using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("jtv")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("jtv")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("1.1.8.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.8.0")]
namespace jtv;
[HarmonyPatch(typeof(OfferingBowl), "Awake")]
public static class AlterOfferBowlAwake
{
public static void Prefix(OfferingBowl __instance)
{
if ((Object)(object)__instance == (Object)null)
{
return;
}
Logger.LogDebug((object)("Calling OfferingBowl.Awake for " + ((Object)__instance).name));
GameObject val = GameObject.Find("JotunnAltar(Clone)");
if ((Object)(object)val != (Object)null)
{
GameObject prefab = ZNetScene.instance.GetPrefab("RRRM_Jotunn");
if ((Object)(object)prefab != (Object)null)
{
((Character)prefab.GetComponent<Humanoid>()).m_staggerWhenBlocked = false;
((Character)prefab.GetComponent<Humanoid>()).m_staggerDamageFactor = 0f;
OfferingBowl componentInChildren = val.gameObject.GetComponentInChildren<OfferingBowl>();
componentInChildren.m_name = ((Character)prefab.gameObject.GetComponent<Humanoid>()).m_name;
componentInChildren.m_bossPrefab = prefab.gameObject;
}
else
{
Logger.LogDebug((object)"Did not find boss <RRRM_Jotunn>");
}
}
else
{
Logger.LogDebug((object)"Did not find altar <JotunnAltar>");
}
GameObject val2 = GameObject.Find("BlazingDamnedOneAltar(Clone)");
if ((Object)(object)val2 != (Object)null)
{
GameObject prefab2 = ZNetScene.instance.GetPrefab("RRRM_DamnedOne");
GameObject prefab3 = ZNetScene.instance.GetPrefab("RRRM_BlazingDamnedOne");
if ((Object)(object)prefab2 != (Object)null && (Object)(object)prefab3 != (Object)null)
{
((Character)prefab2.GetComponent<Humanoid>()).m_staggerWhenBlocked = false;
((Character)prefab2.GetComponent<Humanoid>()).m_staggerDamageFactor = 0f;
((Character)prefab3.GetComponent<Humanoid>()).m_staggerWhenBlocked = false;
((Character)prefab3.GetComponent<Humanoid>()).m_staggerDamageFactor = 0f;
OfferingBowl componentInChildren2 = val2.gameObject.GetComponentInChildren<OfferingBowl>();
componentInChildren2.m_name = ((Character)prefab2.gameObject.GetComponent<Humanoid>()).m_name;
componentInChildren2.m_bossPrefab = prefab2.gameObject;
}
else
{
Logger.LogDebug((object)"Did not find boss <RRRM_DamnedOne>");
}
}
else
{
Logger.LogDebug((object)"Did not find altar <BlazingDamnedOneAltar>");
}
}
}
[BepInPlugin("thedefside.jtv", "jtv", "1.1.8")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency("MonsterLabZ", "2.4.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
internal class Jtv : BaseUnityPlugin
{
public const string PluginGUID = "thedefside.jtv";
public const string PluginName = "jtv";
public const string PluginVersion = "1.1.8";
private AssetBundle bundle;
private GameObject MineRock_Salt;
private GameObject Salt;
private Harmony _harmony;
public static CustomLocalization Localization = LocalizationManager.Instance.GetLocalization();
private void Awake()
{
_harmony = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "thedefside.jtv");
bundle = AssetUtils.LoadAssetBundleFromResources("jtvbundle", typeof(Jtv).Assembly);
LoadPrefabs();
PrefabManager.OnVanillaPrefabsAvailable += AddVegetation;
PrefabManager.OnVanillaPrefabsAvailable += AddItems;
PieceManager.OnPiecesRegistered += AddForges;
PrefabManager.OnVanillaPrefabsAvailable += AddCreatures;
PrefabManager.OnVanillaPrefabsAvailable += UpdateVegvisirs;
}
private void LoadPrefabs()
{
MineRock_Salt = bundle.LoadAsset<GameObject>("MineRock_Salt");
Salt = bundle.LoadAsset<GameObject>("SaltCube");
}
private void AddVegetation()
{
//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_003d: Expected O, but got Unknown
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Expected O, but got Unknown
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: 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_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Expected O, but got Unknown
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Expected O, but got Unknown
Logger.LogInfo((object)"Adding JTV Vegetation");
try
{
MineRock_Salt.GetComponent<Destructible>().m_destroyedEffect.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
{
new EffectData
{
m_prefab = PrefabManager.Instance.GetPrefab("vfx_RockDestroyed_Obsidian")
},
new EffectData
{
m_prefab = PrefabManager.Instance.GetPrefab("sfx_rock_destroyed")
}
};
ZoneManager.Instance.AddCustomVegetation(new CustomVegetation(MineRock_Salt, false, new VegetationConfig
{
Max = 3f,
GroupSizeMin = 1,
GroupSizeMax = 2,
GroupRadius = 15f,
BlockCheck = true,
Biome = (Biome)64,
MinAltitude = 0f,
MaxTilt = 30f
}));
}
catch (Exception ex)
{
Logger.LogError((object)(ex.Message + ex.StackTrace));
}
finally
{
PrefabManager.OnVanillaPrefabsAvailable -= AddVegetation;
}
}
private void AddForges()
{
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Expected O, but got Unknown
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Expected O, but got Unknown
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Expected O, but got Unknown
//IL_0140: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: 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_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Expected O, but got Unknown
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: Expected O, but got Unknown
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Expected O, but got Unknown
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Expected O, but got Unknown
try
{
Logger.LogInfo((object)"Repurposing Crafting Stations");
GameObject prefab = PrefabManager.Instance.GetPrefab("piece_alchemystation");
Renderer[] componentsInChildren = prefab.GetComponentsInChildren<Renderer>();
foreach (Renderer obj in componentsInChildren)
{
obj.materials = ((IEnumerable<Material>)obj.materials).Select((Func<Material, Material>)((Material m) => new Material(m)
{
color = new Color(0.2f, 0.8f, 1.3f)
})).ToArray();
}
prefab.GetComponent<CraftingStation>().m_name = "Cold Forge";
Piece component = prefab.GetComponent<Piece>();
component.m_name = "Cold Forge";
component.m_description = "A table for crafting Frometal weapons and armor.";
component.m_resources = (Requirement[])(object)new Requirement[3]
{
new Requirement
{
m_amount = 1,
m_amountPerLevel = 0,
m_recover = true,
m_resItem = Cache.GetPrefab<ItemDrop>("QueenDrop")
},
new Requirement
{
m_amount = 8,
m_amountPerLevel = 0,
m_recover = true,
m_resItem = Cache.GetPrefab<ItemDrop>("BlackMetal")
},
new Requirement
{
m_amount = 6,
m_amountPerLevel = 0,
m_recover = true,
m_resItem = Cache.GetPrefab<ItemDrop>("FreezeGland")
}
};
PrefabManager.Instance.GetPrefab("piece_thorsforge").GetComponent<Piece>().m_resources = (Requirement[])(object)new Requirement[4]
{
new Requirement
{
m_amount = 2,
m_amountPerLevel = 0,
m_recover = true,
m_resItem = Cache.GetPrefab<ItemDrop>("JotunnBone")
},
new Requirement
{
m_amount = 4,
m_amountPerLevel = 0,
m_recover = true,
m_resItem = Cache.GetPrefab<ItemDrop>("Thunderstone")
},
new Requirement
{
m_amount = 6,
m_amountPerLevel = 0,
m_recover = true,
m_resItem = Cache.GetPrefab<ItemDrop>("BurningWorldTreeFragment")
},
new Requirement
{
m_amount = 6,
m_amountPerLevel = 0,
m_recover = true,
m_resItem = Cache.GetPrefab<ItemDrop>("Tar")
}
};
}
finally
{
PieceManager.OnPiecesRegistered -= AddForges;
}
}
private void AddItems()
{
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Expected O, but got Unknown
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Expected O, but got Unknown
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Expected O, but got Unknown
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_011a: Expected O, but got Unknown
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Expected O, but got Unknown
//IL_0283: Unknown result type (might be due to invalid IL or missing references)
//IL_0288: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Expected O, but got Unknown
//IL_029d: Unknown result type (might be due to invalid IL or missing references)
//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02b5: Expected O, but got Unknown
//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
//IL_02c2: Expected O, but got Unknown
//IL_02fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0302: Expected O, but got Unknown
//IL_0341: Unknown result type (might be due to invalid IL or missing references)
//IL_0346: Unknown result type (might be due to invalid IL or missing references)
//IL_034e: Unknown result type (might be due to invalid IL or missing references)
//IL_035a: Expected O, but got Unknown
//IL_035c: Unknown result type (might be due to invalid IL or missing references)
//IL_0361: Unknown result type (might be due to invalid IL or missing references)
//IL_0369: Unknown result type (might be due to invalid IL or missing references)
//IL_0375: Expected O, but got Unknown
//IL_037c: Unknown result type (might be due to invalid IL or missing references)
//IL_0383: Expected O, but got Unknown
//IL_039a: Unknown result type (might be due to invalid IL or missing references)
//IL_039f: Unknown result type (might be due to invalid IL or missing references)
//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
//IL_03ba: Expected O, but got Unknown
//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
//IL_03bc: Expected O, but got Unknown
//IL_047e: Unknown result type (might be due to invalid IL or missing references)
//IL_0483: Unknown result type (might be due to invalid IL or missing references)
//IL_048e: Unknown result type (might be due to invalid IL or missing references)
//IL_0499: Unknown result type (might be due to invalid IL or missing references)
//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
//IL_04b4: Expected O, but got Unknown
//IL_04af: Unknown result type (might be due to invalid IL or missing references)
//IL_04b6: Expected O, but got Unknown
//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
//IL_04ed: Expected O, but got Unknown
//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
//IL_04ef: Expected O, but got Unknown
//IL_0534: Unknown result type (might be due to invalid IL or missing references)
//IL_053b: Expected O, but got Unknown
//IL_0579: Unknown result type (might be due to invalid IL or missing references)
//IL_057e: Unknown result type (might be due to invalid IL or missing references)
//IL_0585: Unknown result type (might be due to invalid IL or missing references)
//IL_0591: Expected O, but got Unknown
//IL_0593: Unknown result type (might be due to invalid IL or missing references)
//IL_0598: Unknown result type (might be due to invalid IL or missing references)
//IL_059f: Unknown result type (might be due to invalid IL or missing references)
//IL_05ab: Expected O, but got Unknown
//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
//IL_05b9: Expected O, but got Unknown
//IL_067b: Unknown result type (might be due to invalid IL or missing references)
//IL_0682: Expected O, but got Unknown
//IL_06c1: Unknown result type (might be due to invalid IL or missing references)
//IL_06c6: Unknown result type (might be due to invalid IL or missing references)
//IL_06ce: Unknown result type (might be due to invalid IL or missing references)
//IL_06da: Expected O, but got Unknown
//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
//IL_06f5: Expected O, but got Unknown
//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0703: Expected O, but got Unknown
//IL_071a: Unknown result type (might be due to invalid IL or missing references)
//IL_0721: Expected O, but got Unknown
//IL_075f: Unknown result type (might be due to invalid IL or missing references)
//IL_0764: Unknown result type (might be due to invalid IL or missing references)
//IL_076b: Unknown result type (might be due to invalid IL or missing references)
//IL_0777: Expected O, but got Unknown
//IL_0779: Unknown result type (might be due to invalid IL or missing references)
//IL_077e: Unknown result type (might be due to invalid IL or missing references)
//IL_0785: Unknown result type (might be due to invalid IL or missing references)
//IL_0791: Expected O, but got Unknown
//IL_0793: Unknown result type (might be due to invalid IL or missing references)
//IL_0798: Unknown result type (might be due to invalid IL or missing references)
//IL_079f: Unknown result type (might be due to invalid IL or missing references)
//IL_07ab: Expected O, but got Unknown
//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
//IL_07c5: Expected O, but got Unknown
//IL_07cc: Unknown result type (might be due to invalid IL or missing references)
//IL_07d3: Expected O, but got Unknown
//IL_08e7: Unknown result type (might be due to invalid IL or missing references)
//IL_08ee: Expected O, but got Unknown
//IL_092d: Unknown result type (might be due to invalid IL or missing references)
//IL_0932: Unknown result type (might be due to invalid IL or missing references)
//IL_093a: Unknown result type (might be due to invalid IL or missing references)
//IL_0946: Expected O, but got Unknown
//IL_0948: Unknown result type (might be due to invalid IL or missing references)
//IL_094d: Unknown result type (might be due to invalid IL or missing references)
//IL_0955: Unknown result type (might be due to invalid IL or missing references)
//IL_0961: Expected O, but got Unknown
//IL_0963: Unknown result type (might be due to invalid IL or missing references)
//IL_0968: Unknown result type (might be due to invalid IL or missing references)
//IL_0970: Unknown result type (might be due to invalid IL or missing references)
//IL_097c: Expected O, but got Unknown
//IL_097e: Unknown result type (might be due to invalid IL or missing references)
//IL_0983: Unknown result type (might be due to invalid IL or missing references)
//IL_098b: Unknown result type (might be due to invalid IL or missing references)
//IL_0997: Expected O, but got Unknown
//IL_099e: Unknown result type (might be due to invalid IL or missing references)
//IL_09a5: Expected O, but got Unknown
//IL_09bc: Unknown result type (might be due to invalid IL or missing references)
//IL_09c3: Expected O, but got Unknown
//IL_0a01: Unknown result type (might be due to invalid IL or missing references)
//IL_0a06: Unknown result type (might be due to invalid IL or missing references)
//IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
//IL_0a19: Expected O, but got Unknown
//IL_0a1b: Unknown result type (might be due to invalid IL or missing references)
//IL_0a20: Unknown result type (might be due to invalid IL or missing references)
//IL_0a27: Unknown result type (might be due to invalid IL or missing references)
//IL_0a33: Expected O, but got Unknown
//IL_0a35: Unknown result type (might be due to invalid IL or missing references)
//IL_0a3a: Unknown result type (might be due to invalid IL or missing references)
//IL_0a41: Unknown result type (might be due to invalid IL or missing references)
//IL_0a4d: Expected O, but got Unknown
//IL_0a54: Unknown result type (might be due to invalid IL or missing references)
//IL_0a5b: Expected O, but got Unknown
//IL_0b02: Unknown result type (might be due to invalid IL or missing references)
//IL_0b09: Expected O, but got Unknown
//IL_0b48: Unknown result type (might be due to invalid IL or missing references)
//IL_0b4d: Unknown result type (might be due to invalid IL or missing references)
//IL_0b55: Unknown result type (might be due to invalid IL or missing references)
//IL_0b61: Expected O, but got Unknown
//IL_0b63: Unknown result type (might be due to invalid IL or missing references)
//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
//IL_0b70: Unknown result type (might be due to invalid IL or missing references)
//IL_0b7c: Expected O, but got Unknown
//IL_0b7e: Unknown result type (might be due to invalid IL or missing references)
//IL_0b83: Unknown result type (might be due to invalid IL or missing references)
//IL_0b8b: Unknown result type (might be due to invalid IL or missing references)
//IL_0b97: Expected O, but got Unknown
//IL_0b9e: Unknown result type (might be due to invalid IL or missing references)
//IL_0ba5: Expected O, but got Unknown
//IL_0bd7: Unknown result type (might be due to invalid IL or missing references)
//IL_0bdc: Unknown result type (might be due to invalid IL or missing references)
//IL_0be9: Unknown result type (might be due to invalid IL or missing references)
//IL_0bf3: Expected O, but got Unknown
//IL_0c05: Unknown result type (might be due to invalid IL or missing references)
//IL_0c0c: Expected O, but got Unknown
//IL_0c3a: Unknown result type (might be due to invalid IL or missing references)
//IL_0c3f: Unknown result type (might be due to invalid IL or missing references)
//IL_0c4a: Unknown result type (might be due to invalid IL or missing references)
//IL_0c52: Unknown result type (might be due to invalid IL or missing references)
//IL_0c5a: Expected O, but got Unknown
//IL_0c5c: Unknown result type (might be due to invalid IL or missing references)
//IL_0c61: Unknown result type (might be due to invalid IL or missing references)
//IL_0c6c: Unknown result type (might be due to invalid IL or missing references)
//IL_0c74: Unknown result type (might be due to invalid IL or missing references)
//IL_0c7c: Expected O, but got Unknown
//IL_0c7e: Unknown result type (might be due to invalid IL or missing references)
//IL_0c83: Unknown result type (might be due to invalid IL or missing references)
//IL_0c8e: Unknown result type (might be due to invalid IL or missing references)
//IL_0c95: Unknown result type (might be due to invalid IL or missing references)
//IL_0c9d: Expected O, but got Unknown
//IL_0c9f: Unknown result type (might be due to invalid IL or missing references)
//IL_0ca4: Unknown result type (might be due to invalid IL or missing references)
//IL_0caf: Unknown result type (might be due to invalid IL or missing references)
//IL_0cb6: Unknown result type (might be due to invalid IL or missing references)
//IL_0cbe: Expected O, but got Unknown
//IL_0cc5: Unknown result type (might be due to invalid IL or missing references)
//IL_0ccc: Expected O, but got Unknown
//IL_0cea: Unknown result type (might be due to invalid IL or missing references)
//IL_0cf1: Expected O, but got Unknown
//IL_0d1f: Unknown result type (might be due to invalid IL or missing references)
//IL_0d24: Unknown result type (might be due to invalid IL or missing references)
//IL_0d2f: Unknown result type (might be due to invalid IL or missing references)
//IL_0d36: Unknown result type (might be due to invalid IL or missing references)
//IL_0d3e: Expected O, but got Unknown
//IL_0d40: Unknown result type (might be due to invalid IL or missing references)
//IL_0d45: Unknown result type (might be due to invalid IL or missing references)
//IL_0d50: Unknown result type (might be due to invalid IL or missing references)
//IL_0d57: Unknown result type (might be due to invalid IL or missing references)
//IL_0d5f: Expected O, but got Unknown
//IL_0d66: Unknown result type (might be due to invalid IL or missing references)
//IL_0d6d: Expected O, but got Unknown
//IL_0dbb: Unknown result type (might be due to invalid IL or missing references)
//IL_0dc2: Expected O, but got Unknown
//IL_0eaf: Unknown result type (might be due to invalid IL or missing references)
//IL_0eb6: Expected O, but got Unknown
//IL_0ee4: Unknown result type (might be due to invalid IL or missing references)
//IL_0ee9: Unknown result type (might be due to invalid IL or missing references)
//IL_0ef4: Unknown result type (might be due to invalid IL or missing references)
//IL_0efc: Unknown result type (might be due to invalid IL or missing references)
//IL_0f04: Expected O, but got Unknown
//IL_0f06: Unknown result type (might be due to invalid IL or missing references)
//IL_0f0b: Unknown result type (might be due to invalid IL or missing references)
//IL_0f16: Unknown result type (might be due to invalid IL or missing references)
//IL_0f1e: Unknown result type (might be due to invalid IL or missing references)
//IL_0f26: Expected O, but got Unknown
//IL_0f28: Unknown result type (might be due to invalid IL or missing references)
//IL_0f2d: Unknown result type (might be due to invalid IL or missing references)
//IL_0f38: Unknown result type (might be due to invalid IL or missing references)
//IL_0f3f: Unknown result type (might be due to invalid IL or missing references)
//IL_0f47: Expected O, but got Unknown
//IL_0f49: Unknown result type (might be due to invalid IL or missing references)
//IL_0f4e: Unknown result type (might be due to invalid IL or missing references)
//IL_0f59: Unknown result type (might be due to invalid IL or missing references)
//IL_0f60: Unknown result type (might be due to invalid IL or missing references)
//IL_0f68: Expected O, but got Unknown
//IL_0f6f: Unknown result type (might be due to invalid IL or missing references)
//IL_0f76: Expected O, but got Unknown
//IL_0e4d: Unknown result type (might be due to invalid IL or missing references)
//IL_0e54: Expected O, but got Unknown
//IL_10b3: Unknown result type (might be due to invalid IL or missing references)
Logger.LogInfo((object)"Adding Food");
try
{
ItemManager.Instance.AddItem(new CustomItem(Salt, false));
foreach (string item in new List<string> { "Amethyst", "JotunnBone", "FrozenRemains", "BurnedRemains", "SpiderSilk" })
{
try
{
GameObject val = bundle.LoadAsset<GameObject>(item);
ItemManager.Instance.AddItem(new CustomItem(val, false));
}
catch (Exception ex)
{
Logger.LogError((object)("Error Adding item: " + item + " " + ex.Message + ex.StackTrace));
}
}
CustomItem val2 = new CustomItem("Banana", "WolfFang", new ItemConfig
{
Name = "Banana",
Description = "A sweet fruit packed with nutrients that increase stamina."
});
MeshRenderer[] componentsInChildren = val2.ItemPrefab.GetComponentsInChildren<MeshRenderer>();
foreach (MeshRenderer obj in componentsInChildren)
{
((Renderer)obj).materials = ((IEnumerable<Material>)((Renderer)obj).materials).Select((Func<Material, Material>)((Material m) => new Material(m)
{
color = Color.yellow
})).ToArray();
}
val2.ItemDrop.m_itemData.m_shared.m_itemType = (ItemType)2;
val2.ItemDrop.m_itemData.m_shared.m_food = 15f;
val2.ItemDrop.m_itemData.m_shared.m_foodStamina = 50f;
val2.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 900f;
val2.ItemDrop.m_itemData.m_shared.m_foodRegen = 2f;
val2.ItemDrop.m_autoPickup = true;
Sprite val3 = LoadEmbeddedSprite("bananas_icon");
val2.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val3 };
ItemManager.Instance.AddItem(val2);
ItemConfig val4 = new ItemConfig();
val4.Amount = 1;
val4.CraftingStation = "piece_cauldron";
val4.MinStationLevel = 4;
val4.Name = "Banana Bread Dough";
val4.Description = "Dough that when baked in the oven will produce Banana Bread";
val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
{
new RequirementConfig
{
Amount = 5,
Item = "BarleyFlour"
},
new RequirementConfig
{
Amount = 3,
Item = "Banana"
}
};
CustomItem val5 = new CustomItem("BananaBreadDough", "BreadDough", val4);
Sprite val6 = LoadEmbeddedSprite("BananaBreadDough");
val5.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val6 };
ItemManager.Instance.AddItem(val5);
RecipeConfig val7 = new RecipeConfig();
val7.Amount = 20;
val7.Item = "BananaBreadDough";
val7.CraftingStation = "piece_cauldron";
val7.MinStationLevel = 4;
val7.Name = "Banana Bread Dough x20";
val7.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
{
new RequirementConfig
{
Amount = 100,
Item = "BarleyFlour"
},
new RequirementConfig
{
Amount = 60,
Item = "Banana"
}
};
CustomRecipe val8 = new CustomRecipe(val7);
ItemManager.Instance.AddRecipe(val8);
CustomItem val9 = new CustomItem("BananaBread", "Bread", new ItemConfig
{
Name = "Banana Bread",
Description = "A powerful stamina booster containing nutrients from bananas combined with the energy from the bread carbs."
});
val9.ItemDrop.m_itemData.m_shared.m_food = 90f;
val9.ItemDrop.m_itemData.m_shared.m_foodStamina = 115f;
val9.ItemDrop.m_itemData.m_shared.m_foodEitr = 75f;
val9.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 1800f;
val9.ItemDrop.m_itemData.m_shared.m_foodRegen = 6f;
Sprite val10 = LoadEmbeddedSprite("BananaBread");
val9.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val10 };
ItemManager.Instance.AddItem(val9);
CustomItemConversion val11 = new CustomItemConversion((ConversionConfig)new CookingConversionConfig
{
Station = "piece_oven",
FromItem = "BananaBreadDough",
ToItem = "BananaBread",
CookTime = 60f
});
ItemManager.Instance.AddItemConversion(val11);
CustomItem val12 = new CustomItem("Liver", "Entrails", new ItemConfig
{
Name = "Liver",
Description = "The liver of an elf. Full of iron and other nutrients."
});
Sprite val13 = LoadEmbeddedSprite("Liver");
val12.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val13 };
ItemManager.Instance.AddItem(val12);
val4 = new ItemConfig();
val4.Name = "Smoky Liver and Onions";
val4.Description = "The charred remains of what used to be men mixed with onions. An acquired taste.";
val4.Amount = 1;
val4.CraftingStation = "piece_cauldron";
val4.MinStationLevel = 4;
val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
{
new RequirementConfig
{
Amount = 2,
Item = "Liver"
},
new RequirementConfig
{
Amount = 3,
Item = "Onion"
}
};
CustomItem val14 = new CustomItem("LiverAndOnions", "OnionSoup", val4);
val14.ItemDrop.m_itemData.m_shared.m_food = 115f;
val14.ItemDrop.m_itemData.m_shared.m_foodStamina = 90f;
val14.ItemDrop.m_itemData.m_shared.m_foodEitr = 75f;
val14.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 1800f;
val14.ItemDrop.m_itemData.m_shared.m_foodRegen = 6f;
Sprite val15 = LoadEmbeddedSprite("LiverAndOnions");
val14.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val15 };
ItemManager.Instance.AddItem(val14);
val7 = new RecipeConfig();
val7.Amount = 10;
val7.Item = "LiverAndOnions";
val7.CraftingStation = "piece_cauldron";
val7.MinStationLevel = 4;
val7.Name = "Liver and Onions x10";
val7.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
{
new RequirementConfig
{
Amount = 20,
Item = "Liver"
},
new RequirementConfig
{
Amount = 30,
Item = "Onion"
}
};
CustomRecipe val16 = new CustomRecipe(val7);
ItemManager.Instance.AddRecipe(val16);
val4 = new ItemConfig();
val4.Name = "$chicken_noodle_soup";
val4.Description = "$chicken_noodle_description";
val4.Amount = 1;
val4.CraftingStation = "piece_cauldron";
val4.MinStationLevel = 4;
val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
{
new RequirementConfig
{
Amount = 2,
Item = "BarleyFlour"
},
new RequirementConfig
{
Amount = 3,
Item = "ChickenEgg"
},
new RequirementConfig
{
Amount = 1,
Item = "CookedChickenMeat"
},
new RequirementConfig
{
Amount = 1,
Item = "SaltCube"
}
};
CustomItem val17 = new CustomItem("ChickenNoodleSoup", "TurnipStew", val4);
val17.ItemDrop.m_itemData.m_shared.m_food = 35f;
val17.ItemDrop.m_itemData.m_shared.m_foodStamina = 100f;
val17.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 1800f;
val17.ItemDrop.m_itemData.m_shared.m_foodRegen = 6f;
Sprite val18 = LoadEmbeddedSprite("ChickenNoodleIcon");
Texture2D chickenNoodleTexture = LoadEmbeddedTexture("ChickenNoodleSoup");
val17.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val18 };
componentsInChildren = val17.ItemPrefab.GetComponentsInChildren<MeshRenderer>();
foreach (MeshRenderer obj2 in componentsInChildren)
{
((Renderer)obj2).materials = ((IEnumerable<Material>)((Renderer)obj2).materials).Select((Func<Material, Material>)((Material m) => new Material(m)
{
mainTexture = (Texture)(object)chickenNoodleTexture
})).ToArray();
}
ItemManager.Instance.AddItem(val17);
val7 = new RecipeConfig();
val7.Amount = 10;
val7.Item = "ChickenNoodleSoup";
val7.CraftingStation = "piece_cauldron";
val7.MinStationLevel = 4;
val7.Name = "Chicken Noodle Soup x10";
val7.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
{
new RequirementConfig
{
Amount = 20,
Item = "BarleyFlour"
},
new RequirementConfig
{
Amount = 30,
Item = "ChickenEgg"
},
new RequirementConfig
{
Amount = 10,
Item = "CookedChickenMeat"
},
new RequirementConfig
{
Amount = 10,
Item = "SaltCube"
}
};
CustomRecipe val19 = new CustomRecipe(val7);
ItemManager.Instance.AddRecipe(val19);
val4 = new ItemConfig();
val4.Name = "$salted_meat";
val4.Description = "$salted_meat_description";
val4.Amount = 1;
val4.CraftingStation = "piece_cauldron";
val4.MinStationLevel = 4;
val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
{
new RequirementConfig
{
Amount = 2,
Item = "CookedLoxMeat"
},
new RequirementConfig
{
Amount = 1,
Item = "CookedWolfMeat"
},
new RequirementConfig
{
Amount = 3,
Item = "SaltCube"
}
};
CustomItem val20 = new CustomItem("SaltedMeat", "CookedLoxMeat", val4);
val20.ItemDrop.m_itemData.m_shared.m_food = 100f;
val20.ItemDrop.m_itemData.m_shared.m_foodStamina = 35f;
val20.ItemDrop.m_itemData.m_shared.m_foodBurnTime = 1800f;
val20.ItemDrop.m_itemData.m_shared.m_foodRegen = 6f;
Sprite val21 = LoadEmbeddedSprite("SaltedMeat");
val20.ItemDrop.m_itemData.m_shared.m_icons = (Sprite[])(object)new Sprite[1] { val21 };
ItemManager.Instance.AddItem(val20);
val7 = new RecipeConfig();
val7.Amount = 20;
val7.Item = "SaltedMeat";
val7.CraftingStation = "piece_cauldron";
val7.MinStationLevel = 4;
val7.Name = "Salted Meat x20";
val7.Requirements = (RequirementConfig[])(object)new RequirementConfig[3]
{
new RequirementConfig
{
Amount = 40,
Item = "CookedLoxMeat"
},
new RequirementConfig
{
Amount = 20,
Item = "CookedWolfMeat"
},
new RequirementConfig
{
Amount = 60,
Item = "SaltCube"
}
};
CustomRecipe val22 = new CustomRecipe(val7);
ItemManager.Instance.AddRecipe(val22);
GameObject val23 = bundle.LoadAsset<GameObject>("ObsidianGolemTrophy");
val23.GetComponent<ItemDrop>().m_itemData.m_shared.m_trophyPos = new Vector2Int(5, 5);
ItemManager.Instance.AddItem(new CustomItem(val23, true));
GameObject obj3 = bundle.LoadAsset<GameObject>("FrometalWarhammer");
val4 = new ItemConfig();
val4.Name = "$frometal_warhammer";
val4.Description = "$frometal_warhammer_description";
val4.CraftingStation = "piece_alchemystation";
val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
{
new RequirementConfig
{
Item = "FrometalBar",
Amount = 15,
AmountPerLevel = 7
},
new RequirementConfig
{
Item = "Silver",
Amount = 10,
AmountPerLevel = 3
},
new RequirementConfig
{
Item = "ArcticWolfPelt",
Amount = 4,
AmountPerLevel = 2
},
new RequirementConfig
{
Item = "YggdrasilWood",
Amount = 4,
AmountPerLevel = 2
}
};
CustomItem val24 = new CustomItem(obj3, false, val4);
ItemManager.Instance.AddItem(val24);
GameObject obj4 = bundle.LoadAsset<GameObject>("ShieldFrometalBuckler");
val4 = new ItemConfig();
val4.Name = "$frometal_buckler";
val4.Description = "$frometal_buckler_description";
val4.CraftingStation = "piece_alchemystation";
val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[2]
{
new RequirementConfig
{
Item = "FrometalBar",
Amount = 8,
AmountPerLevel = 2
},
new RequirementConfig
{
Item = "YggdrasilWood",
Amount = 4,
AmountPerLevel = 2
}
};
CustomItem val25 = new CustomItem(obj4, false, val4);
ItemManager.Instance.AddItem(val25);
componentsInChildren = ItemManager.Instance.GetItem("ShieldFrometal").ItemPrefab.GetComponentsInChildren<MeshRenderer>();
foreach (MeshRenderer val26 in componentsInChildren)
{
List<Material> list = new List<Material>();
Material[] materials = ((Renderer)val26).materials;
for (int j = 0; j < materials.Length; j++)
{
Material val27 = new Material(materials[j]);
val27.SetTexture("_BumpMap", (Texture)(object)LoadEmbeddedTexture("bam2"));
list.Add(val27);
}
((Renderer)val26).materials = list.ToArray();
}
componentsInChildren = ItemManager.Instance.GetItem("ShieldFrometalTower").ItemPrefab.GetComponentsInChildren<MeshRenderer>();
foreach (MeshRenderer val28 in componentsInChildren)
{
List<Material> list2 = new List<Material>();
Material[] materials = ((Renderer)val28).materials;
for (int j = 0; j < materials.Length; j++)
{
Material val29 = new Material(materials[j]);
val29.SetTexture("_BumpMap", (Texture)(object)LoadEmbeddedTexture("bam2"));
list2.Add(val29);
}
((Renderer)val28).materials = list2.ToArray();
}
GameObject obj5 = bundle.LoadAsset<GameObject>("FlametalWarhammer");
val4 = new ItemConfig();
val4.Name = "$flametal_warhammer";
val4.Description = "$flametal_warhammer_description";
val4.CraftingStation = "piece_thorsforge";
val4.Requirements = (RequirementConfig[])(object)new RequirementConfig[4]
{
new RequirementConfig
{
Item = "Flametal",
Amount = 15,
AmountPerLevel = 7
},
new RequirementConfig
{
Item = "Silver",
Amount = 10,
AmountPerLevel = 3
},
new RequirementConfig
{
Item = "SpiderSilk",
Amount = 4,
AmountPerLevel = 2
},
new RequirementConfig
{
Item = "BurningWorldTreeFragment",
Amount = 4,
AmountPerLevel = 2
}
};
CustomItem val30 = new CustomItem(obj5, false, val4);
val30.ItemPrefab.GetComponent<ItemDrop>().m_itemData.m_shared.m_damagesPerLevel.m_frost = 0f;
ItemManager.Instance.AddItem(val30);
foreach (string item2 in new List<string>
{
"BowFlametal", "AtgeirFlametal", "SledgeFlametal", "BattleaxeFlametal", "SpearFlametal", "KnifeFlametal", "MaceFlametal", "GreatSwordFlametal", "SwordFlametal", "ShieldFlametal",
"ShieldFlametalTower", "AxeFlametal", "PickaxeFlametal"
})
{
componentsInChildren = ItemManager.Instance.GetItem(item2).ItemPrefab.GetComponentsInChildren<MeshRenderer>();
foreach (MeshRenderer val31 in componentsInChildren)
{
for (int k = 0; k < ((Renderer)val31).materials.Length; k++)
{
if (((Object)((Renderer)val31).materials[k]).name.StartsWith("Flametal_Color"))
{
((Renderer)val31).materials[k].SetColor("_EmissionColor", new Color(1.5f, 0.7f, 0.1f));
}
}
}
}
}
catch (Exception ex2)
{
Logger.LogError((object)(ex2.Message + ex2.StackTrace));
}
finally
{
PrefabManager.OnVanillaPrefabsAvailable -= AddItems;
bundle.Unload(false);
}
}
private void AddCreatures()
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Expected O, but got Unknown
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Expected O, but got Unknown
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Expected O, but got Unknown
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0112: Expected O, but got Unknown
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Expected O, but got Unknown
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Expected O, but got Unknown
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Expected O, but got Unknown
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: 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_01c1: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Expected O, but got Unknown
//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
//IL_01d0: 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_01e3: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Expected O, but got Unknown
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_021e: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: Unknown result type (might be due to invalid IL or missing references)
//IL_023f: Expected O, but got Unknown
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
//IL_024c: Expected O, but got Unknown
//IL_0266: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_02a2: Expected O, but got Unknown
//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Expected O, but got Unknown
//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0304: Unknown result type (might be due to invalid IL or missing references)
//IL_030f: 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_031d: Unknown result type (might be due to invalid IL or missing references)
//IL_0328: Unknown result type (might be due to invalid IL or missing references)
//IL_032f: Unknown result type (might be due to invalid IL or missing references)
//IL_0337: Expected O, but got Unknown
//IL_033e: Unknown result type (might be due to invalid IL or missing references)
//IL_0344: Expected O, but got Unknown
//IL_038b: Unknown result type (might be due to invalid IL or missing references)
try
{
CreatureConfig val = new CreatureConfig();
val.Name = "$swedish_chef";
val.Faction = (Faction)2;
val.Consumables = new string[3] { "Resin", "PineCone", "FirCone" };
CustomCreature val2 = new CustomCreature("SwedishChef_JTV", "Greydwarf_Purple_Shroom", val);
Humanoid component = val2.Prefab.GetComponent<Humanoid>();
((Character)component).m_name = "$swedish_chef";
component.m_defaultItems = (GameObject[])(object)new GameObject[2]
{
PrefabManager.Instance.GetPrefab("Greydwarf_attack"),
PrefabManager.Instance.GetPrefab("Greydwarf_throw")
};
((Character)component).m_hitEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[2]
{
new EffectData
{
m_prefab = PrefabManager.Instance.GetPrefab("vfx_greydwarf_hit")
},
new EffectData
{
m_prefab = PrefabManager.Instance.GetPrefab("sfx_greydwarf_hit")
}
};
((Character)component).m_deathEffects.m_effectPrefabs = (EffectData[])(object)new EffectData[3]
{
new EffectData
{
m_prefab = PrefabManager.Instance.GetPrefab("vfx_greydwarf_death")
},
new EffectData
{
m_prefab = PrefabManager.Instance.GetPrefab("sfx_greydwarf_death")
},
new EffectData
{
m_prefab = PrefabManager.Instance.GetPrefab("Greydwarf_Purple_ragdoll")
}
};
CreatureManager.Instance.AddCreature(val2);
val = new CreatureConfig();
val.Name = "$obsidian_golem";
val.Faction = (Faction)5;
val.DropConfigs = (DropConfig[])(object)new DropConfig[3]
{
new DropConfig
{
Item = "ObsidianGolemTrophy",
MinAmount = 1,
MaxAmount = 1,
Chance = 5f,
OnePerPlayer = false,
LevelMultiplier = false
},
new DropConfig
{
Item = "Obsidian",
MinAmount = 10,
MaxAmount = 15,
Chance = 100f,
OnePerPlayer = false,
LevelMultiplier = true
},
new DropConfig
{
Item = "Crystal",
MinAmount = 3,
MaxAmount = 6,
Chance = 100f,
OnePerPlayer = false,
LevelMultiplier = true
}
};
CustomCreature val3 = new CustomCreature("ObsidianGolem_JTV", "ObsidianGolem", val);
val3.Prefab.transform.localScale = new Vector3(0.75f, 0.75f, 0.75f);
((Character)val3.Prefab.GetComponent<Humanoid>()).m_name = "$obsidian_golem";
CreatureManager.Instance.AddCreature(val3);
val = new CreatureConfig();
val.Name = "$molluscan";
val.Faction = (Faction)3;
val.DropConfigs = (DropConfig[])(object)new DropConfig[2]
{
new DropConfig
{
Item = "FishRaw",
MinAmount = 1,
MaxAmount = 2,
Chance = 60f,
OnePerPlayer = false,
LevelMultiplier = true
},
new DropConfig
{
Item = "Chitin",
MinAmount = 2,
MaxAmount = 4,
Chance = 100f,
OnePerPlayer = false,
LevelMultiplier = true
}
};
CustomCreature val4 = new CustomCreature("Molluscan_JTV", "Molluscan", val);
((Character)val4.Prefab.GetComponent<Humanoid>()).m_name = "$molluscan";
((Character)val4.Prefab.GetComponent<Humanoid>()).m_health = 240f;
val4.Prefab.GetComponent<BaseAI>().m_avoidWater = false;
val4.Prefab.GetComponent<BaseAI>().m_pathAgentType = (AgentType)8;
val4.Prefab.GetComponent<Character>().m_tolerateWater = true;
CreatureManager.Instance.AddCreature(val4);
}
catch (Exception ex)
{
Logger.LogError((object)(ex.Message + ex.StackTrace));
}
finally
{
PrefabManager.OnVanillaPrefabsAvailable -= AddCreatures;
}
}
private void UpdateVegvisirs()
{
try
{
PrefabManager.Instance.GetPrefab("Vegvisir_BlazingDamnedOne").GetComponentInChildren<Vegvisir>().m_pinName = "Damned One";
}
catch (Exception ex)
{
Logger.LogError((object)(ex.Message + ex.StackTrace));
}
finally
{
PrefabManager.OnVanillaPrefabsAvailable -= UpdateVegvisirs;
}
}
private Sprite LoadEmbeddedSprite(string imageName)
{
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Expected O, but got Unknown
//IL_009f: 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)
Assembly executingAssembly = Assembly.GetExecutingAssembly();
string text = executingAssembly.GetManifestResourceNames().SingleOrDefault((string str) => str.EndsWith("." + imageName + ".png"));
if (text == null)
{
throw new Exception(imageName + ".png not found.");
}
Logger.LogDebug((object)("Resource name : " + text));
byte[] array = ReadFully(executingAssembly.GetManifestResourceStream(text));
Logger.LogDebug((object)$"Byte array length : {array.Length}");
Texture2D val = new Texture2D(2, 2);
ImageConversion.LoadImage(val, array);
return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero);
}
private Texture2D LoadEmbeddedTexture(string imageName)
{
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Expected O, but got Unknown
//IL_006d: Expected O, but got Unknown
Assembly executingAssembly = Assembly.GetExecutingAssembly();
string text = executingAssembly.GetManifestResourceNames().Single((string str) => str.EndsWith("." + imageName + ".png"));
Logger.LogDebug((object)("Resource name : " + text));
byte[] array = ReadFully(executingAssembly.GetManifestResourceStream(text));
Logger.LogDebug((object)$"Byte array length : {array.Length}");
Texture2D val = new Texture2D(2, 2);
ImageConversion.LoadImage(val, array);
return val;
}
public static byte[] ReadFully(Stream input)
{
using MemoryStream memoryStream = new MemoryStream();
input.CopyTo(memoryStream);
return memoryStream.ToArray();
}
}