Lua Issues menu

Shout-Out

User Tag List

Thread: Lua Issues

Results 1 to 2 of 2
  1. #1
    zatlantis's Avatar Member
    Reputation
    1
    Join Date
    Oct 2008
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua Issues

    Hi there, I started making my first lua script yesterday and it's not going to bad, however I've hit a block. I have scripted the boss, Algalon, to summon a guardian when he hits 50% hp, and enrage when he hits 30%, however, when he hits 50% he continues to spawn adds untill he is dead and at 30% he casts enrage over and over also spamming the area with his yelling. I have tried changing the following numbers. If I leave them at 0, the above problem persists. I thought if I changed them to 1, once the mob hit 50 or 30% he would do it once and stop, however the function does not run at all.

    Code:
    Unit:RegisterEvent("Algalon_Enrage", 1000, 0)
    Unit:RegisterEvent("Algalon_Guardians", 1000, 0)
    I was wondering if anybody knew what the issue was.

    Here is my lua so far.

    Code:
    function Algalon_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Stand back mortals. I am not here to fight you.")
    Unit:RegisterEvent("Algalon_BigBang", 40000, 1)
    Unit:RegisterEvent("Algalon_Enrage", 1000, 0)
    Unit:RegisterEvent("Algalon_Guardians", 1000, 0)
    end
    
    function Algalon_OnDied(Unit, Event)
    Unit:SendChatMessage(12, 0, "Perhaps it is your imperfection, that which grants you free will, that allows you to percivere over all cosmically calculated odds. You prevailed where the Titan's own perfect creations have failed.")
    Unit:RemoveEvents()
    end
    
    function Algalon_OnKilledTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "I do what I must.")
    end
    
    function Algalon_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end
    
    function Algalon_BigBang(Unit, Event)
    Unit:FullCastSpellOnTarget(64443, Unit:GetClosestPlayer())
    Unit:SendChatMessage(14, 0, "Witness the fury of cosmos!")
    end
    
    function Algalon_Ascend(Unit, Event)
    Unit:FullCastSpellOnTarget(64487, Unit:GetClosestPlayer())
    end
    
    function Algalon_Guardians(Unit, Event)
    if Unit:GetHealthPct() <= 50 then
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SpawnCreature (9999998, x, y, z, o, 14 ,60000);
    Unit:SendChatMessage(14, 0, "The stars come to my aid.")
    end
    end
    
    
    function Algalon_Enrage(Unit, Event)
    if Unit:GetHealthPct() <= 30 then
    Unit:SendChatMessage(14, 0, "Behold the tools of creation!")
    Unit:CastSpell(44779)
    Unit:SetScale(1)
    end
    end
    
    
    RegisterUnitEvent(9999999, 1, "Algalon_OnCombat")
    RegisterUnitEvent(9999999, 4, "Algalon_OnDied")
    RegisterUnitEvent(9999999, 3, "Algalon_OnKilledTarget")
    RegisterUnitEvent(9999999, 2, "Algalon_OnLeaveCombat")
    Thank you in advance.

    Lua Issues
  2. #2
    AngelSandy's Avatar Member
    Reputation
    19
    Join Date
    Jan 2009
    Posts
    330
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically you are making him spam his spells over and over in Algalon_OnCombay. To prevent this I suggest you make it so when he hits these 50 % you remove all events, and then re-register the functions such it would look something like this:
    Code:
    function Algalon_Guardians(Unit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:RemoveEvents()
    
           local x = Unit:GetX();
           local y = Unit:GetY();
           local z = Unit:GetZ();
           local o = Unit:GetO();
                  Unit:SpawnCreature (9999998, x, y, z, o, 14 ,60000);
                  Unit:SendChatMessage(14, 0, "The stars come to my aid.")
           Unit:RegisterEvent("Algalon_Bigbang", 40000, 0)
           Unit:RegisterEvent("Algalon_Enrage", 1000, 0)
           end
    end
    And when you get to enrange you do the same:
    Code:
    function Algalon_Enrage(Unit, Event)
    if Unit:GetHealthPct() <= 30 then
           Unit:RemoveEvents()
                  Unit:SendChatMessage(14, 0, "Behold the tools of creation!")
                  Unit:CastSpell(44779)
                  Unit:SetScale(1)
           Unit:RegisterEvent("Algalon_BigBang",40000,0)
    end
    end

    I am not entirely sure if it will work, but you can try it and report back.
    Last edited by AngelSandy; 06-12-2009 at 05:19 AM.

Similar Threads

  1. Lua issues
    By Evilbuffy in forum WoW EMU Questions & Requests
    Replies: 11
    Last Post: 04-27-2009, 02:42 PM
  2. Lua issue ( hide seek script)
    By zozoka in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 09-30-2008, 04:24 PM
  3. LUA issue..
    By kreegoth in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 09-22-2008, 11:56 PM
  4. LUA Issues
    By orion5814 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 06-20-2008, 04:03 PM
  5. [LUA Issue] Sudden self-targetting
    By Whitethebunny in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 06-07-2008, 09:06 PM
All times are GMT -5. The time now is 05:44 AM. 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