Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of AdminMenu v1.8.3
SpawnManager.dll
Decompiled 2 hours agousing System; using System.Collections; using System.Collections.Generic; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Photon.Pun; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace RepoAdminMenu; [BepInPlugin("com.aziz.repomenu", "R.E.P.O. Admin Menu", "1.8.3")] public class SpawnManagerPlugin : BaseUnityPlugin { private struct WeaponEntry { public string displayName; public string[] identifiers; public WeaponEntry(string name, string[] ids) { displayName = name; identifiers = ids; } } public const string MOD_GUID = "com.aziz.repomenu"; public const string MOD_NAME = "R.E.P.O. Admin Menu"; public const string MOD_VERSION = "1.8.3"; internal static ManualLogSource Log; private ConfigEntry<bool> cfgInfiniteMode; private ConfigEntry<bool> cfgInfiniteAmmo; private ConfigEntry<bool> cfgInfiniteEnergy; private ConfigEntry<bool> cfgInfiniteJump; private ConfigEntry<bool> cfgInfiniteRange; private ConfigEntry<bool> cfgInfiniteTumbleLaunch; private ConfigEntry<bool> cfgInfiniteCrouchRest; private ConfigEntry<bool> cfgInfiniteTumbleWings; private ConfigEntry<bool> cfgInfiniteTumbleClimb; private ConfigEntry<bool> cfgInfiniteStrength; private bool isModDisabled; private bool isMenuOpen; private bool godMode; private bool infiniteAmmo; private bool energyAndSpeed; private bool infiniteJump; private bool infiniteRange; private bool infiniteTumbleLaunch; private bool infiniteCrouchRest; private bool infiniteTumbleWings; private bool infiniteTumbleClimb; private bool infiniteStrength; private float savedMoveSpeed = 4f; private float savedSprintSpeed = 8f; private float savedSprintDrain = 20f; private bool savedOriginalSpeeds; private float ammoThrottleTimer; private Dictionary<string, EnemySetup> enemySetupCache = new Dictionary<string, EnemySetup>(StringComparer.OrdinalIgnoreCase); private int currentTab; private int monsterSpawnCount = 1; private string monsterSpawnCountStr = "1"; private Vector2 cheatsScrollPos = Vector2.zero; private Vector2 weaponsScrollPos = Vector2.zero; private Vector2 monsterScrollPos = Vector2.zero; private string statusMessage = ""; private float statusTimer; private bool isSuccessStatus = true; private string bottomNotificationText = ""; private float bottomNotificationTimer; private FieldInfo fiGodMode; private FieldInfo fiHealth; private FieldInfo fiMaxHealth; private FieldInfo fiGunBattery; private FieldInfo fiBatteryLife; private FieldInfo fiGunRevolver; private FieldInfo fiLoadedChambers; private FieldInfo fiJumpGroundedBuffer; private FieldInfo fiJumpCooldown; private FieldInfo fiJumpExtraCurrent; private FieldInfo fiDeadSet; private FieldInfo fiSpectating; private FieldInfo fiGrabDist; private FieldInfo fiGrabDistTimer; private FieldInfo fiPullerDist; private FieldInfo fiTumble; private FieldInfo fiTumbleLaunch; private FieldInfo fiUpgradeCrouchRest; private FieldInfo fiUpgradeCrouchRestActive; private FieldInfo fiUpgradeTumbleWings; private FieldInfo fiUpgradeTumbleClimb; private MethodInfo miOverrideTumbleWings; private FieldInfo fiOverrideGrabStrength; private FieldInfo fiOverrideGrabStrengthTimer; private MethodInfo miOverrideGrabStrength; private FieldInfo fiLevelAnimationCompleted; private FieldInfo fiIsDisabled; private FieldInfo fiSpawnDoneImpulse; private CursorLockMode prevLockMode = (CursorLockMode)1; private bool prevCursorVisible; private bool stylesInitialized; private GUIStyle windowBoxStyle; private GUIStyle titleHeaderStyle; private GUIStyle rowLabelStyle; private GUIStyle toggleBtnStyle; private GUIStyle toggleBtnActiveStyle; private GUIStyle toggleBtnOffActiveStyle; private GUIStyle actionBtnStyle; private GUIStyle tabBtnStyle; private GUIStyle tabBtnActiveStyle; private GUIStyle rightTabButtonStyle; private GUIStyle statusLabelStyle; private GUIStyle backBtnStyle; private GUIStyle countFieldStyle; private GUIStyle countBtnStyle; private GUIStyle itemBtnStyle; private Texture2D texPanelBg; private Texture2D texGridNormal; private Texture2D texGridActive; private Texture2D texGridOffActive; private Texture2D texGridInactive; private Texture2D texRightTab; private Texture2D texRightTabHover; private Texture2D texBlueAccent; private Texture2D texOrangeCursor; private static readonly WeaponEntry[] WEAPON_LIST = new WeaponEntry[19] { new WeaponEntry("Shotgun", new string[3] { "Item Gun Shotgun", "Shotgun", "Item Shotgun" }), new WeaponEntry("Gun", new string[5] { "Item Gun Revolver", "Item Gun Handgun", "Item Gun", "Gun", "ItemGun" }), new WeaponEntry("Human Gun", new string[3] { "Human Gun", "Item Gun Human", "Item Human Gun" }), new WeaponEntry("Photon Blaster", new string[5] { "Photon Blaster", "Item Gun Laser", "PhotonBlaster", "Item Photon Blaster", "Photon Gun" }), new WeaponEntry("Pulse Pistol", new string[5] { "Pulse Pistol", "Item Gun Handgun", "PulsePistol", "Item Pulse Pistol", "Pulse" }), new WeaponEntry("Tranq Gun", new string[6] { "ItemGunTranq", "Tranq Gun", "Tranq", "Tranquilizer Gun", "Item Gun Tranq", "Item Tranq Gun" }), new WeaponEntry("Baseball Bat", new string[6] { "Item Melee Baseball Bat", "weapon_baseball_bat", "Baseball Bat", "BaseballBat", "Item Melee Baseball", "ItemBaseballBat" }), new WeaponEntry("Frying Pan", new string[6] { "Item Melee Frying Pan", "weapon_frying_pan", "Frying Pan", "FryingPan", "Pan", "ItemFryingPan" }), new WeaponEntry("Hammer", new string[6] { "ItemMeleeInflatableHammer", "weapon_inflatable_hammer", "Inflatable Hammer", "Hammer", "Item Melee Inflatable Hammer", "Item Hammer" }), new WeaponEntry("Sledgehammer", new string[8] { "weapon_sledgehammer", "Item Melee Sledgehammer", "Sledgehammer", "ItemMeleeSledgehammer", "Item Sledgehammer", "sledgehammer_healthy", "Balyoz", "Sledge" }), new WeaponEntry("Torque Staff", new string[4] { "Item Staff Torque", "Torque Staff", "ItemStaffTorque", "Staff Torque" }), new WeaponEntry("Void Staff", new string[4] { "Item Staff Void", "Void Staff", "ItemStaffVoid", "Staff Void" }), new WeaponEntry("Zero Grav Staff", new string[4] { "Item Staff Zero Gravity", "Zero Gravity Staff", "ItemStaffZeroGravity", "Staff Zero Gravity" }), new WeaponEntry("Star Wand", new string[5] { "ValuableStarWand", "Star Wand", "Valuable Wizard Staff", "ValuableWizardStaff", "Wand" }), new WeaponEntry("Explosive Grenade", new string[4] { "Item Grenade Explosive", "Item Grenade", "Grenade Explosive", "ItemGrenadeExplosive" }), new WeaponEntry("Shockwave Grenade", new string[3] { "Item Grenade Shockwave", "Shockwave Grenade", "ItemGrenadeShockwave" }), new WeaponEntry("Human Grenade", new string[3] { "Item Grenade Human", "Human Grenade", "ItemGrenadeHuman" }), new WeaponEntry("Duct Tape Grenade", new string[3] { "Item Grenade Duct Taped", "Duct Tape Grenade", "ItemGrenadeDuctTaped" }), new WeaponEntry("Stun Grenade", new string[3] { "Item Grenade Stun", "Stun Grenade", "ItemGrenadeStun" }) }; private static readonly string[] MONSTER_LIST = new string[28] { "Animal", "Bang", "Beamer", "Birthday Boy", "Bowtie", "Ceiling Eye", "Duck", "Elsa", "Floater", "Gnome", "Head Grabber", "Heart Hugger", "Hidden", "Hunter", "Oogly", "Robe", "Runner", "Shadow", "Slow Mouth", "Slow Walker", "Snatcher", "Spinny", "Thin Man", "Tick", "Tricycle", "Tumbler", "Upscream", "Valuable Thrower" }; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; try { string directoryName = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); string path = Path.Combine(directoryName, "disable_mod.txt"); if (File.Exists(path)) { isModDisabled = true; Log.LogWarning((object)"R.E.P.O. Admin Menu is currently DISABLED via disable_mod.txt file. Halting plugin."); return; } } catch { } Log.LogInfo((object)"R.E.P.O. Admin Menu v1.8.3 initializing..."); cfgInfiniteMode = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteMode", false, "Invincibility and locked maximum health (Infinite Mode)"); cfgInfiniteAmmo = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteAmmo", false, "Unlimited ammo, battery and loaded revolver chambers"); cfgInfiniteEnergy = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteEnergyAndSpeed", false, "Unlimited stamina (locked at 100) and super sprint speed"); cfgInfiniteJump = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteJump", false, "Unlimited mid-air continuous jumps"); cfgInfiniteRange = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteGrabRange", false, "Unlimited grab range and beam reach"); cfgInfiniteTumbleLaunch = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteTumbleLaunch", false, "Superpowered high-launch tumble impulses"); cfgInfiniteCrouchRest = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteCrouchRest", false, "Instant full crouch stamina regeneration boost"); cfgInfiniteTumbleWings = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteTumbleWings", false, "Gliding tumble wings flight upgrade"); cfgInfiniteTumbleClimb = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteTumbleClimb", false, "Effortless high-strength wall climbing"); cfgInfiniteStrength = ((BaseUnityPlugin)this).Config.Bind<bool>("Cheats", "InfiniteStrength", false, "Superpowered high grab strength to easily lift any heavy object"); godMode = cfgInfiniteMode.Value; infiniteAmmo = cfgInfiniteAmmo.Value; energyAndSpeed = cfgInfiniteEnergy.Value; infiniteJump = cfgInfiniteJump.Value; infiniteRange = cfgInfiniteRange.Value; infiniteTumbleLaunch = cfgInfiniteTumbleLaunch.Value; infiniteCrouchRest = cfgInfiniteCrouchRest.Value; infiniteTumbleWings = cfgInfiniteTumbleWings.Value; infiniteTumbleClimb = cfgInfiniteTumbleClimb.Value; infiniteStrength = cfgInfiniteStrength.Value; try { BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; fiGodMode = typeof(PlayerHealth).GetField("godMode", bindingAttr); fiHealth = typeof(PlayerHealth).GetField("health", bindingAttr); fiMaxHealth = typeof(PlayerHealth).GetField("maxHealth", bindingAttr); fiGunBattery = typeof(ItemGun).GetField("itemBattery", bindingAttr); fiBatteryLife = typeof(ItemBattery).GetField("batteryLife", bindingAttr); fiGunRevolver = typeof(ItemGun).GetField("itemGunRevolver", bindingAttr); fiLoadedChambers = typeof(ItemGunRevolver).GetField("loadedChambers", bindingAttr); fiJumpGroundedBuffer = typeof(PlayerController).GetField("JumpGroundedBuffer", bindingAttr); fiJumpCooldown = typeof(PlayerController).GetField("JumpCooldown", bindingAttr); fiJumpExtraCurrent = typeof(PlayerController).GetField("JumpExtraCurrent", bindingAttr); fiDeadSet = typeof(PlayerAvatar).GetField("deadSet", bindingAttr); fiSpectating = typeof(PlayerAvatar).GetField("spectating", bindingAttr); fiGrabDist = typeof(PhysGrabber).GetField("overrideGrabDistance", bindingAttr); fiGrabDistTimer = typeof(PhysGrabber).GetField("overrideGrabDistanceTimer", bindingAttr); fiPullerDist = typeof(PhysGrabber).GetField("pullerDistance", bindingAttr); fiTumble = typeof(PlayerAvatar).GetField("tumble", bindingAttr); fiTumbleLaunch = typeof(PlayerTumble).GetField("tumbleLaunch", bindingAttr); fiUpgradeCrouchRest = typeof(PlayerAvatar).GetField("upgradeCrouchRest", bindingAttr); fiUpgradeCrouchRestActive = typeof(PlayerAvatar).GetField("upgradeCrouchRestActive", bindingAttr); fiUpgradeTumbleWings = typeof(PlayerAvatar).GetField("upgradeTumbleWings", bindingAttr); fiUpgradeTumbleClimb = typeof(PlayerAvatar).GetField("upgradeTumbleClimb", bindingAttr); miOverrideTumbleWings = typeof(PlayerAvatar).GetMethod("OverrideTumbleWings", bindingAttr, null, new Type[2] { typeof(bool), typeof(float) }, null); fiOverrideGrabStrength = typeof(PhysGrabber).GetField("overrideGrabStrength", bindingAttr); fiOverrideGrabStrengthTimer = typeof(PhysGrabber).GetField("overrideGrabStrengthTimer", bindingAttr); miOverrideGrabStrength = typeof(PhysGrabber).GetMethod("OverrideGrabStrength", bindingAttr, null, new Type[2] { typeof(float), typeof(float) }, null); fiLevelAnimationCompleted = typeof(PlayerAvatar).GetField("levelAnimationCompleted", bindingAttr); fiIsDisabled = typeof(PlayerAvatar).GetField("isDisabled", bindingAttr); fiSpawnDoneImpulse = typeof(PlayerAvatar).GetField("spawnDoneImpulse", bindingAttr); } catch (Exception ex) { Log.LogWarning((object)("Reflection init warning: " + ex.Message)); } Log.LogInfo((object)"R.E.P.O. Admin Menu v1.8.3 ready."); } private void Update() { if (isModDisabled) { return; } if (cfgInfiniteMode.Value != godMode) { godMode = cfgInfiniteMode.Value; } if (cfgInfiniteAmmo.Value != infiniteAmmo) { infiniteAmmo = cfgInfiniteAmmo.Value; } if (cfgInfiniteEnergy.Value != energyAndSpeed) { energyAndSpeed = cfgInfiniteEnergy.Value; } if (cfgInfiniteJump.Value != infiniteJump) { infiniteJump = cfgInfiniteJump.Value; } if (cfgInfiniteRange.Value != infiniteRange) { infiniteRange = cfgInfiniteRange.Value; } if (cfgInfiniteTumbleLaunch.Value != infiniteTumbleLaunch) { infiniteTumbleLaunch = cfgInfiniteTumbleLaunch.Value; } if (cfgInfiniteCrouchRest.Value != infiniteCrouchRest) { infiniteCrouchRest = cfgInfiniteCrouchRest.Value; } if (cfgInfiniteTumbleWings.Value != infiniteTumbleWings) { infiniteTumbleWings = cfgInfiniteTumbleWings.Value; } if (cfgInfiniteTumbleClimb.Value != infiniteTumbleClimb) { infiniteTumbleClimb = cfgInfiniteTumbleClimb.Value; } if (cfgInfiniteStrength.Value != infiniteStrength) { infiniteStrength = cfgInfiniteStrength.Value; } if (Input.GetKeyDown((KeyCode)284) || Input.GetKeyDown((KeyCode)277)) { PlayerAvatar localPlayer = SemiFunc.PlayerAvatarLocal(); if (IsInActiveGameplay(localPlayer)) { ToggleMenu(); } } if (godMode) { try { PlayerAvatar val = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val != (Object)null && (Object)(object)val.playerHealth != (Object)null) { val.playerHealth.InvincibleSet(1f); val.playerHealth.Heal(100, false); if (fiGodMode != null) { fiGodMode.SetValue(val.playerHealth, true); } if (fiHealth != null && fiMaxHealth != null) { object value = fiMaxHealth.GetValue(val.playerHealth); if (value != null) { fiHealth.SetValue(val.playerHealth, value); } } } } catch { } } if (infiniteAmmo) { ammoThrottleTimer -= Time.deltaTime; if (ammoThrottleTimer <= 0f) { ammoThrottleTimer = 0.25f; try { ItemBattery[] array = Object.FindObjectsOfType<ItemBattery>(); for (int i = 0; i < array.Length; i++) { if (!((Object)(object)array[i] == (Object)null)) { array[i].SetBatteryLife(100); if (fiBatteryLife != null) { fiBatteryLife.SetValue(array[i], 100f); } } } ItemGun[] array2 = Object.FindObjectsOfType<ItemGun>(); for (int j = 0; j < array2.Length; j++) { if (!((Object)(object)array2[j] == (Object)null) && fiGunRevolver != null && fiLoadedChambers != null) { object value2 = fiGunRevolver.GetValue(array2[j]); if (value2 != null) { fiLoadedChambers.SetValue(value2, 6); } } } } catch { } } } if (energyAndSpeed) { try { if ((Object)(object)PlayerController.instance != (Object)null) { if (!savedOriginalSpeeds && PlayerController.instance.SprintSpeed > 0.1f) { savedMoveSpeed = PlayerController.instance.MoveSpeed; savedSprintSpeed = PlayerController.instance.SprintSpeed; savedSprintDrain = PlayerController.instance.EnergySprintDrain; savedOriginalSpeeds = true; } PlayerController.instance.DebugEnergy = true; PlayerController.instance.EnergyCurrent = 100f; PlayerController.instance.EnergySprintDrain = 0f; PlayerController.instance.MoveSpeed = savedMoveSpeed * 1.8f; PlayerController.instance.SprintSpeed = savedSprintSpeed * 2.2f; } SemiFunc.LocalPlayerOverrideEnergyUnlimited(); } catch { } } if (infiniteJump && (Object)(object)PlayerController.instance != (Object)null) { try { if (fiJumpGroundedBuffer != null) { fiJumpGroundedBuffer.SetValue(PlayerController.instance, 0.25f); } if (fiJumpCooldown != null) { fiJumpCooldown.SetValue(PlayerController.instance, 0f); } if (fiJumpExtraCurrent != null) { fiJumpExtraCurrent.SetValue(PlayerController.instance, 999); } } catch { } } if (infiniteRange) { try { if ((Object)(object)PhysGrabber.instance != (Object)null) { PhysGrabber.instance.grabRange = 18f; PhysGrabber.instance.grabReleaseDistance = 26f; } } catch { } } if (infiniteTumbleLaunch) { try { PlayerAvatar val2 = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val2 != (Object)null && fiTumble != null && fiTumbleLaunch != null) { object value3 = fiTumble.GetValue(val2); if (value3 != null) { fiTumbleLaunch.SetValue(value3, 999); } } } catch { } } if (infiniteCrouchRest) { try { PlayerAvatar val3 = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val3 != (Object)null) { if (fiUpgradeCrouchRest != null) { fiUpgradeCrouchRest.SetValue(val3, 999f); } if (fiUpgradeCrouchRestActive != null) { fiUpgradeCrouchRestActive.SetValue(val3, true); } } } catch { } } if (infiniteTumbleWings) { try { PlayerAvatar val4 = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val4 != (Object)null) { if (fiUpgradeTumbleWings != null) { fiUpgradeTumbleWings.SetValue(val4, 999f); } if (miOverrideTumbleWings != null) { miOverrideTumbleWings.Invoke(val4, new object[2] { true, 999f }); } } } catch { } } if (infiniteTumbleClimb) { try { PlayerAvatar val5 = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val5 != (Object)null && fiUpgradeTumbleClimb != null) { fiUpgradeTumbleClimb.SetValue(val5, 999f); } if ((Object)(object)PhysGrabber.instance != (Object)null) { FieldInfo field = typeof(PhysGrabber).GetField("climbForceMultiplier", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { field.SetValue(PhysGrabber.instance, 5f); } FieldInfo field2 = typeof(PhysGrabber).GetField("climbPushPullSpeed", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field2 != null) { field2.SetValue(PhysGrabber.instance, 10f); } } } catch { } } if (infiniteStrength) { try { if ((Object)(object)PhysGrabber.instance != (Object)null) { PhysGrabber.instance.grabStrength = 5f; } } catch { } } if (statusTimer > 0f) { statusTimer -= Time.deltaTime; if (statusTimer <= 0f) { statusMessage = ""; } } if (bottomNotificationTimer > 0f) { bottomNotificationTimer -= Time.deltaTime; if (bottomNotificationTimer <= 0f) { bottomNotificationText = ""; } } } private void ToggleMenu() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) isMenuOpen = !isMenuOpen; if (isMenuOpen) { prevLockMode = Cursor.lockState; prevCursorVisible = Cursor.visible; Cursor.lockState = (CursorLockMode)0; Cursor.visible = false; } else { Cursor.lockState = prevLockMode; Cursor.visible = prevCursorVisible; } } private void SetAllCheats(bool enable) { godMode = enable; cfgInfiniteMode.Value = enable; infiniteAmmo = enable; cfgInfiniteAmmo.Value = enable; energyAndSpeed = enable; cfgInfiniteEnergy.Value = enable; infiniteJump = enable; cfgInfiniteJump.Value = enable; infiniteRange = enable; cfgInfiniteRange.Value = enable; infiniteTumbleLaunch = enable; cfgInfiniteTumbleLaunch.Value = enable; infiniteCrouchRest = enable; cfgInfiniteCrouchRest.Value = enable; infiniteTumbleWings = enable; cfgInfiniteTumbleWings.Value = enable; infiniteTumbleClimb = enable; cfgInfiniteTumbleClimb.Value = enable; infiniteStrength = enable; cfgInfiniteStrength.Value = enable; if (enable) { try { PlayerAvatar val = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val != (Object)null && (Object)(object)val.playerHealth != (Object)null) { val.playerHealth.InvincibleSet(1f); val.playerHealth.Heal(100, false); if (fiGodMode != null) { fiGodMode.SetValue(val.playerHealth, true); } if (fiHealth != null && fiMaxHealth != null) { object value = fiMaxHealth.GetValue(val.playerHealth); if (value != null) { fiHealth.SetValue(val.playerHealth, value); } } } } catch { } try { if ((Object)(object)PlayerController.instance != (Object)null) { if (!savedOriginalSpeeds && PlayerController.instance.SprintSpeed > 0.1f) { savedMoveSpeed = PlayerController.instance.MoveSpeed; savedSprintSpeed = PlayerController.instance.SprintSpeed; savedSprintDrain = PlayerController.instance.EnergySprintDrain; savedOriginalSpeeds = true; } PlayerController.instance.DebugEnergy = true; PlayerController.instance.EnergyCurrent = 100f; PlayerController.instance.EnergySprintDrain = 0f; PlayerController.instance.MoveSpeed = savedMoveSpeed * 1.8f; PlayerController.instance.SprintSpeed = savedSprintSpeed * 2.2f; } SemiFunc.LocalPlayerOverrideEnergyUnlimited(); } catch { } SetStatus("ALL CHEATS: ON", success: true); return; } try { PlayerAvatar val2 = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val2 != (Object)null && (Object)(object)val2.playerHealth != (Object)null && fiGodMode != null) { fiGodMode.SetValue(val2.playerHealth, false); } } catch { } try { if ((Object)(object)PlayerController.instance != (Object)null) { PlayerController.instance.DebugEnergy = false; if (savedOriginalSpeeds) { PlayerController.instance.MoveSpeed = savedMoveSpeed; PlayerController.instance.SprintSpeed = savedSprintSpeed; PlayerController.instance.EnergySprintDrain = savedSprintDrain; } } } catch { } try { if ((Object)(object)PhysGrabber.instance != (Object)null) { PhysGrabber.instance.grabRange = 4f; PhysGrabber.instance.grabReleaseDistance = 8f; PhysGrabber.instance.grabStrength = 1f; } } catch { } SetStatus("ALL CHEATS: OFF", success: false); } private Texture2D CreateBorderedTex(int width, int height, Color bgColor, Color borderColor, int borderThickness) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(width, height); Color[] array = (Color[])(object)new Color[width * height]; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { bool flag = j < borderThickness || j >= width - borderThickness || i < borderThickness || i >= height - borderThickness; array[i * width + j] = (flag ? borderColor : bgColor); } } val.SetPixels(array); val.Apply(); return val; } private Texture2D CreateSolidTex(int width, int height, Color col) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(width, height); Color[] array = (Color[])(object)new Color[width * height]; for (int i = 0; i < array.Length; i++) { array[i] = col; } val.SetPixels(array); val.Apply(); return val; } private Texture2D CreateOrangeCursorTexture() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown try { string s = "iVBORw0KGgoAAAANSUhEUgAAABoAAAAbCAYAAABiFp9rAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAANTSURBVEhLzZR9SFVnHMd/aine59x7znnuOfd67r1mToe5obPaxChNQQp3G0xZbooNk17mNikaY70sfEmQEmpRsLAiX26l02svNgabI1CyYC+wjfbPYLGgv4qxpVSa9I3T0U2fXZ16FfrA95/z/J7v9/k953keem+9drvSr92KjDZ20kJyvkoZxtcSzlVx5Ge4LkezuF1EnhSxLmxKcrTf0WEHOiTgrAN9BxTUvcNH/ZmuHor0lIv1cyYmJm57334V6GJAmwR0MqBLghneUMbx5ir9G4r1VBJ508W5syTR/WkRH/4nqHVMAckKD9jxY4OC2hL+cMNr+nWi+GzRYaYsWpumX0bAAZydEDQx8AsGXGAYOeNAXSl/8EaW/p1D8XxAlJBKRBGi4ZRINmNLz8fc2jYxaKLMhVxkGA3YcfOQgoPlfGhNmj5AlLCMaGOU6BuClbayXO1XXAhhHkpml+0M6GH446iMY5v5o9dfNQM9xURLEqftMiXBdfxGvWoZiMZTqUUCzo912exA8CMVn2/jj31GXAeRL03MGGOJujXf+Qu6QxjORGaXQetf/two43gFR3G2q88mGVvFJCrM0nrvNzusSaLRbNTBgC8ZcMmOIxXq0LoVeu/kpMWeiluHFetYi5Onk7mwc/92hG6GgRoV39cr6NnNUbBSvzkpJ4q58+rfdj78+/TYCRMNx2XeN9PYVBfDaKsdfzXJaH1fxalKZbBxkzqoqEZQ192fEfkyiXRpUhBRcgxFuqvuHJOB9hABpoKmuYR7J2TcbZIRqOLIy3D1L3/RXUPk2WA+AJb+B5strqB9Bx9B53+7GG2WcLSC/7m3yPlbaqK7KTXZtYPIWyR6zJCNUbXFztu4KASZ/6HNgZeW6keIqiPFWXMiP0MfeNAiPEmdDNeq1ScGNz4U68PA62+t5NYpGg/qYqh+i48QxXvE6nCIyE3Xrw632K0tC0h40uZAXrp+xbwEYnFYvJKk1w6dVKwj3Mnw7T4VsmRsEevCJjra6z+5jT+7fOa2ffWJAqKkZLFuPojITHH1j5hPUpBhTyEfJPItSBARGat3+rX7uGJH6Vrtkjg6rxRmaQ0/NDiR87L+rjg2r8Ryr29znvaTLLteEMcWAF+s+OW55Sns/XDkG3nOawAAAABJRU5ErkJggg=="; byte[] array = Convert.FromBase64String(s); Texture2D val = new Texture2D(26, 27, (TextureFormat)4, false); MethodInfo method = typeof(ImageConversion).GetMethod("LoadImage", new Type[2] { typeof(Texture2D), typeof(byte[]) }); if (method != null) { method.Invoke(null, new object[2] { val, array }); } ((Texture)val).filterMode = (FilterMode)1; return val; } catch { return null; } } private void InitStyles() { //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Expected O, but got Unknown //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Expected O, but got Unknown //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Expected O, but got Unknown //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Expected O, but got Unknown //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Expected O, but got Unknown //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Expected O, but got Unknown //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Expected O, but got Unknown //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Expected O, but got Unknown //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Expected O, but got Unknown //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Expected O, but got Unknown //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Expected O, but got Unknown //IL_057f: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_05d5: Expected O, but got Unknown //IL_060c: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_0655: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Expected O, but got Unknown //IL_066a: Unknown result type (might be due to invalid IL or missing references) //IL_0674: Expected O, but got Unknown //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Expected O, but got Unknown //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Expected O, but got Unknown //IL_0788: Unknown result type (might be due to invalid IL or missing references) //IL_079a: Unknown result type (might be due to invalid IL or missing references) //IL_07d1: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Expected O, but got Unknown //IL_080b: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Expected O, but got Unknown //IL_084c: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) if (!stylesInitialized) { Color bgColor = default(Color); ((Color)(ref bgColor))..ctor(0.07f, 0.09f, 0.12f, 0.96f); Color borderColor = default(Color); ((Color)(ref borderColor))..ctor(0.2f, 0.26f, 0.34f, 0.9f); Color bgColor2 = default(Color); ((Color)(ref bgColor2))..ctor(0.1f, 0.13f, 0.18f, 0.9f); Color borderColor2 = default(Color); ((Color)(ref borderColor2))..ctor(0.18f, 0.23f, 0.3f, 0.7f); Color bgColor3 = default(Color); ((Color)(ref bgColor3))..ctor(0.15f, 0.2f, 0.28f, 0.95f); Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.62f, 0.12f, 1f); Color bgColor4 = default(Color); ((Color)(ref bgColor4))..ctor(0.28f, 0.16f, 0.02f, 0.95f); Color borderColor3 = default(Color); ((Color)(ref borderColor3))..ctor(0.14f, 0.76f, 0.38f, 1f); Color bgColor5 = default(Color); ((Color)(ref bgColor5))..ctor(0.1f, 0.36f, 0.18f, 0.95f); Color borderColor4 = default(Color); ((Color)(ref borderColor4))..ctor(0.92f, 0.25f, 0.25f, 1f); Color bgColor6 = default(Color); ((Color)(ref bgColor6))..ctor(0.38f, 0.08f, 0.08f, 0.95f); Color textColor = default(Color); ((Color)(ref textColor))..ctor(0.5f, 0.58f, 0.68f, 1f); Color textColor2 = default(Color); ((Color)(ref textColor2))..ctor(0.92f, 0.96f, 1f, 1f); texPanelBg = CreateBorderedTex(64, 64, bgColor, borderColor, 1); texGridNormal = CreateBorderedTex(32, 32, bgColor2, borderColor2, 1); texGridActive = CreateBorderedTex(32, 32, bgColor5, borderColor3, 1); texGridOffActive = CreateBorderedTex(32, 32, bgColor6, borderColor4, 1); texGridInactive = CreateBorderedTex(32, 32, bgColor2, borderColor2, 1); texRightTab = CreateBorderedTex(64, 32, bgColor, val, 1); texRightTabHover = CreateBorderedTex(64, 32, bgColor3, val, 2); texBlueAccent = CreateSolidTex(8, 8, val); texOrangeCursor = CreateOrangeCursorTexture(); windowBoxStyle = new GUIStyle(GUI.skin.box); windowBoxStyle.normal.background = texPanelBg; windowBoxStyle.border = new RectOffset(4, 4, 4, 4); titleHeaderStyle = new GUIStyle(GUI.skin.label); titleHeaderStyle.alignment = (TextAnchor)4; titleHeaderStyle.fontStyle = (FontStyle)1; titleHeaderStyle.fontSize = 12; titleHeaderStyle.normal.textColor = textColor2; tabBtnStyle = new GUIStyle(GUI.skin.button); tabBtnStyle.normal.background = texGridNormal; tabBtnStyle.hover.background = texRightTabHover; tabBtnStyle.normal.textColor = textColor; tabBtnStyle.hover.textColor = textColor2; tabBtnStyle.fontStyle = (FontStyle)1; tabBtnStyle.fontSize = 10; tabBtnStyle.alignment = (TextAnchor)4; tabBtnActiveStyle = new GUIStyle(GUI.skin.button); tabBtnActiveStyle.normal.background = CreateBorderedTex(32, 32, bgColor4, val, 1); tabBtnActiveStyle.normal.textColor = val; tabBtnActiveStyle.fontStyle = (FontStyle)1; tabBtnActiveStyle.fontSize = 10; tabBtnActiveStyle.alignment = (TextAnchor)4; rowLabelStyle = new GUIStyle(GUI.skin.box); rowLabelStyle.normal.background = texGridNormal; rowLabelStyle.normal.textColor = textColor2; rowLabelStyle.alignment = (TextAnchor)3; rowLabelStyle.fontStyle = (FontStyle)1; rowLabelStyle.fontSize = 10; rowLabelStyle.padding = new RectOffset(10, 4, 0, 0); toggleBtnStyle = new GUIStyle(GUI.skin.button); toggleBtnStyle.normal.background = texGridInactive; toggleBtnStyle.normal.textColor = textColor; toggleBtnStyle.alignment = (TextAnchor)4; toggleBtnStyle.fontStyle = (FontStyle)1; toggleBtnStyle.fontSize = 10; toggleBtnActiveStyle = new GUIStyle(GUI.skin.button); toggleBtnActiveStyle.normal.background = texGridActive; toggleBtnActiveStyle.normal.textColor = Color.white; toggleBtnActiveStyle.alignment = (TextAnchor)4; toggleBtnActiveStyle.fontStyle = (FontStyle)1; toggleBtnActiveStyle.fontSize = 10; toggleBtnOffActiveStyle = new GUIStyle(GUI.skin.button); toggleBtnOffActiveStyle.normal.background = texGridOffActive; toggleBtnOffActiveStyle.normal.textColor = Color.white; toggleBtnOffActiveStyle.alignment = (TextAnchor)4; toggleBtnOffActiveStyle.fontStyle = (FontStyle)1; toggleBtnOffActiveStyle.fontSize = 10; actionBtnStyle = new GUIStyle(GUI.skin.button); actionBtnStyle.normal.background = texGridNormal; actionBtnStyle.hover.background = texRightTabHover; actionBtnStyle.normal.textColor = val; actionBtnStyle.hover.textColor = Color.white; actionBtnStyle.alignment = (TextAnchor)4; actionBtnStyle.fontStyle = (FontStyle)1; actionBtnStyle.fontSize = 10; itemBtnStyle = new GUIStyle(GUI.skin.button); itemBtnStyle.normal.background = texGridNormal; itemBtnStyle.hover.background = texRightTabHover; itemBtnStyle.normal.textColor = textColor2; itemBtnStyle.hover.textColor = val; itemBtnStyle.alignment = (TextAnchor)3; itemBtnStyle.fontStyle = (FontStyle)1; itemBtnStyle.fontSize = 10; itemBtnStyle.padding = new RectOffset(10, 4, 0, 0); countBtnStyle = new GUIStyle(GUI.skin.button); countBtnStyle.normal.background = texGridNormal; countBtnStyle.hover.background = texRightTabHover; countBtnStyle.normal.textColor = val; countBtnStyle.fontStyle = (FontStyle)1; countBtnStyle.fontSize = 11; countBtnStyle.alignment = (TextAnchor)4; countFieldStyle = new GUIStyle(GUI.skin.textField); countFieldStyle.normal.background = texGridNormal; countFieldStyle.normal.textColor = Color.white; countFieldStyle.fontStyle = (FontStyle)1; countFieldStyle.fontSize = 11; countFieldStyle.alignment = (TextAnchor)4; rightTabButtonStyle = new GUIStyle(GUI.skin.button); rightTabButtonStyle.normal.background = texRightTab; rightTabButtonStyle.hover.background = texRightTabHover; rightTabButtonStyle.normal.textColor = textColor2; rightTabButtonStyle.hover.textColor = val; rightTabButtonStyle.alignment = (TextAnchor)4; rightTabButtonStyle.fontStyle = (FontStyle)1; rightTabButtonStyle.fontSize = 11; statusLabelStyle = new GUIStyle(GUI.skin.label); statusLabelStyle.alignment = (TextAnchor)4; statusLabelStyle.fontStyle = (FontStyle)1; statusLabelStyle.fontSize = 9; backBtnStyle = new GUIStyle(GUI.skin.button); backBtnStyle.normal.background = texGridNormal; backBtnStyle.hover.background = texRightTabHover; backBtnStyle.normal.textColor = textColor; backBtnStyle.hover.textColor = val; backBtnStyle.alignment = (TextAnchor)4; backBtnStyle.fontStyle = (FontStyle)1; backBtnStyle.fontSize = 10; stylesInitialized = true; } } private bool IsInActiveGameplay(PlayerAvatar localPlayer) { if ((Object)(object)localPlayer == (Object)null) { return false; } if (fiDeadSet != null) { object value = fiDeadSet.GetValue(localPlayer); if (value is bool && (bool)value) { return false; } } if (fiSpectating != null) { object value2 = fiSpectating.GetValue(localPlayer); if (value2 is bool && (bool)value2) { return false; } } if (fiIsDisabled != null) { object value3 = fiIsDisabled.GetValue(localPlayer); if (value3 is bool && (bool)value3) { return false; } } try { if (!SemiFunc.RunIsLevel()) { return false; } if (SemiFunc.RunIsLobby() || SemiFunc.RunIsLobbyMenu() || SemiFunc.IsMainMenu() || SemiFunc.MenuLevel()) { return false; } if (!SemiFunc.LevelGenDone()) { return false; } } catch { return false; } try { if ((Object)(object)LoadingUI.instance != (Object)null && (Object)(object)((Component)LoadingUI.instance).gameObject != (Object)null && ((Component)LoadingUI.instance).gameObject.activeInHierarchy) { return false; } } catch { } if (fiLevelAnimationCompleted != null) { object value4 = fiLevelAnimationCompleted.GetValue(localPlayer); if (value4 is bool && !(bool)value4) { return false; } } try { if ((Object)(object)Map.Instance != (Object)null && Map.Instance.Active) { return false; } } catch { } try { if (SemiFunc.PlayerCameraTransitionActive()) { return false; } } catch { } try { if ((Object)(object)Object.FindObjectOfType<ArmIntroController>() != (Object)null) { return false; } } catch { } if ((Object)(object)PlayerController.instance == (Object)null) { return false; } return true; } private void OnGUI() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0d1a: Unknown result type (might be due to invalid IL or missing references) //IL_0d21: Expected O, but got Unknown //IL_0d58: Unknown result type (might be due to invalid IL or missing references) //IL_0d76: Unknown result type (might be due to invalid IL or missing references) //IL_0da0: Unknown result type (might be due to invalid IL or missing references) //IL_0db2: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0857: Unknown result type (might be due to invalid IL or missing references) //IL_087d: Unknown result type (might be due to invalid IL or missing references) //IL_0778: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_0780: Unknown result type (might be due to invalid IL or missing references) //IL_0782: Unknown result type (might be due to invalid IL or missing references) //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_08d0: Unknown result type (might be due to invalid IL or missing references) //IL_0932: Unknown result type (might be due to invalid IL or missing references) //IL_07d3: Unknown result type (might be due to invalid IL or missing references) //IL_0990: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_09ce: Unknown result type (might be due to invalid IL or missing references) //IL_0bf3: Unknown result type (might be due to invalid IL or missing references) //IL_0c08: Unknown result type (might be due to invalid IL or missing references) //IL_0a0c: Unknown result type (might be due to invalid IL or missing references) //IL_0c44: Unknown result type (might be due to invalid IL or missing references) //IL_0bac: Unknown result type (might be due to invalid IL or missing references) //IL_0b96: Unknown result type (might be due to invalid IL or missing references) //IL_0a8f: Unknown result type (might be due to invalid IL or missing references) //IL_0a92: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Unknown result type (might be due to invalid IL or missing references) //IL_0a99: Unknown result type (might be due to invalid IL or missing references) //IL_0a9e: Unknown result type (might be due to invalid IL or missing references) //IL_0bc1: Unknown result type (might be due to invalid IL or missing references) //IL_0c74: Unknown result type (might be due to invalid IL or missing references) //IL_0c79: Unknown result type (might be due to invalid IL or missing references) //IL_0c93: Unknown result type (might be due to invalid IL or missing references) //IL_0b12: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_04ff: Unknown result type (might be due to invalid IL or missing references) //IL_0501: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) if (isModDisabled) { return; } try { PlayerAvatar localPlayer = SemiFunc.PlayerAvatarLocal(); if (!IsInActiveGameplay(localPlayer)) { if (isMenuOpen) { isMenuOpen = false; Cursor.lockState = prevLockMode; Cursor.visible = prevCursorVisible; } return; } } catch { return; } InitStyles(); float num = Screen.width; float num2 = Screen.height; float num3 = 200f; float num4 = 36f; float num5 = num - num3 - 8f; float num6 = num2 * 0.4f; string text = (isMenuOpen ? "ADMIN MENU [-]" : "ADMIN MENU [+]"); if (GUI.Button(new Rect(num5, num6, num3, num4), text, rightTabButtonStyle)) { ToggleMenu(); } if (isMenuOpen) { float num7 = 380f; float num8 = 480f; float num9 = num - num7 - 8f; float num10 = num6 + num4 + 6f; if (num10 + num8 > num2 - 12f) { num10 = num2 - num8 - 12f; } GUI.Box(new Rect(num9, num10, num7, num8), "", windowBoxStyle); float num11 = 5f; float num12 = num8 - 24f; float num13 = num9 + num7 - num11 - 10f; float num14 = num10 + 12f; GUI.DrawTexture(new Rect(num13, num14, num11, num12), (Texture)(object)texGridNormal); GUI.DrawTexture(new Rect(num13, num14, num11, 40f), (Texture)(object)texBlueAccent); float num15 = num7 - num11 - 32f; float num16 = num9 + 12f; float num17 = num10 + 12f; float num18 = 25f; GUI.Label(new Rect(num16, num17, num15, 20f), "R.E.P.O. // ADMIN CONSOLE", titleHeaderStyle); num17 += 20f; GUIStyle val = new GUIStyle(GUI.skin.label); val.alignment = (TextAnchor)4; val.fontSize = 9; val.fontStyle = (FontStyle)1; val.normal.textColor = new Color(1f, 0.62f, 0.12f, 0.85f); GUI.Label(new Rect(num16, num17, num15, 14f), "DEVELOPER ACCESS | BY: Serenity | v1.8.3", val); num17 += 18f; float num19 = (num15 - 8f) / 3f; GUIStyle val2 = ((currentTab == 0) ? tabBtnActiveStyle : tabBtnStyle); if (GUI.Button(new Rect(num16, num17, num19, num18), "CHEATS", val2)) { currentTab = 0; } GUIStyle val3 = ((currentTab == 1) ? tabBtnActiveStyle : tabBtnStyle); if (GUI.Button(new Rect(num16 + num19 + 4f, num17, num19, num18), "WEAPONS", val3)) { currentTab = 1; } GUIStyle val4 = ((currentTab == 2) ? tabBtnActiveStyle : tabBtnStyle); if (GUI.Button(new Rect(num16 + (num19 + 4f) * 2f, num17, num19, num18), "MONSTERS", val4)) { currentTab = 2; } num17 += num18 + 6f; if (currentTab == 0) { float num20 = num15 * 0.62f; float num21 = (num15 - num20) / 2f; GUI.Box(new Rect(num16, num17, num20, num18), "ALL CHEATS", rowLabelStyle); GUIStyle val5 = ((!godMode && !infiniteAmmo && !energyAndSpeed && !infiniteJump && !infiniteRange && !infiniteTumbleLaunch && !infiniteCrouchRest && !infiniteTumbleWings && !infiniteTumbleClimb && !infiniteStrength) ? toggleBtnOffActiveStyle : actionBtnStyle); if (GUI.Button(new Rect(num16 + num20, num17, num21, num18), "OFF", val5)) { SetAllCheats(enable: false); } GUIStyle val6 = ((godMode && infiniteAmmo && energyAndSpeed && infiniteJump && infiniteRange && infiniteTumbleLaunch && infiniteCrouchRest && infiniteTumbleWings && infiniteTumbleClimb && infiniteStrength) ? toggleBtnActiveStyle : actionBtnStyle); if (GUI.Button(new Rect(num16 + num20 + num21, num17, num21, num18), "ALL ON", val6)) { SetAllCheats(enable: true); } num17 += num18 + 4f; float num22 = 265f; Rect val7 = default(Rect); ((Rect)(ref val7))..ctor(num16, num17, num15, num22); float num23 = 10f; float num24 = num23 * (num18 + 4f); Rect val8 = default(Rect); ((Rect)(ref val8))..ctor(0f, 0f, num15 - 16f, num24); cheatsScrollPos = GUI.BeginScrollView(val7, cheatsScrollPos, val8); float y = 0f; float num25 = ((Rect)(ref val8)).width * 0.62f; float toggleW = (((Rect)(ref val8)).width - num25) / 2f; y = DrawCheatRow(y, num25, toggleW, num18, "INFINITE MODE", godMode, delegate(bool flag) { godMode = flag; cfgInfiniteMode.Value = flag; try { PlayerAvatar val14 = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val14 != (Object)null && (Object)(object)val14.playerHealth != (Object)null) { if (flag) { val14.playerHealth.InvincibleSet(1f); val14.playerHealth.Heal(100, false); if (fiGodMode != null) { fiGodMode.SetValue(val14.playerHealth, true); } if (fiHealth != null && fiMaxHealth != null) { object value = fiMaxHealth.GetValue(val14.playerHealth); if (value != null) { fiHealth.SetValue(val14.playerHealth, value); } } } else if (fiGodMode != null) { fiGodMode.SetValue(val14.playerHealth, false); } } } catch { } }); y = DrawCheatRow(y, num25, toggleW, num18, "INFINITE AMMO", infiniteAmmo, delegate(bool value) { infiniteAmmo = value; cfgInfiniteAmmo.Value = value; }); y = DrawCheatRow(y, num25, toggleW, num18, "INFINITE ENERGY", energyAndSpeed, delegate(bool flag) { energyAndSpeed = flag; cfgInfiniteEnergy.Value = flag; if (!flag && (Object)(object)PlayerController.instance != (Object)null && savedOriginalSpeeds) { PlayerController.instance.DebugEnergy = false; PlayerController.instance.MoveSpeed = savedMoveSpeed; PlayerController.instance.SprintSpeed = savedSprintSpeed; PlayerController.instance.EnergySprintDrain = savedSprintDrain; } }); y = DrawCheatRow(y, num25, toggleW, num18, "INFINITE JUMP", infiniteJump, delegate(bool value) { infiniteJump = value; cfgInfiniteJump.Value = value; }); y = DrawCheatRow(y, num25, toggleW, num18, "MAX RANGE", infiniteRange, delegate(bool flag) { infiniteRange = flag; cfgInfiniteRange.Value = flag; if (!flag && (Object)(object)PhysGrabber.instance != (Object)null) { try { PhysGrabber.instance.grabRange = 4f; PhysGrabber.instance.grabReleaseDistance = 8f; } catch { } } }); y = DrawCheatRow(y, num25, toggleW, num18, "TUMBLE LAUNCH", infiniteTumbleLaunch, delegate(bool value) { infiniteTumbleLaunch = value; cfgInfiniteTumbleLaunch.Value = value; }); y = DrawCheatRow(y, num25, toggleW, num18, "CROUCH REST", infiniteCrouchRest, delegate(bool value) { infiniteCrouchRest = value; cfgInfiniteCrouchRest.Value = value; }); y = DrawCheatRow(y, num25, toggleW, num18, "TUMBLE WINGS", infiniteTumbleWings, delegate(bool value) { infiniteTumbleWings = value; cfgInfiniteTumbleWings.Value = value; }); y = DrawCheatRow(y, num25, toggleW, num18, "TUMBLE CLIMB", infiniteTumbleClimb, delegate(bool value) { infiniteTumbleClimb = value; cfgInfiniteTumbleClimb.Value = value; }); y = DrawCheatRow(y, num25, toggleW, num18, "INFINITE STRENGTH", infiniteStrength, delegate(bool flag) { infiniteStrength = flag; cfgInfiniteStrength.Value = flag; if (!flag && (Object)(object)PhysGrabber.instance != (Object)null) { try { PhysGrabber.instance.grabStrength = 1f; } catch { } } }); GUI.EndScrollView(); num17 += num22 + 6f; } else if (currentTab == 1) { float num26 = 295f; Rect val9 = default(Rect); ((Rect)(ref val9))..ctor(num16, num17, num15, num26); float num27 = 23f; float num28 = (float)WEAPON_LIST.Length * (num27 + 3f); Rect val10 = default(Rect); ((Rect)(ref val10))..ctor(0f, 0f, num15 - 16f, num28); weaponsScrollPos = GUI.BeginScrollView(val9, weaponsScrollPos, val10); float num29 = 0f; for (int num30 = 0; num30 < WEAPON_LIST.Length; num30++) { WeaponEntry weaponEntry = WEAPON_LIST[num30]; string text2 = "SPAWN " + weaponEntry.displayName.ToUpper(); if (GUI.Button(new Rect(0f, num29, ((Rect)(ref val10)).width, num27), text2, itemBtnStyle)) { ExecuteSpawnWeapon(weaponEntry.displayName, weaponEntry.identifiers); } num29 += num27 + 3f; } GUI.EndScrollView(); num17 += num26 + 6f; } else { float num31 = 95f; float num32 = 24f; float num33 = 38f; float num34 = 30f; GUI.Box(new Rect(num16, num17, num31, num18), "SPAWN COUNT", rowLabelStyle); if (GUI.Button(new Rect(num16 + num31 + 2f, num17, num32, num18), "-", countBtnStyle)) { if (monsterSpawnCount > 1) { monsterSpawnCount--; } monsterSpawnCountStr = monsterSpawnCount.ToString(); } string text3 = GUI.TextField(new Rect(num16 + num31 + num32 + 4f, num17, num33, num18), monsterSpawnCountStr, 3, countFieldStyle); if (text3 != monsterSpawnCountStr) { monsterSpawnCountStr = text3; if (int.TryParse(text3, out var result)) { monsterSpawnCount = Mathf.Clamp(result, 1, 50); } } if (GUI.Button(new Rect(num16 + num31 + num32 + num33 + 6f, num17, num32, num18), "+", countBtnStyle)) { if (monsterSpawnCount < 50) { monsterSpawnCount++; } monsterSpawnCountStr = monsterSpawnCount.ToString(); } float num35 = num16 + num31 + num32 + num33 + num32 + 10f; if (GUI.Button(new Rect(num35, num17, num34, num18), "1", countBtnStyle)) { monsterSpawnCount = 1; monsterSpawnCountStr = "1"; } num35 += num34 + 2f; if (GUI.Button(new Rect(num35, num17, num34, num18), "5", countBtnStyle)) { monsterSpawnCount = 5; monsterSpawnCountStr = "5"; } num35 += num34 + 2f; if (GUI.Button(new Rect(num35, num17, num34, num18), "10", countBtnStyle)) { monsterSpawnCount = 10; monsterSpawnCountStr = "10"; } num17 += num18 + 6f; float num36 = 265f; Rect val11 = default(Rect); ((Rect)(ref val11))..ctor(num16, num17, num15, num36); float num37 = 23f; float num38 = (float)MONSTER_LIST.Length * (num37 + 3f); Rect val12 = default(Rect); ((Rect)(ref val12))..ctor(0f, 0f, num15 - 16f, num38); monsterScrollPos = GUI.BeginScrollView(val11, monsterScrollPos, val12); float num39 = 0f; for (int num40 = 0; num40 < MONSTER_LIST.Length; num40++) { string text4 = MONSTER_LIST[num40]; string text5 = "SPAWN " + text4.ToUpper() + " (" + monsterSpawnCount + "x)"; if (GUI.Button(new Rect(0f, num39, ((Rect)(ref val12)).width, num37), text5, itemBtnStyle)) { ExecuteSpawnEnemy(text4, monsterSpawnCount); } num39 += num37 + 3f; } GUI.EndScrollView(); num17 += num36 + 6f; } if (!string.IsNullOrEmpty(statusMessage)) { statusLabelStyle.normal.textColor = (isSuccessStatus ? new Color(0.2f, 1f, 0.4f) : new Color(1f, 0.35f, 0.35f)); GUI.Label(new Rect(num16, num17, num15, 18f), statusMessage, statusLabelStyle); } else { statusLabelStyle.normal.textColor = new Color(0.4f, 0.55f, 0.7f); GUI.Label(new Rect(num16, num17, num15, 18f), "[ HOTKEY: F3 / INSERT ]", statusLabelStyle); } num17 += 20f; if (GUI.Button(new Rect(num16 + (num15 - 120f) / 2f, num17, 120f, 22f), "CLOSE", backBtnStyle)) { ToggleMenu(); } if ((Object)(object)texOrangeCursor != (Object)null) { Vector2 mousePosition = Event.current.mousePosition; GUI.DrawTexture(new Rect(mousePosition.x, mousePosition.y, 26f, 27f), (Texture)(object)texOrangeCursor); } } if (bottomNotificationTimer > 0f && !string.IsNullOrEmpty(bottomNotificationText)) { float num41 = 1f; if (bottomNotificationTimer < 0.8f) { num41 = Mathf.Clamp01(bottomNotificationTimer / 0.8f); } float num42 = 400f; float num43 = 32f; float num44 = num - num42 - 24f; float num45 = num2 - num43 - 24f; GUIStyle val13 = new GUIStyle(GUI.skin.label); val13.alignment = (TextAnchor)5; val13.fontStyle = (FontStyle)1; val13.fontSize = 15; val13.normal.textColor = new Color(0f, 0f, 0f, num41 * 0.9f); GUI.Label(new Rect(num44 + 1.5f, num45 + 1.5f, num42, num43), bottomNotificationText, val13); val13.normal.textColor = new Color(0.95f, 0.95f, 0.95f, num41); GUI.Label(new Rect(num44, num45, num42, num43), bottomNotificationText, val13); } } private float DrawCheatRow(float y, float labelW, float toggleW, float h, string title, bool currentVal, Action<bool> onChange) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) GUI.Box(new Rect(0f, y, labelW, h), title, rowLabelStyle); GUIStyle val = ((!currentVal) ? toggleBtnOffActiveStyle : toggleBtnStyle); if (GUI.Button(new Rect(labelW, y, toggleW, h), "OFF", val)) { onChange(obj: false); SetStatus(title + ": OFF", success: false); } GUIStyle val2 = (currentVal ? toggleBtnActiveStyle : toggleBtnStyle); if (GUI.Button(new Rect(labelW + toggleW, y, toggleW, h), "ON", val2)) { onChange(obj: true); SetStatus(title + ": ON", success: true); } return y + h + 4f; } private void SetStatus(string msg, bool success) { statusMessage = msg; isSuccessStatus = success; statusTimer = 3.5f; if (success) { Log.LogInfo((object)msg); } else { Log.LogWarning((object)msg); } } private void ExecuteSpawnWeapon(string weaponDisplayName, string[] candidateIds) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) try { if (!GetPlayerSpawnPoint(out var position, out var rotation)) { SetStatus("ERROR: PLAYER NOT IN RUN", success: false); } else if (TrySpawnWeapon(candidateIds, position, rotation)) { SetStatus("SUCCESS: " + weaponDisplayName.ToUpper() + " SPAWNED", success: true); } else { SetStatus("ERROR: FAILED TO SPAWN " + weaponDisplayName.ToUpper(), success: false); } } catch (Exception ex) { Log.LogError((object)("Spawn error: " + ex)); SetStatus("ERROR: " + ex.Message.ToUpper(), success: false); } } private void ExecuteSpawnEnemy(string monsterName, int count) { //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) try { if (!GetEnemySpawnPosition(out var spawnPos, out var spawnRot)) { SetStatus("ERROR: PLAYER NOT IN RUN", success: false); return; } EnemySetup setup = FindEnemySetupFast(monsterName); if (count <= 2) { int num = 0; for (int i = 0; i < count; i++) { Vector3 val = (Vector3)((i == 0) ? Vector3.zero : new Vector3(Random.Range(-1.6f, 1.6f), 0f, Random.Range(-1.6f, 1.6f))); if (SpawnSingleEnemy(setup, monsterName, spawnPos + val, spawnRot)) { num++; } } if (num > 0) { string text = CapitalizeWords(monsterName); bottomNotificationText = num + "x " + text + " spawned."; bottomNotificationTimer = 4f; SetStatus(num + "x " + text.ToUpper() + " SPAWNED", success: true); } else { SetStatus("ERROR: FAILED TO SPAWN " + monsterName.ToUpper(), success: false); } } else { ((MonoBehaviour)this).StartCoroutine(SpawnEnemyBatchRoutine(setup, monsterName, count, spawnPos, spawnRot)); } } catch (Exception ex) { Log.LogError((object)("Spawn monster error: " + ex)); SetStatus("ERROR: " + ex.Message.ToUpper(), success: false); } } private IEnumerator SpawnEnemyBatchRoutine(EnemySetup setup, string monsterName, int count, Vector3 basePos, Quaternion baseRot) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) int successCount = 0; string formattedName = CapitalizeWords(monsterName); for (int i = 0; i < count; i++) { float angle = (float)i * 2.39996f; float radius = ((i == 0) ? 0f : (1.4f + 0.35f * Mathf.Sqrt((float)i))); Vector3 offset = new Vector3(Mathf.Cos(angle) * radius, 0f, Mathf.Sin(angle) * radius); Vector3 spawnPos = basePos + offset; if (SpawnSingleEnemy(setup, monsterName, spawnPos, baseRot)) { successCount++; } if (i % 2 == 1) { yield return null; } } if (successCount > 0) { bottomNotificationText = successCount + "x " + formattedName + " spawned."; bottomNotificationTimer = 4f; SetStatus(successCount + "x " + formattedName.ToUpper() + " SPAWNED", success: true); } else { SetStatus("ERROR: FAILED TO SPAWN " + monsterName.ToUpper(), success: false); } } private bool SpawnSingleEnemy(EnemySetup setup, string monsterName, Vector3 spawnPos, Quaternion baseRot) { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) bool flag = false; if ((Object)(object)setup != (Object)null) { if ((Object)(object)LevelGenerator.Instance != (Object)null) { try { LevelGenerator.Instance.EnemySpawn(setup, spawnPos); flag = true; } catch { } } if (!flag && setup.spawnObjects != null && setup.spawnObjects.Count > 0) { foreach (PrefabRef spawnObject in setup.spawnObjects) { if (spawnObject == null) { continue; } if (SemiFunc.IsMasterClient() && !string.IsNullOrEmpty(((PrefabRef<GameObject>)(object)spawnObject).ResourcePath)) { try { GameObject val = PhotonNetwork.InstantiateRoomObject(((PrefabRef<GameObject>)(object)spawnObject).ResourcePath, spawnPos, baseRot, (byte)0, (object[])null); if ((Object)(object)val != (Object)null) { flag = true; } } catch { } } if (flag || !((Object)(object)((PrefabRef<GameObject>)(object)spawnObject).Prefab != (Object)null)) { continue; } try { GameObject val2 = Object.Instantiate<GameObject>(((PrefabRef<GameObject>)(object)spawnObject).Prefab, spawnPos, baseRot); if ((Object)(object)val2 != (Object)null) { flag = true; } } catch { } } } } if (!flag) { flag = TrySpawnEnemyPrefab(monsterName, spawnPos, baseRot); } return flag; } private string CapitalizeWords(string str) { if (string.IsNullOrEmpty(str)) { return str; } string[] array = str.Split(new char[1] { ' ' }); for (int i = 0; i < array.Length; i++) { if (array[i].Length > 0) { array[i] = char.ToUpper(array[i][0]) + ((array[i].Length > 1) ? array[i].Substring(1).ToLower() : ""); } } return string.Join(" ", array); } private bool GetPlayerSpawnPoint(out Vector3 position, out Quaternion rotation) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) position = Vector3.zero; rotation = Quaternion.identity; try { PlayerAvatar val = SemiFunc.PlayerAvatarLocal(); if ((Object)(object)val != (Object)null && (Object)(object)((Component)val).transform != (Object)null) { position = ((Component)val).transform.position + ((Component)val).transform.forward * 1.8f + Vector3.up * 0.5f; rotation = ((Component)val).transform.rotation; return true; } } catch { } try { if ((Object)(object)PlayerController.instance != (Object)null && (Object)(object)((Component)PlayerController.instance).transform != (Object)null) { Transform transform = ((Component)PlayerController.instance).transform; position = transform.position + transform.forward * 1.8f + Vector3.up * 0.5f; rotation = transform.rotation; return true; } } catch { } try { if ((Object)(object)Camera.main != (Object)null) { Transform transform2 = ((Component)Camera.main).transform; position = transform2.position + transform2.forward * 1.8f + Vector3.up * 0.2f; rotation = transform2.rotation; return true; } } catch { } return false; } private bool GetEnemySpawnPosition(out Vector3 spawnPos, out Quaternion spawnRot) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) spawnPos = Vector3.zero; spawnRot = Quaternion.identity; try { PlayerAvatar val = SemiFunc.PlayerAvatarLocal(); Vector3 val2 = (((Object)(object)val != (Object)null && (Object)(object)((Component)val).transform != (Object)null) ? ((Component)val).transform.position : (((Object)(object)PlayerController.instance != (Object)null) ? ((Component)PlayerController.instance).transform.position : Vector3.zero)); if (val2 != Vector3.zero) { try { LevelPoint val3 = SemiFunc.LevelPointGet(val2, 6f, 25f); if ((Object)(object)val3 != (Object)null && (Object)(object)((Component)val3).transform != (Object)null && !val3.Truck) { spawnPos = ((Component)val3).transform.position; spawnRot = ((Component)val3).transform.rotation; return true; } } catch { } try { LevelPoint val4 = SemiFunc.LevelPointsGetClosestToLocalPlayer(); if ((Object)(object)val4 != (Object)null && (Object)(object)((Component)val4).transform != (Object)null && !val4.Truck) { spawnPos = ((Component)val4).transform.position; spawnRot = ((Component)val4).transform.rotation; return true; } } catch { } Vector3 val5 = (((Object)(object)val != (Object)null && (Object)(object)((Component)val).transform != (Object)null) ? ((Component)val).transform.forward : Vector3.forward); spawnPos = val2 + val5 * 8f + Vector3.up * 0.2f; spawnRot = (((Object)(object)val != (Object)null && (Object)(object)((Component)val).transform != (Object)null) ? ((Component)val).transform.rotation : Quaternion.identity); return true; } } catch { } return false; } private bool TrySpawnWeapon(string[] identifiers, Vector3 position, Quaternion rotation) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) Item val = FindItemAsset(identifiers); if ((Object)(object)val != (Object)null && val.prefab != null) { if (SemiFunc.IsMasterClient()) { string resourcePath = ((PrefabRef<GameObject>)(object)val.prefab).ResourcePath; if (!string.IsNullOrEmpty(resourcePath)) { try { GameObject val2 = PhotonNetwork.InstantiateRoomObject(resourcePath, position, rotation, (byte)0, (object[])null); if ((Object)(object)val2 != (Object)null) { return true; } } catch { } } } if ((Object)(object)((PrefabRef<GameObject>)(object)val.prefab).Prefab != (Object)null) { GameObject val3 = Object.Instantiate<GameObject>(((PrefabRef<GameObject>)(object)val.prefab).Prefab, position, rotation); if ((Object)(object)val3 != (Object)null) { return true; } } } List<string> list = new List<string>(); foreach (string text in identifiers) { list.Add("Items/" + text); list.Add("items/" + text); list.Add("Weapons/" + text); list.Add("weapons/" + text); list.Add("Prefabs/" + text); list.Add("prefabs/" + text); list.Add(text); } if (SemiFunc.IsMasterClient()) { foreach (string item in list) { try { GameObject val4 = PhotonNetwork.InstantiateRoomObject(item, position, rotation, (byte)0, (object[])null); if ((Object)(object)val4 != (Object)null) { return true; } } catch { } } } foreach (string item2 in list) { try { GameObject val5 = Resources.Load<GameObject>(item2); if ((Object)(object)val5 != (Object)null) { GameObject val6 = Object.Instantiate<GameObject>(val5, position, rotation); if ((Object)(object)val6 != (Object)null) { return true; } } } catch { } } return false; } private bool TrySpawnEnemyPrefab(string monsterName, Vector3 spawnPos, Quaternion spawnRot) { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) string text = monsterName.Replace(" ", ""); string[] array = new string[8] { "Enemy " + monsterName, "Enemy" + text, "Enemy_" + text, monsterName, text, "Enemies/" + monsterName, "Enemies/Enemy " + monsterName, "Enemies/Enemy" + text }; if (SemiFunc.IsMasterClient()) { string[] array2 = array; foreach (string text2 in array2) { try { GameObject val = PhotonNetwork.InstantiateRoomObject(text2, spawnPos, spawnRot, (byte)0, (object[])null); if ((Object)(object)val != (Object)null) { return true; } } catch { } } } string[] array3 = array; foreach (string text3 in array3) { try { GameObject val2 = Resources.Load<GameObject>(text3); if ((Object)(object)val2 != (Object)null) { GameObject val3 = Object.Instantiate<GameObject>(val2, spawnPos, spawnRot); if ((Object)(object)val3 != (Object)null) { return true; } } } catch { } } return false; } private EnemySetup FindEnemySetupFast(string monsterName) { if (string.IsNullOrEmpty(monsterName)) { return null; } if (enemySetupCache.TryGetValue(monsterName, out var value) && (Object)(object)value != (Object)null) { return value; } try { if ((Object)(object)EnemyDirector.instance != (Object)null) { EnemySetup val = CheckSetupList(EnemyDirector.instance.enemiesDifficulty1, monsterName); if ((Object)(object)val == (Object)null) { val = CheckSetupList(EnemyDirector.instance.enemiesDifficulty2, monsterName); } if ((Object)(object)val == (Object)null) { val = CheckSetupList(EnemyDirector.instance.enemiesDifficulty3, monsterName); } if ((Object)(object)val != (Object)null) { enemySetupCache[monsterName] = val; return val; } } } catch { } return null; } private EnemySetup CheckSetupList(List<EnemySetup> list, string monsterName) { if (list == null) { return null; } string value = monsterName.Replace(" ", ""); for (int i = 0; i < list.Count; i++) { EnemySetup val = list[i]; if (!((Object)(object)val == (Object)null) && !string.IsNullOrEmpty(((Object)val).name) && (((Object)val).name.IndexOf(monsterName, StringComparison.OrdinalIgnoreCase) >= 0 || ((Object)val).name.Replace(" ", "").IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0)) { return val; } } return null; } private Item FindItemAsset(string[] identifiers) { try { if ((Object)(object)StatsManager.instance != (Object)null && StatsManager.instance.itemDictionary != null) { foreach (KeyValuePair<string, Item> item in StatsManager.instance.itemDictionary) { foreach (string value in identifiers) { if (item.Key != null && item.Key.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0) { return item.Value; } if ((Object)(object)item.Value != (Object)null && item.Value.itemName != null && item.Value.itemName.IndexOf(value, StringComparison.OrdinalIgnoreCase) >= 0) { return item.Value; } } } } } catch { } try { Item[] array = Resources.LoadAll<Item>("ScriptableObjects"); if (array != null) { Item[] array2 = array; foreach (Item val in array2) { if ((Object)(object)val == (Object)null) { continue; } foreach (string value2 in identifiers) { if (((Object)val).name != null && ((Object)val).name.IndexOf(value2, StringComparison.OrdinalIgnoreCase) >= 0) { return val; } if (val.itemName != null && val.itemName.IndexOf(value2, StringComparison.OrdinalIgnoreCase) >= 0) { return val; } } } } } catch { } return null; } }