/* ----- RESTLESS SPIRITS v1.00 This snippet will make about 1 out of 25 mobs you kill return in spirit form to attack you after you kill them. Kinda keeps things interesting. Please send me email if you decide to use this or have any suggestions/improvements. Brian Babey (aka Varen) [bribe@erols.com] http://www.erols.com/bribe/ */ /* ------------------------------------------------------------- merc.h : Declare the function */ void check_spirit args( ( CHAR_DATA *ch, CHAR_DATA *victim ) ); /* ------------------------------------------------------------- fight.c : Insert the call to check_spirit inside of raw_kill, inside the NPC section, just after the line extract_char( victim, TRUE ); */ if ( !IS_SET(victim->form,FORM_UNDEAD)) check_spirit(ch,victim); /* ------------------------------------------------------------- handler.c : Define the function, I just put it at the bottom */ void check_spirit( CHAR_DATA *ch, CHAR_DATA *victim ) { char buf[MAX_STRING_LENGTH]; CHAR_DATA *spirit; /* only happens 1 in 25 times and only to NPCs */ if ( number_range(0,24) != 0 || !IS_NPC(victim)) return; spirit = create_mobile ( victim->pIndexData ); SET_BIT ( spirit->form, FORM_INSTANT_DECAY|FORM_UNDEAD|FORM_INTANGIBLE ); SET_BIT ( spirit->act, ACT_AGGRESSIVE ); SET_BIT ( spirit->affected_by, AFF_PASS_DOOR ); sprintf(buf,"the spirit of %s",victim->short_descr); spirit->short_descr = str_dup(buf); sprintf(buf,"spirit %s",victim->name); spirit->name = str_dup(buf); char_to_room( spirit, ch->in_room ); act("You cower in fear as $N appears before you!",ch,NULL,spirit,TO_CHAR); act("$N suddenly appears and attacks $n!",ch,NULL,spirit,TO_ROOM); multi_hit( spirit, ch, TYPE_UNDEFINED ); return; }