Need help with 2 Scripts (One Boss, One Gauntlet) menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with 2 Scripts (One Boss, One Gauntlet)

    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")

    Need help with 2 Scripts (One Boss, One Gauntlet)
  2. #2
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    100 views no one can see an issue :'( Any chance someone could test it on their server and see if it works. Might just be mine

  3. #3
    marcelo_20xx's Avatar Active Member
    Reputation
    25
    Join Date
    Sep 2008
    Posts
    165
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to change this part:

    Code:
    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
    to
    Code:
    function Twinboss.EldaraTwinboss_OnCombat(Unit, Event)
    if ((boss1 ~= nil) and (boss2~=nil)) then
    boss1:SendChatMessage(12, 0, "You think you can take us?")
    Unit:RegisterEvent("Twinboss.EldaraTwinboss_TalkOne", 2000, 1)
    end
    end
    Also I dont know what is collision needed for in the script?

    For your second problem either use "Player" or "player", not both of them and the script will work.

    or comment these lines:

    Code:
    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
    Last edited by marcelo_20xx; 07-22-2010 at 02:57 AM.

Similar Threads

  1. need help with .ahk script for showing users input text
    By lovemymuffin in forum Programming
    Replies: 0
    Last Post: 03-21-2011, 02:11 AM
  2. Need help with Lua script
    By Pieterkii in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 03-04-2010, 07:07 AM
  3. need help with npc script
    By bitty in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 10-16-2008, 06:21 AM
  4. Need help with my script [lua]
    By Satzen in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-18-2008, 05:19 PM
  5. [C++]Need help with my Scripted Item
    By freezer1012 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-13-2008, 05:55 PM
All times are GMT -5. The time now is 06:03 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search