void death( char_data* victim, char_data* ch, char* dt ) { char tmp [ TWO_LINES ]; obj_data* corpse; content_array* where = victim->array; char_data* rch; bool survive; remove_bit( &victim->status, STAT_BERSERK ); if( ch == NULL ) for( int i = 0; i < *where; i++ ) if( ( rch = character( where->list[i] ) ) != NULL && includes( rch->aggressive, victim ) ) { ch = rch; break; } stop_fight( victim ); clear_queue( victim ); if( !can_die( victim ) ) return; disburse_exp( victim ); register_death( victim, ch, dt ); clear_queue( victim ); death_cry( victim ); if( survive = !die_forever( victim ) ) raw_kill( victim ); corpse = make_corpse( victim, where ); loot_corpse( corpse, ch, victim ); if( survive ) return; if( mob( victim ) != NULL ) { victim->Extract( ); return; } sprintf( tmp, "%s's soul is taken by death.", victim->Name( ) ); info( tmp, LEVEL_BUILDER, tmp, IFLAG_DEATHS, 1, victim ); clear_screen( victim ); reset_screen( victim ); send( victim, "Death is surprisingly peaceful.\n\r" ); send( victim, "Good night.\n\r" ); purge( player( victim ) ); }
void raw_kill(struct char_data *ch) { if (ch->specials.fighting) stop_fighting(ch); death_cry(ch); make_corpse(ch); affect_total(ch); extract_char(ch); }
void raw_kill(struct char_data *ch) { if (FIGHTING(ch)) stop_fighting(ch); while (ch->affected) affect_remove(ch, ch->affected); death_cry(ch); make_corpse(ch); extract_char(ch); }
void raw_kill(struct char_data * ch, struct char_data * killer) { if (FIGHTING(ch)) stop_fighting(ch); while (ch->affected) affect_remove(ch, ch->affected); if (killer) { if (death_mtrigger(ch, killer)) death_cry(ch); } else death_cry(ch); make_corpse(ch); extract_char(ch); }
void raw_kill(struct char_data * ch, struct char_data * killer) { if (FIGHTING(ch)) stop_fighting(ch); while (ch->affected) affect_remove(ch, ch->affected); /* To make ordinary commands work in scripts. welcor*/ GET_POS(ch) = POS_STANDING; if (killer) { if (check_hooks(HOOK_CONT_DIED, ch_script_cont(ch), killer, SNull, SNull )) death_cry(ch); } else death_cry(ch); update_pos(ch); make_corpse(ch); extract_char(ch); }
void raw_kill( CHAR_DATA *victim, int absolute ) { int i = 0; /* if(victim->fighting != NULL) { if(victim->fighting->ooc_xp_count < 2) { send_to_char("You learn from your encounter.\n\r", victim->fighting); victim->fighting->exp += 1; } stop_fighting( victim, TRUE ); } */ if(!absolute && victim->race == race_lookup("werewolf") && ((i = dice_rolls(victim, victim->max_RBPG, 8)) > 0 || victim->agghealth > 0)) { bool tag = FALSE; if(victim->health < 0) victim->health = 0; if(victim->agghealth < 0) { victim->agghealth = 0; tag = TRUE; } if(absolute) tag = TRUE; if(tag) { i -= 7 - victim->health; if(i > 0) victim->agghealth += UMIN(7 - victim->agghealth, i); } else while((victim->agghealth + victim->health - 7) <= 0) { if(victim->health >= 7) victim->agghealth++; else victim->health++; } send_to_char("It hurts, but your body starts to heal.\n\r", victim); update_pos(victim, 0); if((victim->agghealth + victim->health - 7) > 0) return; } if(victim->clan == clan_lookup("bone gnawer") && victim->disc[DISC_TRIBE] >= 5 && victim->max_willpower > 0) { victim->max_willpower--; if(victim->willpower > victim->max_willpower) { victim->willpower = victim->max_willpower; } if(victim->health <= 0) victim->health = 1; if(victim->agghealth <= 0) victim->agghealth = 1; while((victim->agghealth + victim->health - 7) <= 0) { if(victim->health >= 7) victim->agghealth++; else victim->health++; } send_to_char("It hurts, but you'll live.\n\r", victim); return; } death_cry( victim ); make_corpse( victim ); if ( IS_NPC(victim) ) { victim->pIndexData->killed++; extract_char( victim, TRUE ); return; } clear_orgs(victim); if(victim->desc) victim->desc->connected = CON_DECEASED; SET_BIT(victim->act, ACT_REINCARNATE); char_from_room(victim); char_from_list(victim); send_to_char("You are DEAD!\n\r[Hit Return to Continue]\n\r", victim); victim->exp = get_points(victim); save_char_obj(victim); return; }
void m_death(struct monster *m) { pob corpse; pml ml; int x; int y; int found = FALSE; m->hp = -1; if(los_p(Player.x, Player.y, m->x, m->y)) { putspot(m->x, m->y, getspot(m->x, m->y, FALSE)); gain_experience(m->xpv); calc_melee(); if(m->uniqueness != COMMON) { strcpy(Str1, m->monstring); } else { strcpy(Str1, "The "); strcat(Str1, m->monstring); } strcat(Str1, " is dead!"); mprint(Str1); } m_dropstuff(m); /* Death */ if(m->id == (ML10 + 0)) { mprint("Death lies sprawled out on the ground..."); mprint("Death laughs ironically and gets back to his feet."); mprint("He gestures and another scythe appears in his hands."); switch(random_range(10)) { case 0: mprint("Death performs a little bow and goes back on guard."); break; case 1: mprint("\'A hit! A palpable hit!\' Death goes back on the attack."); break; case 2: mprint("\'Ah, if only it could be so simple!\' snickers Death."); break; case 3: mprint("\'This fool things he can slay death! What a jest!\' says Death."); break; case 4: mprint("\'You point is well taken.\' says Death, attacking again."); break; case 5: mprint("\'Oh, come now, stop delaying the inevitable.\' says Death."); break; case 6: mprint("\'Your destiny ends here with me.\' says Death, scythe raised."); break; case 7: mprint("\'I almost felt that.\' says Death, smiling."); break; case 8: mprint("\'Timeo Mortis?\' asks Death quizzically, \'Not me!\'"); break; case 9: mprint("Death sighs theatrically. \'They never learn.\'"); break; } strengthen_death(m); } else { Level->site[m->x][m->y].creature = NULL; if(random_range(2) || (m->uniqueness != COMMON)) { corpse = (pob)malloc(sizeof(objtype)); make_corpse(corpse, m); drop_at(m->x, m->y, corpse); } plotspot(m->x, m->y, FALSE); switch(m->id) { case ML0 + 8: /* Hiscore NPC */ switch(m->aux2) { case 0: mprint("You hear a faroff dirge. You feel a sense of triumph."); break; case 1: case 2: case 3: case 4: case 5: case 6: mprint("You hear a faroff sound like angels crying..."); strcpy(Priest[1], nameprint()); Priestbehavior[1] = 2933; break; case 7: mprint("A furtive figure dashes out of the shadows, takes a look at"); mprint("the corpse, and runs away!"); strcpy(Shadowlord, nameprint()); Shadowlordbehavior = 2912; break; case 8: mprint("An aide-de-camp approaches, removes the corpse's insignia,"); mprint("and departs."); strcpy(Commandant, nameprint()); Commandantbehavior = 2912; break; case 9: mprint("An odd glow surrounds the corpse, and slowly fades."); strcpy(Archmage, nameprint()); Archmagebehavior = 2933; break; case 10: mprint("A demon materializes, takes a quick look at the corpse,"); mprint("and teleports away with a faint popping noise."); strcpy(Prime, nameprint()); Primebehavior = 2932; break; case 11: mprint("A sports columnist rushes forward and takes a quick photo"); mprint("of the corpse and rushes off muttering about a deadline."); strcpy(Champion, nameprint()); Championbehavior = 2913; break; case 12: mprint("You hear a fanfare in the distance, and feel dismayed."); strcpy(Duke, nameprint()); Dukebehavior = 2911; break; case 13: if(Player.alignment > 10) { mprint("You feel smug."); } else if(Player.alignment < 10) { mprint("You feel ashamed."); } strcpy(Chaoslord, nameprint()); Chaoslordbehavior = 2912; break; case 14: if(Player.alignment < 10) { mprint("You feel smug."); } else if(Player.alignment > 10) { mprint("You feel ashamed."); } strcpy(Lawlord, nameprint()); Lawlordbehavior = 2911; break; case 15: /* * Just a tad complicated. Promote a new justiciar if * an guards are left in the city, otherwise destroy * the Order! */ Player.alignment -= 100; if(!gamestatusp(DESTROYED_ORDER)) { mprint("In the distance you hear a trumpet. A Servent of Law"); mprint("materializes, sheds a tear, and leaves."); strcpy(Justiciar, nameprint()); Justiciarbehavior = 2911; /* Promote one of the city guards to be justiciar */ ml = City->mlist; while(!found && (ml != NULL)) { if((ml->m->id == (ML0 + 3)) && (ml->m->hp > 0)) { found = 1; } else { found = 0; } if(!found) { ml = ml->next; } } if(ml != NULL) { mprint("A new justiciar has been promoted!"); x = ml->m->x; y = ml->m->y; ml->m->x = x; ml->m->y = y; ml->m->click = (Tick + 1) % 60; m_status_reset(ml->m, AWAKE); m_status_reset(ml->m, HOSTILE); } /* * Will cause order to be destroyed if no guards or justiciar */ alert_guards(); } else { mprint("A Servant of Chaos materializes, grabs the corpse,"); mprint("snickers a bit, and vanishes."); } } break; case ML0 + 3: /* Guard */ Player.alignment -= 10; if((Current_Environment == E_CITY) || (Current_Environment == E_VILLAGE)) { alert_guards(); } break; case ML3 + 5: /* Goblin king */ if(!gamestatusp(ATTACKED_ORACLE)) { mprint("You seem to hear a woman's voice from far off:"); mprint("\'Well don! Come to me now...\'"); } setgamestatus(COMPLETED_CAVES); break; case ML7 + 5: /* Great worm */ if(!gamestatusp(ATTACKED_ORACLE)) { mprint("A female voice sounds from just behind your ear:"); mprint("\'Well fought! I have some new advice for you...\'"); } setgamestatus(COMPLETED_SEWERS); break; case ML10 + 1: setgamestatus(KILLED_EATER); break; case ML10 + 2: setgamestatus(KILLED_LAWBRINGER); break; case ML10 + 3: setgamestatus(KILLED_DRAGONLORD); break; case ML10 + 4: setgamestatus(COMPLETED_VOLCANO); if(!gamestatusp(ATTACKED_ORACLE)) { mprint("You feel a soft touch on your shoulder..."); mprint("You turn around but there is no one there!"); mprint("You turn back and see a not: \'See me soon.\'"); mprint("The note vanishes in a burst of blue fire!"); } break; case ML10 + 9: /* Elemental master */ if(!gamestatusp(ATTACKED_ORACLE)) { mprint("Words appear before you, traced in blue flame!"); mprint("\'Return to the Prime Plane via the Circle of Sorcerors..."); } break; } } dodrawspot(m->x, m->y); }