[CODE] Slay

From: TDRD (tdlord@ELITE.NET)
Date: 08/05/98


I have no idea if this has been used before or not, but it's something I
came up with a while back... Maybe it'll make things more clear for some.
Title:  Implementor Slay command
Function:  Provides a way for implementors to fight mobs.
Author:  Robert Dylina
Network alias: tdlord
MUD alias: Shaidar
Email:  tdlord@elite.net & shaidar@muds.org
MUD compatibility:  Designed for CircleMudbpl11

        I know you can start a fight with a mob by casting a violence
spell, but I don't wanna have to!  So I made this.  It edits the do_kill
command so that you can type kill fido and you will fight the fido.  Yet
there is a new command called "slay" that lets you still instantly kill a
mob or player. "slay" will not let you kill a player.  If you want to kill
a player use the command "pslay". ;)  Lemme know at the above email
address if you are using my code so I know it's in use.  Etc. Peace out!

---in act.offensive.c---
Down at the very bottom put:

/* slay for impl by tdlord */
ACMD(do_slay)
{
 struct char_data *vict;
    one_argument(argument, arg);
    if(!*arg){
    act("Slay what?",FALSE,ch,0,0,TO_CHAR);
    return;
    }
    if(!(vict = get_char_room_vis(ch, arg))){
      act("Hey, that mob isn't here!",FALSE, ch,0,0,TO_CHAR);
      return;
      } else {

    if(!IS_NPC(vict)){
    act("Use pslay to kill a player.",FALSE,ch,0,0,TO_CHAR);
        } else {
    act("You chop $M to pieces!  Ah!  The blood!", FALSE, ch,0,vict,TO_CHAR);
    act("$N chops you to pieces!", FALSE, vict, 0, ch, TO_CHAR);

    act("$n brutally slays $N!", FALSE, ch, 0, vict, TO_NOTVICT);
    raw_kill(vict);
  }
 }
}
/* pslay for impl by tdlord */
ACMD(do_pslay)
{
 struct char_data *vict;
    one_argument(argument, arg);
    if(!*arg){
    act("Slay who?",FALSE,ch,0,0,TO_CHAR);
    return;
    }
    if(!(vict = get_char_room_vis(ch, arg))){
    act("Hey, that player isn't here!",FALSE,ch,0,0,TO_CHAR);
    return;
    } else {
    if(IS_NPC(vict)){
    act("Use slay to kill a mobile.",FALSE,ch,0,0,TO_CHAR);
    return;
    } else {
    act("You chop $M to pieces!  Ah!  The blood!", FALSE,ch,0,vict,TO_CHAR);
    act("$N chops you to pieces!", FALSE, vict, 0, ch, TO_CHAR);
    act("$n brutally slays $N!", FALSE, ch, 0, vict, TO_NOTVICT);
    raw_kill(vict);
   }
  }
}

After:
  if (!(vict = get_char_room_vis(ch, arg)))
      send_to_char("They aren't here.\r\n", ch);
    else if (ch == vict)
      send_to_char("Your mother would be so sad.. :(\r\n", ch);


Remove:
   else {
    act("You chop $M to pieces!  Ah!  The blood!", FALSE, ch, 0, vict,TO_CHAR
    act("$N chops you to pieces!", FALSE, vict, 0, ch, TO_CHAR);
    act("$n brutally slays $N!", FALSE, ch, 0, vict, TO_NOTVICT);
    raw_kill(vict);
   }

---in interpreter.c---
Somewhere in the ACMD's place:
ACMD(do_slay);
ACMD(do_pslay);

Down in the area with the {}'s place in the correct alphabetic order:
  { "pslay"    , POS_FIGHTING, do_pslay    , LVL_IMPL, 0 },
  { "slay"     , POS_FIGHTING, do_slay     , LVL_IMPL, 0},


Copyright (C) 1996,97,98 Robert Dylina.


______________________________ __ _  _
|TDRD tdlord@elite.net
|QuakeWorld TF2.7 PUBLIC: quake.elite.net  ten.bigcity.net
|Irc : irc.elite.net irc.lowrider.com
|MUD : mud.elite.net 4000 HaqMUD
|Clan Epidemic
|Clan Infinity


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST