Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Made by: kjanko--
- --For LUA 3# Lua Contest--
- --Style: Nature--
- --Bossname: Triburion--
- --Boss subname: King of the Nature--
- --Enjoy--
- local Triburion
- local Channel = {}
- local Raid = {}
- local Adds = {}
- local GossipGuy
- local plr = Triburion:GetRandomPlayer(0)
- local UNIT_FIELD_FLAGS = 0x00
- local timer = math.random(7000, 11500)
- function Triburion_Declare(Unit, Event)
- Triburion = Unit
- end
- function Triburion_OnSpawn(Unit, Event)
- Triburion:Root()
- Triburion:SetCombatCapable(1)
- Triburion:SetNextTarget(nil)
- Triborion:WipeHateList(1)
- Triburion:SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
- local x = Triburion:GetX()
- local y = Triburion:GetY()
- local z = Triburion:GetZ()
- local o = Triburion:GetO()
- Channel[1] = Triburion:SpawnCreature(ChannelID, x, y + 40, z, o, 14, 0)
- Channel[2] = Triburion:SpawnCreature(ChannelID, x + 40, y + 10, z, o, 14, 0)
- Channel[3] = Triburion:SpawnCreature(ChannelID, x - 40, y + 10, z, o, 14, 0)
- Channel[4] = Triburion:SpawnCreature(ChannelID, x + 10, y - 40, z, o, 14, 0)
- Channel[5] = Triburion:SpawnCreature(ChannelID, x - 10, y - 40, z, o, 14, 0)
- Triburion:SpawnCreature(GossipGuyID, x - 85, y, z, o, 35, 0)
- Triburion:RegisterEvent("Channeling", 1000, 1)
- end
- function Channeling(Unit, Event)
- for i=1, #Channel do
- Channel[i]:SetFacing(Channel[i]:CalcRadAngle(Channel[i]:GetX(), Channel[i]:GetY(), Triburion:GetX(), Triburion:GetY()))
- Channel[i]:ChannelSpell(13540, Triburion)
- end
- end
- function Triburion_OnCombat(Unit, Event)
- Triburion:SendChatMessage(14, 0, "I feel so powerful. Servants of the nature you shall be rewared for this. Now begone!")
- for i=1, #Channel do
- Channel[i]:Despawn(1, 0)
- Triburion:RemoveEvents()
- Triburion:RegisterEvent("Phase1", 1000, 1)
- end
- end
- function GossipGuy_Declare(pUnit, Event)
- GossipGuy = pUnit
- end
- function GossipGuy_OnGossip(pUnit, Event, player)
- GossipGuy:GossipCreateMenu(100, player, 0)
- GossipGuy:GossipMenuAddItem(9, "We're ready to face Triburion", 1 ,0)
- GossipGuy:GossipMenuAddItem(0, "We aren't ready yet...", 2, 0)
- GossipGuy:GossipSendMenu(player)
- end
- function Gossipguy_OnSelect(pUnit, Event, player, id, intid, code)
- if (intid == 1) then
- GossipGuy:SendChatMessage(14, 0, "Heroes finish him once and for all, in the name of the whole nature.")
- GossipGuy:Despawn(1, 0)
- Triburion:RegisterEvent("Triburion_OnCombat", 1000, 1)
- elseif (intid == 2) then
- player:GossipComplete()
- end
- end
- function Phase1(Unit, Event)
- Triburion:SendChatMessage(14, 0, "How you dare to challenge me! You shall fail!")
- Triburion:RegisterEvent("Roots", timer, 0)
- Triburion:RegisterEvent("Darkness", timer, 0)
- Triburion:RegisterEvent("Sunbeam", timer, 0)
- Triburion:RegisterEvent("NatureBomb", timer, 0)
- Triburion:RegisterEvent("Phase2", 1000, 1)
- end
- function Phase2(Unit, Event)
- if Unit:GetHealthPct() <= 56 then
- Triburion:RemoveEvents()
- Triburion:SendChatMessage(14, 0, "Servants of the nature arise! Your master calls!")
- Triburion:SetCombatCapable(1)
- Triburion:SetFaction(35)
- Triburion:WipeHateList(1)
- Adds[1] = Triburion:SpawnCreature(ADDSID, x, y + 40, z, o, 14, 0)
- Adds[2] = Triburion:SpawnCreature(ADDSID, x + 40, y + 10, z, o, 14, 0)
- Adds[3] = Triburion:SpawnCreature(ADDSID, x - 40, y + 10, z, o, 14, 0)
- Adds[4] = Triburion:SpawnCreature(ADDSID, x + 10, y - 40, z, o, 14, 0)
- Adds[5] = Triburion:SpawnCreature(ADDSID, x - 10, y - 40, z, o, 14, 0)
- for k,v in pairs(Adds) do
- for i=1, #Adds do
- if (Adds[i]:IsDead() == true) then
- Triburion:RegisterEvent("Phase3", 1000, 1)
- end
- end
- end
- end
- end
- function Phase3(Unit, Event)
- Triburion:SendChatMessage(14, 0, "My limit is reached. Feel the true power on your selves!")
- Triburion:SetCombatCapable(1)
- Triburion:SetFaction(14)
- Triburion:RegisterEvent("Roots", timer, 0)
- Triburion:RegisterEvent("Darkness", timer, 0)
- Triburion:RegisterEvent("Sunbeam", timer, 0)
- Triburion:RegisterEvent("NatureBomb", timer, 0)
- Triburion:RegisterEvent("UnstableEnergy", timer, 0)
- Triburion:RegisterEvent("Healing", 25000, 6)
- Triburion:RegisterEvent("TheEnd", 1000, 1)
- end
- function TheEnd(Unit, Event)
- if Triburion:GetHealthPct() <= 2 then
- Triburion:SpawnCreature(GOSSIPGUYID, x, y + 40, z, o, 14, 0)
- GossipGuy:SendChatMessage(14, 0, "Triburion, your time as a king has over. Congratulations heroes for defeating the corrupted")
- GossipGuy:Kill(Triburion)
- Triburion:Despawn(1, 0)
- GossipGuy:SpawnGameObject(GOID, x, y, z, o, duration) --The lootable chest--
- end
- end
- function Triburion_OnDied(Unit, Event)
- Triburion:SendChatMessage(14, 0, "It can't be. The nature can't ressist much longer without me...")
- Triburion:RemoveEvents()
- end
- function Triburion_OnLeaveCombat(Unit, Event)
- Triburion:RemoveEvents()
- end
- function Triburion_OnKilledPlayer(Unit, Event)
- Triburion:SendChatMessage(14, 0, "Another victim is taken by the nature")
- end
- function Roots(Unit, Event)
- for k,v in pairs(Raid) do
- for i= 1, #Raid do
- Triburion:FullCastSpellOnTarget(62283, Raid[i])
- end
- end
- end
- function Darkness(Unit, Event)
- local DarknessCheck = pUnit:GetRandomPlayer(0)
- if (DarknessCheck ~= nil) then
- Triburion:FullCastSpellOnTarget(45996, Triburion:GetRandomPlayer(0))
- end
- end
- function Sunbeam(Unit, Event)
- for k,v in pairs(Raid) do
- for i= 1, #Raid do
- Triburion:FullCastSpellOnTarget(62623, Raid[i])
- end
- end
- end
- function NatureBomb(Unit, Event)
- Triburion:FullCastSpellOnTarget(64587, Triburion:GetMainTank())
- end
- function UnstableEnergy(Unit, Event)
- Triburion:FullCastSpellOnTarget(62217, Triburion:GetMainTank())
- end
- function Healing(Unit, Event)
- Triburion:FullCastSpell(62209)
- end
- RegisterUnitEvent(TRIBURIONID, 1, "Triburion_OnCombat")
- RegisterUnitEvent(TRIBURIONID, 2, "Triburion_OnLeaveCombat")
- RegisterUnitEvent(TRIBURIONID, 3, "Triburion_OnKilledTarget")
- RegisterUnitEvent(TRIBURIONID, 4, "Triburion_OnDied")
- RegisterUnitEvent(TRIBURIONID, 6, "Triburion_OnSpawn")
- RegisterUnitEvent(TRIBURIONID, 18, "Triburion_Declare")
- RegisterUnitEvent(GOSSIPGUYID, 18, "GossipGuy_Declare")
- RegisterUnitGossipEvent(GOSSIPGUYID, 1, "GossipGuy_OnGossip")
- RegisterUnitGossipEvent(GOSSIPGUYID, 2, "GossipGuy_OnSelect")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement