Lua menu

Shout-Out

User Tag List

Thread: Lua

Results 1 to 12 of 12
  1. #1
    Ballwinkle's Avatar Contributor Authenticator enabled
    Reputation
    124
    Join Date
    Mar 2007
    Posts
    662
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lua

    Code:
    function ScarletMansion_Boss1_OnCombat(Unit, event)
        Unit:SendChatMessage(12,0,"You will dead soon enough!")
        Unit:RegisterEvent("ScarletMansion_Boss1_Phase1",10000,0)
    end
    
    
    function ScarletMansion_Boss1_Phase1(pUnit, Event)
     if pUnit:GetHealthPct() < 90 then
      pUnit:RemoveEvents();
      pUnit:CastSpell(3635)
      pUnit:SendChatMessage(12,0,"This world if mine for the taking!!")
      Unit:RegisterEvent("ScarletMansion_Boss1_Phase2",1000,0)
     end
    end
    
    
    function ScarletMansion_Boss1_Phase2(pUnit, Event)
     if pUnit:GetHealthPct() < 70 then
      pUnit:RemoveEvents();
      Unit:RegisterEvent("ScarletMansion_Boss1_Charge",15000,0)
      pUnit:SendChatMessage(12,0,"Hurmm....you are stronger that i thought!!")
      Unit:RegisterEvent("ScarletMansion_Boss1_Phase3",1000,0)
     end
    end
    
    function ScarletMansion_Boss1_Charge(pUnit, event)
        local plr = pUnit:GetRandomPlayer(0)
       if (plr ~= nil) then
        pUnit:CastSpellOnTarget(40602, plr) 
       end
    end
    
    function ScarletMansion_Boss1_Phase3(pUnit, Event)
     if pUnit:GetHealthPct() < 50 then
      pUnit:RemoveEvents();
      pUnit:CastSpell(19703)    
      pUnit:SendChatMessage(12,0,"This is just the begining!!")
      Unit:RegisterEvent("ScarletMansion_Boss1_Phase4",1000,0)
     end
    end
    
    function ScarletMansion_Boss1_Phase3(pUnit, Event)
     if pUnit:GetHealthPct() < 50 then
      pUnit:RemoveEvents();
      pUnit:CastSpell(19703)    
      pUnit:SendChatMessage(12,0,"This is just the begining!!")
      Unit:RegisterEvent("ScarletMansion_Boss1_Phase4",1000,0)
     end
    end
    
    function ScarletMansion_Boss1_Phase4(pUnit, Event)
     if pUnit:GetHealthPct() < 20 then
      pUnit:RemoveEvents();
      pUnit:CastSpell(9163)    
      Unit:SendChatMessage(12,0,"I Will not be defeated!")
     end
    end
    
    
    function ScarletMansion_Boss1_OnDied(Unit)
        Unit:RemoveEvents()    
        Unit:SendChatMessage(12,0,"Death will come for you...")
    end
    
    function ScarletMansion_Boss1_OnKilledTarget(Unit)
        Unit:SendChatMessage(12,0,"To easy!")
    end
    
    function ScarletMansion_Boss1_OnLeaveCombat(Unit)
        Unit:RemoveEvents()
    end
    
    RegisterUnitEvent(302001,1,"ScarletMansion_Boss1_OnCombat")
    RegisterUnitEvent(302001,2,"ScarletMansion_Boss1_OnLeaveCombat")
    RegisterUnitEvent(302001,3,"ScarletMansion_Boss1_OnKilledTarget")
    RegisterUnitEvent(302001,4,"ScarletMansion_Boss1_OnDied")
    I will +Rep x2

    it wonr go from stage 1 -> 2

    ':12: calling 'RegisterEvent' on bad self <Unit expected, got table>'

    Lua
  2. #2
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Umm.. what do you want us to do?

  3. #3
    Ballwinkle's Avatar Contributor Authenticator enabled
    Reputation
    124
    Join Date
    Mar 2007
    Posts
    662
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it wonr go from stage 1 -> 2

    ':12: calling 'RegisterEvent' on bad self <Unit expected, got table>'

  4. #4
    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)
    Will it do phase 1 ?
    Cheese Cake?

  5. #5
    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)
    Also Try Useing pUnit Instead of Unit
    Cheese Cake?

  6. #6
    Ballwinkle's Avatar Contributor Authenticator enabled
    Reputation
    124
    Join Date
    Mar 2007
    Posts
    662
    Thanks G/R
    0/12
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yea

    it errors on line 12

  7. #7
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try this, I changed a few things, I'm still looking for some errors. But try this first:
    Code:
    function ScarletMansion_Boss1_OnCombat(Unit, event)
     pUnit:SendChatMessage(12, 0, "You will dead soon enough!")
     pUnit:RegisterEvent("ScarletMansion_Boss1_Phase1",10000, 0)
    end
    
    
    function ScarletMansion_Boss1_Phase1(pUnit, Event)
     if pUnit:GetHealthPct() < 90 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(3635)
      pUnit:SendChatMessage(12, 0, "This world if mine for the taking!!")
      pUnit:RegisterEvent("ScarletMansion_Boss1_Phase2",1000, 0)
     end
    end
    
    
    function ScarletMansion_Boss1_Phase2(pUnit, Event)
     if pUnit:GetHealthPct() < 70 then
      pUnit:RemoveEvents();
      pUnit:RegisterEvent("ScarletMansion_Boss1_Charge",15000,0)
      pUnit:SendChatMessage(12, 0, "Hurmm....you are stronger that i thought!!")
      pUnit:RegisterEvent("ScarletMansion_Boss1_Phase3",1000, 0)
     end
    end
    
    function ScarletMansion_Boss1_Charge(pUnit, event)
        local plr = pUnit:GetRandomPlayer(0)
       if (plr ~= nil) then
        pUnit:FullCastSpellOnTarget(40602, plr) 
       end
    end
    
    function ScarletMansion_Boss1_Phase3(pUnit, Event)
     if pUnit:GetHealthPct() < 50 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(19703)    
      pUnit:SendChatMessage(12, 0, "This is just the begining!!")
      pUnit:RegisterEvent("ScarletMansion_Boss1_Phase4",1000, 0)
     end
    end
    
    function ScarletMansion_Boss1_Phase3(pUnit, Event)
     if pUnit:GetHealthPct() < 50 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(19703)    
      pUnit:SendChatMessage(12, 0, "This is just the begining!!")
      pUnit:RegisterEvent("ScarletMansion_Boss1_Phase4",1000, 0)
     end
    end
    
    function ScarletMansion_Boss1_Phase4(pUnit, Event)
     if pUnit:GetHealthPct() < 20 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(9163)    
      pUnit:SendChatMessage(12, 0, "I Will not be defeated!")
     end
    end
    
    
    function ScarletMansion_Boss1_OnDied(Unit)
     pUnit:RemoveEvents()    
     pUnit:SendChatMessage(12, 0, "Death will come for you...")
    end
    
    function ScarletMansion_Boss1_OnKilledTarget(Unit)
     pUnit:SendChatMessage(12, 0, "To easy!")
    end
    
    function ScarletMansion_Boss1_OnLeaveCombat(Unit)
     pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(302001, 1, "ScarletMansion_Boss1_OnCombat")
    RegisterUnitEvent(302001, 2, "ScarletMansion_Boss1_OnLeaveCombat")
    RegisterUnitEvent(302001, 3, "ScarletMansion_Boss1_OnKilledTarget")
    RegisterUnitEvent(302001, 4, "ScarletMansion_Boss1_OnDied")
    EDIT: Changed a few more things
    Last edited by Lich King; 04-05-2008 at 11:51 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)
    Gah That makes no sence. Erroring On a Entry Phase >.<

    Id try using pUnit First.
    Cheese Cake?

  9. #9
    Lich King's Avatar Contributor
    Reputation
    100
    Join Date
    May 2007
    Posts
    911
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried mine, and there were no errors loading it. Try it out in-game

  10. #10
    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)
    It seems like a Perfectly fine script.
    Cheese Cake?

  11. #11
    TheSpidey's Avatar Elite User
    Reputation
    365
    Join Date
    Jan 2008
    Posts
    2,200
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You used Unit where pUnit was needed.

  12. #12
    EcHoEs's Avatar lol why u mad
    Reputation
    374
    Join Date
    Sep 2006
    Posts
    1,646
    Thanks G/R
    3/1
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Excactly what Spidey said ^^


Similar Threads

  1. [Guide] Lua Scripting Guide is here [Updating]
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 93
    Last Post: 11-04-2008, 06:56 PM
  2. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
  3. Lua Ascent Script Documentation
    By latruwski in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 11-26-2007, 12:42 PM
  4. LUA Refrences
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 11-22-2007, 08:09 PM
All times are GMT -5. The time now is 10:50 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