From 290e1d4e87da4b197d004f6855e26a9b634f4b3b Mon Sep 17 00:00:00 2001 From: zephyrus Date: Wed, 20 Aug 2008 19:48:35 +0000 Subject: - Do not trigger event if killed by script at all. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13099 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/map/mob.c b/src/map/mob.c index 0bd3c837f..4f90a7c2b 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2297,16 +2297,16 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) if( !md->sc.data[SC_KAIZEL] ) { // Only trigger event on final kill + md->status.hp = 0; //So that npc_event invoked functions KNOW that mob is dead + if( src ) + switch( src->type ) + { + case BL_PET: sd = ((TBL_PET*)src)->msd; break; + case BL_HOM: sd = ((TBL_HOM*)src)->master; break; + } + if( md->npc_event[0] && !md->state.npc_killmonster ) { - md->status.hp = 0; //So that npc_event invoked functions KNOW that I am dead. - if( src ) - switch( src->type ) - { - case BL_PET: sd = ((TBL_PET*)src)->msd; break; - case BL_HOM: sd = ((TBL_HOM*)src)->master; break; - } - if( sd && battle_config.mob_npc_event_type ) { pc_setglobalreg(sd,"killerrid",sd->bl.id); @@ -2319,14 +2319,14 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) } else npc_event_do(md->npc_event); - - md->status.hp = 1; } - else if( mvp_sd ) + else if( mvp_sd && !md->state.npc_killmonster ) { pc_setglobalreg(mvp_sd,"killedrid",md->class_); npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance] } + + md->status.hp = 1; } if(md->deletetimer!=-1) { -- cgit v1.2.3-70-g09d2