Exemplo n.º 1
0
        public float AOERange;                    // 技能AOE范围

        /**
         * @brief 提取数据
         *
         * @param node
         *
         * @return
         */
        public bool CollectDataFromDBC(DBC_Row node)
        {
            SkillId              = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
            SkillDataFile        = DBCUtil.ExtractString(node, "LogicDataFile", "", true);
            SkillIcon            = DBCUtil.ExtractString(node, "Icon", "", true);
            SkillDescription     = DBCUtil.ExtractString(node, "Description", "", true);
            SkillTrueDescription = DBCUtil.ExtractString(node, "TrueDescription", "", true);
            ActivateLevel        = DBCUtil.ExtractNumeric <int>(node, "ActivateLevel", 0, true);
            SkillPassivity       = (Passivity)DBCUtil.ExtractNumeric <int>(node, "Passivity", 0, true);
            SkillCoefficient     = DBCUtil.ExtractNumeric <float>(node, "SkillCoefficient", 0, true);
            TargetType           = (TargType)DBCUtil.ExtractNumeric <int>(node, "TargetType", 0, true);
            TargetSelectType     = (TargSelectType)DBCUtil.ExtractNumeric <int>(node, "TargetSelectType", 0, true);
            CoolDownTime         = DBCUtil.ExtractNumeric <float>(node, "CD", 0, true);
            CostHp             = DBCUtil.ExtractNumeric <int>(node, "CostHp", 0, false);
            CostEnergy         = DBCUtil.ExtractNumeric <int>(node, "CostEnergy", 0, false);
            CostEnergyCore     = DBCUtil.ExtractNumeric <int>(node, "CostEnergyCore", 0, false);
            CostItemId         = DBCUtil.ExtractNumeric <int>(node, "CostItemId", 0, false);
            RangeIndicatorType = (RangeType)DBCUtil.ExtractNumeric <int>(node, "RangeIndicatorType", 0, false);
            SkillRangeAsset    = DBCUtil.ExtractString(node, "SkillRangeAsset", "", false);
            AOERangeAsset      = DBCUtil.ExtractString(node, "AOERangeAsset", "", false);
            SkillAssetStdRange = DBCUtil.ExtractNumeric <float>(node, "SkillAssetStdRange", 0, false);
            AOEAssetStdRange   = DBCUtil.ExtractNumeric <float>(node, "AOEAssetStdRange", 0, false);
            SkillRange         = DBCUtil.ExtractNumeric <float>(node, "SkillRange", 0, false);
            AOERange           = DBCUtil.ExtractNumeric <float>(node, "AOERange", 0, false);

            return(true);
        }
Exemplo n.º 2
0
        private static bool CheckCondition(Condition condition, Passivity passivity)
        {
            switch (passivity.Type)
            {
            // Damage block
            case 109:
                return(condition == Condition.Attacked);

            // Heal modifier
            case 168:
                return(condition == Condition.Heal);

            // Receive more healing
            case 169:
                return(condition == Condition.Healed);

            // Chance to regenerate MP when combat starts.
            case 207:
                return(condition == Condition.BattleEnter);

            // Do more damage when attack ...
            case 152:
                return(condition == Condition.Attack);

            default:
                return(false);
            }
        }
