topaz-next / topaz

💎 A server emulator for Final Fantasy XI.
GNU General Public License v3.0
56 stars 80 forks source link

Dynamically change droplist content #2557

Closed zach2good closed 3 years ago

zach2good commented 3 years ago

I affirm:

Temporary:

Previously, the drops from a mob are set using ONLY it's DropID: A lookup to a global drop list. If you wanted to change the drops a mob had, you either had to modify that global list (effecting anything else that uses that list), or you had to swap that mobs DropID for another one.

The main changes in this PR: When it's time to roll loot, make a TEMPORARY copy of the drop list assigned to the mob. Add a facility to add a list of droplist modifications that will be actioned just before the droplist is rolled on.

Testing Added mob:addDropListModification(4112, 1000) to onMobDeath for birds in Sky. They dropped a potion. Remove and hot-reload. They no longer drop potions.