diff options
author | Haru <haru@dotalux.com> | 2019-07-28 19:32:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-28 19:32:04 +0200 |
commit | 9034007595aa0ef58d28f09253ba15f405a011ab (patch) | |
tree | 8501bf59aebeae0989436d9d9b60c79f88c11704 | |
parent | 65a7c731d228c059daf042c75d919453e4daa687 (diff) | |
parent | e06b782338e1356b42c80c80d6d59a36d833fcd8 (diff) | |
download | hercules-9034007595aa0ef58d28f09253ba15f405a011ab.tar.gz hercules-9034007595aa0ef58d28f09253ba15f405a011ab.tar.bz2 hercules-9034007595aa0ef58d28f09253ba15f405a011ab.tar.xz hercules-9034007595aa0ef58d28f09253ba15f405a011ab.zip |
Merge pull request #2505 from Emistry/autoloot_adjust
Added battle config autoloot_adjust
-rw-r--r-- | conf/map/battle/drops.conf | 4 | ||||
-rw-r--r-- | src/map/battle.c | 1 | ||||
-rw-r--r-- | src/map/battle.h | 2 | ||||
-rw-r--r-- | src/map/mob.c | 2 |
4 files changed, 8 insertions, 1 deletions
diff --git a/conf/map/battle/drops.conf b/conf/map/battle/drops.conf index cf09d14d9..d37aba455 100644 --- a/conf/map/battle/drops.conf +++ b/conf/map/battle/drops.conf @@ -151,3 +151,7 @@ alchemist_summon_reward: 1 // When picking random options for a dropped item, it does lots of iterations to choose the option to be set, // this value limits the number of iterations to avoid making the server hang in a long loop. option_drop_max_loop: 10 + +// Does autoloot take into account player bonuses and penalties? (Note 1) +// If RENEWAL_DROP, Bubble Gum, or any other modifiers are active autoloot will take them into account. +autoloot_adjust: false diff --git a/src/map/battle.c b/src/map/battle.c index c40c3afac..7fa1567e7 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -7436,6 +7436,7 @@ static const struct battle_data { { "critical_max_limit", &battle_config.critical_max, SHRT_MAX, 1, INT_MAX, }, { "hit_min_limit", &battle_config.hit_min, 1, 1, INT_MAX, }, { "hit_max_limit", &battle_config.hit_max, SHRT_MAX, 1, INT_MAX, }, + { "autoloot_adjust", &battle_config.autoloot_adjust, 0, 0, 1, }, }; static bool battle_set_value_sub(int index, int value) diff --git a/src/map/battle.h b/src/map/battle.h index 0ff5135d8..4f70c697b 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -605,6 +605,8 @@ struct Battle_Config { int critical_max; int hit_min; int hit_max; + + int autoloot_adjust; }; /* criteria for battle_config.idletime_critera */ diff --git a/src/map/mob.c b/src/map/mob.c index 404a240c9..939d062af 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2570,7 +2570,7 @@ static int mob_dead(struct mob_data *md, struct block_list *src, int type) // Announce first, or else ditem will be freed. [Lance] // By popular demand, use base drop rate for autoloot code. [Skotlex] - mob->item_drop(md, dlist, ditem, 0, md->db->dropitem[i].p, homkillonly); + mob->item_drop(md, dlist, ditem, 0, battle_config.autoloot_adjust ? drop_rate : md->db->dropitem[i].p, homkillonly); } // Ore Discovery [Celest] |