Somone help with Small LUA Problem menu

User Tag List

Results 1 to 2 of 2
  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)

    Somone help with Small LUA Problem

    The Script Works Fine, The Problem im having is after the boss leaves and despawns it magicly starts to respawn ads. What i dont get is why, When he spawns his mini boss (28%) the ads stop as they should. But they seems to start back up after he spawns here is the script



    Edit: Thx Vision, Its working now
    Last edited by controlsx2; 06-22-2009 at 07:08 AM.

    Somone help with Small LUA Problem
  2. #2
    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)
    When i have this problem on my server, and i do one of two things. 1; setting the respawn time of the Adds to 0 in the database. so they never respawn. 2nd thing i tried was;

    Code:
    local SpawnCount = 0
    
    function Mate_OnSpawn(Unit, Event)
         if (SpawnCount == x) then
              Unit:RemoveFromWorld()
         else
              SpawnCount = SpawnCount + 1
         end
    replacing x with the amount of 'mates' your boss spawns throughout the fight. If he spawns and un-set amount of 'mates' and you do not know the exact number, you could have a second variable when the boss dies that will store the amount of spawns by the time the fight ends. and still have the code do pretty much the same thing.

    Code:
    local intSpawnCount = 0
    
    function Mate_OnSpawn(Unit, Event)
         if (intSpawnCount == intSpawnCountOnDeath) then
              Unit:RemoveFromWorld()
         else
              SpawnCount = SpawnCount + 1
         end
    end
    
    function BossThree_OnDeath(Unit, Event)
    intSpawnCountOnDeath = intSpawnCount
    end
    
    function BossThree_OnLeaveCombat(Unit, Event)
    intSpawnCountOnDeath = intSpawnCount
    end
    If you use the code above, do not declare intSpawnCountOnDeath(with a value at least) or else you run the risk of having no more npc's spawning if the two variable are the same value. By not declaring it stays nil, and the 'else' part of the statement will always get executed, until its declared when your boss dies. when your boss enters combat again, you can reset the counter to 0.

    If your using the npc with the id of '55194' in your code, your going to have to script them with at least On_Spawn.

    Using Unit:RemoveFromWorld(), will remove a creature from the world, If you spawned it yourself and it has a unique sqlID then it will come back on a server restart, but if a scripted creature spawns it and its sqlID is 0. then it won't come back. (Beware though, using RemoveFromWorld() when a unit is dead has always crashed my servers.)
    Last edited by Vision1000; 06-22-2009 at 12:55 PM.

Similar Threads

  1. [HELP!!!!] Need help with small problem.!!!!
    By Jayson22 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 05-18-2008, 05:55 AM
  2. Help with this LUA script
    By jordash in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 03-08-2008, 04:19 PM
  3. Help with weird database problem
    By Xeneth in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-15-2008, 01:17 PM
  4. To help with the bandwidth problem perhaps.
    By Gothian in forum Suggestions
    Replies: 9
    Last Post: 01-14-2008, 06:10 PM
  5. Need Serious Help with account trade problem
    By threadpilot in forum World of Warcraft General
    Replies: 3
    Last Post: 11-27-2007, 07:38 AM
All times are GMT -5. The time now is 03:20 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