diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-08-22 20:42:41 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-08-22 20:42:41 +0000 |
commit | aaae6dec0ddd990ee60635ce95adce29af260966 (patch) | |
tree | 74f235b5a4a4365c900dac3fc8845fac53866e66 /src/map/mob.c | |
parent | c4d44be7aab68d00388bcdae85cc73e730635b87 (diff) | |
download | hercules-aaae6dec0ddd990ee60635ce95adce29af260966.tar.gz hercules-aaae6dec0ddd990ee60635ce95adce29af260966.tar.bz2 hercules-aaae6dec0ddd990ee60635ce95adce29af260966.tar.xz hercules-aaae6dec0ddd990ee60635ce95adce29af260966.zip |
Fixed bugreport:6536 when a monster is killed by a assist of yours it now updates quests (homunculus, mercenary, elemental). Also, fixed taekwon mission not to count kills for when you kill a monster's fake version (e.g. shinobi under that rebirth spell) -- avoids exploit.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16689 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r-- | src/map/mob.c | 67 |
1 files changed, 30 insertions, 37 deletions
diff --git a/src/map/mob.c b/src/map/mob.c index c56eca2eb..88ee88713 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2137,24 +2137,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) if(src && src->type == BL_MOB) mob_unlocktarget((struct mob_data *)src,tick); - if( sd ) { - if( sd->mission_mobid == md->class_) { //TK_MISSION [Skotlex] - if( ++sd->mission_count >= 100 && (temp = mob_get_random_id(0, 0xE, sd->status.base_level)) ) - { - pc_addfame(sd, 1); - sd->mission_mobid = temp; - pc_setglobalreg(sd,"TK_MISSION_ID", temp); - sd->mission_count = 0; - clif_mission_info(sd, temp, 0); - } - pc_setglobalreg(sd,"TK_MISSION_COUNT", sd->mission_count); - } - if( sd->status.party_id ) - map_foreachinrange(quest_update_objective_sub,&md->bl,AREA_SIZE,BL_PC,sd->status.party_id,md->class_); - else if( sd->avail_quests ) - quest_update_objective(sd, md->class_); - } - // filter out entries not eligible for exp distribution memset(tmpsd,0,sizeof(tmpsd)); for(i = 0, count = 0, mvp_damage = 0; i < DAMAGELOG_SIZE && md->dmglog[i].id; i++) @@ -2555,37 +2537,48 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) mvp_sd = NULL; rebirth = ( md->sc.data[SC_KAIZEL] || (md->sc.data[SC_REBIRTH] && !md->state.rebirth) ); - if( !rebirth ) - { // Only trigger event on final kill + if( !rebirth ) { // 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 ) - { + if( src ) { + switch( src->type ) { case BL_PET: sd = ((TBL_PET*)src)->msd; break; case BL_HOM: sd = ((TBL_HOM*)src)->master; break; case BL_MER: sd = ((TBL_MER*)src)->master; break; + case BL_ELEM: sd = ((TBL_ELEM*)src)->master; break; } + } - if( sd && sd->md && src && src->type != BL_HOM && mob_db(md->class_)->lv > sd->status.base_level/2 ) - mercenary_kills(sd->md); + if( sd ) { + if( sd->mission_mobid == md->class_) { //TK_MISSION [Skotlex] + if( ++sd->mission_count >= 100 && (temp = mob_get_random_id(0, 0xE, sd->status.base_level)) ) { + pc_addfame(sd, 1); + sd->mission_mobid = temp; + pc_setglobalreg(sd,"TK_MISSION_ID", temp); + sd->mission_count = 0; + clif_mission_info(sd, temp, 0); + } + pc_setglobalreg(sd,"TK_MISSION_COUNT", sd->mission_count); + } + + if( sd->status.party_id ) + map_foreachinrange(quest_update_objective_sub,&md->bl,AREA_SIZE,BL_PC,sd->status.party_id,md->class_); + else if( sd->avail_quests ) + quest_update_objective(sd, md->class_); + + if( sd->md && src && src->type != BL_HOM && mob_db(md->class_)->lv > sd->status.base_level/2 ) + mercenary_kills(sd->md); + } - if( md->npc_event[0] && !md->state.npc_killmonster ) - { - if( sd && battle_config.mob_npc_event_type ) - { + if( md->npc_event[0] && !md->state.npc_killmonster ) { + if( sd && battle_config.mob_npc_event_type ) { pc_setparam(sd, SP_KILLERRID, sd->bl.id); npc_event(sd,md->npc_event,0); - } - else if( mvp_sd ) - { + } else if( mvp_sd ) { pc_setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0); npc_event(mvp_sd,md->npc_event,0); - } - else + } else npc_event_do(md->npc_event); - } - else if( mvp_sd && !md->state.npc_killmonster ) - { + } else if( mvp_sd && !md->state.npc_killmonster ) { pc_setparam(mvp_sd, SP_KILLEDRID, md->class_); npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance] } |