[LUA] Spells/Phases Not Occuring menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    trinityunit's Avatar Member
    Reputation
    5
    Join Date
    Aug 2008
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] Spells/Phases Not Occuring

    I'm having an issue with my LUA scripts, and it will do like one spell and say the OnCombat text it's supposed to, and then nothing else.

    I don't know if it's my DLL or not, but here are my scripts:

    Code:
    function HellfireMagus_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "You musn't betray the king!")
    
    function HellfireMagus_Spell1(Unit, Event)
    Unit:FullCastSpellOnTarget(61572, Unit:GetRandomPlayer(0))
    end
    
    function HellfireMagus_Spell2(Unit, Event)
    Unit:FullCastSpellOnTarget(40598, Unit:GetMainTank())
    end
    
    function HellfireMagus_Spell3(Unit, Event)
    Unit:CastSpell(25697)
    end
    
    Unit:RegisterEvent("HellfireMagus_Spell1", 3000, 1)
    Unit:RegisterEvent("HellfireMagus_Spell2", 3000, 1)
    Unit:RegisterEvent("HellfireMagus_Spell3", 3000, 3)
    end
    
    RegisterUnitEvent(999997, 1, "HellfireMagus_OnCombat")
    Code:
    function Zyxis_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "This won't take very long...")
    
    function Zyxis_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end
    
    function Zyxis_Spell1(Unit, Event)
    Unit:FullCastSpellOnTarget(24435, Unit:GetRandomPlayer(0))
    end
    
    function Zyxis_OnDied(Unit, Event)
    Unit:RemoveEvents()
    end
    
    function Zyxis_OnKilledTarget(Unit, Event)
    end
    
    function Zyxis_Phase1(Unit, Event)
    if Unit:GetHealthPct() <=75 then
    Unit:FullCastSpellOnTarget(28405, Unit:GetMainTank())
    Unit:FullCastSpellOnTarget(36843, Unit:GetMainTank())
    Unit:FullCastSpellOnTarget(38535, Unit:GetMainTank())
    end
    end
    
    function Zyxis_Phase2(Unit, Event)
    if Unit:GetHealthPct() <=50 then
    Unit:SendChatMessage(14, 0, "Ugh....")
    Unit:CastSpell(24647)
    Unit:FullCastSpellOnTarget(61673, Unit:GetRandomPlayer(0))
    end
    end
    
    function Zyxis_Phase3(Unit, Event)
    if Unit:GetHealthPct() <=20 then
    Unit:SendChatMessage(14, 0, "What is happening?!")
    Unit:SetModel(24993)
    Unit:SetScale(2)
    end
    end
    
    function Zyxis_Phase4(Unit, Event)
    if Unit:GetHealthPct() <=10 then
    Unit:CastSpell(47496)
    end
    end
    
    Unit:RegisterEvent("Zyxis_Spell1", 60000, 2)
    Unit:RegisterEvent("Zyxis_Phase1", 8000, 1)
    Unit:RegisterEvent("Zyxis_Phase2", 8000, 1)
    Unit:RegisterEvent("Zyxis_Phase3", 1000, 1)
    Unit:RegisterEvent("Zyxis_Phase4", 1000, 1)
    end
    
    RegisterUnitEvent(999999, 1, "Zyxis_OnCombat")

    [LUA] Spells/Phases Not Occuring
  2. #2
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function HellfireMagus_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "You musn't betray the king!")
    Unit:RegisterEvent("HellfireMagus_Spell1", 3000, 1) -- Spell1 after 3s
    Unit:RegisterEvent("HellfireMagus_Spell2", 6000, 1) -- spell2 after 6s, 
    Unit:RegisterEvent("HellfireMagus_Spell3", 9000, 3) -- spell3 after 9
    end
    
    function HellfireMagus_Spell1(Unit, Event)
    Unit:FullCastSpellOnTarget(61572, Unit:GetRandomPlayer(0))
    end
    
    function HellfireMagus_Spell2(Unit, Event)
    Unit:FullCastSpellOnTarget(40598, Unit:GetMainTank())
    end
    
    function HellfireMagus_Spell3(Unit, Event)
    Unit:CastSpell(25697)
    end
    
    RegisterUnitEvent(999997, 1, "HellfireMagus_OnCombat")
    [/code]



    Code:
    function Zyxis_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "This won't take very long...")
    Unit:RegisterEvent("Zyxis_Spell1", 60000, 2)
    Unit:RegisterEvent("Zyxis_Phase1", 1000, 0) -- checks every 1000 miliseconds if he get under 75%
    end
    
    function Zyxis_Spell1(Unit, Event)
    Unit:FullCastSpellOnTarget(24435, Unit:GetRandomPlayer(0))
    end
    
    function Zyxis_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end
    
    function Zyxis_OnDied(Unit, Event)
    Unit:RemoveEvents()
    end
    
    function Zyxis_OnKilledTarget(Unit, Event)
    end
    
    function Zyxis_Phase1(Unit, Event)
    if Unit:GetHealthPct() <=75 then
    Unit:RemoveEvents() -- Remove all Phases before
    Unit:RegisterEvent("Zyxis_Phase2", 1000, 0)
    Unit:FullCastSpellOnTarget(28405, Unit:GetMainTank())
    Unit:FullCastSpellOnTarget(36843, Unit:GetMainTank())
    Unit:FullCastSpellOnTarget(38535, Unit:GetMainTank())
    end
    end
    
    function Zyxis_Phase2(Unit, Event)
    if Unit:GetHealthPct() <=50 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "Ugh....")
    Unit:CastSpell(24647)
    Unit:FullCastSpellOnTarget(61673, Unit:GetRandomPlayer(0))
    Unit:RegisterEvent("Zyxis_Phase3", 1000, 0)
    end
    end
    
    function Zyxis_Phase3(Unit, Event)
    if Unit:GetHealthPct() <=20 then
    Unit:RemoveEvents() 
    Unit:SendChatMessage(14, 0, "What is happening?!")
    Unit:SetModel(24993)
    Unit:SetScale(2)
    Unit:RegisterEvent("Zyxis_Phase4", 1000, 0)
    end
    end
    
    function Zyxis_Phase4(Unit, Event)
    if Unit:GetHealthPct() <=10 then
    Unit:RemoveEvents() 
    Unit:CastSpell(47496)
    end
    end
    
    RegisterUnitEvent(999999, 1, "Zyxis_OnCombat")
    I marked the red things.

    At the Hellfire Magus, 3000, 6000 and 9000 are the times, when he will cast the spells. Ex: Every 3 seconds he will cast Spell1. Every 6 seconds he will cast Spell2 and so on.

    Edit: Normally he would cast every 3 sec, 6sec but you have a "1" after the Time, he will cast the Spell only one time

    The 1 after the seconds is how often he use the spell. Is this right, that he should only cast Spell1 one time? And Spell3 three times?

    And a question to the second script, should he cast Spell1 only in the OnCombat Phase?
    Last edited by Kaidos; 06-06-2009 at 12:25 PM.

  3. #3
    trinityunit's Avatar Member
    Reputation
    5
    Join Date
    Aug 2008
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I haven't tested the first script you gave me yet, but that seems correct, I didn't know the spells happened in rotation, I thought they were cast whenever.

    On the second script, no, I'd prefer he did it every sixty second.

    Thanx for your help anyway, +Rep

  4. #4
    Kaidos's Avatar Contributor
    Reputation
    148
    Join Date
    Jun 2008
    Posts
    324
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, np. Test the script, see what happens. And if you want change it, tell me

  5. #5
    trinityunit's Avatar Member
    Reputation
    5
    Join Date
    Aug 2008
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, cool yeah, the first one works

    And ty again for helping me understand certain things.
    I was reading a guide, and I misunderstood what certain things meant xD

    The second one works too! Except I need to choose some other spells for the phases xD.

  6. #6
    trinityunit's Avatar Member
    Reputation
    5
    Join Date
    Aug 2008
    Posts
    45
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am, again, having issues with LUA.

    Here is the script:

    Code:
    function Zyxis_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "This won't take very long...")
    Unit:RegisterEvent("Zyxis_Phase1", 500, 0)
    Unit:RegisterEvent("Zyxis_Phase2", 500, 0)
    Unit:RegisterEvent("Zyxis_Phase3", 500, 0)
    Unit:RegisterEvent("Zyxis_Phase4", 500, 0)
    Unit:RegisterEvent("Zyxis_Phase5", 500, 0)
    end
    
    function Zyxis_Phase1(Unit, Event)
    if Unit:GetHealthPct() <=75 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("Zyxis_Spell1", 1000, 1) --Cast "Mass Polymorph (29963)"
    elseif Unit:GetHealthPct() <=74 then
    Unit:RemoveEvents()
    elseif Unit:GetHealthPct() <=73 then
    end
    end
    
    function Zyxis_Phase2(Unit, Event)
    if Unit:GetHealthPct() <=50 then
    Unit:CastSpell(42745) --Casts "Enrage"
    elseif Unit:GetHealthPct() <=49 then
    Unit:RemoveEvents()
    elseif Unit:GetHealthPct() <=48 then
    end
    end
    
    function Zyxis_Phase3(Unit, Event)
    if Unit:GetHealthPct() <=30 then
    Unit:RegisterEvent("Zyxis_Spell3", 1000, 1) --Casts "Sunder Armor (25051)"
    elseif Unit:GetHealthPct() <=29 then
    Unit:RemoveEvents()
    elseif Unit:GetHealthPct() <=28 then
    end
    end
    
    function Zyxis_Phase4(Unit, Event)
    if Unit:GetHealthPct() <=20 then
    Unit:SendChatMessage(14, 0, "What is happening?!")
    Unit:SetModel(828)
    Unit:SetScale(4)
    elseif Unit:GetHealthPct() <=19 then
    Unit:RemoveEvents()
    elseif Unit:GetHealthPct() <=18 then
    end
    end
    
    function Zyxis_Phase5(Unit, Event)
    if Unit:GetHealthPct() <=15 then
    Unit:SendChatMessage(14, 0, "If I die, I'm taking you with me!")
    Unit:RegisterEvent("Zyxis_Spell4", 1000, 1) --Cast "Self Destruct (9879)"
    elseif Unit:GetHealthPct() <=14 then
    Unit:RemoveEvents()
    elseif Unit:GetHealthPct() <=13 then
    end
    end
    
    --[Spells]--
    
    function Zyxis_Spell1(Unit, Event)
    Unit:CastSpell(29963)
    end
    
    function Zyxis_Spell2(Unit, Event)
    Unit:CastSpell(43418)
    end
    
    function Zyxis_Spell3(Unit, Event)
    Unit:FullCastSpellOnTarget(25051,
    Unit:GetMainTank(0))
    end
    
    function Zyxis_Spell4(Unit, Event)
    Unit:FullCastSpellOnTarget(9879,
    Unit:GetRandomPlayer(0))
    end
    
    function Zyxis_Spell5(Unit, Event)
    Unit:FullCastSpellOnTarget(24435,
    Unit:GetRandomPlayer(0))
    end
    
    --[Misc]--
    
    function Zyxis_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents()
    end
    
    function Zyxis_OnKilledTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "Hahahaha...")
    end
    
    function Zyxis_OnDied(Unit, Event)
    Unit:RemoveEvents()
    end
    
    
    --[RegisterEvents]--
    
    RegisterUnitEvent(999999, 1, "Zyxis_OnCombat")
    RegisterUnitEvent(999999, 2, "Zyxis_OnLeaveCombat")
    RegisterUnitEvent(999999, 3, "Zyxis_OnKilledTarget")
    RegisterUnitEvent(999999, 4, "Zyxis_OnDied")
    It will do the first phase, but that's it, could someone tell me what has gone wrong?

  7. #7
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In phase 1 you do Unit:RemoveEvents() which means you remove all previous events, including the Zyxis_OnCombat function! So once it enters phase 1 it won't check every 0.5 seconds if he can enter the next phase anymore.
    Just remove all the Unit:RemoveEvents() and you should be fine. Or you could put Unit:RegisterEvent("Zyxis_Phase2", 500, 0) at the end of phase 1 so it still gets registered after all previous events have been removed.

Similar Threads

  1. VanCleef LUA - 4 Phases Script
    By Creepfold in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 05-11-2008, 05:13 AM
  2. No Global-Cooldown on any spell/ability. [NOT WPE]
    By shadeburn in forum WoW EMU Exploits & Bugs
    Replies: 6
    Last Post: 04-07-2008, 08:30 AM
  3. [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
  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. NPC Spells =) (Ascent, not sure about antrix)
    By Dpsfraud in forum WoW EMU Guides & Tutorials
    Replies: 4
    Last Post: 11-18-2007, 12:26 PM
All times are GMT -5. The time now is 10:04 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