[Quick +Rep]  LUA Question menu

User Tag List

Results 1 to 7 of 7
  1. #1
    Strupantwn's Avatar Contributor
    Reputation
    115
    Join Date
    Apr 2007
    Posts
    1,045
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Quick +Rep] LUA Question

    My boss won't cast non of these spells I made in LUA

    Code:
    function Boss_ChaosBlast(pUnit)
    Punit:CastSpell(37675)
    Punit:SendChatMessage(12, 0, "Feel the Chaos!")
    end
    
    function Boss_ShadowBurst(pUnit)
    Punit:CastSpell(34436)
    Punit:SendChatMessage(12, 0, "Hmm, I can feel the power!")
    end
    
    function Boss_Flamebreak(pUnit)
    Punit:CastSpell(16785)
    Punit:SendChatMessage(12, 0, "Don't run away from me!")
    end
    
    function Boss_DarkBarrage(pUnit)
    local plr = unit:GetMainTank()
    if (plr ~= nil) then
    Punit:CastSpellOnTarget(40585, plr)
    end
    end
    
    function Boss_VileBeam(pUnit)
    local plr = unit:GetMainTank()
    if (plr ~= nil) then
    Punit:FullCastSpellOnTarget(40860, plr)
    end
    end
    
    function Boss_OnEnterCombat(pUnit)
    Punit:SendChatMessage(12, 0, "I am Legend's Top Offcier, you think you will have a chance?")
    Punit:RegisterEvent("Boss_ChaosBlast",20000, 0)
    Punit:RegisterEvent("Boss_SunderArmor",20000, 0)
    Punit:RegisterEvent("Boss_ShadowBurst",10000, 0)
    Punit:RegisterEvent("Boss_Flamebreak",15000, 0)
    Punit:RegisterEvent("Boss_DarkBarrage",15000, 0)
    end
    
    
    function Boss_OnLeaveCombat(pUnit)
    Punit:RemoveEvents()
    end
    
    function Boss_KilledTarget(pUnit)
    Punit:SendChatMessage(12, 0, "Hahaha, fools, Engar loses to no one!")
    Punit:RemoveEvents()
    end
    
    function Boss_OnDied(pUnit)
    Punit:SendChatMessage(12, 0, "Legend . . . will . . . not be . . . defeated . . .")
    Punit:RemoveEvents()
    end
    
    
    
    RegisterUnitEvent(444004, 1, "Boss_OnEnterCombat")
    RegisterUnitEvent(444004, 2, "Boss_OnLeaveCombat")
    RegisterUnitEvent(444004, 3, "Boss_OnKilledTarget")
    RegisterUnitEvent(444004, 4, "Boss_onDied")

    [Quick +Rep]  LUA Question
  2. #2
    Hellgawd's Avatar Member
    Reputation
    710
    Join Date
    Jun 2007
    Posts
    2,480
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try:
    Code:
    pUnit   instead of Punit
    OR
    Unit    instead of pUnit
    Not sure if it will work, but worth a shot.

  3. #3
    Juicyz's Avatar Active Member
    Reputation
    34
    Join Date
    Dec 2006
    Posts
    298
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah hes right, since you put (pUnit), you have to use pUnit everywhere

    DA Gift From Mr. Blain

  4. #4
    Power of Illuminati's Avatar Contributor
    Reputation
    179
    Join Date
    May 2008
    Posts
    1,410
    Thanks G/R
    6/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this

    Code:
    function Boss_ChaosBlast(pUnit, Event)
    pUnit:CastSpell(37675)
    pUnit:SendChatMessage(12, 0, "Feel the Chaos!")
    end
    
    function Boss_ShadowBurst(pUnit, Event)
    pUnit:CastSpell(34436)
    pUnit:SendChatMessage(12, 0, "Hmm, I can feel the power!")
    end
    
    function Boss_Flamebreak(pUnit, Event)
    pUnit:CastSpell(16785)
    pUnit:SendChatMessage(12, 0, "Don't run away from me!")
    end
    
    function Boss_DarkBarrage(pUnit, Event)
    local plr = pUnit:GetMainTank()
    if (plr ~= nil) then
    pUnit:CastSpellOnTarget(40585, plr)
    end
    end
    
    function Boss_VileBeam(pUnit, Event)
    local plr = pUnit:GetMainTank()
    if (plr ~= nil) then
    pUnit:FullCastSpellOnTarget(40860, plr)
    end
    end
    
    function Boss_OnEnterCombat(pUnit, Event)
    pUnit:SendChatMessage(12, 0, "I am Legend's Top Offcier, you think you will have a chance?")
    pUnit:RegisterEvent("Boss_ChaosBlast",20000, 0)
    pUnit:RegisterEvent("Boss_SunderArmor",20000, 0)
    pUnit:RegisterEvent("Boss_ShadowBurst",10000, 0)
    pUnit:RegisterEvent("Boss_Flamebreak",15000, 0)
    pUnit:RegisterEvent("Boss_DarkBarrage",15000, 0)
    end
    
    
    function Boss_OnLeaveCombat(pUnit, Event)
    pUnit:RemoveEvents()
    end
    
    function Boss_KilledTarget(pUnit, Event)
    pUnit:SendChatMessage(12, 0, "Hahaha, fools, Engar loses to no one!")
    pUnit:RemoveEvents()
    end
    
    function Boss_OnDied(pUnit, Event)
    pUnit:SendChatMessage(12, 0, "Legend . . . will . . . not be . . . defeated . . .")
    pUnit:RemoveEvents()
    end
    
    
    
    RegisterUnitEvent(444004, 1, "Boss_OnEnterCombat")
    RegisterUnitEvent(444004, 2, "Boss_OnLeaveCombat")
    RegisterUnitEvent(444004, 3, "Boss_OnKilledTarget")
    RegisterUnitEvent(444004, 4, "Boss_onDied")
    Added the Event in all functions, and edited all to pUnit, I think that should be enough


    Last edited by Power of Illuminati; 06-15-2008 at 05:10 PM.

  5. #5
    Strupantwn's Avatar Contributor
    Reputation
    115
    Join Date
    Apr 2007
    Posts
    1,045
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Power of Illuminati View Post
    Try this

    Code:
    function Boss_ChaosBlast(pUnit, Event)
    pUnit:CastSpell(37675)
    pUnit:SendChatMessage(12, 0, "Feel the Chaos!")
    end
    
    function Boss_ShadowBurst(pUnit, Event)
    pUnit:CastSpell(34436)
    pUnit:SendChatMessage(12, 0, "Hmm, I can feel the power!")
    end
    
    function Boss_Flamebreak(pUnit, Event)
    pUnit:CastSpell(16785)
    pUnit:SendChatMessage(12, 0, "Don't run away from me!")
    end
    
    function Boss_DarkBarrage(pUnit, Event)
    local plr = pUnit:GetMainTank()
    if (plr ~= nil) then
    pUnit:CastSpellOnTarget(40585, plr)
    end
    end
    
    function Boss_VileBeam(pUnit, Event)
    local plr = pUnit:GetMainTank()
    if (plr ~= nil) then
    pUnit:FullCastSpellOnTarget(40860, plr)
    end
    end
    
    function Boss_OnEnterCombat(pUnit, Event)
    pUnit:SendChatMessage(12, 0, "I am Legend's Top Offcier, you think you will have a chance?")
    pUnit:RegisterEvent("Boss_ChaosBlast",20000, 0)
    pUnit:RegisterEvent("Boss_SunderArmor",20000, 0)
    pUnit:RegisterEvent("Boss_ShadowBurst",10000, 0)
    pUnit:RegisterEvent("Boss_Flamebreak",15000, 0)
    pUnit:RegisterEvent("Boss_DarkBarrage",15000, 0)
    end
    
    
    function Boss_OnLeaveCombat(pUnit, Event)
    pUnit:RemoveEvents()
    end
    
    function Boss_KilledTarget(pUnit, Event)
    pUnit:SendChatMessage(12, 0, "Hahaha, fools, Engar loses to no one!")
    pUnit:RemoveEvents()
    end
    
    function Boss_OnDied(pUnit, Event)
    pUnit:SendChatMessage(12, 0, "Legend . . . will . . . not be . . . defeated . . .")
    pUnit:RemoveEvents()
    end
    
    
    
    RegisterUnitEvent(444004, 1, "Boss_OnEnterCombat")
    RegisterUnitEvent(444004, 2, "Boss_OnLeaveCombat")
    RegisterUnitEvent(444004, 3, "Boss_OnKilledTarget")
    RegisterUnitEvent(444004, 4, "Boss_onDied")
    Added the Event in all functions, and edited all to pUnit, I think that should be enough


    hey man, thanks again, btw, he casts shadow barrier or something and chaos blast on himself, can you help me check the lua again?

  6. #6
    Whitethebunny's Avatar Member
    Reputation
    2
    Join Date
    Apr 2008
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To fix it so he doesn't cast those spells on himself just change the "pUnit:CastSpell(#)" to "pUnit:FullCastSpellOnTarget(#, target)" for those spell functions.

  7. #7
    Strupantwn's Avatar Contributor
    Reputation
    115
    Join Date
    Apr 2007
    Posts
    1,045
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about for this?

    function Boss_DarkBarrage(pUnit, Event)
    local plr = pUnit:GetMainTank()
    if (plr ~= nil) then
    pUnit:CastSpellOnTarget(40585, plr)
    end
    end

Similar Threads

  1. [Lua Script] Quick and simple Lua question
    By tyeeeee1 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 09-10-2010, 05:35 PM
  2. [Quick +Rep] LUA Question
    By Strupantwn in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 06-03-2008, 02:38 PM
  3. Netherwing Egg Hunting For Quick Rep
    By Therioni in forum World of Warcraft Guides
    Replies: 6
    Last Post: 12-12-2007, 07:48 PM
  4. [Question] Quick spell model question
    By Naralesca in forum WoW ME Questions and Requests
    Replies: 5
    Last Post: 10-02-2007, 11:21 AM
  5. quick mac script question
    By lars1414 in forum World of Warcraft General
    Replies: 0
    Last Post: 12-28-2006, 02:37 PM
All times are GMT -5. The time now is 05:59 PM. 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