Пример #1
0
        public static void PlayerDied(EntityAlive __instance)
        {
            ClientInfo cInfo = PersistentOperations.GetClientInfoFromEntityId(__instance.entityId);

            if (cInfo != null)
            {
                string id = cInfo.CrossplatformId.CombinedString;
                if (__instance.AttachedToEntity != null)
                {
                    __instance.Detach();
                }
                if (Died.IsEnabled)
                {
                    Died.PlayerKilled(__instance);
                }
                if (ProcessDamage.lastEntityKilled == cInfo.entityId)
                {
                    ProcessDamage.lastEntityKilled = 0;
                }
                if (Bloodmoon.IsEnabled && Bloodmoon.Show_On_Respawn)
                {
                    Bloodmoon.Exec(cInfo);
                }
                if (Event.Open && Event.Teams.ContainsKey(id))
                {
                    Event.Respawn(cInfo);
                }
                if (PersistentContainer.Instance.Players[id].EventOver)
                {
                    Event.EventOver(cInfo);
                }
                if (Hardcore.IsEnabled && PersistentContainer.Instance.Players[id].HardcoreEnabled)
                {
                    Hardcore.Check(cInfo, (EntityPlayer)__instance);
                }
                if (Zones.ZonePlayer.ContainsKey(cInfo.entityId))
                {
                    Zones.ZonePlayer.Remove(cInfo.entityId);
                }
                if (PlayerChecks.TwoSecondMovement.ContainsKey(cInfo.entityId))
                {
                    PlayerChecks.TwoSecondMovement.Remove(cInfo.entityId);
                }
                if (FlyingDetector.Flags.ContainsKey(cInfo.entityId))
                {
                    FlyingDetector.Flags.Remove(cInfo.entityId);
                }
                if (SpeedDetector.Flags.ContainsKey(cInfo.entityId))
                {
                    SpeedDetector.Flags.Remove(cInfo.entityId);
                }
            }
        }