Esempio n. 1
0
        public static ParamData.AtkParam GetNpcBasicAtkParam(ParamData.NpcParam npcParam, int behaviorSubID)
        {
            if (npcParam == null)
            {
                return(null);
            }

            long behaviorParamID = 2_00000_000 + (npcParam.BehaviorVariationID * 1_000) + behaviorSubID;

            if (!BehaviorParam.ContainsKey(behaviorParamID))
            {
                return(null);
            }

            ParamData.BehaviorParam behaviorParamEntry = BehaviorParam[behaviorParamID];

            if (behaviorParamEntry.RefType != 0)
            {
                return(null);
            }

            if (!AtkParam_Npc.ContainsKey(behaviorParamEntry.RefID))
            {
                return(null);
            }

            return(AtkParam_Npc[behaviorParamEntry.RefID]);
        }
Esempio n. 2
0
        public static ParamData.AtkParam GetNpcBasicAtkParam(ParamData.NpcParam npcParam, int behaviorJudgeID)
        {
            if (npcParam == null)
            {
                return(null);
            }

            // Format: 2VVVVVJJJ
            // V = BehaviorVariationID
            // J = BehaviorJudgeID
            long behaviorParamID = 2_00000_000 + (npcParam.BehaviorVariationID * 1_000) + behaviorJudgeID;

            if (!BehaviorParam.ContainsKey(behaviorParamID))
            {
                return(null);
            }

            ParamData.BehaviorParam behaviorParamEntry = BehaviorParam[behaviorParamID];

            // Make sure behavior is an attack behavior.
            if (behaviorParamEntry.RefType != 0)
            {
                return(null);
            }

            // Make sure referenced attack exists.
            if (!AtkParam_Npc.ContainsKey(behaviorParamEntry.RefID))
            {
                return(null);
            }

            return(AtkParam_Npc[behaviorParamEntry.RefID]);
        }
Esempio n. 3
0
        public static ParamData.AtkParam GetPlayerBasicAtkParam(ParamData.EquipParamWeapon wpn, int behaviorJudgeID, bool isLeftHand)
        {
            if (wpn == null)
            {
                return(null);
            }

            // Format: 10VVVVJJJ
            // V = BehaviorVariationID
            // J = BehaviorJudgeID
            long behaviorParamID = 10_0000_000 + (wpn.BehaviorVariationID * 1_000) + behaviorJudgeID;

            // If behavior 10VVVVJJJ doesn't exist, check for fallback behavior 10VV00JJJ.
            if (!BehaviorParam_PC.ContainsKey(behaviorParamID))
            {
                long baseBehaviorVariationID = (wpn.BehaviorVariationID / 100) * 100;

                if (baseBehaviorVariationID == wpn.BehaviorVariationID)
                {
                    // Fallback is just the same thing, which we already know doesn't exist.
                    return(null);
                }

                long baseBehaviorParamID = 10_0000_000 + (baseBehaviorVariationID * 1_000) + behaviorJudgeID;

                if (BehaviorParam_PC.ContainsKey(baseBehaviorParamID))
                {
                    behaviorParamID = baseBehaviorParamID;
                }
                else
                {
                    return(null);
                }
            }

            ParamData.BehaviorParam behaviorParamEntry = BehaviorParam_PC[behaviorParamID];

            // Make sure behavior is an attack behavior.
            if (behaviorParamEntry.RefType != 0)
            {
                return(null);
            }

            // Make sure referenced attack exists.
            if (!AtkParam_Pc.ContainsKey(behaviorParamEntry.RefID))
            {
                return(null);
            }

            return(AtkParam_Pc[behaviorParamEntry.RefID]);
        }
Esempio n. 4
0
        public static ParamData.AtkParam GetPlayerBasicAtkParam(ParamData.EquipParamWeapon wpn, int behaviorSubID, bool isLeftHand)
        {
            if (wpn == null)
            {
                return(null);
            }

            long behaviorParamID = 10_0000_000 + (wpn.BehaviorVariationID * 1_000) + behaviorSubID;

            if (!BehaviorParam_PC.ContainsKey(behaviorParamID))
            {
                if (wpn != null)
                {
                    long baseBehaviorParamID = 10_0000_000 + ((wpn.WepMotionCategory * 100) * 1_000) + behaviorSubID;

                    if (BehaviorParam_PC.ContainsKey(baseBehaviorParamID))
                    {
                        behaviorParamID = baseBehaviorParamID;
                    }
                    else
                    {
                        return(null);
                    }
                }
                else

                {
                    return(null);
                }
            }

            ParamData.BehaviorParam behaviorParamEntry = BehaviorParam_PC[behaviorParamID];
            if (behaviorParamEntry.RefType != 0)
            {
                return(null);
            }

            if (!AtkParam_Pc.ContainsKey(behaviorParamEntry.RefID))
            {
                return(null);
            }

            return(AtkParam_Pc[behaviorParamEntry.RefID]);
        }