public static void Initialize(AdventureDataConfig config) { Config = config; SecretStash = new SecretStashAdventureFeature(); Gamble = new GambleAdventureFeature(); TreasureMaps = new TreasureMapsAdventureFeature(); Bounties = new BountiesAdventureFeature(); }
public static bool Prefix(Console __instance) { var input = __instance.m_input.text; var args = input.Split(' '); if (args.Length == 0) { return(true); } var player = Player.m_localPlayer; var command = args[0]; if (CheatCommand(command, "magicitem", "mi")) { MagicItem(__instance, args); } else if (CheatCommand(command, "magicitemwitheffect", "mieffect")) { SpawnMagicItemWithEffect(__instance, args); } else if (Command(command, "checkstackquality")) { CheckStackQuality(__instance); } else if (CheatCommand(command, "magicmats")) { SpawnMagicCraftingMaterials(); } else if (CheatCommand(command, "alwaysdrop")) { ToggleAlwaysDrop(__instance); } else if (CheatCommand(command, "cheatgating")) { LootRoller.CheatDisableGating = !LootRoller.CheatDisableGating; __instance.AddString($"> Disable gating for magic item drops: {LootRoller.CheatDisableGating}"); } else if (CheatCommand(command, "testtreasuremap", "testtm")) { TestTreasureMap(args); } else if (Command(command, "resettreasuremap", "resettm")) { var saveData = player.GetAdventureSaveData(); saveData.TreasureMaps.Clear(); saveData.NumberOfTreasureMapsOrBountiesStarted = 0; player.SaveAdventureSaveData(); } else if (Command(command, "debugtreasuremap", "debugtm")) { Minimap_Patch.DebugMode = !Minimap_Patch.DebugMode; __instance.AddString($"> Treasure Map Debug Mode: {Minimap_Patch.DebugMode}"); } else if (Command(command, "resetbounties")) { var saveData = player.GetAdventureSaveData(); saveData.Bounties.Clear(); player.SaveAdventureSaveData(); } else if (Command(command, "testbountynames")) { var random = new Random(); var count = (args.Length >= 2) ? int.Parse(args[1]) : 10; for (var i = 0; i < count; ++i) { var name = BountiesAdventureFeature.GenerateTargetName(random); __instance.AddString(name); } } else if (Command(command, "resetadventure")) { var adventureComponent = player.GetComponent <AdventureComponent>(); adventureComponent.SaveData = new AdventureSaveDataList(); player.SaveAdventureSaveData(); } else if (Command(command, "bounties")) { var interval = (args.Length >= 2) ? int.Parse(args[1]) : AdventureDataManager.Bounties.GetCurrentInterval(); var availableBounties = AdventureDataManager.Bounties.GetAvailableBounties(interval, false); BountiesAdventureFeature.PrintBounties($"Bounties for Interval {interval}:", availableBounties); } else if (Command(command, "playerbounties")) { var availableBounties = player.GetAdventureSaveData().Bounties; BountiesAdventureFeature.PrintBounties($"Player Bounties:", availableBounties); } else if (CheatCommand(command, "timescale", "ts")) { var timeScale = (args.Length >= 2) ? float.Parse(args[1]) : 1; Time.timeScale = timeScale; } else if (CheatCommand(command, "gotomerchant", "gotom")) { if (ZoneSystem.instance.FindClosestLocation("Vendor_BlackForest", player.transform.position, out var location)) { player.TeleportTo(location.m_position + Vector3.right * 5, player.transform.rotation, true); } } else if (Command(command, "globalkeys")) { if (ZoneSystem.instance != null) { __instance.AddString("> Print Global Keys:"); foreach (var globalKey in ZoneSystem.instance.GetGlobalKeys()) { __instance.AddString("> " + globalKey); } } } return(true); }
public static void Postfix() { var player = Player.m_localPlayer; new Terminal.ConsoleCommand("magicitem", "", (args => { MagicItem(args.Context, args.Args); }), true); new Terminal.ConsoleCommand("mi", "", (args => { MagicItem(args.Context, args.Args); }), true); new Terminal.ConsoleCommand("magicitemwitheffect", "", (args => { SpawnMagicItemWithEffect(args.Context, args.Args); }), true); new Terminal.ConsoleCommand("mieffect", "", (args => { SpawnMagicItemWithEffect(args.Context, args.Args); }), true); new Terminal.ConsoleCommand("magicitemlegendary", "", (args => { SpawnLegendaryMagicItem(args.Context, args.Args); }), true); new Terminal.ConsoleCommand("milegend", "", (args => { SpawnLegendaryMagicItem(args.Context, args.Args); }), true); new Terminal.ConsoleCommand("magicitemset", "", (args => { SpawnMagicItemSet(args.Context, args.Args); }), true); new Terminal.ConsoleCommand("miset", "", (args => { SpawnMagicItemSet(args.Context, args.Args); }), true); new Terminal.ConsoleCommand("checkstackquality", "", (args => { CheckStackQuality(args.Context); })); new Terminal.ConsoleCommand("magicmats", "", (args => { SpawnMagicCraftingMaterials(); }), true); new Terminal.ConsoleCommand("alwaysdrop", "", (args => { ToggleAlwaysDrop(args.Context); }), true); new Terminal.ConsoleCommand("cheatgating", "", (args => { LootRoller.CheatDisableGating = !LootRoller.CheatDisableGating; args.Context.AddString($"> Disable gating for magic item drops: {LootRoller.CheatDisableGating}"); }), true); new Terminal.ConsoleCommand("testtreasuremap", "", (args => { TestTreasureMap(args.Args); }), true); new Terminal.ConsoleCommand("testtm", "", (args => { TestTreasureMap(args.Args); }), true); new Terminal.ConsoleCommand("resettreasuremap", "", (args => { var saveData = player.GetAdventureSaveData(); saveData.TreasureMaps.Clear(); saveData.NumberOfTreasureMapsOrBountiesStarted = 0; player.SaveAdventureSaveData(); })); new Terminal.ConsoleCommand("resettm", "", (args => { var saveData = player.GetAdventureSaveData(); saveData.TreasureMaps.Clear(); saveData.NumberOfTreasureMapsOrBountiesStarted = 0; player.SaveAdventureSaveData(); })); new Terminal.ConsoleCommand("debugtreasuremap", "", (args => { Minimap_Patch.DebugMode = !Minimap_Patch.DebugMode; args.Context.AddString($"> Treasure Map Debug Mode: {Minimap_Patch.DebugMode}"); })); new Terminal.ConsoleCommand("debugtm", "", (args => { Minimap_Patch.DebugMode = !Minimap_Patch.DebugMode; args.Context.AddString($"> Treasure Map Debug Mode: {Minimap_Patch.DebugMode}"); })); new Terminal.ConsoleCommand("resetbounties", "", (args => { var saveData = player.GetAdventureSaveData(); saveData.Bounties.Clear(); player.SaveAdventureSaveData(); })); new Terminal.ConsoleCommand("testbountynames", "", (args => { var random = new Random(); var count = (args.Length >= 2) ? int.Parse(args[1]) : 10; for (var i = 0; i < count; ++i) { var name = BountiesAdventureFeature.GenerateTargetName(random); args.Context.AddString(name); } })); new Terminal.ConsoleCommand("resetadventure", "", (args => { var adventureComponent = player.GetComponent <AdventureComponent>(); adventureComponent.SaveData = new AdventureSaveDataList(); player.SaveAdventureSaveData(); })); new Terminal.ConsoleCommand("bounties", "", (args => { var interval = (args.Length >= 2) ? int.Parse(args[1]) : AdventureDataManager.Bounties.GetCurrentInterval(); var availableBounties = AdventureDataManager.Bounties.GetAvailableBounties(interval, false); BountiesAdventureFeature.PrintBounties($"Bounties for Interval {interval}:", availableBounties); })); new Terminal.ConsoleCommand("playerbounties", "", (args => { var availableBounties = player.GetAdventureSaveData().Bounties; BountiesAdventureFeature.PrintBounties($"Player Bounties:", availableBounties); })); new Terminal.ConsoleCommand("timescale", "", (args => { var timeScale = (args.Length >= 2) ? float.Parse(args[1]) : 1; Time.timeScale = timeScale; }), true); new Terminal.ConsoleCommand("ts", "", (args => { var timeScale = (args.Length >= 2) ? float.Parse(args[1]) : 1; Time.timeScale = timeScale; }), true); new Terminal.ConsoleCommand("gotomerchant", "", (args => { if (ZoneSystem.instance.FindClosestLocation("Vendor_BlackForest", player.transform.position, out var location)) { player.TeleportTo(location.m_position + Vector3.right * 5, player.transform.rotation, true); } }), true); new Terminal.ConsoleCommand("gotom", "", (args => { if (ZoneSystem.instance.FindClosestLocation("Vendor_BlackForest", player.transform.position, out var location)) { player.TeleportTo(location.m_position + Vector3.right * 5, player.transform.rotation, true); } }), true); new Terminal.ConsoleCommand("globalkeys", "", (args => { if (ZoneSystem.instance != null) { args.Context.AddString("> Print Global Keys:"); foreach (var globalKey in ZoneSystem.instance.GetGlobalKeys()) { args.Context.AddString("> " + globalKey); } } })); new Terminal.ConsoleCommand("fixresistances", "", (args => { FixResistances(player); })); new Terminal.ConsoleCommand("lucktest", "", (args => { var lootTable = args.Length > 1 ? args[1] : "Greydwarf"; var luckFactor = args.Length > 2 ? float.Parse(args[2]) : 0; LootRoller.PrintLuckTest(lootTable, luckFactor); })); new Terminal.ConsoleCommand("lootres", "", (args => { var lootTable = args.Length > 1 ? args[1] : "Greydwarf"; var level = args.Length > 2 ? int.Parse(args[2]) : 1; var itemIndex = args.Length > 3 ? int.Parse(args[3]) : 0; LootRoller.PrintLootResolutionTest(lootTable, level, itemIndex); })); new Terminal.ConsoleCommand("resetcooldowns", "", (args => { if (player != null) { var abilityController = player.GetComponent <AbilityController>(); if (abilityController != null) { foreach (var ability in abilityController.CurrentAbilities) { ability.ResetCooldown(); } } } }), true); new Terminal.ConsoleCommand("debugluck", "", (args => { LootRoller.DebugLuckFactor(); })); }