Decompiled source of Lotus Ecarlate Changes v0.6.46
plugins/LotusEcarlateChanges.dll
Decompiled 4 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AuthoritativeConfig; using Backpacks; using BalrondHumanoidRandomizer; using BalrondShipyard; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BowsBeforeHoes; using CapeAndTorchResistanceChanges; using ClayBuildPieces.Functions; using CreatureManager; using HarmonyLib; using ItemDataManager; using ItemManager; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using LocationManager; using LotusEcarlateChanges.Changes.JotunnBased; using LotusEcarlateChanges.Changes.Manual; using LotusEcarlateChanges.Changes.Manual.RenegadeVikingsChanges.Archetypes; using LotusEcarlateChanges.Changes.Manual.RenegadeVikingsChanges.Archetypes.BlackForest; using LotusEcarlateChanges.Changes.Manual.RenegadeVikingsChanges.Archetypes.Meadows; using LotusEcarlateChanges.Changes.Manual.RenegadeVikingsChanges.Archetypes.Mistlands; using LotusEcarlateChanges.Changes.Manual.RenegadeVikingsChanges.Archetypes.Mountain; using LotusEcarlateChanges.Changes.Manual.RenegadeVikingsChanges.Archetypes.Plains; using LotusEcarlateChanges.Changes.Manual.RenegadeVikingsChanges.Archetypes.Swamp; using LotusEcarlateChanges.Changes.Manual.RenegadeVikingsChanges.Tiers; using LotusEcarlateChanges.Changes.StandaloneManagerBased; using LotusEcarlateChanges.Extensions; using LotusEcarlateChanges.Model.Changes; using LotusEcarlateChanges.Model.Managers; using LotusEcarlateChanges.Model.Managers.Jotunn; using LotusEcarlateChanges.Model.Managers.Manual; using LotusEcarlateChanges.Model.Managers.Standalone; using LotusEcarlateChanges.Model.Wrappers; using LotusEcarlateChanges.Model.Wrappers.Nested; using Microsoft.CodeAnalysis; using PieceManager; using RenegadeVikings.Functions; using RenegadeVikings.Utilities; using RenegadeVikings.VikingsData.Overlord; using RenegadeVikings.VikingsData.Renegade; using SpeedyPaths; using TMPro; using UnityEngine; using UnityEngine.InputSystem; using Valheim.FallDamageForCreatures; using VentureValheim.Progression; using Warfare; using neobotics.ValheimMods; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Backpacks")] [assembly: IgnoresAccessChecksTo("BalrondContainers")] [assembly: IgnoresAccessChecksTo("BalrondHumanoidRandomizer")] [assembly: IgnoresAccessChecksTo("BalrondShipyard")] [assembly: IgnoresAccessChecksTo("BowsBeforeHoes")] [assembly: IgnoresAccessChecksTo("CapeAndTorchResistanceChanges")] [assembly: IgnoresAccessChecksTo("ClayBuildPieces")] [assembly: IgnoresAccessChecksTo("Clutter")] [assembly: IgnoresAccessChecksTo("CoreWoodPieces")] [assembly: IgnoresAccessChecksTo("FineWoodBuildPieces")] [assembly: IgnoresAccessChecksTo("Jotunn")] [assembly: IgnoresAccessChecksTo("MaxAxe")] [assembly: IgnoresAccessChecksTo("Microsoft.CSharp")] [assembly: IgnoresAccessChecksTo("MonsterLabZ")] [assembly: IgnoresAccessChecksTo("Monstrum")] [assembly: IgnoresAccessChecksTo("moregates++")] [assembly: IgnoresAccessChecksTo("RefinedStonePieces")] [assembly: IgnoresAccessChecksTo("RenegadeVikings")] [assembly: IgnoresAccessChecksTo("RtDBiomes")] [assembly: IgnoresAccessChecksTo("SouthsilArmor")] [assembly: IgnoresAccessChecksTo("SpeedyPaths")] [assembly: IgnoresAccessChecksTo("System.Data.DataSetExtensions")] [assembly: IgnoresAccessChecksTo("Valheim.FallDamageForCreatures")] [assembly: IgnoresAccessChecksTo("VentureValheim.Progression")] [assembly: IgnoresAccessChecksTo("Warfare")] [assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] [assembly: AssemblyCompany("LotusEcarlateChanges")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.6.46.0")] [assembly: AssemblyInformationalVersion("0.6.46+71691f3cd060381da9a491d1627b8976c9812f35")] [assembly: AssemblyProduct("LotusEcarlateChanges")] [assembly: AssemblyTitle("LotusEcarlateChanges")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.6.46.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace LotusEcarlateChanges { [BepInPlugin("nbusseneau.LotusEcarlateChanges", "LotusEcarlateChanges", "0.6.46")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string ModGUID = "nbusseneau.LotusEcarlateChanges"; private const string ModName = "LotusEcarlateChanges"; private const string ModVersion = "0.6.46"; public static ManualLogSource Logger { get; private set; } public static Harmony Harmony { get; } = new Harmony("nbusseneau.LotusEcarlateChanges"); public void Awake() { Logger = ((BaseUnityPlugin)this).Logger; List<IChanges> list = new List<IChanges>(29); list.Add(new Clutter()); list.Add(new CustomSkills()); list.Add(new MoreGates()); list.Add(new RtDBiomes()); list.Add(new Backpacks()); list.Add(new BowsBeforeHoes()); list.Add(new ClayBuildPieces()); list.Add(new CoreWoodPieces()); list.Add(new FineWoodBuildPieces()); list.Add(new MonsterLabZ()); list.Add(new Monstrum()); list.Add(new RefinedStonePieces()); list.Add(new SouthsilArmor()); list.Add(new Warfare()); list.Add(new BalrondContainers()); list.Add(new BalrondHumanoidRandomizer()); list.Add(new BalrondShipyard()); list.Add(new CapeAndTorchResistanceChanges()); list.Add(new CustomKeyHints()); list.Add(new FallDamageForCreatures()); list.Add(new Lightsources()); list.Add(new MaxAxe()); list.Add(new RenegadeVikings()); list.Add(new SpeedyPaths()); list.Add(new Tutorials()); list.Add(new VanillaMisc()); list.Add(new VanillaArmors()); list.Add(new VanillaWeapons()); list.Add(new WorldAdvancementProgression()); list.ForEach(delegate(IChanges changes) { changes.Apply(); }); } } } namespace LotusEcarlateChanges.Model.Wrappers { public class ItemWrapper : PrefabWrapperBase { private Recipe _recipe; private ResourcesWrapper _resources; private readonly ArmorWrapper _armor; private readonly FoodWrapper _food; private readonly SetWrapper _set; private readonly WeaponWrapper _weapon; public ItemData ItemData { get; } public SharedData SharedData { get; } public PieceTable PieceTable { get; } public List<GameObject> Pieces { get; } public Recipe Recipe { get { if (_recipe != null) { return _recipe; } Recipe recipe = ObjectDB.instance.GetRecipe(ItemData); if (recipe != null) { return _recipe = recipe; } return null; } } public ResourcesWrapper Resources { get { if (_resources != null) { return _resources; } if (Recipe != null) { return _resources = new ResourcesWrapper(Recipe); } return null; } } public Sprite Icon => ItemData.GetIcon(); public ArmorWrapper Armor { get { return _armor; } set { _armor.CopyProperties(value); } } public FoodWrapper Food { get { return _food; } set { _food.CopyProperties(value); } } public SetWrapper Set { get { return _set; } set { _set.CopyProperties(value); } } public WeaponWrapper Weapon { get { return _weapon; } set { _weapon.CopyProperties(value); } } protected ItemWrapper(GameObject prefab) : base(prefab) { ItemData = base.Prefab.GetComponent<ItemDrop>().m_itemData; SharedData = ItemData.m_shared; PieceTable = SharedData.m_buildPieces; Pieces = PieceTable?.m_pieces; _armor = new ArmorWrapper(SharedData); _food = new FoodWrapper(SharedData); _set = new SetWrapper(SharedData); _weapon = new WeaponWrapper(SharedData); } public static ItemWrapper Get(GameObject prefab) { if (prefab == null) { return null; } if (!PrefabWrapperBase.s_wrappersCache.TryGetValue(((Object)prefab).name, out var value)) { PrefabWrapperBase prefabWrapperBase2 = (PrefabWrapperBase.s_wrappersCache[((Object)prefab).name] = new ItemWrapper(prefab)); value = prefabWrapperBase2; } return (ItemWrapper)value; } } public class PieceWrapper : PrefabWrapperBase { private readonly ComfortWrapper _comfort; public Piece Piece { get; } public CraftingStation CraftingStation { get { return Piece.m_craftingStation; } set { Piece.m_craftingStation = value; } } public PieceCategory Category { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return Piece.m_category; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) Piece.m_category = value; } } public ComfortWrapper Comfort { get { return _comfort; } set { _comfort.CopyProperties(value); } } public ResourcesWrapper Resources { get; } protected PieceWrapper(GameObject prefab) : base(prefab) { Piece = base.Prefab.GetComponent<Piece>(); _comfort = new ComfortWrapper(Piece); Resources = new ResourcesWrapper(Piece); } public static PieceWrapper Get(GameObject prefab) { if (prefab == null) { return null; } if (!PrefabWrapperBase.s_wrappersCache.TryGetValue(((Object)prefab).name, out var value)) { PrefabWrapperBase prefabWrapperBase2 = (PrefabWrapperBase.s_wrappersCache[((Object)prefab).name] = new PieceWrapper(prefab)); value = prefabWrapperBase2; } return (PieceWrapper)value; } } public abstract class PrefabWrapperBase { protected static readonly Dictionary<string, PrefabWrapperBase> s_wrappersCache = new Dictionary<string, PrefabWrapperBase>(); public GameObject Prefab { get; } public string PrefabName => ((Object)Prefab).name; protected PrefabWrapperBase(GameObject prefab) { Prefab = prefab; base..ctor(); } } } namespace LotusEcarlateChanges.Model.Wrappers.Nested { public class ArmorWrapper { private readonly SharedData _sharedData; public float ArmorBase { get { return _sharedData.m_armor; } set { _sharedData.m_armor = value; } } public float ArmorPerLevel { get { return _sharedData.m_armorPerLevel; } set { _sharedData.m_armorPerLevel = value; } } public List<DamageModPair> DamageModifiers { get { return _sharedData.m_damageModifiers; } set { _sharedData.m_damageModifiers = value; } } public float MovementModifier { get { return _sharedData.m_movementModifier; } set { _sharedData.m_movementModifier = value; } } public float EitrRegenModifier { get { return _sharedData.m_eitrRegenModifier; } set { _sharedData.m_eitrRegenModifier = value; } } public float Weight { get { return _sharedData.m_weight; } set { _sharedData.m_weight = value; } } public SE_Stats EquipEffect { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown return (SE_Stats)_sharedData.m_equipStatusEffect; } set { _sharedData.m_equipStatusEffect = (StatusEffect)(object)value; } } public ArmorWrapper(SharedData sharedData) { _sharedData = sharedData; base..ctor(); } } public class ComfortWrapper { private readonly Piece _piece; public int Value { get { return _piece.m_comfort; } set { _piece.m_comfort = value; } } public ComfortGroup Group { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _piece.m_comfortGroup; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) _piece.m_comfortGroup = value; } } public ComfortWrapper(Piece piece) { _piece = piece; base..ctor(); } } public class FoodWrapper { private readonly SharedData _sharedData; public float Health { get { return _sharedData.m_food; } set { _sharedData.m_food = value; } } public float Stamina { get { return _sharedData.m_foodStamina; } set { _sharedData.m_foodStamina = value; } } public float Eitr { get { return _sharedData.m_foodEitr; } set { _sharedData.m_foodEitr = value; } } public float Duration { get { return _sharedData.m_foodBurnTime; } set { _sharedData.m_foodBurnTime = value; } } public float Regen { get { return _sharedData.m_foodRegen; } set { _sharedData.m_foodRegen = value; } } public FoodWrapper(SharedData sharedData) { _sharedData = sharedData; base..ctor(); } } public class ResourcesWrapper { private readonly Piece _piece; private readonly Recipe _recipe; private readonly Dictionary<string, Requirement> _resources; public ResourcesWrapper(Piece piece) { _piece = piece; _resources = piece.m_resources.ToDictionary((Requirement r) => ((Object)r.m_resItem).name); } public ResourcesWrapper(Recipe recipe) { _recipe = recipe; _resources = recipe.m_resources.ToDictionary((Requirement r) => ((Object)r.m_resItem).name); } private void Save() { int num; Requirement[] array; if (_piece != null) { Piece piece = _piece; Dictionary<string, Requirement>.ValueCollection values = _resources.Values; num = 0; array = (Requirement[])(object)new Requirement[values.Count]; foreach (Requirement item in values) { array[num] = item; num++; } piece.m_resources = array; } if (_recipe == null) { return; } Recipe recipe = _recipe; Dictionary<string, Requirement>.ValueCollection values2 = _resources.Values; num = 0; array = (Requirement[])(object)new Requirement[values2.Count]; foreach (Requirement item2 in values2) { array[num] = item2; num++; } recipe.m_resources = array; } private void Add(string itemName, int amount) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown if (!_resources.TryGetValue(itemName, out var value)) { value = new Requirement { m_resItem = ObjectDB.instance.GetItemPrefab(itemName).GetComponent<ItemDrop>() }; _resources[itemName] = value; } value.m_amount = amount; } public void Add(string itemName, int amount, bool recover = true) { Add(itemName, amount); _resources[itemName].m_recover = recover; Save(); } public void Add(string itemName, int amount, int amountPerLevel) { Add(itemName, amount); _resources[itemName].m_amountPerLevel = amountPerLevel; Save(); } public void Clear() { _resources.Clear(); Save(); } } public class SetWrapper { private readonly SharedData _sharedData; public SE_Stats Effect { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown return (SE_Stats)_sharedData.m_setStatusEffect; } set { _sharedData.m_setStatusEffect = (StatusEffect)(object)value; } } public string Name { get { return _sharedData.m_setName; } set { _sharedData.m_setName = value; if (Effect != null) { ((Object)Effect).name = "SetEffect_" + value; } } } public int Size { get { return _sharedData.m_setSize; } set { _sharedData.m_setSize = value; } } public SetWrapper(SharedData sharedData) { _sharedData = sharedData; base..ctor(); } } public class WeaponWrapper { private readonly SharedData _sharedData; public DamageTypes Damages { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _sharedData.m_damages; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) _sharedData.m_damages = value; } } public DamageTypes DamagesPerLevel { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _sharedData.m_damagesPerLevel; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) _sharedData.m_damagesPerLevel = value; } } public float Knockback { get { return _sharedData.m_attackForce; } set { _sharedData.m_attackForce = value; } } public float BackstabBonus { get { return _sharedData.m_backstabBonus; } set { _sharedData.m_backstabBonus = value; } } public Attack PrimaryAttack { get { return _sharedData.m_attack; } set { _sharedData.m_attack = value; } } public Attack SecondaryAttack { get { return _sharedData.m_secondaryAttack; } set { _sharedData.m_secondaryAttack = value; } } public SE_Stats AttackEffect { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown return (SE_Stats)_sharedData.m_attackStatusEffect; } set { _sharedData.m_attackStatusEffect = (StatusEffect)(object)value; } } public float BlockArmor { get { return _sharedData.m_blockPower; } set { _sharedData.m_blockPower = value; } } public float BlockArmorPerLevel { get { return _sharedData.m_blockPowerPerLevel; } set { _sharedData.m_blockPowerPerLevel = value; } } public float BlockForce { get { return _sharedData.m_deflectionForce; } set { _sharedData.m_deflectionForce = value; } } public float BlockForcePerLevel { get { return _sharedData.m_deflectionForcePerLevel; } set { _sharedData.m_deflectionForcePerLevel = value; } } public float ParryBonus { get { return _sharedData.m_timedBlockBonus; } set { _sharedData.m_timedBlockBonus = value; } } public float MovementModifier { get { return _sharedData.m_movementModifier; } set { _sharedData.m_movementModifier = value; } } public float Weight { get { return _sharedData.m_weight; } set { _sharedData.m_weight = value; } } public SkillType SkillType { get { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return _sharedData.m_skillType; } set { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) _sharedData.m_skillType = value; } } public SE_Stats EquipEffect { get { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown return (SE_Stats)_sharedData.m_equipStatusEffect; } set { _sharedData.m_equipStatusEffect = (StatusEffect)(object)value; } } public WeaponWrapper(SharedData sharedData) { _sharedData = sharedData; base..ctor(); } } } namespace LotusEcarlateChanges.Model.Managers { public interface IIndexableManager<T> : IManager, IEnumerable<T>, IEnumerable { T this[string name] { get; } IEnumerable<T> this[params string[] names] { get; } } public interface IManager { void Remove(params string[] names); void Remove(IEnumerable<string> names); void Keep(params string[] names); void Keep(IEnumerable<string> names); void Apply(); } } namespace LotusEcarlateChanges.Model.Managers.Standalone { public class CreatureManager<T> : PrefabManagerBase<T>, IIndexableManager<T>, IManager, IEnumerable<T>, IEnumerable { public T this[string name] => GetObject(name); public IEnumerable<T> this[params string[] names] => from name in names select this[name] into c where c != null select c; public CreatureManager(List<T> registeredCreatures, List<GameObject> prefabs) : base(registeredCreatures, prefabs) { } public IEnumerator<T> GetEnumerator() { return _registeredObjects.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class ItemManager<T> : PrefabManagerBase<T>, IIndexableManager<(T Item, ItemWrapper Wrapper)>, IManager, IEnumerable<(T Item, ItemWrapper Wrapper)>, IEnumerable { private readonly List<GameObject> _zNetOnlyPrefabs; public (T Item, ItemWrapper Wrapper) this[string name] { get { T @object = GetObject(name); return (@object, ItemWrapper.Get(GetPrefab(@object))); } } public IEnumerable<(T Item, ItemWrapper Wrapper)> this[params string[] names] => from name in names select this[name] into t where t.Item != null select t; public ItemManager(List<T> registeredItems, List<GameObject> prefabs, List<GameObject> zNetOnlyPrefabs) { _zNetOnlyPrefabs = zNetOnlyPrefabs; base..ctor(registeredItems, prefabs); } protected override void ApplyToRemove() { base.ApplyToRemove(); _zNetOnlyPrefabs.RemoveAll((GameObject prefab) => _toRemove.Contains(((Object)prefab).name)); } protected override void ApplyToKeep() { base.ApplyToKeep(); _zNetOnlyPrefabs.RemoveAll((GameObject prefab) => !_toKeep.Contains(((Object)prefab).name)); } public IEnumerator<(T Item, ItemWrapper Wrapper)> GetEnumerator() { return _registeredObjects.Select((T obj) => (obj, ItemWrapper.Get(GetPrefab(obj)))).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class LocationManager<T> : StandaloneManagerBase<T>, IIndexableManager<T>, IManager, IEnumerable<T>, IEnumerable { public T this[string name] => GetObject(name); public IEnumerable<T> this[params string[] names] => from name in names select this[name] into l where l != null select l; public LocationManager(List<T> registeredLocations) : base(registeredLocations) { } protected override string GetName(T location) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) return ((Object)(Location)AccessTools.Field(location.GetType(), "location").GetValue(location)).name; } public IEnumerator<T> GetEnumerator() { return _registeredObjects.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public class PieceManager<T> : PrefabManagerBase<T>, IIndexableManager<(T BuildPiece, PieceWrapper Wrapper)>, IManager, IEnumerable<(T BuildPiece, PieceWrapper Wrapper)>, IEnumerable { public (T BuildPiece, PieceWrapper Wrapper) this[string name] { get { T @object = GetObject(name); return (@object, PieceWrapper.Get(GetPrefab(@object))); } } public IEnumerable<(T BuildPiece, PieceWrapper Wrapper)> this[params string[] names] => from name in names select this[name] into t where t.BuildPiece != null select t; public PieceManager(List<T> registeredPieces, List<GameObject> piecePrefabs) : base(registeredPieces, piecePrefabs) { } public IEnumerator<(T BuildPiece, PieceWrapper Wrapper)> GetEnumerator() { return _registeredObjects.Select((T obj) => (obj, PieceWrapper.Get(GetPrefab(obj)))).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public abstract class PrefabManagerBase<T> : StandaloneManagerBase<T> { protected readonly List<GameObject> _prefabs; protected PrefabManagerBase(List<T> registeredObjects, List<GameObject> prefabs) { _prefabs = prefabs; base..ctor(registeredObjects); } protected GameObject GetPrefab(T obj) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown if (obj == null) { return null; } return (GameObject)AccessTools.Field(obj.GetType(), "Prefab").GetValue(obj); } protected override string GetName(T obj) { GameObject prefab = GetPrefab(obj); if (prefab == null) { return null; } return ((Object)prefab).name; } protected override void ApplyToRemove() { base.ApplyToRemove(); _prefabs.RemoveAll((GameObject prefab) => _toRemove.Contains(((Object)prefab).name)); } protected override void ApplyToKeep() { base.ApplyToKeep(); _prefabs.RemoveAll((GameObject prefab) => !_toKeep.Contains(((Object)prefab).name)); } } public abstract class StandaloneManagerBase<T> : IManager { protected readonly List<T> _registeredObjects; protected readonly Dictionary<string, T> _objectsCache; protected readonly HashSet<string> _toRemove; protected readonly HashSet<string> _toKeep; protected StandaloneManagerBase(List<T> registeredObjects) { _registeredObjects = registeredObjects; _objectsCache = new Dictionary<string, T>(); _toRemove = new HashSet<string>(); _toKeep = new HashSet<string>(); base..ctor(); } protected abstract string GetName(T obj); protected T GetObject(string name, bool logError = true) { if (!_objectsCache.TryGetValue(name, out var value)) { value = _registeredObjects.SingleOrDefault((T obj) => GetName(obj) == name); if (value != null) { _objectsCache[name] = value; } else if (logError) { Plugin.Logger.LogError((object)$"{GetType()} did not find any object registered with name {name}"); } } return value; } public void Remove(params string[] names) { _toRemove.UnionWith(names); } public void Remove(IEnumerable<string> names) { _toRemove.UnionWith(names); } public void Keep(params string[] names) { _toKeep.UnionWith(names); } public void Keep(IEnumerable<string> names) { _toKeep.UnionWith(names); } public void Apply() { if (_toRemove.Any() && _toKeep.Any()) { Plugin.Logger.LogError((object)"Can't have both object names to remove and object names to keep at the same time."); } else if (_toRemove.Any()) { ApplyToRemove(); } else if (_toKeep.Any()) { ApplyToKeep(); } } protected virtual void ApplyToRemove() { foreach (string item in _toRemove) { _registeredObjects.Remove(GetObject(item, logError: false)); } } protected virtual void ApplyToKeep() { IEnumerable<T> objectsToKeep = from name in _toKeep select GetObject(name, logError: false) into obj where obj != null select obj; _registeredObjects.RemoveAll((T obj) => !objectsToKeep.Contains(obj)); } } public class TherzieCreatureManager<T, Y> : PrefabManagerBase<T>, IIndexableManager<(T Creature, IEnumerable<Y> Spawners)>, IManager, IEnumerable<(T Creature, IEnumerable<Y> Spawners)>, IEnumerable { private readonly List<Y> _registeredSpawners; public (T Creature, IEnumerable<Y> Spawners) this[string name] { get { T @object = GetObject(name); return (@object, GetSpawners(@object)); } } public IEnumerable<(T Creature, IEnumerable<Y> Spawners)> this[params string[] names] => from name in names select this[name] into t where t.Creature != null select t; public TherzieCreatureManager(List<T> registeredCreatures, List<Y> registeredSpawners, List<GameObject> prefabs) { _registeredSpawners = registeredSpawners; base..ctor(registeredCreatures, prefabs); } protected override void ApplyToRemove() { base.ApplyToRemove(); _registeredSpawners.RemoveAll((Y spawner) => _toRemove.Contains(GetCreatureName(spawner))); } protected override void ApplyToKeep() { base.ApplyToKeep(); _registeredSpawners.RemoveAll((Y spawner) => !_toKeep.Contains(GetCreatureName(spawner))); } private string GetCreatureName(Y spawner) { return GetName((T)(AccessTools.Field(spawner.GetType(), "csCreature")?.GetValue(spawner))); } private IEnumerable<Y> GetSpawners(T creature) { return _registeredSpawners.Where((Y spawner) => GetCreatureName(spawner).Equals(GetName(creature))); } public void RemoveSpawner(Y spawner) { _registeredSpawners.Remove(spawner); } public IEnumerator<(T Creature, IEnumerable<Y> Spawners)> GetEnumerator() { return _registeredObjects.Select((T creature) => (creature, GetSpawners(creature))).GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } } namespace LotusEcarlateChanges.Model.Managers.Manual { public class ItemManager : ManualManagerBase<ItemWrapper> { private static readonly ItemManager s_instance; public static ItemManager Instance { get; } = s_instance ?? (s_instance = new ItemManager()); private ItemManager() { } protected override ItemWrapper Get(string name) { ObjectDB instance = ObjectDB.instance; return ItemWrapper.Get((instance != null) ? instance.GetItemPrefab(name) : null); } public override void Apply() { foreach (string name in _toRemove) { GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(name); if (itemPrefab != null) { ObjectDB.instance.m_items.RemoveAll((GameObject prefab) => ((Object)prefab).name == name); ObjectDB.instance.m_itemByHash.Remove(StringExtensionMethods.GetStableHashCode(name)); Recipe recipe = ObjectDB.instance.GetRecipe(itemPrefab.GetComponent<ItemDrop>()?.m_itemData); if (recipe != null) { ObjectDB.instance.m_recipes.Remove(recipe); } } } RegisterStatusEffects(); } private void RegisterStatusEffects() { foreach (ItemWrapper value in _wrappersCache.Values) { RegisterStatusEffect(value.SharedData.m_attackStatusEffect); RegisterStatusEffect(value.SharedData.m_consumeStatusEffect); RegisterStatusEffect(value.SharedData.m_equipStatusEffect); RegisterStatusEffect(value.SharedData.m_setStatusEffect); } } private void RegisterStatusEffect(StatusEffect statusEffect) { if (statusEffect != null && !Object.op_Implicit((Object)(object)ObjectDB.instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode(((Object)statusEffect).name)))) { ObjectDB.instance.m_StatusEffects.Add(statusEffect); } } } public abstract class ManualManagerBase<T> : IIndexableManager<T>, IManager, IEnumerable<T>, IEnumerable where T : PrefabWrapperBase { protected readonly Dictionary<string, T> _wrappersCache = new Dictionary<string, T>(); protected readonly HashSet<string> _toRemove = new HashSet<string>(); public T this[string name] { get { if (!_wrappersCache.TryGetValue(name, out var value)) { value = Get(name); if (value != null) { _wrappersCache[name] = value; } else { Plugin.Logger.LogError((object)$"{GetType()} did not find any object registered with name {name}"); } } return value; } } public IEnumerable<T> this[params string[] names] => from name in names select this[name] into p where p != null select p; protected abstract T Get(string name); public void Remove(params string[] names) { _toRemove.UnionWith(names); } public void Remove(IEnumerable<string> names) { _toRemove.UnionWith(names); } public void Keep(params string[] names) { throw new NotSupportedException(); } public void Keep(IEnumerable<string> names) { throw new NotSupportedException(); } public abstract void Apply(); public IEnumerator<T> GetEnumerator() { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { throw new NotSupportedException(); } } public class PieceManager : ManualManagerBase<PieceWrapper> { private static readonly PieceManager s_instance; private static ItemWrapper s_hammer; public static PieceManager Instance { get; } = s_instance ?? (s_instance = new PieceManager()); private PieceManager() { } protected override PieceWrapper Get(string name) { ZNetScene instance = ZNetScene.instance; return PieceWrapper.Get((instance != null) ? instance.GetPrefab(name) : null); } public override void Apply() { foreach (string name in _toRemove) { if (s_hammer == null) { s_hammer = ItemWrapper.Get(ObjectDB.instance.GetItemPrefab("Hammer")); } if (ZNetScene.instance.GetPrefab(name) == null) { continue; } ZNetScene.instance.m_prefabs.RemoveAll((GameObject prefab) => ((Object)prefab).name == name); ZNetScene.instance.m_nonNetViewPrefabs.RemoveAll((GameObject prefab) => ((Object)prefab).name == name); ZNetScene.instance.m_namedPrefabs.Remove(StringExtensionMethods.GetStableHashCode(name)); s_hammer.Pieces.RemoveAll((GameObject prefab) => ((Object)prefab).name == name); foreach (List<Piece> availablePiece in s_hammer.PieceTable.m_availablePieces) { availablePiece.RemoveAll((Piece piece) => ((Object)piece).name == name); } } } } } namespace LotusEcarlateChanges.Model.Managers.Jotunn { public class ItemManager : JotunnManagerBase, IIndexableManager<ItemWrapper>, IManager, IEnumerable<ItemWrapper>, IEnumerable { private static readonly ItemManager s_manager = ItemManager.Instance; private readonly IEnumerable<ItemWrapper> _items = from item in ModRegistry.GetItems(modGuid) select ItemWrapper.Get(item.ItemPrefab); public ItemWrapper this[string name] { get { CustomItem item = s_manager.GetItem(name); if (item == null) { Plugin.Logger.LogError((object)$"{GetType()} did not find any object registered with name {name}"); } return ItemWrapper.Get((item != null) ? item.ItemPrefab : null); } } public IEnumerable<ItemWrapper> this[params string[] names] => from name in names select this[name] into w where w != null select w; public ItemManager(string modGuid) { } protected override void ApplyToRemove() { foreach (string item in s_manager.Items.Keys.Where(_toRemove.Contains).ToList()) { s_manager.RemoveItem(item); } } protected override void ApplyToKeep() { foreach (string item in s_manager.Items.Keys.Where((string itemName) => !_toRemove.Contains(itemName)).ToList()) { s_manager.RemoveItem(item); } } public IEnumerator<ItemWrapper> GetEnumerator() { return _items.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public abstract class JotunnManagerBase : IManager { protected readonly HashSet<string> _toRemove = new HashSet<string>(); protected readonly HashSet<string> _toKeep = new HashSet<string>(); public void Remove(params string[] names) { _toRemove.UnionWith(names); } public void Remove(IEnumerable<string> names) { _toRemove.UnionWith(names); } public void Keep(params string[] names) { _toKeep.UnionWith(names); } public void Keep(IEnumerable<string> names) { _toKeep.UnionWith(names); } public void Apply() { if (_toRemove.Any() && _toKeep.Any()) { Plugin.Logger.LogError((object)"Can't have both object names to remove and object names to keep at the same time."); } else if (_toRemove.Any()) { ApplyToRemove(); } else if (_toKeep.Any()) { ApplyToKeep(); } } protected abstract void ApplyToRemove(); protected abstract void ApplyToKeep(); } public class PieceManager : JotunnManagerBase, IIndexableManager<PieceWrapper>, IManager, IEnumerable<PieceWrapper>, IEnumerable { private static readonly PieceManager s_manager = PieceManager.Instance; private readonly IEnumerable<PieceWrapper> _pieces = from piece in ModRegistry.GetPieces(modGuid) select PieceWrapper.Get(piece.PiecePrefab); public PieceWrapper this[string name] { get { CustomPiece piece = s_manager.GetPiece(name); if (piece == null) { Plugin.Logger.LogError((object)$"{GetType()} did not find any object registered with name {name}"); } return PieceWrapper.Get((piece != null) ? piece.PiecePrefab : null); } } public IEnumerable<PieceWrapper> this[params string[] names] => from name in names select this[name] into w where w != null select w; public PieceManager(string modGuid) { } protected override void ApplyToRemove() { foreach (string item in s_manager.Pieces.Keys.Where(_toRemove.Contains).ToList()) { s_manager.RemovePiece(item); } } protected override void ApplyToKeep() { foreach (string item in s_manager.Pieces.Keys.Where((string itemName) => !_toRemove.Contains(itemName)).ToList()) { s_manager.RemovePiece(item); } } public IEnumerator<PieceWrapper> GetEnumerator() { return _pieces.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } } namespace LotusEcarlateChanges.Model.Changes { public interface IChanges { void Apply(); } public abstract class JotunnBasedChangesBase : IChanges { protected LotusEcarlateChanges.Model.Managers.Jotunn.ItemManager ItemManager { get; } = (!string.IsNullOrEmpty(modGuid)) ? new LotusEcarlateChanges.Model.Managers.Jotunn.ItemManager(modGuid) : null; protected LotusEcarlateChanges.Model.Managers.Jotunn.PieceManager PieceManager { get; } = (!string.IsNullOrEmpty(modGuid)) ? new LotusEcarlateChanges.Model.Managers.Jotunn.PieceManager(modGuid) : null; protected JotunnBasedChangesBase(string modGuid = null) { } public void Apply() { ApplyInternal(); ItemManager?.Apply(); PieceManager?.Apply(); PieceManager.OnPiecesRegistered += ApplyOnPiecesRegisteredInternal; } protected abstract void ApplyInternal(); protected virtual void ApplyOnPiecesRegisteredInternal() { } } public abstract class ManualChangesBase : IChanges { private static readonly HashSet<ManualChangesBase> s_instances; protected LotusEcarlateChanges.Model.Managers.Manual.ItemManager ItemManager => LotusEcarlateChanges.Model.Managers.Manual.ItemManager.Instance; protected LotusEcarlateChanges.Model.Managers.Manual.PieceManager PieceManager => LotusEcarlateChanges.Model.Managers.Manual.PieceManager.Instance; public void Apply() { s_instances.Add(this); ApplyInternal(); } protected virtual void ApplyInternal() { } protected static void ApplyOnObjectDBAwake() { if (ObjectDB.instance.GetItemPrefab("Wood") == null) { return; } foreach (ManualChangesBase s_instance in s_instances) { s_instance.ApplyOnObjectDBAwakeInternal(); } LotusEcarlateChanges.Model.Managers.Manual.ItemManager.Instance.Apply(); LotusEcarlateChanges.Model.Managers.Manual.PieceManager.Instance.Apply(); } protected virtual void ApplyOnObjectDBAwakeInternal() { } static ManualChangesBase() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown s_instances = new HashSet<ManualChangesBase>(); Plugin.Harmony.Patch((MethodBase)AccessTools.Method(typeof(ObjectDB), "Awake", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(typeof(ManualChangesBase), "ApplyOnObjectDBAwake", (Type[])null) { priority = -100 }, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } public abstract class StandaloneManagerBasedChangesBase : IChanges { protected List<IManager> _managers { get; } = new List<IManager>(); protected ItemManager<T> RegisterItemManager<T>(List<T> registeredItems, List<GameObject> prefabs, List<GameObject> zNetOnlyPrefabs) { ItemManager<T> itemManager = new ItemManager<T>(registeredItems, prefabs, zNetOnlyPrefabs); _managers.Add(itemManager); return itemManager; } protected PieceManager<T> RegisterPieceManager<T>(List<T> registeredPieces, List<GameObject> piecePrefabs) { PieceManager<T> pieceManager = new PieceManager<T>(registeredPieces, piecePrefabs); _managers.Add(pieceManager); return pieceManager; } protected CreatureManager<T> RegisterCreatureManager<T>(List<T> registeredPieces, List<GameObject> prefabs) { CreatureManager<T> creatureManager = new CreatureManager<T>(registeredPieces, prefabs); _managers.Add(creatureManager); return creatureManager; } protected TherzieCreatureManager<T, Y> RegisterCreatureManager<T, Y>(List<T> registeredPieces, List<Y> registeredSpawners, List<GameObject> prefabs) { TherzieCreatureManager<T, Y> therzieCreatureManager = new TherzieCreatureManager<T, Y>(registeredPieces, registeredSpawners, prefabs); _managers.Add(therzieCreatureManager); return therzieCreatureManager; } protected LocationManager<T> RegisterLocationManager<T>(List<T> registeredLocations) { LocationManager<T> locationManager = new LocationManager<T>(registeredLocations); _managers.Add(locationManager); return locationManager; } public void Apply() { ApplyInternal(); _managers.ForEach(delegate(IManager manager) { manager.Apply(); }); } protected abstract void ApplyInternal(); } } namespace LotusEcarlateChanges.Extensions { public static class GameObjectExtensions { private static readonly int s_itemLayer = LayerMask.NameToLayer("item"); public static void FixItemLayer(this GameObject gameObject) { ((Component)gameObject.GetComponentInChildren<Collider>()).gameObject.layer = s_itemLayer; } public static GameObject Find(this GameObject gameObject, string name) { return ((Component)gameObject.transform.Find(name)).gameObject; } public static void SetText(this GameObject gameObject, string text) { ((TMP_Text)gameObject.GetComponentInChildren<TextMeshProUGUI>()).SetText(text); } } public static class GenericTypeExtensions { public static void CopyProperties<T>(this T targetObject, T sourceObject) { foreach (PropertyInfo item in from p in targetObject.GetType().GetProperties() where p.CanWrite select p) { item.SetValue(targetObject, item.GetValue(sourceObject)); } } } public static class KeyCodeExtensions { public static string ToLocalizableString(this KeyCode keyCode) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected I4, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected I4, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Expected I4, but got Unknown //IL_017a: 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) //IL_00f8: Invalid comparison between Unknown and I4 var (flag, val) = ZInput.KeyCodeToMouseButton(keyCode, false); if (flag) { string text; switch ((int)val) { case 0: text = "$button_mouse0"; break; case 1: text = "$button_mouse1"; break; case 2: text = "$button_mouse2"; break; case 3: { Mouse current2 = Mouse.current; text = ((current2 != null) ? ((InputControl)current2.forwardButton).displayName : null) ?? "Mouse Forward"; break; } case 4: { Mouse current = Mouse.current; text = ((current != null) ? ((InputControl)current.backButton).displayName : null) ?? "Mouse Back"; break; } default: text = null; break; } string text2 = text; if (text2 != null) { return text2; } } Key val2 = ZInput.KeyCodeToKey(keyCode, false); switch ((int)val2) { default: switch (val2 - 51) { case 0: return "$button_lshift"; case 1: return "$button_rshift"; case 2: return "$button_lalt"; case 3: return "$button_ralt"; case 4: return "$button_lctrl"; case 5: return "$button_rctrl"; } if ((int)val2 != 77) { break; } return "$button_return"; case 7: return ","; case 8: return "."; case 1: return "$button_space"; case 2: return "$button_return"; case 0: return "$menu_none"; case 3: case 4: case 5: case 6: break; } Keyboard current3 = Keyboard.current; return ((current3 != null) ? ((InputControl)current3[val2]).displayName : null) ?? ((object)(Key)(ref val2)).ToString(); } } public static class KeyValuePairExtensions { public static void Deconstruct<T1, T2>(this KeyValuePair<T1, T2> tuple, out T1 key, out T2 value) { key = tuple.Key; value = tuple.Value; } } } namespace LotusEcarlateChanges.Changes { public static class Constants { public static class Weapon { public static class MovementModifier { public const float Knife = 0f; public const float Fist = 0f; public const float OneHanded = -0.05f; public const float TwoHanded = -0.1f; public const float Buckler = -0.05f; public const float Shield = -0.05f; public const float TowerShield = -0.1f; } public static class ParryBonus { public const float TowerShield = 1.1f; } } public static class Armor { public static class VeryLight { public static class MovementModifier { public const float Helm = 0f; public const float Chest = -0.01f; public const float Legs = -0.01f; } public static class Weight { public const float Helm = 1f; public const float Chest = 6f; public const float Legs = 3f; } } public static class SemiLight { public static class MovementModifier { public const float Helm = 0f; public const float Chest = -0.04f; public const float Legs = -0.02f; } public static class Weight { public const float Helm = 3f; public const float Chest = 10f; public const float Legs = 5f; } } public static class Normal { public static class MovementModifier { public const float Helm = -0.01f; public const float Chest = -0.06f; public const float Legs = -0.03f; } public static class Weight { public const float Helm = 4f; public const float Chest = 12f; public const float Legs = 6f; } } public static class Heavy { public static class MovementModifier { public const float Helm = -0.02f; public const float Chest = -0.08f; public const float Legs = -0.04f; } public static class Weight { public const float Helm = 5f; public const float Chest = 15f; public const float Legs = 10f; } } public static class VeryHeavy { public static class MovementModifier { public const float Helm = -0.02f; public const float Chest = -0.1f; public const float Legs = -0.06f; } public static class Weight { public const float Helm = 6f; public const float Chest = 18f; public const float Legs = 12f; } } } } } namespace LotusEcarlateChanges.Changes.StandaloneManagerBased { public class Backpacks : StandaloneManagerBasedChangesBase { private class SE_Backpack : SE_Stats { public override void ModifySpeed(float baseSpeed, ref float speed, Character character, Vector3 dir) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) float num = API.GetEquippedBackpack().GetWeight() - 4f; base.m_speedModifier = Math.Max(num * -0.2f / 100f, -1f); ((SE_Stats)this).ModifySpeed(baseSpeed, ref speed, character, dir); } public override string GetIconText() { if (base.m_speedModifier != 0f) { return $"{base.m_speedModifier * 100f}%"; } return string.Empty; } } private const float EmptyBackpackWeight = 4f; private const float MovespeedPerWeightRatio = -0.1f; private const float BackpackItemRealWeightRatio = 0.5f; private const float MoveSpeedPerRealWeightRatio = -0.2f; private static SE_Backpack s_backpackEquipEffect; protected override void ApplyInternal() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown Item backpack = Backpacks.Backpack; backpack.Crafting.Stations.Clear(); backpack.Crafting.Add((CraftingTable)0, 1); s_backpackEquipEffect = ScriptableObject.CreateInstance<SE_Backpack>(); ((Object)s_backpackEquipEffect).name = "Backpack"; ((StatusEffect)s_backpackEquipEffect).m_name = "$Backpack_Effect_Name"; ((StatusEffect)s_backpackEquipEffect).m_tooltip = "$Backpack_Effect_Tooltip"; ((StatusEffect)s_backpackEquipEffect).m_icon = backpack.Prefab.GetComponent<ItemDrop>().m_itemData.GetIcon(); Plugin.Harmony.Patch((MethodBase)AccessTools.Method(typeof(Loader), "ApplyConfig", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(GetType(), "EditLoadedBackpacks", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Plugin.Harmony.Patch((MethodBase)AccessTools.Method(typeof(ObjectDB), "Awake", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(GetType(), "RegisterSEBackpack", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Plugin.Harmony.Patch((MethodBase)AccessTools.Method(typeof(ObjectDB), "CopyOtherDB", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(GetType(), "RegisterSEBackpack", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } private static void EditLoadedBackpacks() { foreach (Item value in Loader.loadedBackpacks.Values) { value.Name.Alias("$Backpack_Name"); value.Description.Alias("$Backpack_Description"); ItemWrapper.Get(value.Prefab).Armor.EquipEffect = (SE_Stats)(object)s_backpackEquipEffect; } } private static void RegisterSEBackpack(ObjectDB __instance) { if (!Object.op_Implicit((Object)(object)__instance.GetStatusEffect(StringExtensionMethods.GetStableHashCode(((Object)s_backpackEquipEffect).name)))) { __instance.m_StatusEffects.Add((StatusEffect)(object)s_backpackEquipEffect); } } } public class BowsBeforeHoes : StandaloneManagerBasedChangesBase { private static int s_quiverQualityCache; protected override void ApplyInternal() { //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Expected O, but got Unknown //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Expected O, but got Unknown //IL_04cc: Expected O, but got Unknown ItemManager<Item> itemManager = RegisterItemManager(Item.registeredItems, PrefabManager.prefabs, PrefabManager.ZnetOnlyPrefabs); BowsBeforeHoesPlugin.QuiverList.Clear(); BowsBeforeHoesPlugin.BowList.Clear(); itemManager.Keep("BBH_BlackForest_Quiver", "BBH_BlackForest_QuiverViewOnly", "BBH_PlainsLox_Quiver", "BBH_PlainsLox_QuiverViewOnly", "BBH_Seeker_Quiver", "BBH_Seeker_QuiverViewOnly"); var (val, itemWrapper) = itemManager["BBH_BlackForest_Quiver"]; val.RequiredItems.Requirements.Clear(); val.RequiredItems.Add("FineWood", 10, 0); val.RequiredItems.Add("RoundLog", 10, 0); val.RequiredItems.Add("DeerHide", 4, 0); val.RequiredItems.Add("HardAntler", 1, 0); val.RequiredUpgradeItems.Requirements.Clear(); val.RequiredUpgradeItems.Add("FineWood", 5, 0); val.RequiredUpgradeItems.Add("RoundLog", 5, 0); val.RequiredUpgradeItems.Add("DeerHide", 2, 0); val.RequiredUpgradeItems.Add("HardAntler", 1, 0); itemWrapper.Armor.MovementModifier = 0f; itemWrapper.SharedData.m_maxQuality = 2; BowsBeforeHoesPlugin.QuiverList.Add(val.Prefab); var (val2, itemWrapper2) = itemManager["BBH_PlainsLox_Quiver"]; val2.RequiredItems.Requirements.Clear(); val2.RequiredItems.Add("FineWood", 10, 0); val2.RequiredItems.Add("LinenThread", 30, 0); val2.RequiredItems.Add("LoxPelt", 3, 0); val2.RequiredUpgradeItems.Requirements.Clear(); val2.RequiredUpgradeItems.Requirements.Clear(); val2.RequiredUpgradeItems.Add("FineWood", 5, 0); val2.RequiredUpgradeItems.Add("LinenThread", 15, 0); val2.RequiredUpgradeItems.Add("LoxPelt", 2, 0); itemWrapper2.Armor.MovementModifier = 0f; itemWrapper2.SharedData.m_maxQuality = 3; BowsBeforeHoesPlugin.QuiverList.Add(val2.Prefab); var (val3, itemWrapper3) = itemManager["BBH_Seeker_Quiver"]; val3.RequiredItems.Requirements.Clear(); val3.RequiredItems.Add("YggdrasilWood", 20, 0); val3.RequiredItems.Add("Carapace", 20, 0); val3.RequiredItems.Add("Mandible", 3, 0); val3.RequiredUpgradeItems.Requirements.Clear(); val3.RequiredUpgradeItems.Requirements.Clear(); val3.RequiredUpgradeItems.Add("YggdrasilWood", 10, 0); val3.RequiredUpgradeItems.Add("Carapace", 10, 0); val3.RequiredUpgradeItems.Add("Mandible", 2, 0); itemWrapper3.Armor.MovementModifier = 0f; itemWrapper3.SharedData.m_maxQuality = 4; BowsBeforeHoesPlugin.QuiverList.Add(val3.Prefab); itemManager.Keep("TorchArrow", "bow_projectile_torch", "MistTorchArrow", "bow_projectile_misttorch"); Item item = itemManager["TorchArrow"].Item; item.RequiredItems.Requirements.Clear(); item.RequiredItems.Add("Wood", 8, 0); item.RequiredItems.Add("Resin", 8, 0); item.RequiredItems.Add("Feathers", 2, 0); item.RequiredItems.Add("Tar", 1, 0); item.Crafting.Stations.Clear(); item.Crafting.Add((CraftingTable)2, 3); Item item2 = itemManager["MistTorchArrow"].Item; item2.RequiredItems.Requirements.Clear(); item2.RequiredItems.Add("Wood", 8, 0); item2.RequiredItems.Add("Resin", 8, 0); item2.RequiredItems.Add("Feathers", 2, 0); item2.RequiredItems.Add("Eitr", 1, 0); item2.Crafting.Stations.Clear(); item2.Crafting.Add((CraftingTable)8, 1); Plugin.Harmony.Patch((MethodBase)AccessTools.Method(typeof(DummyItemDataThingy), "GetDefaultContainerSize", (Type[])null, (Type[])null), new HarmonyMethod(GetType(), "SetQuiverSizeOnCraft", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); Plugin.Harmony.Patch((MethodBase)AccessTools.Method(typeof(DummyItemDataThingy), "Upgraded", (Type[])null, (Type[])null), new HarmonyMethod(GetType(), "InterceptQuiverQualityOnUpgrade", (Type[])null), new HarmonyMethod(GetType(), "RestoreQuiverQualityAfterUpgrade", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } private static void SetQuiverSizeOnCraft(ref Vector2i __result, ref bool __runOriginal) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) __runOriginal = false; __result = new Vector2i(1, 1); } private static void InterceptQuiverQualityOnUpgrade(DummyItemDataThingy __instance) { s_quiverQualityCache = ((BackpacksItemData)__instance).Item.m_quality; ItemData item = ((BackpacksItemData)__instance).Item; item.m_quality -= 2; } private static void RestoreQuiverQualityAfterUpgrade(DummyItemDataThingy __instance) { ((BackpacksItemData)__instance).Item.m_quality = s_quiverQualityCache; } } public class ClayBuildPieces : StandaloneManagerBasedChangesBase { protected override void ApplyInternal() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Expected O, but got Unknown PieceManager<BuildPiece> pieceManager = RegisterPieceManager(BuildPiece.registeredPieces, PiecePrefabManager.piecePrefabs); pieceManager.Remove("BFP_ClayArmorStand", "BFP_ClayChest"); foreach (var item3 in pieceManager) { BuildPiece item = item3.BuildPiece; if (item.Category.custom == "ClayBuildPieces") { item.Category.Set((BuildPieceCategory)2); } if ((int)item.Category.Category == 0) { item.Category.Set((BuildPieceCategory)4); } } BuildPiece item2 = pieceManager["BCP_ClayCollector"].BuildPiece; item2.Category.Set((BuildPieceCategory)1); item2.RequiredItems.Requirements.Clear(); item2.RequiredItems.Add("Stone", 20, true); item2.RequiredItems.Add("Bronze", 10, true); item2.RequiredItems.Add("FineWood", 20, true); item2.RequiredItems.Add("SurtlingCore", 5, true); item2.RequiredItems.Add("BFP_Clay", 30, true); string[] names = new string[3] { "BFP_ClayCorgi", "BFP_ClayDeer", "BFP_ClayHare" }; foreach (var item4 in pieceManager[names]) { item4.Wrapper.Comfort.Value = 0; } Plugin.Harmony.Patch((MethodBase)AccessTools.Method(typeof(SetupPrefabs), "SetupArmorStand", (Type[])null, (Type[])null), new HarmonyMethod(GetType(), "NoOpPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } private static void NoOpPrefix(ref bool __runOriginal) { __runOriginal = false; } } public class CoreWoodPieces : StandaloneManagerBasedChangesBase { protected override void ApplyInternal() { PieceManager<BuildPiece> pieceManager = RegisterPieceManager(BuildPiece.registeredPieces, PiecePrefabManager.piecePrefabs); pieceManager.Remove("BCW_CoreWood_Fence1", "BCW_CoreWood_Fence2", "BCW_CoreWood_FenceGate", "BCW_CoreWood_FencePillar"); HashSet<string> hashSet = new HashSet<string> { "BCW_CoreWood_DrawBridgeNarrow", "BCW_CoreWood_DrawBridgeNarrowTall", "BCW_CoreWood_DrawBridgeWide", "BCW_CoreWood_DrawBridgeWideTall" }; foreach (var item2 in pieceManager) { BuildPiece item = item2.BuildPiece; if (hashSet.Contains(((Object)item.Prefab).name)) { item.Category.Set((BuildPieceCategory)2); } else if (item.Category.custom == "CoreWoodFence") { item.Category.Set((BuildPieceCategory)0); } else if (item.Category.custom == "CoreWoodPieces") { item.Category.Set((BuildPieceCategory)2); } } } } public class FineWoodBuildPieces : StandaloneManagerBasedChangesBase { protected override void ApplyInternal() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) PieceManager<BuildPiece> pieceManager = RegisterPieceManager(BuildPiece.registeredPieces, PiecePrefabManager.piecePrefabs); pieceManager.Remove("BFP_FenceGate", "BFP_FencePillar1", "BFP_FencePillar2", "BFP_FencePillar3", "BFP_FencePillar4", "BFP_StepLadder1", "BFP_StepLadder2"); foreach (var item3 in pieceManager) { BuildPiece item = item3.BuildPiece; if ((int)item.Category.Category == 0) { item.Category.Set((BuildPieceCategory)4); } else if (item.Category.custom == "FineWoodFence") { item.Category.Set((BuildPieceCategory)0); } else if (item.Category.custom == "FineWoodPieces") { item.Category.Set((BuildPieceCategory)2); } } pieceManager["BFP_HeavyGate"].BuildPiece.Crafting.Set((CraftingTable)3); string[] names = new string[9] { "BFP_StoneLightPost", "BFP_StoneRoof26", "BFP_StoneRoof45", "BFP_StoneRoofICorner26", "BFP_StoneRoofICorner45", "BFP_StoneRoofOCorner26", "BFP_StoneRoofOCorner45", "BFP_StoneRoofTop26", "BFP_StoneRoofTop45" }; foreach (var item4 in pieceManager[names]) { BuildPiece item2 = item4.BuildPiece; item2.Crafting.Set((CraftingTable)5); item2.Category.Set((BuildPieceCategory)3); } } } public class MonsterLabZ : StandaloneManagerBasedChangesBase { protected override void ApplyInternal() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Expected O, but got Unknown //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Expected O, but got Unknown //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Expected O, but got Unknown //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_0315: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Expected O, but got Unknown //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) ItemManager<Item> itemManager = RegisterItemManager(Item.registeredItems, PrefabManager.prefabs, PrefabManager.ZnetOnlyPrefabs); CreatureManager<Creature> creatureManager = RegisterCreatureManager(Creature.registeredCreatures, PrefabManager.prefabs); LocationManager<Location> locationManager = RegisterLocationManager(Location.registeredLocations); DamageTypes damages = itemManager["DwarfGoblinShaman_attack_fireball"].Wrapper.Weapon.Damages; damages.m_fire = 50f; itemManager["DwarfGoblinShaman_attack_fireball"].Wrapper.Weapon.Damages = damages; DamageTypes damages2 = itemManager["DwarfGoblinShamanBoat_attack_fireball"].Wrapper.Weapon.Damages; damages2.m_fire = 50f; itemManager["DwarfGoblinShamanBoat_attack_fireball"].Wrapper.Weapon.Damages = damages2; creatureManager["BrownSpider"].Drops.drops.Remove("Ooze"); creatureManager["BrownSpider"].Drops.drops["SpiderFang"].DropChance = 100f; creatureManager["TreeSpider"].Drops.drops.Remove("Ooze"); creatureManager["TreeSpider"].Drops.drops["SpiderFang"].DropChance = 100f; creatureManager["GreenSpider"].Drops.drops.Remove("Ooze"); creatureManager["GreenSpider"].Drops.drops["SpiderFang"].DropChance = 100f; creatureManager["Rainbow_Butterfly"].Drops.drops.Remove("Ooze"); creatureManager["Rainbow_Butterfly"].Drops.drops["Amber"] = new Drop(); creatureManager["Green_Butterfly"].Drops.drops.Remove("Ooze"); creatureManager["Green_Butterfly"].Drops.drops["Amber"] = new Drop(); creatureManager["DwarfGoblin"].Drops.drops["Coins"].Amount = new Range(0f, 15f); creatureManager["DwarfGoblin"].Drops.drops["Amber"] = new Drop { Amount = new Range(0f, 3f) }; creatureManager["DwarfGoblin"].Drops.drops["Ruby"] = new Drop { DropChance = 50f }; creatureManager["DwarfGoblinShaman"].Drops.drops["Coins"].Amount = new Range(0f, 25f); creatureManager["DwarfGoblinShaman"].Drops.drops["Amber"] = new Drop { Amount = new Range(0f, 3f) }; creatureManager["DwarfGoblinShaman"].Drops.drops["Ruby"] = new Drop { DropChance = 50f }; creatureManager.Remove("ML_AshHatchling", "ML_AshHuldra", "ML_FrostHatchling", "FireGolem", "ObsidianGolem", "DwarfGoblinLoot"); creatureManager["TreeSpider"].SpawnChance = 5f; creatureManager["TreeSpider"].Maximum = 3; creatureManager["TreeSpider"].GroupSize = new Range(2f, 3f); creatureManager["GreenSpider"].SpawnChance = 5f; creatureManager["GreenSpider"].Maximum = 1; creatureManager["ML_DraugrShip"].Biome = (Biome)256; creatureManager["ML_DraugrShip"].RequiredWeather = (Weather)0; creatureManager["ML_DraugrShip"].SpecificSpawnArea = (SpawnArea)2; creatureManager["ML_GoblinShip"].Biome = (Biome)256; creatureManager["ML_GoblinShip"].RequiredWeather = (Weather)0; creatureManager["ML_GoblinShip"].SpecificSpawnArea = (SpawnArea)2; creatureManager["DwarfGoblin"].GroupSize = new Range(2f, 4f); creatureManager["DwarfGoblin"].Maximum = 4; creatureManager["DwarfGoblinShaman"].CanHaveStars = false; creatureManager["WraithWarrior"].SpawnChance = 10f; creatureManager["WraithWarrior"].Maximum = 1; creatureManager["WraithWarrior"].RequiredWeather = (Weather)0; creatureManager["WraithWarrior"].CanHaveStars = false; creatureManager["DeepSea_Serpent"].CanHaveStars = false; locationManager.Remove("AshHuldraQueen_Altar", "AshlandsCave_01", "AshlandsCave_02", "Mystical_Well0"); } } public class Monstrum : StandaloneManagerBasedChangesBase { private TherzieCreatureManager<Creature, Spawner> creatureManager; protected override void ApplyInternal() { //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_057c: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0653: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_071c: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) ItemManager<Item> itemManager = RegisterItemManager(Item.registeredItems, PrefabManager.prefabs, PrefabManager.ZnetOnlyPrefabs); PieceManager<BuildPiece> pieceManager = RegisterPieceManager(BuildPiece.registeredPieces, PiecePrefabManager.piecePrefabs); creatureManager = RegisterCreatureManager(Creature.registeredCreatures, Creature.registeredSpawners, PrefabManager.prefabs); var (val, pieceWrapper) = pieceManager["rug_Fox_TW"]; val.RequiredItems.Requirements.Clear(); val.RequiredItems.Add("FoxPelt_TW", 4, true); val.Category.Set((BuildPieceCategory)4); pieceWrapper.Comfort.Value = 1; pieceWrapper.Comfort.Group = (ComfortGroup)6; var (val2, pieceWrapper2) = pieceManager["rug_Rotten_TW"]; val2.RequiredItems.Requirements.Clear(); val2.RequiredItems.Add("RottenPelt_TW", 4, true); val2.Category.Set((BuildPieceCategory)4); pieceWrapper2.Comfort = pieceWrapper.Comfort; var (val3, pieceWrapper3) = pieceManager["rug_BlackBear_TW"]; val3.RequiredItems.Requirements.Clear(); val3.RequiredItems.Add("BlackBearPelt_TW", 4, true); val3.Category.Set((BuildPieceCategory)4); pieceWrapper3.Comfort = pieceWrapper.Comfort; var (val4, pieceWrapper4) = pieceManager["rug_GrizzlyBear_TW"]; val4.RequiredItems.Requirements.Clear(); val4.RequiredItems.Add("GrizzlyBearPelt_TW", 4, true); val4.Category.Set((BuildPieceCategory)4); pieceWrapper4.Comfort = pieceWrapper.Comfort; Item item = itemManager["SaddleBoar_TW"].Item; item.Crafting.Stations.Clear(); item.Crafting.Add((CraftingTable)2, 2); item.RequiredItems.Requirements.Clear(); item.RequiredItems.Add("RazorbackLeather_TW", 10, 0); item.RequiredItems.Add("RazorbackTusk_TW", 5, 0); item.RequiredItems.Add("Bronze", 10, 0); Item item2 = itemManager["SaddleBear_TW"].Item; item2.Crafting.Stations.Clear(); item2.Crafting.Add((CraftingTable)2, 3); item2.RequiredItems.Requirements.Clear(); item2.RequiredItems.Add("BlackBearPelt_TW", 5, 0); item2.RequiredItems.Add("GrizzlyBearPelt_TW", 3, 0); item2.RequiredItems.Add("Silver", 10, 0); Item item3 = itemManager["SaddleProwler_TW"].Item; item3.Crafting.Stations.Clear(); item3.Crafting.Add((CraftingTable)2, 4); item3.RequiredItems.Requirements.Clear(); item3.RequiredItems.Add("ProwlerFang_TW", 2, 0); item3.RequiredItems.Add("LinenThread", 20, 0); item3.RequiredItems.Add("LoxPelt", 4, 0); item3.RequiredItems.Add("BlackMetal", 10, 0); ItemWrapper item4 = itemManager["CookedBearSteak_TW"].Wrapper; item4.Food.Stamina = 13f; item4.Food.Duration = 1200f; ItemWrapper item5 = itemManager["MixedGrill_TW"].Wrapper; item5.Food.Health = 70f; item5.Food.Stamina = 23f; creatureManager["BossAsmodeus_TW"].Creature.Drops.drops.Remove("KnifeViper_TW"); creatureManager["BossSvalt_TW"].Creature.Drops.drops.Remove("DualAxeDemonic_TW"); creatureManager["BossVrykolathas_TW"].Creature.Drops.drops.Remove("ScytheVampiric_TW"); creatureManager["Fox_TW"].Creature.Drops["FoxMeat_TW"].DropChance = 100f; creatureManager["Razorback_TW"].Creature.Drops["RawMeat"].Amount = new Range(1f, 2f); creatureManager["Razorback_TW"].Creature.Drops["RawMeat"].DropChance = 100f; creatureManager["BlackBear_TW"].Creature.Drops["BearSteak_TW"].DropChance = 100f; creatureManager["GrizzlyBear_TW"].Creature.Drops["GrizzlyBearPelt_TW"].DropChance = 100f; creatureManager["GrizzlyBear_TW"].Creature.Drops["BearSteak_TW"].DropChance = 100f; creatureManager["Prowler_TW"].Creature.Drops["ProwlerFang_TW"].DropChance = 100f; List<Spawner> list = creatureManager["Fox_TW"].Spawners.ToList(); Spawner val5 = list[0]; Spawner obj = list[1]; Spawner obj2 = val5; obj2.SpecificSpawnTime = (SpawnTime)0; obj2.CheckSpawnInterval = 600; obj2.SpawnChance = 10f; obj2.Maximum = 1; obj2.CanHaveStars = true; obj.SpecificSpawnTime = (SpawnTime)1; obj.CheckSpawnInterval = 400; obj.SpawnChance = 20f; obj.Maximum = 1; obj.CanHaveStars = true; Spawner obj3 = creatureManager["Razorback_TW"].Spawners.Single(); obj3.CheckSpawnInterval = 150; obj3.SpawnChance = 40f; obj3.Maximum = 3; obj3.GroupSize = new Range(1f, 2f); Spawner obj4 = MergeDualSpawners("BlackBear_TW"); obj4.CheckSpawnInterval = 900; obj4.SpawnChance = 10f; Spawner obj5 = MergeDualSpawners("Crawler_TW"); obj5.CheckSpawnInterval = 900; obj5.SpawnChance = 10f; creatureManager["ObsidianGolem_TW"].Creature.RequiredAltitude = new Range(120f, 1000f); creatureManager["ObsidianGolem_TW"].Spawners.Single().CanHaveStars = false; Spawner obj6 = MergeDualSpawners("GrizzlyBear_TW"); obj6.CheckSpawnInterval = 900; obj6.SpawnChance = 10f; List<Spawner> list2 = creatureManager["Prowler_TW"].Spawners.ToList(); val5 = list2[0]; Spawner obj7 = list2[1]; Spawner obj8 = val5; obj8.SpecificSpawnTime = (SpawnTime)0; obj8.CheckSpawnInterval = 900; obj8.SpawnChance = 10f; obj8.Maximum = 1; obj8.CanHaveStars = false; obj7.SpecificSpawnTime = (SpawnTime)1; obj7.CheckSpawnInterval = 600; obj7.SpawnChance = 20f; obj7.Maximum = 2; obj7.GroupSize = new Range(1f, 2f); obj7.CanHaveStars = true; } private Spawner MergeDualSpawners(string creatureName) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) Spawner spawner = creatureManager[creatureName].Spawners.First(); creatureManager.RemoveSpawner(spawner); Spawner obj = creatureManager[creatureName].Spawners.Single(); obj.SpecificSpawnTime = (SpawnTime)2; obj.CanHaveStars = true; return obj; } } public class RefinedStonePieces : StandaloneManagerBasedChangesBase { protected override void ApplyInternal() { PieceManager<BuildPiece> pieceManager = RegisterPieceManager(BuildPiece.registeredPieces, PiecePrefabManager.piecePrefabs); foreach (var item in pieceManager) { item.BuildPiece.Category.Set((BuildPieceCategory)3); } string[] names = new string[3] { "BRP_StoneCorgi", "BRP_StoneDeer", "BRP_StoneHare" }; foreach (var (val, pieceWrapper) in pieceManager[names]) { val.Category.Set((BuildPieceCategory)4); pieceWrapper.Comfort.Value = 0; } pieceManager["BRP_RefinedStone_Stack"].BuildPiece.Category.Set((BuildPieceCategory)0); pieceManager["BRP_RefinedStone_Hearth"].BuildPiece.Category.Set((BuildPieceCategory)4); pieceManager["BRP_StoneChest"].BuildPiece.Category.Set((BuildPieceCategory)4); } } public class SouthsilArmor : StandaloneManagerBasedChangesBase { private static readonly List<Action> s_onLocalizationAddedCallbacks = new List<Action>(); protected override void ApplyInternal() { //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_0b20: Unknown result type (might be due to invalid IL or missing references) //IL_0b33: Unknown result type (might be due to invalid IL or missing references) //IL_0b38: Unknown result type (might be due to invalid IL or missing references) //IL_1025: Unknown result type (might be due to invalid IL or missing references) //IL_102d: Unknown result type (might be due to invalid IL or missing references) //IL_1032: Unknown result type (might be due to invalid IL or missing references) //IL_103a: Unknown result type (might be due to invalid IL or missing references) //IL_103f: Unknown result type (might be due to invalid IL or missing references) //IL_152b: Unknown result type (might be due to invalid IL or missing references) //IL_153c: Unknown result type (might be due to invalid IL or missing references) //IL_1541: Unknown result type (might be due to invalid IL or missing references) //IL_1564: Unknown result type (might be due to invalid IL or missing references) //IL_156c: Unknown result type (might be due to invalid IL or missing references) //IL_1571: Unknown result type (might be due to invalid IL or missing references) //IL_1579: Unknown result type (might be due to invalid IL or missing references) //IL_157e: Unknown result type (might be due to invalid IL or missing references) //IL_1a37: Unknown result type (might be due to invalid IL or missing references) //IL_1a49: Unknown result type (might be due to invalid IL or missing references) //IL_201b: Unknown result type (might be due to invalid IL or missing references) //IL_202d: Unknown result type (might be due to invalid IL or missing references) //IL_247f: Unknown result type (might be due to invalid IL or missing references) //IL_2490: Unknown result type (might be due to invalid IL or missing references) //IL_2495: Unknown result type (might be due to invalid IL or missing references) //IL_297f: Unknown result type (might be due to invalid IL or missing references) //IL_2992: Unknown result type (might be due to invalid IL or missing references) //IL_2e6c: Unknown result type (might be due to invalid IL or missing references) //IL_2e7e: Unknown result type (might be due to invalid IL or missing references) //IL_33d0: Unknown result type (might be due to invalid IL or missing references) //IL_33e1: Unknown result type (might be due to invalid IL or missing references) //IL_33e6: Unknown result type (might be due to invalid IL or missing references) ItemManager<Item> itemManager = RegisterItemManager(Item.registeredItems, PrefabManager.prefabs, PrefabManager.ZnetOnlyPrefabs); LocalizationManager.OnLocalizationAdded += onLocalizationAddedCallback; itemManager.Keep("chiefhelmboar", "chiefhelmdeer", "chiefchest", "chieflegs"); var (chieftainHelmBoar, itemWrapper) = itemManager["chiefhelmboar"]; s_onLocalizationAddedCallbacks.Add(delegate { chieftainHelmBoar.Name.Alias("$SouthsilArmor_ChieftainHelmBoar_Name"); chieftainHelmBoar.Description.Alias("$SouthsilArmor_ChieftainHelmBoar_Description"); }); chieftainHelmBoar.Crafting.Stations.Clear(); chieftainHelmBoar.Crafting.Add((CraftingTable)2, 2); chieftainHelmBoar.RequiredItems.Requirements.Clear(); chieftainHelmBoar.RequiredItems.Add("DeerHide", 2, 0); chieftainHelmBoar.RequiredItems.Add("LeatherScraps", 2, 0); chieftainHelmBoar.RequiredItems.Add("FoxPelt_TW", 1, 0); chieftainHelmBoar.RequiredItems.Add("TrophyBoar", 2, 0); chieftainHelmBoar.RequiredUpgradeItems.Requirements.Clear(); chieftainHelmBoar.RequiredUpgradeItems.Add("DeerHide", 1, 0); chieftainHelmBoar.RequiredUpgradeItems.Add("LeatherScraps", 1, 0); itemWrapper.Armor.ArmorBase = 2f; itemWrapper.Armor.ArmorPerLevel = 2f; itemWrapper.Armor.MovementModifier = -0.01f; itemWrapper.Armor.Weight = 4f; SE_Stats equipEffect = itemWrapper.Armor.EquipEffect; ((StatusEffect)equipEffect).m_name = "$SouthsilArmor_ChieftainHelmBoar_Effect_Name"; ((StatusEffect)equipEffect).m_tooltip = "$SouthsilArmor_ChieftainHelmBoar_Effect_Tooltip"; equipEffect.m_healthRegenMultiplier = 1.25f; equipEffect.m_staminaRegenMultiplier = 1f; equipEffect.m_skillLevel = (SkillType)6; equipEffect.m_skillLevelModifier = 10f; chieftainHelmBoar.Prefab.FixItemLayer(); var (chieftainHelmDeer, itemWrapper2) = itemManager["chiefhelmdeer"]; s_onLocalizationAddedCallbacks.Add(delegate { chieftainHelmDeer.Name.Alias("$SouthsilArmor_ChieftainHelmDeer_Name"); chieftainHelmDeer.Description.Alias("$SouthsilArmor_ChieftainHelmDeer_Description"); }); chieftainHelmDeer.Crafting.Stations.Clear(); chieftainHelmDeer.Crafting.Add((CraftingTable)2, 2); chieftainHelmDeer.RequiredItems.Requirements.Clear(); chieftainHelmDeer.RequiredItems.Add("DeerHide", 2, 0); chieftainHelmDeer.RequiredItems.Add("LeatherScraps", 2, 0); chieftainHelmDeer.RequiredItems.Add("FoxPelt_TW", 1, 0); chieftainHelmDeer.RequiredItems.Add("TrophyDeer", 2, 0); chieftainHelmDeer.RequiredUpgradeItems.Requirements.Clear(); chieftainHelmDeer.RequiredUpgradeItems.Add("DeerHide", 1, 0); chieftainHelmDeer.RequiredUpgradeItems.Add("LeatherScraps", 1, 0); itemWrapper2.Armor.ArmorBase = 2f; itemWrapper2.Armor.ArmorPerLevel = 2f; itemWrapper2.Armor.MovementModifier = -0.01f; itemWrapper2.Armor.Weight = 4f; SE_Stats equipEffect2 = itemWrapper2.Armor.EquipEffect; ((StatusEffect)equipEffect2).m_name = "$SouthsilArmor_ChieftainHelmDeer_Effect_Name"; ((StatusEffect)equipEffect2).m_tooltip = "$SouthsilArmor_ChieftainHelmDeer_Effect_Tooltip"; equipEffect2.m_speedModifier = 0f; equipEffect2.m_runStaminaDrainModifier = 0f; equipEffect2.m_staminaRegenMultiplier = 1.5f; equipEffect2.m_skillLevel = (SkillType)102; equipEffect2.m_skillLevelModifier = 10f; chieftainHelmDeer.Prefab.FixItemLayer(); var (chieftainChest, itemWrapper3) = itemManager["chiefchest"]; s_onLocalizationAddedCallbacks.Add(delegate { chieftainChest.Name.Alias("$SouthsilArmor_ChieftainChest_Name"); chieftainChest.Description.Alias("$SouthsilArmor_ChieftainChest_Description"); }); chieftainChest.Crafting.Stations.Clear(); chieftainChest.Crafting.Add((CraftingTable)2, 2); chieftainChest.RequiredItems.Requirements.Clear(); chieftainChest.RequiredItems.Add("DeerHide", 6, 0); chieftainChest.RequiredItems.Add("FoxPelt_TW", 3, 0); chieftainChest.RequiredItems.Add("ShieldWood", 1, 0); chieftainChest.RequiredItems.Add("Feathers", 5, 0); chieftainChest.RequiredUpgradeItems.Requirements.Clear(); chieftainChest.RequiredUpgradeItems.Add("DeerHide", 3, 0); chieftainChest.RequiredUpgradeItems.Add("LeatherScraps", 3, 0); chieftainChest.RequiredUpgradeItems.Add("FoxPelt_TW", 1, 0); itemWrapper3.Armor.ArmorBase = 6f; itemWrapper3.Armor.ArmorPerLevel = 3f; itemWrapper3.Armor.MovementModifier = -0.06f; itemWrapper3.Armor.Weight = 12f; var (chieftainLegs, itemWrapper4) = itemManager["chieflegs"]; s_onLocalizationAddedCallbacks.Add(delegate { chieftainLegs.Name.Alias("$SouthsilArmor_ChieftainLegs_Name"); chieftainLegs.Description.Alias("$SouthsilArmor_ChieftainLegs_Description"); }); chieftainLegs.Crafting.Stations.Clear(); chieftainLegs.Crafting.Add((CraftingTable)2, 2); chieftainLegs.RequiredItems.Requirements.Clear(); chieftainLegs.RequiredItems.Add("DeerHide", 4, 0); chieftainLegs.RequiredItems.Add("FoxPelt_TW", 2, 0); chieftainLegs.RequiredItems.Add("KnifeFlint", 2, 0); chieftainLegs.RequiredItems.Add("AxeFlint", 1, 0); chieftainLegs.RequiredUpgradeItems.Requirements.Clear(); chieftainLegs.RequiredUpgradeItems.Add("DeerHide", 2, 0); chieftainLegs.RequiredUpgradeItems.Add("LeatherScraps", 2, 0); itemWrapper4.Armor.ArmorBase = 4f; itemWrapper4.Armor.ArmorPerLevel = 3f; itemWrapper4.Armor.MovementModifier = -0.03f; itemWrapper4.Armor.Weight = 6f; itemManager.Keep("heavybronzehelm", "heavybronzechest", "heavybronzelegs"); var (battleswineHelm, itemWrapper5) = itemManager["heavybronzehelm"]; s_onLocalizationAddedCallbacks.Add(delegate { battleswineHelm.Name.Alias("$SouthsilArmor_BattleswineHelm_Name"); battleswineHelm.Description.Alias("$SouthsilArmor_BattleswineHelm_Description"); }); battleswineHelm.Crafting.Stations.Clear(); battleswineHelm.Crafting.Add((CraftingTable)4, 2); battleswineHelm.RequiredItems.Requirements.Clear(); battleswineHelm.RequiredItems.Add("Bronze", 3, 0); battleswineHelm.RequiredItems.Add("RazorbackLeather_TW", 2, 0); battleswineHelm.RequiredItems.Add("BlackBearPelt_TW", 1, 0); battleswineHelm.RequiredItems.Add("RazorbackTusk_TW", 2, 0); battleswineHelm.RequiredUpgradeItems.Requirements.Clear(); battleswineHelm.RequiredUpgradeItems.Add("Bronze", 2, 0); battleswineHelm.RequiredUpgradeItems.Add("RazorbackLeather_TW", 1, 0); battleswineHelm.RequiredUpgradeItems.Add("DeerHide", 2, 0); battleswineHelm.RequiredUpgradeItems.Add("RazorbackTusk_TW", 1, 0); itemWrapper5.Armor.ArmorBase = 6f; itemWrapper5.Armor.ArmorPerLevel = 3f; itemWrapper5.Armor.MovementModifier = -0.02f; itemWrapper5.Armor.Weight = 6f; battleswineHelm.Prefab.FixItemLayer(); var (battleswineChest, itemWrapper6) = itemManager["heavybronzechest"]; s_onLocalizationAddedCallbacks.Add(delegate { battleswineChest.Name.Alias("$SouthsilArmor_BattleswineChest_Name"); battleswineChest.Description.Alias("$SouthsilArmor_BattleswineChest_Description"); }); battleswineChest.Crafting.Stations.Clear(); battleswineChest.Crafting.Add((CraftingTable)4, 2); battleswineChest.RequiredItems.Requirements.Clear(); battleswineChest.RequiredItems.Add("Bronze", 9, 0); battleswineChest.RequiredItems.Add("RazorbackLeather_TW", 4, 0); battleswineChest.RequiredItems.Add("BlackBearPelt_TW", 3, 0); battleswineChest.RequiredItems.Add("TrophyRazorback_TW", 1, 0); battleswineChest.RequiredUpgradeItems.Requirements.Clear(); battleswineChest.RequiredUpgradeItems.Add("Bronze", 5, 0); battleswineChest.RequiredUpgradeItems.Add("RazorbackLeather_TW", 1, 0); battleswineChest.RequiredUpgradeItems.Add("BlackBearPelt_TW", 1, 0); itemWrapper6.Armor.ArmorBase = 18f; itemWrapper6.Armor.ArmorPerLevel = 4f; itemWrapper6.Armor.MovementModifier = -0.1f; itemWrapper6.Armor.Weight = 18f; var (battleswineLegs, itemWrapper7) = itemManager["heavybronzelegs"]; s_onLocalizationAddedCallbacks.Add(delegate { battleswineLegs.Name.Alias("$SouthsilArmor_BattleswineLegs_Name"); battleswineLegs.Description.Alias("$SouthsilArmor_BattleswineLegs_Description"); }); battleswineLegs.Crafting.Stations.Clear(); battleswineLegs.Crafting.Add((CraftingTable)4, 2); battleswineLegs.RequiredItems.Requirements.Clear(); battleswineLegs.RequiredItems.Add("Bronze", 6, 0); battleswineLegs.RequiredItems.Add("RazorbackLeather_TW", 2, 0); battleswineLegs.RequiredItems.Add("BlackBearPelt_TW", 2, 0); battleswineLegs.RequiredUpgradeItems.Requirements.Clear(); battleswineLegs.RequiredUpgradeItems.Add("Bronze", 4, 0); battleswineLegs.RequiredUpgradeItems.Add("RazorbackLeather_TW", 1, 0); battleswineLegs.RequiredUpgradeItems.Add("DeerHide", 4, 0); itemWrapper7.Armor.ArmorBase = 12f; itemWrapper7.Armor.ArmorPerLevel = 3f; itemWrapper7.Armor.MovementModifier = -0.06f; itemWrapper7.Armor.Weight = 12f; SE_Stats val = ScriptableObject.CreateInstance<SE_Stats>(); ((StatusEffect)val).m_name = "$SouthsilArmor_BattleswineSet_Effect_Name"; ((StatusEffect)val).m_tooltip = "$SouthsilArmor_BattleswineSet_Effect_Tooltip"; ((StatusEffect)val).m_icon = itemWrapper5.Icon; val.m_skillLevel = (SkillType)5; val.m_skillLevelModifier = 15f; val.m_skillLevel2 = CustomSkills.Warpikes; val.m_skillLevelModifier2 = 15f; itemWrapper5.Set.Effect = val; itemWrapper5.Set.Name = "Battleswine"; itemWrapper5.Set.Size = 3; itemWrapper6.Set = itemWrapper5.Set; itemWrapper7.Set = itemWrapper5.Set; itemManager.Keep("swamphelm", "swampchest", "swamplegs"); var (draugrHelm, itemWrapper8) = itemManager["swamphelm"]; s_onLocalizationAddedCallbacks.Add(delegate { draugrHelm.Name.Alias("$SouthsilArmor_DraugrHelm_Name"); draugrHelm.Description.Alias("$SouthsilArmor_DraugrHelm_Description"); }); draugrHelm.Crafting.Stations.Clear(); draugrHelm.Crafting.Add((CraftingTable)4, 3); draugrHelm.RequiredItems.Requirements.Clear(); draugrHelm.RequiredItems.Add("Iron", 15, 0); draugrHelm.RequiredItems.Add("RottenPelt_TW", 2, 0); draugrHelm.RequiredItems.Add("WitheredBone", 2, 0); draugrHelm.RequiredItems.Add("TrophyCrawler_TW", 1, 0); draugrHelm.RequiredUpgradeItems.Requirements.Clear(); draugrHelm.RequiredUpgradeItems.Add("Iron", 4, 0); draugrHelm.RequiredUpgradeItems.Add("RottenPelt_TW", 1, 0); draugrHelm.RequiredUpgradeItems.Add("WitheredBone", 1, 0); itemWrapper8.Armor.ArmorBase = 9f; itemWrapper8.Armor.ArmorPerLevel = 3f; itemWrapper8.Armor.MovementModifier = -0.02f; itemWrapper8.Armor.Weight = 6f; draugrHelm.Prefab.FixItemLayer(); var (draugrChest, itemWrapper9) = itemManager["swampchest"]; s_onLocalizationAddedCallbacks.Add(delegate { draugrChest.Name.Alias("$SouthsilArmor_DraugrChest_Name"); draugrChest.Description.Alias("$SouthsilArmor_DraugrChest_Description"); }); draugrChest.Crafting.Stations.Clear(); draugrChest.Crafting.Add((CraftingTable)4, 3); draugrChest.RequiredItems.Requirements.Clear(); draugrChest.RequiredItems.Add("Iron", 45, 0); draugrChest.RequiredItems.Add("RottenPelt_TW", 4, 0); draugrChest.RequiredItems.Add("WitheredBone", 8, 0); draugrChest.RequiredUpgradeItems.Requirements.Clear(); draugrChest.RequiredUpgradeItems.Add("Iron", 11, 0); draugrChest.RequiredUpgradeItems.Add("RottenPelt_TW", 2, 0); draugrChest.RequiredUpgradeItems.Add("WitheredBone", 4, 0); itemWrapper9.Armor.ArmorBase = 27f; itemWrapper9.Armor.ArmorPerLevel = 4f; itemWrapper9.Armor.MovementModifier = -0.1f; itemWrapper9.Armor.Weight = 18f; var (draugrLegs, itemWrapper10) = itemManager["swamplegs"]; s_onLocalizationAddedCallbacks.Add(delegate { draugrLegs.Name.Alias("$SouthsilArmor_DraugrLegs_Name"); draugrLegs.Description.Alias("$SouthsilArmor_DraugrLegs_Description"); }); draugrLegs.Crafting.Stations.Clear(); draugrLegs.Crafting.Add((CraftingTable)4, 3); draugrLegs.RequiredItems.Requirements.Clear(); draugrLegs.RequiredItems.Add("Iron", 30, 0); draugrLegs.RequiredItems.Add("RottenPelt_TW", 2, 0); draugrLegs.RequiredItems.Add("WitheredBone", 4, 0); draugrLegs.RequiredItems.Add("TrophySkeleton", 4, 0); draugrLegs.RequiredUpgradeItems.Requirements.Clear(); draugrLegs.RequiredUpgradeItems.Add("Iron", 7, 0); draugrLegs.RequiredUpgradeItems.Add("RottenPelt_TW", 1, 0); draugrLegs.RequiredUpgradeItems.Add("WitheredBone", 2, 0); itemWrapper10.Armor.ArmorBase = 18f; itemWrapper10.Armor.ArmorPerLevel = 3f; itemWrapper10.Armor.MovementModifier = -0.06f; itemWrapper10.Armor.Weight = 12f; SE_Stats effect = itemWrapper8.Set.Effect; ((StatusEffect)effect).m_name = "$SouthsilArmor_DraugrSet_Effect_Name"; ((StatusEffect)effect).m_tooltip = "$SouthsilArmor_DraugrSet_Effect_Tooltip"; effect.m_mods.Clear(); effect.m_mods.Add(new DamageModPair { m_type = CapeAndTorchResistanceChanges.Water, m_modifier = (DamageModifier)3 }); itemWrapper8.Set.Name = "Draugr"; itemWrapper8.Set.Size = 3; itemWrapper9.Set = itemWrapper8.Set; itemWrapper10.Set = itemWrapper8.Set; itemManager.Keep("heavybearhelm", "heavybearchest", "heavybearlegs"); var (grizzlyHelm, itemWrapper11) = itemManager["heavybearhelm"]; s_onLocalizationAddedCallbacks.Add(delegate { grizzlyHelm.Name.Alias("$SouthsilArmor_GrizzlyHelm_Name"); grizzlyHelm.Description.Alias("$SouthsilArmor_GrizzlyHelm_Description"); }); grizzlyHelm.Crafting.Stations.Clear(); grizzlyHelm.Crafting.Add((CraftingTable)4, 3); grizzlyHelm.RequiredItems.Requirements.Clear(); grizzlyHelm.RequiredItems.Add("Silver", 15, 0); grizzlyHelm.RequiredItems.Add("GrizzlyBearPelt_TW", 1, 0); grizzlyHelm.RequiredItems.Add("TrophyHatchling", 1, 0); grizzlyHelm.RequiredItems.Add("TrophyGrizzlyBear_TW", 1, 0); grizzlyHelm.RequiredUpgradeItems.Requirements.Clear(); grizzlyHelm.RequiredUpgradeItems.Add("Silver", 4, 0); grizzlyHelm.RequiredUpgradeItems.Add("WolfPelt", 2, 0); itemWrapper11.Armor.ArmorBase = 14f; itemWrapper11.Armor.ArmorPerLevel = 4f; itemWrapper11.Armor.MovementModifier = -0.02f; itemWrapper11.Armor.Weight = 6f; grizzlyHelm.Prefab.FixItemLayer(); var (grizzlyChest, itemWrapper12) = itemManager["heavybearchest"]; s_onLocalizationAddedCallbacks.Add(delegate { grizzlyChest.Name.Alias("$SouthsilArmor_GrizzlyChest_Name"); grizzlyChest.Description.Alias("$SouthsilArmor_GrizzlyChest_Description"); }); grizzlyChest.Crafting.Stations.Clear(); grizzlyChest.Crafting.Add((CraftingTable)4, 3); grizzlyChest.RequiredItems.Requirements.Clear(); grizzlyChest.RequiredItems.Add("Silver", 45, 0); grizzlyChest.RequiredItems.Add("GrizzlyBearPelt_TW", 3, 0); grizzlyChest.RequiredItems.Add("WolfPelt", 4, 0); grizzlyChest.RequiredItems.Add("ClaymoreIron_TW", 1, 0); grizzlyChest.RequiredUpgradeItems.Requirements.Clear(); grizzlyChest.RequiredUpgradeItems.Add("Silver", 11, 0); grizzlyChest.RequiredUpgradeItems.Add("GrizzlyBearPelt_TW", 2, 0); grizzlyChest.RequiredUpgradeItems.Add("WolfPelt", 2, 0); itemWrapper12.Armor.ArmorBase = 27f; itemWrapper12.Armor.ArmorPerLevel = 4f; itemWrapper12.Armor.MovementModifier = -0.1f; itemWrapper12.Armor.Weight = 18f; itemWrapper12.SharedData.m_heatResistanceModifier = 0f; var (grizzlyLegs, itemWrapper13) = itemManager["heavybearlegs"]; s_onLocalizationAddedCallbacks.Add(delegate { grizzlyLegs.Name.Alias("$SouthsilArmor_GrizzlyLegs_Name"); grizzlyLegs.Description.Alias("$SouthsilArmor_GrizzlyLegs_Description"); }); grizzlyLegs.Crafting.Stations.Clear(); grizzlyLegs.Crafting.Add((CraftingTable)4, 3); grizzlyLegs.RequiredItems.Requirements.Clear(); grizzlyLegs.RequiredItems.Add("Silver", 30, 0); grizzlyLegs.RequiredItems.Add("GrizzlyBearPelt_TW", 2, 0); grizzlyLegs.RequiredItems.Add("KnifeSilver", 2, 0); grizzlyLegs.RequiredItems.Add("TankardAnniversary", 1, 0); grizzlyLegs.RequiredUpgradeItems.Requirements.Clear(); grizzlyLegs.RequiredUpgradeItems.Add("Silver", 7, 0); grizzlyLegs.RequiredUpgradeItems.Add("GrizzlyBearPelt_TW", 1, 0); grizzlyLegs.RequiredUpgradeItems.Add("WolfPelt", 2, 0); itemWrapper13.Armor.ArmorBase = 18f; itemWrapper13.Armor.ArmorPerLevel = 3f; itemWrapper13.Armor.MovementModifier = -0.06f; itemWrapper13.Armor.Weight = 12f; itemWrapper13.SharedData.m_heatResistanceModifier = 0f; SE_Stats effect2 = itemWrapper11.Set.Effect; ((StatusEffect)effect2).m_name = "$SouthsilArmor_GrizzlySet_Effect_Name"; ((StatusEffect)effect2).m_tooltip = "$SouthsilArmor_GrizzlySet_Effect_Tooltip"; effect2.m_skillLevel = (SkillType)1; effect2.m_skillLevelModifier = 15f; effect2.m_skillLevel2 = CustomSkills.TwoHandedSwords; effect2.m_skillLevelModifier2 = 15f; effect2.m_mods.Clear(); effect2.m_mods.Add(new DamageModPair { m_type = CapeAndTorchResistanceChanges.Cold, m_modifier = (DamageModifier)5 }); effect2.m_staminaRegenMultiplier = 1f; itemWrapper11.Set.Name = "Grizzly"; itemWrapper11.Set.Size = 3; itemWrapper12.Set = itemWrapper11.Set; itemWrapper13.Set = itemWrapper11.Set; itemManager.Keep("obswolfhelm", "obswolfchest", "obswolflegs"); var (feralHelm, itemWrapper14) = itemManager["obswolfhelm"]; s_onLocalizationAddedCallbacks.Add(delegate { feralHelm.Name.Alias("$SouthsilArmor_FeralHelm_Name"); feralHelm.Description.Alias("$SouthsilArmor_FeralHelm_Description"); }); feralHelm.Crafting.Stations.Clear(); feralHelm.Crafting.Add((CraftingTable)4, 2); feralHelm.RequiredItems.Requirements.Clear(); feralHelm.RequiredItems.Add("BlackMetal", 4, 0); feralHelm.RequiredItems.Add("WolfHairBundle", 10, 0); feralHelm.RequiredItems.Add("TrophyProwler_TW", 1, 0); feralHelm.RequiredItems.Add("Ruby", 5, 0); feralHelm.RequiredUpgradeItems.Requirements.Clear(); feralHelm.RequiredUpgradeItems.Add("BlackMetal", 2, 0); feralHelm.RequiredUpgradeItems.Add("WolfHairBundle", 5, 0); itemWrapper14.Armor.ArmorBase = 7f; itemWrapper14.Armor.ArmorPerLevel = 2f; itemWrapper14.Armor.MovementModifier = 0f; itemWrapper14.Armor.Weight = 1f; feralHelm.Prefab.FixItemLayer(); var (feralChest, itemWrapper15) = itemManager["obswolfchest"]; s_onLocalizationAddedCallbacks.Add(delegate { feralChest.Name.Alias("$SouthsilArmor_FeralChest_Name"); feralChest.Description.Alias("$SouthsilArmor_FeralChest_Description"); }); feralChest.Crafting.Stations.Clear(); feralChest.Crafting.Add((CraftingTable)4, 2); feralChest.RequiredItems.Requirements.Clear(); feralChest.RequiredItems.Add("BlackMetal", 12, 0); feralChest.RequiredItems.Add("LoxPelt", 4, 0); feralChest.RequiredItems.Add("ProwlerFang_TW", 4, 0); feralChest.RequiredItems.Add("TrophyUlv", 4, 0); feralChest.RequiredUpgradeItems.Requirements.Clear(); feralChest.RequiredUpgradeItems.Add("BlackMetal", 6, 0); feralChest.RequiredUpgradeItems.Add("LoxPelt", 1, 0); feralChest.RequiredUpgradeItems.Add("ProwlerFang_TW", 2, 0); itemWrapper15.Armor.ArmorBase = 21f; itemWrapper15.Armor.ArmorPerLevel = 3f; itemWrapper15.Armor.MovementModifier = -0.01f; itemWrapper15.Armor.Weight = 6f; itemWrapper15.Armor.DamageModifiers.Clear(); var (feralLegs, itemWrapper16) = itemManager["obswolflegs"]; s_onLocalizationAddedCallbacks.Add(delegate { feralLegs.Name.Alias("$SouthsilArmor_FeralLegs_Name"); feralLegs.Description.Alias("$SouthsilArmor_FeralLegs_Description"); }); feralLegs.Crafting.Stations.Clear(); feralLegs.Crafting.Add((CraftingTable)4, 2); feralLegs.RequiredItems.Requirements.Clear(); feralLegs.RequiredItems.Add("BlackMetal", 8, 0); feralLegs.RequiredItems.Add("LinenThread", 20, 0); feralLegs.RequiredItems.Add("WolfClaw", 5, 0); feralLegs.RequiredUpgradeItems.Requirements.Clear(); feralLegs.RequiredUpgradeItems.Add("BlackMetal", 4, 0); feralLegs.RequiredUpgradeItems.Add("LinenThread", 10, 0); itemWrapper16.Armor.ArmorBase = 14f; itemWrapper16.Armor.ArmorPerLevel = 3f; itemWrapper16.Armor.MovementModifier = -0.01f; itemWrapper16.Armor.Weight = 3f; SE_Stats effect3 = itemWrapper14.Set.Effect; ((StatusEffect)effect3).m_name = "$SouthsilArmor_FeralSet_Effect_Name"; ((StatusEffect)effect3).m_tooltip = "$SouthsilArmor_FeralSet_Effect_Tooltip"; effect3.m_skillLevel = (SkillType)101; effect3.m_skillLevelModifier = 15f; effect3.m_skillLevel2 = (SkillType)2; effect3.m_skillLevelModifier2 = 15f; effect3.m_runStaminaDrainModifier = 0f; effect3.m_jumpStaminaUseModifier = 0f; effect3.m_speedModifier = 0f; effect3.m_stealthModifier = 0f; effect3.m_mods.Clear(); itemWrapper14.Set.Name = "Feral"; itemWrapper14.Set.Size = 3; itemWrapper15.Set = itemWrapper14.Set; itemWrapper16.Set = itemWrapper14.Set; itemManager.Keep("norahhelm", "norahhelmalt", "norahchest", "norahlegs"); var (shieldmaidenHelm, itemWrapper17) = itemManager["norahhelm"]; s_onLocalizationAddedCallbacks.Add(delegate { shieldmaidenHelm.Name.Alias("$SouthsilArmor_ShieldmaidenHelm_Name"); shieldmaidenHelm.Description.Alias("$SouthsilArmor_ShieldmaidenHelm_Description"); }); shieldmaidenHelm.Crafting.Stations.Clear(); shieldmaidenHelm.Crafting.Add((CraftingTable)4, 2); shieldmaidenHelm.RequiredItems.Requirements.Clear(); shieldmaidenHelm.RequiredItems.Add("LinenThread", 10, 0); shieldmaidenHelm.RequiredItems.Add("Coins", 500, 0); shieldmaidenHelm.RequiredUpgradeItems.Requirements.Clear(); shieldmaidenHelm.RequiredUpgradeItems.Add("LinenThread", 10, 0); itemWrapper17.Armor.ArmorBase = 10f