diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-10 18:11:10 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-10 18:11:10 +0000 |
commit | c44e355943ad24235aceb6bd2157544bdf46ba64 (patch) | |
tree | 03da679cfae3127a81928033b127886fde9b6d9d /src | |
parent | e6d726f486b00d443320269a96a0e6d9a12d8d38 (diff) | |
download | hercules-c44e355943ad24235aceb6bd2157544bdf46ba64.tar.gz hercules-c44e355943ad24235aceb6bd2157544bdf46ba64.tar.bz2 hercules-c44e355943ad24235aceb6bd2157544bdf46ba64.tar.xz hercules-c44e355943ad24235aceb6bd2157544bdf46ba64.zip |
Added config option 'quest_exp_rate' to adjust exp gained by the 'getexp' script command (followup to r11165).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11171 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 1 | ||||
-rw-r--r-- | src/map/script.c | 12 |
3 files changed, 12 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index 93bc5e1d0..3ff567b90 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -3691,6 +3691,7 @@ static const struct _battle_data { { "mob_remove_delay", &battle_config.mob_remove_delay, 60000, 15000, INT_MAX, }, { "sg_miracle_skill_duration", &battle_config.sg_miracle_skill_duration, 3600000, 0, INT_MAX, }, { "hvan_explosion_intimate", &battle_config.hvan_explosion_intimate, 45000, 0, 100000, }, + { "quest_exp_rate", &battle_config.quest_exp_rate, 100, 0, INT_MAX, }, }; diff --git a/src/map/battle.h b/src/map/battle.h index ca9563ce6..a4bab9b54 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -433,6 +433,7 @@ extern struct Battle_Config int hom_rename; int homunculus_show_growth ; //[orn] int homunculus_friendly_rate; + int quest_exp_rate; } battle_config; void do_init_battle(void); diff --git a/src/map/script.c b/src/map/script.c index a5dc7696b..a754aca14 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -7767,13 +7767,21 @@ BUILDIN_FUNC(getexp) { TBL_PC *sd = script_rid2sd(st); int base=0,job=0; + double bonus; + + nullpo_retr(0, sd); base=script_getnum(st,2); job =script_getnum(st,3); if(base<0 || job<0) return 0; - if(sd) - pc_gainexp(sd,NULL,base,job); + + // bonus for npc-given exp + bonus = battle_config.quest_exp_rate / 100.; + base = (int) cap_value(base * bonus, 0, INT_MAX); + job = (int) cap_value(job * bonus, 0, INT_MAX); + + pc_gainexp(sd, NULL, base, job); return 0; } |