static MonStat() { foreach (MonStat stat in sheet) { var key = stat.id.ToLower(); if (stats.ContainsKey(key)) { stats.Remove(key); } stats.Add(key, stat); stat.ext = MonStatsExtended.Find(stat.monStatEx); stat.name = stat.nameStr == null ? null : Translation.Find(stat.nameStr); stat.minion1 = stat.minion1Id == null ? null : Find(stat.minion1Id); stat.minion2 = stat.minion2Id == null ? null : Find(stat.minion2Id); stat.sound = MonSound.Find(stat.monSoundId); stat.uniqueSound = MonSound.Find(stat.uMonSoundId); foreach (var tcInfo in stat.treasureClass) { tcInfo.normal = TreasureClass.Find(tcInfo._normal); tcInfo.champion = TreasureClass.Find(tcInfo._champion); tcInfo.unique = TreasureClass.Find(tcInfo._unique); tcInfo.quest = TreasureClass.Find(tcInfo._quest); } } }
static void Drop(string code, Vector3 pos, int itemLevel, QualityFactors qualityFactors = new QualityFactors()) { var treasureClass = TreasureClass.Find(code); if (treasureClass == null) { var item = Item.Create(code); if (item == null) { Debug.LogWarning("Item wasn't spawned: " + code); return; } item.level = itemLevel; SelectItemQuality(item, qualityFactors, mf: 1000); if (item.quality != Item.Quality.HiQuality && item.quality != Item.Quality.Normal && item.quality != Item.Quality.LowQuality) { item.identified = false; } GenerateItemProperties(item); GenerateItemQuantity(item); Pickup.Create(pos, item); } else { Drop(treasureClass, pos, itemLevel, qualityFactors); } }
static MonStat() { foreach(MonStat stat in sheet) { var key = stat.id.ToLower(); if (monStats.ContainsKey(key)) { monStats.Remove(key); } monStats.Add(key, stat); stat.ext = MonStatsExtended.Find(stat.monStatEx); stat.name = stat.nameStr == null ? null : Translation.Find(stat.nameStr); stat.minion1 = stat.minion1Id == null ? null : Find(stat.minion1Id); stat.minion2 = stat.minion2Id == null ? null : Find(stat.minion2Id); stat.sound = MonSound.Find(stat.monSoundId); stat.uniqueSound = MonSound.Find(stat.uMonSoundId); for(int i = 0; i < stat.treasureClass.Length; ++i) { stat.treasureClass[i].normal = TreasureClass.Find(stat.treasureClass[i]._normal); stat.treasureClass[i].champion = TreasureClass.Find(stat.treasureClass[i]._champion); stat.treasureClass[i].unique = TreasureClass.Find(stat.treasureClass[i]._unique); stat.treasureClass[i].quest = TreasureClass.Find(stat.treasureClass[i]._quest); } } }