Guest User

Untitled

a guest
Nov 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. public static WoWUnit BestTricksTarget
  2. {
  3. get
  4. {
  5. if (!StyxWoW.Me.IsInParty && !StyxWoW.Me.IsInRaid)
  6. return null;
  7.  
  8. // If the player has a focus target set, use it instead. TODO: Add Me.FocusedUnit to the HB API.
  9. if (StyxWoW.Me.FocusedUnitGuid != 0)
  10. return StyxWoW.Me.FocusedUnit;
  11.  
  12. if (StyxWoW.Me.IsInInstance)
  13. {
  14. if (RaFHelper.Leader != null && !RaFHelper.Leader.IsMe)
  15. {
  16. // Leader first, always. Otherwise, pick a rogue/DK/War pref. Fall back to others just in case.
  17. return RaFHelper.Leader;
  18. }
  19.  
  20. if (StyxWoW.Me.IsInParty)
  21. {
  22. var bestTank = Group.Tanks.OrderBy(t => t.DistanceSqr).FirstOrDefault(t => t.IsAlive);
  23.  
  24. if (bestTank != null)
  25. return bestTank;
  26. }
  27.  
  28. var bestPlayer = Group.GetPlayerByClassPrio(100f, false,
  29. WoWClass.Rogue, WoWClass.DeathKnight, WoWClass.Warrior,WoWClass.Hunter, WoWClass.Mage, WoWClass.Warlock, WoWClass.Shaman, WoWClass.Druid,
  30. WoWClass.Paladin, WoWClass.Priest);
  31. return bestPlayer;
  32. }
  33.  
  34. return null;
  35. }
  36. }
Add Comment
Please, Sign In to add comment