Code:
--##################################################################
--## State Changes ##
--##################################################################
function Fire_OnCombat(Unit, event, miscUnit, misc)
Unit:RegisterEvent("Fire_AOE",1500,0)
end
function Frost_OnCombat(Unit, event, miscUnit, misc)
Unit:RegisterEvent("Frost_AOE",3000,0)
end
function Nature_OnCombat(Unit, event, miscUnit, misc)
Unit:RegisterEvent("Nature_AOE",1000,1)
end
function Shadow_OnCombat(Unit, event, miscUnit, misc)
Unit:RegisterEvent("Shadow_AOE",5000,0)
end
--##################################################################
function Fire_OnLeaveCombat(Unit, event, miscUnit, misc)
Unit:RemoveEvents()
Unit:Despawn(5000,0)
end
function Frost_OnLeaveCombat(Unit, event, miscUnit, misc)
Unit:RemoveEvents()
Unit:Despawn(5000,0)
end
function Nature_OnLeaveCombat(Unit, event, miscUnit, misc)
Unit:RemoveEvents()
Unit:Despawn(5000,0)
end
function Shadow_OnLeaveCombat(Unit, event, miscUnit, misc)
Unit:RemoveEvents()
Unit:Despawn(5000,0)
end
--##################################################################
function Fire_OnDied(Unit, event, miscUnit, misc)
Unit:RemoveEvents()
Unit:Despawn(5000,0)
end
function Frost_OnDied(Unit, event, miscUnit, misc)
Unit:RemoveEvents()
Unit:Despawn(5000,0)
end
function Nature_OnDied(Unit, event, miscUnit, misc)
Unit:RemoveEvents()
Unit:Despawn(5000,0)
end
function Shadow_OnDied(Unit, event, miscUnit, misc)
Unit:RemoveEvents()
Unit:Despawn(5000,0)
end
--##################################################################
--## Spells ##
--##################################################################
function Fire_AOE (Unit, event)
Unit:CastSpell(32167)
end
function Frost_AOE (Unit, event)
Unit:CastSpell(43426)
end
function Nature_AOE (Unit, event)
Unit:CastSpell(41151)
end
function Shadow_AOE (Unit, event)
Unit:CastSpell(34322)
end
RegisterUnitEvent(99988,1,"Fire_OnCombat")
RegisterUnitEvent(99988,3,"Fire_OnLeaveCombat")
RegisterUnitEvent(99988,4,"Fire_OnDied")
RegisterUnitEvent(99989,1,"Frost_OnCombat")
RegisterUnitEvent(99989,3,"Frost_OnLeaveCombat")
RegisterUnitEvent(99989,4,"Frost_OnDied")
RegisterUnitEvent(99990,1,"Nature_OnCombat")
RegisterUnitEvent(99990,3,"Nature_OnLeaveCombat")
RegisterUnitEvent(99990,4,"Nature_OnDied")
RegisterUnitEvent(99991,1,"Shadow_OnCombat")
RegisterUnitEvent(99991,3,"Shadow_OnLeaveCombat")
RegisterUnitEvent(99991,4,"Shadow_OnDied")
Code:
--## Trithemius & Everburning Lights ##
--##################################################################
--## Trithemius Phasing ##
--##################################################################
function Tri_Attunement (Unit, event, miscUnit, misc)
print "Attuning"
result = math.random(1, 4)
if result == 1 then
print "Fire Phase"
Unit:RemoveEvents()
Unit:RegisterEvent("Tri_Fire",1000,1)
Unit:RegisterEvent("Tri_Attunement",90000,1)
end
if result == 2 then
print "Frost Phase"
Unit:RemoveEvents()
Unit:RegisterEvent("Tri_Frost",1000,1)
Unit:RegisterEvent("Tri_Attunement",90000,1)
end
if result == 3 then
print "Nature Phase"
Unit:RemoveEvents()
Unit:RegisterEvent("Tri_Nature",1000,1)
Unit:RegisterEvent("Tri_Attunement",90000,1)
end
if result == 4 then
print "Shadow Phase"
Unit:RemoveEvents()
Unit:RegisterEvent("Tri_Shadow",1000,1)
Unit:RegisterEvent("Tri_Attunement",90000,1)
end
end
function Tri_Fire (Unit, event, miscUnit, misc)
print "+++++++++ Entered Fire Phase"
Unit:SetScale(1.1)
Unit:SetModel(12821)
Unit:RegisterEvent("Rand_Spawn",10000,1)
Unit:RegisterEvent("Rand_Curse",89000,1)
Unit:RegisterEvent("Tri_FireVolley",timer3,0)
Unit:RegisterEvent("Tri_Wall",timer2,3)
Unit:RegisterEvent("Tri_Stack",timer2,0)
Unit:RegisterEvent("Tri_Breath",timer1,0)
a = 1
end
function Tri_Frost (Unit, event, miscUnit, misc)
print "--------- Entered Frost Phase"
Unit:SetScale(1.2)
Unit:SetModel(6373)
Unit:RegisterEvent("Rand_Spawn",10000,1)
Unit:RegisterEvent("Rand_Curse",89000,1)
Unit:RegisterEvent("Tri_FrostVolley",timer3,0)
Unit:RegisterEvent("Tri_Freeze",timer2,0)
Unit:RegisterEvent("Tri_Freeze",timer1,0)
Unit:RegisterEvent("Tri_Icelance",timer2,0)
Unit:RegisterEvent("Tri_Icelance",timer2,0)
Unit:RegisterEvent("Tri_IncreaseDamage",1000,1)
a = 2
end
function Tri_Nature (Unit, event, miscUnit, misc)
print "????????? Entered Nature Phase"
Unit:SetScale(1.2)
Unit:SetModel(7553)
Unit:RegisterEvent("Rand_Spawn",10000,1)
Unit:RegisterEvent("Rand_Curse",89000,1)
Unit:RegisterEvent("Tri_NatureVolley",timer3,0)
Unit:RegisterEvent("Tri_Sleep",timer2,0)
Unit:RegisterEvent("Tri_Storm",timer3,0)
Unit:RegisterEvent("Tri_Poison",timer1,0)
Unit:RegisterEvent("Tri_Poison2",timer2,0)
a = 3
end
function Tri_Shadow (Unit, event, miscUnit, misc)
print "========= Entered Shadow Phase"
Unit:SetScale(1.2)
Unit:SetModel(6377)
Unit:RegisterEvent("Rand_Spawn",10000,1)
Unit:RegisterEvent("Rand_Curse",89000,1)
Unit:RegisterEvent("Tri_ShadowVolley",timer3,0)
Unit:RegisterEvent("Tri_Nova",timer2,0)
Unit:RegisterEvent("Tri_Embrace",timer2,0)
Unit:RegisterEvent("Tri_Rat",timer4,0)
Unit:RegisterEvent("Tri_Cleave",timer2,0)
a = 4
end
function Rand_Curse (Unit, event, misc, miscunit)
print "Mathing Curse"
result = math.random(1, 4)
if result == 1 then
print "Fire Curse"
Unit:RegisterEvent("Fire_Curse",1000,1)
end
if result == 2 then
print "Frost Curse"
Unit:RegisterEvent("Frost_Curse",1000,1)
end
if result == 3 then
print "Nature Curse"
Unit:RegisterEvent("Nature_Curse",1000,1)
end
if result == 4 then
print "Shadow Curse"
Unit:RegisterEvent("Shadow_Curse",1000,1)
end
end
--##################################################################
--## Load Spawns ##
--##################################################################
function Rand_Spawn (Unit, event, miscUnit, misc)
print "Mathing Spawn"
result = math.random(1, 4)
if result == 1 then
print "Inc: Everburning Children"
Unit:SendChatMessage (12, 0, "Return to me my Everburning Children!")
Unit:RegisterEvent("Fire_Summon",1000,1)
end
if result == 2 then
print "Inc: Frozen Souls"
Unit:SendChatMessage (12, 0, "Let them feel your chill my Frozen Souls!")
Unit:RegisterEvent("Frost_Summon",1000,1)
end
if result == 3 then
print "Inc: Children of Earth"
Unit:SendChatMessage (12, 0, "Children of Earth stand strong!")
Unit:RegisterEvent("Nature_Summon",1000,1)
end
if result == 4 then
print "Inc: Shattered Visions"
Unit:SendChatMessage (12, 0, "Engulf their hearts in darkness my Shattered Visions!")
Unit:RegisterEvent("Shadow_Summon",1000,1)
end
end
function Fire_Summon (Unit, event)
print "Summoning Fire"
x=Unit:GetX()
y=Unit:GetY()
z=Unit:GetZ()
o=Unit:GetO()
Unit:SpawnCreature(99988, x + 20, y - 20, z, o, 1890, 0)
Unit:SpawnCreature(99988, x - 20, y - 20, z, o, 1890, 0)
Unit:SpawnCreature(99988, x, y + 20, z, o, 1890, 0)
end
function Frost_Summon (Unit, event)
print "Summoning Frost"
x=Unit:GetX()
y=Unit:GetY()
z=Unit:GetZ()
o=Unit:GetO()
Unit:SpawnCreature(99989, x + 20, y - 20, z, o, 1890, 0)
Unit:SpawnCreature(99989, x - 20, y - 20, z, o, 1890, 0)
Unit:SpawnCreature(99989, x, y + 20, z, o, 1890, 0)
end
function Nature_Summon (Unit, event)
print "Summoning Nature"
x=Unit:GetX()
y=Unit:GetY()
z=Unit:GetZ()
o=Unit:GetO()
Unit:SpawnCreature(99990, x + 20, y - 20, z, o, 1890, 0)
Unit:SpawnCreature(99990, x - 20, y - 20, z, o, 1890, 0)
Unit:SpawnCreature(99990, x, y + 20, z, o, 1890, 0)
end
function Shadow_Summon (Unit, event)
print "Summoning Shadow"
x=Unit:GetX()
y=Unit:GetY()
z=Unit:GetZ()
o=Unit:GetO()
Unit:SpawnCreature(99991, x + 20, y - 20, z, o, 1890, 0)
Unit:SpawnCreature(99991, x - 20, y - 20, z, o, 1890, 0)
Unit:SpawnCreature(99991, x, y + 20, z, o, 1890, 0)
end
--##################################################################
--## Curses ##
--##################################################################
function Fire_Curse (Unit, event)
print "Fire Cursing"
Unit:FullCastSpellOnTarget(38715,Unit:GetRandomPlayer(0))
Unit:FullCastSpellOnTarget(38715,Unit:GetRandomPlayer(0))
Unit:FullCastSpellOnTarget(38715,Unit:GetRandomPlayer(0))
end
function Frost_Curse (Unit, event)
print "Frost Cursing"
Unit:CastSpellOnTarget(38714,Unit:GetRandomPlayer(0))
Unit:CastSpellOnTarget(38714,Unit:GetRandomPlayer(0))
Unit:CastSpellOnTarget(38714,Unit:GetRandomPlayer(0))
end
function Nature_Curse (Unit, event)
print "Nature Cursing"
Unit:FullCastSpellOnTarget(38717,Unit:GetRandomPlayer(0))
Unit:FullCastSpellOnTarget(38717,Unit:GetRandomPlayer(0))
Unit:FullCastSpellOnTarget(38717,Unit:GetRandomPlayer(0))
end
function Shadow_Curse (Unit, event)
print "Shadow Cursing"
Unit:FullCastSpellOnTarget(17800,Unit:GetRandomPlayer(7))
Unit:FullCastSpellOnTarget(17800,Unit:GetRandomPlayer(7))
Unit:FullCastSpellOnTarget(17800,Unit:GetRandomPlayer(7))
end
--##################################################################
--## Fire ##
--##################################################################
function Tri_Wall (Unit, event)
x=Unit:GetX()
y=Unit:GetY()
z=Unit:GetZ()
o=Unit:GetO()
Unit:SpawnCreature(23069, x, y, z, o, 1890, 25000)
end
function Tri_Breath (Unit, event)
Unit:FullCastSpellOnTarget(43140,Unit:GetMainTank())
end
function Tri_FireVolley (Unit, event)
Unit:FullCastSpellOnTarget(37109,Unit:GetRandomPlayer(0))
end
function Tri_Stack (Unit, event)
Unit:FullCastSpellOnTarget(22433,Unit:GetRandomPlayer(0))
end
--##################################################################
--## Frost ##
--##################################################################
function Tri_FrostVolley (Unit, event)
Unit:FullCastSpellOnTarget(36741,Unit:GetRandomPlayer(0))
end
function Tri_Freeze (Unit, event)
Unit:FullCastSpellOnTarget(38035,Unit:GetRandomPlayer(7))
end
function Tri_Icelance (Unit, event)
Unit:FullCastSpellOnTarget(46194,Unit:GetRandomPlayer(0))
end
function Tri_IncreaseDamage (Unit, event)
Unit:CastSpell(25178)
end
--##################################################################
--## Nature ##
--##################################################################
function Tri_NatureVolley (Unit, event)
Unit:FullCastSpellOnTarget(25991,Unit:GetRandomPlayer(0))
end
function Tri_Sleep (Unit, event)
Unit:FullCastSpellOnTarget(36333,Unit:GetRandomPlayer(0))
end
function Tri_Storm (Unit, event)
Unit:FullCastSpellOnTarget(25033,Unit:GetRandomPlayer(0))
end
function Tri_Poison (Unit, event)
Unit:FullCastSpellOnTarget(46294,Unit:GetRandomPlayer(4))
end
function Tri_Poison2 (Unit, event)
Unit:FullCastSpellOnTarget(41978,Unit:GetRandomPlayer(7))
end
--##################################################################
--## Shadow ##
--##################################################################
function Tri_ShadowVolley (Unit, event)
Unit:CastSpellOnTarget(32963,Unit:GetRandomPlayer(0))
end
function Tri_Nova (Unit, event)
Unit:CastSpell(30852)
end
function Tri_Embrace (Unit, event)
Unit:FullCastSpellOnTarget(34922,Unit:GetRandomPlayer(7))
end
function Tri_Rat (Unit, event)
Unit:FullCastSpellOnTarget(17738,Unit:GetRandomPlayer(7))
end
function Tri_Cleave (Unit, event)
Unit:CastSpellOnTarget(30495,Unit:GetMainTank())
end
--##################################################################
--## Heart ##
--##################################################################
function Heart_Out (Unit, event)
print "&&&&&&&&& Heart Peacing"
Unit:SendChatMessage(12, 0, "Thank you Heroes, my tortured heart may finally be at peace...")
end
function Heart_Out2 (Unit, event)
Unit:CastSpell(19823)
Unit:CastSpell(32459)
Unit:CastSpell(19484)
Unit:CastSpell(36400)
Unit:CastSpell(41918)
end
--##################################################################
--## Timers ##
--##################################################################
timer1 = math.random(5000,10000)
timer2 = math.random(7000,15000)
timer3 = math.random(15000,25000)
timer4 = math.random(25000,45000)
timer5 = math.random(40000,80000)
--##################################################################
--## State Changes ##
--##################################################################
function Tri_OnCombat (Unit, event, miscUnit, misc)
print "$$$$$$$$$ Combatting"
Unit:RegisterEvent("Tri_Attunement",90000,0)
end
function Tri_OnKilledTarget (Unit, event, miscunit, misc)
Unit:RemoveEvents()
end
function Tri_OnLeaveCombat (Unit, event, miscUnit, misc)
Unit:Despawn(10000,1)
end
function Tri_OnDied (Unit, event, miscUnit, misc)
x=Unit:GetX()
y=Unit:GetY()
z=Unit:GetZ()
o=Unit:GetO()
Unit:Despawn(3000,0)
Unit:SpawnCreature(99992, x, y, z + 10, o, 3000, 0)
end
function Heart_OnSpawn (Unit, event, miscUnit, misc)
print "********* Heart Spawn"
Unit:SetFaction(35)
x=Unit:GetX()
y=Unit:GetY()
z=Unit:GetZ()
o=Unit:GetO()
Unit:CreateCustomWaypointMap()
Unit:CreateWaypoint(x, y, z, o, 0, 0, 0)
Unit:MoveToWaypoint(0)
Unit:SpawnCreature(99993, x + 7, y + 7, z, o, 35, 14000)
Unit:SpawnCreature(99994, x + 7, y - 7, z, o, 35, 14000)
Unit:SpawnCreature(99995, x - 7, y + 7, z, o, 35, 14000)
Unit:SpawnCreature(99996, x - 7, y - 7, z, o, 35, 14000)
Unit:RegisterEvent("Heart_Out", 10000, 1)
Unit:RegisterEvent("Heart_Out2", 13000, 1)
Unit:Despawn(14000,0)
end
--##################################################################
--## Registers ##
--##################################################################
RegisterUnitEvent(99987,1,"Tri_OnCombat")
RegisterUnitEvent(99987,2,"Tri_OnKilledTarget")
RegisterUnitEvent(99987,3,"Tri_OnLeaveCombat")
RegisterUnitEvent(99987,4,"Tri_OnDied")
--##################################################################
RegisterUnitEvent(99992,6,"Heart_OnSpawn")