Przeglądaj źródła

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!
Aleos 7 lat temu
rodzic
commit
63daab5860
4 zmienionych plików z 8 dodań i 1 usunięć
  1. 5 0
      conf/battle/drops.conf
  2. 1 0
      src/map/battle.cpp
  3. 1 0
      src/map/battle.hpp
  4. 1 1
      src/map/mob.cpp

+ 5 - 0
conf/battle/drops.conf

@@ -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

+ 1 - 0
src/map/battle.cpp

@@ -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"
 };

+ 1 - 0
src/map/battle.hpp

@@ -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"
 };

+ 1 - 1
src/map/mob.cpp

@@ -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]