Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 5 of 5
  1. #1
    Beginner

    Join Date
    Feb 2009
    Posts
    4
    Post Thanks / Like
    Rep Power
    16
    Reputation
    1

    question about lua script


    Register to remove this ad
    hi this is my first thread i have a simple question for u guys...

    i saw this code for example:
    (its not my code it just for example..)
    Code:
    function Leviathan_Morph1(pUnit,Event)
     if pUnit:GetHealthPct() <= 75 then
        print "Group through stage 1"
        pUnit:RemoveEvents()
        pUnit:SetModel(18945)
        pUnit:SendChatMessage(12, 0, "You think you are a match for me? Pfft, what about if I do.... THIS?")
        pUnit:SetScale(0.3)
        pUnit:CastSpell(25431)
        pUnit:RegisterEvent("Leviathan_Talk", 15000, 0)
        pUnit:RegisterEvent("Leviathan_SpellFirecone", 18000, 0)
        pUnit:RegisterEvent("Leviathan_SpellFireball", 15000, 0)
        pUnit:RegisterEvent("Leviathan_SpellFireRain", 8000, 0)
        pUnit:RegisterEvent("Leviathan_SpellSteal", 20000, 0)
        pUnit:RegisterEvent("Leviathan_Morph2", 1000, 0)  
    end
    end
    --Morph two, Ahune The Frost Lord display ID, IceFrostPhase enabled, 50 to 25 percent--
    function Leviathan_Morph2(pUnit,Event)
     if pUnit:GetHealthPct() <= 50 then
        print "Group through stage 2"
        pUnit:RemoveEvents()
        pUnit:SetModel(23344)
        pUnit:SendChatMessage(12, 0, "Hah, you think that you may triumph over me, but you are only halfway through this igneous shell of steel!")
        pUnit:SetScale(0.3)
        pUnit:CastSpell(7301)
        pUnit:RegisterEvent("Leviathan_Talk", 15000, 0)
        pUnit:RegisterEvent("Leviathan_SpellFrostbolt", 11000, 0)
        pUnit:RegisterEvent("Leviathan_SpellBreath", 20000, 0)
        pUnit:RegisterEvent("Leviathan_SpellClaw", 8000, 0)
        pUnit:RegisterEvent("Leviathan_SpellCone", 15000, 0)
        pUnit:RegisterEvent("Leviathan_SpellPlague", 17000, 0)
        pUnit:RegisterEvent("Leviathan_Morph3", 1000, 0)
    and i have a little question about the "pUnit:GetHealthPct() " command:
    at the end of morph1 it "throws" to morph2 which first thing checks for bosses hp...

    1. what will happen if boss hp is still over 50% while morph2 is triggered?
    it will melee endless? or loop itself and cast again the same spells?

    2. is triggering the function as: function Leviathan_Morph2(pUnit,Event)
    will "inject" the function to the memory and once the boss hp will go under 50% it will auto trigger the rest of the function? or i need to re-trigger it again somehow in a period of time?
    :0

    im sorry i know its noobish q, but i just have to know lol
    thank in advance to all helpers..




    › See More: question about lua script



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Beginner

    Join Date
    Feb 2009
    Posts
    4
    Post Thanks / Like
    Rep Power
    16
    Reputation
    1
    any1?

  4. #3
    Contributor
    runiker's Avatar
    Join Date
    Jul 2008
    Posts
    170
    Post Thanks / Like
    Rep Power
    18
    Reputation
    113
    As a general rule for all scripts most languages will keep looping the same script untill a it is told to stop or change. this part of the code
    Code:
        pUnit:RemoveEvents()
    found at the first thing once it sees the units health has hit below 50% this will remove all actions before it and run only the 50% ones.So i think the short answer is this the script reads all lines of code in order so imputing it once would only work. So far this script should work if it had a baseline trigger. Hope this helps.

  5. #4
    Beginner

    Join Date
    Feb 2009
    Posts
    4
    Post Thanks / Like
    Rep Power
    16
    Reputation
    1
    thank you! it do helps

  6. #5
    Beginner

    Join Date
    Feb 2009
    Posts
    4
    Post Thanks / Like
    Rep Power
    16
    Reputation
    1

    Register to remove this ad
    so.... basiclly ur saying that:
    morph1 will cast all the spells as it should be.
    then it will check the unit's hp
    if its not reached the 50% as it should....morph1 will run again?
    and once the unit hp will go 50% it will proc morph2 function automaticlly?

 

 

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!
SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 02:21 AM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org