More LUA Problems xD menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    More LUA Problems xD

    Two Issues Here,

    The Game Object isnt spawning i know why, i get this error not sure how to fix



    Second when clicking the portal its not teleporting me, just my char starts casting World of Recall (OLD)

    Here is the script

    Code:
    --Register Events--
    RegisterUnitEvent(70027, 1, "Grull_OnCombat")
    RegisterUnitEvent(70027, 2, "Grull_OnLeaveCombat")
    RegisterUnitEvent(70027, 3, "Grull_OnKillTarget")
    RegisterUnitEvent(70027, 4, "Grull_OnDeath")
    RegisterGameObjectEvent(55185,2,"CustomPortal")
    
    --Main Boss--
    function Grull_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "You Want to Die? As You Wish. . . ")
    Unit:RegisterEvent("Grull_one", 100, 0)
    end
    
    function Grull_OnKillTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "Pityful Beings, Yet Another of your Team is Laid to Rest")
    end
    
    function Grull_OnDeath(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "No! I... can't... die... I am... the Dragonslayer...")
    Unit:SpawnGameObject(55185,Unit:GetX(),Unit:GetY(),Unit:GetZ(),60000)
    end
    
    function Grull_one(Unit, Event)
    local p
    p=math.random(1, 2)
    if Choice==1 then
    Unit:CastSpell(6432)
    end
    end
    
    
    --Portal--
    function CustomPortal(pUnit, Event, pMisc)
    pUnit:Teleport(1,-10551.9, 2194.788, -20)
    pMisc:Teleport(1,-10551.9, 2194.788, -20)
    end
    
    
    
    --MiniBoss--

    More LUA Problems xD
  2. #2
    y2kss66's Avatar Member
    Reputation
    104
    Join Date
    Jan 2008
    Posts
    778
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:

    Code:
    --Register Events--
    RegisterUnitEvent(70027, 1, "Grull_OnCombat")
    RegisterUnitEvent(70027, 2, "Grull_OnLeaveCombat")
    RegisterUnitEvent(70027, 3, "Grull_OnKillTarget")
    RegisterUnitEvent(70027, 4, "Grull_OnDeath")
    RegisterGameObjectEvent(55185,2,"CustomPortal")
    
    --Main Boss--
    function Grull_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "You Want to Die? As You Wish. . . ")
    Unit:RegisterEvent("Grull_one", 100, 0)
    end
    
    function Grull_OnKillTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "Pityful Beings, Yet Another of your Team is Laid to Rest")
    end
    
    function Grull_OnDeath(Unit, Event)
    Unit:RemoveEvents()
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SendChatMessage(14, 0, "No! I... can't... die... I am... the Dragonslayer...")
    Unit:SpawnGameObject(55185, x, y, z, o, 60000)
    end
    
    function Grull_one(Unit, Event)
    local p
    p=math.random(1, 2)
    if Choice==1 then
    Unit:CastSpell(6432)
    end
    end
    
    
    --Portal--
    function CustomPortal(Unit, Event, pMisc)
    pMisc:Teleport(1,-10551.9, 2194.788, -20)
    RegisterGameObjectEvent(55185, 2, "CustomPortal")
    end
    
    
    --MiniBoss--
    Last edited by y2kss66; 06-22-2009 at 07:31 AM.

  3. #3
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Spawn works, portal still showing word of recall though

    Edit: New problem, With a different boss

    Full Code:

    Code:
    RegisterUnitEvent(70027, 1, "Grull_OnCombat")
    RegisterUnitEvent(70027, 2, "Grull_OnLeaveCombat")
    RegisterUnitEvent(70027, 3, "Grull_OnKillTarget")
    RegisterUnitEvent(70027, 4, "Grull_OnDeath")
    RegisterUnitEvent(70026, 1, "Mini_OnCombat")
    RegisterUnitEvent(70026, 2, "Mini_OnLeaveCombat")
    RegisterUnitEvent(70026, 3, "Mini_OnKillTarget")
    RegisterUnitEvent(70026, 4, "Mini_OnDeath")
    RegisterUnitEvent(70022, 18, "Ad_OnSpawn")
    RegisterGameObjectEvent(999012,2,"CustomMallPortal")
    
    --Declare Variables--
    local ad = 70
    local g
    
    
    --Grull Functions
    
    function Grull_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "You Want to Die? As You Wish. . . ")
    Unit:RegisterEvent("Grull_one", 100, 0)
    end
    
    function Grull_OnKillTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "Pityful Beings, Yet Another of your Team is Laid to Rest")
    end
    
    function Grull_OnDeath(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "No! I... can't... die... I am... the Dragonslayer...")
    Unit:SendChatMessage(16, 0, "Shade of Grull's Body Shrinks as His Power is Drained by a Mysterious Portal")
    Unit:SetScale(0.2)
    Unit:SpawnGameObject(999012,Unit:GetX(),Unit:GetY(),Unit:GetZ(),6,60000)
    end
    
    function Grull_one(Unit, Event)
    local p
    p=math.random(1, 2)
    if Choice==1 then
    Unit:CastSpell(6432)
    end
    end
    
    
    --Portal--
    function CustomMallPortal(pUnit, Event, pMisc)
    pUnit:Teleport(1,-10551.9,2194.788,-20)
    pMisc:Teleport(1,-10551.9,2194.788,-20)
    end
    
    
    
    --MiniBoss--
    function Mini_OnCombat(Unit, Event)
    g=Unit
    Unit:SendChatMessage(14, 0, "Open the dances!")
    Unit:RegisterEvent("Mini_one", 100, 0)
    end
    
    function Mini_OnKillTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "One Dancer Down")
    end
    
    function Mini_OnDeath(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "You.. danced better... than me...")
    end
    
    function Mini_one(Unit, Event)
    if Unit:GetHealthPct() <= 80 then
    Unit:RemoveEvents()
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SpawnCreature (70022, x+3, y+3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x+3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y+3, z, o, 14 ,60000);
    Unit:RegisterEvent("Mini_two", 100, 0)
    end
    end
    
    function Mini_two(Unit, Event)
    if Unit:GetHealthPct() <= 60 then
    Unit:RemoveEvents()
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SpawnCreature (70022, x+3, y+3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x+3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y+3, z, o, 14 ,60000);
    Unit:RegisterEvent("Mini_thr", 100, 0)
    end
    end
    
    function Mini_thr(Unit, Event)
    if Unit:GetHealthPct() <= 40 then
    Unit:RemoveEvents()
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SpawnCreature (70022, x+3, y+3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x+3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y+3, z, o, 14 ,60000);
    Unit:RegisterEvent("Mini_fou", 100, 0)
    end
    end
    
    function Mini_fou(Unit, Event)
    if Unit:GetHealthPct() <= 20 then
    Unit:RemoveEvents()
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SpawnCreature (70022, x+3, y+3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x+3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y+3, z, o, 14 ,60000);
    end
    end
    
    --MiniBoss Ads
    
    function Ad_OnSpawn(Unit, Event)
    Unit:RegisterEvent("ADCHECK", 100, 0)
    end
    
    function ADCHECK(Unit, Event)
    if g:GetHealthPct() <= ad then
    Unit:Despawn(100, 0)
    ad = ad - 20
    end
    end
    The Ad's arnt Despawning at 70,50,30,10 as they should

    Both the MiniBoss and the Main Boss say the Enter Combat Line Twice
    Last edited by controlsx2; 06-22-2009 at 08:05 AM.

  4. #4
    brue's Avatar Member
    Reputation
    1
    Join Date
    Jul 2008
    Posts
    33
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I got the fix for your portal
    Code:
    function TELE_onUse (pUnit, Event, pMisc)
    pMisc:Teleport (1,-10551.9, 2194.788, -20)
    end
    
    RegisterGameObjectEvent (55185 ,4, "TELE_onUse")

    Try that :P

  5. #5
    Vision1000's Avatar Member
    Reputation
    104
    Join Date
    Jun 2008
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by controlsx2 View Post
    Spawn works, portal still showing word of recall though
    Change the 'Type' in gameobject names from spell focus(22) to button(1).

    Edit: New problem, With a different boss

    Full Code:

    Code:
    RegisterUnitEvent(70027, 1, "Grull_OnCombat")
    RegisterUnitEvent(70027, 2, "Grull_OnLeaveCombat")
    RegisterUnitEvent(70027, 3, "Grull_OnKillTarget")
    RegisterUnitEvent(70027, 4, "Grull_OnDeath")
    RegisterUnitEvent(70026, 1, "Mini_OnCombat")
    RegisterUnitEvent(70026, 2, "Mini_OnLeaveCombat")
    RegisterUnitEvent(70026, 3, "Mini_OnKillTarget")
    RegisterUnitEvent(70026, 4, "Mini_OnDeath")
    RegisterUnitEvent(70022, 18, "Ad_OnSpawn")
    RegisterGameObjectEvent(999012,2,"CustomMallPortal")
    
    --Declare Variables--
    local ad = 70
    local g
    
    
    --Grull Functions
    
    function Grull_OnCombat(Unit, Event)
    Unit:SendChatMessage(14, 0, "You Want to Die? As You Wish. . . ")
    Unit:RegisterEvent("Grull_one", 100, 0)
    end
    
    function Grull_OnKillTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "Pityful Beings, Yet Another of your Team is Laid to Rest")
    end
    
    function Grull_OnDeath(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "No! I... can't... die... I am... the Dragonslayer...")
    Unit:SendChatMessage(16, 0, "Shade of Grull's Body Shrinks as His Power is Drained by a Mysterious Portal")
    Unit:SetScale(0.2)
    Unit:SpawnGameObject(999012,Unit:GetX(),Unit:GetY(),Unit:GetZ(),6,60000)
    end
    
    function Grull_one(Unit, Event)
    local p
    p=math.random(1, 2)
    if Choice==1 then
    Unit:CastSpell(6432)
    end
    end
    
    
    --Portal--
    function CustomMallPortal(pUnit, Event, pMisc)
    pUnit:Teleport(1,-10551.9,2194.788,-20)
    pMisc:Teleport(1,-10551.9,2194.788,-20)
    end
    
    
    
    --MiniBoss--
    function Mini_OnCombat(Unit, Event)
    g=Unit
    Unit:SendChatMessage(14, 0, "Open the dances!")
    Unit:RegisterEvent("Mini_one", 100, 0)
    end
    
    function Mini_OnKillTarget(Unit, Event)
    Unit:SendChatMessage(14, 0, "One Dancer Down")
    end
    
    function Mini_OnDeath(Unit, Event)
    Unit:RemoveEvents()
    Unit:SendChatMessage(14, 0, "You.. danced better... than me...")
    end
    
    function Mini_one(Unit, Event)
    if Unit:GetHealthPct() <= 80 then
    Unit:RemoveEvents()
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SpawnCreature (70022, x+3, y+3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x+3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y+3, z, o, 14 ,60000);
    Unit:RegisterEvent("Mini_two", 100, 0)
    end
    end
    
    function Mini_two(Unit, Event)
    if Unit:GetHealthPct() <= 60 then
    Unit:RemoveEvents()
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SpawnCreature (70022, x+3, y+3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x+3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y+3, z, o, 14 ,60000);
    Unit:RegisterEvent("Mini_thr", 100, 0)
    end
    end
    
    function Mini_thr(Unit, Event)
    if Unit:GetHealthPct() <= 40 then
    Unit:RemoveEvents()
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SpawnCreature (70022, x+3, y+3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x+3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y+3, z, o, 14 ,60000);
    Unit:RegisterEvent("Mini_fou", 100, 0)
    end
    end
    
    function Mini_fou(Unit, Event)
    if Unit:GetHealthPct() <= 20 then
    Unit:RemoveEvents()
    local x = Unit:GetX();
    local y = Unit:GetY();
    local z = Unit:GetZ();
    local o = Unit:GetO();
    Unit:SpawnCreature (70022, x+3, y+3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x+3, y-3, z, o, 14 ,60000);
    Unit:SpawnCreature (70022, x-3, y+3, z, o, 14 ,60000);
    end
    end
    
    --MiniBoss Ads
    
    function Ad_OnSpawn(Unit, Event)
    Unit:RegisterEvent("ADCHECK", 100, 0)
    end
    
    function ADCHECK(Unit, Event)
    if g:GetHealthPct() <= ad then
    Unit:Despawn(100, 0)
    ad = ad - 20
    end
    end
    The Ad's arnt Despawning at 70,50,30,10 as they should

    Both the MiniBoss and the Main Boss say the Enter Combat Line Twice
    Your adds aren't despawning at the correct time becuase, Add check is registered for 4 of your Adds at the same time. So when his health goes below the first percent point, 'ad' value goes down to -10?

    Try this code instead to see if this works or is even the problem

    Code:
    function ADCHECK(Unit, Event)
         if g:GetHealthPct() <= 70 then
              Unit:Despawn(100, 0)
         elseif g:GetHealthPct() <= 50 then
              Unit:Despawn(100, 0)
         elseif g:GetHealthPct() <= 30 then
              Unit:Despawn(100, 0)
         elseif g:GetHealthPct() <= 10 then
              Unit:Despawn(100, 0)
         end
    end
    This eliminates the use of the awkward 'ad' variable.

  6. #6
    controlsx2's Avatar Member
    Reputation
    16
    Join Date
    Jun 2007
    Posts
    223
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function ADCHECK(Unit, Event)
         if g:GetHealthPct() <= 70 then
              Unit:Despawn(100, 0)
         elseif g:GetHealthPct() <= 50 then
              Unit:Despawn(100, 0)
         elseif g:GetHealthPct() <= 30 then
              Unit:Despawn(100, 0)
         elseif g:GetHealthPct() <= 10 then
              Unit:Despawn(100, 0)
         end
    end
    .[/QUOTE]

    But after the 70% Everything would return true wouldnt it. So basicly the ads will insta despawn as ever number 0-69% is <= 70.

    Change the 'Type' in gameobject names from spell focus(22) to button(1), When its set to 1 right clicking does nothing
    Last edited by controlsx2; 06-22-2009 at 01:01 PM.

  7. #7
    Vision1000's Avatar Member
    Reputation
    104
    Join Date
    Jun 2008
    Posts
    122
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok try this, Your spawning 16 adds in total;
    sorry for the first code, wasn't thinking.
    Code:
    local intAdSpawnCount = 0
    
    function Mini_OnCombat(Unit, Event)
    g=Unit
    Unit:SendChatMessage(14, 0, "Open the dances!")
    Unit:RegisterEvent("Mini_one", 100, 0)
    Unit:RegisterEvent("Mini_HealthCheck", 100, 1)
    end
    
    function Mini_HealthCheck70(Unit, Event)
         if g:GetHealthPct() <= ad then
              ad = ad - 20
              Unit:RegisterEvent("Mini_HealthCheck50", 100, 1)
         else
              Unit:RegisterEvent("Mini_HealthCheck70". 100, 1)
         end
    end
    
    function Mini_HealthCheck50(Unit, Event)
         if g:GetHealthPct() <= ad then
              ad = ad - 20
              Unit:RegisterEvent("Mini_HealthCheck30", 100, 1)
         else
              Unit:RegisterEvent("Mini_HealthCheck50". 100, 1)
         end
    end
    
    function Mini_HealthCheck30(Unit, Event)
         if g:GetHealthPct() <= ad then
              ad = ad - 20
              Unit:RegisterEvent("Mini_HealthCheck10", 100, 1)
         else
              Unit:RegisterEvent("Mini_HealthCheck30". 100, 1)
         end
    end
    
    function Mini_HealthCheck10(Unit, Event)
         if g:GetHealthPct() <= ad then
              ad = ad - 20
         else
              Unit:RegisterEvent("Mini_HealthCheck10". 100, 1)
         end
    end
    
    
    function Ad_OnSpawn(Unit, Event)
    intAdSpawnCount = intAdSpawnCount + 1
    Unit:RegisterEvent("ADCHECK", 100, 0)
    end
    
    function ADCHECK(Unit, Event)
    	if (intAdSpawnCount == 4) then
    		if (ad == 70) then
    			Unit:Despawn(100, 0)
    		end
    	elseif (intAdSpawnCount == 8) then
    		if (ad == 50) then
    			Unit:Despawn(100, 0)
    		end
    	elseif (intAdSpawnCount == 12) then
    		if (ad == 30) then
    			Unit:Despawn(100, 0)
    		end
    	elseif (intAdSpawnCount == 16) then
    		if (ad == 10) then
    			Unit:Despawn(100, 0)
    		end
    	end
    end
    then just add "ad = ad - 20" whenever your Mini boss goes into a new phase.

    That should work as long as you aren't spawning more than 1 boss at once.

    Edit: /facepalm 2nd edit to fix it again, you want your adds to despawn between mini boss phases =(
    Edit2: /pray this works
    Last edited by Vision1000; 06-22-2009 at 01:25 PM.

Similar Threads

  1. [Guide]More LUA ascent 2.3 scripts
    By Pragma in forum WoW EMU Guides & Tutorials
    Replies: 27
    Last Post: 04-10-2008, 01:06 PM
  2. [Help] Lua problem
    By Lich King in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 03-23-2008, 04:34 AM
  3. lua problem
    By *Alexz* in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 02-14-2008, 10:41 PM
  4. [Question]-Lua Problem
    By Peter1337 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 02-07-2008, 07:59 AM
  5. [Question] LUA problem
    By Peter1337 in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 02-01-2008, 09:21 AM
All times are GMT -5. The time now is 01:24 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