Boss Script not working? menu

User Tag List

Results 1 to 11 of 11
  1. #1
    slrvertigo's Avatar Corporal
    Reputation
    1
    Join Date
    Mar 2011
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Boss Script not working?

    I'm trying to make a script for a Boss in a custom dungeon, and this is an example i've been following but It seems to have a problem at the IF section so what am i missing?

    Here's the script:

    local NAME = "Shimtan"
    local NPCID = 100001

    function Shimtan_OnCombat(Unit, event, player)
    Shimtan=Unit
    Unit:SendChatMessage(12, 0,"Prepare to feel the wrath of the Dead!!")
    Unit:RegisterEvent("Shimtan_Phase1",1000,1)
    end

    function Shimtan_OnLeaveCombat(Unit,Event,Player)
    Unit:SendChatMessage(14,0,"You cannot escape Death. I am always waiting...")
    end

    function Shimtan_OnDeath(Unit,Event,Player)
    Unit:SendChatMessage(14,0,"Even with my End, I will be waiting on the Other Side, My blade ready to slit your throat..")
    end


    function Shimtan_Phase1(Unit,Event,Player)
    If Shimtan:GetHealthPct() == 85 then
    Unit:SendChatMessage(12,0,"Witness My True Power!"
    Unit:CastSpell(52262)
    Unit:RegisterEvent("Elite_Phase2",1000,1)
    end
    end


    RegisterUnitEvent(100001,1,"Shimtan_OnCombat")
    RegisterUnitEvent(100001,2,"Shimtan_OnLeaveCombat")
    RegisterUnitEvent(100001,4,"Shimtan_OnDeath")

    So far am i doing it correctly? If i can get scripts under my collar i'm hoping to release some but i need a little help first lol

    Boss Script not working?
  2. #2
    newtech's Avatar Active Member
    Reputation
    57
    Join Date
    Aug 2008
    Posts
    308
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Shimtan_OnCombat(Unit, event, player)
    	Unit:SendChatMessage(12, 0, "Prepare to feel the wrath of the Dead!!")
    	Unit:RegisterEvent("Shimtan_Phase1", 1000, 1)
    end
    
    function Shimtan_OnLeaveCombat(Unit,Event,Player)
    	Unit:SendChatMessage(14, 0, "You cannot escape Death. I am always waiting...")
    end
    
    function Shimtan_OnDeath(Unit,Event,Player)
    	Unit:SendChatMessage(14, 0, "Even with my End, I will be waiting on the Other Side, My blade ready to slit your throat..")
    end
    
    
    function Shimtan_Phase1(Unit,Event,Player)
    	if Shimtan:GetHealthPct() == 85 then
    		Unit:SendChatMessage(12, 0, "Witness My True Power!"
    		Unit:CastSpell(52262)
    		Unit:RegisterEvent("Elite_Phase2", 1000, 1)
    	end
    end
    
    
    RegisterUnitEvent(100001, 1, "Shimtan_OnCombat")
    RegisterUnitEvent(100001, 2, "Shimtan_OnLeaveCombat")
    RegisterUnitEvent(100001, 4, "Shimtan_OnDeath")
    Try that. The problem is, you write 'If' instead of 'if'. (Capital I). Keywords doesn't normally start with uppercase. Lua is case sensetive :P A quick glance over the script, and that what I could come up with for errors :P Oh yeah, and you dont need the locals in the top, since you dont use them anywhere anyways

    Thanks
    Newtech

    Ps. PWND STONEHARRY! I GOT FIRST =D Sorry x)
    LuaHypArc Lua scripter - 3.3.5a World Builder.

  3. #3
    bendaferi's Avatar Active Member
    Reputation
    34
    Join Date
    Jun 2008
    Posts
    111
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's not correct sorry you registered "Shimtan_Phase1" wrong. Why? Because you made it to happen at the first sec only 1 time. Instead of 1 write 0, so It will check every seconds if the Unit has 85% or not. Also
    Code:
    if Shimtan:GetHealthPct() == 85 then
    Shimtan does not exist in this case, write Unit, or define it, but that's not necessary.
    Code:
    function Shimtan_OnCombat(Unit, Event, player)
    Unit:SendChatMessage(12, 0, "Prepare to feel the wrath of the Dead!!")
    Unit:RegisterEvent("Shimtan_Phase1", 1000, 0)
    -- Unit:RegisterEvent("Elite_Phase2",1000,0) -- Remove the "--" to activate this line
    end
    
    function Shimtan_OnLeaveCombat(Unit,Event,player)
    Unit:SendChatMessage(14, 0, "You cannot escape Death. I am always waiting...")
    end
    
    function Shimtan_OnDeath(Unit,Event, player)
    Unit:SendChatMessage(14, 0, "Even with my End, I will be waiting on the Other Side, My blade ready to slit your throat..")
    end
    
    function Shimtan_Phase1(Unit,Event,player)
    if Unit:GetHealthPct() == 85 then
    Unit:SendChatMessage(12, 0, "Witness My True Power!")
    Unit:CastSpell(52262)
    end
    end
    
    --[[
    function Elite_Phase2(Unit,Event,player)
    -- write stuff here...
    end
    --]]
    
    RegisterUnitEvent(100001, 1, "Shimtan_OnCombat")
    RegisterUnitEvent(100001, 2, "Shimtan_OnLeaveCombat")
    RegisterUnitEvent(100001, 4, "Shimtan_OnDeath")
    That should work.

  4. #4
    newtech's Avatar Active Member
    Reputation
    57
    Join Date
    Aug 2008
    Posts
    308
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by bendaferi View Post
    That's not correct sorry you registered "Shimtan_Phase1" wrong.
    ^ He's right. Sorry, didn't notice that, Bendaferi x) But yes, your right, it has to be changed to 0, so it repetitively checks to see if its 80%. Also, rather make it "if Unit:GetHealthPct() <= 85 then". That way, it wont bug, if say, the player crits, and damages more than down to 80% on the hit :P It will just activate the phase as soon as its bellow 80% HP x)

    And yea, regarding to that "Shimtan:GetHealthPct()"... He's right again, change that to Unit xD

    Guess I was sleepy this morning in school, when I made the first reply. But ofcourse, I was also in school, so that explains it. :P Don't flame me! XD

    Thanks
    Newtech
    LuaHypArc Lua scripter - 3.3.5a World Builder.

  5. #5
    slrvertigo's Avatar Corporal
    Reputation
    1
    Join Date
    Mar 2011
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried Both of those scripts, and they both worked at first, but i edited them slightly and when they stopped working i reset them to what you posted and now there not working at all? Any ideas?
    Btw- Newtech you forgot a ) right after the "Witness My true Power" command
    and Bend your script worked great but it made my boss constantly yell witness my power and refresh the buff every second?

  6. #6
    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)
    Add:

    Unit:RemoveEvents()

    To remove all events currently registered, which will stop the health being checked every second.

    Aka, like this (this is not your code and is pseudo code only):

    Code:
    function blablabla(unit, event)
    unit:RegisterEvent("checkhealth", 1000, 0)
    end
    
    function checkhealth(unit)
    if unit:GetHealthPct() < 50 then
    unit:RemoveEvents()
    unit:SendChatMessage(12,0,"I WILL ONLY SAY THIS ONCE!")
    end
    end
    
    RegisterUnitEvent(1, 1, "blablabla")

  7. #7
    slrvertigo's Avatar Corporal
    Reputation
    1
    Join Date
    Mar 2011
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright i have the script working but when i try to add my second phase, it fails? I'm Attempting to make him cast Army of the dead but it doesn't even register the Say command?

    function Shimtan_OnCombat(Unit, Event, player)
    Unit:SendChatMessage(12, 0, "Prepare to feel the wrath of the

    Dead!!")
    Unit:RegisterEvent("Shimtan_Phase1", 1000, 0)
    Unit:RegisterEvent("Shimtan_2", 1000, 0)
    end

    function Shimtan_OnLeaveCombat(Unit,Event,player)
    Unit:SendChatMessage(14, 0, "You cannot escape Death. I am always

    waiting...")
    end

    function Shimtan_OnDeath(Unit,Event, player)
    Unit:SendChatMessage(14, 0, "Even with my End, I will be waiting on

    the Other Side, My blade ready to slit your throat..")
    end

    function Shimtan_Phase1(Unit,Event,player)
    if Unit:GetHealthPct() <= 85 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(12, 0, "Witness My True Power!")
    Unit:CastSpell(52262)
    end
    end

    function Shimtan_2(Unit,Event,player)
    if Unit:GetHealthPct() <= 50 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14,0,"RISE MINIONS!!")
    Unit:CastSpell(67761)
    end
    end

    RegisterUnitEvent(100001, 1, "Shimtan_OnCombat")
    RegisterUnitEvent(100001, 2, "Shimtan_OnLeaveCombat")
    RegisterUnitEvent(100001, 4, "Shimtan_OnDeath")

    Also thank you for everyone who's helped so far

  8. #8
    slrvertigo's Avatar Corporal
    Reputation
    1
    Join Date
    Mar 2011
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright I've narrowed it down to the Unit:RemoveEvents() that is keeping my second function from starting so what would i put if i want My first function to end, and my second function to start?

  9. #9
    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)
    Register the phase 2 check after you remove events, removing events stops ALL currently registered events.

  10. #10
    slrvertigo's Avatar Corporal
    Reputation
    1
    Join Date
    Mar 2011
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function Shimtan_OnCombat(Unit, Event, player)
    Unit:SendChatMessage(12,0, "Prepare to feel the Wrath of the Dead!")
    Unit:RegisterEvent("Spell1", 1500000,0)
    Unit:RegisterEvent("Phase1", 1000,0)
    End

    function Shimtan_OnDeath(Unit, Event, player)
    Unit:SendChatMessage(14,0,"Oblivion Awaits Me...")
    end

    function Shimtan_OnKill(Unit,Event,Player)
    Unit:SendChatMessage(14,0,"Another joins my Legion!")
    end

    function Spell1(Unit,Event,Player)
    Unit:FullCastSpellOnTarget(75245, Unit:GetMainTank()) --ShadowBurn--
    end

    function Phase1(Unit,Event,Player)
    if Unit:GetHealthPct() <= 80
    Unit:RemoveEvents()
    Unit:RegisterEvent("Phase2", 1000,0)
    Unit:SendChatMessage(12,0, "Witness My True Power!")
    Unit:CastSpell(52262) --Enraged and Cornered--
    Unit:CastSpellOnTarget(69200,Unit:GetMainTank())
    end
    end

    function Phase2(Unit,Event,Player)
    if Unit:GetHealthPct() <= 50 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("Phase3",1000,0)
    Unit:SendChatMessage(14,0,"RISE MY MINION!")
    Unit:RegisterEvent(Spell2,1500000,0)
    end
    end

    function Phase3(Unit,Event,Player)
    if Unit:GetHealthPct() <= 15 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14,0,"I WILL NOT BE FINISHED BY THE LIKES OF YOU!!

    RISE MINIONS")
    Unit:RegisterEVent(Spell3,1500000, 5)
    end
    end

    function Spell3(Unit,Event,Player)
    Unit:FullCastSpell(7035 --summon--
    end

    function spell2(Unit,Event,Player)
    Unit:CastSpellOnTarget(56362,Unit:GetMainTank()) --Deathcoil--
    end
    end

    RegisterUnitEvent(100001,1,"Shimtan_OnCombat")
    RegisterUnitEVent(100001,2,"Shimtan_OnLeave")
    RegisterUnitEvent(100001,3,"Shimtan_OnKill")
    RegisterUnitEVent(100001,4,"Shimtan_OnDeath")

    It says ' = ' expected near function line 7?

  11. #11
    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:
    function Shimtan_OnCombat(Unit, Event)
    	Unit:SendChatMessage(12,0, "Prepare to feel the Wrath of the Dead!")
    	Unit:RegisterEvent("Spell1", 15000,0) -- every 15 seconds
    	Unit:RegisterEvent("Phase1", 1000,0) -- every second
    end -- End had capital E, this is what the error on line 7 was going on about
    
    function Shimtan_OnDeath(Unit, Event)
    	Unit:SendChatMessage(14,0,"Oblivion Awaits Me...")
    	Unit:RemoveEvents() -- Stop all registered
    end
    
    function Shimtan_OnKill(Unit,Event)
    	Unit:SendChatMessage(14,0,"Another joins my Legion!")
    end
    
    function Spell1(Unit)
    	Unit:FullCastSpellOnTarget(75245, Unit:GetMainTank()) --ShadowBurn--
    end
    
    function Phase1(Unit)
    	if Unit:GetHealthPct() <= 80
    		Unit:RemoveEvents()
    		Unit:RegisterEvent("Phase2", 1000,0)
    		Unit:SendChatMessage(12,0, "Witness My True Power!")
    		Unit:CastSpell(52262) --Enraged and Cornered--
    		Unit:CastSpellOnTarget(69200,Unit:GetMainTank())
    	end
    end
    
    function Phase2(Unit)
    	if Unit:GetHealthPct() <= 50 then
    		Unit:RemoveEvents()
    		Unit:RegisterEvent("Phase3",1000,0)
    		Unit:SendChatMessage(14,0,"RISE MY MINION!")
    		Unit:RegisterEvent("Spell2",15000,0) -- Missed "", 15 seconds
    	end
    end
    
    function Phase3(Unit)
    	if Unit:GetHealthPct() <= 15 then
    		Unit:RemoveEvents()
    		Unit:SendChatMessage(14,0,"I WILL NOT BE FINISHED BY THE LIKES OF YOU!! 
    
    		RISE MINIONS")
    		Unit:RegisterEVent(Spell3,1500000, 5)
    	end
    end
    
    function Spell3(Unit)
    	Unit:FullCastSpell(7035) -- Missed a ) --summon--
    end
    
    function spell2(Unit)
    	Unit:CastSpellOnTarget(56362,Unit:GetMainTank()) --Deathcoil--
    -- You had too many ends here
    end
    
    RegisterUnitEvent(100001,1,"Shimtan_OnCombat")
    RegisterUnitEVent(100001,2,"Shimtan_OnLeave")
    RegisterUnitEvent(100001,3,"Shimtan_OnKill")
    RegisterUnitEVent(100001,4,"Shimtan_OnDeath")
    Should work, added all codes on things I saw wrong through a skim read. Added comments on most the things I corrected.

    Please use [-code][-/code] boxes in future (remove -).

Similar Threads

  1. [Lua Script] Big lua boss script not working
    By tyeeeee1 in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 08-17-2010, 01:45 PM
  2. [HELP] Lua boss script not working-solutions?
    By WinKIller0 in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 03-21-2008, 08:19 AM
  3. [Help] Lua Script Not Working
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 26
    Last Post: 03-16-2008, 02:13 PM
  4. [Lua]Boss phases not working, NEED PRO HELP!!
    By blah7 in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 01-23-2008, 02:30 PM
  5. Simple Lua Script , not working need help!
    By Arugos in forum World of Warcraft Emulator Servers
    Replies: 16
    Last Post: 12-30-2007, 02:06 PM
All times are GMT -5. The time now is 08:03 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