Пример #1
0
        public static bool TryLoadRecipe(string file, out Models.Recipe result)
        {
            try
            {
                var fileText = File.ReadAllText(file);

                result = JsonConvert.DeserializeObject <Models.Recipe>(fileText);

                return(true);
            }
            catch
            {
                result = null;
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        /// Converts a GDLE recipe to an ACE recipe
        /// </summary>
        public static bool TryConvert(Models.Recipe input, out Recipe result)
        {
            try
            {
                result = new Recipe();

                result.Id = input.RecipeId;

                result.Unknown1    = (uint)input.Unknown;
                result.Skill       = input.Skill;
                result.Difficulty  = input.Difficulty;
                result.SalvageType = (uint)input.SkillCheckFormulaType;

                result.SuccessWCID    = input.SuccessWcid;
                result.SuccessAmount  = input.SuccessAmount;
                result.SuccessMessage = input.SuccessMessage;

                result.FailWCID    = input.FailWcid;
                result.FailAmount  = input.FailAmount;
                result.FailMessage = input.FailMessage;

                result.SuccessDestroyTargetChance  = input.SuccessConsumeTargetChance;
                result.SuccessDestroyTargetAmount  = input.SuccessConsumeTargetAmount;
                result.SuccessDestroyTargetMessage = input.SuccessConsumeTargetMessage;

                result.SuccessDestroySourceChance  = input.SuccessConsumeToolChance;
                result.SuccessDestroySourceAmount  = input.SuccessConsumeToolAmount;
                result.SuccessDestroySourceMessage = input.SuccessConsumeToolMessage;

                result.FailDestroyTargetChance  = input.FailureConsumeTargetChance;
                result.FailDestroyTargetAmount  = input.FailureConsumeTargetAmount;
                result.FailDestroyTargetMessage = input.FailureConsumeTargetMessage;

                result.FailDestroySourceChance  = input.FailureConsumeToolChance;
                result.FailDestroySourceAmount  = input.FailureConsumeToolAmount;
                result.FailDestroySourceMessage = input.FailureConsumeToolMessage;

                result.DataId = input.DataId;

                sbyte index = -1;
                foreach (var value in input.Requirements)
                {
                    index++;
                    if (value == null)
                    {
                        continue;
                    }

                    if (value.IntRequirements != null)
                    {
                        foreach (var requirement in value.IntRequirements)
                        {
                            result.RecipeRequirementsInt.Add(new RecipeRequirementsInt
                            {
                                Index   = index,
                                Stat    = requirement.Stat,
                                Value   = requirement.Value,
                                Enum    = requirement.OperationType,
                                Message = requirement.Message
                            });
                        }
                    }

                    if (value.DIDRequirements != null)
                    {
                        foreach (var requirement in value.DIDRequirements)
                        {
                            result.RecipeRequirementsDID.Add(new RecipeRequirementsDID
                            {
                                Index   = index,
                                Stat    = requirement.Stat,
                                Value   = requirement.Value,
                                Enum    = requirement.OperationType,
                                Message = requirement.Message
                            });
                        }
                    }

                    if (value.IIDRequirements != null)
                    {
                        foreach (var requirement in value.IIDRequirements)
                        {
                            result.RecipeRequirementsIID.Add(new RecipeRequirementsIID
                            {
                                Index   = index,
                                Stat    = requirement.Stat,
                                Value   = requirement.Value,
                                Enum    = requirement.OperationType,
                                Message = requirement.Message
                            });
                        }
                    }

                    if (value.FloatRequirements != null)
                    {
                        foreach (var requirement in value.FloatRequirements)
                        {
                            result.RecipeRequirementsFloat.Add(new RecipeRequirementsFloat
                            {
                                Index   = index,
                                Stat    = requirement.Stat,
                                Value   = requirement.Value,
                                Enum    = requirement.OperationType,
                                Message = requirement.Message
                            });
                        }
                    }

                    if (value.StringRequirements != null)
                    {
                        foreach (var requirement in value.StringRequirements)
                        {
                            result.RecipeRequirementsString.Add(new RecipeRequirementsString
                            {
                                Index = index,
                                Stat  = requirement.Stat,
                                Value = requirement.Value,
                                Enum  = requirement.OperationType,
                            });
                        }
                    }

                    if (value.BoolRequirements != null)
                    {
                        foreach (var requirement in value.BoolRequirements)
                        {
                            result.RecipeRequirementsBool.Add(new RecipeRequirementsBool
                            {
                                Index   = index,
                                Stat    = requirement.Stat,
                                Value   = requirement.Value,
                                Enum    = requirement.OperationType,
                                Message = requirement.Message
                            });
                        }
                    }
                }

                for (int i = 0; i < 8; i++) // Must be 8
                {
                    var recipeMod = new RecipeMod();

                    var value = input.Mods[i];

                    if (value == null)
                    {
                        continue;
                    }

                    if (value.IntRequirements != null)
                    {
                        foreach (var mod in value.IntRequirements)
                        {
                            recipeMod.RecipeModsInt.Add(new RecipeModsInt
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown ?? 0
                            });
                        }
                    }

                    if (value.DIDRequirements != null)
                    {
                        foreach (var mod in value.DIDRequirements)
                        {
                            recipeMod.RecipeModsDID.Add(new RecipeModsDID
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown ?? 0
                            });
                        }
                    }

                    if (value.IIDRequirements != null)
                    {
                        foreach (var mod in value.IIDRequirements)
                        {
                            recipeMod.RecipeModsIID.Add(new RecipeModsIID
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown ?? 0
                            });;
                        }
                    }

                    if (value.FloatRequirements != null)
                    {
                        foreach (var mod in value.FloatRequirements)
                        {
                            recipeMod.RecipeModsFloat.Add(new RecipeModsFloat
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown ?? 0
                            });
                        }
                    }

                    if (value.StringRequirements != null)
                    {
                        foreach (var mod in value.StringRequirements)
                        {
                            recipeMod.RecipeModsString.Add(new RecipeModsString
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown
                            });
                        }
                    }

                    if (value.BoolRequirements != null)
                    {
                        foreach (var mod in value.BoolRequirements)
                        {
                            recipeMod.RecipeModsBool.Add(new RecipeModsBool
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown ?? 0
                            });
                        }
                    }

                    recipeMod.RecipeId = result.Id;

                    recipeMod.ExecutesOnSuccess = (i <= 3); // The first 4 are "act on success", the second 4 are "act on failure"

                    recipeMod.Health  = value.ModifyHealth;
                    recipeMod.Stamina = value.ModifyStamina;
                    recipeMod.Mana    = value.ModifyMana;

                    // TODO: ACE is missing RequiresHealth, RequiresStamina, RequiresMana

                    recipeMod.Unknown7 = value.Unknown7;
                    recipeMod.DataId   = value.ModificationScriptId;

                    recipeMod.Unknown9   = value.Unknown9;
                    recipeMod.InstanceId = value.Unknown10;

                    bool add = (recipeMod.Health > 0 || recipeMod.Stamina > 0 || recipeMod.Mana > 0);
                    add = (add || recipeMod.Unknown7 || recipeMod.DataId > 0 || recipeMod.Unknown9 > 0 || recipeMod.InstanceId > 0);
                    add = (add || recipeMod.RecipeModsBool.Count > 0 || recipeMod.RecipeModsDID.Count > 0 || recipeMod.RecipeModsFloat.Count > 0 || recipeMod.RecipeModsIID.Count > 0 || recipeMod.RecipeModsInt.Count > 0 || recipeMod.RecipeModsString.Count > 0);

                    if (add)
                    {
                        result.RecipeMod.Add(recipeMod);
                    }
                }

                return(true);
            }
            catch
            {
                result = null;
                return(false);
            }
        }
