LUA Scripting Problem menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Knife's Avatar Member
    Reputation
    44
    Join Date
    Dec 2007
    Posts
    254
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Scripting Problem

    Ok so heres my script :
    Code:
    function Boss_Enrage(pUnit, Event)
        if pUnit:GetHealthPct() < 95 then
        pUnit:FullCastSpell(34670)
        pUnit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
        pUnit:RegisterEvent("Boss_Shadow_Bolt",10000, 0)
    end
    end
    
    function Boss_Shadow_Bolt(pUnit, Event) 
        print "Boss Shadow Bolt"
            if pUnit:GetHealthPct() < 70 then
        pUnit:RemoveEvents();
        pUnit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
        pUnit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
        pUnit:RegisterEvent("Boss_Thunderclap",20000, 0)
    end
    end
    
    function Boss_Thunderclap(pUnit, Event)
        print "Boss Thunderclap"
            if pUnit:GetHealthPct() < 50 then
        pUnit:RemoveEvents();
        pUnit:FullCastSpellOnTarget(36706,Unit:GetClosestPlayer())
        pUnit:SendChatMessage(11, 0, "Thunderclap...Feel that you newb")
        pUnit:RegisterEvent("Boss_Void_Bolt",30000, 0)
    end
    end
    
    function Boss_Void_Bolt(pUnit, Event)
        print "Boss Void Bolt"
            if pUnit:GetHealthPct() < 30 then
        pUnit:RemoveEvents();
        pUnit:FullCastSpellOnTarget(39329,Unit:GetClosestPlayer())
        pUnit:SendChatMessage(11, 0, "Now a good Void Bolt...Muhahaha are you feeling it?")
        pUnit:RegisterEvent("Boss_Shadow_Bolt_2",8000, 0)
    end
    end
    
    function Boss_Shadow_Bolt_2(pUnit, Event) 
        print "Boss Shadow Bolt 2"      
            if pUnit:GetHealthPct() < 15 then
        pUnit:RemoveEvents();
        pUnit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
        pUnit:SendChatMessage(11, 0, "Again Shadow Bolt on you...You are dead....")
    end
    end
    
    function Boss_OnCombat(pUnit, Event)
        punit:RegisterEvent("Boss_Enrage",10000,1)
    end
    end
    
    RegisterUnitEvent(130018,1,"Boss")
    I get the error :
    Code:
     scripts/BOSS_Grol'Mak.lua Expected '<eof>' expected near 'end'
    So whats the problem with my script?
    Use the "Search" Button, its not hard
    +RepEveryone who helps and contributes


    LUA Scripting Problem
  2. #2
    vb4evr's Avatar Member
    Reputation
    22
    Join Date
    Oct 2007
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this function
    function Boss_OnCombat(pUnit, Event)
    punit:RegisterEvent("Boss_Enrage",10000,1)
    end
    end

    RegisterUnitEvent(130018,1,"Boss")
    remove one end you have too many

    EDIT: I think you may have some other problems with your script with regards to Unit:GetClosestPlayer(). I think you will need to have it as pUnit:GetClosestPlayer() as you are passing in pUnit.
    Last edited by vb4evr; 03-10-2008 at 09:26 AM.

  3. #3
    Knife's Avatar Member
    Reputation
    44
    Join Date
    Dec 2007
    Posts
    254
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm i found one error :
    at this part :
    Code:
     			 				function Boss_OnCombat(pUnit, Event)
    punit:RegisterEvent("Boss_Enrage",10000,1)
    end
    end
     
    RegisterUnitEvent(130018,1,"Boss")
    It should be
    Code:
     			 				function Boss_OnCombat(pUnit, Event)
    punit:RegisterEvent("Boss_Enrage",10000,1)
    end
    end
     
    RegisterUnitEvent(130018,1,"Boss_OnCombat")
    Or?
    Use the "Search" Button, its not hard
    +RepEveryone who helps and contributes


  4. #4
    vb4evr's Avatar Member
    Reputation
    22
    Join Date
    Oct 2007
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No it should be

    Code:
    function Boss_OnCombat(pUnit, Event)
    punit:RegisterEvent("Boss_Enrage",10000,1)
    end
    RegisterUnitEvent(130018,1,"Boss")

  5. #5
    Knife's Avatar Member
    Reputation
    44
    Join Date
    Dec 2007
    Posts
    254
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I fixed it, it was another problem...i registered events from function to function and changed some things...thanks anyway:P
    Use the "Search" Button, its not hard
    +RepEveryone who helps and contributes


  6. #6
    vb4evr's Avatar Member
    Reputation
    22
    Join Date
    Oct 2007
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What was the other problem? as your first error was most definitely due to too many ends in the OnCombat function

  7. #7
    Knife's Avatar Member
    Reputation
    44
    Join Date
    Dec 2007
    Posts
    254
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Changed "pUnit" to "Unit"

    "unit" to "Unit"

    i modified

    Code:
    function Boss_OnCombat(Unit, Event)
    Unit:RegisterEvent("Boss_Enrage",10000,1)
    end
    end
     
    RegisterUnitEvent(130018,1,"Boss")
    to
    Code:
    function Boss_OnCombat(pnit, Event)
    Unit:RegisterEvent("Boss_Enrage",10000,1)
    end
    end
     
    RegisterUnitEvent(130018,1,"Boss_OnCombat")
    I deleted the ends you sayed
    Use the "Search" Button, its not hard
    +RepEveryone who helps and contributes


  8. #8
    vb4evr's Avatar Member
    Reputation
    22
    Join Date
    Oct 2007
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, not sure what ends you deleted as in my second post I put what the end problem was and what you changed doesn't look like that. But I guess if your script is working that is the important thing. I've added what I think the script should have looked like if you have any other problems.

    Code:
    function Boss_Enrage(pUnit, Event)
        if pUnit:GetHealthPct() < 95 then
        pUnit:RemoveEvents();
           pUnit:FullCastSpell(34670)
           pUnit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
           pUnit:RegisterEvent("Boss_Shadow_Bolt",10000, 0)
        end
    end
    function Boss_Shadow_Bolt(pUnit, Event) 
        print "Boss Shadow Bolt"
        if pUnit:GetHealthPct() < 70 then
           pUnit:RemoveEvents();
           pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
           pUnit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
           pUnit:RegisterEvent("Boss_Thunderclap",20000, 0)
        end
    end
    function Boss_Thunderclap(pUnit, Event)
        print "Boss Thunderclap"
        if pUnit:GetHealthPct() < 50 then
           pUnit:RemoveEvents();
           pUnit:FullCastSpellOnTarget(36706,pUnit:GetClosestPlayer())
           pUnit:SendChatMessage(11, 0, "Thunderclap...Feel that you newb")
           pUnit:RegisterEvent("Boss_Void_Bolt",30000, 0)
        end
    end
    function Boss_Void_Bolt(pUnit, Event)
        print "Boss Void Bolt"
        if pUnit:GetHealthPct() < 30 then
           pUnit:RemoveEvents();
           pUnit:FullCastSpellOnTarget(39329,pUnit:GetClosestPlayer())
           pUnit:SendChatMessage(11, 0, "Now a good Void Bolt...Muhahaha are you feeling it?")
           pUnit:RegisterEvent("Boss_Shadow_Bolt_2",8000, 0)
        end
    end
    function Boss_Shadow_Bolt_2(pUnit, Event) 
        print "Boss Shadow Bolt 2"      
        if pUnit:GetHealthPct() < 15 then
           pUnit:RemoveEvents();
           pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
           pUnit:SendChatMessage(11, 0, "Again Shadow Bolt on you...You are dead....")
        end
    end
    function Boss_OnCombat(pUnit, Event)
        pUnit:RegisterEvent("Boss_Enrage",10000,1)
    end
    RegisterUnitEvent(130018,1,"Boss")

  9. #9
    Knife's Avatar Member
    Reputation
    44
    Join Date
    Dec 2007
    Posts
    254
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Man thanks for help, it worked and seems i dont have any other problems :P, i have another question now, how can i make the mob cast more spells in a phase? So in Shadow Bolt Phase i want the Boss to cast more Shadow Bolts not only one
    Use the "Search" Button, its not hard
    +RepEveryone who helps and contributes


  10. #10
    vb4evr's Avatar Member
    Reputation
    22
    Join Date
    Oct 2007
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would do something like this
    Code:
    local nSpell = math.random(0,2)
    if (nSpell == 0) then
       pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
    elseif (nSpell == 1) then
      (put some other spell here)
    else
          (put some other spell here)
    end
    this would generate a random between 0 and 2 number and cast that spell. Change the random number to suit your needs.
    So for instance in your shadow bolt phase it would cast one of 3 spells every 10 seconds.
    Last edited by vb4evr; 03-10-2008 at 10:52 AM.

  11. #11
    Knife's Avatar Member
    Reputation
    44
    Join Date
    Dec 2007
    Posts
    254
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I change to that cuz with yours were not loading
    Code:
        local nSpell = math.random(0,2)
        if (nSpell == 0) then
            Unit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
        elseif (nSpell == 1) then
          Unit:FullCastSepllOnTarget(29924,Unit:GetClosestPlayer())
        else
          Unit:FullCastSepllOnTarget(29924,Unit:GetClosestPlayer())
    end
    Il try now in game and see if it works or not

    EDIT : lol the boss dont works anymore now
    Use the "Search" Button, its not hard
    +RepEveryone who helps and contributes


  12. #12
    vb4evr's Avatar Member
    Reputation
    22
    Join Date
    Oct 2007
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How doesn't the boss work?

    Edit... there are some other things that I am seeing that I am wondering about. Think about your logic and what you want the boss to do. If you are wanting the boss to enter combat and just tank till it hits 95% cast spell 34670 then at 70% start casting shadow bolt every 10 seconds until it hits the Thunderclap phase? Is this correct? If so... I would do that like this.

    Code:
    function Boss_Enrage(pUnit, Event)
        if pUnit:GetHealthPct() < 95 then
        pUnit:RemoveEvents();
           pUnit:FullCastSpell(34670)
           pUnit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
           pUnit:RegisterEvent("Boss_Shadow_Bolt",3000, 0)
        end
    end
    function Boss_Shadow_Bolt(pUnit, Event) 
        print "Boss Shadow Bolt"
        if pUnit:GetHealthPct() < 70 then
           pUnit:RemoveEvents();
           pUnit:RegisterEvent("ShadowBoltCast",10000,0)
           pUnit:RegisterEvent("Boss_Thunderclap",20000, 0)
        end
    end
    function ShadowBoltCast(pUnit,Event)
     pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
        pUnit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
    end
     
    function Boss_OnCombat(pUnit, Event)
        pUnit:RegisterEvent("Boss_Enrage",10000,1)
    end
    RegisterUnitEvent(130018,1,"Boss_OnCombat")
    This is not the full code but a change to the first phase. (I want you to see what the difference is and figure out how you would proceed for the rest.
    Basically the logic is this...
    1) BOss enters combat, checks the even Boss enrage every 10seconds
    2) Enter Boss_Enrage section at 95% health cast the spell 34670, send message and check the Boss_Shadow_Bolt_Section every 3 seconds
    3) Enter Boss_Shadow_Bolt_Section at less then 70% health and check the ShadowBoltCast section every 10 seconds which will trigger your ShadowBolt Cast and message.
    4) Check Boss_Thunderclap phase every 20 seconds.
    Last edited by vb4evr; 03-10-2008 at 11:24 AM.

  13. #13
    Knife's Avatar Member
    Reputation
    44
    Join Date
    Dec 2007
    Posts
    254
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He dont cast anything anymore....dont say anything anymore
    Use the "Search" Button, its not hard
    +RepEveryone who helps and contributes


  14. #14
    vb4evr's Avatar Member
    Reputation
    22
    Join Date
    Oct 2007
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    See my code above. If still not functioning please post your script at this point

  15. #15
    Knife's Avatar Member
    Reputation
    44
    Join Date
    Dec 2007
    Posts
    254
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats my script now : (very huge i know, im good )
    Code:
    function Boss_Enrage(Unit, Event)
           if Unit:GetHealthPct() < 95 then
           Unit:RemoveEvents();
           Unit:FullCastSpell(34670)
           Unit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
           Unit:RegisterEvent("Boss_Shadow_Bolt",3000, 0)
    end
    end
    
    function Boss_Shadow_Bolt(Unit, Event) 
           print "Boss Shadow Bolt"
           if Unit:GetHealthPct() < 80 then
           Unit:RemoveEvents();
           Unit:RegisterEvent("ShadowBoltCast",5000,0)
           Unit:RegisterEvent("Boss_Thunderclap",5000, 0)
    end
    end
    
    function ShadowBoltCast(Unit,Event)
        Unit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
        Unit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
    end
    
    function Boss_Thunderclap(Unit, Event)
            if Unit:GetHealthPct() < 60 then
        Unit:RemoveEvents()
        Unit:RegisterEvent("ThunderclapCast",10000, 0)
        Unit:RegisterEvent("Boss_Void_Bolt",7000, 0)
    
    end
    end
    
    function ThunderclapCast(Unit, Event)
        Unit:FullCastSpellOnTarget(36706,Unit:GetClosestPlayer())
        Unit:SendChatMessage(11, 0, "Thunderclap...Feel that you newb")
    end
    
    function Boss_Void_Bolt(Unit, Event)
            if Unit:GetHealthPct() < 50 then
        Unit:RemoveEvents()
        Unit:RegisterEvent("VoidBoltCast",10000, 0)
        Unit:RegisterEvent("Boss_Shadow_Bolt_2",5000, 0)
    end
    
    function VoidBoltCast(Unit, Event)
        Unit:FullCastSpellOnTarget(39329,Unit:GetClosestPlayer())
        Unit:SendChatMessage(11, 0, "Now a good Void Bolt...Muhahaha are you feeling it?")
    end
    end
    
    function Boss_Shadow_Bolt_2(Unit, Event)       
            if Unit:GetHealthPct() < 40 then
        Unit:RemoveEvents()
        Unit:RegisterEvent("ShadowBoltCast1",10000, 0)
        Unit:RegisterEvent("Boss_Water_Bolt",3000, 0)
    end
    end
    
    function ShadowBoltCast1(Unit, Event)
        Unit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
        Unit:SendChatMessage(11, 0, "Again Shadow Bolt on you...You are dead....")
    end
    
    function Boss_Water_Bolt(Unit, Event)
        if Unit:GetHealthPct() < 30 then
        Unit:RemoveEvents()
        Unit:RegisterEvent("WaterBoltCast",10000, 0)
        Unit:RegisterEvent("Boss_Stun",2000, 0)
    end
    end
    
    function WaterBoltCast(Unit, Event)
        Unit:FullCastSpellOnTarget(31012,Unit:GetClosestPlayer())
        Unit:SendChatMessage(11, 0, "Hehe, drink some water, Newb !!!!!!!")
    end
    
    function Boss_Stun(Unit, Event)
        if Unit:GetHealthPct() < 20 then
        Unit:RemoveEvents()
        Unit:RegisterEvent("StunCast",10000, 0)
        Unit:RegisterEvent("Boss_Wave",1000, 0)
    end
    end
    
    function StunCast(Unit, Event)
        Unit:FullCastSpellOnTarget(20170,Unit:GetClosestPlayer())
        Unit:SendChatMessage(11, 0, "Umm, what happened? Cannot move? Hahahahaa.....")
    end
    
    function Boss_Wave(Unit, Event)
            if Unit:GetHealthPct() < 15 then
        Unit:RemoveEvents()
        Unit:RegisterEvent("WaveCast",10000, 0)
        Unit:RegisterEvent("Boss_Hellfire",1000, 0)
    end
    end
    
    function WaveCast(Unit, Event)
        Unit:FullCastSpellOnTarget(36278,Unit:GetClosestPlayer())
        Unit:SendChatMessage(11, 0, "Lets wave, you NOOB........")
    end
    
    function Boss_Hellfire(Unit, Event)
        if Unit:GetHealthPct() < 10 then
        Unit:RemoveEvents()
        Unit:RegisterEvent("HellfireCast",10000, 0)
        Unit:RegisterEvent("Boss_Holy_Ground",1000, 0)
    end
    end
    
    function HellFireCast(Unit, Event)
        Unit:FullCastSpellOnTarget(43465,Unit:GetClosestPlayer())
        Unit:SendChatMessage(11, 0, "Cannot kill me noobs, BURN!!!!!!")
    end
    
    function Boss_Holy_Ground(Unit, Event)
        if Unit:GetHealthPct() < 5 then
        Unit:RemoveEvents()
        Unit:RegisterEvent("HolyGroundCast",10000, 0)
    end
    end
    
    function HolyGroundCast(Unit, Event)
        Unit:FullCastSpellOnTarget(29512,Unit:GetClosestPlayer())
        Unit:SendChatMessage(11, 0, "And for the finish take a Holy Spell.....")
    end
    
    
    function Boss_OnCombat(Unit, Event)
        Unit:RegisterEvent("Boss_Enrage",7000,1)
    
    end
    
    RegisterUnitEvent(130018,1,"Boss_OnCombat")
    Semms working for the Shadow bolt but for the others not...have i doed something wrong?
    Use the "Search" Button, its not hard
    +RepEveryone who helps and contributes


Page 1 of 2 12 LastLast

Similar Threads

  1. Lua script problem
    By robinelitenn in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 10-22-2009, 11:27 PM
  2. LUA script problem, teleporter.
    By Romis in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 12-02-2008, 04:32 PM
  3. LUA script problem
    By uberhak3r in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 07-09-2008, 06:32 PM
  4. [Help] Fairly large Lua script problem
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 03-16-2008, 09:03 PM
  5. Lua scripts problem
    By Mr.Ice.Cold in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-02-2008, 11:44 AM
All times are GMT -5. The time now is 03:02 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