[Lua] Need script help! menu

User Tag List

Results 1 to 2 of 2
  1. #1
    jarjarb14's Avatar Member
    Reputation
    1
    Join Date
    Apr 2007
    Posts
    6
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Need script help!

    So, below is my boss. As a precaution, this is my first script so I'm assuming there are going to be various errors. And boy are there errors...
    My biggest issue is that phase two of my boss just doesn't work. I've been changing things around for a while with no luck.

    Code:
    --[[
                    Archaeon Boss Script
                    Written by: Jarjarb
    
                    Phase 1: Saber Lash attack (every 5 secs) and shadowbolt volley (every 10 secs)
                             35 secs later
                    Phase 2: Random planned is stunned and DoT'd. Boss gets shield.
                             Boss stops DoT only if shield is broken, 31 secs have passed, or player has died.
                             Return to Phase 1. Unless...
                    Phase 3: Boss is at <20% health. Boss Enrages. Two adds spawned (Unstable Arcanoids) which move slowly and
    			 cast Arcane explosion every 2 seconds. These must be OT'd and kept away from party. More damage done to them, the faster they go.
    
                    Enjoy!
    --]]
    
    -- On Triggers
    
    function Archaeon_OnCombat(pUnit, Event)
            pUnit:SendChatMessage(14, 0, "You dare attack an Ambasador of Arcana?! Meet your end!")
            pUnit:RegisterEvent("Archaeon_Phase1", 2000, 0)
    end
    
    function Archaeon_LeaveCombat(pUnit, Event)
            pUnit:RemoveEvents()
            pUnit:SendChatMessage(12, 0, "Fools...")
    end
    
    function Archaeon_Kill(pUnit, Event)
            local chatrandom = math.random(1, 3)
    		if (chatrandom == 1) then
    			pUnit:SendChatMessage(12, 0, "Hahahahaha!")
    		elseif (chatrandom == 2) then
    			pUnit:SendChatMessage(12, 0, "Pathetic...")
    		elseif (chatrandom == 3) then
    			pUnit:SendchatMessage(12, 0, "A waste of my time...")
    		end
    end
    
    function Archaeon_Dead(pUnit, Event)
            pUnit:RemoveEvents()
            pUnit:SendChatMessage(12, 0, "What have you done....my people shall here of this...they will.....")
    end
    
    RegisterUnitEvent(40013, 1, "Archaeon_OnCombat")
    RegisterUnitEvent(40013, 2, "Archaeon_LeaveCombat")
    RegisterUnitEvent(40013, 3, "Archaeon_Kill")
    RegisterUnitEvent(40013, 4, "Archaeon_Dead")
    
    ------------------------------------------------------------------------Phase 1
    
    function Archaeon_Phase1(pUnit, Event)
            pUnit:RemoveEvents()
            pUnit:RegisterEvent("Archaeon_Phase3", 1000, 0)
            pUnit:RegisterEvent("Archaeon_Phase2", 35000, 1)
            pUnit:SendBroadcastMessage("PHASE 1")
    		pUnit:RegisterEvent("Archaeon_SaberLash", 5000, 0)
            pUnit:RegisterEvent("Archaeon_ShadowVolley", 10000, 0)
    end
    
    ------------------------------------------------------------------------Spells for Phase 1
    function Archaeon_SaberLash(pUnit, Event)
            pUnit:CastSpellOnTarget(43267, pUnit:GetMainTank())
    end
    
    function Archaeon_ShadowVolley(pUnit, Event)
            pUnit:CastSpellOnTarget(55323, pUnit:GetMainTank())
    end
    
    -------------------------------------------------------------------------Phase 2
    function Archaeon_Phase2(pUnit, Event)
            pUnit:RemoveEvents()
    		pUnit:CastSpell(71781)
    		pUnit:SendBroadcastMessage("PHASE 2")
    		pUnit:RegisterEvent("Archaeon_Phase1", 31000, 1)
            pUnit:RegisterEvent("Archaeon_AuraCheck", 100, 0)
    		pUnit:RegisterEvent("Archaeon_DrainAttack", 100, 1)
    end
    
    
    function Archaeon_DrainAttack(pUnit, target, Event)
    	if (target ~= nil) then
    	local target = pUnit:GetRandomPlayer(0)
    	local class = target:GetPlayerClass()
    	pUnit:ChannelSpell(target:GetGUID(),46466)
    	target:SendBroadcastMessage("Your life is mine!")
    	end
    	local x = pUnit:GetX()
    	local y = pUnit:GetY()
    	local z = pUnit:GetZ()
    	local o = pUnit:GetO()
    	local yfly = y + 2
    	local zfly = z + 2
    	target:MovePlayerTo(x, yfly, zfly, o, 256)
    	target:SetPlayerLock(true)
    	if (class == 1) then
    			pUnit:SendChatMessage(11, 0, "Pitiful Warrior... all brawn and no brains...")
    		elseif (class == 2) then
    			pUnit:SendChatMessage(11, 0, "Your faith in the Light shall be your undoing!")
    		elseif (class == 3) then
    			pUnit:SendChatMessage(11, 0, "Your primitive mind bores me.")
    		elseif (class == 4) then
    			pUnit:SendChatMessage(11, 0, "What have we here? A pest that shall be dealt with!")
    		elseif (class == 5) then
    			pUnit:SendChatMessage(11, 0, "Say your last prayers, Priest. Not that they'll help you...")
    		elseif (class == 6) then
    			pUnit:SendChatMessage(11, 0, "A former pawn of the Lich King... You shall die once more!")
    		elseif (class == 7) then
    			pUnit:SendChatMessage(11, 0, "Your Spirits won't save you now! Die worm!")
    		elseif (class == 8) then
    			pUnit:SendChatMessage(11, 0, "Tsk tsk... You have so much potential, Mage. Such a shame that you waste it on these so called friends.")
    		elseif (class == 9) then
    			pUnit:SendChatMessage(11, 0, "Your trust in daemon magic is astounding considering how weak it is compared to the magic of my people...")
    		elseif (class == 11) then
    			pUnit:SendChatMessage(11, 0, "Nature won't save you now, Child of Cenarius. Prepare to meet your doom.")
    		end
    end
    
    function Archaeon_AuraCheck(pUnit, target, Event)              --This is to check whether the Shield Aura has been destroyed.
            if (pUnit:HasAura(71781) == false) then
    		target:SetPlayerLock(false)
    		pUnit:StopChannel()
    		pUnit:RemoveEvents()
    		pUnit:RegisterEvent("Archaeon_Phase1", 100, 0)
            end
    end
    
    -------------------------------------------------------------------------Phase 3
    function Archaeon_Phase3(pUnit, Event)
            if (pUnit:GetHealthPct() <= 20) then
                    pUnit:RemoveEvents()
                    pUnit:SendBroadcastMessage("PHASE 3")
    				pUnit:CastSpell(68335)
                    pUnit:SendChatMessage(12, 0, "ENOUGH! We finish this now! Brothers, assist me!")
                    pUnit:RegisterEvent("Archeaon_SaberLash", 6000, 0)
    				local xx = pUnit:GetX()
    				local yy = pUnit:GetY()
    				local zz = pUnit:GetZ()
    				local xa = xx + 2
    				local xb = xx - 2
    				pUnit:SpawnCreature(40014,xa,yy,zz,14)
    				pUnit:SpawnCreature(40014,xb,yy,zz,14)
                    end
    end
    My plan is to have him shield himself, cause a player to be ported into the air while he channels a spell on them. The only way to rescue the person is to wait till the shield runs out or to destroy the shield. DPS is the name of the game.

    Feel free to mock my script. I actually want some criticism so fire away!

    And if you like the script, feel free to use it. Just gotta fix it! :P

    Thanks in advance

    [Lua] Need script help!
  2. #2
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    The only thing I see from quickly reading through it is a few syntex's are wrong (e.g: SpawnCreature(id,x,y,z,o,faction,time) you just have x y z faction) and you don't check to see if everything is there which could cause errors (get class -> would if the player was nil?).

Similar Threads

  1. Need Scripting help!
    By Arthis456 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 01-11-2009, 02:35 PM
  2. [LUA] Need expert help
    By Juve21 in forum World of Warcraft General
    Replies: 3
    Last Post: 10-13-2008, 11:04 PM
  3. [LUA] Need expert help
    By Juve21 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 10-13-2008, 02:16 AM
  4. New to LUA, need some help please.
    By C-Death in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 06-30-2008, 02:37 PM
  5. LUA Boss Script Help
    By neurothymia in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 02-05-2008, 02:57 PM
All times are GMT -5. The time now is 08:27 PM. 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