Script Help menu

User Tag List

Thread: Script Help

Results 1 to 2 of 2
  1. #1
    Xmaily's Avatar Master Sergeant
    Reputation
    14
    Join Date
    May 2013
    Posts
    115
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Script Help

    Hi there so I'm making this script and it's coming along very nicely but that last part is making me stuck once my boss his 10% hp he runs into the middle doing his RP then all the sudden he randomly starts playing all the functions from 10% and on at once and it keeps repeating until it crashes my server and I don't know what's going on. Please Help!

    Here is the last part of my script the the bug is happening

    function GarroshPhase4(pUnit, event)
    GarroshA:SetCombatCapable(0)
    GarroshA:Unroot()
    GarroshA:RemoveEvents()
    GarroshA:CastSpell(44779)
    local PlayersAllAround = GarroshA:GetInRangePlayers()
    for a, players in pairs(PlayersAllAround) do
    players:CastSpell(7383)
    GarroshA:SendChatMessage(42, 0, "Garrosh Goes Into A Frenzy!")
    GarroshA:SendChatMessage(42, 0, "Jaina protects her allys with a Water Shield!")
    GarroshA:RegisterEvent("GarroshRepellingWave", 8000, 1)
    GarroshA:RegisterEvent("GarroshEnervatingBrand", 5000, 1)
    GarroshA:RegisterEvent("GarroshBladeTempest", 10000, 0)
    GarroshA:RegisterEvent("GarroshDefilingHorror", 15000, 1)
    GarroshA:RegisterEvent("GarroshHopelessness", 10000, 0)
    GarroshA:RegisterEvent("GarroshSharedSuffering", 15000, 1)
    GarroshA:RegisterEvent("GarroshPhase5", 1000, 0)
    end
    end

    function GarroshPhase5(pUnit, event)
    if GarroshA:GetHealthPct() <= 10 then
    GarroshA:RemoveEvents()
    GarroshA:SetMovementFlags(1)
    GarroshA:SetCombatCapable(1)
    GarroshA:CastSpell(40647)
    GarroshA:SendChatMessage(14, 0, "Perhaps I've toyed with you long enough!")
    GarroshA:RegisterEvent("GarroshTrans7", 5000, 0)
    end
    end

    function GarroshTrans7(pUnit, event)
    GarroshA:SendChatMessage(14, 0, "It's time for you to witness the power of a GOD!")
    GarroshA:MoveTo(754.366333, 1301.582886, 266.171021, 2.304476)
    GarroshA:RegisterEvent("GarroshTrans8", 6000, 1)
    end

    function GarroshTrans8(pUnit, event)
    GarroshA:SendChatMessage(14,0,"Watch as I corrupt your champions Proudmoore. They will play a great role in taking over your Allaince Empire and reclaiming Orgrimmar for the orcs.")
    GarroshA:Root()
    JainaA:CastSpell(57772)
    JainaAespawn(1600, 0)
    local plr = GarroshA:GetRandomPlayer(0)
    if plr ~= nil then
    GarroshA:ChannelSpell(71769, plr)
    GarroshA:RegisterEvent("GarroshTrans9", 7000, 1)
    end
    end

    function GarroshTrans9(pUnit, event)
    GarroshA:SpawnCreature(JainaAEntryID, 742.116577, 1314.535034, 266.170746, 5.466067, 35, 0)
    GarroshA:RegisterEvent("GarroshTrans10", 1000, 1)
    end

    function GarroshTrans10(pUnit, event)
    JainaA:SendChatMessage(14, 0, "You...Are...NOTHING!")
    JainaA:EquipWeapons(873,0,0)
    JainaA:CastSpell(71773)
    GarroshA:RegisterEvent("GarroshTrans11", 5000, 1)
    end

    function GarroshTrans11(pUnit, event)
    JainaA:SendChatMessage(14, 0, "I...Cannot hold him alone!")
    JainaA:CastSpell(51361)
    GarroshA:StopChannel()
    GarroshA:CastSpell(72523)
    GarroshA:Emote(473, 120000)
    GarroshA:RegisterEvent("GarroshTrans12", 5000, 1)
    end

    function GarroshTrans12(pUnit, event)
    JainaA:SpawnCreature(ThrallAEntryID, 726.608459, 1298.765747, 266.170868, 0.231472, 35, 0)
    GarroshA:RegisterEvent("GarroshTrans13", 1000, 1)
    end

    function GarroshTrans13(pUnit, event)
    ThrallA:SendChatMessage(12, 0, "You are not alone.")
    ThrallA:MoveTo(739.550171, 1300.533447, 266.170868, 0.117219)
    GarroshA:RegisterEvent("GarroshTrans14", 4000, 1)
    end

    function GarroshTrans14(pUnit, event)
    ThrallA:CastSpell(51361)
    JainaA:SendChatMessage(12, 0, "Thrall!")
    GarroshA:RegisterEvent("GarroshTrans15", 5000, 1)
    end

    function GarroshTrans15(pUnit, event)
    JainaA:SendChatMessage(14, 0, "Garrosh must fall!")
    JainaA:SendChatMessage(42, 0, "Jaina Removes The Shadow Prison Affect!")
    GarroshA:Emote(473, 120000)
    end

    Thanks!

    Script Help
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Code:
    GarroshA:RegisterEvent("GarroshTrans7", 5000, 0)
    You set it to 0, so it will keep doing it every 5 seconds forever. Change this to 1.

    Use code tags: [-code] code goes here [-/code] (without the -)

    Also your style of coding is quite inefficient. This is a better way to do it (using a example of my script):

    Code:
    function Goblin_ThoradinSpawn(pUnit, Event)
    	pUnit:RegisterEvent("Thoradin_StartEvent", 3000, 0)
    end
    
    RegisterUnitEvent(205820, 18, "Goblin_ThoradinSpawn")
    
    function Thoradin_StartEvent(pUnit)
    	if can_start then
    		can_start = false
    		pUnit:MoveTo(-842.5, -1597.9, 53.8, 0.934246)
    		pUnit:RegisterEvent("Thoradin_Events_Handle", 1000, 0)
    	end
    end
    
    function Thoradin_Events_Handle(pUnit)
    	i = i + 1
    	if i == 6 then
    		pUnit:SendChatMessage(12,0,"Let's see...")
    		pUnit:Emote(69, 2500)
    	elseif i == 8 then
    		objb = pUnit:SpawnGameObject(690377, -841.65, -1596.6, 53.5, 0, 0, 100)
    		pUnit:SpawnCreature(18392, -841.65, -1596.6, 54, 1, 35, 0):SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
    		pUnit:MoveTo(-846.6, -1594.5, 53.6, 0.890507)
    	elseif i == 11 then
    		pUnit:Emote(69, 2500)
    	elseif i == 13 then
    		obja = pUnit:SpawnGameObject(690377, -845.5, -1593.2, 53.5, 1, 0, 100)
    		pUnit:SpawnCreature(18392, -845.5, -1593.2, 54, 1, 35, 0):SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
    	elseif i == 15 then
    		pUnit:SendChatMessage(12,0,"Right. Time for plan Beta-Bravo-Brandy!")
    		pUnit:Emote(15, 0)
    	elseif i == 19 then
    		pUnit:Emote(60, 0)
    	elseif i == 20 then
    		pUnit:SendChatMessage(14,0,"Run! Run for your lives!")
    		pUnit:SetMovementFlags(1)
    		pUnit:MoveTo(-862.4, -1617.5, 52.8, 0.924264)
    	elseif i == 29 then
    		pUnit:Emote(4,0)
    		local npc = pUnit:GetCreatureNearestCoords(pUnit:GetX(), pUnit:GetY(), pUnit:GetZ(), 205821)
    		if npc then
    			npc:SendChatMessage(12,0,"Oh my.")
    		end
    		local a = pUnit:GetCreatureNearestCoords(-841.65, -1596.6, 54, 18392)
    		local b = pUnit:GetCreatureNearestCoords(-845.5, -1593.2, 54, 18392)
    		if a then
    			a:CastSpell(60852)
    			a:Despawn(15000, 0)
    		end
    		if b then
    			b:CastSpell(60852)
    			b:Despawn(15000, 0)
    		end
    		local gate = pUnit:GetGameObjectNearestCoords(-841.2, -1592.44, 54.1486, 690376)
    		if gate then
    			gate:SetUInt32Value(0x0006+0x0003,0x200) -- damaged
    		end
    		if obja then
    			obja:Despawn(1,0)
    		end
    		if objb then
    			objb:Despawn(1,0)
    		end
    	elseif i == 33 then
    		pUnit:SendChatMessage(12,0,"It didn't go down, but we can soon fix that.")
    		pUnit:SetMovementFlags(0)
    		pUnit:MoveTo(-845.8, -1597.8, 53.6, 0.887626)
    	elseif i == 45 then
    		pUnit:SendChatMessage(12,0,"...and this is why I'm called Mr. Smith.")
    		pUnit:Emote(69, 5000)
    	elseif i == 49 then
    		obja = pUnit:SpawnGameObject(690377, -843, -1595, 53.6, 2, 0, 200)
    	elseif i == 51 then
    		pUnit:Emote(60, 0)
    	elseif i == 52 then
    		pUnit:Emote(60, 0)
    	elseif i == 53 then
    		pUnit:Emote(60, 0)
    	elseif i == 54 then
    		pUnit:SendChatMessage(14,0,"Time to run!")
    		pUnit:SetMovementFlags(1)
    		pUnit:MoveTo(-862.4, -1617.5, 52.8, 0.924264)
    		pUnit:SpawnCreature(18392, -843, -1595, 54, 0, 35, 0):SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)
    	elseif i == 63 then
    		pUnit:Emote(11,0)
    		local a = pUnit:GetCreatureNearestCoords(-843, -1595, 54, 18392)
    		if a then
    			a:CastSpell(60852)
    			a:Despawn(15000, 0)
    		end
    		local b = pUnit:GetGameObjectNearestCoords(-843, -1595, 53.6, 690377)
    		if b then
    			b:Despawn(1,0)
    		end
    		local gate = pUnit:GetGameObjectNearestCoords(-841.2, -1592.44, 54.1486, 690376)
    		if gate then
    			gate:SetUInt32Value(0x0006+0x0003,0x400) -- destroyed
    		end
    		pUnit:SetMovementFlags(0)
    	elseif i == 66 then
    		pUnit:SendChatMessage(12,0,"Come on honey, we're going on an adventure. The profits will be wonderful, we can live how we want as we want. Nobody tells the Smith's what to do...")
    		pUnit:MoveTo(-811.4, -1553.8, 54.2, 1.174046)
    	elseif i == 72 then
    		local npc = pUnit:GetCreatureNearestCoords(pUnit:GetX(), pUnit:GetY(), pUnit:GetZ(), 205821)
    		if npc then
    			npc:SendChatMessage(12,0,"It sounds so wonderful.")
    		end
    	elseif i == 75 then
    		pUnit:SendChatMessage(12,0,"You bet! The rabbits of Southshore are said to be the fluffiest in all of Azeroth.")
    	elseif i == 120 then
    		pUnit:ReturnToSpawnPoint()
    	elseif i == 160 then
    		local gate = pUnit:GetGameObjectNearestCoords(-841.2, -1592.44, 54.1486, 690376)
    		if gate then
    			gate:RemoveFlag(0x0006+0x0003,0x400)
    			gate:RemoveFlag(0x0006+0x0003,0x200)
    		end
    		pUnit:RemoveEvents()
    		i = 0
    		pUnit:SetNPCFlags(3)
    	end
    end

Similar Threads

  1. Lua script help and general questions from beginner
    By WinKIller0 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 02-23-2008, 04:38 AM
  2. LUA Boss Script Help
    By neurothymia in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 02-05-2008, 02:57 PM
  3. Need LUA Scripting Help ?
    By Snailz in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 02-04-2008, 12:36 PM
  4. Scripting help please will +rep need for a new server
    By runiker in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 01-22-2008, 04:05 AM
  5. [Ascent] Boss Scripts help
    By n0t5ew in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 12-24-2007, 03:04 PM
All times are GMT -5. The time now is 05:00 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search