示例#1
0
 public static async Task MoveAndWait(WalkablePosition pos, string log = null, int distance = 20)
 {
     if (pos.Distance > distance)
     {
         pos.Come();
     }
     else
     {
         GlobalLog.Debug(log ?? $"Waiting for {pos.Name}");
         await Wait.StuckDetectionSleep(200);
     }
 }
示例#2
0
        public static async Task <bool> KillKitava()
        {
            if (World.Act10.FeedingTrough.IsCurrentArea)
            {
                UpdateKitavaFightObjects();

                if (KitavaWalkablePos.PathExists)
                {
                    if (await Helpers.StopBeforeBoss(Settings.BossNames.Kitava2))
                    {
                        return(true);
                    }

                    if (_kitavaHeart != null && _kitavaHeart.IsTargetable)
                    {
                        await Helpers.MoveAndWait(_kitavaHeart.WalkablePosition());

                        return(true);
                    }
                    if (_kitava != null)
                    {
                        if (_kitava.IsDead)
                        {
                            await Wait.For(() => World.Act11.Oriath.IsCurrentArea, "Waiting for Kitava fight ending", 500, 7000);

                            return(false);
                        }
                        if (!_kitava.IsActive)
                        {
                            await Helpers.MoveAndWait(KitavaWalkablePos, "Waiting for Kitava, the Insatiable");
                        }
                        else
                        {
                            KitavaWalkablePos.Come();
                        }
                    }
                    return(true);
                }
                if (_sin != null && _sin.IsTargetable && _sin.HasNpcFloatingIcon)
                {
                    var pos = _sin.WalkablePosition();
                    if (pos.IsFar)
                    {
                        pos.Come();
                    }
                    else
                    {
                        await Helpers.TalkTo(_sin);
                    }
                    return(true);
                }
                await Helpers.MoveAndTakeLocalTransition(KivataRoomTgt);

                return(true);
            }

            if (World.Act11.Oriath.IsCurrentArea)
            {
                return(false);
            }

            await Travel.To(World.Act10.FeedingTrough);

            return(true);
        }