Advertisement
Guest User

WodaN

a guest
Oct 14th, 2010
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.16 KB | None | 0 0
  1. local halion
  2. local halionN = {}
  3. local flames = {}
  4. local halionID = 99990
  5. local flame_object = 182260
  6. local flame_spell = 74528
  7. local eadric = {}
  8. local eadricID = 99991
  9. local avengwrath = 43430
  10. local holybolt = 57465
  11. local ashbringer = 57544
  12. local starter
  13. local battletime_sec = 0
  14. local battletime_min = 0
  15. local heal = 61965
  16. local bubble = 40733
  17. local inprogress = false
  18. local shadow_lance = 72810
  19. local delirious_slash = 71623
  20. local halion_buffs = 90
  21. local halion_buff = 62519
  22. local halion_heal_spell = 62892
  23. local debuffID = 999999
  24. local debuff = {}
  25. local enrage = 61212
  26.  
  27. function halion_spawn(pUnit, event)
  28.     halion = pUnit
  29.     halion:SetUInt32Value(59, 2)
  30.     halion:SetMovementFlags(2)
  31.     halion:MoveTo(5811.865234, 430.781677, 658.773376, 1.366595)
  32.     halion:RegisterEvent("halion_despawn_nearby", 4000, 1)
  33. end
  34.  
  35. function halion_despawn_nearby(pUnit, event)
  36.     for _,v in pairs(halion:GetInRangeUnits()) do
  37.         v:Despawn(3000, 600000)
  38.     end
  39.     halion:FullCastSpell(flame_spell)
  40.     halion:RegisterEvent("halion_flames", 2200, 1)
  41.     halion:RegisterEvent("eadric_spawn", 3000, 1)
  42.     halion:SendChatMessage(14, 0, "The heavens burn!")
  43.     halion:PlaySoundToSet(17505)
  44. end
  45.  
  46. function halion_flames(pUnit, event)
  47.     flames[1] = PerformIngameSpawn(2, flame_object, 571, 5836.120117, 451.244812, 658.778137, 3.223354, 500, 0)
  48.     flames[2] = PerformIngameSpawn(2, flame_object, 571, 5822.706543, 470.705505, 658.778992, 4.216882, 500, 0)
  49.     flames[3] = PerformIngameSpawn(2, flame_object, 571, 5804.275391, 471.398376, 658.780884, 5.013276, 500, 0)
  50.     flames[4] = PerformIngameSpawn(2, flame_object, 571, 5843.834473, 473.248962, 657.648315, 4.002699, 500, 0)
  51.     flames[5] = PerformIngameSpawn(2, flame_object, 571, 5811.180176, 491.086731, 657.165039, 4.214756, 500, 0)
  52. end
  53.  
  54. RegisterUnitEvent(halionID, 18, "halion_spawn")
  55.  
  56. function eadric_spawn(pUnit, event)
  57.     eadric[1] = PerformIngameSpawn(1, eadricID, 571, 5818.958008, 518.560913, 657.748291, 5.737253, 2007, 0)
  58.     eadric[1]:MoveTo(5831.867188, 513.460938, 657.748291, 4.578004)
  59.     eadric[1]:SetMovementFlags(1)
  60.     eadric[1]:EquipWeapons(13262, 0, 0)
  61.     halion:RegisterEvent("eadric_move1", 2000, 1)
  62. end
  63.  
  64. function eadric_move1(pUnit, event)
  65.     eadric[1]:MoveTo(5815.333984, 450.494781, 658.753113, 4.254894)
  66.     halion:RegisterEvent("eadric_taunt", 7000, 1)
  67. end
  68.  
  69. function eadric_taunt(pUnit, event)
  70.     eadric[1]:SendChatMessage(14, 0, "For the Argent Crusade!")
  71.     eadric[1]:SetUInt32Value(59, 0)
  72.     halion:RegisterEvent("flames_damage", 3000, 0)
  73.     halion:SetCombatCapable(0)
  74.     halion:SetUInt32Value(59, 0)
  75.     halion:SetMovementFlags(0)
  76.     halion:SetTauntedBy(eadric[1])
  77.     eadric[1]:SetTauntedBy(halion)
  78.     eadric[1]:SetTauntedBy(halionN[1])
  79.     battletime_sec = 1
  80.     battletime_min = 0
  81.     halion_buffs = 90
  82.     RegisterTimedEvent("battle_time_up", 1000, 0)
  83.     eadric[1]:RegisterEvent("eadric_spells", 1000, 1)
  84.     eadric[1]:RegisterEvent("eadric_bubble", 1000, 0)
  85.     halion:RegisterEvent("halion_spells", 1000, 1)
  86.     for i = 1, halion_buffs do
  87.         halion:CastSpell(halion_buff)
  88.     end
  89. end
  90.  
  91. function eadric_spells(pUnit, event)
  92.     eadric[1]:RegisterEvent("eadric_ash", 6000, 0)
  93.     eadric[1]:RegisterEvent("eadric_holybolt", 7000, 0)
  94.     eadric[1]:RegisterEvent("eadric_avengwrath", 15000, 0)
  95.     eadric[1]:RegisterEvent("eadric_heal", 10000, 0)
  96.     eadric[1]:RegisterEvent("eadric_spawn_f", 10000, 19)
  97. end
  98.  
  99. function eadric_spawn_f(pUnit, event)
  100.     starter:SendBroadcastMessage("["..pUnit:GetName().."]Spawning Debuff Brazier...["..battletime_min..":"..battletime_sec.."]")
  101.     local random_spawn = math.random(1, 6)
  102.     if(random_spawn == 1) then
  103.         debuff[1] = PerformIngameSpawn(2, debuffID, eadric[1]:GetMapId(), eadric[1]:GetX()+15, eadric[1]:GetY(), eadric[1]:GetZ(), eadric[1]:GetO(), 50, 5000)
  104.     elseif(random_spawn == 2) then
  105.         debuff[1] = PerformIngameSpawn(2, debuffID, eadric[1]:GetMapId(), eadric[1]:GetX()-15, eadric[1]:GetY(), eadric[1]:GetZ(), eadric[1]:GetO(), 50, 5000)
  106.     elseif(random_spawn == 3) then
  107.         debuff[1] = PerformIngameSpawn(2, debuffID, eadric[1]:GetMapId(), eadric[1]:GetX()+15, eadric[1]:GetY()+15, eadric[1]:GetZ(), eadric[1]:GetO(), 50, 5000)
  108.     elseif(random_spawn == 4) then
  109.         debuff[1] = PerformIngameSpawn(2, debuffID, eadric[1]:GetMapId(), eadric[1]:GetX()+15, eadric[1]:GetY()-15, eadric[1]:GetZ(), eadric[1]:GetO(), 50, 5000)
  110.     elseif(random_spawn == 5) then
  111.         debuff[1] = PerformIngameSpawn(2, debuffID, eadric[1]:GetMapId(), eadric[1]:GetX()-15, eadric[1]:GetY()-15, eadric[1]:GetZ(), eadric[1]:GetO(), 50, 5000)
  112.     elseif(random_spawn == 6) then
  113.         debuff[1] = PerformIngameSpawn(2, debuffID, eadric[1]:GetMapId(), eadric[1]:GetX()-15, eadric[1]:GetY()+15, eadric[1]:GetZ(), eadric[1]:GetO(), 50, 5000)
  114.     end
  115. end
  116.    
  117.  
  118. function halion_removebuff(pUnit, event)
  119.     eadric[1]:SetHealthPct(eadric[1]:GetHealthPct()+5)
  120.     starter:SendBroadcastMessage("["..pUnit:GetName().."]Healing Eadric the Pure, Current HP "..eadric[1]:GetHealth().."/"..eadric[1]:GetMaxHealth().."["..battletime_min..":"..battletime_sec.."]")
  121.     if(halion_buffs == 0) then
  122.     else
  123.         for i = 1, halion_buffs do
  124.             halion:RemoveAura(halion_buff)
  125.         end
  126.         halion_buffs = halion_buffs - 5
  127.         starter:SendBroadcastMessage("["..pUnit:GetName().."]Removing Buff from Halion, Buffs remaining: "..halion_buffs.."["..battletime_min..":"..battletime_sec.."]")
  128.         debuff[1]:Despawn(100, 0)
  129.         for i = 1, halion_buffs do
  130.             halion:CastSpell(halion_buff)
  131.         end
  132.     end
  133. end
  134.  
  135. function eadric_ash(pUnit, event)
  136.     if(eadric[1]:GetCurrentSpellId() == nil) then
  137.         eadric[1]:FullCastSpellOnTarget(ashbringer, halion)
  138.         starter:SendBroadcastMessage("["..pUnit:GetName().."]Ashbringer...["..battletime_min..":"..battletime_sec.."]")
  139.     end
  140. end
  141.  
  142. function eadric_holybolt(pUnit, event)
  143.     if(eadric[1]:GetCurrentSpellId() == nil) then
  144.         eadric[1]:FullCastSpellOnTarget(holybolt, halion)
  145.         starter:SendBroadcastMessage("["..pUnit:GetName().."]Holy Bolt...["..battletime_min..":"..battletime_sec.."]")
  146.     end
  147. end
  148.  
  149. function eadric_heal(pUnit, event)
  150.     if(eadric[1]:GetCurrentSpellId() == nil) then
  151.         eadric[1]:FullCastSpell(heal)
  152.         starter:SendBroadcastMessage("["..pUnit:GetName().."]Heal...["..battletime_min..":"..battletime_sec.."]")
  153.     end
  154. end
  155.  
  156. function eadric_avengwrath(pUnit, event)
  157.     if(eadric[1]:GetCurrentSpellId() == nil) then
  158.         eadric[1]:CastSpell(avengwrath)
  159.         starter:SendBroadcastMessage("["..pUnit:GetName().."]AvengWrath...["..battletime_min..":"..battletime_sec.."]")
  160.     end
  161. end
  162.  
  163. function battle_time_up(pUnit, event)
  164.     if battletime_sec == 59 then
  165.         battletime_min = battletime_min + 1
  166.         battletime_sec = 0
  167.     else
  168.         battletime_sec = battletime_sec + 1
  169.     end
  170. end
  171.  
  172. function eadric_bubble(pUnit, event)
  173.     if(eadric[1]:GetHealthPct() <= 45) then
  174.         starter:SendBroadcastMessage("Disabling spells... Bubble UP! ["..battletime_min..":"..battletime_sec.."]")
  175.         eadric[1]:CastSpell(bubble)
  176.         eadric[1]:RemoveEvents()
  177.         halion:RemoveEvents()
  178.         eadric[1]:SetUInt32Value(59, 2)
  179.         eadric[1]:RegisterEvent("eadric_heal", 2010, 0)
  180.         eadric[1]:RegisterEvent("eadric_stopheal", 21000, 1)
  181.     end
  182. end
  183.  
  184. function eadric_stopheal(pUnit, event)
  185.     eadric[1]:RemoveEvents()
  186.     eadric[1]:RemoveAura(bubble)
  187.     eadric[1]:SetUInt32Value(59, 0)
  188.     eadric[1]:RegisterEvent("eadric_enrage", 1000, 0)
  189.     eadric[1]:RegisterEvent("eadric_ash", 3000, 0)
  190.     eadric[1]:RegisterEvent("eadric_holybolt", 4000, 0)
  191.     eadric[1]:RegisterEvent("eadric_avengwrath", 15000, 0)
  192.     eadric[1]:RegisterEvent("eadric_spawn_f", 20000, 3)
  193.     halion:RegisterEvent("halion_spells", 1000, 1)
  194.     starter:SendBroadcastMessage("["..pUnit:GetName().."]Has Stopped healing self!["..battletime_min..":"..battletime_sec.."]")
  195. end
  196.  
  197. function eadric_enrage(pUnit, event)
  198.     if(halion:GetHealthPct() <= 30) then
  199.         eadric[1]:CastSpell(enrage)
  200.         eadric[1]:RemoveEvents()
  201.     eadric[1]:RegisterEvent("eadric_ash", 3000, 0)
  202.     eadric[1]:RegisterEvent("eadric_holybolt", 4000, 0)
  203.     eadric[1]:RegisterEvent("eadric_avengwrath", 15000, 0)
  204.     eadric[1]:RegisterEvent("eadric_spawn_f", 20000, 3)
  205.     end
  206. end
  207.  
  208. function flames_damage(pGameObject, event)
  209.     flames[1]:CastSpellOnTarget(64733, eadric[1])
  210.     flames[2]:CastSpellOnTarget(64733, eadric[1])
  211.     flames[3]:CastSpellOnTarget(64733, eadric[1])
  212.     flames[4]:CastSpellOnTarget(64733, eadric[1])
  213.     flames[5]:CastSpellOnTarget(64733, eadric[1])
  214. end
  215.  
  216. function halion_spells(pUnit, event)
  217.     halion:CastSpell(halion_heal_spell)
  218.     halion:RegisterEvent("halion_slash", 10000, 0)
  219.     halion:RegisterEvent("halion_shadowlance", 7000, 0)
  220. end
  221.  
  222. function halion_shadowlance(pUnit, event)
  223.     if(halion:GetCurrentSpellId() == nil) then
  224.         starter:SendBroadcastMessage("["..pUnit:GetName().."]Shadow Lance...["..battletime_min..":"..battletime_sec.."]")
  225.         halion:FullCastSpellOnTarget(shadow_lance, halion:GetMainTank())
  226.     end
  227. end
  228.  
  229. function halion_slash(pUnit, event)
  230.     if(halion:GetCurrentSpellId() == nil) then
  231.         starter:SendBroadcastMessage("["..pUnit:GetName().."]Delirious Slash...["..battletime_min..":"..battletime_sec.."]")
  232.         halion:FullCastSpellOnTarget(delirious_slash, halion:GetMainTank())
  233.     end
  234. end
  235.  
  236. function halion_spawn_msg(event, player, message, type, language)
  237.     if(message == "#halion") then
  238.         if(player:IsGm() == true) then
  239.             if(inprogress == false) then
  240.                 halionN[1] = PerformIngameSpawn(1, halionID, 571, 5800.203125, 389.554016, 669.523315, 1.334444, 2068, 0)
  241.                 starter = player
  242.                 inprogress = true
  243.             else
  244.                 player:SendBroadcastMessage("Halion encounter is already in progress!")
  245.             end
  246.         else
  247.             player:SendBroadcastMessage("Only GM or Admin can use this command!")
  248.         end
  249.         return 0
  250.     elseif(message == "#buffs") then
  251.         for i = 1, halion_buffs do
  252.             halion:RemoveAura(halion_buff)
  253.         end
  254.         halion_buffs = 0
  255.         eadric[1]:SetHealthPct(45)
  256.         halion:SetHealthPct(31)
  257.     end
  258. end
  259.  
  260. RegisterServerHook(16, "halion_spawn_msg")
  261.  
  262. function ead_hal_die(pUnit, event)
  263.     if(halion:IsDead() == true) then
  264.         for k,v in pairs(eadric[1]:GetInRangePlayers()) do
  265.             v:AddItem(49426, 5)
  266.         end
  267.     end
  268.     halion:RemoveEvents()
  269.     halion:Despawn(1000, 0)
  270.     eadric[1]:Despawn(1000, 0)
  271.     flames[1]:Despawn(1000, 0)
  272.     flames[2]:Despawn(1000, 0)
  273.     flames[3]:Despawn(1000, 0)
  274.     flames[4]:Despawn(1000, 0)
  275.     flames[5]:Despawn(1000, 0)
  276.     inprogress = false
  277.     RemoveTimedEvents()
  278. end
  279.    
  280. RegisterUnitEvent(halionID, 4, "ead_hal_die")
  281. RegisterUnitEvent(eadricID, 4, "ead_hal_die")
  282. RegisterGameObjectEvent(debuffID, 4, "halion_removebuff")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement