Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        private void HandleMovement(Vector3 pos)
        {
            Me.Update();

            if (!WaypointQueue.Contains(pos))
            {
                WaypointQueue.Enqueue(pos);
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Process a path by adding all nodes to the QaypointQueue
 /// 
 /// will set PathCalculated to true
 /// </summary>
 /// <param name="path">path to process</param>
 private void ProcessPath(List<Node> path)
 {
     AmeisenLogger.Instance.Log(LogLevel.DEBUG, "Found path: " + path.ToString(), this);
     foreach (Node node in path)
     {
         Me.Update();
         WaypointQueue.Enqueue(new Vector3(node.Position.X, node.Position.Y, node.Position.Z));
     }
 }
Exemplo n.º 5
0
 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);
         }
     }
 }
Exemplo n.º 6
0
        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);
                    }
                }
            }
        }
Exemplo n.º 7
0
        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);
            }
        }