private async Task <bool> IdentifyItems(Game game, MovementMode movementMode)
        {
            var unidentifiedItemCount = game.Inventory.Items.Count(i => !i.IsIdentified) +
                                        game.Cube.Items.Count(i => !i.IsIdentified);

            if (unidentifiedItemCount > 6)
            {
                Log.Information($"Visiting Deckard Cain with {unidentifiedItemCount} unidentified items");
                var deckhardCainCode = NPCHelpers.GetDeckardCainForAct(game.Act);

                var deckardCain     = NPCHelpers.GetUniqueNPC(game, deckhardCainCode);
                var pathDeckardCain = new List <Point>();
                if (deckardCain != null)
                {
                    pathDeckardCain = await _pathingService.GetPathToLocation(game.MapId, Difficulty.Normal, WayPointHelpers.MapTownArea(game.Act), game.Me.Location, deckardCain.Location, movementMode);
                }
                else
                {
                    pathDeckardCain = await _pathingService.GetPathToNPC(game.MapId, Difficulty.Normal, WayPointHelpers.MapTownArea(game.Act), game.Me.Location, deckhardCainCode, movementMode);
                }

                if (!await MovementHelpers.TakePathOfLocations(game, pathDeckardCain, movementMode))
                {
                    Log.Warning($"Client {game.Me.Name} {movementMode} to deckard cain failed at {game.Me.Location}");
                    return(false);
                }

                return(NPCHelpers.IdentifyItemsAtDeckardCain(game));
            }

            return(true);
        }
Example #2
0
 public static async Task <List <Point> > GetPathToNPC(this IPathingService pathingService, Game game, NPCCode NPCCode, MovementMode movementMode)
 {
     return(await pathingService.GetPathToNPC(game.MapId, Difficulty.Normal, game.Area, game.Me.Location, NPCCode, movementMode));
 }