After testing my CC on bosses like Magmaw, Nefarion, and Chimearion, both which have quite a hitbox, i did some tweaking to my original code, and seemed to be pretty damm close to the actual distance:
PHP:
static public double TotalDistance(WoWUnit unit)
{
return unit.Distance - Convert.ToDouble(unit.CombatReach) + 1;
}
}
Some explanation, unit = My target as an example,
unit.distance = distance to center of boss, as mentioned before;
unit.CombatReach = Roughly the range from the edge of their hitbox they can melee a target, which would make sense for melee's having a meleerange of ~5yards , an example combatreach for players/most npc's returns 1.5, so the radius of the hitbox for a normal player/npc would be 3.5 yards
TL;DR: so if you're standing at 30yards(unit.distance) your actual distance would be 28.5 yards
the + 1 is simply due to latency, so take it as an error margin
just a small update on my progression throughout the CC business
