Example #1
0
        private static void BasePhysicalAttack(SkillBaseEventArgs bargument)
        {
            int Lvldiff;

            SkillUsageEventArgs.SkillMatrix matrix;
            Actor asource = bargument.Sender as Actor;
            Actor atarget = bargument.Target as Actor;

            if (asource != null && atarget != null && bargument.Context == Saga.Enumarations.SkillContext.SkillUse)
            {
                SkillUsageEventArgs arguments = (SkillUsageEventArgs)bargument;
                matrix        = arguments.GetPhysicalSkillMatrix(asource, atarget);
                Lvldiff       = arguments.GetCappedLevelDifference(matrix);
                matrix[4, 3] += (Lvldiff * 120);
                matrix[0, 1]  = 0; matrix[1, 1] = 0;

                if (arguments.IsMissed(matrix) || arguments.IsBlocked(matrix))
                {
                    return;
                }
                else
                {
                    arguments.CanCheckEquipmentDurabillity = true;
                    arguments.CanCheckWeaponDurabillity    = true;
                    arguments.Damage = arguments.GetDamage(matrix);
                    arguments.Damage = arguments.GetDefenseReduction(matrix, arguments.Damage);
                    arguments.IsCritical(matrix);
                }
            }
            else
            {
                bargument.Failed = true;
            }
        }