Hey guys, im having tourble with two events.
One is a simple world boss fight, its not collision enabled as there will only ever be one at a time. It was working fine. I went away from a server and came back it was broken. Im unsure if somone else edited it or if it was an edit i made and didn't test. Unfortunatly i cannot find the problem.
When she died the death part works fine, but upon trying to enter combat with her nothing happens. She stands there doesnt fight back and regens health (As if she is leaving combat instead of starting it)
My Script:-
Code:
Twinboss = {}
local Twintemphold
local boss1
local boss2
function Twinboss.EldaraTwinboss_OnSpawn(Unit, Event)
boss1 = Unit
end
function Twinboss.EldaraTwinboss2_OnSpawn(Unit, Event)
boss2 = Unit
Unit:SetFaction(35)
end
function Twinboss.EldaraTwinboss2_OnDeath(Unit, Event)
if boss1:IsAlive() then
boss1:CastSpell(48138)
end
end
function Twinboss.EldaraTwinboss_OnCombat(Unit, Event)
if ((boss1 == nil) or (boss2==nil)) then
boss1:SendChatMessage(12, 0, "I'm sorry i don't seem to have the energy to fight. Please report this to a Dev")
else
boss1:SendChatMessage(12, 0, "You think you can take us?")
Unit:RegisterEvent("Twinboss.EldaraTwinboss_TalkOne", 2000, 1)
end
end
function Twinboss.EldaraTwinboss2_OnCombat(Unit, Event)
boss1:SetFaction(14)
boss2:SetFaction(14)
end
function Twinboss.EldaraTwinboss_TalkOne(Unit, Event)
boss2:SendChatMessage(12, 0, "Well, i suppose if your wish is to die, its granted")
boss1:SetFaction(14)
boss2:SetFaction(14)
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Strike", 3000, 0)
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Shadowstepp", 18000, 0)
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Mana", 5000, 0)
Unit:RegisterEvent("Twinboss.EldaraTwinboss_HPCHECK", 1000, 0)
end
function Twinboss.EldaraTwinboss_HPCHECK (Unit, Event)
if boss1:GetHealthPct() <= 25 then
Unit:RemoveEvents()
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Strike", 2500, 0)
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Mana", 5000, 0)
boss1:CastSpell(38151)
boss1:SendChatMessage(12, 0, "I am weak, Illumis protect me")
Unit:RegisterEvent("Twinboss.EldaraTwinboss_HPCHECK2", 1000, 0)
Twintemphold = Unit:GetMainTank()
end
if boss2:GetHealthPct() <= 25 then
Unit:RemoveEvents()
boss2:CastSpell(38151)
boss2:SendChatMessage(12, 0, "I am weak, Tenebrae protect me")
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Strike", 2500, 0)
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Mana", 5000, 0)
Unit:RegisterEvent("Twinboss.EldaraTwinboss_HPCHECK2", 1000, 0)
Twintemphold = Unit:GetMainTank()
end
end
function Twinboss.EldaraTwinboss_HPCHECK2 (Unit, Event)
if (boss1:GetHealthPct() <= 25) and (boss2:GetHealthPct() <= 25)then
Twintemphold = Unit:GetMainTank()
boss1:RemoveAura(38151)
boss2:RemoveAura(38151)
boss2:CastSpell(40733)
boss1:CastSpell(48138)
Unit:RemoveEvents()
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Strike", 3000, 0)
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Shadowstepp", 5000, 0)
Unit:RegisterEvent("Twinboss.EldaraTwinboss_Mana", 5000, 0)
end
end
function Twinboss.EldaraTwinboss_Mana(Unit, Event)
Unit:SetMana(38000)
boss2:SetMana(38000)
end
function Twinboss.EldaraTwinboss_Strike(Unit, Event)
if (math.random(10) > 5) then
boss1:CastSpellOnTarget(48638, Unit:GetMainTank())
else
boss2:CastSpellOnTarget(35395, Unit:GetMainTank())
boss2:CastSpellOnTarget(35395, Unit:GetMainTank())
end
end
function Twinboss.EldaraTwinboss_Shadowstepp(Unit, Event)
boss1:CastSpellOnTarget(36554, Unit:GetMainTank())
end
function Twinboss.EldaraTwinboss_OnLeaveCombat(Unit, Event)
Unit:SetFaction(7)
boss2:SetFaction(7)
Unit:RemoveEvents()
end
function Twinboss.EldaraTwinboss_OnKilledTarget(Unit, Event)
Unit:SendChatMessage(14, 0, "Another one bites the dust")
end
function Twinboss.EldaraTwinboss2_OnKilledTarget(Unit, Event)
Unit:SendChatMessage(14, 0, "Aww im sure he's in a better place. . . NOT")
end
--Death
function Twinboss.EldaraTwinboss_OnDeath(Unit, Event)
Unit:RemoveEvents()
Unit:SetFaction(7)
if boss2:IsAlive() then
Unit:CastSpellOnTarget(5, boss2)
boss2:RemoveAura(40733)
boss2:Despawn(1, 59500)
end
Unit:SendChatMessage(12, 0, "We both die. . as. . one")
if (Twintemphold == nil) then
Twintemphold = Unit:GetClosestPlayer()
end
if Twintemphold:GetPlayerLevel() < 43 then
Twintemphold:SpawnCreature(291512, Twintemphold:GetX(), Twintemphold:GetY()+3, Unit:GetZ()+20, Unit:GetO(), 35, 14000) -- self
end
end
--ANGEL BELOW
function Twinboss.Angel_Delay(Unit, Event)
local temphold = Twintemphold
local relic = false
if (Twintemphold == nil) then
temphold = Unit:GetClosestPlayer()
end
local gsize = 0
for z,x in pairs(temphold:GetGroupPlayers()) do
gsize = gsize + 1
end
if (math.random(10) > (5+gsize)) then
relic = true
end
if (gsize == 0) then
if (relic==true) then
temphold:AddItem(191599, 1)
Unit:SendChatMessage(12, 0, "Great work "..temphold:GetName()..", the heavens are proud of you. I will grant you my blessing and my relic.")
else
Unit:SendChatMessage(12, 0, "Great work "..temphold:GetName()..", the heavens are proud of you. I will grant you my blessing.")
end
temphold:CastSpell(20217)
temphold:CastSpell(48469)
temphold:CastSpell(48162)
temphold:CastSpell(48074)
temphold:CastSpell(48470)
temphold:CastSpell(53307)
temphold:CastSpell(42914)
end
for k,v in pairs(temphold:GetGroupPlayers()) do
if (relic==true) then
v:AddItem(191599, 1)
Unit:SendChatMessage(12, 0, "Great work "..v:GetName()..", the heavens are proud of you. I will grant you my blessing and my relic.")
else
Unit:SendChatMessage(12, 0, "Great work "..v:GetName()..", the heavens are proud of you. I will grant you my blessing.")
end
v:CastSpell(20217)
v:CastSpell(48469)
v:CastSpell(48162)
v:CastSpell(48074)
v:CastSpell(48470)
v:CastSpell(53307)
v:CastSpell(42914)
end
Twitempnhold = nil
Unit:RemoveEvents()
end
function Twinboss.Angel_OnSpawn(Unit, Event)
Unit:RegisterEvent("Twinboss.Angel_Delay", 1600, 1)
end
RegisterUnitEvent(291510, 1, "Twinboss.EldaraTwinboss2_OnCombat")
RegisterUnitEvent(291510, 18, "Twinboss.EldaraTwinboss2_OnSpawn")
RegisterUnitEvent(291510, 3, "Twinboss.EldaraTwinboss2_OnKilledTarget")
RegisterUnitEvent(291510, 4, "Twinboss.EldaraTwinboss2_OnDeath")
RegisterUnitEvent(291509, 1, "Twinboss.EldaraTwinboss_OnCombat")
RegisterUnitEvent(291509, 2, "Twinboss.EldaraTwinboss_OnLeaveCombat")
RegisterUnitEvent(291509, 3, "Twinboss.EldaraTwinboss_OnKilledTarget")
RegisterUnitEvent(291509, 4, "Twinboss.EldaraTwinboss_OnDeath")
RegisterUnitEvent(291509, 18, "Twinboss.EldaraTwinboss_OnSpawn")
RegisterUnitEvent(291512, 18, "Twinboss.Angel_OnSpawn")
The second is a gauntlet event, its started automaticly when your level 30. you get teleported to the arena and after a short speech it begins. Unfortunatly nothing happens when i hit level 30 (The end of the script isnt finished so only 1 wave so far but i need to get the start working before hand)
Code:
local Zuriel
local A_OnGoing = false
local A_Player
function onPlayerLevel(event, player)
Player:SendBroadcastMessage("DEBUG: LP1")
if (player:GetPlayerLevel() == 30) then
Player:SendBroadcastMessage("DEBUG: LEVELTRUE")
if (A_OnGoing == false) then
player:TeleportUnit(1, 5299.644531, -3758.356689, 1737.251343)
player:SetOrientation(3.117624)
player:Root()
player:PhaseSet(2)
player:RegisterEvent("Zuriel_Delay", 3000, 1)
A_OnGoing = true
A_Player = player
else
Player:SendBroadcastMessage("DEBUG: NOTLEVEL")
end
end
end
function Zuriel_Spawn(Unit, Event)
Unit:SetMovementType(2)
Unit:SetCombatMeleeCapable(0)
Unit:PhaseSet(2)
Zuriel = Unit
end
function Zuriel_Delay(Unit, Event)
Unit:SendChatMessage(12, 0, "Greetings "..A_Player:GetName()..", Welcome to the heavens, I'm sorry for calling you here.")
Unit:RegisterEvent("Zuriel_Delay2", 4000, 1)
end
function Zuriel_Delay2(Unit, Event)
Unit:SendChatMessage(12, 0, "The Elders have great faith in you, and they believe it is time.")
Unit:RegisterEvent("Zuriel_Delay3", 4000, 1)
end
function Zuriel_Delay2(Unit, Event)
Unit:SendChatMessage(12, 0, "Time for you to face a great challenge. Talk to me when you wish to begin")
A_Player:UnRoot()
Unit:RegisterEvent("Zuriel_Delay2", 4000, 1)
end
function Zuriel_GossipOnTalk(Unit, Event, player)
Unit:GossipCreateMenu(100, player, 0)
Unit:GossipMenuAddItem(0, "I am ready to begin!", 2915111, 0)
Unit:GossipSendMenu(player)
end
function Zuriel_GossipOnSelect(Unit, Event, player, id, intid, code, pMisc)
if (intid ==2915111) then
player:GossipComplete()
Zuriel:MoveTo(5269.394531, -3755.744873, 1735.667358, 6.241841);
Zuriel:RegisterEvent("Zuriel_Delay3", 5000, 1)
end
end
function Zuriel_Delay3(Unit, Event)
Unit:SendChatMessage(12, 0, "Goodluck my friend!")
Unit:SpawnCreature(650000, A_Player:GetX()+5, A_Player:GetY()+1, A_Player:GetZ()+5, Unit:GetO(), 14, 60000) -- self
Unit:SpawnCreature(650000, A_Player:GetX()-5, A_Player:GetY()+1, A_Player:GetZ()+5, Unit:GetO(), 14, 60000) -- self
Unit:SpawnCreature(650000, A_Player:GetX()+1, A_Player:GetY()+1, A_Player:GetZ()+5, Unit:GetO(), 14, 60000) -- self
Unit:SpawnCreature(650000, A_Player:GetX()-1, A_Player:GetY()+1, A_Player:GetZ()+5, Unit:GetO(), 14, 60000) -- self
Unit:RegisterEvent("Zuriel_Check", 1000, 1)
end
function Zuriel_Check(Unit, Event)
local evsize = 0
for z,x in pairs(A_Player:GetEnemiesInRange()) do
evsize = evsize + 1
end
if (evsize == 0) then
Zuriel:SendChatMessage(12, 0, "Well Done, You passed the first wave. Only Two More Remain")
A_OnGoing = false
end
end
RegisterServerHook(27, "onPlayerLevel")
RegisterUnitEvent(291511, 18, "Zuriel_Spawn")
RegisterUnitGossipEvent(291511, 1, "Zuriel_GossipOnTalk")
RegisterUnitGossipEvent(291511, 2, "Zuriel_GossipOnSelect")