Added battle config autoloot_adjust (#2562)

* Fixes #2540.
* Added battle config autoloot_adjust that allows autoloot to take player drop penalties and bonuses into account.
Thanks to @ecdarreola!
This commit is contained in:
Aleos 2017-11-08 18:55:20 -05:00 committed by GitHub
parent 86241b0eb8
commit 63daab5860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 1 deletions

View File

@ -148,3 +148,8 @@ alchemist_summon_reward: 1
// 333 = show announces for 3.33% or lower drop chance items
// 10000 = show announces for all items
rare_drop_announce: 0
// 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: 0

View File

@ -8442,6 +8442,7 @@ static const struct _battle_data {
{ "feature.achievement", &battle_config.feature_achievement, 1, 0, 1, },
{ "allow_bound_sell", &battle_config.allow_bound_sell, 0, 0, 0x3, },
{ "event_refine_chance", &battle_config.event_refine_chance, 0, 0, 1, },
{ "autoloot_adjust", &battle_config.autoloot_adjust, 0, 0, 1, },
#include "../custom/battle_config_init.inc"
};

View File

@ -635,6 +635,7 @@ struct Battle_Config
int feature_achievement;
int allow_bound_sell;
int event_refine_chance;
int autoloot_adjust;
#include "../custom/battle_config_struct.inc"
};

View File

@ -2738,7 +2738,7 @@ 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]