private bool DoSkillsList(List<Structs.TERASkill> Skills, int Distance, TERAObject Object) { uint manaPercentage = LocalPlayer.S1PlayerStatController.ManaPercentage; uint mana = LocalPlayer.S1PlayerStatController.Mana; uint healthPercentage = LocalPlayer.S1PlayerStatController.HealthPercentage; uint health = LocalPlayer.S1PlayerStatController.Health; if (this.IsMultiAggro()) { Object = this.NearestAggro(); } Distance = (int) this.GetCombatDistance(this.GetDistanceFrom(Object)); Skills = this.GetCombatSkillList(); if (!Approach.ApproachTERAObject(Object, (double) Distance)) { return false; } foreach (Structs.TERASkill skill2 in Skills) { Structs.TERASkill tERASkillById = MyTERA.Helpers.SkillsManager.SkillsManager.GetTERASkillById(skill2.Id); double distanceFrom = this.GetDistanceFrom(Object); try { this.StayInRange(Object, Distance); } catch { } if (distanceFrom > Distance) { Approach.ApproachTERAObject(Object, (double) Distance); } else if ((tERASkillById.IsValid && !tERASkillById.OnCooldown()) && Player.HasMana(tERASkillById.GetCostMP())) { bool requireDoubleCast = doubleCastSkillList.Contains(tERASkillById); Object.S1SkeletalMeshController.Position.Camera__Face(); Thread.Sleep(100); this.GetDistanceFrom(Object); if (requireDoubleCast) { Logger.WriteLine("Double Cast: " + tERASkillById.Name); } this.LogCast(tERASkillById.Name); this.castTime = this.GetCastTimeById(tERASkillById.Id); try { this.Strafe(Object); } catch { } Skills.CastSkillById(tERASkillById.Id, this.castTime, requireDoubleCast, Object); while (LocalPlayer.IsCasting || LocalPlayer.S1PlayerMoveController.IsCasting) { } Thread.Sleep(1); if (!Player.isCombo) { return true; } } } return true; }
public void StayInRange(TERAObject obj, int Distance) { if ((((!this.isStrafePlayer || this.isPlayerNearby()) && (this.isStrafe && !this.isBotStopped)) && !Player.isPull) && (Distance != this.meleeDist)) { DateTime time = DateTime.Now.AddMilliseconds(1500.0); for (Position position = LocalPlayer.Position; this.GetDistanceFrom(obj) < (Distance - 2); position = LocalPlayer.Position) { if ((!obj.IsValid || !obj.S1NpcGameDataController.IsAlive) || !obj.S1NpcGameDataController.InCombat) { break; } if (this.isBotStopped) { return; } if (DateTime.Now > time) { return; } obj.S1SkeletalMeshController.Position.Camera__Face(); Movements.SetMovementFlag(Enums.MovementFlags.Backward); if (LocalPlayer.Position == position) { return; } } } }
public void Strafe(TERAObject obj) { if ((!this.isStrafePlayer || this.isPlayerNearby()) && (this.isStrafe && !this.isBotStopped)) { int chanceDefault = this.chanceDefault; int num2 = this.moveMS.Next(this.minStrafeTime, this.maxStrafeTime); int num3 = this.moveMS.Next(0, 100); if ((this.castTime > 0) && this.isStrafeCharge) { chanceDefault = this.chanceCharging; } if ((num3 <= chanceDefault) && ((Player.isCombat || Player.isLong) || (Player.isHPRegen || Player.isMPRegen))) { if (this.moveMS.Next(0, 0x3e8) < 500) { this.strafeLeft = true; } else { this.strafeLeft = false; } string str = " for " + num2 + " ms"; if (this.strafeLeft) { Logger.WriteLine("Strafe Left" + str); } else { Logger.WriteLine("Strafe Right" + str); } DateTime time = DateTime.Now.AddMilliseconds((double) num2); while (DateTime.Now < time) { if ((!obj.IsValid || !obj.S1NpcGameDataController.IsAlive) || (!obj.S1NpcGameDataController.InCombat || this.isBotStopped)) { break; } obj.S1SkeletalMeshController.Position.Camera__Face(); if (this.strafeLeft) { Movements.SetMovementFlag(Enums.MovementFlags.Left); } else { Movements.SetMovementFlag(Enums.MovementFlags.Right); } obj.S1SkeletalMeshController.Position.Camera__Face(); } if (!Player.IsLongRange()) { Movements.SetMovementFlag(Enums.MovementFlags.Forward); Thread.Sleep(100); Movements.StopMove(); } } } }
public override bool Pull(TERAObject Object) { if (this.isPlayerNearby()) { Logger.WriteLine(string.Concat(new object[] { "Player detected: ", this.nearestPlayer.S1UserGameDataController.Name, " at ", Math.Round(this.nearestPlayer.S1SkeletalMeshController.Position.TERADistance3DFromPlayer, 1), "m" })); } try { this.Thread_CheckCombo.Abort(); } catch { } this.Thread_CheckCombo = new Thread(new ThreadStart(this.CheckFinalCombo)); this.Thread_CheckCombo.Start(); Player.SwitchToPull(); if (this.DoSkillsList(pullSkillList, this.pullDist, Object)) { DateTime time = DateTime.Now.AddMilliseconds(2000.0); while (DateTime.Now <= time) { if (Object.S1NpcGameDataController.TargetGUID == Game.LocalTERAObject.GUID) { return true; } } } return false; }
public bool isPlayerNearby() { if (this.isDetectPlayer) { List<TERAObject> list = new List<TERAObject>(MyTERA.Helpers.ObjectManager.ObjectManager.GetTERAObjects().Values); foreach (TERAObject obj2 in list) { if (((obj2.GUID != Game.LocalTERAObject.GUID) && (obj2.S1SkeletalMeshController.Position.TERADistance3DFromPlayer < this.maxPlayerDistance)) && obj2.IsPlayer) { this.nearestPlayer = obj2; return true; } } } return false; }
public double GetDistanceFrom(TERAObject o) { return o.S1SkeletalMeshController.Position.TERADistance3DFromPlayer; }
public override bool Combat(TERAObject Object) { Player.SwitchToMpRegen(); this.DoSkillsList(combatSkillList, this.meleeDist, Object); return true; }
private bool WithinRange(TERAObject Object, int range) { return (Object.S1SkeletalMeshController.Position.TERADistance3DFromPlayer <= range); }