LUA Script Question menu

User Tag List

Results 1 to 1 of 1
  1. #1
    abndrew82's Avatar Active Member
    Reputation
    17
    Join Date
    Jan 2008
    Posts
    162
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LUA Script Question

    I have been reading over some Tutorial on LUA scripting, and think I am learning but for some reason something i had working before I must be doing something wrong with

    I have this script

    Code:
    function phase_1(pUnit, Event)
     if pUnit:GetHealthPct() < 90 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(16033)
      pUnit:SendChatMessage(11, 0, "Test Oh Shit I am at 90%")
      pUnit:RegisterEvent("phase_2",1000, 0)
     end
    end
     
    function phase_2(pUnit, Event)
     if pUnit:GetHealthPct() < 60 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(33452)
      pUnit:RegisterEvent("phase_3",1000, 0)
     end
    end
     
    function phase_3(pUnit, Event)
     if pUnit:GetHealthPct() < 60 then
      pUnit:RemoveEvents();
      pUnit:FullCastSpell(34807)
     end
    end
    
    function Boss_OnCombat(Unit, event)
    Unit:RegisterEvent("phase_1",1000, 0)
    end
    RegisterUnitEvent(65008, 1, "Boss_OnCombat")
    As just a test and the mob seems to cast the spells but isnt saying anything

    My other one I am working on that I really want to work is this

    Code:
    function phase_1(pUnit, Event)
     if pUnit:GetHealthPct() < 90 then
      pUnit:RemoveEvents();
      pUnit:SendChatMessage (11, 0, "The Fight has Just Begun!!!"
      pUnit:FullCastSpellOnTarget(38739)
      pUnit:RegisterEvent("phase_2",1000, 0)
     end
    end
    
    function phase_2(pUnit, Event)
     if pUnit:GetHealthPct() < 70 then
      pUnit:RemoveEvents();
      pUnit:SendChatMessage (11, 0, "Battle My Minions!!!"
      pUnit:SpawnCreature(65006, -4849, -883, 822, 0.8, 14, 360000)
      pUnit:FullCastSpellOnTarget(30217)
      pUnit:SpawnCreature(65005, -4831, -883, 825, 2.2, 14, 360000)
      pUnit:RegisterEvent("phase_3",1000, 0)
     end
    end
    
    function phase_3(pUnit, Event)
     if pUnit:GetHealthPct() < 60 then
    	pUnit RemoveEvents();
    	pUnit:SpawnCreature(65007, -4849, -883, 822, 0.8, 14, 360000)
    	pUnit:SpawnCreature(65007, -4831, -883, 825, 2.2, 14, 360000)
    	pUnit:FullCastSpellOnTarget(34697)
    	pUnit:SpawnCreature(65007, -4824, -875, 822, 2.8, 14, 360000)
    	pUnit:RegisterEvent("phase_4",1000, 0)
     end
    end
    
    function phase_4(pUnit, Event)
     if pUnit:GetHealthPct() < 50 then
    	pUnit:RemoveEvents();
    	pUnit:SpawnCreature(65007, -4824, -875, 822, 2.8, 14, 360000)
    	pUnit:FullCastSpellOnTarget(12738)
    	pUnit:SpawnCreature(65007, -4831, -883, 825, 2.2, 14, 360000))
    	pUnit:RegisterEvent("phase_5",1000, 0)
     end
    end
    
    function phase_5(pUnit, Event)
     if pUnit:GetHealthPct() < 25 then
    	pUnit:RemoveEvents();
    	pUnit:FullCastSpellOnTarget(34036)
     end
    end
    
    function Boss_OnCombat(pUnit, event)
    	pUnit:RegisterEvent("phase_1",1000, 0)
    end
    RegisterUnitEvent(ENTRY ID, 1, "Boss_OnCombat")

    LUA Script Question

Similar Threads

  1. [Lua] Newbie Lua scripting question (SOLVED)
    By Maybepie in forum WoW EMU Questions & Requests
    Replies: 10
    Last Post: 04-16-2010, 07:21 AM
  2. lua scripting question
    By deep6ixed in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 08-08-2009, 06:31 AM
  3. Lua Scripting question.
    By gregzoid2 in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 07-06-2008, 02:45 PM
  4. LUA Script question.. [AI_Tick?]
    By Lakotaness in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 06-14-2008, 06:54 AM
  5. LUA script question
    By Zordin in forum World of Warcraft Emulator Servers
    Replies: 4
    Last Post: 06-08-2008, 06:24 AM
All times are GMT -5. The time now is 06:22 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