Hey, could someone please help me fix this script?
I keep getting Tried to call Invalid LUA Function 'Boss_OnEnterCombat' from Ascent (unit)!
Here's the script:
Code:
function Boss_Spell1(unit)
unit:CastSpell(41150)
unit:SendChatMessage(12, 0, "Run, run for your lives pitiful mortals...")
end
function Boss_Spell2(unit)
unit:CastSpell(45302)
unit:SendChatMessage(12, 0, "Feel the chaos flow...")
end
function Boss_Spell3(unit)
local plr = unit:GetClosestPlayer()
if (plr ~= nil) then
unit:CastSpellOnTarget(39568, plr)
end
function Boss_SunderArmor(unit)
local plr = unit:GetClosestPlayer()
if (plr ~= nil) then
unit:FullCastSpellOnTarget(30901, plr)
end
end
function Boss_OnEnterCombat(unit)
unit:SendChatMessage(12, 0, "You've made a grave error...")
unit:RegisterUnitEvent("Boss_Spell1",23000, 0)
unit:RegisterUnitEvent("Boss_SunderArmor",10000, 0)
unit:RegisterUnitEvent("Boss_Spell2",50000, 0)
unit:RegisterUnitEvent("Boss_Spell3",120000, 0)
end
end
function Boss_OnLeaveCombat(unit)
unit:RemoveEvents()
end
function Boss_KilledTarget(unit)
unit:SendChatMessage(12, 0, "All dressed up and nowhere to go...")
unit:RemoveEvents()
end
function Boss_OnDied(unit)
unit:SendChatMessage(12, 0, "BEHOLD! The true power of chaos reigns...")
unit:RemoveEvents()
end
RegisterUnitEvent(90227, 1, "Boss_OnEnterCombat")
RegisterUnitEvent(90227, 2, "Boss_OnLeaveCombat")
RegisterUnitEvent(90227, 3, "Boss_OnKilledTarget")
RegisterUnitEvent(90227, 4, "Boss_onDied")
any help would be much appreciated...