Beispiel #1
0
        /// <summary>
        /// Run adventurer Gem Upgrade coroutine
        /// </summary>
        public static async Task <bool> UpgradeGems()
        {
            if (DateTime.UtcNow.Subtract(LastRequestedGemUpgrade).TotalSeconds < 10)
            {
                return(false);
            }

            if (RiftHelper.IsInRift && RiftHelper.RiftQuest.Step == RiftQuest.RiftStep.UrshiSpawned && RiftHelper.IsCompleted)
            {
                if (AutoFollow.CurrentLeader.Distance > 150f)
                {
                    await Coordination.TeleportToPlayer(AutoFollow.CurrentLeader);
                }

                Log.Warn("Rift is Completed.");

                while (await _gemUpgrader.GetCoroutine() == false && !Player.IsDead)
                {
                    await Coroutine.Yield();
                }

                _gemUpgrader.Reset();

                await Coroutine.Sleep(5000);

                LastRequestedGemUpgrade = DateTime.UtcNow;
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        /// <summary>
        /// Send out a request to all plugins for someone to handle gem upgrading for us.
        /// </summary>
        public static async Task <bool> UpgradeGems()
        {
            if (DateTime.UtcNow.Subtract(LastRequestedGemUpgrade).TotalSeconds < 15)
            {
                return(false);
            }

            if (RiftHelper.IsInRift && RiftHelper.RiftQuest.Step == RiftQuest.RiftStep.UrshiSpawned && RiftHelper.CurrentRift.IsCompleted)
            {
                if (AutoFollow.CurrentLeader.Distance > 30f)
                {
                    Log.Warn("Rift is Completed; telport to the leader");
                    await Coordination.TeleportToPlayer(AutoFollow.CurrentLeader, false);

                    await Coroutine.Sleep(3000);
                }

                Log.Warn("Rift is Completed; requesting gem upgrade from other plugins.");
                PluginCommunicator.BroadcastGemUpgradRequest();
                await Coroutine.Sleep(5000);

                LastRequestedGemUpgrade = DateTime.UtcNow;
                return(true);
            }

            return(false);
        }
Beispiel #3
0
        /// <summary>
        /// If we're in a different world to the leader, teleport to him.
        /// </summary>
        public static async Task <bool> TeleportWhenInDifferentWorld(Message player)
        {
            if (player.WorldSnoId <= 0 || Player.CurrentWorldSnoId <= 0)
            {
                return(false);
            }

            if (Player.IsInTown && BrainBehavior.IsVendoring)
            {
                return(false);
            }

            if ((RiftHelper.IsInRift || player.IsInRift) && RiftHelper.IsGreaterRiftStarted)
            {
                return(false);
            }

            if (Player.IsFollower && player.WorldSnoId != Player.CurrentMessage.WorldSnoId && player.IsInSameGame && !player.IsInCombat)
            {
                await Coordination.TeleportToPlayer(player);

                return(true);
            }
            return(false);
        }
Beispiel #4
0
        /// <summary>
        /// If we're too far away from the leader, teleport to him.
        /// </summary>
        public static async Task <bool> TeleportWhenTooFarAway(Message playerMessage)
        {
            if (RiftHelper.IsInGreaterRift || Player.IsInBossEncounter || playerMessage.IsInBossEncounter)
            {
                return(false);
            }

            if (Player.IsFollower && playerMessage.WorldSnoId == Player.CurrentMessage.WorldSnoId && playerMessage.IsInSameGame &&
                !playerMessage.IsInCombat && playerMessage.Distance > Settings.Coordination.TeleportDistance)
            {
                Log.Info("{0} is getting quite far away... attempting teleport!", playerMessage.HeroName);
                await Coordination.TeleportToPlayer(playerMessage);

                return(true);
            }

            return(false);
        }