Lua Script Problem menu

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 36
  1. #16
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    The reason it does it in parts is because it's doing this:
    On combat, we check every few seconds if he has 90% or less health.
    Once he has 90% or less health, we remove events stopping it checking, and then get it checking for 80%.
    You need to change all the timers on RegisterEvents and remove the RemoveEvents() from each % to make it happen constently.

    Lua Script Problem
  2. #17
    Diemen's Avatar Member
    Reputation
    1
    Join Date
    Nov 2006
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How long should the timers be than ?
    Last edited by Diemen; 01-06-2010 at 05:35 PM.

  3. #18
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Diemen View Post
    How long should the timers be than ?

    pUnit:RegisterEvent("name", time, how many times)

    The name is the name of the function we are registering, the timer is every <time> seconds we do the function, like 1000 would do the function every second, and the times is how many times we do it, 0 being until we remove events (like the script I linked) or 3 being do it 3 times.

  4. #19
    Diemen's Avatar Member
    Reputation
    1
    Join Date
    Nov 2006
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol i feel very Stupid know :P

    My head begins to hurt of all this info :P

    but i did what you said.

    Code:
    function Lucius_Phase8(Unit, Event)
    if Unit:GetHealthPct() <15 then
    Unit:SendChatMessage(14, 0, "NO NO NO! I WON'T DIE ! ,UNGREADIAL TRANSFORM !")
    Unit:SetModel(10315)
    Unit:RemoveEvents()
    Unit:CastSpell(59159)
    Unit:RegisterEvent("Lucius_Phase9", 2000, 0)
    end
    end
    but i think it still looks the same

  5. #20
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Lucius_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Die you foul humans !")
    Unit:RegisterEvent("Lucius_Phase1", 2000, 0)
    end
    
    RegisterUnitEvent(210801, 1, "Lucius_OnCombat")
    
    function Lucius_Phase1(Unit, Event)
    if Unit:GetHealthPct() <= 90 then
    Unit:SendChatMessage(14, 0, "TAKE THIS !")
    Unit:CastSpell(42945)
    Unit:RemoveEvents() -- Stop the last repeating
    Unit:RegisterEvent("Lucius_Phase2", 2000, 0) -- next
    end
    end
    
    function Lucius_Phase2(Unit, Event)
    if Unit:GetHealthPct() <= 80 then
    Unit:SendChatMessage(14, 0, "YOU ARE SO WEAK !")
    Unit:FullCastSpellOnTarget(48127, Unit:GetMainTank(0)) -- You missed the closing )
    Unit:RemoveEvents() -- Stop the last repeating
    Unit:RegisterEvent("Lucius_Summon1", 12000, 1) -- missed the closing ) again
    end
    end
    
    function Lucius_Summon1(Unit, Event)
    local x = Unit:GetX()
    local y = Unit:GetY()
    local z = Unit:GetZ() -- We don't need ; this isn't C++
    local o = Unit:GetO()
    Unit:SpawnCreature (210803, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SpawnCreature (210803, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000) -- npcid, x, y, z, o, faction, time (correct I think)
    Unit:SpawnCreature (210803, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SendChatMessage(12, 0, "Let's see if you can handle this !")
    Unit:RegisterEvent("Lucius_Phase3", 30000, 0) -- 200000 is a VERY long time, shortened it
    end
    
    function Lucius_Phase3(Unit, Event)
    if Unit:GetHealthPct() <= 70 then
    Unit:RemoveEvents() -- Stop last register repeating
    Unit:SendChatMessage(14, 0, "KNEEL FOR ME YOU STUPID HUMANS")
    Unit:CastSpell(42921)
    Unit:RegisterEvent("Lucius_Phase4", 30009, 1)
    end
    end
    
    function Lucius_Phase4(Unit, Event)
    if Unit:GetHealthPct() <= 60 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "Enough of this ! , UNGREADIAL TRANSFORM !")
    Unit:SetModel(14508)
    Unit:SetScale(2)
    Unit:CastSpell(42926)
    Unit:RegisterEvent("Lucius_Phase5", 2000, 0)
    end
    end
    
    function Lucius_Phase5(Unit, Event)
    if Unit:GetHealthPct() <= 50 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "NO ONE CAN STOP ME !")
    Unit:CastSpell(42950)
    Unit:RegisterEvent("Lucius_Summon2", 12000, 0)
    end
    end
    
    function Lucius_Summon2(Unit, Event)
    Unit:RemoveEvents()
    local x = Unit:GetX()
    local y = Unit:GetY()
    local z = Unit:GetZ() -- Again this isn't C++ no ;
    local o = Unit:GetO()
    Unit:SpawnCreature (210804, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SpawnCreature (210804, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SpawnCreature (210804, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:RegisterEvent("Lucius_Phase6", 2000, 0)
    end
    
    function Lucius_Phase6(Unit, Event)
    if Unit:GetHealthPct() <= 40 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(12, 0, "UNGREADIAL TRANSFORM !")
    Unit:SetModel(1126)
    Unit:SetScale(3)
    Unit:CastSpell(42931)
    Unit:RegisterEvent("Lucius_Phase7", 2000, 0) -- You missed a 0 on 200
    end
    end
    
    function Lucius_Phase7(Unit, Event)
    if Unit:GetHealthPct() <= 25 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "FEEL THE POWER OF A TRUE GOD !")
    Unit:FullCastSpellOnTarget(5, Unit:GetMainTank(0)) -- Missed the closing )
    Unit:RegisterEvent("Lucius_Phase8", 20000, 0)
    end
    end
    
    
    function Lucius_Phase8(Unit, Event)
    if Unit:GetHealthPct() <= 25 then
    Unit:SendChatMessage(14, 0, "NO NO NO! I WON'T DIE ! ,UNGREADIAL TRANSFORM !")
    Unit:SetModel(10315)
    Unit:RemoveEvents()
    Unit:CastSpell(59159)
    Unit:RegisterEvent("Lucius_Phase8", 2000, 0)
    end
    end
    
    function Lucius_Phase9(Unit, Event)
    if Unit:GetHealthPct() <= 5 then
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "THIS CAN'T BE TRUE ! NOOOOOOOO.....")
    Unit:CastSpell(61721)
    end
    end
    
    
    function Lucius_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents() 
    Unit:SendChatMessage(12, 0, "Haha you weaklings !")
    end
    
    RegisterUnitEvent(210801, 2, "Lucius_OnLeaveCombat")
    
    function Lucius_OnKilledTarget(Unit, Event)
    Unit:SendChatMessage(12, 0, "Kneel for your god !") 
    end
    
    RegisterUnitEvent(210801, 3, "Lucius_OnKilledTarget")
    
    function Lucius_OnDied(Unit, Event)
    Unit:SendChatMessage(14, 0, "No..... SARCIUS !!!!!!!")
    Unit:RemoveEvents()
    end
    RegisterUnitEvent(210801, 4, "Lucius_OnDied")
    This script should work perfectly, in terms of doing each part 1 at a time, but you have to delete the removeevents lines and change the timers to make it keep doing them, but move ALL the register events to on combat because otherwise it will do this:

    RegisterEvent on 90% or less in 3 seconds
    90% or less: register event in 5 seconds

    See the problem?
    The register in 3 seconds will happen again before the 5 second one is called, meaning the 5 second timer will go back to 0 seconds and resulting it in never happening.

  6. #21
    Diemen's Avatar Member
    Reputation
    1
    Join Date
    Nov 2006
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This must be it than

    Code:
    function Lucius_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Die you foul humans !")
    Unit:RegisterEvent("Lucius_Phase1", 5000, 0)
    end
    
    RegisterUnitEvent(210801, 1, "Lucius_OnCombat")
    
    function Lucius_Phase1(Unit, Event)
    if Unit:GetHealthPct() <90 then
    Unit:SendChatMessage(14, 0, "TAKE THIS !")
    Unit:CastSpell(42945)
    Unit:RegisterEvent("Lucius_Phase2", 5000, 0) -- next
    end
    end
    
    function Lucius_Phase2(Unit, Event)
    if Unit:GetHealthPct() <80 then
    Unit:SendChatMessage(14, 0, "YOU ARE SO WEAK !")
    Unit:FullCastSpellOnTarget(48127, Unit:GetMainTank(0)) -- You missed the closing )
    Unit:RegisterEvent("Lucius_Summon1", 12000, 1) -- missed the closing ) again
    end
    end
    
    function Lucius_Summon1(Unit, Event)
    local x = Unit:GetX()
    local y = Unit:GetY()
    local z = Unit:GetZ() -- We don't need ; this isn't C++
    local o = Unit:GetO()
    Unit:SpawnCreature (210803, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SpawnCreature (210803, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000) -- npcid, x, y, z, o, faction, time (correct I think)
    Unit:SpawnCreature (210803, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SendChatMessage(12, 0, "Let's see if you can handle this !")
    Unit:RegisterEvent("Lucius_Phase3", 5000, 0) -- 200000 is a VERY long time, shortened it
    end
    
    function Lucius_Phase3(Unit, Event)
    if Unit:GetHealthPct() <70 then
    Unit:SendChatMessage(14, 0, "KNEEL FOR ME YOU STUPID HUMANS")
    Unit:CastSpell(42921)
    Unit:RegisterEvent("Lucius_Phase4", 5000, 0)
    end
    end
    
    function Lucius_Phase4(Unit, Event)
    if Unit:GetHealthPct() <60 then
    Unit:SendChatMessage(14, 0, "Enough of this ! , UNGREADIAL TRANSFORM !")
    Unit:SetModel(14508)
    Unit:SetScale(2)
    Unit:CastSpell(42926)
    Unit:RegisterEvent("Lucius_Phase5", 5000, 0)
    end
    end
    
    function Lucius_Phase5(Unit, Event)
    if Unit:GetHealthPct() <50 then
    Unit:SendChatMessage(14, 0, "NO ONE CAN STOP ME !")
    Unit:CastSpell(42950)
    Unit:RegisterEvent("Lucius_Summon2", 5000, 0)
    end
    end
    
    function Lucius_Summon2(Unit, Event)
    local x = Unit:GetX()
    local y = Unit:GetY()
    local z = Unit:GetZ() -- Again this isn't C++ no ;
    local o = Unit:GetO()
    Unit:SpawnCreature (210804, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SpawnCreature (210804, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SpawnCreature (210804, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:RegisterEvent("Lucius_Phase6", 5000, 0)
    end
    
    function Lucius_Phase6(Unit, Event)
    if Unit:GetHealthPct() <40 then
    Unit:SendChatMessage(12, 0, "UNGREADIAL TRANSFORM !")
    Unit:SetModel(1126)
    Unit:SetScale(3)
    Unit:CastSpell(42931)
    Unit:RegisterEvent("Lucius_Phase7", 5000, 0)
    end
    end
    
    function Lucius_Phase7(Unit, Event)
    if Unit:GetHealthPct() <25 then
    Unit:SendChatMessage(14, 0, "FEEL THE POWER OF A TRUE GOD !")
    Unit:FullCastSpellOnTarget(5, Unit:GetMainTank(0))
    Unit:RegisterEvent("Lucius_Phase8", 5000, 0)
    end
    end
    
    
    function Lucius_Phase8(Unit, Event)
    if Unit:GetHealthPct() <15 then
    Unit:SendChatMessage(14, 0, "NO NO NO! I WON'T DIE ! ,UNGREADIAL TRANSFORM !")
    Unit:SetModel(10315)
    Unit:CastSpell(59159)
    Unit:RegisterEvent("Lucius_Phase9", 5000, 0)
    end
    end
    
    function Lucius_Phase9(Unit, Event)
    if Unit:GetHealthPct() <5 then
    Unit:SendChatMessage(14, 0, "THIS CAN'T BE TRUE ! NOOOOOOOO.....")
    Unit:CastSpell(61721)
    end
    end
    
    
    function Lucius_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents() 
    Unit:SendChatMessage(12, 0, "Haha you weaklings !")
    end
    
    RegisterUnitEvent(210801, 2, "Lucius_OnLeaveCombat")
    
    function Lucius_OnKilledTarget(Unit, Event)
    Unit:SendChatMessage(12, 0, "Kneel for your god !")
    end
    
    RegisterUnitEvent(210801, 3, "Lucius_OnKilledTarget")
    
    function Lucius_OnDied(Unit, Event)
    Unit:SendChatMessage(14, 0, "No..... SARCIUS !!!!!!!")
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(210801, 4, "Lucius_OnDied")

  7. #22
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Lucius_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "Die you foul humans !")
    Unit:RegisterEvent("Lucius_Phase1", 5000, 0)
    Unit:RegisterEvent("Lucius_Phase2", 5000, 0) -- next
    Unit:RegisterEvent("Lucius_Phase9", 5000, 0)
    Unit:RegisterEvent("Lucius_Summon1", 12000, 1)
    Unit:RegisterEvent("Lucius_Phase3", 5000, 0)
    Unit:RegisterEvent("Lucius_Phase4", 5000, 0)
        Unit:RegisterEvent("Lucius_Phase5", 5000, 0)
       Unit:RegisterEvent("Lucius_Summon2", 5000, 0)
      Unit:RegisterEvent("Lucius_Phase6", 5000, 0)
     Unit:RegisterEvent("Lucius_Phase7", 5000, 0)
    Unit:RegisterEvent("Lucius_Phase8", 5000, 0)
    end
    
    RegisterUnitEvent(210801, 1, "Lucius_OnCombat")
    
    function Lucius_Phase1(Unit, Event)
    if Unit:GetHealthPct() <90 then
    Unit:SendChatMessage(14, 0, "TAKE THIS !")
    Unit:CastSpell(42945)
    end
    end
    
    function Lucius_Phase2(Unit, Event)
    if Unit:GetHealthPct() <80 then
    Unit:SendChatMessage(14, 0, "YOU ARE SO WEAK !")
    Unit:FullCastSpellOnTarget(48127, Unit:GetMainTank(0)) -- You missed the closing )
    end
    end
    
    function Lucius_Summon1(Unit, Event)
    local x = Unit:GetX()
    local y = Unit:GetY()
    local z = Unit:GetZ() -- We don't need ; this isn't C++
    local o = Unit:GetO()
    Unit:SpawnCreature (210803, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SpawnCreature (210803, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000) -- npcid, x, y, z, o, faction, time (correct I think)
    Unit:SpawnCreature (210803, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SendChatMessage(12, 0, "Let's see if you can handle this !")
    end
    
    function Lucius_Phase3(Unit, Event)
    if Unit:GetHealthPct() <70 then
    Unit:SendChatMessage(14, 0, "KNEEL FOR ME YOU STUPID HUMANS")
    Unit:CastSpell(42921)
    end
    end
    
    function Lucius_Phase4(Unit, Event)
    if Unit:GetHealthPct() <60 then
    Unit:SendChatMessage(14, 0, "Enough of this ! , UNGREADIAL TRANSFORM !")
    Unit:SetModel(14508)
    Unit:SetScale(2)
    Unit:CastSpell(42926)
    end
    end
    
    function Lucius_Phase5(Unit, Event)
    if Unit:GetHealthPct() <50 then
    Unit:SendChatMessage(14, 0, "NO ONE CAN STOP ME !")
    Unit:CastSpell(42950)
    end
    end
    
    function Lucius_Summon2(Unit, Event)
    local x = Unit:GetX()
    local y = Unit:GetY()
    local z = Unit:GetZ() -- Again this isn't C++ no ;
    local o = Unit:GetO()
    Unit:SpawnCreature (210804, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SpawnCreature (210804, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    Unit:SpawnCreature (210804, 10149.490234, 2551.358887, 1321.909180, 3.536894, 14 ,120000)
    end
    
    function Lucius_Phase6(Unit, Event)
    if Unit:GetHealthPct() <40 then
    Unit:SendChatMessage(12, 0, "UNGREADIAL TRANSFORM !")
    Unit:SetModel(1126)
    Unit:SetScale(3)
    Unit:CastSpell(42931)
    end
    end
    
    function Lucius_Phase7(Unit, Event)
    if Unit:GetHealthPct() <25 then
    Unit:SendChatMessage(14, 0, "FEEL THE POWER OF A TRUE GOD !")
    Unit:FullCastSpellOnTarget(5, Unit:GetMainTank(0))
    end
    end
    
    
    function Lucius_Phase8(Unit, Event)
    if Unit:GetHealthPct() <15 then
    Unit:SendChatMessage(14, 0, "NO NO NO! I WON'T DIE ! ,UNGREADIAL TRANSFORM !")
    Unit:SetModel(10315)
    Unit:CastSpell(59159)
    end
    end
    
    function Lucius_Phase9(Unit, Event)
    if Unit:GetHealthPct() <5 then
    Unit:SendChatMessage(14, 0, "THIS CAN'T BE TRUE ! NOOOOOOOO.....")
    Unit:CastSpell(61721)
    end
    end
    
    
    function Lucius_OnLeaveCombat(Unit, Event)
    Unit:RemoveEvents() 
    Unit:SendChatMessage(12, 0, "Haha you weaklings !")
    end
    
    RegisterUnitEvent(210801, 2, "Lucius_OnLeaveCombat")
    
    function Lucius_OnKilledTarget(Unit, Event)
    Unit:SendChatMessage(12, 0, "Kneel for your god !")
    end
    
    RegisterUnitEvent(210801, 3, "Lucius_OnKilledTarget")
    
    function Lucius_OnDied(Unit, Event)
    Unit:SendChatMessage(14, 0, "No..... SARCIUS !!!!!!!")
    Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(210801, 4, "Lucius_OnDied")

    Like that but change to the timers you want, at the moment it's going to do everything at once every 5 seconds.

  8. #23
    Diemen's Avatar Member
    Reputation
    1
    Join Date
    Nov 2006
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Timers are getting me a bit confused :S

    Do i need to Have different timers ? or what ?

    The timers are the "Checks" to check the Mob his Health for the phases right ?

  9. #24
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Diemen View Post
    The Timers are getting me a bit confused :S

    Do i need to Have different timers ? or what ?

    The timers are the "Checks" to check the Mob his Health for the phases right ?
    The timers you can be anything you want it to be, currently each timer is doing this:
    In 5 seocnds we check for the mobs hp, if the mobs hp is what were checking for then cast the spells and then repeat again in 5 seconds.
    So it is lasting forever till the mob dies/leaves combat.
    You need to change the timers to when you want it to do the spells, before doing the spells it checks for the health. So if you change it to 1000 from 5000 it will do the spells every second if it has the required amount of health.
    Understand now?

  10. #25
    Diemen's Avatar Member
    Reputation
    1
    Join Date
    Nov 2006
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah

    My idea was to do The Spell once or twice in each Phase so it would look like this right ?

    Unit:RegisterEvent("Lucius_Phase1", 10000, 2)

    This will make it use the Spell twice in 10 Sec right ?


  11. #26
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Diemen View Post
    Yeah

    My idea was to do The Spell once or twice in each Phase so it would look like this right ?

    Unit:RegisterEvent("Lucius_Phase1", 10000, 2)

    This will make it use the Spell twice in 10 Sec right ?


    Yes but you forget your doing the checks, so it will on combat check two times whether it has less than 50% hp for example, after the 2nd time it will stop checking so it may never cast the spell.

  12. #27
    Diemen's Avatar Member
    Reputation
    1
    Join Date
    Nov 2006
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh haha , So How much Checking would you recommand ?

  13. #28
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Diemen View Post
    Oh haha , So How much Checking would you recommand ?
    I would of done it so that:
    Check for 90% forever.
    When 90% is reached remove events and register this event AGAIN for 2 times, and register the next event forever.
    And so on.
    If that makes sense.

  14. #29
    Diemen's Avatar Member
    Reputation
    1
    Join Date
    Nov 2006
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So Like this ?

    Code:
    Unit:RegisterEvent("Lucius_Phase1", 5000, 0)
    Unit:RemoveEvents()
    Unit:RegisterEvent("Lucius_Phase1", 5000, 2)
    Unit:RegisterEvent("Lucius_Phase2", 5000, 0)
    Unit:RemoveEvents()
    Unit:RegisterEvent("Lucius_Phase2", 5000, 2)
    Last edited by Diemen; 01-07-2010 at 11:41 AM. Reason: Forgot Remove Event.

  15. #30
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Diemen View Post
    So Like this ?

    Code:
    Unit:RegisterEvent("Lucius_Phase1", 5000, 0)
    Unit:RegisterEvent("Lucius_Phase1", 5000, 2)
    Unit:RegisterEvent("Lucius_Phase2", 5000, 0)
    Unit:RegisterEvent("Lucius_Phase2", 5000, 2)
    Code:
    function X_OnCombat(Unit, Event)
    Unit:RegisterEvent("Lucius_Phase1", 5000, 0)
    end
    
    function Lucius_Phase1(Unit, Event)
    if Unit:GetHealthPct() < 90 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("Lucius_Phase1", 5000, 2)
    end
    end
    This will keep checking to see when it has less than 90% hp and then when it does have less than 90% it will cast the spells two times.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. LUA script problem, teleporter.
    By Romis in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 12-02-2008, 04:32 PM
  2. LUA script problem
    By uberhak3r in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 07-09-2008, 06:32 PM
  3. [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
  4. LUA Scripting Problem
    By Knife in forum World of Warcraft Emulator Servers
    Replies: 18
    Last Post: 03-10-2008, 02:00 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 08:11 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search