Example #1
0
        public static async Task <bool> OpenWaypoint()
        {
            WalkablePosition wpPos;

            if (World.CurrentArea.IsTown)
            {
                wpPos = StaticPositions.GetWaypointPosByAct();
            }
            else
            {
                var wpObj = LokiPoe.ObjectManager.Waypoint;
                if (wpObj == null)
                {
                    GlobalLog.Error("[OpenWaypoint] Fail to find any Waypoint nearby.");
                    return(false);
                }
                wpPos = wpObj.WalkablePosition();
            }

            await EnableAlwaysHighlight();

            await wpPos.ComeAtOnce();

            if (!await Interact(LokiPoe.ObjectManager.Waypoint, () => LokiPoe.InGameState.WorldUi.IsOpened, "wold panel opening"))
            {
                return(false);
            }

            await Wait.SleepSafe(200);

            return(true);
        }