[DiscordArchive] i write a function used in registcreatureevent on event 1, means onentercombat.it doesn't work on cr
[DiscordArchive] i write a function used in registcreatureevent on event 1, means onentercombat.it doesn't work on cr
Archived author: BetaYi • Posted: 2022-05-11T06:43:58.753000+00:00
Original source
i write a function used in registcreatureevent on event 1, means onentercombat.it doesn't work on creature inside of instance but works fine with same creatureentry that spawnd outside instance , seems like just the registered event was removed while enter combat , does anyone know the reason? and how to excuse the custome function on enter combat in instance?
Archived author: Foe • Posted: 2022-05-11T06:48:30.737000+00:00
Original source
The instance script probably overrides the creature ai with a c++ script, a creature cannot have both a Lua and a c++ ai/script attached
Archived author: Foe • Posted: 2022-05-11T06:49:01.549000+00:00
Original source
So either script the creature in c++, or script the instance entirely in Lua
Archived author: Honey • Posted: 2022-05-11T06:51:17.788000+00:00
Original source
Try Clearing all active instace IDs. If the creature existed, it can lead to unexpected results.
If in doubt, restart the server until you know the conditions when it works.
Archived author: BetaYi • Posted: 2022-05-11T07:01:22.677000+00:00
Original source
but the function regist on event leave combat was worked fine , the lua api work s override the c++ source function,right? so they should be worked with a list?
Archived author: Honey • Posted: 2022-05-11T07:02:36.651000+00:00
Original source
It does Override SAI but only after a respawn. Not sure with cpp
Archived author: BetaYi • Posted: 2022-05-11T07:09:33.154000+00:00
Original source
well,it means creature sai event was conflict with lua api on same event? and sai event will be selected only if exist ?
Archived author: Honey • Posted: 2022-05-11T07:17:56.967000+00:00
Original source
There are probably a Lot of people more experienced with this. But my experience is, that a single `RegisterCreatureEvent` for that entry removes any existing SAI and only leaves Lua.