[Circle] Assassin spec_proc....NEW VERSION! (woohoo!)

From: Ryan A.J. Biggs (ae744@freenet.toronto.on.ca)
Date: 07/28/96


Ok, here's the latest version of the assassin spec_proc.  I haven't 
written docs for it yet (as I don't know if it works yet)  If you use 
this code and it blows up in your face, try and find where it blew up, 
and why.  I will try and figure it out.  Unless you can loan me a site to 
test out the code, I can't do the debugging myself (and my computer is 
not fast enough, nor have enough HD space to run Linux or any UNIX for 
that matter)  I am not responsible for murdered players with this code, 
and this version will NOT send a message tothe player if they succeed or 
not.  Why?  Well, until I can figure out how to get the system to send 
mud-mail automatically, I do not want to have the sanity checks to see if 
the hiring player is even online.

Here we go......

#define ASSASSIN_PRICE(as) (GET_LEVEL(as) * 100000)

SPECIAL(assassin)
{
  int as_loc;
  struct char_data *as, *vict;

  as_loc = ch->in_room + 1;

  if (CMD_IS("list")) {
    send_to_char("Available assassins are:\r\n", ch);
    for (as = world[real_room(as_loc)].people;as;as = as->next_in_room) {
      sprintf(buf, "%8d - %s\r\n", ASSASSIN_PRICE(as), GET_NAME(as));
      send_to_char(buf, ch);
    }
    return 1;
  } else if (CMD_IS("hire")) {
    two_arguments(argument, buf, buf2);
    if(!*buf) {
      send_to_char("Hire who?\r\n", ch);
      return 1;
    }
    if (!(as = get_char_room(buf, real_room(as_loc)))) {
      send_to_char("There is nobody called that!\r\n", ch);
      return 1;
    }
    if(!IS_NPC(as)) {
      send_to_char("GET THE HELL OUT OF THAT ROOM, NOW !!!\r\n", as);
      sprintf(buf, "%s is in the assassin store room.\r\n", GET_NAME(as));
      mudlog(buf, BRF, LVL_IMMORT, TRUE);
      send_to_char("You can't hire players.\r\n", ch);
      return 1;
    }
    if (!*buf2) {
      send_to_char("Whom do want dead?\r\n", ch);
      return 1;
    }
    if (GET_GOLD(ch) < ASSASSIN_PRICE(as)) {
      send_to_char("You don't have enough gold!\r\n", ch);
      return 1;
    }
    if ((vict = get_player_vis(as, buf2, 0))) {
      GET_GOLD(ch) -= ASSASSIN_PRICE(as);
      as = read_mobile(GET_MOB_RNUM(as), REAL);
      char_to_room(as, ch->in_room);
      SET_BIT(MOB_FLAGS(as), MOB_ASSASSIN);
      SET_BIT(MOB_FLAGS(as), MOB_HUNTER);
      remember(as, vict);
      HUNTING(as) = vict;
      ASSASSIN(vict) = as;
      SET_BIT(AFF_FLAGS(vict), AFF_MARK);
      send_to_char("We cannot contact you if the job succeeds or 
not...security reasons.\r\n", ch);
      act("$n hires $N for a job.", FALSE, ch, 0, as, TO_ROOM);
      return 1;
    } else {
      send_to_char("The assassin can't find the mark!\r\n", ch);
      return 1;
    }
  }
  return 1;
}



--in interpreter.c in nanny() in CON_MENU before 
"char_to_room(d->character, load_room)"
add in a struct char_data *as;
    if (IS_AFFECTED(d->character, AFF_MARK)) {
      as = read_mobile(AS_RNUM(d->character), REAL);
      char_to_room(as, AS_ROOM(d->character));
      SET_BIT(MOB_FLAGS(as), MOB_ASSASSIN);
      SET_BIT(MOB_FLAGS(as), MOB_HUNTER);
      remember(as, vict);
      HUNTING(as) = vict;
      ASSASSIN(d->character) = as;
    }

--in act.other.c in do_quit after the send_to_char("Good bye....
  AS_ROOM(ch) = AS_MOB_ROOM(ch);
  AS_RNUM(ch) = AS_MOB_RNUM(ch);
  extract_char(ASSASSIN(ch));

--in structs.h in char_special_data, after *hunting add
    struct char_data *assassin;
--in structs.h, in player_special_data_saved, change 2 of the spare int's to
  int as_room;
  int as_rnum;
--in structs.h add in wherever there is room
  MOB_ASSASSIN
  MOB_HUNTING
  AFF_MARK

--in utils.h add in
  #define ASSASSIN(ch)  ((ch)->char_specials.assassin)
  #define AS_ROOM(ch)   ((ch)->player_specials->saved.as_room)
  #define AS_RNUM(ch)   ((ch)->player_specials->saved.as_rnum)
  #define AS_MOB_ROOM(ch)  (ASSASSIN(ch)->in_room)
  #define AS_MOB_RNUM(ch)  (ASSASSIN(ch)->nr)



------------------------------------------------------------------
Ryan A.J. Biggs    email-ae744@freenet.toronto.on.ca
Doppleganger, Charon the Boatman and member of Dieties Anonymous
Owner of a 100% organic wibble and Plasma lamp, and rubber chicken
Keeper of the sacred butcher knife and the Cloak of Shadows
Compiler of the Net.Psionics.Handbook
------------------------------------------------------------------


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



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