Faction attacking each other menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    Iaccidentallytwink's Avatar Elite User
    Reputation
    591
    Join Date
    Aug 2007
    Posts
    1,020
    Thanks G/R
    1/16
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Faction attacking each other

    I'm scripting 2 flag bosses for WSG, and I'm making them cast spells to the closest player near them. It works fine, but if there is a player of the same faction near them it will cast the harmful spell on them as well. Here's the code for the spells:
    Code:
    Unit:FullCastSpellOnTarget(xxx,Unit:GetClosestPlayer(0))
    What would be an efficient way of checking for the closest hostile player?


    Faction attacking each other
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Could try this:

    Unit:FullCastSpellOnTarget(xxx, Unit:
    GetRandomEnemy())

    Or

    Unit:FullCastSpellOnTarget(xxx, Unit:GetRandomEnemy(0))

  3. #3
    Iaccidentallytwink's Avatar Elite User
    Reputation
    591
    Join Date
    Aug 2007
    Posts
    1,020
    Thanks G/R
    1/16
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by stoneharry View Post
    Could try this:

    Unit:FullCastSpellOnTarget(xxx, Unit:
    GetRandomEnemy())

    Or

    Unit:FullCastSpellOnTarget(xxx, Unit:GetRandomEnemy(0))
    I tried this and got "attempt to call method..." "...a nil value".

    Edit: NVM, I accidentally typed GetClosestEnemy.
    Is it possible to target the closest enemy instead of a random one?


  4. #4
    Iaccidentallytwink's Avatar Elite User
    Reputation
    591
    Join Date
    Aug 2007
    Posts
    1,020
    Thanks G/R
    1/16
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by n4ru70h4x0r View Post
    I tried this and got "attempt to call method..." "...a nil value".

    Edit: NVM, I accidentally typed GetClosestEnemy.
    Is it possible to target the closest enemy instead of a random one?
    Actually, GetRandomEnemy gives the same error =S.


  5. #5
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Code:
    function X (pUnit, Event)
    local plr = pUnit:GetClosestPlayer()
          if plr pUnit:GetFaction() == 1 then
                  pUnit:FullCastSpellOnTarget(xx, plr)
            else
          if plr pUnit:GetFaction() == 2 then
          end
    end
    1 = Alliance
    2 = Horde
    I think that should work, just edit it to your needs.

Similar Threads

  1. [SQL] Heidi SQL NPC respawn + NPC's to attack each other, Not working.
    By Zaty in forum WoW EMU Questions & Requests
    Replies: 5
    Last Post: 07-20-2013, 05:36 PM
  2. [Repack] Make npc attack each other
    By 6rimReaper in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 02-27-2011, 04:31 PM
  3. Attack the other Faction during mounted combat.
    By Corpsegrind in forum World of Warcraft Exploits
    Replies: 2
    Last Post: 04-21-2009, 11:16 AM
  4. [Guide] Have Horde and Alliance able to Speak to Each Other
    By †Crou† in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 04-23-2008, 02:28 PM
  5. Send Mails to each other.
    By Goggelpuff in forum Community Chat
    Replies: 1
    Last Post: 08-17-2006, 12:53 PM
All times are GMT -5. The time now is 10:39 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