Decompiled source of ItemPriceModifier v1.0.0

ItemPriceModifier.dll

Decompiled 2 weeks ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
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("ItemPriceModifier")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ItemPriceModifier")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("620a1ba2-5a90-4ce8-9930-51652ddf0af8")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ItemPriceModifier;

[BepInPlugin("com.deinname.itempricemodifier", "Item Price Modifier", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	public static ConfigEntry<float> PriceMultiplier;

	private void Awake()
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Expected O, but got Unknown
		PriceMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Settings", "PriceMultiplier", 0.5f, "Multiplikator für Item-Preise (z.B. 0.5 = halbieren)");
		Harmony val = new Harmony("com.deinname.itempricemodifier");
		val.PatchAll();
	}
}
[HarmonyPatch(typeof(ItemData), "GetItemPrice")]
public class Patch_GetItemPrice
{
	private static void Postfix(ref ushort __result)
	{
		float num = (float)(int)__result * Plugin.PriceMultiplier.Value;
		__result = (ushort)Mathf.Clamp(Mathf.RoundToInt(num), 1, 65535);
	}
}