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

RegisterCreatureEvent not working for script AI boss #170

Closed kissingers closed 5 months ago

kissingers commented 5 months ago

Try test , will find the RegisterCreatureEvent not working any more. not only methed 9 , but all can not.

-- .go c 76586

local function OnDamageTaken(event, creature, attacker, damage) creature:SendUnitSay("Test") end RegisterCreatureEvent(21878, 9, OnDamageTaken)

kissingers commented 5 months ago

It seems only script AI boss cant work.

local function OnDamageTaken(event, creature, attacker, damage) if attacker:IsPlayer() then attacker:SendBroadcastMessage("???") end end

-- .go c 76586 -- OK RegisterCreatureEvent(21878, 9, OnDamageTaken)

-- .go c 40527 -- Fault for script AI boss RegisterCreatureEvent(22887, 9, OnDamageTaken)

55Honey commented 5 months ago

You can not use 2 AIs for Unit in parallel. If a creature has a .cpp script, it will use it instead of any Lua AI. If a creature has SAI, it will use SAI until it respawns. Then switch to Lua instead of SAI.

kissingers commented 5 months ago

Thanks, I see , so something must register to word even or player even to replace the boss LUA AI