Exemplo n.º 1
0
        public static void Prefix(byte amount, Vector3 newRagdoll, EDeathCause newCause, ELimb newLimb, CSteamID newKiller, ref EPlayerKill kill, bool trackKill, ERagdollEffect newRagdollEffect, bool canCauseBleeding, PlayerLife __instance)
        {
            Player ply = __instance.channel.owner.player;
            if (ply is null) return;

            if (amount >= ply.life.health)
            {
                Transform deathboxTransform = BarricadeManager.dropBarricade(new Barricade(1283),ply.transform, ply.transform.position, 0f, 0f, 0f, (ulong) ply.channel.owner.playerID.steamID, 0UL);
                byte x;
                byte y;
                ushort plant;
                ushort index;
                BarricadeRegion region;

                if (!BarricadeManager.tryGetInfo(deathboxTransform, out x, out y, out plant, out index, out region)) return;

                InteractableStorage storage = deathboxTransform.GetComponent<InteractableStorage>();
                storage.items.resize(10, 10);

                for (byte page = 0; page < 6; page++)
                {
                    for (byte i = 0; i < ply.inventory.items[page].getItemCount(); i++)
                    {
                        ItemJar item = ply.inventory.items[page].getItem(i);
                        storage.items.tryAddItem(item.item);
                    }
                }
                TTTPlayer.ClearInventoryUnsafe(__instance.channel.owner); // Clears clothing to prevent players aqquiring detective vest ect.
            }
        }
Exemplo n.º 2
0
        private void OnEnemyConnected(SteamPlayer steamPlayer)
        {
            TTTPlayer.ClearInventoryUnsafe(steamPlayer);
            steamPlayer.player.interact.sendSalvageTimeOverride(16f);
            Player ply = steamPlayer.player;

            ply.life.serverModifyHealth(100.0f); // Change this
            ply.life.serverModifyStamina(100.0f);
        }