Decompiled source of OutHard Gameplay Overhaul v2.1.0

OuthardCombat.dll

Decompiled 3 weeks ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OutwardModTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OutwardModTemplate")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace OutwardModTemplate;

[BepInPlugin("DubsMod.NoCombatMusic", "NoCombatMusic", "1.0.0")]
public class DubsNoCombatMod : BaseUnityPlugin
{
	public const string GUID = "DubsMod.NoCombatMusic";

	public const string NAME = "NoCombatMusic";

	public const string VERSION = "1.0.0";

	internal static ManualLogSource Log;

	internal void Awake()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		Log = ((BaseUnityPlugin)this).Logger;
		new Harmony("DubsMod.NoCombatMusic").PatchAll();
	}
}
[HarmonyPatch(typeof(GlobalAudioManager), "CombatStarted")]
public class GlobalAudioManagerNoCombatMusic
{
	[HarmonyPrefix]
	private static bool Prefix(Character __instance)
	{
		return false;
	}
}
[BepInPlugin("com.outward.DubsPotions", "DubsPotions", "1.0")]
public class DubsPotions : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Item), "StartEffectsCast")]
	private class Item_StartEffectsCast
	{
		[HarmonyPrefix]
		public static bool Prefix(Item __instance, Character _targetChar)
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Invalid comparison between Unknown and I4
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if (__instance.IsDrink)
			{
				int num = (int)methodGetCastSheathRequired.Invoke(__instance, new object[0]);
				SpellCastModifier val = (SpellCastModifier)1;
				SpellCastType val2 = __instance.ActivateEffectAnimType;
				if ((int)val2 == 28)
				{
					val2 = (SpellCastType)2;
				}
				_targetChar.CastSpell(val2, ((Component)__instance).gameObject, val, num, __instance.MobileCastMovementMult);
				return false;
			}
			return true;
		}
	}

	private const string ID = "com.outward.DubsPotions";

	private const string NAME = "DubsPotions";

	private const string VERSION = "1.0";

	private static MethodInfo methodGetCastSheathRequired;

	internal void Awake()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		methodGetCastSheathRequired = typeof(Item).GetMethod("GetCastSheathRequired", AccessTools.all);
		new Harmony("com.outward.DubsPotions").PatchAll(Assembly.GetExecutingAssembly());
	}
}
public class DubsSkillLearner
{
}

OuthardEconomy.dll

Decompiled 3 weeks ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using SideLoader;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OutwardModTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OutwardModTemplate")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace OutwardModTemplate;

