public override void DoThings() { if (WaypointQueue.Count > 0) { base.DoThings(); } Unit unitToLoot = AmeisenDataHolder.LootableUnits.Peek(); double distance = Utils.GetDistance(Me.pos, unitToLoot.pos); if (distance > 3) { if (!WaypointQueue.Contains(unitToLoot.pos)) { WaypointQueue.Enqueue(unitToLoot.pos); } } else { AmeisenCore.TargetGUID(unitToLoot.Guid); AmeisenCore.LuaDoString("InteractUnit(\"target\");"); Thread.Sleep(1000); // We should have looted it by now based on the event AmeisenDataHolder.LootableUnits.Dequeue(); } }
private void GoToCorpseAndRevive() { Vector3 corpsePosition = AmeisenCore.GetCorpsePosition(); corpsePosition.X = (int)corpsePosition.X; corpsePosition.Y = (int)corpsePosition.Y; corpsePosition.Z = (int)corpsePosition.Z; if (InstanceEntrances.ContainsKey(corpsePosition)) { // Dungeon/Raid workaround // because blizzard decided to put the corpse at very low Z axis values that // we cant navigate to them, so we are going to use the position of the entrance instead corpsePosition = InstanceEntrances[corpsePosition]; } if (corpsePosition.X != 0 && corpsePosition.Y != 0 && corpsePosition.Z != 0) { if (!WaypointQueue.Contains(corpsePosition)) { WaypointQueue.Enqueue(corpsePosition); } } if (Utils.GetDistance(Me.pos, corpsePosition) < 4.0) { AmeisenCore.RetrieveCorpse(true); } }
private void HandleMovement(Vector3 pos) { Me.Update(); if (!WaypointQueue.Contains(pos)) { WaypointQueue.Enqueue(pos); } }
private void GoToUnitAndRepair(RememberedUnit closestUnit) { Me.Update(); if (Utils.GetDistance(Me.pos, closestUnit.Position) < 3) { SellTrashAtUnit(closestUnit); } else { if (!WaypointQueue.Contains(closestUnit.Position)) { WaypointQueue.Enqueue(closestUnit.Position); } } }
public override void DoThings() { if (WaypointQueue.Count > 0) { // Do the movement stuff base.DoThings(); Thread.Sleep(100); return; } RefreshActiveUnit(); Me?.Update(); ActiveUnit?.Update(); if (Me == null || ActiveUnit == null) { return; } /*Vector3 posToMoveTo = ActiveUnit.pos; * posToMoveTo = CalculateMovementOffset( * posToMoveTo, * GetFollowAngle( * GetPartymemberCount(), * GetMyPartyPosition()), * AmeisenDataHolder.Settings.followDistance);*/ //AmeisenMovementEngine.MemberCount = GetPartymemberCount(); Vector4 targetPos = AmeisenMovementEngine.GetPosition( new Vector4(ActiveUnit.pos.X, ActiveUnit.pos.Y, ActiveUnit.pos.Z, ActiveUnit.Rotation), AmeisenDataHolder.Settings.followDistance / 10, GetMyPartyPosition()); Vector3 posToMoveTo = new Vector3(targetPos.X, targetPos.Y, targetPos.Z); // When we are far enough away, follow if (WaypointQueue.Count == 0) { if (Utils.GetDistance(Me.pos, ActiveUnit.pos) > AmeisenDataHolder.Settings.followDistance) { if (!WaypointQueue.Contains(posToMoveTo)) { WaypointQueue.Enqueue(posToMoveTo); } } } }
private void GoToCorpseAndRevive() { Vector3 corpsePosition = AmeisenCore.GetCorpsePosition(); if (corpsePosition.X != 0 && corpsePosition.Y != 0 && corpsePosition.Z != 0) { if (!WaypointQueue.Contains(corpsePosition)) { WaypointQueue.Enqueue(corpsePosition); } } if (Utils.GetDistance(Me.pos, corpsePosition) < 10.0) { AmeisenCore.RetrieveCorpse(true); } }