Boss Script problem menu

Shout-Out

User Tag List

Results 1 to 2 of 2
  1. #1
    Myuu's Avatar Active Member
    Reputation
    17
    Join Date
    Dec 2007
    Posts
    71
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Boss Script problem

    I recently started learning LUA and I've got some problems with a boss that I'm trying to make.

    The code looks like this at the moment
    Code:
    --[[
        Jahim boss fight (test)
    ]]
    
    local NPC_ID = 100007
    
    function NPC_OnCombat(Unit, Event)
    Unit:RegisterEvent("Jahim_Trash", 3500, 0)
    Unit:RegisterEvent("Jahim_FireNova", 10000, 0)
    Unit:RegisterEvent("Imp_Spawn", 30000, 0)
    end
    
    function NPC_OnLeaveCombat(Unit, Event)
        Unit:RemoveEvents()
    end
    
    function NPC_OnDeath(Unit, Event)
        Unit:RemoveEvents()
    end
    
    function Jahim_Trash(Unit, Event)
    Unit:CastSpellOnTarget(11976, Unit:GetMainTank())
    end
    
    function Jahim_FireNova(Unit, Event)
    Unit:FullCastSpellOnTarget(30941, Unit:GetRandomPlayer(0))
    if (Unit:GetRandomPlayer(0) ~= nil) then
    Unit:FullCastSpellOnTarget(30941, Unit:GetRandomPlayer(0))
    end
    end
    
    function Imp_Spawn(NPCID, x, y, z, o, faction, duration)
    Unit:SpawnCreature(100008, -1119, 1741, 89, 4, 14, 0)
    end
    
    RegisterUnitEvent(NPC_ID, 1, NPC_OnCombat)
    RegisterUnitEvent(NPC_ID, 2, NPC_OnLeaveCombat)
    RegisterUnitEvent(NPC_ID, 4, NPC_OnDeath)
    There are two main problems. First off all the Firenova spell is really buggy. Sometimes it dosen't do anything for the whole fight. Sometimes it uses it once or twice and then never again, and it always uses it double (I get hit twice instantly when I'm only suppost to get hit once). The second problem is that the Imp dosen't spawn.

    When I spawn the Imp manually it dosen't do anything but auto-attack.
    This is the code for the Imp.
    Code:
    --[[ Imp Script for Jahim Boss fight
    ]]
    
    local NPC_ID = 100008
    
    function NPC_OnCombat(Unit, Event)
    Unit:RegisterEvent("Imp_FireBall", 3000, 0)
    end
    
    function NPC_OnDeath(Unit,Event)
    Unit:RemoveEvents()
    end
    
    function NPC_OnLeaveCombat(Unit, Event)
    Unit:Despawn(10, 0)
    Unit:RemoveEvents()
    end
    
    function Imp_FireBall (Unit, Event)
    Unit:CastSpellOnTarget(33793, Unit:GetRandomPlayer(0))
    if (Unit:GetRandomPlayer(0) ~= nil) then
    Unit:CastSpellOnTarget(33793, Unit:GetRandomPlayer(0))
    end
    
    RegisterUnitGossipEvent(NPC_ID, 4, NPC_OnDeath)
    RegisterUnitGossipEvent(NPC_ID, 2, NPC_OnLeaveCombat)
    RegisterUnitGossipEvent(NPC_ID, 1, NPC_OnCombat)
    How can I fix these problems?
    /dnd leeching

    Boss Script problem
  2. #2
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well for one part it seems that your function
    Code:
    function Jahim_FireNova(Unit, Event)
    Unit:FullCastSpellOnTarget(30941, Unit:GetRandomPlayer(0))
    if (Unit:GetRandomPlayer(0) ~= nil) then
    Unit:FullCastSpellOnTarget(30941, Unit:GetRandomPlayer(0))
    end
    end
    Is causing the double firenova.

    Atm you have it set up to Cast fire nova then check for targets and if it finds a target to cast it again. It really doesnt make any sense to tell it Do this.. and if you find a target do it again. Same effect would be accomplished by just using the fullcastspell. The same applies with your imp_fireball

    For your imps script i dont think combat phases are considered Gossip events.
    RegisterUnitGossipEvent(NPC_ID, 4, NPC_OnDeath)
    RegisterUnitGossipEvent(NPC_ID, 2, NPC_OnLeaveCombat)
    RegisterUnitGossipEvent(NPC_ID, 1, NPC_OnCombat)

    Is your console throwing up an error when it attempts to spawn the imp? Sorry i dont have a Arc server to run the lua through to see what it does and i havent used arc in a few years so im just going off what i can see in the script.

Similar Threads

  1. [C++ Script] Oregon core boss script problems
    By gillisrofl in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 02-22-2012, 03:06 AM
  2. [C++ Script] Boss script problem
    By marksman726lul in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 07-10-2011, 12:42 AM
  3. [Lua Script] Boss Script Problem!
    By wour55 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 06-28-2010, 06:46 AM
  4. Problem with lua boss script
    By nickeg in forum WoW EMU Questions & Requests
    Replies: 13
    Last Post: 08-16-2008, 09:22 AM
  5. Lua Boss Script Problems!!
    By blah7 in forum World of Warcraft Emulator Servers
    Replies: 14
    Last Post: 01-22-2008, 08:59 PM
All times are GMT -5. The time now is 10:07 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