[Help] Lua, How to...? menu

User Tag List

Results 1 to 15 of 15
  1. #1
    Lilltimmy's Avatar Member
    Reputation
    20
    Join Date
    Jun 2007
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Help] Lua, How to...?

    I've tried many Lua Boss Scripts i know how to make them, But not as i want them:

    I Can make it do things on % Hp.

    But i dont know how to do a Boss use spells like every xx second and cast spells all the time in the fight.

    Anyone can help me? i'll give you a +Rep

    Anyone can show me how to do it without If Get HealthPct thing
    Last edited by Lilltimmy; 04-18-2008 at 05:08 AM.

    [Help] Lua, How to...?
  2. #2
    b!atch's Avatar Member
    Reputation
    118
    Join Date
    Oct 2007
    Posts
    726
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Npcname_Spellname(Unit, event, miscunit, misc)
        print "Npcname Spellname"
        Unit:CastSpellOnTarget(Spellid,Unit:GetMainTank())
    end
    
    function Npcname(unit, event, miscunit, misc)
        print "Npcname"
        unit:RegisterEvent("Npcname_Spellname",WhenItShouldBeDone,0)
    end
    
    RegisterUnitEvent(Npc ID,1,"Npcname")
    WhenItShouldBeDone is miliseconds.. example if you write 30000 it will be done every 30 sec and start after 30 sec, ofc

    Any questions? Ask me

    You can make more phases etc

    And the GetMainTank is the target.. MainTank means "cast this at most hated player" AddTank means "second most hated" hate=threat.. You can use stuff like RandomPlayer and ClosestPlayer too. Also GetFriend for picking a friendly npc..
    Last edited by b!atch; 04-18-2008 at 05:56 AM.
    Spectrum-X is win! Rep People That Help You and Candybones Wont Eat Your Brain:>

  3. #3
    b!atch's Avatar Member
    Reputation
    118
    Join Date
    Oct 2007
    Posts
    726
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is for example one of my scripts, That i use for a shadowy dragon

    Code:
    function Shadownpc_Voidbolt(Unit, event, miscunit, misc)
        print "Shadownpc Voidbolt"
        Unit:FullCastSpellOnTarget(39252,Unit:GetMainTank())
    end
    
    function Shadownpc_Berserkerstance(Unit, event, miscunit, misc)
        print "Shadownpc Berserkerstance"
        Unit:FullCastSpell(7366)
    end
    
    function Shadownpc_Fear(Unit, event, miscunit, misc)
        print "Shadownpc Fear"
        Unit:FullCastSpellOnTarget(13704,Unit:GetMainTank())
    end
    
    function Shadownpc_Shadowboltvalley(Unit, event, miscunit, misc)
        print "Shadownpc Shadowboltvalley"
        Unit:FullCastSpell(32963)
    end
    
    function Shadownpc_Empoweringshadow(Unit, event, miscunit, misc)
        print "Shadownpc Empoweringshadow"
        Unit:FullCastSpell(39364)
    end
    
    function Shadownpc_Shadownovatwo(Unit, event, miscunit, misc)
        print "Shadownpc Shadownovatwo"
        Unit:FullCastSpell(33846)
    end
    
    function Shadownpc_Shadownova(Unit, event, miscunit, misc)
        print "Shadownpc Shadownova"
        Unit:FullCastSpell(30852)
    end
    
    function Shadownpc_leavecombat(Unit, event, miscunit, misc)
    unit:RemoveEvents();
    end
    
    function Shadownpc_killtarget(Unit, event, miscunit, misc)
    unit:RemoveEvents();
    end
    
    function Shadownpc(unit, event, miscunit, misc)
        print "Shadownpc"
        unit:RegisterEvent("Shadownpc_Voidbolt",15000,0)
        unit:RegisterEvent("Shadownpc_Shadowboltvalley",30000,0)
        unit:RegisterEvent("Shadownpc_Berserkerstance",50000,0)
        unit:RegisterEvent("Shadownpc_Fear",51000,0)
        unit:RegisterEvent("Shadownpc_Empoweringshadow",60000,0)
        unit:RegisterEvent("Shadownpc_Shadownovatwo",17000,0)
        unit:RegisterEvent("Shadownpc_Shadownova",40000,0)
    end
    
    RegisterUnitEvent(1508422, 3, "Shadownpc_killtarget")
    RegisterUnitEvent(1508422, 2, "Shadownpc_leavecombat")
    RegisterUnitEvent(1508422, 1,"Shadownpc")
    Spectrum-X is win! Rep People That Help You and Candybones Wont Eat Your Brain:>

  4. #4
    Lilltimmy's Avatar Member
    Reputation
    20
    Join Date
    Jun 2007
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm... Ima take a look at it, I'll Rep soon.

  5. #5
    b!atch's Avatar Member
    Reputation
    118
    Join Date
    Oct 2007
    Posts
    726
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hehe thx
    Spectrum-X is win! Rep People That Help You and Candybones Wont Eat Your Brain:>

  6. #6
    Lilltimmy's Avatar Member
    Reputation
    20
    Join Date
    Jun 2007
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can i make him spawn a Creature only one time? or make him respawn / despawn it and spawn a new one?

    Edit: Can't +Rep need to Spread : /

  7. #7
    Lilltimmy's Avatar Member
    Reputation
    20
    Join Date
    Jun 2007
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He uses all the Spells on himself (exept 2) Even if i have "GetMainTank())"

    Use This if Casts On Self! :-

    function Name_Event(pUnit, Event)
    local plr = pUnit:GetRandomPlayer(0) <-- Or something else
    if (plr ~= nil) then
    pUnit:FullCastSpellOnTarget(SpellID, player)
    end
    end
    Would that work in a "Unit" Script? Tell me how then
    Last edited by Lilltimmy; 04-18-2008 at 11:40 AM.

  8. #8
    Snailz's Avatar Contributor Authenticator enabled
    Reputation
    239
    Join Date
    Nov 2007
    Posts
    941
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol thx for using my post =O xD

    Yea it should
    Cheese Cake?

  9. #9
    Snailz's Avatar Contributor Authenticator enabled
    Reputation
    239
    Join Date
    Nov 2007
    Posts
    941
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use It As a Function Then Register it.
    Cheese Cake?

  10. #10
    Lilltimmy's Avatar Member
    Reputation
    20
    Join Date
    Jun 2007
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll Try :P

  11. #11
    Lilltimmy's Avatar Member
    Reputation
    20
    Join Date
    Jun 2007
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Didnt work... Aww

  12. #12
    b!atch's Avatar Member
    Reputation
    118
    Join Date
    Oct 2007
    Posts
    726
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mob spawning is simple just put this in your script as if it were a spell

    Unit:SpawnCreature(npc id, x, y, z, orientation, faction, duration); duration is miliseconds btw
    Spectrum-X is win! Rep People That Help You and Candybones Wont Eat Your Brain:>

  13. #13
    CairiFEA's Avatar Member
    Reputation
    36
    Join Date
    Jan 2008
    Posts
    194
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To have a mob cast a spell on him self


    function selfcast(Unit, Event)
    Unit:CastSpell(ID)
    end



    To have him cast ON A PLAYER
    function playercast(Unit, Event)
    Unit:FullCastSpellOnTarget(ID, Unit:GetClosestPlayer())
    end


    Cairi,
    Cairi
    As a Nation, we have AGREED to A GREED
    gmtricks.com

  14. #14
    Snailz's Avatar Contributor Authenticator enabled
    Reputation
    239
    Join Date
    Nov 2007
    Posts
    941
    Thanks G/R
    2/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And Also If You want to know what number to put in

    - GetRandomPlayer(0) this is a Random Player
    - GetRandomPlayer(1) this is a Random guy in Short-Range
    - GetRandomPlayer(2) this is aRandom guy in Mid-Range
    - GetRandomPlayer(3) this is a Random guy in Long-Range
    - GetRandomPlayer(4) = Random guy with Mana
    - GetRandomPlayer(5) = Random guy with Rage
    - GetRandomPlayer(6) = Random guy With Energy
    - GetRandomPlayer(7) = Random guy WILL NOT BE Main-Tank

    P.s ill try it
    Cheese Cake?

  15. #15
    Lilltimmy's Avatar Member
    Reputation
    20
    Join Date
    Jun 2007
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm...Wtf are you talking about? I know how to make a Script, I know how to spawn a Mob, I Know how to make him cast spells on himself, I Dont want him to cast spells on him self thats it. He casts all the spells on himself when i created a Normal Script.

    Learn to Read O______________________________o

Similar Threads

  1. help .lua portal
    By Tom_2001 in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 01-26-2008, 11:14 AM
  2. help .lua portal help
    By Tom_2001 in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 01-24-2008, 03:21 PM
  3. [HELP] Lua DLL Error
    By Rouslan in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-12-2008, 02:02 PM
  4. Help needed - how to insert .sql files with SQLyog
    By ADAMZY in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 11-23-2007, 05:32 PM
  5. Everything you ever need [Commands Help Instructions How to add stuff etc] [Updates]
    By Dryice in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-12-2007, 02:35 PM
All times are GMT -5. The time now is 10:50 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