- 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://svn.code.sf.net/p/rathena/svn/trunk@9067 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-10-25 14:44:14 +00:00
parent 274bcb4fa0
commit 71601f58b3
10 changed files with 80 additions and 30 deletions

View File

@ -4,6 +4,17 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
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/25 2006/10/25
- Made the exp bonus settings be adjustable: [Skotlex]
- 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. The first two can be found in exp.conf, the last
one was left in party.conf
* MG_STONECURSE and NPC_PETRIFYATTACK now use time1 to specify the * MG_STONECURSE and NPC_PETRIFYATTACK now use time1 to specify the
"petrifying time". This value has been set to 5 seconds. [Skotlex] "petrifying time". This value has been set to 5 seconds. [Skotlex]
* Now when SC_STONE is triggered from status-change cards, it's petrifying * Now when SC_STONE is triggered from status-change cards, it's petrifying

View File

@ -1,5 +1,10 @@
Date Added Date Added
2006/10/25
* Added exp-bonus settings exp_bonus_attacker and exp_bonus_max_attacker
(exp.conf, default to 25 and 12) [Skotlex]
* Changed the way the party_even_share_bonus setting works. It now uses a
simple linear bonus increase (party.conf) [Skotlex]
2006/10/24 2006/10/24
* Changed the way the skill_steal_max_tries work. Now it actually MEANS the * Changed the way the skill_steal_max_tries work. Now it actually MEANS the
max number of steal tries, use 0 to disable (unlimited tries). [Skotlex] max number of steal tries, use 0 to disable (unlimited tries). [Skotlex]

View File

@ -49,6 +49,15 @@ max_exp_gain_rate: 0
//1 - eAthena's (uses damage given / max_hp as damage ratio) //1 - eAthena's (uses damage given / max_hp as damage ratio)
exp_calc_type: 0 exp_calc_type: 0
//Experience increase per attacker. That is, every additional attacker to the
// monster makes it give this much more experience
// (eg: 5 people attack with 25 here, +25*4% -> +100% exp)
exp_bonus_attacker: 25
//Max number of attackers at which exp bonus is capped
// (eg: if set at 5, the max bonus is 4*bonus-per-char regardless of attackers)
exp_bonus_max_attacker: 12
// MVP bonus exp rate. (Note 2) (Note 3) // MVP bonus exp rate. (Note 2) (Note 3)
mvp_exp_rate: 100 mvp_exp_rate: 100

View File

@ -57,11 +57,8 @@ party_item_share_type: 0
// A character's idle status is reset upon item use/skill use/attack (auto attack counts too)/movement. // A character's idle status is reset upon item use/skill use/attack (auto attack counts too)/movement.
idle_no_share: no idle_no_share: no
// Use the alternate experience even share bonus equation? // Give additional experience bonus per party-member involved on even-share parties?
// When multiple characters even share experience within a party, there's an experience bonus of 10% per additional teammate. // (eg: If set to 10, a even-share party of 5 people will receive +40% exp)
// Setting this to other than 0 uses a different experience bonus equation of the form: bonus*c*(c-1)/10 (where c is the total
// count of players to share experience). With bonus = 25 in a full party (c = 12) the total bonus is +25*12*11/10 = +330%,
// which means the total exp gained is 430% of the original, and each party member receives ~35% of the original mob's experience.
party_even_share_bonus: 0 party_even_share_bonus: 0
// If a party uses a skill with penalties do they apply? (Note 1) // If a party uses a skill with penalties do they apply? (Note 1)

View File