Пример #3
0
        /// <summary>
        /// Converts an ACE recipe to GDLE recipe
        /// </summary>
        public static bool TryConvert(Recipe input, out Models.Recipe result)
        {
            try
            {
                result = new Models.Recipe();

                result.RecipeId = input.Id;

                result.Unknown               = (int)input.Unknown1;
                result.Skill                 = input.Skill;
                result.Difficulty            = input.Difficulty;
                result.SkillCheckFormulaType = (int)input.SalvageType;

                result.SuccessWcid    = input.SuccessWCID;
                result.SuccessAmount  = input.SuccessAmount;
                result.SuccessMessage = input.SuccessMessage;

                result.FailWcid    = input.FailWCID;
                result.FailAmount  = input.FailAmount;
                result.FailMessage = input.FailMessage;

                result.SuccessConsumeTargetChance  = input.SuccessDestroyTargetChance;
                result.SuccessConsumeTargetAmount  = input.SuccessDestroyTargetAmount;
                result.SuccessConsumeTargetMessage = input.SuccessDestroyTargetMessage;

                result.SuccessConsumeToolChance  = input.SuccessDestroySourceChance;
                result.SuccessConsumeToolAmount  = input.SuccessDestroySourceAmount;
                result.SuccessConsumeToolMessage = input.SuccessDestroySourceMessage;

                result.FailureConsumeTargetChance  = input.FailDestroyTargetChance;
                result.FailureConsumeTargetAmount  = input.FailDestroyTargetAmount;
                result.FailureConsumeTargetMessage = input.FailDestroyTargetMessage;

                result.FailureConsumeToolChance  = input.FailDestroySourceChance;
                result.FailureConsumeToolAmount  = input.FailDestroySourceAmount;
                result.FailureConsumeToolMessage = input.FailDestroySourceMessage;

                result.DataId = input.DataId;

                // requirements
                result.Requirements = new List <Models.RecipeRequirements>();
                for (var idx = 0; idx < 3; idx++)
                {
                    result.Requirements.Add(null);
                }

                foreach (var intReq in input.RecipeRequirementsInt)
                {
                    var requirements = result.Requirements[intReq.Index];

                    if (requirements == null)
                    {
                        requirements = new Models.RecipeRequirements();
                        result.Requirements[intReq.Index] = requirements;
                    }

                    requirements.IntRequirements.Add(new Models.IntRequirement
                    {
                        Stat          = intReq.Stat,
                        Value         = intReq.Value,
                        OperationType = intReq.Enum,
                        Message       = intReq.Message
                    });
                }

                foreach (var didReq in input.RecipeRequirementsDID)
                {
                    var requirements = result.Requirements[didReq.Index];

                    if (requirements == null)
                    {
                        requirements = new Models.RecipeRequirements();
                        result.Requirements[didReq.Index] = requirements;
                    }

                    requirements.DIDRequirements.Add(new Models.DIDRequirement
                    {
                        Stat          = didReq.Stat,
                        Value         = didReq.Value,
                        OperationType = didReq.Enum,
                        Message       = didReq.Message
                    });
                }

                foreach (var iidReq in input.RecipeRequirementsIID)
                {
                    var requirements = result.Requirements[iidReq.Index];

                    if (requirements == null)
                    {
                        requirements = new Models.RecipeRequirements();
                        result.Requirements[iidReq.Index] = requirements;
                    }

                    requirements.DIDRequirements.Add(new Models.DIDRequirement
                    {
                        Stat          = iidReq.Stat,
                        Value         = iidReq.Value,
                        OperationType = iidReq.Enum,
                        Message       = iidReq.Message
                    });
                }

                foreach (var floatReq in input.RecipeRequirementsFloat)
                {
                    var requirements = result.Requirements[floatReq.Index];

                    if (requirements == null)
                    {
                        requirements = new Models.RecipeRequirements();
                        result.Requirements[floatReq.Index] = requirements;
                    }

                    requirements.FloatRequirements.Add(new Models.FloatRequirement
                    {
                        Stat          = floatReq.Stat,
                        Value         = floatReq.Value,
                        OperationType = floatReq.Enum,
                        Message       = floatReq.Message
                    });
                }

                foreach (var stringReq in input.RecipeRequirementsString)
                {
                    var requirements = result.Requirements[stringReq.Index];

                    if (requirements == null)
                    {
                        requirements = new Models.RecipeRequirements();
                        result.Requirements[stringReq.Index] = requirements;
                    }

                    requirements.StringRequirements.Add(new Models.StringRequirement
                    {
                        Stat          = stringReq.Stat,
                        Value         = stringReq.Value,
                        OperationType = stringReq.Enum,
                    });
                }

                foreach (var boolReq in input.RecipeRequirementsBool)
                {
                    var requirements = result.Requirements[boolReq.Index];

                    if (requirements == null)
                    {
                        requirements = new Models.RecipeRequirements();
                        result.Requirements[boolReq.Index] = requirements;
                    }

                    requirements.BoolRequirements.Add(new Models.BoolRequirement
                    {
                        Stat          = boolReq.Stat,
                        Value         = boolReq.Value,
                        OperationType = boolReq.Enum,
                    });
                }

                // modifications
                result.Mods = new List <Models.Mod>();
                for (var idx = 0; idx < 8; idx++)
                {
                    result.Mods.Add(null);
                }

                foreach (var recipeMod in input.RecipeMod)
                {
                    // should index be on RecipeMod, or RecipeModType?
                    var idx = GetIndex(recipeMod);
                    if (idx == -1)
                    {
                        Console.WriteLine($"Couldn't find recipe mod idx");
                        continue;
                    }

                    var mod = result.Mods[idx];
                    if (mod == null)
                    {
                        mod = new Models.Mod();
                        result.Mods[idx] = mod;
                    }

                    // base stats
                    mod.ModifyHealth  = recipeMod.Health;
                    mod.ModifyStamina = recipeMod.Stamina;
                    mod.ModifyMana    = recipeMod.Mana;

                    // TODO!!! we're missing the following RequiresHealth, RequiresStamina, RequiresMana

                    mod.Unknown7             = recipeMod.Unknown7;
                    mod.ModificationScriptId = recipeMod.DataId;

                    mod.Unknown9  = recipeMod.Unknown9;
                    mod.Unknown10 = recipeMod.InstanceId;

                    // type mods
                    foreach (var intMod in recipeMod.RecipeModsInt)
                    {
                        mod.IntRequirements.Add(new Models.IntRequirement
                        {
                            Stat          = intMod.Stat,
                            Value         = intMod.Value,
                            OperationType = intMod.Enum,
                            Unknown       = intMod.Source
                        });
                    }

                    foreach (var didMod in recipeMod.RecipeModsDID)
                    {
                        mod.DIDRequirements.Add(new Models.DIDRequirement
                        {
                            Stat          = didMod.Stat,
                            Value         = didMod.Value,
                            OperationType = didMod.Enum,
                            Unknown       = didMod.Source
                        });
                    }

                    foreach (var iidMod in recipeMod.RecipeModsIID)
                    {
                        mod.IIDRequirements.Add(new Models.IIDRequirement
                        {
                            Stat          = iidMod.Stat,
                            Value         = iidMod.Value,
                            OperationType = iidMod.Enum,
                            Unknown       = iidMod.Source
                        });
                    }

                    foreach (var floatMod in recipeMod.RecipeModsFloat)
                    {
                        mod.FloatRequirements.Add(new Models.FloatRequirement
                        {
                            Stat          = floatMod.Stat,
                            Value         = floatMod.Value,
                            OperationType = floatMod.Enum,
                            Unknown       = floatMod.Source
                        });
                    }

                    foreach (var stringMod in recipeMod.RecipeModsString)
                    {
                        mod.StringRequirements.Add(new Models.StringRequirement
                        {
                            Stat          = stringMod.Stat,
                            Value         = stringMod.Value,
                            OperationType = stringMod.Enum,
                            Unknown       = stringMod.Source
                        });
                    }

                    foreach (var boolMod in recipeMod.RecipeModsBool)
                    {
                        mod.BoolRequirements.Add(new Models.BoolRequirement
                        {
                            Stat          = boolMod.Stat,
                            Value         = boolMod.Value,
                            OperationType = boolMod.Enum,
                            Unknown       = boolMod.Source
                        });
                    }
                }

                return(true);
            }
            catch
            {
                result = null;
                return(false);
            }
        }
