diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-10-25 14:44:14 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-10-25 14:44:14 +0000 |
commit | bbb2671566dada63d7a34616f93e66b18d91ef44 (patch) | |
tree | 76771200cd114f2d1cf01615879c3348c9c0a47b /src/map/party.c | |
parent | 25e3d584866b386b37232320457e6cf1bdcf3d87 (diff) | |
download | hercules-bbb2671566dada63d7a34616f93e66b18d91ef44.tar.gz hercules-bbb2671566dada63d7a34616f93e66b18d91ef44.tar.bz2 hercules-bbb2671566dada63d7a34616f93e66b18d91ef44.tar.xz hercules-bbb2671566dada63d7a34616f93e66b18d91ef44.zip |
- Made the exp bonus settings be adjustable:
- exp_bonus_attacker: Indicates how much additional exp a mob gives per additional attacker (eg: 10 -> +10%*attacker)
- exp_bonus_max_attacker: Indicates at which number of attackers the bonus is capped (eg: 5 -> 5 attackers, so a mob yield the same exp whether 5 or 10 people attack it)
- Changed the way the party_even_share_bonus setting works. It now uses a simple linear bonus increase (eg: 10 -> +10%*party member)
- The defaults are as explained by Tharis: +25%/attacker, capped at 12 attackers, no party bonus.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9067 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/party.c')
-rw-r--r-- | src/map/party.c | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/src/map/party.c b/src/map/party.c index a119d5287..0799b5215 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -707,7 +707,7 @@ int party_exp_share(struct party_data *p,struct block_list *src,unsigned int bas {
struct map_session_data* sd[MAX_PARTY];
int i;
- unsigned short c, bonus =100; // modified [Valaris]
+ unsigned short c;
nullpo_retr(0, p);
@@ -719,32 +719,44 @@ int party_exp_share(struct party_data *p,struct block_list *src,unsigned int bas }
if (c < 1)
return 0;
- if (battle_config.party_even_share_bonus) //Valaris's even share exp bonus equation.
- bonus += (battle_config.party_even_share_bonus*c*(c-1)/10); //Changed Valaris's bonus switch to an equation [Skotlex]
- else //Official kRO/iRO sites state that the even share bonus is 10% per additional party member.
- bonus += (c-1)*10;
base_exp/=c;
job_exp/=c;
- if (base_exp/100 > UINT_MAX/bonus)
- base_exp= UINT_MAX; //Exp overflow
- else if (base_exp > 10000)
- base_exp = (base_exp/100)*bonus; //Calculation overflow protection
- else
- base_exp = base_exp*bonus/100;
-
- if (job_exp/100 > UINT_MAX/bonus)
- job_exp = UINT_MAX;
- else if (job_exp > 10000)
- job_exp = (job_exp/100)*bonus;
- else
- job_exp = job_exp*bonus/100;
+ zeny/=c;
+
+ if (battle_config.party_even_share_bonus && c > 1) {
+ unsigned short bonus =100 + battle_config.party_even_share_bonus*(c-1);
+ if (base_exp) {
+ if (base_exp/100 > UINT_MAX/bonus)
+ base_exp= UINT_MAX; //Exp overflow
+ else if (base_exp > 10000)
+ base_exp = (base_exp/100)*bonus; //Calculation overflow protection
+ else
+ base_exp = base_exp*bonus/100;
+ }
+ if (job_exp) {
+ if (job_exp/100 > UINT_MAX/bonus)
+ job_exp = UINT_MAX;
+ else if (job_exp > 10000)
+ job_exp = (job_exp/100)*bonus;
+ else
+ job_exp = job_exp*bonus/100;
+ }
+ if (zeny) {
+ if (zeny/100 > UINT_MAX/bonus)
+ zeny = UINT_MAX;
+ else if (zeny > 10000)
+ zeny = (zeny/100)*bonus;
+ else
+ zeny = zeny*bonus/100;
+ }
+ }
for (i = 0; i < c; i++)
{
pc_gainexp(sd[i], src, base_exp, job_exp);
- if (battle_config.zeny_from_mobs) // zeny from mobs [Valaris]
- pc_getzeny(sd[i],bonus*zeny/(c*100));
+ if (zeny) // zeny from mobs [Valaris]
+ pc_getzeny(sd[i],zeny);
}
return 0;
}
|