[BepInPlugin("myname.mymod", "MyMod", "1.0.0")]
public class DubsThing : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Merchant), "RefreshInventory")]
	public class MerchantRefreshInventoryPatch
	{
		private static void Postfix(Merchant __instance)
		{
			__instance.MerchantPouch.RemoveAllSilver();
			__instance.AverageSilverOnRefresh = 0;
		}
	}

	[HarmonyPatch(typeof(ItemDropper), "GenerateItem")]
	public class ItemDropper_GenerateItem
	{
		[HarmonyPostfix]
		public static void Postfix(ItemDropper __instance, ItemContainer _container, BasicItemDrop _itemDrop, int _spawnAmount)
		{
			Log.LogMessage((object)"ItemDropper Interaction");
			Character characterUsing = ((Item)_container).m_characterUsing;
			if ((Object)(object)characterUsing != (Object)null)
			{
				Log.LogMessage((object)"ItemDropper Interaction Character not null");
				List<int> list = CanItemDrop(characterUsing);
				if (list != null && list.Count > 0)
				{
					Log.LogMessage((object)$"ItemDropper Interaction ItemDropped {list[0]}");
					GrantCharacterItems(list, characterUsing);
				}
			}
		}
	}

	[HarmonyPatch(typeof(InteractionOpenContainer), "OnActivationDone")]
	public class InteractionOpenContainer_OnActivationDone
	{
		[HarmonyPrefix]
		public static void Prefix(InteractionOpenContainer __instance)
		{
			Character lastCharacter = ((InteractionBase)__instance).LastCharacter;
			if ((Object)(object)lastCharacter != (Object)null)
			{
				List<int> list = CanItemDrop(lastCharacter);
				Log.LogMessage((object)"InteractionOpenContainer Character not null");
				if (list != null && list.Count > 0)
				{
					Log.LogMessage((object)$"InteractionOpenContaine Interaction ItemDropped {list[0]}");
					GrantCharacterItems(list, lastCharacter);
				}
			}
		}
	}

	[HarmonyPatch(typeof(Currency))]
	public class CurrencyPatch
	{
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		public static void SilverIconGetterPostfix(ref Sprite __result)
		{
			if ((Object)(object)CustomSilverIcon != (Object)null)
			{
				__result = CustomSilverIcon;
			}
			else
			{
				Debug.LogWarning((object)"Custom sprite is null, using original SilverIcon");
			}
		}
	}

	[HarmonyPatch(typeof(Currency), "GetSilverWeight")]
	public class CurrencyGetSilverWeightPatch
	{
		[HarmonyPrefix]
		public static bool Prefix(int _silverAmount, ref float __result)
		{
			__result = 0f;
			return false;
		}
	}

	public const string GUID = "myname.mymod";

	public const string NAME = "MyMod";

	public const string VERSION = "1.0.0";

	internal static ManualLogSource Log;

	public static ConfigEntry<bool> ExampleConfig;

	public static ConfigEntry<float> Item59200;

	public static ConfigEntry<float> Item59201;

	public static ConfigEntry<float> Item59202;

	public static ConfigEntry<float> Item59203;

	public static ConfigEntry<float> Item59204;

	public static ConfigEntry<float> Item59205;

	public static ConfigEntry<int> GoldMinDrop;

	public static ConfigEntry<int> GoldMaxDrop;

	public const int GoldCurrencyID = -59200;

	public static List<AdditionalItemDrops> ItemDrops = new List<AdditionalItemDrops>();

	public static Dictionary<int, ConfigEntry<float>> Map = new Dictionary<int, ConfigEntry<float>>();

	public static Sprite CustomSilverIcon = null;

	internal void Awake()
	{
		//IL_0180: Unknown result type (might be due to invalid IL or missing references)
		Log = ((BaseUnityPlugin)this).Logger;
		Log.LogMessage((object)"Hello world from MyMod 1.0.0!");
		Item59200 = ((BaseUnityPlugin)this).Config.Bind<float>("Dub Item Drop Chances", "Gold Coin Drop Chance", 50f, (ConfigDescription)null);
		Item59201 = ((BaseUnityPlugin)this).Config.Bind<float>("Dub Item Drop Chances", "Forgotten Knowledge Drop Chance", 50f, (ConfigDescription)null);
		Item59202 = ((BaseUnityPlugin)this).Config.Bind<float>("Dub Item Drop Chances", "Knowledge Scroll", 50f, (ConfigDescription)null);
		Item59203 = ((BaseUnityPlugin)this).Config.Bind<float>("Dub Item Drop Chances", "Advanced Knowledge Scroll", 50f, (ConfigDescription)null);
		Item59204 = ((BaseUnityPlugin)this).Config.Bind<float>("Dub Item Drop Chances", "Attribute Scroll", 50f, (ConfigDescription)null);
		GoldMinDrop = ((BaseUnityPlugin)this).Config.Bind<int>("Dub Item Drop Chances", "Gold Drop Min", 5, (ConfigDescription)null);
		GoldMaxDrop = ((BaseUnityPlugin)this).Config.Bind<int>("Dub Item Drop Chances", "Gold Drop Max", 50, (ConfigDescription)null);
		Map.Clear();
		Map.Add(-59200, Item59200);
		Map.Add(-59201, Item59201);
		Map.Add(-59202, Item59202);
		Map.Add(-59203, Item59203);
		Map.Add(-59204, Item59204);
		SL.OnPacksLoaded += SL_OnPacksLoaded;
		new Harmony("myname.mymod").PatchAll();
	}

	private void SL_OnPacksLoaded()
	{
		Log.LogMessage((object)"SL_OnPacksLoaded : OutHard_Gameplay_Overhaul");
		SLPack sLPack = SL.GetSLPack("OutHard_Gameplay_Overhaul");
		if (sLPack != null)
		{
			Texture2D val = sLPack.Texture2D["Influence"];
			if ((Object)(object)val != (Object)null)
			{
				Log.LogMessage((object)"creating sprite from texture");
				Log.LogMessage((object)CustomSilverIcon);
			}
			else
			{
				Log.LogMessage((object)"Could not find Texture named Influence");
			}
		}
		else
		{
			Log.LogMessage((object)"Could not find SLPack : OutHard_Gameplay_Overhaul");
		}
	}

	public static List<int> CanItemDrop(Character Character)
	{
		List<int> list = new List<int>();
		foreach (AdditionalItemDrops itemDrop in ItemDrops)
		{
			float num = Random.Range(0, 100);
			if (Map.ContainsKey(itemDrop.ItemID) && num <= Map[itemDrop.ItemID].Value)
			{
				list.Add(itemDrop.ItemID);
				break;
			}
		}
		return list;
	}

	public static void GrantCharacterItems(List<int> Droppeditems, Character character)
	{
		if (Droppeditems == null || Droppeditems.Count <= 0)
		{
			return;
		}
		foreach (int Droppeditem in Droppeditems)
		{
			if (Droppeditem == -59200)
			{
				int num = Random.Range(GoldMinDrop.Value, GoldMaxDrop.Value);
				character.Inventory.GenerateItem(ItemManager.Instance.GenerateItemNetwork(Droppeditem), num, false);
			}
			else
			{
				character.Inventory.GenerateItem(ItemManager.Instance.GenerateItemNetwork(Droppeditem), 1, false);
			}
		}
	}
}
public class AdditionalItemDrops
{
	public int ItemID;

