public bool CastIfHasBuff(WoWGlobal wowinfo, WoWUnit unit) { if (unit.HasBuff(this.ID)) { this.SendCast(); return true; } return false; }
public void Print(WoWUnit u, int padleft) { Type type = u.GetType(); PropertyInfo[] properties = type.GetProperties(); foreach (PropertyInfo property in properties) { Console.WriteLine("".PadLeft(padleft)+(property.Name.ToString().PadRight(Paddistance) + property.GetValue(u, null))); } Print(u.MovingInfo, padleft); Print(u.Buffs,2*padleft); }
public virtual bool ReCast(WoWGlobal wowinfo, WoWUnit unit) { if (!unit.HasBuff(this.ID) /*&& !wowinfo.SpellIsPending*/) { this.SendCast(); return true; } else { return false; } }
public override bool ReCast(WoWGlobal wowinfo, WoWUnit unit) { if (!unit.HasBuff(cot) && !unit.HasBuff(cote) && !unit.HasBuff(cow) && !unit.HasBuff(coe)) { this.SendCast(); return true; } else { return false; } }
public override bool ReCast(WoWGlobal wowinfo, WoWUnit unit) { if (!unit.HasBuff(this.ID) && !wowinfo.SpellIsPending && wowinfo.HasRunesFor(cost)) { this.SendCast(); return true; } else { return false; } }
public void Print(WoWUnit u) { Type type = u.GetType(); PropertyInfo[] properties = type.GetProperties(); Console.WriteLine("Printing Info about a " + type.ToString()); foreach (PropertyInfo property in properties) { Console.WriteLine(property.Name.ToString().PadRight(Paddistance) + property.GetValue(u, null)); } Print(u.MovingInfo,0); Print(u.Buffs, 3); }
public static double Calculateangle(WoWUnit Target, WoWUnit Player) { float vx = Target.Position.X - Player.Position.X; float vy = Target.Position.Y - Player.Position.Y; return Math.Sign(vy) * Math.Acos((vx * 1 + vy * 0) / (Math.Sqrt(vx * vx + vy * vy))); }
protected void Halt(WoWUnit mPlayerUnit) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_UP, mPlayerUnit.MovingInfo.IsMovingForward, ref myforward); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_LEFT, mPlayerUnit.MovingInfo.IsTurningLeft, ref myleft); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_RIGHT, mPlayerUnit.MovingInfo.IsTurningRight, ref myright); }
protected bool WalkingTowards(WoWUnit mPlayerUnit, WoWUnit mTargetUnit, double mPositionThreshhold) { return WalkingTowards(mPlayerUnit, mTargetUnit.Position, mPositionThreshhold); }
protected bool WalkingTowards(WoWUnit mPlayerUnit, Vector3 mTargetPosition, double mPositionThreshold) { if (Vector3.Distance(mPlayerUnit.Position, mTargetPosition) < mPositionThreshold) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_UP, mPlayerUnit.MovingInfo.IsMovingForward, ref myforward); return true; } else { SendKey.KeyDown(ConstController.WindowsVirtualKey.VK_UP, !mPlayerUnit.MovingInfo.IsMovingForward, ref myforward); return false; } }
protected bool RotateTowards(WoWUnit PlayerUnit, WoWUnit TargetUnit, double RotationThreshhold, bool DisableForward) { return RotateTowards(PlayerUnit, TargetUnit.Position, RotationThreshhold, DisableForward); }
protected bool RotateTowards(WoWUnit PlayerUnit, Vector3 TargetUnitPos, double RotationThreshhold, bool DisableForward) { double mydiff = Angles.AngleDiff(Angles.Calculateangle(TargetUnitPos, PlayerUnit.Position), PlayerUnit.Rotation); if ((Math.Abs(mydiff) < RotationThreshhold)) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_LEFT, PlayerUnit.MovingInfo.IsTurningLeft, ref myleft); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_RIGHT, PlayerUnit.MovingInfo.IsTurningRight, ref myright); return true; } else if (mydiff < 0) { if (DisableForward) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_UP, PlayerUnit.MovingInfo.IsMovingForward, ref myforward); } SendKey.KeyDown(ConstController.WindowsVirtualKey.VK_LEFT, !PlayerUnit.MovingInfo.IsTurningLeft, ref myleft); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_RIGHT, PlayerUnit.MovingInfo.IsTurningRight, ref myright); } else if (mydiff > 0) { if (DisableForward) { SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_UP, PlayerUnit.MovingInfo.IsMovingForward, ref myforward); } SendKey.KeyDown(ConstController.WindowsVirtualKey.VK_RIGHT, !PlayerUnit.MovingInfo.IsTurningRight, ref myright); SendKey.KeyUp(ConstController.WindowsVirtualKey.VK_LEFT, PlayerUnit.MovingInfo.IsTurningLeft, ref myleft); } return false; }