//--------------------------------------------------------------------------------------------- public static double GetAngle(IUOPosition start, IUOPosition destination) { int destX; int destY; Robot.GetRelativeCoordinates(start, destination, out destX, out destY); return(Robot.GetVectorAngle(destX, destY)); }
//--------------------------------------------------------------------------------------------- public static double GetRelativeVectorLength(IUOPosition start, IUOPosition position) { int x; int y; GetRelativeCoordinates(start, position, out x, out y); //UO.Print("{0}, {1}, {2}, {3}, {4}, {5}", x, y, position.X, position.Y, this.X, this.Y); return(Robot.GetVectorLength(x, y)); }
//--------------------------------------------------------------------------------------------- public ushort Distance(IUOPosition positionFrom) { int distance = Math.Max(Math.Abs(positionFrom.X.GetValueOrDefault() - this.X.GetValueOrDefault()), Math.Abs(positionFrom.Y.GetValueOrDefault() - this.Y.GetValueOrDefault())); if (distance < 0) { distance = 0; } return((ushort)distance); }
//--------------------------------------------------------------------------------------------- public IUOPosition CreatePositionInstance(ushort x, ushort y, ushort z) { IUOPosition instance = Activator.CreateInstance(this.PositionType) as IUOPosition; instance.X = x; instance.Y = y; instance.Z = z; return(instance); }
private void GoHomeAtJelom() { Robot robot = new Robot(); IUOPosition test = robot.CreatePositionInstance(1389, 3856, 0); robot.GoTo(test); UO.UseObject(door_home); UO.Wait(500); test = robot.CreatePositionInstance(1389, 3855, 0); robot.GoTo(test); UO.UseObject(door_home); test = robot.CreatePositionInstance(1385, 3849, 0); robot.GoTo(test); }
//--------------------------------------------------------------------------------------------- public bool GoToSimple(ushort x, ushort y, int fromDistance) { bool result = true; IUOPosition destination = this.CreatePositionInstance(x, y, 0); while (!this.ActualPosition.Equals(destination) && Robot.GetRelativeVectorLength(this.ActualPosition, destination) > fromDistance) { result = this.Move(GetMovementDirection(this.GetAngle(destination))); if (!result) { break; } } return(result); }
//--------------------------------------------------------------------------------------------- public static bool LookingDirectlyAt(IUOPosition a, IUOPosition b, byte direction) { double angle = GetAngle(a, b); Dictionary <byte, double> transform = new Dictionary <byte, double>(); transform.Add(0, 180); transform.Add(1, 135); transform.Add(2, 90); transform.Add(3, 45); transform.Add(4, 0); transform.Add(5, 315); transform.Add(6, 270); transform.Add(7, 225); return(transform[direction] == Math.Round(angle, 10)); }
public UOPositionCollection SortByDistanceToPosition(IUOPosition positionFrom) { UOPositionCollection sortedCol = new UOPositionCollection(); sortedCol.AddRange(this.ToArray()); sortedCol.Sort(delegate(UOPosition a, UOPosition b) { double distanceA = Robot.GetRelativeVectorLength(positionFrom, a); double distanceB = Robot.GetRelativeVectorLength(positionFrom, b); return(distanceA.CompareTo(distanceB)); }); return(sortedCol); }
//--------------------------------------------------------------------------------------------- // 1371 2712.0 Flags: 0x0000 Color: 0x038A Model: 0x0190 Renamable: False Notoriety: Neutral HP: -1/-1 //Tile X=1371 Y=2713 Z=0 Graphic=0x053E Name=cave floor //Tile X=1372 Y=2713 Z=0 Graphic=0x053F Name=cave floor //Tile X=1372 Y=2712 Z=0 Graphic=0x053E Name=cave floor //Tile X=1372 Y=2711 Z=0 Graphic=0x053E Name=cave floor //Tile X=1371 Y=2711 Z=0 Graphic=0x053D Name=cave floor //Tile X=1370 Y=2711 Z=0 Graphic=0x053D Name=cave floor //Tile X=1370 Y=2712 Z=0 Graphic=0x053F Name=cave floor //Tile X=1370 Y=2713 Z=0 Graphic=0x053F Name=cave floor /* * x0,y+1,a0 * x+1,y+1,a45 * x+1,y0,a90 * x+1,y-1,a135 * x0,y-1,a180 * x-1,y-1,a225 * x-1,y0,a270 * x-1,y+1,a315 */ //--------------------------------------------------------------------------------------------- public static double GetNextCoordinates(double angle, IUOPosition fromPosition, out IUOPosition nextPosition) { ushort nextX; ushort nextY; double nextAngle = GetNextCoordinates(angle, fromPosition.X.Value, fromPosition.Y.Value, out nextX, out nextY); if (nextAngle > -1) { nextPosition = new UOPositionBase(nextX, nextY, 0); } else { nextPosition = null; } return(nextAngle); }
public UOPositionCollection SortByOptimalTrack(IUOPosition positionFrom) { IUOPosition last = positionFrom; UOPositionCollection sortedCol = new UOPositionCollection(); for (int i = 0; i < this.Count; i++) { UOPositionCollection search = this.SortByDistanceToPosition(last); if (search.Count > 0) { foreach (UOPosition pos in search) { if (!sortedCol.Contains(pos)) { sortedCol.Add(pos); last = pos; break; } } } } return(sortedCol); }
public UOCharacter SearchNextTarget(IUOPosition center, Notoriety[] notorities, int resetTimer, bool useDoneList) { UOCharacter result = new UOCharacter(Serial.Invalid); bool isReset = false; if (resetTimer > 0 && (DateTime.Now - lastSearch).TotalMilliseconds >= resetTimer) { if (useDoneList) { searchDoneList = new List <uint>(); } isReset = true; } lastSearch = DateTime.Now; List <UOCharacter> list = new List <UOCharacter>(); list.AddRange(World.Characters.Where(i => i.GetDistance() <= 25 && i.Serial != World.Player.Serial && (i.Notoriety == Notoriety.Murderer || i.Notoriety == Notoriety.Enemy) && notorities.Where(n => n == i.Notoriety).Count() > 0 && !Game.CurrentGame.IsAlie(i.Serial) && !Characters.IsSummon(i)).OrderBy(i => i.GetDistance(center)).ThenBy(i => i.Hits).ToList()); list.AddRange(World.Characters.Where(i => i.GetDistance() <= 25 && i.Serial != World.Player.Serial && i.Notoriety == Notoriety.Neutral && notorities.Where(n => n == i.Notoriety).Count() > 0 && !Game.CurrentGame.IsAlie(i.Serial) && !Characters.IsSummon(i)).OrderBy(i => i.GetDistance(center)).ThenBy(i => i.Hits).ToList()); list.AddRange(World.Characters.Where(i => i.GetDistance() <= 25 && i.Serial != World.Player.Serial && (i.Notoriety == Notoriety.Guild || i.Notoriety == Notoriety.Innocent) && notorities.Where(n => n == i.Notoriety).Count() > 0 && !Game.CurrentGame.IsAlie(i.Serial) && !Characters.IsSummon(i)).OrderBy(i => i.GetDistance(center)).ThenBy(i => i.Hits).ToList()); if (useDoneList && list.Where(i => !searchDoneList.Contains(i.Serial)).ToList().Count > 0) { result = list.Where(i => !searchDoneList.Contains(i.Serial)).ToList()[0]; } else { if (useDoneList) { searchDoneList = new List <uint>(); } isReset = true; if (list.Count > 0) { result = list[0]; } } if (useDoneList && result.ExistCust()) { searchDoneList.Add(result.Serial); } if (list.Count > 1) { if (Game.Debug) { for (int i = 1; i < Math.Min(3, list.Count); i++) { list[i].PrintHitsMessage("[" + i + "]"); } } } if (isReset && Game.Debug) { Game.PrintMessage("TargetNext - Reset"); } return(result); }
public UOCharacter SearchNearestEnemy(IUOPosition postion) { return(SearchNextTarget(postion, new Notoriety[] { Notoriety.Enemy, Notoriety.Murderer, Notoriety.Neutral, Notoriety.Guild }, -1, false)); }
//--------------------------------------------------------------------------------------------- public void Lumber() { int iteration = 0; World.Player.RequestStatus(1000); World.Player.Click(); Game.Wait(); bool doLumber = this.GoToNext(); while (doLumber) { UO.Print("doLumber" + iteration); iteration++; UO.Print("doLumber" + lastPositionIndex + " / " + this.Trees.Count); IUOPosition current = this.Trees[lastPositionIndex]; UOItem myDeadBody = this.MyDeadBody(); bool dead = UO.Dead; bool returnToLast = false; bool goToNext = false; bool trainForensic = this.MaxForensicSkill > 0 && !dead && myDeadBody != null && myDeadBody.Exist; this.LastPosition = new UOPosition(World.Player.X, World.Player.Y, 0); UO.DeleteJournal(); if (Game.CurrentGame.WorldSave()) { Game.Wait(30000); if (!dead) { Nastroj.Move(1, World.Player.Backpack); Game.Wait(500); Nastroj.Click(); } Game.Wait(); if (World.Player.Backpack.AllItems.FindType(0x0FF0).Exist) { World.Player.Backpack.AllItems.FindType(0x0FF0).Move(1, World.Player.Backpack);//Sychr test na zasek Game.Wait(); } if (myDeadBody != null && myDeadBody.Exist) { myDeadBody.Click(); } } if (this.EnableVisitorInfo) { VisitorInfo visitor; if (this.NavstevnikHandle(out visitor).Result == ActionResult.Continue) { continue; } if (visitor != null && UO.Dead && visitor.LastVisit != null) { visitor.LastVisit.ZabilMe = true; } } if (World.Player.Warmode) { World.Player.ChangeWarmode(WarmodeChange.Peace); } if (dead) { Game.Wait(60000); this.BezSeResnout(); this.BezLast(); this.VylotSiTelo(); continue; } if (World.Player.Backpack.AllItems.FindType(LogGraphic, 0x0979).Amount >= 3 || World.Player.Backpack.AllItems.FindType(LogGraphic, 0x06D3).Amount >= 2 || World.Player.Backpack.AllItems.FindType(LogGraphic, 0x0972).Amount >= 1 || World.Player.Backpack.AllItems.FindType(LogGraphic, 0x05A6).Amount >= 1 || World.Player.Backpack.AllItems.FindType(LogGraphic, 0x0522).Amount >= 1 ) { this.BezVylozit(); returnToLast = true; } if (this.WeightLimitReached) { this.BezVylozit(); returnToLast = true; } if (!dead && !Nastroj.Exist) { this.BezVylozit(); returnToLast = true; } if (returnToLast) { this.Robot.GoTo(this.LastPosition); } this.VylotSiTelo(); this.DropDeny(); if (trainForensic && SkillsHelper.GetSkillValue("ForensicEvaluation").Value < this.MaxForensicSkill) { Game.Wait(150); UO.Print("Train - ForensicEvaluation"); UO.WaitTargetObject(myDeadBody); UO.UseSkill(StandardSkill.ForensicEvaluation); Journal.WaitForText(true, 2500, "this is body of", "You can tell nothing about the corpse.");// Game.Wait(1500); Game.Wait(150); continue; } StaticTarget target = new StaticTarget(Serial.Invalid, current.X.GetValueOrDefault(), current.Y.GetValueOrDefault(), (sbyte)current.Z.GetValueOrDefault(), TreeGraphic[0]); SekInfo sek = this.SekTree(target); if (sek.Mined || sek.Wrong) { goToNext = true; } this.SeberLogy(); if (goToNext) { this.GoToNext(); } } }
public static List <EnemyInfo> GetEnemyList(List <UOCharacter> chars, IUOPosition center) { List <EnemyInfo> enemyList = new List <EnemyInfo>(); foreach (UOCharacter ch in chars)//World.Characters) { if (Game.CurrentGame.IsAlie(ch.Serial) || Game.CurrentGame.IsHealAlie(ch.Serial)) { continue; } EnemyInfo enemy = new EnemyInfo(); enemy.Char = ch; enemy.Damage = (ch.MaxHits - ch.Hits); enemy.Perc = (((decimal)(ch.MaxHits - ch.Hits) / (decimal)ch.MaxHits) * 100.0m) / (decimal)ch.MaxHits; enemy.DamagePerc = ((decimal)(ch.MaxHits - ch.Hits) / (decimal)ch.MaxHits) * 100.0m; enemy.Distance = Robot.GetRelativeVectorLength(center, UOPositionBase.CharacterPosition(ch)); if (enemy.Distance <= 5) { enemy.Zone = 0; } else if (enemy.Distance <= 10) { enemy.Zone = 1; } else if (enemy.Distance <= 15) { enemy.Zone = 2; } else { enemy.Zone = 3; } if (String.IsNullOrEmpty(ch.Name)) { ch.Click(); UO.Wait(100); } if ((String.Empty + ch.Name).ToLower().Contains("mirror") && ch.MaxHits >= 255) { enemy.Priority = 100; } else if ((String.Empty + ch.Name).ToLower().Contains("chameleon")) { enemy.Priority = ch.MaxHits; } else if ((String.Empty + ch.Name).ToLower().Contains("lethargy")) { enemy.Priority = ch.MaxHits; } else if ((String.Empty + ch.Name).ToLower().Contains("lethargy")) { enemy.Priority = ch.MaxHits; } else if ((String.Empty + ch.Name).ToLower().Contains("acid ooze")) { enemy.Priority = ch.MaxHits; } else if ((String.Empty + ch.Name).ToLower().Contains("bird")) { enemy.Priority = ch.MaxHits - 100; } if (enemy.Char.Notoriety == Notoriety.Enemy || enemy.Char.Notoriety == Notoriety.Murderer) { enemy.Priority += 1000; } enemyList.Add(enemy); } return(enemyList); }
//--------------------------------------------------------------------------------------------- private bool TryGoTo(ushort x, ushort y, int fromDistance, int tries, PathNodeList localList) { IUOPosition destination = this.CreatePositionInstance(x, y, 0); if (localList == null) { localList = new PathNodeList(); } if (EnableLog) { Game.PrintMessage("TryGoTo : " + x + ", " + y + " - " + tries); } if (this.ActualPosition.Equals(destination) || Robot.GetRelativeVectorLength(this.ActualPosition, destination) <= fromDistance) { if (EnableLog) { Game.PrintMessage("TryGoTo OK - 1: " + x + ", " + y); } return(true); } PathNode start = new PathNode() { X = World.Player.X, Y = World.Player.Y }; PathNode end = new PathNode() { X = x, Y = y }; if (tries > 0) { using (PathBuilder builder = new PathBuilder(UseCachedPathList ? this.PossibleNodes : localList)) { if (builder.ComputePath(start, end, fromDistance)) { PathNodeList computedPath = new PathNodeList(); computedPath.AddRange(builder.ComputedPathNodes); computedPath.Reverse(); if (EnableLog) { Game.PrintMessage("TryGoTo Found: " + x + ", " + y + " / " + builder.Searchs); } int step = 0; foreach (PathNode node in computedPath) { step++; IUOPosition pos = this.CreatePositionInstance(node.X, node.Y, x); GotoStepArgs args = new GotoStepArgs(pos, tries, fromDistance); if (this.BeforeMove != null) { this.BeforeMove(this, args); } bool moveFail = false; if (args.Abort) { Game.PrintMessage("TryGoTo Abort " + destination); return(false); } if (args.IvalidDestination) { if (EnableLog) { Game.PrintMessage("Path IvalidDestination: " + this.ActualPosition.ToString() + " to " + node.ToString()); } moveFail = true; } else { if (!this.Move(GetMovementDirection(this.GetAngle(pos)))) { if (!this.Move(GetMovementDirection(this.GetAngle(pos)))) { moveFail = true; } } } if (moveFail) { if (EnableLog) { Game.PrintMessage("PathFail: " + this.ActualPosition.ToString() + " to " + node.ToString()); } PathNode findNode = builder.PossibleNodes.FindNode(node.X, node.Y); if (findNode != null && !findNode.Walkable.HasValue) { findNode.Walkable = false; } return(TryGoTo(x, y, fromDistance, --tries, localList)); } if (this.AfterMoveSuccess != null) { this.AfterMoveSuccess(this, new GotoStepArgs(pos, tries, fromDistance)); } if (args.Abort) { return(false); } } // 09:44 Phoenix: TryGoTo: 1380, 2706 - 459 //09:44 Phoenix: Compute Path FAIL: 1380,2707 to 1380,2706 //09:44 Phoenix: TryGoTo END: 1380, 2706 if (this.ActualPosition.Equals(destination) || Robot.GetRelativeVectorLength(this.ActualPosition, destination) <= fromDistance) { if (EnableLog) { Game.PrintMessage("TryGoTo OK - 2: " + x + ", " + y); } this.OnGoToSuccess(this, EventArgs.Empty); return(true); } else { return(TryGoTo(x, y, fromDistance, --tries, localList)); } } else { if (EnableLog) { Game.PrintMessage("Compute Path FAIL - Restart: " + start.ToString() + " to " + end.ToString()); } return(TryGoTo(x, y, fromDistance, --tries, null)); } } } if (EnableLog) { Game.PrintMessage("TryGoTo END: " + x + ", " + y); } return(false); }
//--------------------------------------------------------------------------------------------- public static double GetDistance(this UOObject obj, IUOPosition positionFrom) { return(Robot.GetRelativeVectorLength(positionFrom, obj.GetPosition())); }
//--------------------------------------------------------------------------------------------- public double RealDistance(IUOPosition positionFrom) { return(Robot.GetRelativeVectorLength(positionFrom, this)); }
//--------------------------------------------------------------------------------------------- public double GetAngle(IUOPosition destination) { return(GetAngle(this.ActualPosition, destination)); }
public GotoStepArgs(IUOPosition destination, int tries, int fromDistance) { this.Destination = destination; this.Tries = tries; this.FromDistance = fromDistance; }
//--------------------------------------------------------------------------------------------- public bool GoToSimple(IUOPosition position, int fromDistance) { return(this.GoToSimple((ushort)position.X, (ushort)position.Y, fromDistance)); }
//--------------------------------------------------------------------------------------------- public bool GoToSimple(IUOPosition position) { return(this.GoToSimple(position, 0)); }
public static void CastWallOfIron(string target, int sizeL, int sizeR, string direction) { //if (!AdaHammer.Exist) //{ // World.Player.PrintMessage("[Neni adahammer..]", MessageType.Error); // return; //} World.Player.PrintMessage("[WoI " + (sizeL + sizeR + 1) + "...]", Game.Val_GreenBlue); TargetInfo targetInfo = Targeting.GetTarget(target); if (targetInfo.Success) { IUOPosition startPostion = targetInfo.Position; //direction //SN //WE List <IUOPosition> positions = new List <IUOPosition>(); positions.Add(startPostion);; double angle = Robot.GetAngle(World.Player.GetPosition(), startPostion); if (String.IsNullOrEmpty(direction)) { if (angle <= 45) { direction = "WE"; } else if (angle < 135) { direction = "SN"; } else if (angle <= 225) { direction = "WE"; } else if (angle < 315) { direction = "SN"; } else { direction = "WE"; } } Game.PrintMessage(String.Format(direction + " [" + targetInfo.StaticTarget.X + ":" + targetInfo.StaticTarget.Y + "] {0:N4}", angle) + ""); if (direction == "WE") { for (int i = 1; i <= sizeL; i++) { positions.Add(new UOPositionBase((ushort)(startPostion.X - 1), (ushort)(startPostion.Y), startPostion.Z.Value)); } for (int i = 1; i <= sizeR; i++) { positions.Add(new UOPositionBase((ushort)(startPostion.X + 1), (ushort)(startPostion.Y), startPostion.Z.Value)); } } else { for (int i = 1; i <= sizeL; i++) { positions.Add(new UOPositionBase((ushort)(startPostion.X), (ushort)(startPostion.Y + 1), startPostion.Z.Value)); } for (int i = 1; i <= sizeR; i++) { positions.Add(new UOPositionBase((ushort)(startPostion.X), (ushort)(startPostion.Y - 1), startPostion.Z.Value)); } } positions = positions.Where(p => p.Distance() <= 3).OrderByDescending(p => p.Distance()).ToList(); DateTime start = DateTime.Now; World.FindDistance = 6; List <UOItem> ground = World.Ground.Where(i => i.Distance <= 5).ToList(); List <UOItem> groundIngots = new List <UOItem>(); foreach (IUOPosition p in positions) { bool done = false; // UOItem ingot = null; foreach (UOItem g in ground) { if (g.X == p.X && g.Y == p.Y) { if (g.Graphic == IronIngot.Graphic && g.Color == IronIngot.Color && g.Amount == 10) { //ingot = g; groundIngots.Add(g); done = true; break; } if (g.Graphic == IronWall.Graphic && g.Color == IronWall.Color)//todo color { done = true; break; } } } if (!done) { UOItem ingots = World.Player.Backpack.AllItems.FindType(IronIngot.Graphic, IronIngot.Color); if (ingots.Amount >= 10 && ingots.Move((ushort)10, p.X.Value, p.Y.Value, (sbyte)p.Z.Value)) { //ingot = ingots; groundIngots.Add(ingots); Game.Wait(50); } } } foreach (UOItem ingot in groundIngots) { if (ingot != null && AdaHammer.Exist) { UO.WaitTargetObject(ingot); AdaHammer.Use(); Game.Wait(125); } } World.Player.PrintMessage("Move: " + (DateTime.Now - start).TotalMilliseconds); start = DateTime.Now; } }
//--------------------------------------------------------------------------------------------- public static double GetRealDistance(IUOPosition start, IUOPosition position) { return(Math.Max(Math.Abs(start.X.GetValueOrDefault() - position.X.GetValueOrDefault()), Math.Abs(start.Y.GetValueOrDefault() - position.Y.GetValueOrDefault()))); }
//--------------------------------------------------------------------------------------------- public static void GetRelativeCoordinates(IUOPosition start, IUOPosition position, out int x, out int y) { GetRelativeCoordinates(start.X.Value, start.Y.Value, position.X.Value, position.Y.Value, out x, out y); }
//--------------------------------------------------------------------------------------------- public static List <UOCharacter> GetEnemiesByDistance(int maxDistance, IUOPosition pos) { return(GetEnemiesByDistance(maxDistance, false, pos)); }
//--------------------------------------------------------------------------------------------- private void UpdatePositionAndDirection() { if (this.StatusType != StatusType.Player) { string sufix = "-"; double distance = 0; if (mobile.ExistCust() && mobile.Hits > -1) { lastPositon = mobile.GetPosition(); } distance = Robot.GetRealDistance(World.Player.GetPosition(), lastPositon); lastPositionAngle = Robot.GetAngle(World.Player.GetPosition(), lastPositon); MovementDirection direction = Robot.GetMovementDirection(lastPositionAngle); if (direction == MovementDirection.Up) { sufix = "↑"; } else if (direction == MovementDirection.UpRight) { sufix = "↗"; } else if (direction == MovementDirection.Right) { sufix = "→"; } else if (direction == MovementDirection.DownRight) { sufix = "↘"; } else if (direction == MovementDirection.Down) { sufix = "↓"; } else if (direction == MovementDirection.DownLeft) { sufix = "↙"; } else if (direction == MovementDirection.Left) { sufix = "←"; } else if (direction == MovementDirection.UpLeft) { sufix = "↖"; } Color c = Color.Transparent; if (distance <= 1) { c = Color.FromArgb(0, 128, 255); } else if (distance <= 5) { c = Color.FromArgb(0, 191, 255); } else if (distance <= 10) { c = Color.FromArgb(0, 255, 255); } else if (distance <= 15) { c = Color.FromArgb(0, 255, 191); } else if (distance > 15) { c = Color.FromArgb(0, 255, 128); } this.runLabel.BackColor = c; if (distance > 99 || distance < 0) { distance = 0; } //-/|\---↖↗↘↙↑← →↓ string runLabelText = String.Format("{0:N0}", distance); runLabelText += " " + sufix; this.runLabel.Text = runLabelText; this.runLabel.Invalidate(); } }
//--------------------------------------------------------------------------------------------- public static List <UOCharacter> GetEnemiesByDistance(int maxDistance, bool useDistanceCircles, IUOPosition pos) { List <UOCharacter> enemies = new List <UOCharacter>(); if (pos == null) { pos = UOPositionBase.PlayerPosition; } int distance5 = 0; int distance10 = 0; int enemyDistance = maxDistance; List <UOCharacter> chars = CharactersByDistance; foreach (UOCharacter character in chars) { if ( character.Serial != World.Player.Serial && Robot.GetRelativeVectorLength(pos, UOPositionBase.CharacterPosition(character)) <= maxDistance && // character.Distance < maxDistance && Array.IndexOf(EnemyFilter, character.Notoriety) >= 0 && !Game.CurrentGame.IsAlie(character.Serial) && !Game.CurrentGame.IsHealAlie(character.Serial) && !IsSummon(character) ) { if (character.Distance <= 7) { distance5++; } else if (character.Distance <= 12) { distance10++; } } } if (useDistanceCircles) { if (distance5 > 0) { enemyDistance = 8; } else if (distance10 > 0) { enemyDistance = 13; } } foreach (UOCharacter character in chars) { if ( character.Serial != World.Player.Serial && // character.Distance < enemyDistance && Robot.GetRelativeVectorLength(pos, UOPositionBase.CharacterPosition(character)) <= maxDistance && Array.IndexOf(EnemyFilter, character.Notoriety) >= 0 && !Game.CurrentGame.IsAlie(character.Serial) && !Game.CurrentGame.IsHealAlie(character.Serial) && !IsSummon(character)) { enemies.Add(character); } } return(enemies); }
//--------------------------------------------------------------------------------------------- public static double GetRealDistance(this UOObject obj, IUOPosition positionFrom) { return(Robot.GetRealDistance(positionFrom, obj.GetPosition())); }
//--------------------------------------------------------------------------------------------- public bool GoTo(IUOPosition position, int fromDistance, int tries) { return(this.GoTo((ushort)position.X, (ushort)position.Y, fromDistance, tries)); }