From a4c18091b9e8f93d5cb3524039c7950faaf9b94b Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 6 Jun 2006 14:16:22 +0000 Subject: - cleaned up status_check_skilluse some to use status_data variables. - Fixed mvp-exp calculations being messed up with more than one attacker. - Changed the mob exp race bonus so that each player gets their own bonus, rather than the killer's bonus applying to everyone. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7003 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mob.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/map/mob.c') diff --git a/src/map/mob.c b/src/map/mob.c index 5dd5008ff..85e50fdf0 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -1723,9 +1723,8 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) } } - for(temp=0,i=0,count=0,mvp_damage=0;idmglog[i].id;i++) + for(temp=0,i=0,mvp_damage=0;idmglog[i].id;i++) { - count++; //Count an attacker even if he is dead/logged-out. tmpsd[temp] = map_charid2sd(md->dmglog[i].id); if(tmpsd[temp] == NULL) continue; @@ -1733,13 +1732,14 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) continue; temp++; - if(mvp_damage<(unsigned int)md->dmglog[temp].dmg){ + if(mvp_damage<(unsigned int)md->dmglog[i].dmg){ third_sd = second_sd; second_sd = mvp_sd; mvp_sd=tmpsd[temp]; - mvp_damage=md->dmglog[temp].dmg; + mvp_damage=md->dmglog[i].dmg; } } + count = i; //Total number of attackers. if(!(type&2) && //No exp (!map[md->bl.m].flag.pvp || battle_config.pvp_exp) && //Pvp no exp rule [MouseJstr] @@ -1773,11 +1773,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) if (md->sc.data[SC_RICHMANKIM].timer != -1) bonus += md->sc.data[SC_RICHMANKIM].val2; - if(sd) { - if (sd->expaddrace[status->race]) - bonus += sd->expaddrace[status->race]; - bonus += sd->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS]; - } + if (tmpsd[i]->expaddrace[status->race]) + bonus += tmpsd[i]->expaddrace[status->race]; + bonus += tmpsd[i]->expaddrace[status->mode&MD_BOSS?RC_BOSS:RC_NONBOSS]; + if (battle_config.pk_mode && (int)(md->db->lv - tmpsd[i]->status.base_level) >= 20) //Needed due to unsigned checks bonus += 15; // pk_mode additional exp if monster >20 levels [Valaris] -- cgit v1.2.3-60-g2f50