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

Actual combatrange to boss ?

Thacai

Member
Joined
Jan 15, 2010
Messages
71
Reaction score
0
Really trying to figure out a way to calculate the exact range to a target, etc bosses with very large hitboxes like bosses from the Conclave fight, issue is that target.Distance return the distance to the middle of the boss, not the range till you're able to attack it.

Any who've been able to calculate this ?
 
Have to get this for spells like Shadowflame which have a maximum range of 10 yards cone infront of you, gives trouble if you set like if Distance <= 10, then on mobs with large hitbox you'll have to basicly stand in the boss. Looks wierd :D
 
i've tried stuff like Target.Distance + Target.Combatreach but doesnt work correctly
 
well theres WoWUnit.BoundingRadius so try something like Target.Distance + BoundingRadius
however if what this says is correct. CombatReach, BoundingRadius, MeleeRange?
then theres not ever really a proper way to find it for all mobs, since according to them, BoundingRadius is for the scale of the Original Model not ones that are scaled. im sure you've seen this with hunter pets, as soon as you tame them they shrink down. i think i had melee range issues when i was working on my hunter CC a long time ago, so im not exactly sure how i solved it, but bounding radius defiantly helped. if worse comes to worse you can always just override the the number instead of using bounding radius, give it a guess. and just have it check for mob name.
 
Ok thanks, think i just choose to store the Names on the bosses i've been fighting + the range in a XML file then, and just load it duing initialize
 
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 :D
 
Back
Top