What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[REQUEST] Resto Druid to cast Wild Mushroom on grp instead of tank?

CobraFuchs

New Member
Joined
Mar 11, 2013
Messages
22
I've been trying to get my Resto Druid to cast Wild Mushroom on the biggest group of raid/party members in need of heals (like Resto Shammy's Healing Rain) instead of only on the tank. If anyone is up to the task I would greatly appreciate it. I have tried myself and even borrowed some lines from Singular's Resto Shammy file to try to make it work but have only failed. Thanks again if anyone can help.
 
It is possible to cast it on the biggest group by either picking the exact middle location ( hard ) or picking the location of the unit with most units around him ( easy ).
As I won't share my own method for them yet* here's code publicly available you can use :)

Example:
Code:
      internal static WoWUnit GetBestUnitForCluster(IEnumerable<WoWUnit> units, float clusterRange)
        {
            IEnumerable<WoWUnit> wUnits = units as WoWUnit[] ?? units.ToArray();
            if (units != null && wUnits.Any())
            {
                var firstOrDefault = (from u in wUnits where !u.Error() select new { Count = GetRadiusClusterCount(u, wUnits, clusterRange), Unit = u }).OrderByDescending(a => a.Count).FirstOrDefault();
                if (firstOrDefault != null)
                    return firstOrDefault.Unit;
            }


            return null;
        }


        internal static int GetRadiusClusterCount(this WoWUnit target, IEnumerable<WoWUnit> otherUnits, float range)
        {
            var rdx = range * range;
            return otherUnits.Count(u => u.SpellDistanceSqr(target)   <= rdx);
        }
 
You make is all seem soo easy :) Thank you very much for your help, i will put it into play asap!
 
Back
Top