Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!, Remcon

Members: 1
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Archery
Forum Rules | Mark all | Recent Posts

Archery
< Newer Topic :: Older Topic > Hmm... bad for players?

Pages:<< prev 1 next >>
Post is unread #1 May 18, 2005, 9:59 am   Last edited May 18, 2005, 10:08 am by Txzeenath
Go to the top of the page
Go to the bottom of the page

Txzeenath
Apprentice
GroupMembers
Posts86
JoinedJul 24, 2004

Yes.. I know I am annoying :-p

but in archery.c, there's this piece of code:

   if( vch )
   {
      if( !CAN_PKILL( vch ) || !CAN_PKILL( ch ) )
      {
         send_to_char( "You can't do that!\n\r", ch );
         return rNONE;
      }
      if( vch && is_safe( ch, vch ) )
         return rNONE;
   }
   was_in_room = ch->in_room;



Now CAN_PKILL simply means IS_PKILL ... so if either of them is a non-pkill character, than they can't use ranged attacks at all, even on mobs.. and since CAN_PKILL and IS_PKILL don't use a second argument to check against levels at all, it will always return TRUE if they are pkill and FALSE if they are peaceful, I modified this to the following.. it may not be the best, but it works.

   if( vch && is_safe(ch, vch))
         return rNONE;

   was_in_room = ch->in_room;

This way, all players can use ranged weapons normally, as the is_safe code checks for safe rooms, illegal pkills, npc/non-npc, etc and also sends messages if their actions are not allowed.


Now if you're not much for the whole open pkill thing, and want to make it so that pkill and peaceful can't shoot eachother, than you can use this to achieve that... correct me if I did a typo anywhere:
   if( vch )
   {
      if(!IS_NPC(vch) && !in_arena(vch) && (!CAN_PKILL( vch ) && CAN_PKILL( ch )) || (!CAN_PKILL(ch) && CAN_PKILL(vch) )
      {
         send_to_char( "You can't do that!\n\r", ch );
         return rNONE;
      }
      if( vch && is_safe( ch, vch ) )
         return rNONE;
   }
   was_in_room = ch->in_room;


----EDIT----
After looking around it seems that alot of the code has pkill restricted will hard coded checks with a return, instead of allowing the attack and reporting it... guess it's a matter of opinion :-p Looks like it's time for me to reinstate the "bad-guy" flags.
       
Pages:<< prev 1 next >>