- Added a check to prevent adding negative damage to the total accumulated damage in mob_damage.

- Implemented the property where the first attacker get's double exp-share than the others. Due to the way exp calculation is done, this bonus will not apply when you use exp_calc_type 1 (damage/max_hp) instead of the default (damage/total-damage). For now this bonus is done after calculating who is the MVP character instead of before.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9107 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-10-31 15:08:07 +00:00
parent 21f49a933c
commit 186798af26
3 changed files with 23 additions and 3 deletions

View File

@ -3,6 +3,15 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK. AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2006/10/31
* Added a check to prevent adding negative damage to the total accumulated
damage in mob_damage. It could fix some exploits, even though mob_damage
should never be invoked with negative damage anyway. [Skotlex]
* Implemented the property where the first attacker get's double exp-share
than the others. Due to the way exp calculation is done, this bonus will
not apply when you use exp_calc_type 1 (damage/max_hp) instead of the
default (damage/total-damage). For now this bonus is done after calculating
who is the MVP character instead of before. [Skotlex]
2006/10/30 2006/10/30
* Fixed a little bug in event enqueue code [Toms] * Fixed a little bug in event enqueue code [Toms]
* Updated the code so mobs can use ChainAction as a targetted skill. * Updated the code so mobs can use ChainAction as a targetted skill.

View File

@ -47,6 +47,8 @@ max_exp_gain_rate: 0
//Method of calculating earned experience when defeating a monster: //Method of calculating earned experience when defeating a monster:
//0 - jAthena's (uses damage given / total damage as damage ratio) //0 - jAthena's (uses damage given / total damage as damage ratio)
//1 - eAthena's (uses damage given / max_hp as damage ratio) //1 - eAthena's (uses damage given / max_hp as damage ratio)
//NOTE: Using type 1 disables the bonus where the first attacker gets
// his share of the exp doubled when multiple people attack the mob.
exp_calc_type: 0 exp_calc_type: 0
//Experience increase per attacker. That is, every additional attacker to the //Experience increase per attacker. That is, every additional attacker to the

View File

@ -1594,14 +1594,15 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
{ {
int char_id = 0, flag = 0; int char_id = 0, flag = 0;
md->tdmg+=damage; //Store total damage...
if(md->guardian_data && md->guardian_data->number < MAX_GUARDIANS) // guardian hp update [Valaris] (updated by [Skotlex]) if(md->guardian_data && md->guardian_data->number < MAX_GUARDIANS) // guardian hp update [Valaris] (updated by [Skotlex])
md->guardian_data->castle->guardian[md->guardian_data->number].hp = md->status.hp; md->guardian_data->castle->guardian[md->guardian_data->number].hp = md->status.hp;
if (battle_config.show_mob_info&3) if (battle_config.show_mob_info&3)
clif_charnameack (0, &md->bl); clif_charnameack (0, &md->bl);
if (damage > 0) //Store total damage...
md->tdmg+=damage;
if (!src) if (!src)
return; return;
@ -1675,7 +1676,8 @@ void mob_damage(struct mob_data *md, struct block_list *src, int damage)
md->dmglog[i].flag= flag; md->dmglog[i].flag= flag;
break; break;
} }
if(md->dmglog[i].dmg<mindmg){ if(md->dmglog[i].dmg<mindmg && i)
{ //Never overwrite first hit slot (he gets double exp bonus)
minpos=i; minpos=i;
mindmg=md->dmglog[i].dmg; mindmg=md->dmglog[i].dmg;
} }
@ -1785,6 +1787,13 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
} }
count = i; //Total number of attackers. count = i; //Total number of attackers.
if(!battle_config.exp_calc_type && count > 1)
{ //Apply first-attacker 200% exp share bonus
//TODO: Determine if this should go before calculating the MVP player instead of after.
md->tdmg += md->dmglog[0].dmg;
md->dmglog[0].dmg<<=1;
}
if(!(type&2) && //No exp if(!(type&2) && //No exp
(!map[md->bl.m].flag.pvp || battle_config.pvp_exp) && //Pvp no exp rule [MouseJstr] (!map[md->bl.m].flag.pvp || battle_config.pvp_exp) && //Pvp no exp rule [MouseJstr]
(!md->master_id || !md->special_state.ai) && //Only player-summoned mobs do not give exp. [Skotlex] (!md->master_id || !md->special_state.ai) && //Only player-summoned mobs do not give exp. [Skotlex]