Beispiel #1
0
            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));
            }
Beispiel #2
0
            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);
                }
            }
Beispiel #3
0
            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);
            }