feat: Surprise bag boss #504
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds support for marking surprise bag loot as exclusive to boss monsters and improves the way surprise bag loot is rolled and distributed. It introduces a new
bossOnlyattribute for bag items, updates the loot-dropping logic to respect this attribute, and refactors the loot rolling mechanism for better maintainability and Lua scripting support.Surprise Bag Loot Improvements:
bossOnlyattribute to bag items inbags.xmland the item system, allowing certain surprise bag drops to be restricted to boss monsters only. (data/items/bags.xml,src/items/items.hpp,src/items/items.cpp)rollSurpriseBagLoot, which filters and rolls bag loot based on monster type, class, race, and the newbossOnlyflag. (src/items/items.cpp,src/items/items.hpp)rollSurpriseBagLootmethod, ensuring surprise bag drops are handled consistently and with the new restrictions. (src/creatures/monsters/monster.cpp)Lua Scripting Enhancements:
MonsterType:getSurpriseBagLoot(), allowing scripts to query possible surprise bag drops for a monster. (src/lua/functions/creatures/monster/monster_type_functions.cpp,src/lua/functions/creatures/monster/monster_type_functions.hpp)data/libs/functions/monster.lua)