Code:
--[[--///////////////////////////////////////////////////////////
Archmage Vargoth made by Myzt
Originally for Netherstorm Wow.
////////////////////////////////////////////////////////////////--]]--
--[[---------Phase 1 Abilities-----------------]]--
function Vargoth_Arcanebolt(pUnit, Event)
local boltTarg = pUnit:GetRandomPlayer(0)
pUnit:FullCastSpellOnTarget(38823, boltTarg)
end
function Vargoth_Arcanebomb(pUnit, Event)
pUnit:CastSpell(19821)
end
function Vargoth_Magpull(pUnit, Event)
local MagpullTarget = pUnit:GetRandomPlayer(7)
pUnit:FullCastSpellOnTarget(32039, MagpullTarget)
end
--[[--------Phase 1--------------------------]]--
function Vargoth_Phase1(pUnit, Event)
if pUnit:GetHealthPct() <= 99 then
pUnit:RegisterEvent("Vargoth_Arcanebolt", 12000, 0)
pUnit:RegisterEvent("Vargoth_Arcanebomb", 6000, 0)
pUnit:RegisterEvent("Vargoth_Magpull", 20000, 0)
end
end
--[[--------Phase 2 Abilities-----------------]]--
function Vargoth_Spiribolts(pUnit, Event)
pUnit:FullCastSpell(43383)
end
function Vargoth_Diminishsoul(pUnit, Event)
local soulTarget = GetRandomPlayer(0)
pUnit:FullCastSpellOnTarget(38848, soulTarget)
end
--[[--------Phase 2--------------------------]]--
function Vargoth_Phase2(pUnit, Event)
if pUnit:GetHealthPct() <= 75 then
pUnit:SendChatMessage(5, 0, "The infection... Is making me weak...")
pUnit:SendChatMessage(5, 0, "Yours souls belong to me now!")
pUnit:RemoveEvents()
pUnit:RegisterEvent("Vargoth_Spiritbolts", 60000, 0)
pUnit:RegisterEvent("Vargoth_Diminishsoul", 5000, 0)
pUnit:RegisterEvent("Vargoth_Phase3", 1000, 0)
end
end
--[[--------Phase 3 Abilities-----------------]]--
function Vargoth_Minions(pUnit, Event)
pUnit:SpawnCreature(1000061, 2233, 2260, 134.875112, 530, 1000000)
pUnit:SpawnCreature(1000061, 2237, 2220, 136.679474, 530, 1000000)
end
function Vargoth_Shield(pUnit, Event)
pUnit:CastSpell(31901)
end
function Vargoth_Aoe(pUnit, Event)
pUnit:CastSpell(35152)
end
--[[--------Phase 3--------------------------]]--
function Vargoth_Phase3(pUnit, Event)
if pUnit:GetHealthPct() <= 60 then
pUnit:RemoveEvents()
pUnit:SendChatMessage(5, 0, "I feel the power coming back... I'm more powerful then ever! The shadows will prevail! And you will DIE!")
pUnit:RegisterEvent("Vargoth_Minions", 500, 10)
pUnit:RegisterEvent("Vargoth_Aoe", 2000, 0)
pUnit:RegisterEvent("Vargoth_Phase4", 1000, 0)
end
end
--[[--------Phase 4 Abilities------------------]]--
function Vargoth_Shadownova(pUnit, Event)
pUnit:CastSpell(30852)
end
function Vargoth_Energy(pUnit, Event)
local energyTarget = pUnit:GetRandomPlayer(7)
pUnit:FullCastSpellOnTarget(46285, energyTarget)
end
function Vargoth_Missiles(pUnit, Event)
local missileTarget = pUnit:GetRandomPlayer(0)
pUnit:FullCastSpellOnTarget(38147, missileTarget)
end
--[[--------Phase 4---------------------------]]--
function Vargoth_Phase4(pUnit, Event)
if pUnit:GetHealthPct() <=40 then
pUnit:RemoveEvents()
pUnit:SendChatMessage(5, 0, "The shadows is stronger than ever!")
pUnit:RegisterEvent("Vargoth_Shadownova", 25000, 0)
pUnit:RegisterEvent("Vargoth_Energy", 8000, 0)
pUnit:RegisterEvent("Vargoth_Missiles", 9200, 0)
pUnit:registerEvent("Vargoth_Phase5", 1000, 0)
end
end
--[[--------Phase 5 Abilities------------------]]--
function Vargoth_Felcleave(pUnit, Event)
local cleaveTarget = pUnit:GetMainTank()
pUnit:CastSpellOnTarget(38742, cleaveTarget)
end
function Vargoth_Dragonbane(pUnit, Event)
pUnit:CastSpell(23967)
end
function Vargoth_Bloodcurse(pUnit, Event)
local bloodTarget = pUnit:GetMainTank()
pUnit:FullCastSpellOnTarget(40412, bloodTarget)
end
--[[--------Phase 5---------------------------]]--
function Vargoth_Phase5(pUnit, Event)
if pUnit:GetHealthPct() <= 20 then
pUnit:RemoveEvents()
pUnit:SendChatMessage(5, 0, "Ahaha this is so much better then your weak magic!")
pUnit:RegisterEvent("Vargoth_Bloodcurse", 90000, 0)
pUnit:RegisterEvent("Vargoth_Dragonbane", 10000, 0)
pUnit:RegisterEvent("Vargoth_Felcleave", 15000, 0)
end
end
--[[---------Primary Functions---------------]]--
function Vargoth_Oncombat(pUnit, Event)
pUnit:SendChatMessage(5, 0, "Kirin'Tor will fall! You all will fail!")
pUnit:RegisterEvent("Vargoth_Phase1", 1000, 0)
end
function Vargoth_WhenKilled(pUnit, Event)
pUnit:SendChatMessage(5, 0, "The pain... I feel my flesh rotten... Please forgive me...")
pUnit:SendChatMessage(5, 0, "I'm lost in the darkness...")
end
RegisterUnitEvent(100060, 1, "Vargoth_Oncombat")
RegisterUnitEvent(100060, 4, "Vargoth_WhenKilled")