Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variables
- local Krasus
- local VH_Spawn1
- local VH_Spawn2
- local VH_Spawn3
- local VH_Spawn4
- local VH_Spawn5
- local GossipGuy
- local Controll
- local Portal_1
- local Portal_2
- local OBJECT_END = 0x006
- local UNIT_FIELD_FLAGS = OBJECT_END + 0x028
- local UNIT_FLAG_NOT_ATTACKABLE_2 = 0x00000002
- local Add_One
- local Add_Two
- -- Here we have the channeling parts
- function VH_KrasusBeams(pUnit, event)
- Krasus = pUnit
- VH_Spawn1:ChannelSpell(47855, Krasus)
- VH_Spawn2:ChannelSpell(47855, Krasus)
- VH_Spawn3:ChannelSpell(47855, Krasus)
- VH_Spawn4:ChannelSpell(47855, Krasus)
- VH_Spawn5:ChannelSpell(47855, Krasus)
- Krasus:ChannelSpell(47855, VH_Spawn3)
- end
- RegisterUnitEvent(836733, 18, "VH_KrasusBeams")
- function Minion1(pUnit, event)
- VH_Spawn1 = pUnit
- end
- RegisterUnitEvent(499940, 18, "Minion1")
- function Minion2(pUnit, event)
- VH_Spawn2 = pUnit
- end
- RegisterUnitEvent(499941, 18, "Minion2")
- function Minion3(pUnit, event)
- VH_Spawn3 = pUnit
- end
- RegisterUnitEvent(499942, 18, "Minion3")
- function Minion4(pUnit, event)
- VH_Spawn4 = pUnit
- end
- RegisterUnitEvent(499943, 18, "Minion4")
- function Minion5(pUnit, event)
- VH_Spawn5 = pUnit
- end
- RegisterUnitEvent(499944, 18, "Minion5")
- -- Here we have our gossip to start it
- function VH_KrasusSpeak(pUnit, event, player)
- pUnit:GossipCreateMenu(70015, player, 0)
- pUnit:GossipMenuAddItem(0, "I am ready to fight the boss. (You only get one try!)", 10, 0)
- pUnit:GossipMenuAddItem(0, "I need some more time to prepare.", 20, 0)
- pUnit:GossipSendMenu(player)
- end
- function VH_KrasusSelect(pUnit, event, player, id, intid, code)
- if (intid == 10) then
- pUnit:GossipCreateMenu(70016, player, 0)
- pUnit:GossipMenuAddItem(4, "I am ready. (You only get one try!)", 11, 0)
- pUnit:GossipMenuAddItem(4, "I am not.", 21, 0)
- pUnit:GossipSendMenu(player)
- end
- if (intid == 11) then
- pUnit:RegisterEvent("VH_StartInstance", 2000, 1)
- GossipGuy = pUnit
- Krasus:StopChannel()
- VH_Spawn1:StopChannel()
- VH_Spawn2:StopChannel()
- VH_Spawn3:StopChannel()
- VH_Spawn4:StopChannel()
- VH_Spawn5:StopChannel()
- pUnit:SetNPCFlags(2)
- pUnit:SpawnCreature(499945, 1616, 414, 94, 3.198040, 35, 0)
- pUnit:SendChatMessage(12, 0, "Very well, Get ready people!")
- player:GossipComplete()
- end
- if (intid == 20) then
- player:SendBroadcastMessage("Take your time.")
- player:SendAreaTriggerMessage("Take your time.")
- player:GossipComplete()
- end
- if (intid == 21) then
- player:SendBroadcastMessage("Take your time.")
- player:SendAreaTriggerMessage("Take your time.")
- player:GossipComplete()
- end
- end
- RegisterUnitGossipEvent(359763, 1, "VH_KrasusSpeak")
- RegisterUnitGossipEvent(359763, 2, "VH_KrasusSelect")
- -- Controll Npc
- RegisterUnitEvent(499945, 18, "ControllNpc")
- function ControllNpc(pUnit, event)
- Controll = pUnit
- pUnit:SetScale(0.01)
- GossipGuy:PlaySoundToSet(11707) -- Dramatic?
- GossipGuy:ChannelSpell(47855, Krasus)
- Krasus:ChannelSpell(47855, GossipGuy)
- pUnit:RegisterEvent("Start_Talking_Etc_Etc", 5000, 0)
- end
- function Start_Talking_Etc_Etc(pUnit, event)
- pUnit:RemoveEvents()
- VH_Spawn1:SendChatMessage(14, 0, "Your a fool! Without us he will break free!")
- pUnit:RegisterEvent("Start_Talking_Etc_Etc_Etc", 5000, 0)
- end
- function Start_Talking_Etc_Etc_Etc(pUnit, event)
- pUnit:RemoveEvents()
- VH_Spawn5:SendChatMessage(14, 0, "We cant let you get away with this!")
- VH_Spawn1:SetFaction(21)
- VH_Spawn2:SetFaction(21)
- VH_Spawn3:SetFaction(21)
- VH_Spawn4:SetFaction(21)
- VH_Spawn5:SetFaction(21)
- pUnit:RegisterEvent("CheckMobOne", 1000, 0)
- end
- -- This is checking for 1st 5 mobs death
- function CheckMobOne(pUnit, event)
- if VH_Spawn1:GetHealthPct() <= 2 then
- pUnit:RemoveEvents()
- VH_Spawn1:SendChatMessage(14, 0, "Fight on brothers!")
- pUnit:RegisterEvent("CheckMobTwo", 3000, 0)
- end
- end
- function CheckMobTwo(pUnit, event)
- if VH_Spawn2:GetHealthPct() <= 2 then
- pUnit:RemoveEvents()
- VH_Spawn2:SendChatMessage(14, 0, "I will be avenged!")
- pUnit:RegisterEvent("CheckMobThree", 3000, 0)
- end
- end
- function CheckMobThree(pUnit, event)
- if VH_Spawn3:GetHealthPct() <= 2 then
- pUnit:RemoveEvents()
- VH_Spawn3:SendChatMessage(14, 0, "It is futile to resist!")
- pUnit:RegisterEvent("CheckMobFour", 3000, 0)
- end
- end
- function CheckMobFour(pUnit, event)
- if VH_Spawn4:GetHealthPct() <= 2 then
- pUnit:RemoveEvents()
- VH_Spawn4:SendChatMessage(14, 0, "Don't let him escape the prison! Destroy the Intruders!")
- pUnit:RegisterEvent("CheckMobFive", 3000, 0)
- end
- end
- function CheckMobFive(pUnit, event)
- if VH_Spawn5:GetHealthPct() <= 2 then
- pUnit:RemoveEvents()
- VH_Spawn5:SendChatMessage(12, 0, "Mortals, you have doomed us all...")
- pUnit:RegisterEvent("FreeBoss_Tehe_Tehe", 5000, 0)
- end
- end
- function FreeBoss_Tehe_Tehe(pUnit, event)
- pUnit:RemoveEvents()
- GossipGuy:StopChannel()
- Krasus:StopChannel()
- Krasus:SendChatMessage(14, 0, "...and I am FREE!")
- Krasus:CastSpell(51110)
- Krasus:CastSpell(54306)
- Krasus:MoveTo(1613, 452, 94, 0.039271)
- GossipGuy:Emote(45, 10000)
- pUnit:RegisterEvent("Suicide_Lol", 5000, 0)
- end
- function Suicide_Lol(pUnit, event)
- pUnit:RemoveEvents()
- GossipGuy:SendChatMessage(12, 0, "I shall destroy you once and for all!")
- pUnit:RegisterEvent("Suicide_Lol_Lol", 4000, 0)
- end
- function Suicide_Lol_Lol(pUnit, event)
- pUnit:RemoveEvents()
- Krasus:SendChatMessage(12, 0, "You can not if your dead.")
- Krasus:FullCastSpellOnTarget(31984, GossipGuy)
- pUnit:RegisterEvent("Suicide_Lol_Lol_Lol", 3500, 0)
- end
- function Suicide_Lol_Lol_Lol(pUnit, event)
- pUnit:RemoveEvents()
- GossipGuy:Despawn(1000,0)
- Krasus:SendChatMessage(12, 0, "Now you shall be destroyed.")
- pUnit:RegisterEvent("Suicide_Lol_Lol_Lol_Lol", 2500, 0)
- end
- function Suicide_Lol_Lol_Lol_Lol(pUnit, event)
- pUnit:RemoveEvents()
- Krasus:SetFaction(21)
- pUnit:RegisterEvent("Suicide_Lol_Lol_Lol_Lol_Lol", 5000, 0)
- end
- function Suicide_Lol_Lol_Lol_Lol_Lol(pUnit, event)
- pUnit:RemoveEvents()
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0)) -- CURSE EVERYONE!!! >.>
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- pUnit:RegisterEvent("ExplosionThenSpells_Tehe", 20000, 0)
- end
- function ExplosionThenSpells_Tehe(pUnit, event)
- pUnit:RemoveEvents()
- Krasus:CastSpell(36092)
- Krasus:StopMovement(999999)
- pUnit:RegisterEvent("LetsCastSomeNastySpells", 3001, 0)
- pUnit:RegisterEvent("EndThisRandomCrapTehe", 25000, 0)
- end
- function LetsCastSomeNastySpells(pUnit, event)
- Krasus:FullCastSpellOnTarget(39252, Krasus:GetRandomPlayer(0)) -- Ok it works but he moves and it can be inturupted :S
- end
- function EndThisRandomCrapTehe(pUnit, event)
- pUnit:RemoveEvents()
- Krasus:CastSpell(22663) -- We may need to do it again incase of stun? (Imunes to all)
- Krasus:StopMovement(999999999)
- Krasus:SetCombatCapable(1)
- Krasus:SendChatMessage(12, 0, "Mortals, did you really believe you would defeat me?")
- pUnit:RegisterEvent("MoveToCentreOfTheRoom", 2500, 0)
- end
- function MoveToCentreOfTheRoom(pUnit, event)
- pUnit:RemoveEvents()
- Krasus:MoveTo(1591, 451, 98, 6.272190) -- This will be on top of the platform
- pUnit:RegisterEvent("MoveToCentreOfTheRoom_Now", 10000, 0) -- 10 seconds should give him long enough to get there, or more do you think?
- end
- function MoveToCentreOfTheRoom_Now(pUnit, event)
- pUnit:RemoveEvents()
- pUnit:SpawnCreature(111000, 1597, 414, 94, 1.830532, 35, 0) -- These are the portals minions will come out of
- pUnit:SpawnCreature(111001, 1594, 491, 94, 4.798336, 35, 0)
- Krasus:SendChatMessage(14, 0, "Come my minions!")
- pUnit:RegisterEvent("MoveToCentreOfTheRoom_Now_Now", 2500, 0)
- end
- -- Portal effects and flags
- RegisterUnitEvent(111000, 18, "Portal_One_For_Minions")
- function Portal_One_For_Minions(pUnit, event)
- Portal_1 = pUnit
- -- pUnit:FullCastSpell(40280) -- Disabled, not needed
- Portal_1:SetFieldFlags(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2) -- Now he cant be attacked to break the event
- end
- RegisterUnitEvent(111001, 18, "Portal_Two_For_Minions")
- function Portal_Two_For_Minions(pUnit, event)
- Portal_2 = pUnit
- -- pUnit:FullCastSpell(40280) -- Disabled, not needed
- Portal_2:SetFieldFlags(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2) -- Now he cant be attacked to break the event
- end
- -- End portal stuff
- function MoveToCentreOfTheRoom_Now_Now(pUnit, event)
- pUnit:RemoveEvents()
- pUnit:SpawnGameObject(189997, 1655, 453, 93, 3.157301, 120000) -- We need to stop them running away
- Portal_2:FullCastSpell(40280) -- Portal effect, make sure it's Full not Cast?... Update: Works now!
- Portal_1:FullCastSpell(40280) -- Portal effect, make sure it's Full not Cast?... Update: Works now!
- Krasus:ChannelSpell(47855, Portal_1)
- Portal_2:ChannelSpell(47855, Krasus) -- Maybe he can only channel to 1 at a time?]]
- pUnit:RegisterEvent("ComeOnAddsSpawnAlready", 7500, 0)
- end
- ---------------------------
- -- Coords -----------------
- ---------------------------
- -- ___________ -
- -- / Top \ -
- -- ¦ A D ¦ -
- -- \____ E ____/ -
- -- -
- -- A = Left -
- -- D = Right -
- -- E = Enterance -
- ---------------------------
- -- x y z o Map = 603 -
- ---------------------------
- -- A = 1597, 415, 94, 1.5 -
- -- D = 1596, 488, 94, 4.6 -
- ---------------------------
- ---------------------------
- RegisterUnitEvent(111003, 18, "gAgdd_One_For_Minions")
- function gAgdd_One_For_Minions(pUnit, event) -- A
- Add_One = pUnit
- Add_One:SendChatMessage(14, 0, "Mortals will perish!")
- Add_One:MoveTo(1625,445,94,0.777544) -- Use exact, not variable
- end
- RegisterUnitEvent(111004, 18, "gAgdd_Two_For_Minions")
- function gAgdd_Two_For_Minions(pUnit, event) -- D
- Add_Two = pUnit
- Add_Two:SendChatMessage(14, 0, "For the master!")
- Add_Two:MoveTo(1626,462,94,5.743618) -- Use exact, not variable
- end
- function ComeOnAddsSpawnAlready(pUnit, event)
- pUnit:RemoveEvents()
- -- local x = Krasus:GetX()
- -- local y = Krasus:GetY() -- Un-needed since 2 mobs using same variables = buggy
- -- local z = Krasus:GetZ()
- -- local o = Krasus:GetO()
- pUnit:SpawnCreature(111003, 1597, 415, 94, 1.5, 20, 0) -- A
- pUnit:SpawnCreature(111004, 1596, 488, 94, 4.6, 20, 0) -- D
- pUnit:RegisterEvent("ComeOnAddsSpawnAlready_Go", 1000, 0)
- end
- function ComeOnAddsSpawnAlready_Go(pUnit, event)
- if Add_One:GetHealthPct() <= 2 then
- pUnit:RemoveEvents()
- Add_One:SendChatMessage(14, 0, "I am invincible!")
- pUnit:RemoveEvents()
- pUnit:RegisterEvent("ComeOnAddsSpawnAlready_Go_Go", 1000, 0)
- end
- end
- function ComeOnAddsSpawnAlready_Go_Go(pUnit, event)
- if Add_Two:GetHealthPct() <= 2 then
- pUnit:RemoveEvents()
- Add_Two:SendChatMessage(15, 0, "No...")
- pUnit:RemoveEvents()
- pUnit:RegisterEvent("ComeOnAddsSpawnAlready_Go_Go_Go", 5000, 0)
- end
- end
- function ComeOnAddsSpawnAlready_Go_Go_Go(pUnit, event)
- pUnit:RemoveEvents()
- Krasus:StopChannel()
- Portal_2:StopChannel()
- pUnit:RegisterEvent("ComeOnAddsSpawnAlready_Go_Go_Go_Go", 2500, 0)
- end
- function ComeOnAddsSpawnAlready_Go_Go_Go_Go(pUnit, event)
- pUnit:RemoveEvents()
- Portal_1:Despawn(1000,0)
- Portal_2:Despawn(1000,0) -- Simpler than killing em
- Krasus:SendChatMessage(14,0,"You have not won yet!")
- Krasus:StopMovement(1000) -- Resets movement
- Krasus:RemoveAura(22663) -- Removes Imune
- Krasus:SetCombatCapable(0) -- Let him attack!
- Krasus:FullCastSpell(17695) -- -100 shadow reistance every few seconds to nearby people
- pUnit:RegisterEvent("Knock_Knock_Whos_There", 15000, 0)
- pUnit:RegisterEvent("Knock_Knock_Whos_There_Boom", 7000, 0)
- pUnit:RegisterEvent("Knock_Knock_Whos_There_Boom_End", 30100, 0)
- end
- function Knock_Knock_Whos_There(pUnit, event)
- local screwerup = Krasus:GetMainTank()
- if (screwerup ~= nil) then
- Krasus:ClearThreatList()
- Krasus:FullCastSpellOnTarget(24199, screwerup)
- Krasus:SendChatMessage(42, 0, "The main tank is knocked away!")
- else
- end
- end
- function Knock_Knock_Whos_There_Boom(pUnit, event)
- Krasus:FullCastSpell(60851)
- end
- function Knock_Knock_Whos_There_Boom_End(pUnit, event)
- pUnit:RemoveEvents()
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0)) -- CURSE EVERYONE AGAIN!!! <.>
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:FullCastSpellOnTarget(43439, Krasus:GetRandomPlayer(0))
- Krasus:CastSpell(28531) -- frost aura
- pUnit:RegisterEvent("Let_It_Rain", 5000, 0)
- pUnit:RegisterEvent("Restart_These_Spells_Again", 36000, 0)
- end
- function Let_It_Rain(pUnit, event)
- Krasus:CastSpell(38635) -- rain of fire
- end
- function Restart_These_Spells_Again(pUnit, event)
- pUnit:RemoveEvents()
- pUnit:RegisterEvent("Knock_Knock_Whos_There", 15000, 0)
- pUnit:RegisterEvent("Knock_Knock_Whos_There_Boom", 7000, 0)
- pUnit:RegisterEvent("EndThisRandomCrapTehe", 45000, 0) -- Start of script
- end
- -- If the boss dies or leaves combat.
- RegisterUnitEvent(836733, 4, "VH_KrasusDie")
- function VH_KrasusDie(pUnit, event)
- pUnit:RemoveEvents()
- Controll:Despawn(1000,0)
- pUnit:PlaySoundToSet(11652)
- x = Krasus:GetX()
- y = Krasus:GetY()
- z = Krasus:GetZ()
- o = Krasus:GetO()
- Krasus:SpawnCreature(555331,x,y,z,o,35,0)
- end
- -- vendor
- RegisterUnitEvent(555331, 18, "Vendor_On_Spawn_Move")
- function Vendor_On_Spawn_Move(pUnit, event)
- pUnit:MoveTo(1617,453,94,6.254140) -- Near start
- pUnit:SendChatMessage(12, 0, "Well done mortals for defeating Yog'Sarons General, please come and talk to me and we can barter a reward for freeing me.")
- end
Advertisement
Add Comment
Please, Sign In to add comment