Hello, it's again me.
This time I have problem with custom NPC. Here is the code:
Code:
function Necromancer_OnCombat(Unit, Event)
Unit:RegisterEvent("Necromancer_Summon", 30000, 0)
Unit:RegisterEvent("Necromancer_Fear", 12000, 0)
Unit:RegisterEvent("Necromancer_ShadowBolt", 6000, 0)
end
function Necromancer_Summon(Unit, Event)
local x = Unit:GetX()
local y = Unit:GetY()
local z = Unit:GetZ()
local o = Unit:GetO()
Unit:SpawnCreature(15654, x, y, z, o, 14, 20000)
Unit:SpawnCreature(15658, x+5, y-3, z-1, o, 14, 20000)
end
function Necromancer_ShadowBolt(Unit, Event)
Unit:FullCastSpellOnTarget(1106, Unit:GetMainTank())
end
function Necromancer_Fear(Unit, Event)
Unit:FullCastSpellOnTarget(5782, Unit:GetMainTank())
end
function Necromancer_OnLeaveCombat(Unit, Event)
Unit:RemoveEvents()
end
function Necromancer_OnKilledTarget(Unit, Event)
end
function Necromancer_OnDied(Unit, Event)
Unit:RemoveEvents()
end
RegisterUnitEvent(1000011, 1, "Necromancer_OnCombat")
RegisterUnitEvent(1000011, 2, "Necromancer_OnLeaveCombat")
RegisterUnitEvent(1000011, 3, "Necromancer_OnKilledTarget")
RegisterUnitEvent(1000011, 4, "Necromancer_OnDied")
He is casting spells etc. everything fine, expect summoning mobs. Just when it's time for summoning - nothing happens like the function doesn't exist. I even tried adding spells to this function and they did work, but summons still didn't work. My NPC summoned mobs only few random times like there is chance for it 1%-5%. I'm out of ideas - I have tried all methods I found and result is same.
Anyone know how to fix it? I'm using ArcEmu rev 2833 (3.1.3). Mobs 15654 and 15658 exist - first one is a skeleton around 4 lvl and second one is a ghoul. Both of them appears in big amounts near Silvermoon on deathscar.