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:
What would be an efficient way of checking for the closest hostile player?Code:Unit:FullCastSpellOnTarget(xxx,Unit:GetClosestPlayer(0))