summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-06 14:16:22 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-06 14:16:22 +0000
commita4c18091b9e8f93d5cb3524039c7950faaf9b94b (patch)
tree466bfe8e5e98a58deccb809deade0ae3cb9ec3c8 /src/map/mob.c
parent56a66e3f3e6bbfa77d4558b309d563cbd915c83e (diff)
downloadhercules-a4c18091b9e8f93d5cb3524039c7950faaf9b94b.tar.gz
hercules-a4c18091b9e8f93d5cb3524039c7950faaf9b94b.tar.bz2
hercules-a4c18091b9e8f93d5cb3524039c7950faaf9b94b.tar.xz
hercules-a4c18091b9e8f93d5cb3524039c7950faaf9b94b.zip
- 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
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c17
1 files changed, 8 insertions, 9 deletions
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;i<DAMAGELOG_SIZE && md->dmglog[i].id;i++)
+ for(temp=0,i=0,mvp_damage=0;i<DAMAGELOG_SIZE && md->dmglog[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]