@ -60,7 +60,7 @@ int mapif_homunculus_deleted(int fd, int flag)
return 0; return 0;
} }
int mapif_homunculus_created(int fd, int account_id, struct s_homunculus *sh, short flag) int mapif_homunculus_created(int fd, int account_id, struct s_homunculus *sh, unsigned char flag)
{ {
WFIFOHEAD(fd, sizeof(struct s_homunculus)+9); WFIFOHEAD(fd, sizeof(struct s_homunculus)+9);
WFIFOW(fd,0) = 0x3890; WFIFOW(fd,0) = 0x3890;

View File

@ -3709,6 +3709,8 @@ static const struct battle_data_short {
{ "motd_type", &battle_config.motd_type}, // [celest] { "motd_type", &battle_config.motd_type}, // [celest]
{ "finding_ore_rate", &battle_config.finding_ore_rate}, // [celest] { "finding_ore_rate", &battle_config.finding_ore_rate}, // [celest]
{ "exp_calc_type", &battle_config.exp_calc_type}, // [celest] { "exp_calc_type", &battle_config.exp_calc_type}, // [celest]
{ "exp_bonus_attacker", &battle_config.exp_bonus_attacker}, // [Skotlex]
{ "exp_bonus_max_attacker", &battle_config.exp_bonus_max_attacker}, // [Skotlex]
{ "min_skill_delay_limit", &battle_config.min_skill_delay_limit}, // [celest] { "min_skill_delay_limit", &battle_config.min_skill_delay_limit}, // [celest]
{ "default_skill_delay", &battle_config.default_skill_delay}, // [Skotlex] { "default_skill_delay", &battle_config.default_skill_delay}, // [Skotlex]
{ "no_skill_delay", &battle_config.no_skill_delay}, // [Skotlex] { "no_skill_delay", &battle_config.no_skill_delay}, // [Skotlex]
@ -4143,6 +4145,8 @@ void battle_set_defaults() {
battle_config.castrate_dex_scale = 150; battle_config.castrate_dex_scale = 150;
battle_config.area_size = 14; battle_config.area_size = 14;
battle_config.exp_calc_type = 1; battle_config.exp_calc_type = 1;
battle_config.exp_bonus_attacker = 25;
battle_config.exp_bonus_max_attacker = 12;
battle_config.min_skill_delay_limit = 100; battle_config.min_skill_delay_limit = 100;
battle_config.default_skill_delay = 300; //Default skill delay according to official servers. battle_config.default_skill_delay = 300; //Default skill delay according to official servers.
battle_config.no_skill_delay = BL_MOB; battle_config.no_skill_delay = BL_MOB;
@ -4351,6 +4355,9 @@ void battle_validate_conf() {
if (battle_config.min_skill_delay_limit < 10) if (battle_config.min_skill_delay_limit < 10)
battle_config.min_skill_delay_limit = 10; // minimum delay of 10ms battle_config.min_skill_delay_limit = 10; // minimum delay of 10ms
if (battle_config.exp_bonus_max_attacker < 2)
battle_config.exp_bonus_max_attacker = 2;
if (battle_config.no_spawn_on_player > 100) if (battle_config.no_spawn_on_player > 100)
battle_config.no_spawn_on_player = 100; battle_config.no_spawn_on_player = 100;
if (battle_config.mob_remove_delay < 15000) //Min 15 sec if (battle_config.mob_remove_delay < 15000) //Min 15 sec

View File

@ -359,6 +359,8 @@ extern struct Battle_Config {
unsigned short motd_type; // [celest] unsigned short motd_type; // [celest]
unsigned short finding_ore_rate; // orn unsigned short finding_ore_rate; // orn
unsigned short exp_calc_type; unsigned short exp_calc_type;
unsigned short exp_bonus_attacker;
unsigned short exp_bonus_max_attacker;
unsigned short min_skill_delay_limit; unsigned short min_skill_delay_limit;
unsigned short default_skill_delay; unsigned short default_skill_delay;
unsigned short no_skill_delay; unsigned short no_skill_delay;

View File

@ -1807,8 +1807,13 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
//eAthena's exp formula based on max hp. //eAthena's exp formula based on max hp.
per = (double)md->dmglog[i].dmg/(double)status->max_hp; per = (double)md->dmglog[i].dmg/(double)status->max_hp;
if (count>1) if (count>1 && battle_config.exp_bonus_attacker) {
per *= (9.+(double)((count > 6)? 6:count))/10.; //attackers count bonus. //Exp bonus per additional attacker.
if (count > battle_config.exp_bonus_max_attacker)
count = battle_config.exp_bonus_max_attacker;
count--;
per += per*(count*battle_config.exp_bonus_attacker)/100.;
}
if(md->special_state.size==1) // change experience for different sized monsters [Valaris] if(md->special_state.size==1) // change experience for different sized monsters [Valaris]
per /=2.; per /=2.;
@ -2053,8 +2058,10 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
//mapflag: noexp check [Lorky] //mapflag: noexp check [Lorky]
if (map[md->bl.m].flag.nobaseexp) if (map[md->bl.m].flag.nobaseexp)
exp =1; exp =1;
else else {
exp = (double)md->db->mexp * (9+count)/10.; //[Gengar] exp = md->db->mexp;
exp += exp*(battle_config.exp_bonus_attacker*count)/100.; //[Gengar]
}
mexp = (exp > UINT_MAX)?UINT_MAX:(exp<1?1:(unsigned int)exp); mexp = (exp > UINT_MAX)?UINT_MAX:(exp<1?1:(unsigned int)exp);

View File

@ -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]; struct map_session_data* sd[MAX_PARTY];
int i; int i;
unsigned short c, bonus =100; // modified [Valaris] unsigned short c;
nullpo_retr(0, p); 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) if (c < 1)
return 0; 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; base_exp/=c;
job_exp/=c; job_exp/=c;
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) if (base_exp/100 > UINT_MAX/bonus)
base_exp= UINT_MAX; //Exp overflow base_exp= UINT_MAX; //Exp overflow
else if (base_exp > 10000) else if (base_exp > 10000)
base_exp = (base_exp/100)*bonus; //Calculation overflow protection base_exp = (base_exp/100)*bonus; //Calculation overflow protection
else else
base_exp = base_exp*bonus/100; base_exp = base_exp*bonus/100;
}
if (job_exp) {
if (job_exp/100 > UINT_MAX/bonus) if (job_exp/100 > UINT_MAX/bonus)
job_exp = UINT_MAX; job_exp = UINT_MAX;
else if (job_exp > 10000) else if (job_exp > 10000)
job_exp = (job_exp/100)*bonus; job_exp = (job_exp/100)*bonus;
else else
job_exp = job_exp*bonus/100; 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++) for (i = 0; i < c; i++)
{ {
pc_gainexp(sd[i], src, base_exp, job_exp); pc_gainexp(sd[i], src, base_exp, job_exp);
if (battle_config.zeny_from_mobs) // zeny from mobs [Valaris] if (zeny) // zeny from mobs [Valaris]
pc_getzeny(sd[i],bonus*zeny/(c*100)); pc_getzeny(sd[i],zeny);
} }
return 0; return 0;
} }

View File

@ -7886,7 +7886,7 @@ int skill_check_condition (struct map_session_data *sd, int skill, int lv, int t
itemid[i] = skill_db[j].itemid[i]; itemid[i] = skill_db[j].itemid[i];
amount[i] = skill_db[j].amount[i]; amount[i] = skill_db[j].amount[i];
} }
if(mhp > 0 && 100 * status->hp / status->max_hp > mhp) { if(mhp > 0 && 100 * status->hp / status->max_hp > (unsigned int) mhp) {
//mhp is the max-hp-requirement, that is, //mhp is the max-hp-requirement, that is,
//you must have this % or less of HP to cast it. //you must have this % or less of HP to cast it.
clif_skill_fail(sd,skill,2,0); clif_skill_fail(sd,skill,2,0);