Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------
- -- By Stoneharry
- -- Variable Decleration
- -------------------------------------------------------------------------------------------------
- local DarrowID, TrishID, GarrashID, LachdananID = 280211, 280214, 280213, 280212
- local TrigAID, TrigBID, TrigCID, CrownID = 116860, 116861, 116862, 116863
- local TrigA, TrigB, TrigC, Crown = nil, nil, nil, nil
- local AddA, AddB, AddC, AddD = 179701, 179702, 179703, 179704
- local Trish, Garrash, Lachdanan = nil, nil, nil
- local OBJECT_END = 0x0006
- local UNIT_FIELD_BYTES_1 = OBJECT_END + 0x0044 -- Size: 1, Type: BYTES, Flags: PUBLIC
- local UNIT_FIELD_FLAGS = OBJECT_END + 0x0035 -- Size: 1, Type: INT, Flags: PUBLIC
- local UNIT_FLAG_NOT_SELECTABLE = 0x02000000 -- 26 33554432 cannot select the unit
- -------------------------------------------------------------------------------------------------
- function Evil_King_Darrow_OnSpawn(pUnit, Event)
- pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 0)
- pUnit:SetFaction(35)
- pUnit:RegisterEvent("Check_For_Players_KingDarrow", 2000, 0)
- end
- function Check_For_Players_KingDarrow(pUnit)
- local plr = pUnit:GetClosestPlayer()
- if plr ~= nil then
- if pUnit:GetDistanceYards(plr) < 20 then
- if Trish ~= nil and Garrash ~= nil and Lachdanan ~= nil then
- if Trish:IsAlive() and Garrash:IsAlive() and Lachdanan:IsAlive() then
- pUnit:RemoveEvents()
- pUnit:SendChatMessage(14,0,"You think you can kill me?! Knights defend me!")
- pUnit:RegisterEvent("Delay_Going_Underground_Timer_Darrow", 1500, 1)
- pUnit:RegisterEvent("Spawn_Npcs_One_at_A_Time_T", math.random(3000, 5000), 1)
- pUnit:RegisterEvent("Spawn_Npcs_One_at_A_Time_G", math.random(3000, 5000), 1)
- pUnit:RegisterEvent("Spawn_Npcs_One_at_A_Time_L", math.random(3000, 5000), 1)
- pUnit:RegisterEvent("All_Go_Hostile_And_Watch_The_Fireworks", 9000, 1)
- pUnit:RegisterEvent("Checkforalladdsdead_Knightsdefendme", 5000, 0)
- end
- end
- end
- end
- end
- function Delay_Going_Underground_Timer_Darrow(pUnit)
- pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 9)
- end
- function Spawn_Npcs_One_at_A_Time_T(pUnit)
- pUnit:CastSpellAoF(Trish:GetX(), Trish:GetY(), Trish:GetZ(), 55719)
- Trish:SetUInt32Value(UNIT_FIELD_BYTES_1, 0)
- end
- function Spawn_Npcs_One_at_A_Time_G(pUnit)
- pUnit:CastSpellAoF(Garrash:GetX(), Garrash:GetY(), Garrash:GetZ(), 55719)
- Garrash:SetUInt32Value(UNIT_FIELD_BYTES_1, 0)
- end
- function Spawn_Npcs_One_at_A_Time_L(pUnit)
- pUnit:CastSpellAoF(Lachdanan:GetX(), Lachdanan:GetY(), Lachdanan:GetZ(), 55719)
- Lachdanan:SetUInt32Value(UNIT_FIELD_BYTES_1, 0)
- end
- RegisterUnitEvent(DarrowID, 18, "Evil_King_Darrow_OnSpawn")
- function King_Evil_Death_Of_King(pUnit, Event)
- TrigA:RemoveAura(72405)
- pUnit:RemoveEvents()
- pUnit:Unroot()
- end
- RegisterUnitEvent(DarrowID, 4, "King_Evil_Death_Of_King")
- function King_Evil_Leave_Of_King(pUnit, Event)
- pUnit:RemoveEvents()
- pUnit:Unroot()
- end
- RegisterUnitEvent(DarrowID, 2, "King_Evil_Leave_Of_King")
- function All_Go_Hostile_And_Watch_The_Fireworks(pUnit)
- Trish:SetFaction(21)
- Garrash:SetFaction(21)
- Lachdanan:SetFaction(21)
- end
- function Checkforalladdsdead_Knightsdefendme(pUnit)
- if Trish ~= nil and Garrash ~= nil and Lachdanan ~= nil then
- if Trish:IsAlive() == false and Garrash:IsAlive() == false and Lachdanan:IsAlive() == false then
- pUnit:RemoveEvents()
- pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 0)
- pUnit:SendChatMessage(14,0,"You may have defeated my knights, but you shall never defeat me!")
- pUnit:RegisterEvent("Go_Hostile_Darrow_Guy", 5000, 1)
- end
- end
- end
- SetDBCSpellVar(17467, "c_is_flags", 0x01000)
- function Go_Hostile_Darrow_Guy(pUnit)
- pUnit:SetFaction(21)
- pUnit:CastSpell(17467) -- Aura
- pUnit:RegisterEvent("Phase_Two_Darrow_King", 2000, 0)
- --pUnit:RegisterEvent("SpawnCreatures_ThatWillHelp", 20000, 0)
- pUnit:RegisterEvent("Mean_Buff_King", 2000, 0)
- end
- function Mean_Buff_King(pUnit)
- local plr = pUnit:GetClosestPlayer()
- if plr ~= nil then
- pUnit:FullCastSpellOnTarget(48423, plr)
- end
- end
- function Phase_Two_Darrow_King(pUnit)
- if pUnit:GetHealthPct() < 90 then
- pUnit:SendChatMessage(14,0,"You will all burn!")
- pUnit:RemoveEvents()
- pUnit:Root()
- pUnit:SetCombatCapable(1)
- pUnit:CastSpell(54306) -- Protective bubble
- pUnit:ChannelSpell(30742, TrigB)
- TrigB:ChannelSpell(64367, TrigA)
- TrigA:ChannelSpell(40447, TrigB)
- pUnit:RegisterEvent("Spam_Explosions_On_People_Tehe_Darrow", 3000, 1)
- pUnit:RegisterEvent("Wait_thirty_seconds_For_next_phase", 33000, 1)
- end
- end
- function Spam_Explosions_On_People_Tehe_Darrow(pUnit)
- pUnit:RegisterEvent("Spam_Explosions_On_People_Tehe_Darrow", math.random(100, 1000), 1)
- local plr = pUnit:GetRandomPlayer(0)
- if plr ~= nil then
- pUnit:SpawnCreature(TrigCID, plr:GetX()+math.random(0,3), plr:GetY()-math.random(0,3), plr:GetZ()+math.random(0,6), 0, 21, 0)
- end
- end
- function Spam_Explosions_On_People_Tehe_Darrow_B(pUnit)
- pUnit:RegisterEvent("Spam_Explosions_On_People_Tehe_Darrow_B", math.random(500, 8000), 1)
- local plr = pUnit:GetRandomPlayer(0)
- if plr ~= nil then
- pUnit:SpawnCreature(TrigCID, plr:GetX()+math.random(0,3), plr:GetY()-math.random(0,3), plr:GetZ()+math.random(0,6), 0, 21, 0)
- end
- end
- function TrigC_OnSpawnDoShizzle(pUnit, Event)
- pUnit:RegisterEvent("boom_tehe_TrigCSpawned", math.random(500, 7000), 1)
- pUnit:Root()
- pUnit:SetCombatCapable(1)
- pUnit:SetFlying()
- pUnit:CastSpell(72262) -- Fun visual
- --pUnit:SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
- end
- function boom_tehe_TrigCSpawned(pUnit)
- pUnit:CastSpell(9433) -- Damage
- pUnit:CastSpell(48582) -- Visual
- pUnit:Despawn(3000, 0)
- end
- RegisterUnitEvent(TrigCID, 18, "TrigC_OnSpawnDoShizzle")
- function Wait_thirty_seconds_For_next_phase(pUnit)
- pUnit:RemoveEvents()
- TrigA:StopChannel()
- TrigB:StopChannel()
- pUnit:StopChannel()
- pUnit:Unroot()
- pUnit:SetCombatCapable(0)
- pUnit:RegisterEvent("SpawnCreatures_ThatWillHelp", 25000, 0)
- pUnit:RegisterEvent("SHADOWBOLT_BOOM", 5000, 0)
- pUnit:RegisterEvent("DeathAndDecay_Boss_king", math.random(12000,18000), 0)
- pUnit:RegisterEvent("Knockback_Of_Doom_Phase", 2000, 0)
- end
- function Knockback_Of_Doom_Phase(pUnit)
- if pUnit:GetHealthPct() < 50 then
- pUnit:SendChatMessage(14,0,"Enough! I grow tired of this.")
- pUnit:Root()
- pUnit:RemoveEvents()
- for a, plrs in pairs(pUnit:GetInRangePlayers()) do
- plrs:CastSpell(37968) -- Soaring
- end
- pUnit:RegisterEvent("Spam_Shadow_Bolts_Tehe", 500, 0)
- pUnit:RegisterEvent("resetbacktonormal", 20000, 0)
- end
- end
- function Spam_Shadow_Bolts_Tehe(pUnit)
- pUnit:FullCastSpell(17228)
- end
- function resetbacktonormal(pUnit)
- pUnit:RemoveEvents()
- for a, plrs in pairs(pUnit:GetInRangePlayers()) do
- plrs:Teleport(plrs:GetMapId(), pUnit:GetX(), pUnit:GetY(), pUnit:GetZ())
- plrs:CastSpell(64446) -- Teleport visual
- end
- pUnit:FullCastSpell(51110)
- pUnit:SendChatMessage(42,0,"King Darrow casts \124cff71d5ff\124Hspell:51110\124h[Empowered Arcane Explosion]\124h\124r!")
- pUnit:RegisterEvent("Reset_this_time_I_mean_seriously", 9000, 1)
- end
- function Reset_this_time_I_mean_seriously(pUnit)
- pUnit:RemoveEvents()
- pUnit:SendChatMessage(14,0,"I am invincible!")
- local pla = pUnit:GetRandomPlayer(0)
- if pla ~= nil then
- pUnit:FullCastSpellOnTarget(41272, pla) -- Charge
- end
- pUnit:Unroot()
- pUnit:RegisterEvent("SpawnCreatures_ThatWillHelp", 25000, 0)
- pUnit:RegisterEvent("SHADOWBOLT_BOOM", 5000, 0)
- pUnit:RegisterEvent("DeathAndDecay_Boss_king", math.random(12000,18000), 0)
- pUnit:RegisterEvent("Spam_Explosions_On_People_Tehe_Darrow_B", 3000, 1)
- pUnit:RegisterEvent("Mean_Buff_King", 6000, 0)
- pUnit:RegisterEvent("Final_Phase", 5000, 0)
- end
- function SHADOWBOLT_BOOM(pUnit)
- local plr = pUnit:GetRandomPlayer(0)
- if plr ~= nil then
- if math.random(1,2) == 1 then
- pUnit:FullCastSpellOnTarget(39026, plr) -- Shadow Bolt
- else
- pUnit:FullCastSpellOnTarget(51131, plr) -- Strangulate
- end
- end
- end
- function DeathAndDecay_Boss_king(pUnit)
- local plr = pUnit:GetRandomPlayer(0)
- if plr ~= nil then
- pUnit:CastSpellAoF(plr:GetX(), plr:GetY(), plr:GetZ(), 39658) -- Death and decay
- end
- end
- function SpawnCreatures_ThatWillHelp(pUnit)
- local i = 0
- while i ~= 4 do
- i = i + 1
- local plr = pUnit:GetRandomPlayer(0)
- if plr ~= nil then
- local choice = math.random(1,4)
- if choice == 1 then
- pUnit:SpawnCreature(AddA, plr:GetX()+math.random(0,3), plr:GetY()-math.random(0,3), plr:GetZ()+math.random(0,2), plr:GetO(), 21, 120000)
- elseif choice == 2 then
- pUnit:SpawnCreature(AddB, plr:GetX()+math.random(0,3), plr:GetY()+math.random(0,3), plr:GetZ()+math.random(0,3), plr:GetO(), 21, 120000)
- elseif choice == 3 then
- pUnit:SpawnCreature(AddC, plr:GetX()+math.random(0,3), plr:GetY()+math.random(0,3), plr:GetZ()+math.random(0,3), plr:GetO(), 21, 120000)
- elseif choice == 4 then
- pUnit:SpawnCreature(AddD, plr:GetX()+math.random(0,3), plr:GetY()+math.random(0,3), plr:GetZ()+math.random(0,3), plr:GetO(), 21, 120000)
- end
- end
- end
- end
- function AddsSpawn(pUnit, Event)
- pUnit:Root()
- pUnit:RegisterEvent("Wait_For_VISUAL", 750, 1)
- pUnit:EquipWeapons(5742,0,39296)
- end
- function Wait_For_VISUAL(pUnit)
- pUnit:Unroot()
- pUnit:CastSpell(39180) -- Visual
- end
- RegisterUnitEvent(AddA, 18, "AddsSpawn")
- RegisterUnitEvent(AddB, 18, "AddsSpawn")
- RegisterUnitEvent(AddC, 18, "AddsSpawn")
- RegisterUnitEvent(AddD, 18, "AddsSpawn")
- function Final_Phase(pUnit)
- if pUnit:GetHealthPct() < 20 then
- pUnit:Root()
- pUnit:SendChatMessage(14,0,"You cannot defeat me! Not while my source of power still thrives...")
- pUnit:SetCombatCapable(1)
- pUnit:RemoveEvents()
- pUnit:CastSpell(22663) -- Invincible
- pUnit:SpawnCreature(CrownID, TrigA:GetX(), TrigA:GetY(), TrigA:GetZ(), 0, 21, 0)
- pUnit:RegisterEvent("Wait_For_Crown_To_Define_Ololololol", 2000, 1)
- pUnit:RegisterEvent("Check_Crown_Health", 2000, 0)
- end
- end
- function Wait_For_Crown_To_Define_Ololololol(pUnit)
- Crown:CastSpell(64446) -- Teleport Visual
- Crown:CastSpell(55928) -- Crown shield visual
- Crown:SetCombatCapable(1)
- Crown:Root()
- Crown:SetScale(2)
- pUnit:ChannelSpell(30742, TrigB)
- TrigB:ChannelSpell(64367, TrigA)
- TrigA:ChannelSpell(40447, TrigB)
- end
- function Check_Crown_Health(pUnit)
- if Crown:IsAlive() == false then
- pUnit:SendChatMessage(14,0,"How is this possible?!")
- pUnit:Unroot()
- pUnit:RemoveEvents()
- pUnit:RemoveAura(22663) -- invincible
- pUnit:SetCombatCapable(0)
- pUnit:StopChannel()
- TrigA:StopChannel()
- TrigB:StopChannel()
- pUnit:RegisterEvent("Spam_Explosions_On_People_Tehe_Darrow", 5000, 1)
- end
- end
- -------------------------------------------------------------------------------------------------
- function Define_Trish_OnSpawn(pUnit, Event)
- pUnit:SetFaction(35)
- pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 9)
- Trish = pUnit
- end
- function Define_Trish_OnDeath(pUnit, Event)
- pUnit:RemoveEvents()
- end
- RegisterUnitEvent(TrishID, 18, "Define_Trish_OnSpawn")
- RegisterUnitEvent(TrishID, 4, "Define_Trish_OnDeath")
- function Define_Trish_OnLeave(pUnit, Event)
- pUnit:RemoveEvents()
- end
- RegisterUnitEvent(TrishID, 2, "Define_Trish_OnLeave")
- function Define_Garrash_OnSpawn(pUnit, Event)
- pUnit:SetFaction(35)
- pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 9)
- Garrash = pUnit
- end
- function Define_Garrash_OnDeath(pUnit, Event)
- pUnit:RemoveEvents()
- end
- function Define_Garrosh_OnLeave(pUnit, Event)
- pUnit:RemoveEvents()
- end
- RegisterUnitEvent(GarrashID, 2, "Define_Garrosh_OnLeave")
- RegisterUnitEvent(GarrashID, 4, "Define_Garrash_OnDeath")
- RegisterUnitEvent(GarrashID, 18, "Define_Garrash_OnSpawn")
- function Define_Lachdanan_OnSpawn(pUnit, Event)
- pUnit:SetFaction(35)
- pUnit:SetUInt32Value(UNIT_FIELD_BYTES_1, 9)
- Lachdanan = pUnit
- end
- function Define_Lachdanan_OnDeath(pUnit, Event)
- pUnit:RemoveEvents()
- end
- RegisterUnitEvent(LachdananID, 4, "Define_Lachdanan_OnDeath")
- RegisterUnitEvent(LachdananID, 18, "Define_Lachdanan_OnSpawn")
- function Define_Lachdanan_OnLeave(pUnit, Event)
- pUnit:RemoveEvents()
- end
- RegisterUnitEvent(LachdananID, 2, "Define_Lachdanan_OnLeave")
- -------------------------------------------------------------------------------------------------
- function Define_Lachdanan_OnCombat(pUnit, Event) -- Warrior
- pUnit:RegisterEvent("Cast_A_Spell_Lachdanan", math.random(5000, 15000), 1)
- end
- function Cast_A_Spell_Lachdanan(pUnit)
- if math.random(1,2) == 1 then
- pUnit:FullCastSpell(36132) -- Whirlwind
- pUnit:RegisterEvent("Cast_A_Spell_Lachdanan", math.random(5000, 15000), 1)
- else
- pUnit:FullCastSpellOnTarget(58504, pUnit:GetMainTank()) -- Strike
- pUnit:RegisterEvent("Cast_A_Spell_Lachdanan", math.random(2000, 10000), 1)
- end
- end
- function Define_Trish_OnCombat(pUnit, Event) -- Mage
- pUnit:Root()
- pUnit:RegisterEvent("Cast_A_Spell_Trish", 1000, 0)
- end
- function Cast_A_Spell_Trish(pUnit)
- pUnit:CastSpell(52662) -- Visual
- pUnit:FullCastSpell(17228) -- Shadowbolt Volley
- end
- function Define_Garrash_OnCombat(pUnit, Event) -- Paladin
- pUnit:CastSpell(51126) -- Shadowform visual
- pUnit:RegisterEvent("HealAllies_Lol_PallY", 6000, 0)
- end
- function HealAllies_Lol_PallY(pUnit)
- if Trish:GetHealthPct() < 50 and Trish:IsAlive() then
- pUnit:FullCastSpellOnTarget(58153, Trish) -- Heal
- elseif Lachdanan:GetHealthPct() < 50 and Lachdanan:IsAlive() then
- pUnit:FullCastSpellOnTarget(58153, Lachdanan) -- Heal
- end
- end
- RegisterUnitEvent(TrishID, 1, "Define_Trish_OnCombat")
- RegisterUnitEvent(LachdananID, 1, "Define_Lachdanan_OnCombat")
- RegisterUnitEvent(GarrashID, 1, "Define_Garrash_OnCombat")
- -------------------------------------------------------------------------------------------------
- function TrigA_SpawnDefine(pUnit, Event)
- pUnit:CastSpell(72405)
- TrigA = pUnit
- end
- RegisterUnitEvent(TrigAID, 18, "TrigA_SpawnDefine")
- function TrigB_SpawnDefine(pUnit, Event)
- TrigB = pUnit
- end
- RegisterUnitEvent(TrigBID, 18, "TrigB_SpawnDefine")
- function Crown_Spawn_Define(pUnit, Event)
- pUnit:Root()
- Crown = pUnit
- end
- RegisterUnitEvent(CrownID, 18, "Crown_Spawn_Define")
- -------------------------------------------------------------------------------------------------
- -------------------------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment