public static bool LeadsTo(this AreaTransition a, AreaInfo area)
        {
            if (a.TransitionType == TransitionTypes.Local)
            {
                return(false);
            }

            var dest = a.Components.AreaTransitionComponent?.Destination;

            return(dest != null && dest == area);
        }
Example #2
0
        public static async Task <bool> TakeWaypoint(AreaInfo area, bool newInstance = false)
        {
            if (!LokiPoe.InGameState.WorldUi.IsOpened)
            {
                if (!await OpenWaypoint())
                {
                    GlobalLog.Error("[TakeWaypoint] Fail to open a waypoint.");
                    return(false);
                }
            }

            GlobalLog.Debug($"[TakeWaypoint] Now going to take a waypoint to {area}");

            var areaHash = LokiPoe.LocalData.AreaHash;

            var err = LokiPoe.InGameState.WorldUi.TakeWaypoint(area.Id, newInstance);

            if (err != LokiPoe.InGameState.TakeWaypointResult.None)
            {
                GlobalLog.Error($"[TakeWaypoint] Fail to take a waypoint to {area}. Error: \"{err}\".");
                return(false);
            }
            return(await Wait.ForAreaChange(areaHash));
        }
        public static bool LeadsTo(this Portal p, AreaInfo area)
        {
            var dest = p.Components.PortalComponent?.Area;

            return(dest != null && dest == area);
        }