Lua script spell problem menu

User Tag List

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

    Lua script spell problem

    For some reason he goes through the spells once and then stops. Is there something I am missing to make him keep casting through the spells?

    Code:
    function Bigbobspawn_Reproduce2(unit)
    unit:SendChatMessage(12, 0, "Death is close.")
    unit:PlaySoundToSet(8888)
    unit:PlaySoundToSet (8580)
    unit:CastSpell(0)
    x = unit:GetX()
    y = unit:GetY()
    z = unit:GetZ()
    unit:SpawnCreature(65028, x, y, z, 0, 148, 180000)
    unit:SpawnCreature(65028, x, y, z, 0, 148, 180000)
    unit:RemoveEvents()
    end
    
    
    function Bigbobspawn_Corrupt1(unit)
    unit:CastSpell(25198)
    unit:SendChatMessage(12, 0, "You will die.")
    unit:PlaySoundToSet (8586)
    end 
    
    function Bigbobspawn_Mindcontrol1(unit)
    unit:CastSpellOnTarget(26198, unit:GetRandomPlayer(7))
    unit:SendChatMessage(12, 0, "Your friends will abandon you.")
    unit:PlaySoundToSet (8583)
    end 
    
    
    function Bigbobspawn_Posionaura1(unit)
    unit:CastSpell(29865)
    end
    
    function Bigbobspawn_Poisonthing1(unit)
    unit:CastSpell(38220)
    unit:SendChatMessage(12, 0, "Your heart will explode.")
    unit:PlaySoundToSet (8587)
    end
    
    function Bigbobspawn_OnEnterCombat(unit)
    unit:PlaySoundToSet(8888)
    unit:PlaySoundToSet(8581)
    unit:SendChatMessage(12, 0, "You are already dead.")
    unit:RegisterEvent("Bigbobspawn_Reproduce2",30000, 15)
    unit:RegisterEvent("Bigbobspawn_Posionaura1",12000, 10)
    unit:RegisterEvent("Bigbobspawn_Poisonthing1",22000, 10)
    unit:RegisterEvent("Bigbobspawn_Corrupt1",17000, 5)
    unit:RegisterEvent("Bigbobspawn_Mindcontrol1",23000, 5)
    end
    
    function Bigbobspawn_OnLeaveCombat(unit)
    unit:RemoveEvents()
    end
    
    
    function Bigbobspawn_Death(unit)
    x = unit:GetX()
    y = unit:GetY()
    z = unit:GetZ()
    unit:SpawnCreature(65028, x, y, z, 0, 148, 180000)
    unit:SpawnCreature(65028, x, y, z, 0, 148, 180000)
    unit:SpawnCreature(65028, x, y, z, 0, 148, 180000)
    unit:SpawnCreature(65028, x, y, z, 0, 148, 180000)
    unit:SendChatMessage(12, 0, "Your courage will fail.")
    unit:PlaySoundToSet (8582)
    unit:RemoveEvents()
    end
    
    
    function Bigbobspawn_OnKilledTarget(unit)
    unit:SendChatMessage(12, 0, "You are weak.")
    unit:PlaySoundToSet (8586)
    unit:RemoveEvents()
    end
    
    
    RegisterUnitEvent(65026, 1, "Bigbobspawn_OnEnterCombat")
    RegisterUnitEvent(65026, 2, "Bigbobspawn_OnLeaveCombat")
    RegisterUnitEvent(65026, 3, "Bigbobspawn_OnKilledTarget")
    RegisterUnitEvent(65026, 4, "Bigbobspawn_Death")

    Lua script spell problem
  2. #2
    Pwntzyou's Avatar Contributor
    Reputation
    264
    Join Date
    Dec 2007
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function Bigbobspawn_OnKilledTarget(unit)
    unit:SendChatMessage(12, 0, "You are weak.")
    unit:PlaySoundToSet (8586)
    unit:RemoveEvents()
    end


    That would mean once he kills someone the events are removed and he stops casting anything called by events... you might want to change that^^

    If you die and THEN he stops casting there is your problem


    <3 MysterioussouL for the sig

  3. #3
    bill45's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    He still seems to stop casting his spells during the fight. And no one dies.

  4. #4
    Gastricpenguin's Avatar Legendary
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its because you registered all of your spells in the OnComnbat function. And taking a look at each spell, once he casts them, his whole script will stop due to "Unit:RemoveEvents" found in each spell function.
    Life Puzzler WoW - Website | Forums

  5. #5
    bill45's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    104
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ah yes thank you didn't see that remove events after that spell.

Similar Threads

  1. Creature wont cast his spells [Lua Script]
    By bill45 in forum World of Warcraft Emulator Servers
    Replies: 13
    Last Post: 05-26-2008, 08:29 PM
  2. LUA scripting -- Making game objects cast spells.
    By Jotox in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 05-08-2008, 03:44 PM
  3. [Help] Fairly large Lua script problem
    By Muruk in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 03-16-2008, 09:03 PM
  4. LUA Scripting Problem
    By Knife in forum World of Warcraft Emulator Servers
    Replies: 18
    Last Post: 03-10-2008, 02:00 PM
  5. Lua scripts problem
    By Mr.Ice.Cold in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-02-2008, 11:44 AM
All times are GMT -5. The time now is 08:51 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