ElunaLuaEngine / Eluna

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

AddAura to itself immediately after PerformIngameSpawn fails #441

Closed NadeonCH closed 8 months ago

NadeonCH commented 1 year ago

Adding an aura to a creature after PerformIngameSpawn will not be applied.

It does however apply when I wait a couple of milliseconds (around 200ms).

No errors or anything, just .. Not being applied.

local creature = PerformIngameSpawn(1,      -- 1 for creature
        entry,                              -- Boss entry ID
        bossCoord.Map,                      -- Map ID
        0,                                  -- Instance ID
        bossCoord.X,                        -- X Pos
        bossCoord.Y,                        -- Y Pos
        bossCoord.Z,                        -- Z Pos
        bossCoord.Orientation               -- Orientation
)

creature:SetHealth(creature:GetMaxHealth()) -- Works
creature:AddAura(500000, creature)          -- Does not work (will never be applied)

Pretty much nothing works immediately after, things such as

creature:AttackStart(player)
creature:SetInCombatWith(player)

Does not work either. Meaning it never starts attacking the player, not is it in combat with the player.

Foereaper commented 8 months ago

This is default core behavior and call order. Not really much we can do about this unfortunately.