azerothcore / mod-eluna

Eluna Lua Engine © for WoW Emulators
https://elunaluaengine.github.io/
GNU General Public License v3.0
96 stars 126 forks source link

CREATURE_EVENT_ON_DIED for RegisterCreatureEvent not working on reload #139

Closed 0xCiBeR closed 1 year ago

0xCiBeR commented 1 year ago

The event CREATURE_EVENT_ON_DIED(ID 4) for RegisterCreatureEvent is no triggered if added to a script and then you reload eluna.

It only starts to work after you restart the server

Steps to reproduce: 1.) on a running server, create a lua script that uses the RegisterCreatureEvent and the CREATURE_EVENT_ON_DIED(ID 4) event. 2.) reload eluna using .reload eluna and try to kill the creature you referenced in the RegisterCreatureEvent

55Honey commented 1 year ago

You need to reset a creature to trigger the new AI. You can e.g. spawn a new one temporarily or kill it twice, then it will trigger on the second kill.