[Lua]Wtb Proofread menu

User Tag List

Results 1 to 5 of 5
  1. #1
    Synyster's Avatar Member
    Reputation
    4
    Join Date
    Nov 2006
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua]Wtb Proofread

    So my friend has been teaching me LUA for the past 2 days.. and i wanted to give a shot at coding a boss fight. id appreciate some feedback or if there are any errors in it id appreciate the help in finding them :P
    Code:
    ##################
    #Original Script #
    # By Elise:      #
    #                #
    ##################
    
    local npcid =
    --------------------------------------------
    function Npc_OnCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Feel my wrath!")
    pUnit:RegisterEvent("Npc_PhaseOne, 1000, 0")
    end
    RegisterUnitEvent(npcid, 1, "Npc_OnCOmbat")
    
    function Npc_PhaseOne(pUnit, Event)
    if pUnit:GetHealthPct() <= 95 then
    pUnit:RemoveEvents();
    pUnit:RegisterEvent("Npc_Spellone", 10000, 0)
    pUnit:RegisterEvent("Npc_Aoe, 20000, 0)
    pUnit:RegisterEvent("Npc_Aoetwo, 40000, 0)
    pUnit:RegisterEvent("Npc_PhaseTwo, 1000, 0)
    pUnit:RegisterEvent("Npc_Spelltwo", 120000, 0)
    PUnit:RegisterEvent("Npc_Tankstrike", 25000, 0)
    end
    end
    
    function Npc_Spellone(pUnit, Event)
    pUnit:CastSpell(65542, pUnit:Getrandomplayer(4))
    end
    
    function Npc_Aoe(pUnit, Event)
    pUnit:CastSpell(59417)
    end
    
    function Npc_Aoetwo(pUnit, Event)
    pUnit:CastSpell(38226)
    end
    
    function Npc_Spelltwo
    pUnit:CastSpell(66485, pUnit:GetRandomPlayer(7))
    end
    
    --------------------------------------
    
    function Npc_PhaseTwo(pUnit, Event)
    if pUnit:GetHealthPct() <= 50 then
    pUnit:RemoveEvents();
    pUnit:RegisterEvent("Npc_Aoethree, 20000, 0)
    pUnit:RegisterEvent("Npc_Spellthree, 120000, 0)
    pUnit:RegisterEvent("Npc_Fear, 5000, 0)
    pUnit:RegisterEvent("Npc_Aoefour, 10000, 0)
    pUnit:RegisterEvent("Npc_Phasethree, 1000, 0)
    pUnit:RegisterEvent("Npc_Knockback, 30000, 0)
    PUnit:RegisterEvent("Npc_Tankstrike", 25000, 0)
    end
    end
    
    function Npc_Aoethree(pUnit, Event)
    pUnit:CastSpell(59417)
    end
    
    function Npc_Spellthree(pUnit, Event)
    pUnit:CastSpell(66485, pUnit:GetRandomPlayer())
    end
    
    function Npc_Fear(pUnit, Event)
    pUnit:CastSpell(26580, pUnit:GetRandomPlayer())
    end
    
    function Npc_Aoefour(pUnit, Event)
    pUnit:CastSpell(59419, pUnit:GetRandomPlayer(2))
    end
    
    function Npc_Knockback(pUnit, Event)
    pUnit:CastSpell(28405, pUnit:GetRandomPlayer(7))
    end
    
    -------------------------------------------------------
    
    function Npc_Phasethree(pUnit, Event)
    if pUnit:GetHealthPct() <= 25 then
    pUnit:RemoveEvents();
    pUnit:RegisterEvent("Npc_Spellfour, 8000, 0)
    PUnit:RegisterEvent("Npc_Tankstrike", 25000, 0)
    pUnit:RegisterEvent("Npc_Aoefive", 40000, 0)
    pUnit:RegisterEvent("Npc_Spellfive", 10000, 0)
    pUnit:RegisterEvent("Npc_Spellsix", 30000, 0)
    
    function Npc_Spellfour(pUnit, Event)
    pUnit:CastSpell(66485, pUnit:GetMainTank())
    end
    
    function Npc_Aoefive(pUnit, Event)
    pUnit:CastSpell(59417)
    end
    
    function Npc_Spellfive(pUnit, Event)
    pUnit:Castspell(41597)
    
    function Npc_Spellsix(pUnit, Event)
    pUnit:FullCastSpell(33051, pUnit:GetRandomPlayer())
    end
    
    
    
    -----------------------------------------------
    function Npc_OnKilledTarget(pUnit, Event)
    if pUnit:GetHealthPct() <= 5
    pUnit:SendChatMessage(14, 0, "Fools...")
    pUnit:FullCastSpell(64487)
    end
    RegisterUnitEvent(npcid, 3,"Npc_OnKilledTarget")
    
    Function Npc_LeaveCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "You're showing your true colors, cowards.")
    end
    RegisterUnitEvent(npcid, 2,"Npc_LeaveCOmbat")
    
    Function Npc_Tankstrike(pUnit, Event)
    pUnit:CastSpell(43529, pUnit:GetMainTank())
    end
    
    function Npc_OnDeath(pUnit, Event)
    pUnit:CastSpell(29371)
    end
    RegisterUnitEvent(npcid, 4, "Npc_OnDeath")
    And yes I did make this, I am Elise.
    Credit to Phase for Sig xD

    [Lua]Wtb Proofread
  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:
    ##################
    #Original Script #
    # By Elise:      #
    #                #
    ##################
    
    local npcid =        -- you need to write a npcid here
    
    --------------------------------------------
    
    function Npc_OnCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Feel my wrath!")
    pUnit:RegisterEvent("Npc_PhaseOne", 1000, 0)
    end
    
    RegisterUnitEvent(npcid, 1, "Npc_OnCombat")
    
    function Npc_PhaseOne(pUnit, Event)
    if pUnit:GetHealthPct() <= 95 then
    pUnit:RemoveEvents()
    pUnit:RegisterEvent("Npc_Spellone", 10000, 0)
    pUnit:RegisterEvent("Npc_Aoe", 20000, 0)
    pUnit:RegisterEvent("Npc_Aoetwo", 40000, 0)
    pUnit:RegisterEvent("Npc_PhaseTwo", 1000, 0)
    pUnit:RegisterEvent("Npc_Spelltwo", 120000, 0)
    PUnit:RegisterEvent("Npc_Tankstrike", 25000, 0)
    end
    end
    
    function Npc_Spellone(pUnit, Event)
    pUnit:FullCastSpellOnTarget(65542, pUnit:GetRandomPlayer(4))
    end
    
    function Npc_Aoe(pUnit, Event)
    pUnit:CastSpell(59417)
    end
    
    function Npc_Aoetwo(pUnit, Event)
    pUnit:CastSpell(38226)
    end
    
    function Npc_Spelltwo(pUnit, Event)
    pUnit:FullCastSpellOnTarget(66485, pUnit:GetRandomPlayer(7))
    end
    
    --------------------------------------
    
    function Npc_PhaseTwo(pUnit, Event)
    if pUnit:GetHealthPct() <= 50 then
    pUnit:RemoveEvents()
    pUnit:RegisterEvent("Npc_Aoethree", 20000, 0)
    pUnit:RegisterEvent("Npc_Spellthree", 120000, 0)
    pUnit:RegisterEvent("Npc_Fear", 5000, 0)
    pUnit:RegisterEvent("Npc_Aoefour", 10000, 0)
    pUnit:RegisterEvent("Npc_Phasethree", 1000, 0)
    pUnit:RegisterEvent("Npc_Knockback", 30000, 0)
    PUnit:RegisterEvent("Npc_Tankstrike", 25000, 0)
    end
    end
    
    function Npc_Aoethree(pUnit, Event)
    pUnit:CastSpell(59417)
    end
    
    function Npc_Spellthree(pUnit, Event)
    pUnit:FullCastSpellOnTarget(66485, pUnit:GetRandomPlayer(0))
    end
    
    function Npc_Fear(pUnit, Event)
    pUnit:FullCastSpellOnTarget(26580, pUnit:GetRandomPlayer(0))
    end
    
    function Npc_Aoefour(pUnit, Event)
    pUnit:CastSpell(59419)
    end
    
    function Npc_Knockback(pUnit, Event)
    pUnit:FullCastSpellOnTarget(28405, pUnit:GetRandomPlayer(7))
    end
    
    -------------------------------------------------------
    
    function Npc_Phasethree(pUnit, Event)
    if pUnit:GetHealthPct() <= 25 then
    pUnit:RemoveEvents();
    pUnit:RegisterEvent("Npc_Spellfour", 8000, 0)
    PUnit:RegisterEvent("Npc_Tankstrike", 25000, 0)
    pUnit:RegisterEvent("Npc_Aoefive", 40000, 0)
    pUnit:RegisterEvent("Npc_Spellfive", 10000, 0)
    pUnit:RegisterEvent("Npc_Spellsix", 30000, 0)
    
    function Npc_Spellfour(pUnit, Event)
    pUnit:FullCastSpellOnCastSpell(66485, pUnit:GetMainTank())
    end
    
    function Npc_Aoefive(pUnit, Event)
    pUnit:CastSpell(59417)
    end
    
    function Npc_Spellfive(pUnit, Event)
    pUnit:Castspell(41597)
    
    function Npc_Spellsix(pUnit, Event)
    pUnit:FullCastSpellOnTarget(33051, pUnit:GetRandomPlayer(0))
    end
    
    
    
    -----------------------------------------------
    
    function Npc_OnKilledTarget(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Fools...")
    pUnit:FullCastSpell(64487)
    end
    
    RegisterUnitEvent(npcid, 3,"Npc_OnKilledTarget")
    
    Function Npc_LeaveCombat(pUnit, Event)
    pUnit:SendChatMessage(14, 0, "You're showing your true colors, cowards.")
    end
    
    RegisterUnitEvent(npcid, 2,"Npc_LeaveCombat")
    
    Function Npc_Tankstrike(pUnit, Event)
    pUnit:FullCastSpellOnTarget(43529, pUnit:GetMainTank())
    end
    
    function Npc_OnDeath(pUnit, Event)
    pUnit:CastSpell(29371)
    end
    
    RegisterUnitEvent(npcid, 4, "Npc_OnDeath")
    ...i fixxed many errors^^

    Would be good to know if the world.exe show an error.
    Last edited by Kaidos; 08-08-2009 at 06:02 PM.

  3. #3
    Synyster's Avatar Member
    Reputation
    4
    Join Date
    Nov 2006
    Posts
    89
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i didnt think instant casts needed fullcast.. but okay.. and i didnt put a npc id yet because i didnt make an npc for it. but thanks for the rest of it :O
    Credit to Phase for Sig xD

  4. #4
    jay77's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    They don't, but you specified a target after the Cast Spell, if you have a target it needs to be:

    Code:
    pUnit:CastSpellOnTarget(43529, pUnit:GetMainTank())
    or
    pUnit:FullCastSpellOnTarget(43529, pUnit:GetMainTank())
    If you specify a target with just cast spell, but if it's a plain AoE (like concecration) you could have done :

    Code:
    pUnit:CastSpell(spell id)
    For instant spells. =]
    Correct me if I'm wrong though, I'm just getting more advanced with lua.

  5. #5
    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)
    No, you are right jay.

    Code:
     pUnit:CastSpellOnTarget(SpellID, target)
    exists too..it would instant cast the spell on the specific target, but it is currently bugged, so you need to use
    Code:
    pUnit:FullCastSpellOnTarget(SpellID, target)

Similar Threads

  1. [Buying] Wtb private lua unlocker for combat rotations/routines
    By FernzY in forum World of Warcraft Buy Sell Trade
    Replies: 0
    Last Post: 12-05-2016, 01:01 PM
  2. [Question] wtb lua help !
    By maxxis in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-21-2016, 04:08 AM
  3. LF / WTB LUA Disabler for 3.3.5
    By Noaah in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 12-14-2013, 06:16 PM
  4. [WTB/Request] Lua Protection disabler
    By huhutheman in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 05-07-2011, 11:44 AM
  5. LUA Script help (proofread)
    By foamysquirl in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 06-25-2009, 04:53 PM
All times are GMT -5. The time now is 01:35 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