[Help] Lua problem menu

User Tag List

Results 1 to 11 of 11
  1. #1
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] Lua problem

    Well, I have two different bosses and for some reason the second boss keeps doing the same things as the first boss, the luas are:

    First boss:
    Code:
    function jeg_1(pUnit, Event)
     if pUnit:GetHealthPct() < 70 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(30926)
      pUnit:RegisterEvent("jeg_2",1000, 0)
     end
    end
     
    function jeg_2(pUnit, Event)
     if pUnit:GetHealthPct() < 50 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(21858)
      pUnit:RegisterEvent("jeg_3",1000, 0)
     end
    end
     
    function jeg_3(pUnit, Event)
     if pUnit:GetHealthPct() < 30 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(25550)
      pUnit:RegisterEvent("jeg_4",1000, 0)
     end
    end
    
    function jeg_4(pUnit, Event)
     if pUnit:GetHealthPct() < 10 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(43218)
     end
    end
     
    function jeg_start(pUnit, Event)
     pUnit:RegisterEvent("jeg_1",1000, 0)
    end
    RegisterUnitEvent(3000004, 1, "jeg_start")
    Second boss:
    Code:
    function ger_1(pUnit, Event)
     if pUnit:GetHealthPct() < 70 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(38840)
      pUnit:SendChatMessage (11, 0, "DIE!!!")
      pUnit:RegisterEvent("ger_2",1000, 0)
     end
    end
     
    function ger_2(pUnit, Event)
     if pUnit:GetHealthPct() < 50 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(36127)
      pUnit:SendChatMessage (11, 0, "Die !")
      pUnit:RegisterEvent("ger_3",1000, 0)
     end
    end
     
    function ger_3(pUnit, Event)
     if pUnit:GetHealthPct() < 30 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(39666)
      pUnit:SendChatMessage (11, 0, "Nothing may harm me!")  
      pUnit:RegisterEvent("ger_4",1000, 0)
     end
    end
    
    function ger_4(pUnit, Event)
     if pUnit:GetHealthPct() < 10 then
      pUnit:RemoveEvents();
      pUnit:SendChatMessage (11, 0, "I will not die!")  
      pUnit:FullCastSpell(17683)
      pUnit:RegisterEvent("ger_5",1000, 0)
     end
    end
    
    function ger_5(pUnit, Event)
     if pUnit:GetHealthPct() < 75 then
      pUnit:RemoveEvents();
      pUnit:SendChatMessage (11, 0, "This will be your grave!")  
      pUnit:FullCastSpell(36127)
      pUnit:RegisterEvent("ger_6",1000, 0)
     end
    end
    
    function ger_6(pUnit, Event)
     if pUnit:GetHealthPct() < 50 then
      pUnit:RemoveEvents();
      pUnit:SendChatMessage (11, 0, "Die! All of you!")  
      pUnit:FullCastSpell(38840)
      pUnit:RegisterEvent("ger_7",1000, 0)
     end
    end
    
    function ger_7(pUnit, Event)
     if pUnit:GetHealthPct() < 10 then
      pUnit:RemoveEvents();
      pUnit:SendChatMessage (11, 0, "No!!")  
      pUnit:FullCastSpell(17928)
     end
    end
     
    function ger_start(pUnit, Event)
     pUnit:RegisterEvent("jeg_1",1000, 0)
     pUnit:SendChatMessage (11, 0, ", you will die here!")
    end
    RegisterUnitEvent(3000005, 1, "ger_start")
    I have no idea what's wrong, there are no errors in the console, its just that the second boss keeps doing the same thing as the first boss +Rep to anyone who figures out what I should do

    [Help] Lua problem
  2. #2
    SectorSeven's Avatar Banned
    Reputation
    444
    Join Date
    Oct 2007
    Posts
    1,948
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What are they named?

  3. #3
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you mean the bosses than the first one is Jeg'mosh, and the second is Ger'mosh

  4. #4
    Saedusii's Avatar Contributor
    Reputation
    116
    Join Date
    Nov 2007
    Posts
    457
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are they in separate Lua files? Or did you just place them in the same one?

    I don't know if this will affect anything, but if so, you should try separating them into two different .lua files.


  5. #5
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    They are in different files

  6. #6
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bump, anyone?

  7. #7
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bump
    Does anyone know what I should do?

  8. #8
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey Try this ok man

    function Jeg_Phase1(unit)
    if pUnit:GetHealthPct() < 70 then
    unit:CastSpell(30926)
    end

    function Jeg_Phase2(unit)
    if pUnit:GetHealthPct() < 50 then
    unit:CastSpell(2185
    end

    function Jeg_Phase3(unit)
    if pUnit:GetHealthPct() < 30 then
    unit:CastSpell(25550)
    end

    funtion Jeg_Phase4(unit)
    if pUnit:GetHealthPct() < 10 then
    unit:CastSpell(4321
    end



    function Jeg_OnEnterCombat(unit)
    Unit:SendChatMessage(12, 0, "Just change this to something u want the guy to say")
    unit:RegisterUnitEvent("Jeg_Phase1", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase2", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase3", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase4", 1000, 0)
    end
    end


    RegisterUnitEvent(3000004, 1, Jeg_OnEnterCombat)



    if it works just base the second one on this one or ill make you another if u need ok


    edit-------

    ok heres the second one XD i was bored so i did them for you






    function Ger_Phase1(unit)
    if pUnit:GetHealthPct() < 70 then
    unit:CastSpell(38840)
    Unit:SendChatMessage(11, 0, "DIE!!!")
    end

    function Jeg_Phase2(unit)
    if pUnit:GetHealthPct() < 50 then
    unit:CastSpell(36127)
    Unit:SendChatMessage(11, 0, "Die!!!!")
    end

    function Jeg_Phase3(unit)
    if pUnit:GetHealthPct() < 30 then
    unit:CastSpell(39666)
    Unit:SendChatMessage(11, 0, "Nothing may harm me!!!")
    end

    funtion Jeg_Phase4(unit)
    if pUnit:GetHealthPct() < 10 then
    unit:CastSpell(17683)
    Unit:SendChatMessage(11, 0, "I will not die!!")
    end

    funtion Jeg_Phase4(unit)
    if pUnit:GetHealthPct() < 75 then
    unit:CastSpell(17683)
    Unit:SendChatMessage(11, 0, "This will be your grace!!")
    end

    funtion Jeg_Phase6(unit)
    if pUnit:GetHealthPct() < 10 then
    unit:CastSpell(17683)
    Unit:SendChatMessage(11, 0, "Die! All of your!!")
    end




    function Jeg_OnEnterCombat(unit)
    Unit:SendChatMessage(12, 0, "Just change this to something u want the guy to say")
    unit:RegisterUnitEvent("Jeg_Phase1", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase2", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase3", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase4", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase5", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase6", 1000, 0)
    end
    end


    RegisterUnitEvent(3000005, 1, Jeg_OnEnterCombat)




    XD here ya go
    Last edited by mager1794; 03-22-2008 at 09:52 PM.
    Lunar Gaming - Reaching For The Stars

  9. #9
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found out, the error was:
    Code:
    function ger_start(pUnit, Event)
     pUnit:RegisterEvent("jeg_1",1000, 0)
     pUnit:SendChatMessage (11, 0, ", you will die here!")
    end
    RegisterUnitEvent(3000005, 1, "ger_start")
    I made it jeg instead of ger, so it was starting the other lua script, instead of this one

  10. #10
    mager1794's Avatar Member
    Reputation
    356
    Join Date
    Feb 2008
    Posts
    703
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh wow now im pissed i typed all that up lol
    Lunar Gaming - Reaching For The Stars

  11. #11
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    unit:RegisterUnitEvent("Jeg_Phase1", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase2", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase3", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase4", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase5", 1000, 0)
    unit:RegisterUnitEvent("Jeg_Phase6", 1000, 0)
    Don't do this. Register just the first phase, the others will never tick as you're removing all events every phase anyways.

Similar Threads

  1. [Help]DLL or LUA problem i have no idea
    By bfwlegend in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 01-31-2009, 01:58 AM
  2. [Help] Lua Problem
    By Thug4Life in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 01-01-2009, 01:19 PM
  3. [ArcEmu Help] LUA Weird Problem
    By KaMakaZe in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 10-04-2008, 02:17 PM
  4. [Help Plzzzz] LUA Problem with KJ Script
    By Arthas117 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 08-16-2008, 05:25 PM
  5. [HELP] LUA problem
    By Strupantwn in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 06-06-2008, 01:47 AM
All times are GMT -5. The time now is 05:06 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