Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7a19c66a24 |
@@ -122,6 +122,7 @@ namespace MxValheim.EventSystem
|
|||||||
Reward.GiveEpicLootDust();
|
Reward.GiveEpicLootDust();
|
||||||
Reward.GiveEpicLootShard();
|
Reward.GiveEpicLootShard();
|
||||||
Reward.GiveEpicLootEssence();
|
Reward.GiveEpicLootEssence();
|
||||||
|
Reward.GiveEpicLootReagent();
|
||||||
Reward.GiveEpicLootRune();
|
Reward.GiveEpicLootRune();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,6 +130,30 @@ namespace MxValheim.EventSystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void GiveEpicLootReagent()
|
||||||
|
{
|
||||||
|
System.Random rand = new System.Random();
|
||||||
|
|
||||||
|
int qty = rand.Next(1, Profiles.serverLevel);
|
||||||
|
|
||||||
|
string[] rarity = GetRarityList(Watcher.eventPoints);
|
||||||
|
|
||||||
|
string itemName = $"Reagent{globalRarity}";
|
||||||
|
|
||||||
|
Player player = Player.m_localPlayer;
|
||||||
|
if (player == null) return;
|
||||||
|
|
||||||
|
GameObject prefab = ObjectDB.instance.GetItemPrefab(itemName);
|
||||||
|
if (prefab != null)
|
||||||
|
{
|
||||||
|
GiveItemSafe(itemName, player, qty);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"Item {itemName} not found in ObjectDB!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void GiveEpicLootRune()
|
public static void GiveEpicLootRune()
|
||||||
{
|
{
|
||||||
System.Random rand = new System.Random();
|
System.Random rand = new System.Random();
|
||||||
@@ -289,6 +313,7 @@ namespace MxValheim.EventSystem
|
|||||||
{ "Ghost", 100 },
|
{ "Ghost", 100 },
|
||||||
{ "Skeleton", 60 },
|
{ "Skeleton", 60 },
|
||||||
{ "Skeleton_NoArcher", 60 }, // Melee only variant
|
{ "Skeleton_NoArcher", 60 }, // Melee only variant
|
||||||
|
{ "Skeleton_Poison", 60 },
|
||||||
|
|
||||||
// --- Swamp ---
|
// --- Swamp ---
|
||||||
{ "Blob", 50 },
|
{ "Blob", 50 },
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using TMPro;
|
using TMPro;
|
||||||
@@ -33,7 +34,7 @@ public class MxValheimMod : BaseUnityPlugin
|
|||||||
|
|
||||||
private const string ModGUID = "ovh.mxdev.mxvalheim";
|
private const string ModGUID = "ovh.mxdev.mxvalheim";
|
||||||
private const string ModName = "MxValheim";
|
private const string ModName = "MxValheim";
|
||||||
private const string ModVersion = "1.6.13";
|
private const string ModVersion = "1.6.14";
|
||||||
|
|
||||||
public static ConfigEntry<bool> Config_DebugRandomEventInterval;
|
public static ConfigEntry<bool> Config_DebugRandomEventInterval;
|
||||||
public static ConfigEntry<float> Config_bowDrawSpeedBonusPerLevel;
|
public static ConfigEntry<float> Config_bowDrawSpeedBonusPerLevel;
|
||||||
@@ -44,6 +45,10 @@ public class MxValheimMod : BaseUnityPlugin
|
|||||||
public static string internalDataEventSystem = Path.Combine(internalDataPath, "EventSystem.json");
|
public static string internalDataEventSystem = Path.Combine(internalDataPath, "EventSystem.json");
|
||||||
public static string DropConfigPath => Path.Combine(internalConfigsPath, "items_drop.json");
|
public static string DropConfigPath => Path.Combine(internalConfigsPath, "items_drop.json");
|
||||||
public static string WeightConfigPath => Path.Combine(internalConfigsPath, "items_weight.json");
|
public static string WeightConfigPath => Path.Combine(internalConfigsPath, "items_weight.json");
|
||||||
|
public static string EnemyExpConfigPath => Path.Combine(internalConfigsPath, "enemies_expvalue.mx");
|
||||||
|
public static Dictionary<string, int> EnemyExpSettings = new Dictionary<string, int>();
|
||||||
|
public static string EnemyRewardConfigPath => Path.Combine(internalConfigsPath, "enemies_rewardvalue.mx");
|
||||||
|
public static Dictionary<string, int> EnemyRewardSettings = new Dictionary<string, int>();
|
||||||
public static string AutoDoorConfigPath => Path.Combine(internalConfigsPath, "auto_doors.json");
|
public static string AutoDoorConfigPath => Path.Combine(internalConfigsPath, "auto_doors.json");
|
||||||
public static DoorRoot CachedConfig;
|
public static DoorRoot CachedConfig;
|
||||||
public static Dictionary<string, float> WeightSettings = new Dictionary<string, float>();
|
public static Dictionary<string, float> WeightSettings = new Dictionary<string, float>();
|
||||||
@@ -376,9 +381,21 @@ public class MxValheimMod : BaseUnityPlugin
|
|||||||
File.WriteAllText(DropConfigPath, JsonConvert.SerializeObject(DropSettings, Newtonsoft.Json.Formatting.Indented));
|
File.WriteAllText(DropConfigPath, JsonConvert.SerializeObject(DropSettings, Newtonsoft.Json.Formatting.Indented));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
byte[] jsonEncryptedB64 = null;
|
||||||
|
|
||||||
json = File.ReadAllText(DropConfigPath);
|
json = File.ReadAllText(DropConfigPath);
|
||||||
DropSettings = JsonConvert.DeserializeObject<Dictionary<string, int>>(json);
|
DropSettings = JsonConvert.DeserializeObject<Dictionary<string, int>>(json);
|
||||||
Logger.LogInfo($"Successfully parsed {DropSettings.Count} items.");
|
Logger.LogInfo($"Successfully parsed {DropSettings.Count} items.");
|
||||||
|
|
||||||
|
/*jsonEncryptedB64 = Convert.FromBase64String(File.ReadAllText(EnemyRewardConfigPath));
|
||||||
|
json = Encoding.UTF8.GetString(jsonEncryptedB64);
|
||||||
|
EnemyRewardSettings = JsonConvert.DeserializeObject<Dictionary<string, int>>(json);
|
||||||
|
Logger.LogInfo($"Successfully parsed {EnemyRewardSettings.Count} enemy reward value.");
|
||||||
|
|
||||||
|
jsonEncryptedB64 = Convert.FromBase64String(File.ReadAllText(EnemyExpConfigPath));
|
||||||
|
json = Encoding.UTF8.GetString(jsonEncryptedB64);
|
||||||
|
EnemyExpSettings = JsonConvert.DeserializeObject<Dictionary<string, int>>(json);
|
||||||
|
Logger.LogInfo($"Successfully parsed {EnemyExpSettings.Count} enemy exp value.");*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadDoorConfig()
|
public void LoadDoorConfig()
|
||||||
|
|||||||
Reference in New Issue
Block a user