Пример #4
0
        public static bool TryConvert(Models.Recipe input, out Database.Models.World.Recipe result)
        {
            try
            {
                result = new Recipe();

                result.Id = input.RecipeId;

                result.Unknown1    = (uint)input.Unknown;
                result.Skill       = input.Skill;
                result.Difficulty  = input.Difficulty;
                result.SalvageType = (uint)input.SkillCheckFormulaType;

                result.SuccessWCID    = input.SuccessWcid;
                result.SuccessAmount  = input.SuccessAmount;
                result.SuccessMessage = input.SuccessMessage;

                result.FailWCID    = input.FailWcid;
                result.FailAmount  = input.FailAmount;
                result.FailMessage = input.FailMessage;

                result.SuccessDestroyTargetChance  = input.SuccessConsumeTargetChance;
                result.SuccessDestroyTargetAmount  = input.SuccessConsumeTargetAmount;
                result.SuccessDestroyTargetMessage = input.SuccessConsumeTargetMessage;

                result.SuccessDestroySourceChance  = input.SuccessConsumeToolChance;
                result.SuccessDestroySourceAmount  = input.SuccessConsumeToolAmount;
                result.SuccessDestroySourceMessage = input.SuccessConsumeToolMessage;

                result.FailDestroyTargetChance  = input.FailureConsumeTargetChance;
                result.FailDestroyTargetAmount  = input.FailureConsumeTargetAmount;
                result.FailDestroyTargetMessage = input.FailureConsumeTargetMessage;

                result.FailDestroySourceChance  = input.FailureConsumeToolChance;
                result.FailDestroySourceAmount  = input.FailureConsumeToolAmount;
                result.FailDestroySourceMessage = input.FailureConsumeToolMessage;

                result.DataId = input.DataId;

                sbyte index = -1;
                foreach (var value in input.Requirements)
                {
                    index++;
                    if (value == null)
                    {
                        continue;
                    }

                    // TODO!!! GDLE only has 2 requirements, int and bool. Why do we have all of them defined?
                    // TODO!!! GDLE requirements also define properties OperationType and Unknown

                    if (value.IntRequirements != null)
                    {
                        foreach (var requirement in value.IntRequirements)
                        {
                            result.RecipeRequirementsInt.Add(new RecipeRequirementsInt
                            {
                                Index   = index,
                                Stat    = requirement.Stat,
                                Value   = (int)requirement.Value,
                                Enum    = requirement.OperationType,
                                Message = requirement.Message
                            });
                        }
                    }

                    /*if (value.DIDRequirements != null)
                     * {
                     *  foreach (var requirement in value.DIDRequirements)
                     *  {
                     *      result.RecipeRequirementsDID.Add(new RecipeRequirementsDID
                     *      {
                     *          Stat = requirement.Stat,
                     *          Value = requirement.Value,
                     *          Enum = requirement.Enum,
                     *          Message = requirement.Message
                     *      });
                     *  }
                     * }
                     *
                     * if (value.IIDRequirements != null)
                     * {
                     *  foreach (var requirement in value.IIDRequirements)
                     *  {
                     *      result.RecipeRequirementsIID.Add(new RecipeRequirementsIID
                     *      {
                     *          Stat = requirement.Stat,
                     *          Value = requirement.Value,
                     *          Enum = requirement.Enum,
                     *          Message = requirement.Message
                     *      });
                     *  }
                     * }
                     *
                     * if (value.FloatRequirements != null)
                     * {
                     *  foreach (var requirement in value.FloatRequirements)
                     *  {
                     *      result.RecipeRequirementsFloat.Add(new RecipeRequirementsFloat
                     *      {
                     *          Stat = requirement.Stat,
                     *          Value = requirement.Value,
                     *          Enum = requirement.Enum,
                     *          Message = requirement.Message
                     *      });
                     *  }
                     * }
                     *
                     * if (value.StringRequirements != null)
                     * {
                     *  foreach (var requirement in value.StringRequirements)
                     *  {
                     *      result.RecipeRequirementsString.Add(new RecipeRequirementsString
                     *      {
                     *          Stat = requirement.Stat,
                     *          Value = requirement.Value,
                     *          Enum = requirement.Enum,
                     *          Message = requirement.Message
                     *      });
                     *  }
                     * }*/

                    if (value.BoolRequirements != null)
                    {
                        foreach (var requirement in value.BoolRequirements)
                        {
                            result.RecipeRequirementsBool.Add(new RecipeRequirementsBool
                            {
                                Index   = index,
                                Stat    = requirement.Stat,
                                Value   = (requirement.Value != 0),
                                Enum    = requirement.OperationType,
                                Message = requirement.Message
                            });
                        }
                    }
                }

                for (int i = 0; i < 8; i++) // Must be 8
                {
                    var recipeMod = new RecipeMod();

                    var value = input.Mods[i];

                    if (value == null)
                    {
                        continue;
                    }

                    if (value.IntRequirements != null)
                    {
                        foreach (var mod in value.IntRequirements)
                        {
                            recipeMod.RecipeModsInt.Add(new RecipeModsInt
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = (int)mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown ?? 0
                            });
                        }
                    }

                    if (value.DidRequirements != null)
                    {
                        foreach (var mod in value.DidRequirements)
                        {
                            recipeMod.RecipeModsDID.Add(new RecipeModsDID
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = (uint)mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown ?? 0
                            });
                        }
                    }

                    // TODO!!!! GDLE doesn't have this

                    /*if (value.IIDMods != null)
                     * {
                     *  foreach (var mod in value.IIDMods)
                     *  {
                     *      recipeMod.RecipeModsIID.Add(new RecipeModsIID
                     *      {
                     *          Stat = mod.Stat,
                     *          Value = mod.Value,
                     *          Enum = mod.Enum,
                     *          Unknown1 = mod.Unknown1
                     *      });
                     *  }
                     * }*/

                    if (value.FloatRequirements != null)
                    {
                        foreach (var mod in value.FloatRequirements)
                        {
                            recipeMod.RecipeModsFloat.Add(new RecipeModsFloat
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown ?? 0
                            });
                        }
                    }

                    if (value.StringRequirements != null)
                    {
                        foreach (var mod in value.StringRequirements)
                        {
                            recipeMod.RecipeModsString.Add(new RecipeModsString
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = mod.Value,
                                Enum   = mod.OperationType,
                                Source = mod.Unknown
                            });
                        }
                    }

                    if (value.BoolRequirements != null)
                    {
                        foreach (var mod in value.BoolRequirements)
                        {
                            recipeMod.RecipeModsBool.Add(new RecipeModsBool
                            {
                                Index  = (sbyte)i,
                                Stat   = mod.Stat,
                                Value  = (mod.Value != 0),
                                Enum   = mod.OperationType,
                                Source = mod.Unknown ?? 0
                            });
                        }
                    }

                    recipeMod.RecipeId = result.Id;

                    recipeMod.ExecutesOnSuccess = (i <= 3); // The first 4 are "act on success", the second 4 are "act on failure"

                    // TODO!!!
                    recipeMod.Health  = value.ModifyHealth;
                    recipeMod.Stamina = value.ModifyStamina;
                    recipeMod.Mana    = value.ModifyMana;
                    // TODO!!! we're missing the following RequiresHealth, RequiresStamina, RequiresMana

                    recipeMod.Unknown7 = value.Unknown7;
                    recipeMod.DataId   = value.ModificationScriptId;

                    recipeMod.Unknown9   = value.Unknown9;
                    recipeMod.InstanceId = value.Unknown10;

                    bool add = (recipeMod.Health > 0 || recipeMod.Stamina > 0 || recipeMod.Mana > 0);
                    add = (add || recipeMod.Unknown7 || recipeMod.DataId > 0 || recipeMod.Unknown9 > 0 || recipeMod.InstanceId > 0);
                    add = (add || recipeMod.RecipeModsBool.Count > 0 || recipeMod.RecipeModsDID.Count > 0 || recipeMod.RecipeModsFloat.Count > 0 || recipeMod.RecipeModsIID.Count > 0 || recipeMod.RecipeModsInt.Count > 0 || recipeMod.RecipeModsString.Count > 0);

                    if (add)
                    {
                        result.RecipeMod.Add(recipeMod);
                    }
                }

                return(true);
            }
            catch
            {
                result = null;
                return(false);
            }
        }