Exemplo n.º 3
0
        /**
         * @brief 提取数据
         *
         * @param node
         *
         * @return
         */
        public bool CollectDataFromDBC(DBC_Row node)
        {
            SkillId              = DBCUtil.ExtractNumeric <int>(node, "Id", 0, true);
            SkillDataFile        = DBCUtil.ExtractString(node, "LogicDataFile", "", false);
            SkillDescription     = DBCUtil.ExtractString(node, "Description", "", true);
            SkillTrueDescription = DBCUtil.ExtractString(node, "TrueDescription", "", false);
            ActivateLevel        = DBCUtil.ExtractNumeric <int>(node, "ActivateLevel", 0, true);
            SkillPassivity       = (Passivity)DBCUtil.ExtractNumeric <int>(node, "Passivity", 0, true);
            SkillCoefficient     = DBCUtil.ExtractNumeric <float>(node, "SkillCoefficient", 0, true);
            SkillRangeMin        = DBCUtil.ExtractNumeric <float>(node, "RangeMin", 0.0f, false);
            SkillRangeMax        = DBCUtil.ExtractNumeric <float>(node, "RangeMax", 3.0f, false);
            TargetType           = (TargType)DBCUtil.ExtractNumeric <int>(node, "TargetType", 0, true);
            TargetSelectType     = (TargSelectType)DBCUtil.ExtractNumeric <int>(node, "TargetSelectType", 0, true);
            CoolDownTime         = DBCUtil.ExtractNumeric <float>(node, "CD", 0, true);
            CastTime             = DBCUtil.ExtractNumeric <float>(node, "CastTime", 0, true);
            MinusCD              = DBCUtil.ExtractNumericList <int>(node, "MinusCD", 0, false);
            CostHp         = DBCUtil.ExtractNumeric <int>(node, "CostHp", 0, false);
            CostRage       = DBCUtil.ExtractNumeric <int>(node, "CostRage", 0, false);
            CostEnergy     = DBCUtil.ExtractNumeric <int>(node, "CostEnergy", 0, false);
            CostEnergyCore = DBCUtil.ExtractNumeric <int>(node, "CostEnergyCore", 0, false);
            CostItemId     = DBCUtil.ExtractNumeric <int>(node, "CostItemId", 0, false);

            LevelUpCostType  = DBCUtil.ExtractNumeric <int>(node, "LevelUpCostType", 1, false);
            LevelUpVigorType = DBCUtil.ExtractNumeric <int>(node, "LevelUpVigorType", 1, false);

            CanStartWhenStiffness = DBCUtil.ExtractBool(node, "CanStartWhenStiffness", false, false);
            CanStartWhenHitFly    = DBCUtil.ExtractBool(node, "CanStartWhenHitFly", false, false);
            CanStartWhenKnockDown = DBCUtil.ExtractBool(node, "CanStartWhenKnockDown", false, false);
            BreakType             = DBCUtil.ExtractNumeric <int>(node, "BreakType", 0, false);
            Category            = (SkillCategory)DBCUtil.ExtractNumeric <int>(node, "Category", 0, false);
            NextSkillId         = DBCUtil.ExtractNumeric <int>(node, "NextSkillId", -1, false);
            LiftSkillId         = DBCUtil.ExtractNumeric <int>(node, "LiftSkillId", -1, false);
            LiftCostItemList    = DBCUtil.ExtractNumericList <int>(node, "LiftCostItem", 0, false);
            LiftCostItemNumList = DBCUtil.ExtractNumericList <int>(node, "LiftCostItemNum", 0, false);
            QSkillId            = DBCUtil.ExtractNumeric <int>(node, "QSKillId", -1, false);
            ESkillId            = DBCUtil.ExtractNumeric <int>(node, "ESKillId", -1, false);
            LockInputTime       = DBCUtil.ExtractNumeric <float>(node, "LockInputTime", 0, false);;
            NextInputTime       = DBCUtil.ExtractNumeric <float>(node, "NextInputTime", 0, false);;
            TargetChooseRange   = DBCUtil.ExtractNumeric <float>(node, "TargetChooseRange", 0, false);;
            ShowName            = DBCUtil.ExtractString(node, "ShowName", "", false);
            ShowHitNum          = DBCUtil.ExtractNumeric <int>(node, "ShowHitNum", 0, false);
            ShowScore           = DBCUtil.ExtractNumeric <int>(node, "ShowScore", 0, false);
            ShowDescription     = DBCUtil.ExtractString(node, "ShowDescription", "", false);
            ShowCd         = DBCUtil.ExtractNumeric <float>(node, "ShowCD", 0, false);   //
            ShowCostEnergy = DBCUtil.ExtractNumeric <int>(node, "ShowCostEnergy", 0, false);
            ShowSteps      = DBCUtil.ExtractNumeric <int>(node, "ShowSteps", 0, false);
            ShowSteps2Des  = DBCUtil.ExtractString(node, "ShowSteps2Dec", "", false);
            ShowSteps3Des  = DBCUtil.ExtractString(node, "ShowSteps3Dec", "", false);
            ShowSteps4Des  = DBCUtil.ExtractString(node, "ShowSteps4Dec", "", false);
            DamagePerLevel = DBCUtil.ExtractNumeric <float>(node, "ShowDamagePerLevel", 0f, false);
            ShowBaseDamage = DBCUtil.ExtractNumeric <float>(node, "ShowDamage", 0f, false);
            ShowIconName   = DBCUtil.ExtractString(node, "ShowIconName", "", false);
            ShowAtlasPath  = DBCUtil.ExtractString(node, "ShowAtlasPath", "", false);
            return(true);
        }
Exemplo n.º 4
0
        private static void ApplyPassivity(Player player, Condition condition, Passivity passivity, AttackResult result)
        {
            if (!CheckCondition(condition, passivity))
            {
                return;
            }

            if (passivity.Probability >= 0.001f && 1.0f - passivity.Probability > 0.001f)
            {
                if (RandomUtilities.Random().Next(0, 100) > passivity.Probability * 100)
                {
                    return;
                }
            }

            switch (passivity.Type)
            {
            // Damage block
            case 109:
                if (result.AttackType != AttackType.Normal || !result.Target.EffectsImpact.IsBlockFrontAttacks)
                {
                    return;
                }

                if (result.AngleDif < 135 || passivity.Value < result.Damage)
                {
                    return;
                }

                result.Damage     = 0;
                result.AttackType = AttackType.Block;
                break;

            // Heal modifier
            case 168:
            case 169:
                switch (passivity.Method)
                {
                case 2:
                    result.HpDiff += (int)passivity.Value;
                    break;

                case 3:
                    result.HpDiff = (int)passivity.Value * result.HpDiff;
                    break;
                }
                break;

            // Do more damage when attack ...
            case 152:
                if (passivity.MobSize != NpcSize.All)
                {
                    if (result.Target is Player && passivity.MobSize != NpcSize.Player)
                    {
                        return;
                    }

                    if (result.Target is Npc && ((Npc)result.Target).NpcTemplate.Size != passivity.MobSize)
                    {
                        return;
                    }
                }

                switch (passivity.Method)
                {
                case 2:
                    result.Damage += (int)passivity.Value;
                    break;

                case 3:
                    result.Damage = (int)(passivity.Value * result.Damage);
                    break;
                }
                break;

            // Chance to regenerate MP when combat starts.
            case 207:
                Communication.Global.FeedbackService.MpChanged(player, (int)passivity.Value, player);
                break;
            }
        }