using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
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("PutinMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Comet")]
[assembly: AssemblyProduct("PutinMod")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5d429653-1f3b-406d-85c8-b4496d5c034a")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace PutinMon
{
[BepInPlugin("PutinLootBug", "PutinLootBug", "1.0.0")]
public class PutinModd : BaseUnityPlugin
{
public static GameObject PutinObj;
private static PutinModd PutinMod;
public static AssetBundle assetBundle;
public static ManualLogSource logger;
private readonly Harmony harm = new Harmony("PutinLootBug");
private void Awake()
{
logger = ((BaseUnityPlugin)this).Logger;
((BaseUnityPlugin)this).Logger.LogInfo((object)"Started Putin Mod");
if ((Object)(object)PutinMod == (Object)null)
{
PutinMod = this;
}
string location = ((BaseUnityPlugin)PutinMod).Info.Location;
string text = "PutinMon.dll";
string text2 = location.TrimEnd(text.ToCharArray());
string text3 = text2 + "wideputin";
assetBundle = AssetBundle.LoadFromFile(text3);
((BaseUnityPlugin)this).Logger.LogInfo((object)assetBundle.GetAllAssetNames());
PutinObj = assetBundle.LoadAsset<GameObject>("putin_reference.prefab");
((BaseUnityPlugin)this).Logger.LogInfo((object)(((Object)PutinObj).name + " has been found"));
harm.PatchAll();
}
}
}
namespace PutinMon.Patches
{
[HarmonyPatch(typeof(HoarderBugAI))]
internal class LootBugPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
public static void Postfix(ref HoarderBugAI __instance)
{
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
//IL_01db: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: Unknown result type (might be due to invalid IL or missing references)
//IL_025c: Unknown result type (might be due to invalid IL or missing references)
//IL_0278: Unknown result type (might be due to invalid IL or missing references)
//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0316: Unknown result type (might be due to invalid IL or missing references)
//IL_0349: Unknown result type (might be due to invalid IL or missing references)
//IL_0356: Unknown result type (might be due to invalid IL or missing references)
//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
//IL_042d: Unknown result type (might be due to invalid IL or missing references)
//IL_0449: Unknown result type (might be due to invalid IL or missing references)
//IL_047c: Unknown result type (might be due to invalid IL or missing references)
//IL_0498: Unknown result type (might be due to invalid IL or missing references)
//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
//IL_04ed: Unknown result type (might be due to invalid IL or missing references)
PutinModd.logger.LogInfo((object)"Hoarding spawned, Replacing with putin");
Transform val = ((Component)__instance).transform.Find("HoarderBugModel");
SkinnedMeshRenderer val2 = null;
if ((Object)(object)val != (Object)null)
{
Transform val3 = val.Find("Cube");
Transform val4 = val.Find("Cube.001");
((Component)val3).gameObject.SetActive(false);
((Component)val4).gameObject.SetActive(false);
val2 = (((Object)(object)val3 != (Object)null) ? ((Component)val3).GetComponent<SkinnedMeshRenderer>() : null);
}
Transform val5 = null;
if ((Object)(object)val != (Object)null)
{
Transform val6 = val.Find("AnimContainer");
val5 = (((Object)(object)val6 != (Object)null) ? val6.Find("Armature") : null);
}
if (!((Object)(object)val2 == (Object)null) && ((Renderer)val2).enabled)
{
Renderer[] componentsInChildren = ((Component)val5).gameObject.GetComponentsInChildren<Renderer>();
foreach (Renderer val7 in componentsInChildren)
{
val7.enabled = false;
}
GameObject val8 = Object.Instantiate<GameObject>(PutinModd.PutinObj);
val8.transform.SetParent(val);
val8.transform.localPosition = Vector3.zero;
val8.transform.localRotation = Quaternion.identity;
val8.transform.localScale = Vector3.one;
Transform val9 = val8.transform.Find("Container/Body_Geo");
Transform val10 = val8.transform.Find("Container/metarig");
Transform val11 = val5.Find("Abdomen");
Transform val12 = val10.Find("Torso1");
val10.SetParent(val11);
((Component)val10).transform.localScale = Vector3.one * 5f;
((Component)val10).transform.localPosition = new Vector3(0.44f, 0.52f, 0f);
Transform val13 = val11.Find("Chest");
val12.SetParent(val13);
((Component)val12).transform.localPosition = Vector3.zero;
val12.forward = ((Component)__instance).transform.forward;
PutinModd.logger.LogInfo((object)"Getting to parents!!!!!!!");
Transform val14 = val10.Find("UpperLeg1.L");
Transform val15 = val11.Find("Bone.00");
val14.SetParent(val15);
val14.localPosition = Vector3.zero;
val14.localEulerAngles = new Vector3(0f, 330f, 10f);
Transform val16 = val10.Find("UpperLeg1.R");
Transform val17 = val11.Find("Bone.001");
val16.SetParent(val17);
val16.localPosition = Vector3.zero;
val16.localEulerAngles = new Vector3(0f, 200f, 14f);
Transform val18 = val16.Find("UpperLeg2.R");
Transform parent = val17.Find("Bone.002");
val18.SetParent(parent);
val18.localPosition = Vector3.zero;
val18.localEulerAngles = new Vector3(0f, 210f, 0f);
Transform val19 = val14.Find("UpperLeg2.L");
Transform parent2 = val15.Find("Bone.01");
val19.SetParent(parent2);
val19.localPosition = Vector3.zero;
val19.localRotation = Quaternion.identity;
Transform child = val12.GetChild(0).GetChild(0);
Transform val20 = child.Find("mixamorig:Neck");
Transform val21 = val13.Find("Head");
val20.SetParent(val21);
((Component)val20).transform.forward = ((Component)__instance).transform.forward;
Transform val22 = child.Find("mixamorig:LeftShoulder");
Transform val23 = val21.Find("Bone.03");
val22.SetParent(val23);
val22.localPosition = Vector3.zero;
val22.localEulerAngles = new Vector3(25f, 110f, 350f);
Transform val24 = val22.GetChild(0).Find("mixamorig:LeftForeArm");
Transform parent3 = val23.Find("Bone.04");
val24.SetParent(parent3);
val24.localPosition = Vector3.zero;
val24.localEulerAngles = new Vector3(15f, 200f, 0f);
Transform val25 = child.Find("mixamorig:RightShoulder");
Transform val26 = val21.Find("Bone.004");
val25.SetParent(val26);
val25.localPosition = Vector3.zero;
val25.localEulerAngles = new Vector3(0f, 120f, 0f);
Transform val27 = val25.GetChild(0).Find("mixamorig:RightForeArm");
Transform parent4 = val26.Find("Bone.005");
val27.SetParent(parent4);
val27.localPosition = Vector3.zero;
val27.localEulerAngles = new Vector3(0f, 200f, 0f);
}
}
}
}