Advertisement
Guest User

Kjankoski

a guest
Sep 15th, 2009
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.69 KB | None | 0 0
  1. --Made by: kjanko--
  2. --For LUA 3# Lua Contest--
  3. --Style: Nature--
  4. --Bossname: Triburion--
  5. --Boss subname: King of the Nature--
  6. --Enjoy--
  7.  
  8. local Triburion
  9. local Channel = {}
  10. local Raid = {}
  11. local Adds = {}
  12. local GossipGuy
  13. local plr = Triburion:GetRandomPlayer(0)
  14. local UNIT_FIELD_FLAGS = 0x00
  15. local timer = math.random(7000, 11500)
  16.  
  17. function Triburion_Declare(Unit, Event)
  18.          Triburion = Unit
  19. end
  20.  
  21. function Triburion_OnSpawn(Unit, Event)
  22.          Triburion:Root()
  23.          Triburion:SetCombatCapable(1)
  24.          Triburion:SetNextTarget(nil)
  25.          Triborion:WipeHateList(1)
  26.          Triburion:SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
  27.          local x = Triburion:GetX()
  28.          local y = Triburion:GetY()
  29.          local z = Triburion:GetZ()
  30.          local o = Triburion:GetO()
  31.          Channel[1] = Triburion:SpawnCreature(ChannelID, x, y + 40, z, o, 14, 0)
  32.          Channel[2] = Triburion:SpawnCreature(ChannelID, x + 40, y + 10, z, o, 14, 0)
  33.          Channel[3] = Triburion:SpawnCreature(ChannelID, x - 40, y + 10, z, o, 14, 0)
  34.          Channel[4] = Triburion:SpawnCreature(ChannelID, x + 10, y - 40, z, o, 14, 0)
  35.          Channel[5] = Triburion:SpawnCreature(ChannelID, x - 10, y - 40, z, o, 14, 0)
  36.          Triburion:SpawnCreature(GossipGuyID, x - 85, y, z, o, 35, 0)
  37.          Triburion:RegisterEvent("Channeling", 1000, 1)
  38. end
  39.  
  40. function Channeling(Unit, Event)
  41.          for i=1, #Channel do
  42.              Channel[i]:SetFacing(Channel[i]:CalcRadAngle(Channel[i]:GetX(), Channel[i]:GetY(), Triburion:GetX(), Triburion:GetY()))
  43.              Channel[i]:ChannelSpell(13540, Triburion)
  44.          end
  45. end
  46.  
  47. function Triburion_OnCombat(Unit, Event)
  48.          Triburion:SendChatMessage(14, 0, "I feel so powerful. Servants of the nature you shall be rewared for this. Now begone!")
  49.          for i=1, #Channel do
  50.          Channel[i]:Despawn(1, 0)
  51.          Triburion:RemoveEvents()
  52.          Triburion:RegisterEvent("Phase1", 1000, 1)
  53.          end
  54. end
  55.  
  56. function GossipGuy_Declare(pUnit, Event)
  57.          GossipGuy = pUnit
  58. end
  59.  
  60. function GossipGuy_OnGossip(pUnit, Event, player)
  61.          GossipGuy:GossipCreateMenu(100, player, 0)
  62.              GossipGuy:GossipMenuAddItem(9, "We're ready to face Triburion", 1 ,0)
  63.              GossipGuy:GossipMenuAddItem(0, "We aren't ready yet...", 2, 0)
  64.              GossipGuy:GossipSendMenu(player)
  65. end
  66.  
  67. function Gossipguy_OnSelect(pUnit, Event, player, id, intid, code)
  68.          if (intid == 1) then
  69.              GossipGuy:SendChatMessage(14, 0, "Heroes finish him once and for all, in the name of the whole nature.")
  70.              GossipGuy:Despawn(1, 0)
  71.              Triburion:RegisterEvent("Triburion_OnCombat", 1000, 1)
  72.          elseif (intid == 2) then
  73.              player:GossipComplete()
  74.          end
  75. end
  76.  
  77. function Phase1(Unit, Event)
  78.          Triburion:SendChatMessage(14, 0, "How you dare to challenge me! You shall fail!")
  79.          Triburion:RegisterEvent("Roots", timer, 0)
  80.          Triburion:RegisterEvent("Darkness", timer, 0)
  81.          Triburion:RegisterEvent("Sunbeam", timer, 0)
  82.          Triburion:RegisterEvent("NatureBomb", timer, 0)
  83.          Triburion:RegisterEvent("Phase2", 1000, 1)
  84. end
  85.  
  86. function Phase2(Unit, Event)
  87.          if Unit:GetHealthPct() <= 56 then
  88.              Triburion:RemoveEvents()
  89.              Triburion:SendChatMessage(14, 0, "Servants of the nature arise! Your master calls!")
  90.              Triburion:SetCombatCapable(1)
  91.              Triburion:SetFaction(35)
  92.              Triburion:WipeHateList(1)
  93.                  Adds[1] = Triburion:SpawnCreature(ADDSID, x, y + 40, z, o, 14, 0)
  94.                  Adds[2] = Triburion:SpawnCreature(ADDSID, x + 40, y + 10, z, o, 14, 0)
  95.                  Adds[3] = Triburion:SpawnCreature(ADDSID, x - 40, y + 10, z, o, 14, 0)
  96.                  Adds[4] = Triburion:SpawnCreature(ADDSID, x + 10, y - 40, z, o, 14, 0)
  97.                  Adds[5] = Triburion:SpawnCreature(ADDSID, x - 10, y - 40, z, o, 14, 0)
  98.          for k,v in pairs(Adds) do
  99.          for i=1, #Adds do
  100.              if (Adds[i]:IsDead() == true) then
  101.                  Triburion:RegisterEvent("Phase3", 1000, 1)
  102.              end
  103.              end
  104.              end
  105.              end
  106.          end
  107.  
  108. function Phase3(Unit, Event)
  109.          Triburion:SendChatMessage(14, 0, "My limit is reached. Feel the true power on your selves!")
  110.          Triburion:SetCombatCapable(1)
  111.          Triburion:SetFaction(14)
  112.          Triburion:RegisterEvent("Roots", timer, 0)
  113.          Triburion:RegisterEvent("Darkness", timer, 0)
  114.          Triburion:RegisterEvent("Sunbeam", timer, 0)
  115.          Triburion:RegisterEvent("NatureBomb", timer, 0)
  116.          Triburion:RegisterEvent("UnstableEnergy", timer, 0)
  117.          Triburion:RegisterEvent("Healing", 25000, 6)
  118.          Triburion:RegisterEvent("TheEnd", 1000, 1)
  119.          end
  120.  
  121. function TheEnd(Unit, Event)
  122.          if Triburion:GetHealthPct() <= 2 then
  123.          Triburion:SpawnCreature(GOSSIPGUYID, x, y + 40, z, o, 14, 0)
  124.          GossipGuy:SendChatMessage(14, 0, "Triburion, your time as a king has over. Congratulations heroes for defeating the corrupted")
  125.          GossipGuy:Kill(Triburion)
  126.          Triburion:Despawn(1, 0)
  127.          GossipGuy:SpawnGameObject(GOID, x, y, z, o, duration) --The lootable chest--
  128.          end
  129. end
  130.  
  131. function Triburion_OnDied(Unit, Event)
  132.          Triburion:SendChatMessage(14, 0, "It can't be. The nature can't ressist much longer without me...")
  133.          Triburion:RemoveEvents()
  134. end
  135.  
  136. function Triburion_OnLeaveCombat(Unit, Event)
  137.          Triburion:RemoveEvents()
  138. end
  139.  
  140. function Triburion_OnKilledPlayer(Unit, Event)
  141.          Triburion:SendChatMessage(14, 0, "Another victim is taken by the nature")
  142. end
  143.  
  144. function Roots(Unit, Event)
  145.          for k,v in pairs(Raid) do
  146.          for i= 1, #Raid do
  147.              Triburion:FullCastSpellOnTarget(62283, Raid[i])
  148.              end
  149.          end
  150. end
  151.  
  152. function Darkness(Unit, Event)
  153.          local DarknessCheck = pUnit:GetRandomPlayer(0)
  154.          if (DarknessCheck ~= nil) then
  155.              Triburion:FullCastSpellOnTarget(45996, Triburion:GetRandomPlayer(0))
  156.          end
  157. end
  158.  
  159. function Sunbeam(Unit, Event)
  160.          for k,v in pairs(Raid) do
  161.          for i= 1, #Raid do
  162.              Triburion:FullCastSpellOnTarget(62623, Raid[i])
  163.              end
  164.          end
  165. end
  166.  
  167. function NatureBomb(Unit, Event)
  168.          Triburion:FullCastSpellOnTarget(64587, Triburion:GetMainTank())
  169. end
  170.  
  171. function UnstableEnergy(Unit, Event)
  172.          Triburion:FullCastSpellOnTarget(62217, Triburion:GetMainTank())
  173. end
  174.  
  175. function Healing(Unit, Event)
  176.          Triburion:FullCastSpell(62209)
  177. end
  178.  
  179. RegisterUnitEvent(TRIBURIONID, 1, "Triburion_OnCombat")
  180. RegisterUnitEvent(TRIBURIONID, 2, "Triburion_OnLeaveCombat")
  181. RegisterUnitEvent(TRIBURIONID, 3, "Triburion_OnKilledTarget")
  182. RegisterUnitEvent(TRIBURIONID, 4, "Triburion_OnDied")
  183. RegisterUnitEvent(TRIBURIONID, 6, "Triburion_OnSpawn")
  184. RegisterUnitEvent(TRIBURIONID, 18, "Triburion_Declare")
  185. RegisterUnitEvent(GOSSIPGUYID, 18, "GossipGuy_Declare")
  186. RegisterUnitGossipEvent(GOSSIPGUYID, 1, "GossipGuy_OnGossip")
  187. RegisterUnitGossipEvent(GOSSIPGUYID, 2, "GossipGuy_OnSelect")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement