Skip to content

Conversation

@Laslest
Copy link
Contributor

@Laslest Laslest commented Nov 17, 2025

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 bossOnly attribute 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:

  • Added a bossOnly attribute to bag items in bags.xml and 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)
  • Refactored the surprise bag loot rolling logic into a new method rollSurpriseBagLoot, which filters and rolls bag loot based on monster type, class, race, and the new bossOnly flag. (src/items/items.cpp, src/items/items.hpp)
  • Updated the monster loot drop process to use the new rollSurpriseBagLoot method, ensuring surprise bag drops are handled consistently and with the new restrictions. (src/creatures/monsters/monster.cpp)

Lua Scripting Enhancements:

  • Exposed the new surprise bag loot rolling to Lua via 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)
  • Integrated the new Lua method into the monster loot generation pipeline, so Lua-based loot logic can now include surprise bag loot. (data/libs/functions/monster.lua)

@Laslest Laslest closed this Nov 17, 2025
@Laslest Laslest deleted the surprisebag-boss branch November 17, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant