[Lua] Mobs only ever cast spells on themselves menu

Shout-Out

User Tag List

Results 1 to 10 of 10
  1. #1
    RoyPwns's Avatar Sergeant
    Reputation
    1
    Join Date
    Mar 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Mobs only ever cast spells on themselves

    Hey, I'm running a 2.4.3 ArcEmu server, and I'm having a problem with mobs that are scripted to use single target spells. They -always- attack themselves with them.

    Code:
    function Venoxis_HolyFireRepeat(pUnit, event)
         pUnit:FullCastSpellOnTarget(23860, pUnit:GetMainTank())
         pUnit:RegisterEvent("Venoxis_HolyFire", math.random(18000, 22000), 1)
    end
    
    function Venoxis_HolyFire(pUnit, event)
         pUnit:FullCastSpellOnTarget(23860, pUnit:GetmainTank())
         pUnit:RegisterEvent("Venoxis_HolyFireRepeat", math.random(18000, 22000), 1)
    end
    Have I done something wrong here?

    [Lua] Mobs only ever cast spells on themselves
  2. #2
    Maybepie's Avatar Active Member
    Reputation
    25
    Join Date
    Aug 2008
    Posts
    147
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had a kind of related issue yesterday, I simply changed;
    Code:
    pUnit:FullCastSpellOnTarget to pUnit:CastSpellOnTarget
    I removed the "Full" part in other words.
    That got it working for me, I can't see any other error in your script. (But on the other hand, I've only been scripting for about two or three days xD..)
    Nyaa ~

  3. #3
    RoyPwns's Avatar Sergeant
    Reputation
    1
    Join Date
    Mar 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Didn't work for me, he still casts it on himself :runaway:

  4. #4
    alj03's Avatar Contributor
    Reputation
    91
    Join Date
    Feb 2008
    Posts
    1,103
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you post the whole script?
    Death to all but Metal.

  5. #5
    RoyPwns's Avatar Sergeant
    Reputation
    1
    Join Date
    Mar 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function Venoxis_HolyNovaRepeat(pUnit, event)
         pUnit:CastSpell(23858)
         pUnit:RegisterEvent("Venoxis_HolyNova", math.random(26000, 31000), 1)
    end
    
    function Venoxis_HolyNova(pUnit, event)
         pUnit:FullCastSpellOnTarget(23858)
         pUnit:RegisterEvent("Venoxis_HolyNovaRepeat", math.random(26000, 31000), 1)
    end
    
    function Venoxis_HolyFireRepeat(pUnit, event)
         local plr = pUnit:GetMainTank()
         pUnit:CastSpellOnTarget(23860, pUnit:GetMainTank())
         pUnit:RegisterEvent("Venoxis_HolyFire", math.random(18000, 22000), 1)
    end
    
    function Venoxis_HolyFire(pUnit, event)
         local plr = pUnit:GetMainTank()
         pUnit:CastSpellOnTarget(23860, pUnit:GetmainTank())
         pUnit:RegisterEvent("Venoxis_HolyFireRepeat", math.random(18000, 22000), 1)
    end
    
    function Venoxis_Serpent(pUnit, event)
         local serpenttarget=pUnit:GetRandomPlayer(0);
         pUnit:SpawnCreature(14884, serpenttarget:GetX(), serpenttarget:GetY(), serpenttarget:GetZ(), serpenttarget:GetO(), 14, 0)
    end
    
    function Venoxis_Renew(pUnit, event)
         pUnit:CastSpell(23895)
    end
    
    function Venoxis_PoisonCloud(pUnit, event)
         pUnit:CastSpell(23861)
    end
    
    function Venoxis_VenomSpitRepeat(pUnit, event)
         pUnit:FullCastSpellOnTarget(23862, pUnit:GetRandomPlayer(0))
         pUnit:RegisterEvent("Venoxis_VenomSpit", math.random(14000, 18000), 1)
    end
    
    function Venoxis_VenomSpit(pUnit, event)
         pUnit:FullCastSpellOnTarget(23862, pUnit:GetRandomPlayer(0))
         pUnit:RegisterEvent("Venoxis_VenomSpitRepeat", math.random(14000, 18000), 1)
    end
    
    function Venoxis_Phasetwo(pUnit, event)
         if pUnit:GetHealthPct() < 51 then
    	     pUnit:RemoveEvents()
    	     pUnit:SendChatMessage(14, 0, "Let the coils of hate unfurl!")
    	     pUnit:SetModel(9134)
    	     pUnit:CastSpell(23849)
    	     pUnit:CastSpell(23861)
    	     pUnit:RegisterEvent("Venoxis_PoisonCloud", 22000, 0)
    	     pUnit:RegisterEvent("Venoxis_VenomSpit", math.random(14000, 18000), 1)
         end
    end
    
    function Venoxis_OnEnterCombat(pUnit, event)
         pUnit:RegisterEvent("Venoxis_HolyNova", math.random(26000, 31000), 1)
         pUnit:RegisterEvent("Venoxis_HolyFire", math.random(18000, 22000), 1)
         pUnit:RegisterEvent("Venoxis_Serpent", 45000, 0)
         pUnit:RegisterEvent("Venoxis_Renew", 50000, 0)
         pUnit:RegisterEvent("Venoxis_Phasetwo", 1000, 0)
    end
    
    RegisterUnitEvent(14507, 1, "Venoxis_OnEnterCombat")
    
    function Venoxis_OnWipe(pUnit, event)
         if pUnit:IsAlive() == true then
    	     pUnit:SetModel(15217)
    	     pUnit:RemoveEvents()
         else
         	pUnit:SendChatMessage(14, 0, "Ssserenity..at lassst!")
         end
    end
    
    RegisterUnitEvent(14507, 2, "Venoxis_OnWipe")
    
    function Venoxis_OnDie(pUnit, event)
         pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(14507, 4, "Venoxis_OnDie")
    
    --Parasitic Serpent AI
    function Serpent_OneTimeBite(pUnit, event)
         pUnit:FullCastSpellOnTarget(23865, pUnit:GetClosestPlayer())
    end
    
    function Serpent_Bite(pUnit, event)
         pUnit:FullCastSpellOnTarget(23865, pUnit:GetClosestPlayer())
    end
    
    function Serpent_OnEnterCombat(pUnit, event)
         pUnit:RegisterEvent("Serpent_OneTimeBite", 2000, 1)
         pUnit:RegisterEvent("Serpent_Bite", 14000, 0)
    end
    
    RegisterUnitEvent(14884, 1, "Serpent_OnEnterCombat")
    
    function Serpent_OnWipe(pUnit, event)
         pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(14884, 2, "Serpent_OnWipe")
    
    function Serpent_OnDie(pUnit, event)
         pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(14884, 4, "Serpent_OnDie")
    Here you go.

  6. #6
    Mircast's Avatar Member
    Reputation
    14
    Join Date
    Sep 2008
    Posts
    139
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why do you have two functions of the same spell, timed at the exact time? D:

    And you're making local's but looking through the script I can't see where you've used "plr"

    Code:
    function Venoxis_HolyFireRepeat(pUnit, event)
         local plr = pUnit:GetMainTank()
         pUnit:CastSpellOnTarget(23860, pUnit:GetMainTank())
         pUnit:RegisterEvent("Venoxis_HolyFire", math.random(18000, 22000), 1)
    end
    
    function Venoxis_HolyFire(pUnit, event)
         local plr = pUnit:GetMainTank()
         pUnit:CastSpellOnTarget(23860, pUnit:GetmainTank())
         pUnit:RegisterEvent("Venoxis_HolyFireRepeat", math.random(18000, 22000), 1)
    end
    Try this.
    Code:
    function Venoxis_HolyFire(pUnit, event)
         pUnit:CastSpellOnTarget(23860, pUnit:GetMainTank())
         pUnit:RegisterEvent("Venoxis_HolyFireRepeat", math.random(18000, 22000), 1)
    end

  7. #7
    RoyPwns's Avatar Sergeant
    Reputation
    1
    Join Date
    Mar 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I tried using that just now, and Venoxis still casts holy fire on himself :weepy:

  8. #8
    Mircast's Avatar Member
    Reputation
    14
    Join Date
    Sep 2008
    Posts
    139
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm..

    Maybe it's the spell, that's all I can think of for now.. try this.

    Code:
    function Venoxis_HolyFire(pUnit, event)
         pUnit:CastSpellOnTarget(48134, pUnit:GetRandomPlayer(0))
         pUnit:RegisterEvent("Venoxis_HolyFireRepeat", math.random(18000, 22000), 1)
    end

  9. #9
    RoyPwns's Avatar Sergeant
    Reputation
    1
    Join Date
    Mar 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope, no luck there either :eek3:

  10. #10
    RoyPwns's Avatar Sergeant
    Reputation
    1
    Join Date
    Mar 2010
    Posts
    37
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still having this problem :runaway:

Similar Threads

  1. [Lua] Mobs always cast spells on themselves. Not the target
    By Wheeze201 in forum WoW EMU Questions & Requests
    Replies: 10
    Last Post: 08-17-2009, 09:12 AM
  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. Question How do I make a mob stand still casting a spell?
    By jakjaklol1337 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 04-26-2008, 03:53 PM
  4. [Question] hmm, how do i make a mob rapidly cast spells?
    By Creepfold in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 12-27-2007, 10:38 AM
  5. [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc
    By Greed in forum WoW EMU Guides & Tutorials
    Replies: 6
    Last Post: 12-10-2007, 07:51 PM
All times are GMT -5. The time now is 11:57 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