Beispiel #1
0
        private void HandleDeath(object source, Client client, Client killer)
        {
            AccountUtil.SetPlayerDeath(client, true);
            LevelRanks         levelRanks  = AccountUtil.GetLevelRanks(client);
            LevelRankCooldowns cooldowns   = AccountUtil.GetCooldowns(client);
            DateTime           timeOfDeath = AccountUtil.SetTimeOfDeath(client);

            int downerBonus = 0;

            if (levelRanks.Downer > 0 && cooldowns.IsDownerReady)
            {
                cooldowns.IsDownerReady = false;
                downerBonus             = 5000 * levelRanks.Downer;
                client.SendChatMessage("~r~Downer ~w~You are using your extended downtime for dieing.");
            }

            NotifyPlayersOfDeath(client);

            NAPI.Task.Run(() =>
            {
                if (!AccountUtil.IsPlayerDead(client))
                {
                    return;
                }

                if (timeOfDeath != AccountUtil.GetTimeOfDeath(client))
                {
                    return;
                }

                AccountUtil.SetPlayerDeath(client, false);
            }, 30000 + downerBonus); // 30 Seconds + Bonus
        }