Ascelyn - I did something like:
Code:
function MyNPC_OnCombat(Unit, Event)
Unit:RegisterEvent("HpTest", 1000, 0)
Unit:RegisterEvent("MpTest", 1000, 0)
end
Code:
function HpTest(Unit, Event)
if unit:GetHealthPct() < 75 then
unit:SendChatMessage(12, 7, "Auu!")
Unit:FullCastSpellOnTarget(5176, Unit:GetMainTank())
else
end
end
function MpTest(Unit, Event)
if unit:GetManaPct() < 75 then
unit:SendChatMessage(12, 7, "Ahh... losing ... mana...")
Unit:FullCastSpellOnTarget(8921, Unit:GetMainTank())
else
end
end
And does NOT work also.
But found this:
Code:
function kt_OnCombat(Unit, Event)
local phase3 = 0
(...)
Unit:RegisterEvent("Phase3",1000,0)
end
Code:
function Phase3(Unit, Event)
if Unit:GetHealthPct() < 41 then
if phase3==0 then
Unit:SendChatMessage(14,0, "Something happens...")
phase3 = 1
else
end
end
end
This is cutted part from BOSS-Naxxramas-KelThuzad.lua by ArcEmu (game version 2.4.3). Check it out, may work... I will test it later. But I think it's like that:
" local phase3 = 0 " = PHASE3 is marked as 0 (not happen yet) because the NPC just entered combat
" if phase3==0 then " = if function named PHASE3 is TRUE then something happens (lines below it)
" phase3 = 1 " = PHASE3 has been marked as 1 (already happen)
===========
Wheezee201 - seems to. You can try some other methods by yourself or use different spell ID or so.
=======
+Rep me if I helped