Code:
function AllianceD_OnEnterCombat(pUnit, event, miscpUnit, misc)
pUnit:SendChatMessage(11, 0, "For the kingdom!")
end
function AllianceD_Phase1(pUnit, event, miscpUnit, misc)
if pUnit:GetHealthPct() < 95 then
pUnit:FullCastSpellOnTarget(36877,pUnit:GetRandomPlayer())
pUnit:SendChatMessage(11, 0, "Feel the power of the Alliance!")
end
function AllianceD_Phase2(pUnit, event, miscpUnit, misc)
if pUnit:GetHealthPct() < 80 then
pUnit:FullCastSpellOnTarget(29963,pUnit:GetRandomPlayer())
pUnit:FullCastSpellOnTarget(38589,pUnit:GetRandomPlayer())
end
function AllianceD_Phase3(Unit, Event)
if pUnit:GetHealthPct() < 50 then
pUnit:SendChatMessage(11, 0, "Fellow guards, attack!")
local x = Unit:GetX()
local y = Unit:GetY()
local z = Unit:GetZ()
local o = Unit:GetO()
Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
Unit:SpawnCreature(1423, x, y, z, o, 1638, 600000)
end
RegisterUnitEvent(466, 1, "AllianceD_OnEnterCombat")
RegisterUnitEvent(466, 2, "AllianceD_Phase1")
RegisterUnitEvent(466, 3, "AllianceD_Phase2")
RegisterUnitEvent(466, 4, "AllianceD_Phase3")
I actually think the RegisterEvents ain't correct, cause I do not know how to fill them in.