	public int ItemAmount;
}

OuthardSkills.dll

Decompiled 3 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using SideLoader;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OutwardModTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OutwardModTemplate")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace OuthardAdditionsSkill;

[BepInPlugin("OuthardAdditionsSkill", "OuthardAdditionsSkill", "1.0.0")]
public class OuthardAdditionsSkill : BaseUnityPlugin
{
	public const string GUID = "OuthardAdditionsSkill";

	public const string NAME = "OuthardAdditionsSkill";

	public const string VERSION = "1.0.0";

	internal static ManualLogSource Log;

	public const int OuthardAdditionsSkillID = -59040;

	public Skill OuthardAdditions;

	public const int OuthardAdditions1SkillID = -59065;

	public Skill OuthardAdditions1;

	public const int OuthardAdditions2SkillID = -59237;

	public Skill OuthardAdditions2;

	internal void Awake()
	{
		Log = ((BaseUnityPlugin)this).Logger;
		Log.LogMessage((object)"Hello world from OuthardAdditionsSkill 1.0.0!");
		SL.OnSceneLoaded += OnSceneLoaded;
	}

	private void OnSceneLoaded()
	{
		try
		{
			foreach (Character value in CharacterManager.Instance.Characters.Values)
			{
				if (!value.IsAI && (Object)(object)value.Inventory != (Object)null && !value.Inventory.LearnedSkill((Item)(object)OuthardAdditions))
				{
					value.Inventory.ReceiveSkillReward(-59040);
					value.Inventory.ReceiveSkillReward(-59065);
					value.Inventory.ReceiveSkillReward(-59237);
				}
			}
		}
		catch (Exception arg)
		{
			Log.LogMessage((object)$"Exception during PowerAdjustmentLearn.OnSceneLoaded: {arg}");
		}
	}
}

OuthardTrainers.dll

Decompiled 3 weeks ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using SideLoader_ExtendedEffects;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OuthardAdditions")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OuthardAdditions")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace OuthardAdditions;

[BepInPlugin("Outhard.Additions", "Outhard Additions", "1.0.0")]
public class TrainerSkillTree : BaseUnityPlugin
{
	public const string GUID = "Outhard.Additions";

	public const string NAME = "Outhard Additions";

	public const string VERSION = "1.0.0";

	internal static ManualLogSource Log;

	internal void Awake()
	{
		Log = ((BaseUnityPlugin)this).Logger;
		ExtendedEffects.AddSkillTreeOverride("amNWoE86iEuFXwR0W0IN1g", "customritualistskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("T9WMtY19iE-xHgY8YvL-pg", "customsageskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("RDpO95DLnUCAbO2r6wFXWQ", "customspellbladeskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("COjwWffxskCCJArwPse8sg", "custommercenaryskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("sFByVx3FlkqcousWhBuMoQ", "customphilosopherskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("px5m8Zz0BkuxKlKqQ3WWVw", "custommonkskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("QLNeDTk4R06-FYBYH3-pFg", "customhermitskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("ib2QuU8At0ylS4xT_uOXMQ", "customrogueskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("YV9EcfuJ4Uak484H4nf98A", "customhunterskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("GopwgEoanEa888blVh8s6A", "customspeedsterskilltree-dub");
		ExtendedEffects.AddSkillTreeOverride("awsiJhIN-UmoO6JxQuzjIA", "customhexskilltree-dub");
	}
}