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

Properly detecting whether behind or not

strix

New Member
Joined
Feb 13, 2010
Messages
442
Reaction score
18
Did anyone successfully found way to detect if we are behind or not?

I'm using this:
PHP:
public static bool ImSafelyBehind( this WoWUnit unit )
{
    return unit.ImBehind(0.97*Math.PI);
}

public static bool ImBehind( this WoWUnit unit, double arcBehind)
{
    return unit.IsValid &&
        WoWMathHelper.IsBehind(
            StyxWoW.Me.Location,
            unit.Location,
            unit.Rotation,
            (float)(2*Math.PI - arcBehind)
    );
}

public static Composite CreateBackstabOrAmbush()
{
    return new Decorator(
        ret => Me.CurrentTarget.ImSafelyBehind(),
        new PrioritySelector(
            Spell.Cast("Ambush", ret => Commons.Stealthed || ShadowDancing),
            Spell.Cast("Backstab", ret => !Commons.Stealthed && !ShadowDancing)
    ));
}

And people still report my CC spamming backstab while being in front during solo combat (when mob is targetting us).
I've tried couple different ways, but never succeeded in solving this issue.
 
Last edited:
From what i tested it's constantly bugging out if you move inside target and then it step backwards itself.
After that you need to move few steps to "reset" it.
 
Back
Top