private static IGameObject GetHuntable() { List <WeightedHuntingData> weightedData = new List <WeightedHuntingData>(); GetFragmentData(ref weightedData); foreach (KeyValuePair <RockGemMetal, RockGemMetalData> pair in RockGemMetalBase.sData) { RGMHuntableData huntingData = pair.Value.HuntingData; if (huntingData == null) { continue; } WeightedHuntingData item = new WeightedHuntingData((ulong)pair.Key, 10, huntingData.MinSkillLevel, huntingData.MaxSkillLevel, huntingData.MaxWeight, huntingData.MaxWeight, 0x0); weightedData.Add(item); } if (weightedData.Count == 0) { return(null); } WeightedHuntingData weightedRandomObjectFromList = RandomUtil.GetWeightedRandomObjectFromList(weightedData); return(MakeHuntableFromData(weightedRandomObjectFromList)); }
private static void GetFragmentData(ref List <WeightedHuntingData> weightedData) { foreach (HunatbleFragmentData data in DogHuntingSkill.sHuntableFragments) { if (data == null) { continue; } WeightedHuntingData item = new WeightedHuntingData(data.MetadorName, 10, data.MinSkillLevel, data.MaxSkillLevel, data.MinWeight, data.MaxWeight); weightedData.Add(item); } }
private static IGameObject MakeHuntableFromData(WeightedHuntingData data) { IGameObject huntable = null; if (data != null) { if (string.IsNullOrEmpty(data.StringID)) { huntable = RockGemMetalBase.Make((RockGemMetal)data.ID, true); } else { huntable = GlobalFunctions.CreateObjectOutOfWorld(data.StringID, ProductVersion.EP5); } } return(huntable); }
private static IGameObject MakeHuntableFromData(WeightedHuntingData data) { IGameObject huntable = null; if (data != null) { if (string.IsNullOrEmpty(data.StringID)) { huntable = RockGemMetalBase.Make((RockGemMetal)data.ID, true); } else { huntable = GlobalFunctions.CreateObjectOutOfWorld(data.StringID, ProductVersion.EP5); } } return huntable; }
private static void GetFragmentData(ref List<WeightedHuntingData> weightedData) { foreach (HunatbleFragmentData data in DogHuntingSkill.sHuntableFragments) { if (data == null) continue; WeightedHuntingData item = new WeightedHuntingData(data.MetadorName, 10, data.MinSkillLevel, data.MaxSkillLevel, data.MinWeight, data.MaxWeight); weightedData.Add(item); } }
private static IGameObject GetHuntable() { List<WeightedHuntingData> weightedData = new List<WeightedHuntingData>(); GetFragmentData(ref weightedData); foreach (KeyValuePair<RockGemMetal, RockGemMetalData> pair in RockGemMetalBase.sData) { RGMHuntableData huntingData = pair.Value.HuntingData; if (huntingData == null) continue; WeightedHuntingData item = new WeightedHuntingData((ulong)pair.Key, 10, huntingData.MinSkillLevel, huntingData.MaxSkillLevel, huntingData.MaxWeight, huntingData.MaxWeight, 0x0); weightedData.Add(item); } if (weightedData.Count == 0) return null; WeightedHuntingData weightedRandomObjectFromList = RandomUtil.GetWeightedRandomObjectFromList(weightedData); return MakeHuntableFromData(weightedRandomObjectFromList); }