Code:
function Knight_OnCombat(Unit, event)
Unit:SendChatMessage(14, 0, "You dare challenge me? I am your worst NIGHTMARE!")
Unit:EquipWeapons(40343, 0, 0)
Unit:RegisterEvent("Knight_Phase1Checker", 1000, 0)
end
RegisterUnitEvent(141001, 1, "Knight_OnCombat")
function Knight_Phase1Checker(Unit, event)
if(Unit:GetHealthPct() <= 85) then
Unit:RemoveEvents()
Unit:SendChatMessage(14, 0, "Do you want to see a true Cataclysm!? So be it!")
Unit:RegisterEvent("Ghoulzzzz", 30000, 0)
Unit:RegisterEvent("Quakemoar", 45000, 0)
Unit:RegisterEvent("DrainLifeZor", 23000, 0)
Unit:RegisterEvent("Knight_Phase2Checker", 1000, 0)
end
end
function Ghoulzzzz(Unit, event)
local player = Unit:GetRandomPlayer(0)
if player then
local x, y, z = player:GetX(), player:GetY(), player:GetZ()
Unit:CastSpellAoF(x, y, z, 67761)
Unit:SendChatMessage(42, 0, "The Black Knight begins to summon his minions!")
Unit:SendChatMessage(14, 0, "Rise, my minions and obey your master's call! Destroy our enemies!")
end
end
function Quakemoar(Unit, event)
local targets = Unit:GetInRangePlayers()
for _,v in pairs(targets) do
Unit:FullCastSpellOnTarget(72262, v)
Unit:SendChatMessage(42, 0, "The Black Knight begins to cast Quake")
Unit:SendChatMessage(14, 0, "You will all bow before your beloved master!")
end
end
function DrainLifeZor(Unit, event)
local victim = Unit:GetRandomPlayer(0)
if victim then
Unit:FullCastSpellOnTarget(38817, victim)
local Choice = math.random(1, 2)
if(Choice == 1) then
Unit:SendChatMessage(14, 0, "Your life is so full of energy!")
end
if(Choice == 2) then
Unit:SendChatMessage(14, 0, "How long can you resist?")
end
end
end
function Knight_Phase2Checker(Unit, event)
if(Unit:GetHealthPct() <= 50) then
Unit:RemoveEvents()
Unit:RegisterEvent("ShadowBoltVolleyz", 30000, 0)
Unit:RegisterEvent("FrostNovaz", 30000, 0)
Unit:RegisterEvent("Knight_Phase3Checker", 1000, 0)
end
end
function ShadowBoltVolleyz(Unit, event)
local targets = Unit:GetInRangePlayers()
for _,v in pairs(targets) do
Unit:FullCastSpellOnTarget(36736, v)
end
end
function FrostNovaz(Unit, event)
local targets = Unit:GetInRangePlayers()
local Choice = math.random(1, 2)
for _,v in pairs(targets) do
Unit:FullCastSpellOnTarget(32365, v)
end
Unit:SendChatMessage(42, 0, "The Black Knight froze you and teleported to the Center of the Area. The Black Knight begins to cast Shadow Bolt Volley")
if(Choice == 1) then
Unit:SendChatMessage(14, 0, "Now, you will all die before me!")
end
if(Choice == 2) then
Unit:SendChatMessage(14, 0, "Die, mortals! DIE!")
end
end
function Knight_Phase3Checker(Unit, event)
if(Unit:GetHealthPct() <= 25) then
Unit:RemoveEvents()
Unit:SendChatMessage(14, 0, "No, I shall not be defeated by mortals! Minions, aid me!")
Unit:RegisterEvent("Summon_Advanced_Minions", 1000, 1)
Unit:RegisterEvent("Healzzzzzzzzzzzzzzz", 2000, 5)
Unit:RegisterEvent("Knight_FinalPhaseChecker", 1000, 0)
end
end
function Summon_Advanced_Minions(Unit, event)
local player = GetClosestPlayer()
if player then
local x, y, z = player:GetX(), player:GetY(), player:GetZ()
Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
Unit:SpawnCreature(14385, x, y, z, math.random(1, 5), 14, 0, 0, 0, 0, 4, 1)
end
end
function Healzzzzzzzzzzzzzzz(Unit, event)
Unit:FullCastSpell(66104)
end
function Knight_FinalPhaseChecker(Unit, player, event)
if(Unit:GetHealthPct() < 11) then
Unit:RemoveEvents()
Unit:SetFaction(35)
player:StopPlayerAttack()
Unit:Emote(1, 0)
Unit:SendChatMessage(12, 0, "I... I've killed so many that I've lost count... I can't come back from this. I'm a monster! But, I am still somewhere inside, more than that...")
Unit:EventChat(12, 0, "Better... Than that.", 10000)
Unit:RegisterEvent("Suicidezzzzzzzzzzzzzzz", 3000, 1)
end
end
function Suicidezzzzzzzzzzzzzzz(Unit, event)
Unit:CastSpell(59084)
Unit:Kill(Unit)
end