Code:
function mage1_Phase1(Unit, event)
if Unit:GetHealthPct() < 90 then
Unit:RemoveEvents()
Unit:SpawnCreature(113303, -13212.33, 258.22, 21.85, 4.25, 180000)
Unit:SpawnCreature(113304, -13208.69, 237.72, 21.85, 1.30, 180000)
Unit:SpawnCreature(113304, -13207.32, 313.67, 21.85, 4.89, 180000)
Unit:SpawnCreature(113304, -13178.21, 293.70, 21.85, 3.92, 180000)
Unit:SpawnCreature(113303, -13176.02, 254.26, 21.85, 2.60, 180000)
Unit:SpawnCreature(113304, -12315.16, 215.31, 34.96, 1.39, 180000)
Unit:SpawnCreature(113303, -13239.49, 308.06, 33.22, 5.70, 180000)
Unit:SpawnCreature(113303, -13156.18, 278.33, 33.22, 3.45, 180000)
Unit:SpawnCreature(113304, -13168.31, 237.95, 33.24, 2.27, 180000)
Unit:RegisterEvent("mage1_Phase2",1000, 0)
end
end
function mage1_Phase2(Unit, event)
if Unit:GetHealthPct() < 70 then
Unit:RemoveEvents()
Unit:SpawnCreature(113303, -13212.33, 258.22, 21.85, 4.25, 180000)
Unit:SpawnCreature(113303, -13208.69, 237.72, 21.85, 1.30, 180000)
Unit:SpawnCreature(113303, -13242.99, 289.37, 21.85, 5.62, 180000)
Unit:SpawnCreature(113303, -13207.32, 313.67, 21.85, 4.89, 180000)
Unit:SpawnCreature(113304, -13178.21, 293.70, 21.85, 3.92, 180000)
Unit:SpawnCreature(113304, -13176.02, 254.26, 21.85, 2.60, 180000)
Unit:SpawnCreature(113303, -13239.49, 308.06, 33.22, 5.70, 180000)
Unit:SpawnCreature(113304, -13156.18, 278.33, 33.22, 3.45, 180000)
Unit:SpawnCreature(113304, -13168.31, 237.95, 33.24, 2.27, 180000)
Unit:RegisterEvent("mage1_Phase3",1000, 0)
end
end
function mage1_Phase3(Unit, event)
if Unit:GetHealthPct() < 63 then
Unit:RemoveEvents()
Unit:SpawnCreature(113304, -13212.33, 258.22, 21.85, 4.25, 180000)
Unit:SpawnCreature(113303, -13208.69, 237.72, 21.85, 1.30, 180000)
Unit:SpawnCreature(113304, -13242.99, 289.37, 21.85, 5.62, 180000)
Unit:SpawnCreature(113303, -13207.32, 313.67, 21.85, 4.89, 180000)
Unit:SpawnCreature(113304, -13178.21, 293.70, 21.85, 3.92, 180000)
Unit:SpawnCreature(113303, -13176.02, 254.26, 21.85, 2.60, 180000)
Unit:SpawnCreature(113304, -12315.16, 215.31, 34.96, 1.39, 180000)
Unit:SpawnCreature(113304, -13250.32, 250.49, 39.23, 0.49, 180000)
Unit:SpawnCreature(113304, -13239.49, 308.06, 33.22, 5.70, 180000)
Unit:SpawnCreature(113304, -13156.18, 278.33, 33.22, 3.45, 180000)
Unit:SpawnCreature(113304, -13168.31, 237.95, 33.24, 2.27, 180000)
Unit:SendChatMessage(12, 0, "How dare you tryo to stop us!")
Unit:RegisterEvent("mage1_Phase4",1000, 0)
end
end
function mage1_Phase4(Unit, event)
if Unit:GetHealthPct() < 48 then
Unit:RemoveEvents()
Unit:SpawnCreature(113303, -13212.33, 258.22, 21.85, 4.25, 180000)
Unit:SpawnCreature(113304, -13208.69, 237.72, 21.85, 1.30, 180000)
Unit:SpawnCreature(113303, -13242.99, 289.37, 21.85, 5.62, 180000)
Unit:SpawnCreature(113304, -13207.32, 313.67, 21.85, 4.89, 180000)
Unit:SpawnCreature(113303, -13178.21, 293.70, 21.85, 3.92, 180000)
Unit:SpawnCreature(113304, -13176.02, 254.26, 21.85, 2.60, 180000)
Unit:SpawnCreature(113303, -12315.16, 215.31, 34.96, 1.39, 180000)
Unit:SpawnCreature(113303, -13250.32, 250.49, 39.23, 0.49, 180000)
Unit:SpawnCreature(113303, -13239.49, 308.06, 33.22, 5.70, 180000)
Unit:SpawnCreature(113304, -13156.18, 278.33, 33.22, 3.45, 180000)
Unit:SpawnCreature(113304, -13168.31, 237.95, 33.24, 2.27, 180000)
Unit:RegisterEvent("mage1_Phase5",1000, 0)
end
end
function mage1_Phase5(Unit, event)
if Unit:GetHealthPct() < 32 then
Unit:RemoveEvents()
Unit:SpawnCreature(113303, -13212.33, 258.22, 21.85, 4.25, 180000)
Unit:SpawnCreature(113304, -13208.69, 237.72, 21.85, 1.30, 180000)
Unit:SpawnCreature(113303, -13242.99, 289.37, 21.85, 5.62, 180000)
Unit:SpawnCreature(113303, -13207.32, 313.67, 21.85, 4.89, 180000)
Unit:SpawnCreature(113304, -13178.21, 293.70, 21.85, 3.92, 180000)
Unit:SpawnCreature(113303, -13176.02, 254.26, 21.85, 2.60, 180000)
Unit:SpawnCreature(113304, -12315.16, 215.31, 34.96, 1.39, 180000)
Unit:SpawnCreature(113304, -13250.32, 250.49, 39.23, 0.49, 180000)
Unit:SpawnCreature(113303, -13239.49, 308.06, 33.22, 5.70, 180000)
Unit:SpawnCreature(113304, -13156.18, 278.33, 33.22, 3.45, 180000)
Unit:SpawnCreature(113304, -13168.31, 237.95, 33.24, 2.27, 180000)
Unit:RegisterEvent("mage1_Phase6",1000, 0)
end
end
function mage1_Phase6(Unit, event)
if Unit:GetHealthPct() < 15 then
Unit:RemoveEvents()
Unit:SpawnCreature(113303, -13212.33, 258.22, 21.85, 4.25, 180000)
Unit:SpawnCreature(113304, -13208.69, 237.72, 21.85, 1.30, 180000)
Unit:SpawnCreature(113303, -13242.99, 289.37, 21.85, 5.62, 180000)
Unit:SpawnCreature(113303, -13207.32, 313.67, 21.85, 4.89, 180000)
Unit:SpawnCreature(113304, -13178.21, 293.70, 21.85, 3.92, 180000)
Unit:SpawnCreature(113303, -13176.02, 254.26, 21.85, 2.60, 180000)
Unit:SpawnCreature(113304, -12315.16, 215.31, 34.96, 1.39, 180000)
Unit:SpawnCreature(113304, -13250.32, 250.49, 39.23, 0.49, 180000)
Unit:SpawnCreature(113303, -13239.49, 308.06, 33.22, 5.70, 180000)
Unit:SpawnCreature(113304, -13156.18, 278.33, 33.22, 3.45, 180000)
Unit:SpawnCreature(113304, -13168.31, 237.95, 33.24, 2.27, 180000)
Unit:RegisterEvent("mage1_Phase5",1000, 0)
end
end
function mage1_Phase7(Unit, event)
if Unit:GetHealthPct() < 5 then
Unit:RemoveEvents()
Unit:SpawnCreature(113303, -13212.33, 258.22, 21.85, 4.25, 180000)
Unit:SpawnCreature(113303, -13208.69, 237.72, 21.85, 1.30, 180000)
Unit:SpawnCreature(113303, -13242.99, 289.37, 21.85, 5.62, 180000)
Unit:SpawnCreature(113304, -13207.32, 313.67, 21.85, 4.89, 180000)
Unit:SpawnCreature(113304, -13178.21, 293.70, 21.85, 3.92, 180000)
Unit:SpawnCreature(113304, -13176.02, 254.26, 21.85, 2.60, 180000)
Unit:SpawnCreature(113304, -12315.16, 215.31, 34.96, 1.39, 180000)
Unit:SpawnCreature(113304, -13250.32, 250.49, 39.23, 0.49, 180000)
Unit:SpawnCreature(113303, -13239.49, 308.06, 33.22, 5.70, 180000)
Unit:SpawnCreature(113304, -13156.18, 278.33, 33.22, 3.45, 180000)
Unit:SpawnCreature(113303, -13168.31, 237.95, 33.24, 2.27, 180000)
Unit:RegisterEvent("mage1_Phase4",1000, 0)
end
end
function mage1_OnCombat(Unit, event)
Unit:RegisterEvent("mage1_Phase1",1000, 0)
Unit:RegisterEvent("mage1_Phase2",1000, 0)
Unit:RegisterEvent("mage1_Phase3",1000, 0)
Unit:RegisterEvent("mage1_Phase4",1000, 0)
Unit:RegisterEvent("mage1_Phase5",1000, 0)
Unit:RegisterEvent("mage1_Phase6",1000, 0)
Unit:RegisterEvent("mage1_Phase7",1000, 0)
end
function mage1_Death(Unit)
Unit:SpawnCreature(224401, -13205.12, 277.96, 21.85, 5.78, 180000)
Unit:SendChatMessage(12, 0, "I will return from the underworld again!")
Unit:RemoveEvents()
Unit:SetScale(1)
end
function mage1_spawn(Unit)
Unit:SendChatMessage(12, 0, "I am but a sprit you can never kill me!")
Unit:SpawnCreature(113303, -13212.33, 258.22, 21.85, 4.25, 180000)
Unit:SpawnCreature(113304, -13208.69, 237.72, 21.85, 1.30, 180000)
Unit:SpawnCreature(113303, -13242.99, 289.37, 21.85, 5.62, 180000)
Unit:SpawnCreature(113303, -13207.32, 313.67, 21.85, 4.89, 180000)
Unit:SpawnCreature(113304, -13178.21, 293.70, 21.85, 3.92, 180000)
Unit:SpawnCreature(113303, -13176.02, 254.26, 21.85, 2.60, 180000)
Unit:SpawnCreature(113304, -12315.16, 215.31, 34.96, 1.39, 180000)
Unit:SpawnCreature(113304, -13250.32, 250.49, 39.23, 0.49, 180000)
Unit:SpawnCreature(113303, -13239.49, 308.06, 33.22, 5.70, 180000)
Unit:SpawnCreature(113304, -13156.18, 278.33, 33.22, 3.45, 180000)
Unit:SpawnCreature(113304, -13168.31, 237.95, 33.24, 2.27, 180000)
Unit:SpawnGameObject(137167, -13212.33, 258.22, 21.85, 4.25, 180000)
Unit:SpawnGameObject(137167, -13208.69, 237.72, 21.85, 1.30, 180000)
Unit:SpawnGameObject(137167, -13242.99, 289.37, 21.85, 5.62, 180000)
Unit:SpawnGameObject(137167, -13207.32, 313.67, 21.85, 4.89, 180000)
Unit:SpawnGameObject(137167, -13178.21, 293.70, 21.85, 3.92, 180000)
Unit:SpawnGameObject(137167, -13176.02, 254.26, 21.85, 2.60, 180000)
Unit:SpawnGameObject(137167, -12315.16, 215.31, 34.96, 1.39, 180000)
Unit:SpawnGameObject(137167, -13250.32, 250.49, 39.23, 0.49, 180000)
Unit:SpawnGameObject(137167, -13239.49, 308.06, 33.22, 5.70, 180000)
Unit:SpawnGameObject(137167, -13156.18, 278.33, 33.22, 3.45, 180000)
Unit:SpawnGameObject(137167, -13168.31, 237.95, 33.24, 2.27, 180000)
Unit:SendBroadcastMessage(I have returned to the arena and have opened the portal to the underworld just try to stop me!)
Unit:RemoveEvents()
end
RegisterUnitEvent(113300, 1, "mage1_OnCombat")
RegisterUnitEvent(113300, 4, "mage1_Death")
RegisterUnitEvent(113300, 6, "mage1_spawn")