var playersAttackable = new List<wManager.Wow.ObjectManager.WoWPlayer>();
foreach (var player in wManager.Wow.ObjectManager.ObjectManager.GetObjectWoWPlayer())
{
bool canAttack = false;
var f = wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid;
wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid = player.Guid;
if (wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid == player.Guid)
canAttack = Lua.LuaDoString<bool>("return UnitCanAttack('player', 'focus')");
wManager.Wow.ObjectManager.ObjectManager.Me.FocusGuid = f;
if (canAttack)
playersAttackable.Add(player);
Logging.WriteDebug("Can attack = " + canAttack + " > " + player);
}
You can change focus several time