diff --git a/Exiled.API/Features/Map.cs b/Exiled.API/Features/Map.cs index 791dc9a6ad..998b3ad13d 100644 --- a/Exiled.API/Features/Map.cs +++ b/Exiled.API/Features/Map.cs @@ -51,6 +51,7 @@ public static class Map internal static readonly List ToysValue = new(); private static AmbientSoundPlayer ambientSoundPlayer; + private static SqueakSpawner squeakSpawner; /// /// Gets a value indicating whether decontamination has begun in the light containment zone. @@ -99,6 +100,11 @@ public static int Seed /// public static AmbientSoundPlayer AmbientSoundPlayer => ambientSoundPlayer ??= ReferenceHub.HostHub.GetComponent(); + /// + /// Gets the . + /// + public static SqueakSpawner SqueakSpawner => squeakSpawner ??= Object.FindObjectOfType(); + /// /// Broadcasts a message to all players. /// @@ -353,6 +359,19 @@ public static void PlayGunSound(Vector3 position, ItemType firearmType, byte max msg.SendToAuthenticated(); } + /// + /// Spawns mice inside the . + /// + /// The type of mice you want to spawn.. + public static void SpawnMice(byte mice = 1) + { + if (mice > SqueakSpawner.mice.Length) + throw new ArgumentOutOfRangeException($"Mouse type must be between 1 and {SqueakSpawner.mice.Length}."); + + SqueakSpawner.NetworksyncSpawn = mice; + SqueakSpawner.SyncMouseSpawn(0, SqueakSpawner.NetworksyncSpawn); + } + /// /// Clears the lazy loading game object cache. ///