Advertisement
Guest User

Untitled

a guest
Apr 4th, 2010
1,697
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 31.36 KB | None | 0 0
  1. --[[ Made by Hydroxis @AC-Web & ToxicWoW (http://wowtoxic.com)
  2.                 and
  3.                     Stoneharry @MMOwned
  4.                             Do not re-release without our permission.
  5. TODO: Defile (Doesn't work by default on ArcEmu)
  6. TODO: Frostmourne Chamber (If you give me a description of the fight, and the DisplayID of the Frozen Throne I will do it.
  7. TODO: Spawn Bolvar on the Frozen Throne (Give me his DisplayID and I will do it)
  8. ENJOY!              ]]--
  9.  
  10.  
  11.  
  12.  
  13. local Lich = nil
  14. local Tirion = nil
  15. local package = nil
  16. local Terenas = nil
  17. local Count = 0
  18. local Phase = 0
  19. local Players_Wiped = 0
  20. local tleh
  21. local tleh1
  22. --npc = {}--
  23.  
  24. ---- Lich King ---------------------------------------------------
  25.  
  26. function LichKing_OnSpawn(pUnit, Event)
  27.     pUnit:RegisterEvent("LichKing_OnSpawn_Go", 1000, 1)
  28. end
  29.  
  30. function LichKing_OnSpawn_Go(pUnit, Event)
  31.     if Lich ~= nil then -- Do a check
  32.     Lich:RemoveFromWorld()
  33.     end
  34.     Lich = pUnit
  35.     Lich:SetFaction(35)
  36. end
  37.  
  38. RegisterUnitEvent(3072111, 18, "LichKing_OnSpawn")
  39.  
  40. ---- Tleh ------------------------------------------------------
  41. function tleh_OnSpawn(pUnit, Event)
  42.     tleh = pUnit
  43.     tleh:SetFlying()
  44.     tleh:SetMovementFlags(2)
  45.     tleh:MoveTo(505.135254, -2121.514160, 1583.135132)
  46.     tleh:SetUInt32Value(58, 26)
  47. end
  48.  
  49. RegisterUnitEvent(100001, 18, "tleh_OnSpawn")
  50.  
  51. function tleh1_OnSpawn(pUnit, Event)
  52.     tleh1 = pUnit
  53.     tleh1:SetUInt32Value(58, 26)
  54. end
  55.  
  56. RegisterUnitEvent(100002, 18, "tleh1_OnSpawn")
  57.  
  58. ---- Tirion ------------------------------------------------------
  59.  
  60. function TirionFordring_OnSpawn(pUnit, Event)
  61.     pUnit:RegisterEvent("TirionFordring_OnSpawn_Go", 5000, 0)
  62. end
  63.  
  64. function TirionFordring_OnSpawn_Go(pUnit, Event)
  65.     if Lich ~= nil then
  66.         local plr = pUnit:GetClosestPlayer()
  67.         if plr ~= nil then
  68.             if pUnit:GetDistanceYards(plr) < 7 then
  69.                 local PlayersAllAround = pUnit:GetInRangePlayers()
  70.                 for a, players in pairs(PlayersAllAround) do
  71.                 players:CastSpell(69127)
  72.                 end
  73.             pUnit:PlaySoundToSet(17458)
  74.             pUnit:RemoveEvents()
  75.             Lich:MoveTo(461.47, -2123.73, 1572.1, 0)
  76.             pUnit:Emote(375, 60000)
  77.             pUnit:PlaySoundToSet(17349)
  78.             Lich:SendChatMessage(14, 0, "So...the Light's vaunted justice has finally arrived. Shall I lay down Frostmourne and throw myself at your mercy, Fordring?")
  79.             pUnit:RegisterEvent("TirionFordring_OnSpawn_Goz", 13500, 1)
  80.             end
  81.         end
  82.     end
  83. end
  84.  
  85. RegisterUnitEvent(26529762, 18, "TirionFordring_OnSpawn")
  86.  
  87. function TirionFordring_OnSpawn_Goz(pUnit, Event)
  88.     pUnit:SendChatMessage(14,0,"We will grant you a swift death, Arthas. More than can be said for the thousands you've tortured and slain.")
  89.     pUnit:PlaySoundToSet(17390)
  90.     local PlayersAllAround = pUnit:GetInRangePlayers()
  91.     for k, v in pairs(PlayersAllAround) do
  92.     v:CastSpell(69127)
  93.     end
  94.     pUnit:RegisterEvent("TirionFordring_OnSpawn_Gozz", 7500, 1)
  95. end
  96.  
  97. function TirionFordring_OnSpawn_Gozz(pUnit, Event)
  98.     Lich:SendChatMessage(14,0,"You will learn of that first hand. When my work is complete, you will beg for mercy -- and I will deny you. Your anguished cries will be testament to my unbridled power.")
  99.     pUnit:PlaySoundToSet(17350)
  100.     Lich:Emote(397, 4000)
  101.     pUnit:RegisterEvent("zTirionFordring_OnSpawn_Gozzz", 4000, 1)
  102.     pUnit:RegisterEvent("zzTirionFordring_OnSpawn_Gozzz", 12000, 1)
  103.     pUnit:RegisterEvent("TirionFordring_OnSpawn_Gozzz", 23000, 1)
  104. end
  105.  
  106. function zTirionFordring_OnSpawn_Gozzz(pUnit, Event)
  107.     Lich:Emote(1, 6000)
  108. end
  109.  
  110. function zzTirionFordring_OnSpawn_Gozzz(pUnit, Event)
  111.     Lich:Emote(392, 3500)
  112. end
  113.  
  114. function TirionFordring_OnSpawn_Gozzz(pUnit, Event)
  115.     Lich:SendChatMessage(14,0,"So be it. Champions, attack!")
  116.     pUnit:PlaySoundToSet(17391)
  117.     pUnit:Emote(397, 2000)
  118.     pUnit:RegisterEvent("PATHETIC_RUN_TIRION", 2000, 1)
  119.     pUnit:RegisterEvent("TirionFordring_OnSpawn_Gozzzz", 3000, 1)
  120.     pUnit:RegisterEvent("TirionFordring_zzz_Gozzzz", 4800, 1)
  121. end
  122.  
  123. function PATHETIC_RUN_TIRION(pUnit, Event)
  124.     pUnit:SetMovementFlags(1)
  125.     pUnit:MoveTo(485.92, -2123.2, 1572.1, 3.17)
  126. end
  127.  
  128. function TirionFordring_OnSpawn_Gozzzz(pUnit, Event)
  129.     Lich:SendChatMessage(14,0,"I'll keep you alive to witness the end, Fordring. I would not want the Light's greatest champion to miss seeing this wretched world remade in my image.")
  130.     pUnit:PlaySoundToSet(17351)
  131.     local PlayersAllAround = pUnit:GetInRangePlayers()
  132.     for a, players in pairs(PlayersAllAround) do
  133.     players:CastSpell(69127)
  134.     end
  135.     Tirion = pUnit
  136. end
  137.  
  138. function TirionFordring_zzz_Gozzzz(pUnit, Event)
  139.     Tirion:CastSpell(71614)
  140.     Lich:SetFaction(22)
  141.     local o = Lich:GetO()
  142.     Lich:SpawnCreature(3769511, 468, -2130, 1572, o, 14, 0)
  143.     Lich:SpawnCreature(3769511, 465, -2140, 1572, o, 14, 0)
  144.     Lich:SpawnCreature(3769511, 468, -2115, 1572, o, 14, 0)
  145.     Lich:SpawnCreature(3769511, 465, -2105, 1572, o, 14, 0)
  146.     local ghoulmove = Lich:GetCreatureNearestCoords(468, -2130, 1572, 3769511)
  147.     ghoulmove:MoveTo(474, -2130, 1572)
  148.     local ghoulmove1 = Lich:GetCreatureNearestCoords(465, -2140, 1572, 3769511)
  149.     ghoulmove1:MoveTo(469, -2138, 1572)
  150.     local ghoulmove2 = Lich:GetCreatureNearestCoords(468, -2115, 1572, 3769511)
  151.     ghoulmove2:MoveTo(474, -2115, 1572)
  152.     local ghoulmove3 = Lich:GetCreatureNearestCoords(465, -2105, 1572, 3769511)
  153.     ghoulmove3:MoveTo(469, -2105, 1572)
  154.     Lich:MoveTo(474, -2123, 1571.900146)
  155. end
  156.  
  157. -------- Rage Counter ---------------------------------------------
  158.  
  159. function Rage_Counter_Lich_King(pUnit, Event)
  160.     if Lich == nil then
  161.     pUnit:RemoveEvents()
  162.     else
  163.         if Count == 300 then
  164.             if Phase == 2 then
  165.             Count = 0
  166.             Phase = 0
  167.             Lich:RemoveEvents()
  168.             Lich:SendChatMessage(14,0,"Face now your tragic end!")
  169.             Lich:PlaySoundToSet(17365)
  170.             else
  171.             Lich:FullCastSpell(72143) -- Enrage --
  172.             Phase = Phase + 1
  173.             end
  174.         else
  175.         Count = Count + 5
  176.         end
  177.     end
  178. end
  179.  
  180. -------- Fight ----------------------------------------------------
  181.  
  182. function LichKingHasEnteredCombatLawl_Phase_One(pUnit, Event)
  183.     if Tirion == nil then
  184.     pUnit:Despawn(1, 10000)
  185.     Lich = nil
  186.     else
  187.         if Players_Wiped == 1 then
  188.         Players_Wiped = 0
  189.         Lich:SetHealthPct(10)
  190.         else
  191.         Lich:SetCombatCapable(0)
  192.         Lich:RegisterEvent("Rage_Counter_Lich_King", 5000, 0)
  193.         Lich:RegisterEvent("Adds_Spawning_Incoming_Dredge_Ghouls", 19000, 0)
  194.         Lich:RegisterEvent("Adds_Spawning_Incoming_Shambling_Horror", math.random(60000,70000), 0)
  195.         Lich:RegisterEvent("Necrotic_Plague_Incoming", 20000, 0)
  196.         Lich:RegisterEvent("Infest_Big_AOE_Incoming", 30000, 0)
  197.         Lich:RegisterEvent("Phase_Two_Checker", 2500, 0)
  198.         end
  199.     end
  200. end
  201.  
  202. function Adds_Spawning_Incoming_Dredge_Ghouls(pUnit, Event)
  203.     Lich:RegisterEvent("Adds_Spawning_Incoming_Dredge_Ghoulsz", 1000, 3)
  204. end
  205.  
  206. function Adds_Spawning_Incoming_Dredge_Ghoulsz(pUnit, Event)
  207.     local x = Lich:GetX()
  208.     local y = Lich:GetY()
  209.     local z = Lich:GetZ()
  210.     local o = Lich:GetO()
  211.     if math.random(1,2) == 1 then
  212.     Lich:SpawnCreature(3769511, x+math.random(1,6), y+math.random(1,6), z, o, 15, 360000)
  213.     else
  214.     Lich:SpawnCreature(3769511, x-math.random(1,6), y-math.random(1,6), z, o, 15, 360000)
  215.     end
  216. end
  217.  
  218. function Adds_Spawning_Incoming_Shambling_Horror(pUnit, Event)
  219.     local x = Lich:GetX()
  220.     local y = Lich:GetY()
  221.     local z = Lich:GetZ()
  222.     local o = Lich:GetO()
  223.     if math.random(1,2) == 1 then
  224.     Lich:SpawnCreature(3769811, x+math.random(1,6), y+math.random(1,6), z, o, 15, 360000)
  225.     else
  226.     Lich:SpawnCreature(3769811, x-math.random(1,6), y-math.random(1,6), z, o, 15, 360000)
  227.     end
  228. end
  229.  
  230. function Necrotic_Plague_Incoming(pUnit, Event)
  231.     local plr = Lich:GetRandomPlayer(0)
  232.     if plr ~= nil then
  233.     Lich:FullCastSpellOnTarget(70337, plr)
  234.     end
  235. end
  236.  
  237. function Infest_Big_AOE_Incoming(pUnit, Event)
  238.     Lich:FullCastSpell(70541)
  239. end
  240.  
  241. RegisterUnitEvent(3072111, 1, "LichKingHasEnteredCombatLawl_Phase_One")
  242.  
  243. function Phase_Two_Checker(pUnit, Event)
  244.     if Lich:GetHealthPct() < 71 then
  245.     Lich:RemoveEvents()
  246.     Lich:MoveTo(506.7, -2122.5, 1572.1, 0)
  247.     Lich:SetMovementFlags(1)
  248.     Lich:SetCombatCapable(1)
  249.     Lich:RegisterEvent("Test_Debug_MoveToCentreOfRoom", 100, 0)
  250.     Lich:RegisterEvent("Test_Debug_MoveToCentreOfRoom_z", 9005, 1)
  251.     end
  252. end
  253.  
  254. function Test_Debug_MoveToCentreOfRoom(pUnit, Event)
  255.     Lich:MoveTo(506.7, -2122.5, 1572.1, 0)
  256.     Lich:SetMovementFlags(1)
  257. end
  258.  
  259. function Test_Debug_MoveToCentreOfRoom_z(pUnit, Event)
  260.     Lich:RemoveEvents()
  261.     Lich:Root()
  262.     Lich:FullCastSpell(68981)
  263.     Lich:SendChatMessage(14,0,"I will freeze you from within until all that remains is an icy husk!")
  264.     Lich:PlaySoundToSet(17369)
  265.     Lich:RegisterEvent("weaiyhoahg_delay", 9500, 1)
  266. end
  267.  
  268. function weaiyhoahg_delay(pUnit, Event)
  269.     local x = Lich:GetX()
  270.     local y = Lich:GetY()
  271.     Lich:SpawnCreature(3769812, x+math.random(3,6), y+math.random(3,6), Lich:GetZ(), Lich:GetZ(), 21, 10000)
  272.     Lich:RegisterEvent("Spam_Of_Lightning_That_Looks_Crap_But_Is_Blizzlike", 2000, 0)
  273.     Lich:RegisterEvent("NeedToWaitBecauseAddsBreakAndShizzleOrSomething", 3005, 1)
  274.     Lich:RegisterEvent("RandomRagingSpiritAddsThatAreNotRandom", 19990, 3)
  275.     Lich:RegisterEvent("Test_Despawn_Outer_Shell", 59000, 0)
  276. end
  277.  
  278. function NeedToWaitBecauseAddsBreakAndShizzleOrSomething(pUnit,Event)
  279.     local x = Lich:GetX()
  280.     local y = Lich:GetY()
  281.     Lich:SpawnCreature(3769812, x-math.random(3,6), y-math.random(3,6), Lich:GetZ(), Lich:GetZ(), 21, 10000)
  282. end
  283.  
  284. function RandomRagingSpiritAddsThatAreNotRandom(pUnit, Event)
  285.     local plr = Lich:GetRandomPlayer(0)
  286.     if plr ~= nil then
  287.     local x,y,z,o = plr:GetX(),plr:GetY(),plr:GetZ(),plr:GetO()
  288.     Lich:SpawnCreature(3769813, x,y,z,o , 21, 360000)
  289.     end
  290. end
  291.  
  292. function Spam_Of_Lightning_That_Looks_Crap_But_Is_Blizzlike(pUnit, Event)
  293.     local plr = Lich:GetRandomPlayer(0)
  294.     if plr ~= nil then
  295.     Lich:FullCastSpellOnTarget(72133, plr)
  296.     end
  297. end
  298.  
  299. function Test_Despawn_Outer_Shell(pUnit, Event)
  300.     Lich:RemoveEvents()
  301.     Lich:SendChatMessage(14,0,"Watch as the world around you collapses!")
  302.     Lich:PlaySoundToSet(17370)
  303.     Lich:CastSpell(59084) -- Frozen Throne goes boom --
  304.     Lich:SpawnCreature(2626262, 476.2, -2083.56, 1573.1, 0, 814, 20000)
  305.     Lich:SpawnCreature(2626262, 505.1, -2074.47, 1573.1, 0, 814, 20000)
  306.     Lich:SpawnCreature(2626262, 523.35, -2077.77, 1573.1, 0, 814, 20000)
  307.     Lich:SpawnCreature(2626262, 541, -2086.36, 1573.1, 0, 814, 20000)
  308.     Lich:SpawnCreature(2626262, 552.7, -2111.2, 1573.1, 0, 814, 20000)
  309.     Lich:SpawnCreature(2626262, 554, -2137, 1573.1, 0, 814, 20000)
  310.     Lich:SpawnCreature(2626262, 545.9, -2153.1, 1573.1, 0, 814, 20000)
  311.     Lich:SpawnCreature(2626262, 528, -2164, 1573.1, 0, 814, 20000)
  312.     Lich:SpawnCreature(2626262, 508.25, -2169.5, 1573.1, 0, 814, 20000)
  313.     Lich:SpawnCreature(2626262, 488.2, -2168, 1573.1, 0, 814, 20000)
  314.     Lich:RegisterEvent("DelayForDespawnSinceVisualTakesSomeTimeTehe_Zieghoszho", 1000, 1)
  315.     Lich:RegisterEvent("DelayForDespawnSinceVisualTakesSomeTimeTehe", 2500, 1)
  316. end
  317.  
  318. function DelayForDespawnSinceVisualTakesSomeTimeTehe_Zieghoszho(pUnit, Event)
  319.     Lich:FullCastSpell(72262) -- Epic shit I got working :D
  320. end
  321.  
  322. function DelayForDespawnSinceVisualTakesSomeTimeTehe(pUnit, Event)
  323.     local Object = Lich:GetGameObjectNearestCoords(pUnit:GetX(),pUnit:GetY(),pUnit:GetZ(), 2957197)
  324.     if Object ~= nil then
  325.     Object:Despawn(1,0)
  326.     Lich:CastSpell(46853) --Shake--
  327.     end
  328.     Lich:SetCombatCapable(0)
  329.     Lich:Unroot()
  330.     -- Phase 2
  331.     Lich:RegisterEvent("Infest_Big_AOE_Incoming", 22000, 0)
  332.     Lich:RegisterEvent("Summon_Valkyr_Shadowguard", 19500, 0)
  333.     Lich:RegisterEvent("Soul_Reaper_On_Main_Tank", 30000, 0)
  334.     Lich:RegisterEvent("Phase_TwoPointFive_Checker", 2500, 0)
  335.     -- Defile --
  336. end
  337.  
  338. function Soul_Reaper_On_Main_Tank(pUnit, Event)
  339.     local tank = Lich:GetMainTank()
  340.     if tank ~= nil then
  341.     Lich:FullCastSpellOnTarget(69409, tank)
  342.     end
  343. end
  344.  
  345. function Summon_Valkyr_Shadowguard(pUnit, Event)
  346.     local x, y, z, o = Lich:GetX()+7, Lich:GetY(), Lich:GetZ(), Lich:GetO()
  347.     Lich:SpawnCreature(25452151, x, y, z, o, 22, 0)
  348.     Lich:SendChatMessage(14,0,"Val'kyr, your master calls!")
  349.     Lich:PlaySoundToSet(17373)
  350. end
  351.  
  352. function Phase_TwoPointFive_Checker(pUnit, Event)
  353.     if Lich:GetHealthPct() < 41 then
  354.     Lich:RemoveEvents()
  355.     Lich:MoveTo(506.7, -2122.5, 1572.1, 0)
  356.     Lich:SetMovementFlags(1)
  357.     Lich:SetCombatCapable(1)
  358.     Lich:RegisterEvent("hhTest_Debug_MoveToCentreOfRoom", 100, 0)
  359.     Lich:RegisterEvent("hhTest_Debug_MoveToCentreOfRoom_z", 9005, 1)
  360.     end
  361. end
  362.  
  363. function hhTest_Debug_MoveToCentreOfRoom(pUnit, Event)
  364.     Lich:MoveTo(506.7, -2122.5, 1572.1, 0)
  365.     Lich:SetMovementFlags(1)
  366. end
  367.  
  368. function hhTest_Debug_MoveToCentreOfRoom_z(pUnit, Event)
  369.     Lich:RemoveEvents()
  370.     Lich:Root()
  371.     Lich:FullCastSpell(68981)
  372.     Lich:SendChatMessage(14,0,"I will freeze you from within until all that remains is an icy husk!")
  373.     Lich:PlaySoundToSet(17369)
  374.     Lich:RegisterEvent("jjweaiyhoahg_delay", 8500, 1)
  375. end
  376.  
  377. function jjweaiyhoahg_delay(pUnit, Event)
  378.     local x = Lich:GetX()
  379.     local y = Lich:GetY()
  380.     Lich:SpawnCreature(3769812, x+math.random(3,6), y+math.random(3,6), Lich:GetZ(), Lich:GetZ(), 21, 10000)
  381.     Lich:RegisterEvent("Spam_Of_Lightning_That_Looks_Crap_But_Is_Blizzlike", 1500, 0)
  382.     Lich:RegisterEvent("NeedToWaitBecauseAddsBreakAndShizzleOrSomething", 3005, 1)
  383.     Lich:RegisterEvent("RandomRagingSpiritAddsThatAreNotRandom", 14000, 3)
  384.     Lich:RegisterEvent("zzzTest_Despawn_Outer_Shell", 59000, 0)
  385. end
  386.  
  387. function zzzTest_Despawn_Outer_Shell(pUnit, Event)
  388.     Lich:RemoveEvents()
  389.     Lich:SendChatMessage(14,0,"Watch as the world around you collapses!")
  390.     Lich:PlaySoundToSet(17370)
  391.     Lich:CastSpell(59084) -- Frozen Throne goes boom --
  392.     Lich:SpawnCreature(2626262, 476.2, -2083.56, 1573.1, 0, 814, 20000)
  393.     Lich:SpawnCreature(2626262, 505.1, -2074.47, 1573.1, 0, 814, 20000)
  394.     Lich:SpawnCreature(2626262, 523.35, -2077.77, 1573.1, 0, 814, 20000)
  395.     Lich:SpawnCreature(2626262, 541, -2086.36, 1573.1, 0, 814, 20000)
  396.     Lich:SpawnCreature(2626262, 552.7, -2111.2, 1573.1, 0, 814, 20000)
  397.     Lich:SpawnCreature(2626262, 554, -2137, 1573.1, 0, 814, 20000)
  398.     Lich:SpawnCreature(2626262, 545.9, -2153.1, 1573.1, 0, 814, 20000)
  399.     Lich:SpawnCreature(2626262, 528, -2164, 1573.1, 0, 814, 20000)
  400.     Lich:SpawnCreature(2626262, 508.25, -2169.5, 1573.1, 0, 814, 20000)
  401.     Lich:SpawnCreature(2626262, 488.2, -2168, 1573.1, 0, 814, 20000)
  402.     Lich:RegisterEvent("DelayForDespawnSinceVisualTakesSomeTimeTehe_Zieghoszho", 1000, 1)
  403.     Lich:RegisterEvent("zzzDelayForDespawnSinceVisualTakesSomeTimeTehe", 2500, 1)
  404. end
  405.  
  406. function zzzDelayForDespawnSinceVisualTakesSomeTimeTehe(pUnit, Event)
  407.     Lich:SetCombatCapable(0)
  408.     Lich:Unroot()
  409.     Lich:RemoveEvents()
  410.     Lich:RegisterEvent("Soul_Reaper_On_Main_Tank", 30000, 0)
  411.     Lich:RegisterEvent("Harvest_Soul_Random_Raid_Member", 66000, 0)
  412.     Lich:RegisterEvent("Vile_Spirits_Spawning_Inc", 28000, 0)
  413.     Lich:RegisterEvent("Phase_Four_The_Ending_tehe", 1500, 0)
  414. end
  415.  
  416. function Harvest_Soul_Random_Raid_Member(pUnit, Event)
  417.     local plr = Lich:GetRandomPlayer(0)
  418.     if plr ~= nil then
  419.     Lich:SendChatMessage(14,0,"Frostmourne hungers...")
  420.     Lich:PlaySoundToSet(17366)
  421.     Lich:FullCastSpellOnTarget(68980, plr)
  422.     end
  423. end
  424.  
  425. function Vile_Spirits_Spawning_Inc(pUnit, Event)
  426.     Lich:RegisterEvent("Spawning_The_Vile_spirits_NoW", 1000, 10)
  427. end
  428.  
  429. function Spawning_The_Vile_spirits_NoW(pUnit, Event)
  430.     local pla = Lich:GetRandomPlayer(0)
  431.     if pla ~= nil then
  432.     local x, y, z, o = pla:GetX(), pla:GetY(), pla:GetZ(), pla:GetO()
  433.     Lich:SpawnCreature(5078151, x, y, z, o, 22, 60000)
  434.     end
  435. end
  436.  
  437. function Phase_Four_The_Ending_tehe(pUnit, Event)
  438.     if Lich:GetHealthPct() < 11 then
  439.     Count = 0
  440.     Phase = 0
  441.     Lich:RemoveEvents()
  442.     Lich:SetFacing(0.050405)
  443.     Lich:SendChatMessage(14,0,"You gnats actually hurt me! Perhaps I've toyed with you long enough, now taste the vengeance of the grave!")
  444.     Lich:PlaySoundToSet(17359)
  445.     Lich:MoveTo(506.7, -2122.5, 1572.1, 0)
  446.     Lich:SetMovementFlags(1)
  447.     Lich:SetCombatCapable(1)
  448.     Lich:RegisterEvent("hhTest_Debug_MoveToCentreOfRoom", 100, 0)
  449.     Lich:RegisterEvent("hggzhTest_Debug_MoveToCentreOfRoom_z", 5005, 1)
  450.     end
  451. end
  452.  
  453. function hggzhTest_Debug_MoveToCentreOfRoom_z(pUnit, Event)
  454.     Lich:RemoveEvents()
  455.     Lich:CastSpell(70063)
  456.     Players_Wiped = 1
  457.     Lich:RemoveEvents()
  458.     Lich:RegisterEvent("Debug_Send_Next_Message_LichKing", 10000, 1)
  459. end
  460.  
  461. function Debug_Send_Next_Message_LichKing(pUnit, Event)
  462.     Lich:SendChatMessage(14,0,"No question remains unanswered. No doubts linger. You are Azeroth's greatest champions! You overcame every challenge I laid before you. My mightiest servants have fallen before your relentless onslaught, your unbridled fury...")
  463.     Lich:PlaySoundToSet(17353)
  464.     Lich:RegisterEvent("zzDebug_Send_Next_Message_LichKing", 25000, 1)
  465. end
  466.  
  467. function zzDebug_Send_Next_Message_LichKing(pUnit, Event)
  468.     Lich:SendChatMessage(14,0,"You trained them well, Fordring. You delivered the greatest fighting force this world has ever known... right into my hands -- exactly as I intended. You shall be rewarded for your unwitting sacrifice.")
  469.     Lich:PlaySoundToSet(17355)
  470.     Lich:RegisterEvent("zzzzDebug_Send_Next_Message_LichKing", 24000, 1)
  471. end
  472.  
  473. function zzzzDebug_Send_Next_Message_LichKing(pUnit, Event)
  474.     Lich:SendChatMessage(14,0,"Watch now as I raise them from the dead to become masters of the Scourge. They will shroud this world in chaos and destruction. Azeroth's fall will come at their hands -- and you will be the first to die.")
  475.     Lich:PlaySoundToSet(17356)
  476.     local plr = Lich:GetRandomPlayer(0)
  477.     if plr ~= nil then
  478.     Lich:ChannelSpell(71769, plr)
  479.     Lich:RegisterEvent("zzzzDebug_Send_Next_Message_LichKingzz", 26000, 1)
  480.     Lich:RegisterEvent("lich_channel_players_raise_dead", 500, 1)
  481.     --[[Lich:RegisterEvent("imakeyoumineservants", 1000, 1)
  482.     Lich:RegisterEvent("lichchannelplayers", 3000, 1)]]--
  483.     end
  484. end
  485. function lich_channel_players_raise_dead(pUnit, Event)
  486.     local dumbass = Lich:GetInRangePlayers()
  487.     for k, v in pairs(dumbass) do
  488.     v:ChannelSpell(47855, tleh)
  489.     end
  490. end
  491.  
  492. --[[function imakeyoumineservants(pUnit, Event)  -- Doesn't work like this no idea why--
  493.     for k, v in pairs(pUnit:GetInRangePlayers()) do
  494.     if v:IsDead() then
  495.         if npc[v:GetName()] ==  nil then
  496.             npc[v:GetName()] = {};
  497.             npc[v:GetName()].position = {v:GetX(), v:GetY(), v:GetZ(), v:GetO()}
  498.             npc[v:GetName()].npcSpawned = true;         local x, y, z, o = pos;
  499.             Lich:SpawnCreature(100001, npc[v:GetName()].position.x, npc[v:GetName()].position.y, npc[v:GetName()].position.z, npc[v:GetName()].position.o, 35, 0)
  500.             break;
  501.         end
  502.     break;
  503.     end
  504. end
  505. end
  506.  
  507. function lichchannelplayers(pUnit, Event)
  508.     Lich:ChannelSpell(49576, tleh)
  509. end
  510. --]]
  511.  
  512. function zzzzDebug_Send_Next_Message_LichKingzz(pUnit, Event)
  513.     Lich:PlaySoundToSet(17357)
  514.     Lich:SendChatMessage(14,0,"I delight in the irony.")
  515.     Lich:RegisterEvent("zzzzDebug_Send_Next_Message_LichKingzzzz", 6000, 1)
  516. end
  517.  
  518. function zzzzDebug_Send_Next_Message_LichKingzzzz(pUnit, Event)
  519.     if Tirion == nil then
  520.     Lich:Despawn(1,0)
  521.     else
  522.     Tirion:SendChatMessage(14,0,"LIGHT, GRANT ME ONE FINAL BLESSING. GIVE ME THE STRENGTH... TO SHATTER THESE BONDS!")
  523.     Tirion:PlaySoundToSet(17392)
  524.     Lich:RegisterEvent("Breakoutofice", 9000, 1)
  525.     end
  526. end
  527.  
  528. function Breakoutofice(pUnit, Event)
  529.     Tirion:RemoveAura(71614)
  530.     Tirion:CastSpell(71797)
  531.     Tirion:CastSpell(71614)
  532.     Lich:RegisterEvent("zzzzDebug_Send_Next_Message_LichKingzzzzgg", 5000, 1)
  533. end
  534.  
  535. function zzzzDebug_Send_Next_Message_LichKingzzzzgg(pUnit, Event)
  536.     Tirion:RemoveAura(71614) -- Ice Block
  537.     Tirion:CastSpell(71773)
  538.     Tirion:MoveTo(495, -2123, 1572)
  539.     Lich:RegisterEvent("zzzzDebug_Send_Next_Message_LichKingzzzzgzg", 1700, 1)
  540. end
  541.  
  542. function zzzzDebug_Send_Next_Message_LichKingzzzzgzg(pUnit, Event) --Teh holy jump--
  543.     Tirion:SetMovementFlags(2)
  544.     Tirion:SetFlying()
  545.     Tirion:Emote(375, 60000)
  546.     Tirion:MoveTo(511, -2121, 1575)
  547.     Tirion:Emote(375, 60000)
  548.     Tirion:RegisterEvent("lichisdead", 1900, 1)
  549.     Lich:RegisterEvent("BrokeFrostmourne", 1900, 1)
  550. end
  551.  
  552. function lichisdead(pUnit, Event)
  553.     Tirion:MoveTo(514.135254, -2122.514160, 1572)
  554. end
  555.  
  556. function BrokeFrostmourne(pUnit, Event)
  557.     local dumbasss = Lich:GetInRangePlayers()
  558.     for k, v in pairs(dumbasss) do
  559.     v:StopChannel()
  560.     Lich:StopChannel()
  561.     Lich:CastSpell(37592) -- Knockdown
  562.     Lich:CastSpell(72726) -- Boom visual
  563.     Lich:FullCastSpell(72398) -- Broken Frostmourne (On the floor)
  564.     Lich:EquipWeapons(0,0,0)
  565.     Lich:CastSpell(73017) --Frostmourne Drops (Off the hands)
  566.     Lich:RegisterEvent("zagazzzDebug_Send_Next_Message_LichKingzzzzgzg", 700, 1)
  567.     end
  568. end
  569.  
  570. function zagazzzDebug_Send_Next_Message_LichKingzzzzgzg(pUnit, Event)
  571.     Tirion:SetMovementFlags(1)
  572.     Tirion:MoveTo(533.5, -2121, 1572.1, 3.15)
  573.     Lich:RegisterEvent("zagazzzDebug_Send_Next_Message_LichKingzgeazzzzgzg", 1000, 1)
  574. end
  575.  
  576. function zagazzzDebug_Send_Next_Message_LichKingzgeazzzzgzg(pUnit, Event)
  577.     Lich:SendChatMessage(14,0,"Impossible...")
  578.     Lich:PlaySoundToSet(17358)
  579.     Lich:Emote(473, 120000)
  580.     tleh1:CastSpell(72405)
  581.     Lich:RegisterEvent("zagazzzDebug_Send_Next_Message_LichKingzgeazzzzedhezgzg", 3500, 1)
  582. end
  583.  
  584. function zagazzzDebug_Send_Next_Message_LichKingzgeazzzzedhezgzg(pUnit, Event)
  585.     Tirion:SendChatMessage(14,0,"No more, Arthas! No more lives will be consumed by your hatred!")
  586.     Tirion:PlaySoundToSet(17393)
  587.     Tirion:SetMovementFlags(0)
  588.     Lich:Emote(473, 120000)
  589.     Lich:SpawnCreature(31021151, 518.8, -2115.8, 1572.1, 3.780169, 35, 0)
  590.     Terenas:EquipWeapons(23456, 18825, 0)
  591.     Tirion:MoveTo(525.654663, -2121.921143, 1571.900513, 3)
  592.     Tirion:RemoveEvents()
  593.     Lich:RegisterEvent("zagazzzDebug_Send_Next_Message_LichKingzgeazzzzedhezgzzzzsay", 5500, 1)
  594. end
  595.  
  596. function zagazzzDebug_Send_Next_Message_LichKingzgeazzzzedhezgzzzzsay(pUnit, Event)
  597.     if Terenas == nil then
  598.     Lich:Despawn(1,0)
  599.     Lich = nil
  600.     Tirion:Despawn(1,0)
  601.     Tirion = nil
  602.     else
  603.     Tirion:RemoveEvents()
  604.     Lich:Emote(473, 120000)
  605.     Terenas:SendChatMessage(14,0,"Free at last! It is over, my son. This is the moment of reckoning.")
  606.     Terenas:PlaySoundToSet(17397)
  607.     Lich:RegisterEvent("epiashgyophopapea_Lich_King_Is_Not_A_Happy_Bunny", 10000, 1)
  608.     end
  609. end
  610.  
  611. function epiashgyophopapea_Lich_King_Is_Not_A_Happy_Bunny(pUnit, Event)
  612.     Terenas:SendChatMessage(14,0,"Rise up, champions of the Light!")
  613.     Terenas:PlaySoundToSet(17398)
  614.     Terenas:CastSpell(37755)
  615.     Terenas:RemoveEvents()
  616.     Lich:Emote(473, 120000)
  617.     local PlayersAllAround = Terenas:GetInRangePlayers()
  618.     for a, players in pairs(PlayersAllAround) do
  619.     players:ResurrectPlayer(players)
  620.     players:CastSpell(24171)
  621.     end
  622.     Lich:SetHealthPct(10)
  623.     Lich:RegisterEvent("zLich_King_Is_Not_A_Happy_Bunny", 5000, 1)
  624. end
  625.  
  626. function zLich_King_Is_Not_A_Happy_Bunny(pUnit, Event)
  627.     Tirion:MoveTo(509, -2125, 1572)
  628.     Terenas:MoveTo(509, -2121, 1572)
  629.     Tirion:FullCastSpellOnTarget(6603, Lich)
  630.     Terenas:FullCastSpellOnTarget(6603, Lich)
  631.     Lich:Emote(473, 120000)
  632.     Lich:SendChatMessage(14,0,"Now I stand, the lion before the lambs... and they do not fear.")
  633.     Lich:PlaySoundToSet(17361)
  634.     Lich:RegisterEvent("zLich_King_Is_Not_A_Happy_Bunnyz", 8000, 1)
  635. end
  636.  
  637. function zLich_King_Is_Not_A_Happy_Bunnyz(pUnit, Event)
  638.     Lich:SendChatMessage(14,0,"They cannot fear.")
  639.     Lich:PlaySoundToSet(17362)
  640.     Lich:Emote(473, 120000)
  641. end
  642.  
  643. ---- Terenas -----------------------------------------------------
  644.  
  645. function Terenas_Spawned_root_Hes_the_realm_of_My_RETAIL_Char(pUnit, Event)
  646.     if Tirion == nil or Lich == nil then
  647.     pUnit:Despawn(1,0)
  648.     else
  649.     Terenas = pUnit
  650.     end
  651. end
  652.  
  653. RegisterUnitEvent(31021151, 18, "Terenas_Spawned_root_Hes_the_realm_of_My_RETAIL_Char")
  654.  
  655. -------------------------------------------------------------------
  656.  
  657. function LichKingHasDiedSoWePlayMovie(pUnit, Event)
  658.     tleh1:Despawn(1, 0)
  659.     Terenas:Despawn(1, 0)
  660.     Tirion:RemoveEvents()
  661.     Tirion:RegisterEvent("Idespawn", 11000, 1)
  662.     Lich = nil
  663.     pUnit:RemoveEvents()
  664.     pUnit:PlaySoundToSet(17374) -- Freak makes dying sound --
  665.     pUnit:SpawnCreature(3072110, pUnit:GetX(), pUnit:GetY(), pUnit:GetZ(), pUnit:GetO(), 35, 10000)
  666. end
  667.  
  668. RegisterUnitEvent(3072111, 4, "LichKingHasDiedSoWePlayMovie")
  669.  
  670. function Idespawn(pUnit, Event)
  671.     Tirion = pUnit
  672.     Tirion:Despawn(1, 0)
  673.     Tirion = nil
  674. end
  675.  
  676. function TriggerHasSpawnedSoPlayMovie(pUnit, Event)
  677.     pUnit:RegisterEvent("PlayMovieOnceDeathAnimationHasPlayed", 9000, 1)
  678. end
  679.  
  680. function PlayMovieOnceDeathAnimationHasPlayed(pUnit, Event)
  681.     -- Reset Fight --
  682.     Tirion = nil
  683.     Lich = nil
  684.     Terenas = nil
  685.     package = nil
  686.     Phase = 0
  687.     Count = 0
  688.     -- Movie --
  689.     Players_Wiped = 0
  690.     local PlayersAllAround = pUnit:GetInRangePlayers()
  691.     for a, players in pairs(PlayersAllAround) do
  692.     --SMSG_TRIGGER_MOVIE = 0x464
  693.     local packet = LuaPacket:CreatePacket(0x464, 4)
  694.     packet:WriteULong(16)
  695.     players:SendPacketToPlayer(packet)
  696.     end
  697.     -- Bolvar --
  698.     local Bolvar = pUnit:GetGameObjectNearestCoords(428.758, -2124.4, 1594.69, 2508221) -- Bolvar in chains
  699.     if Bolvar ~= nil then
  700.     Bolvar:Despawn(1,0)
  701.     pUnit:SpawnGameObject(2508220, 428.758, -2124.4, 1594.69, 0, 360000) -- Chains
  702.     pUnit:SpawnGameObject(2508219, 430.103, -2124, 1595.93, 3.3, 360000) -- Bolvar
  703.     end
  704. end
  705.  
  706. RegisterUnitEvent(3072110, 18, "TriggerHasSpawnedSoPlayMovie")
  707.  
  708.  
  709. ------- Adds ------------------------------------------------------
  710.  
  711. function Dredge_Ghouls_OnSpawn(pUnit, Event)
  712.     pUnit:RegisterEvent("TestRootFunctionNextSecond", 1, 1)
  713. end
  714.  
  715. function TestRootFunctionNextSecond(pUnit, Event)
  716.     if Lich == nil then
  717.     pUnit:RemoveFromWorld()
  718.     else
  719.     pUnit:Emote(449, 4000)
  720.     pUnit:Root()
  721.     pUnit:RegisterEvent("Delay_A_Second_And_See_WhatHappens_Tehe", math.random(1,1000), 1)
  722.     pUnit:RegisterEvent("SetFactionToHostileForTheEmote", 4500, 1)
  723.     end
  724. end
  725.  
  726. function Delay_A_Second_And_See_WhatHappens_Tehe(pUnit, Event)
  727.     pUnit:CastSpell(55719)
  728. end
  729.  
  730. function SetFactionToHostileForTheEmote(pUnit, Event)
  731.     pUnit:Unroot()
  732.     pUnit:SetFaction(21)
  733. end
  734.  
  735. RegisterUnitEvent(3769511, 18, "Dredge_Ghouls_OnSpawn")
  736.  
  737. ---------------------------------------------------------------------
  738.  
  739. function Shambling_Horrors_OnSpawn(pUnit, Event)
  740.     pUnit:RegisterEvent("zzTestRootFunctionNextSecond", 1, 1)
  741. end
  742.  
  743. function zzTestRootFunctionNextSecond(pUnit, Event)
  744.     if Lich == nil then
  745.     pUnit:RemoveFromWorld()
  746.     else
  747.     pUnit:Emote(449, 4000)
  748.     pUnit:Root()
  749.     pUnit:CastSpell(55719)
  750.     pUnit:RegisterEvent("zzSetFactionToHostileForTheEmote", 4500, 1)
  751.     end
  752. end
  753.  
  754. function zzSetFactionToHostileForTheEmote(pUnit, Event)
  755.     pUnit:Unroot()
  756.     pUnit:SetFaction(21)
  757. end
  758.  
  759. RegisterUnitEvent(3769811, 18, "Shambling_Horrors_OnSpawn")
  760.  
  761. function Shambling_Horrors_OnCombat(pUnit, Event)
  762.     if Lich == nil then
  763.     pUnit:RemoveFromWorld()
  764.     else
  765.     pUnit:RegisterEvent("Enrage_Spam_Incoming_Varied_Time", math.random(20000,25000), 0)
  766.     pUnit:RegisterEvent("Shockwave_thingy_time_notsure_on_timer", 15000, 0)
  767.     end
  768. end
  769.  
  770. function Enrage_Spam_Incoming_Varied_Time(pUnit, Event)
  771.     pUnit:FullCastSpell(72143)
  772. end
  773.  
  774. function Shockwave_thingy_time_notsure_on_timer(pUnit, Event)
  775.     pUnit:FullCastSpell(72149)
  776. end
  777.  
  778. function Shambling_Horrors_OnLeave(pUnit, Event)
  779.     pUnit:RemoveEvents()
  780. end
  781.  
  782. function Shambling_Horrors_OnDead(pUnit, Event)
  783.     pUnit:RemoveEvents()
  784. end
  785.  
  786. RegisterUnitEvent(3769811, 1, "Shambling_Horrors_OnCombat")
  787. RegisterUnitEvent(3769811, 2, "Shambling_Horrors_OnLeave")
  788. RegisterUnitEvent(3769811, 4, "Shambling_Horrors_OnDead")
  789.  
  790. ----- Ice Sphere --------------------------------------------------
  791.  
  792. function IceShard_OnSpawn(pUnit, Event)
  793.     pUnit:RegisterEvent("rage_rage_rage_rage_Rage_rage", 1, 1)
  794. end
  795.  
  796. function rage_rage_rage_rage_Rage_rage(pUnit, Event)
  797.     if Lich == nil then
  798.     pUnit:RemoveFromWorld()
  799.     else
  800.         pUnit:FullCastSpell(69090) -- Visual
  801.         local pla = pUnit:GetRandomPlayer(0)
  802.         if pla ~= nil then
  803.         pUnit:MoveTo(pla:GetX(), pla:GetY(), pla:GetZ(), pla:GetO())
  804.         pUnit:SetMovementFlags(1)
  805.         pUnit:RegisterEvent("rage_rage_rage_rage_Rage_rage_r", 1000, 8)
  806.         else
  807.         pUnit:RemoveFromWorld()
  808.         end
  809.     end
  810. end
  811.  
  812. function rage_rage_rage_rage_Rage_rage_r(pUnit, Event)
  813.     local plm = pUnit:GetClosestPlayer()
  814.     if plm ~= nil then
  815.         pUnit:FullCastSpell(69090)
  816.         if pUnit:GetDistanceYards(plm) < 4 then
  817.         pUnit:CastSpell(56135)
  818.         pUnit:RemoveEvents()
  819.         end
  820.     end
  821. end
  822.  
  823. RegisterUnitEvent(3769812, 18, "IceShard_OnSpawn")
  824.  
  825. ---- Raging Spirit ------------------------------------------------
  826.  
  827. function RagingSpirit_OnCombat(pUnit, Event)
  828.     if Lich == nil then
  829.     pUnit:RemoveFromWorld()
  830.     else
  831.     pUnit:RegisterEvent("Soul_Shriek_Random_Time_Depending_On_Mob", math.random(7500, 15000), 0)
  832.     pUnit:RegisterEvent("Soul_Shriek_Random_Visual", 1000, 1)
  833.     end
  834. end
  835.  
  836. function Soul_Shriek_Random_Visual(pUnit, Event)
  837.     pUnit:FullCastSpell(69198) -- Visual
  838. end
  839.  
  840. function Soul_Shriek_Random_Time_Depending_On_Mob(pUnit, Event)
  841.     pUnit:FullCastSpell(69242) -- Shriek
  842. end
  843.  
  844. function RagingSpirit_OnLeave(pUnit, Event)
  845.     pUnit:RemoveEvents()
  846. end
  847.  
  848. function RagingSpirit_OnDead(pUnit, Event)
  849.     pUnit:RemoveEvents()
  850. end
  851.  
  852. RegisterUnitEvent(3769813, 1, "RagingSpirit_OnCombat")
  853. RegisterUnitEvent(3769813, 2, "RagingSpirit_OnLeave")
  854. RegisterUnitEvent(3769813, 4, "RagingSpirit_OnDead")
  855.  
  856. ---- Flying Dudes ------------------------------------------------------
  857.  
  858. function zhgzFlying_Dude_OnCombat(pUnit, Event)
  859.     if Lich == nil then
  860.     pUnit:RemoveFromWorld()
  861.     else
  862.     pUnit:RegisterEvent("zhgzFlying_Dude_Find_Player", 1, 1)
  863.     end
  864. end
  865.  
  866. function zhgzFlying_Dude_Find_Player(pUnit, Event)
  867.     package = pUnit:GetClosestPlayer()
  868.     if package ~= nil then
  869.     pUnit:SetCombatCapable(1)
  870.     package:SetPlayerLock(1)
  871.     pUnit:SetMovementFlags(2)
  872.     pUnit:ChannelSpell(55520, package)
  873.     pUnit:MoveTo(pUnit:GetX(), pUnit:GetY(), pUnit:GetZ()+6, pUnit:GetO(), 12288)
  874.     package:MovePlayerTo(package:GetX(), package:GetY(), package:GetZ()+6, package:GetO(), 12288)
  875.     pUnit:RegisterEvent("now_we_have_loaded_preset_We_can_move_on", 2000, 1)
  876.     else
  877.     pUnit:RemoveFromWorld()
  878.     end
  879. end
  880.  
  881. function now_we_have_loaded_preset_We_can_move_on(pUnit, Event)
  882.     if package ~= nil then
  883.     package:CastSpell(52241) -- Choke visual
  884.     package:CastSpell(53658) -- Bubble to stop stupid animations
  885.     pUnit:ChannelSpell(29172, package) -- visual
  886.     pUnit:RegisterEvent("now_we_have_loaded_preset_We_can_move_on_two", 1500, 0)
  887.     else
  888.     pUnit:RemoveEvents()
  889.     pUnit:RemoveFromWorld()
  890.     end
  891. end
  892.  
  893. function now_we_have_loaded_preset_We_can_move_on_two(pUnit, Event)
  894.     if package ~= nil then
  895.         if pUnit:GetX() == 572 and pUnit:GetY() == -2121.5 then
  896.         pUnit:RemoveEvents()
  897.         pUnit:StopChannel()
  898.         package:RemoveAura(52241) -- choke
  899.         package:RemoveAura(53658) -- buble
  900.         package:SetPlayerLock(0)
  901.         package = nil
  902.         --pUnit:RemoveFromWorld() -- Causes crash :(
  903.         else
  904.         pUnit:SetMovementFlags(2)
  905.         package:ModifyFlySpeed(2.5)
  906.         pUnit:MoveTo(572, -2121.5, 1577.2, 0, 12288, 2.5)
  907.         package:MovePlayerTo(pUnit:GetX(), pUnit:GetY(), pUnit:GetZ() ,pUnit:GetO(), 12288)
  908.         end
  909.     else
  910.     pUnit:RemoveEvents()
  911.     pUnit:RemoveFromWorld()
  912.     end
  913. end
  914.  
  915. function zhgzFlying_Dude_OnDead(pUnit, Event)
  916.     pUnit:RemoveEvents()
  917.     pUnit:StopChannel()
  918.     package:RemoveAura(52241) -- choke
  919.     package:RemoveAura(53658) -- buble
  920.     package:SetPlayerLock(0)
  921.     package = nil
  922.     --pUnit:RemoveFromWorld() -- Causes crash :(
  923. end
  924.  
  925. RegisterUnitEvent(25452151, 1, "zhgzFlying_Dude_OnCombat")
  926. RegisterUnitEvent(25452151, 4, "zhgzFlying_Dude_OnDead")
  927.  
  928. ---- Vile Spirits ------------------------------------------------------
  929.  
  930. function VileSpiirt_OnCombat(pUnit, Event)
  931.     if Lich == nil then
  932.     pUnit:RemoveFromWorld()
  933.     else
  934.     pUnit:RegisterEvent("deoaopighophgeoaugozh_delay", 500, 1)
  935.     end
  936. end
  937.  
  938. function deoaopighophgeoaugozh_delay(pUnit, Event)
  939.     pUnit:Root()
  940.     pUnit:SetCombatCapable(1)
  941.     pUnit:RegisterEvent("Tick_Tick_Tick_dot_dot_dot_BOOM", 29000, 1)
  942. end
  943.  
  944. function Tick_Tick_Tick_dot_dot_dot_BOOM(pUnit, Event)
  945.     pUnit:RemoveEvents()
  946.     pUnit:CastSpell(37106)
  947.     pUnit:RegisterEvent("Kill_Self_Suicide_Or_Whathaveyou_vile", 1000, 1)
  948. end
  949.  
  950. function Kill_Self_Suicide_Or_Whathaveyou_vile(pUnit, Event)
  951.     pUnit:Despawn(1,0)
  952. end
  953.  
  954. function VileSpiirt_OnLeave(pUnit, Event)
  955.     pUnit:RemoveEvents()
  956. end
  957.  
  958. function VileSpiirt_OnDead(pUnit, Event)
  959.     pUnit:RemoveEvents()
  960. end
  961.  
  962. RegisterUnitEvent(5078151, 1, "VileSpiirt_OnCombat")
  963. RegisterUnitEvent(5078151, 2, "VileSpiirt_OnLeave")
  964. RegisterUnitEvent(5078151, 4, "VileSpiirt_OnDead")
  965.  
  966. ------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement