Exemplo n.º 1
0
        public override async Task <bool> OnKilledRiftGaurdian(Message sender, EventData e)
        {
            if (e.IsLeaderEvent)
            {
                Log.Warn("{0} killed a rift gaurdian", e.OwnerHeroAlias);

                if (GameUI.ReviveAtCheckpointButton.IsVisible && GameUI.ReviveAtCheckpointButton.IsEnabled)
                {
                    GameUI.ReviveAtCheckpointButton.Click();
                    await Coroutine.Sleep(3000);
                }

                var timeout = DateTime.UtcNow + TimeSpan.FromSeconds(8);
                while (Player.IsDead && DateTime.UtcNow < timeout)
                {
                    await Coroutine.Sleep(250);

                    await Coroutine.Yield();
                }

                await Coordination.TeleportToRiftGaurdianLoot(sender);

                return(true);
            }
            return(false);
        }