Im attempting to create a boss that slowly because immune to all types of damage except Holy damage, and I was wondering how I would go about this. I have it all compiled, but it decides not to work, or say any sort of errors. I think the first problem would be: How do I cast spells on the boss? So far I have
Code:
function Boss_OnCombat(pUnit, event)
pUnit:SendChatMessage(14,0,"You think you can challenge me? The Warrior of Gilneas?!")
pUnit:RegisterEvent("Balth_Phase2",0,0)
pUnit:RegisterEvent("Balth_Phase3",0,0)
pUnit:RegisterEvent("Balth_Phase4",0,0)
pUnit:RegisterEvent("Balth_Phase5",0,0)
pUnit:RegisterEvent("Balth_Phase6",0,0)
end
function Balth_Phase2(pUnit, event)
if pUnit:GetHealthPct() < 84 then
pUnit:RemoveEvents()
pUnit:FullCastSpell(34308)
end
end
function Balth_Phase3(pUnit, event)
if pUnit:GetHealthPct() < 70 then
pUnit:RemoveEvents()
pUnit:FullCastSpell(39804)
end
end
function Balth_Phase4(pUnit, event)
if pUnit:GetHealthPct() < 56 then
pUnit:RemoveEvents()
pUnit:FullCastSpell(34306)
end
end
function Balth_Phase5(pUnit, event)
if pUnit:GetHealthPct() < 32 then
pUnit:RemoveEvents()
pUnit:FullCastSpell(34309)
end
end
function Balth_Phase6(pUnit, event)
if pUnit:GetHealthPct() < 18 then
pUnit:RemoveEvents()
pUnit:FullCastSpell(34311)
end
end
function Balth_OnLeaveCombat (pUnit, Event)
pUnit:SendChatMessage(12,0,"Once again, I have bested you... Inferior beings.")
pUnit:RemoveEvents()
end
function Balth_OnDied (pUnit, Event)
pUnit:SendChatMessage(11,0,"You may have slain me, but I live on.")
pUnit:RemoveEvents()
end
RegisterUnitEvent(100000, 1, "Balth_OnCombat")
RegisterUnitEvent(100000, 2, "Balth_OnLeaveCombat")
RegisterUnitEvent(100000, 4, "Balth_OnDied")
Meaning, when he hits Less than 56% HP, bump it into Phase4 which will remove that search and cast 34306 (Immune to Frost damage) on himself.
Also, Im getting a server error saying tried to call invalid lua function Balth_OnCombat from ArcEmu (Unit)!, when I have it declared later in the script. Or do I need to declare it first?