예제 #1
0
        public static bool CheckEvasion(Mobile m)
        {
            if (IsActive(m))
            {
                return(MasteryInfo.GetMasteryLevel(m, SkillName.Ninjitsu) + 2 > Utility.Random(100));
            }

            return(false);
        }
예제 #2
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!UnderEffects(attacker))
            {
                return;
            }

            if (_Table[attacker].Target == defender)
            {
                _Table[attacker].Hit++;

                if (_Table[attacker].Hit >= 3)
                {
                    int level  = MasteryInfo.GetMasteryLevel(attacker, MoveSkill);
                    int newDam = damage + Utility.RandomMinMax(level, level * 2);

                    AOS.Damage(defender, attacker, Utility.RandomMinMax(level + 1, (level * 7) - 1), 0, 0, 0, 0, 0, 0, 100);
                }
            }
        }
예제 #3
0
        public static bool OnPoisonApplied(Mobile m)
        {
            if (GetSpell(m, typeof(ToleranceSpell)) is ToleranceSpell spell)
            {
                double stamCost = (m.Skills[spell.CastSkill].Base + ((MasteryInfo.GetMasteryLevel(m, SkillName.Poisoning) * 30) + 10)) / 2;

                stamCost /= 4;
                stamCost  = Math.Max(18, (25 - stamCost) + 18);

                if (m.Stam < (int)stamCost)
                {
                    spell.Caster.SendLocalizedMessage(1156036, ((int)stamCost).ToString());  // You must have at least ~1_STAM_REQUIREMENT~ Stamina to use this ability.
                    return(false);
                }

                spell.Caster.Stam -= (int)stamCost;
                return(true);
            }

            return(false);
        }
예제 #4
0
        public static void OnHit(Mobile attacker, Mobile defender)
        {
            CheckTable();

            int damage;

            if (!HasBleedMod(attacker, out damage) || (_Table != null && _Table.ContainsKey(attacker)))
            {
                return;
            }

            double bleedchance = (attacker.Skills.Ninjitsu.Value + attacker.Skills.Stealth.Value + (MasteryInfo.GetMasteryLevel(attacker, SkillName.Ninjitsu) * 40)) / 3.0 / 15.0;

            if (bleedchance > Utility.RandomDouble())
            {
                BleedAttack.BeginBleed(defender, attacker, false);

                if (_Table == null)
                {
                    _Table = new Dictionary <Mobile, DateTime>();
                }

                _Table[attacker] = DateTime.UtcNow + TimeSpan.FromMinutes(1);
            }
        }
예제 #5
0
        public static int GetDamageBonus(Mobile m)
        {
            AnimalFormContext context = AnimalForm.GetContext(m);

            if (context != null && context.Type == typeof(WildWhiteTiger))
            {
                return((int)(((m.Skills[SkillName.Ninjitsu].Value + m.Skills[SkillName.Stealth].Value + (MasteryInfo.GetMasteryLevel(m, SkillName.Ninjitsu) * 40)) / 3) / 10) / 2);
            }

            return(0);
        }
예제 #6
0
 public int GetMasteryLevel()
 {
     return((int)MasteryInfo.GetMasteryLevel(Caster, CastSkill));
 }
예제 #7
0
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon != null && !HasOnslaught(attacker, defender))
            {
                ClearCurrentMove(attacker);

                int phys, fire, cold, pois, nrgy, chaos, direct;
                weapon.GetDamageTypes(null, out phys, out fire, out cold, out pois, out nrgy, out chaos, out direct);

                int highest = phys;
                int type    = 0;

                if (fire > phys)
                {
                    type    = 1;
                    highest = fire;
                }

                if (cold > highest)
                {
                    type    = 2;
                    highest = cold;
                }

                if (pois > highest)
                {
                    type    = 3;
                    highest = pois;
                }

                if (nrgy > highest)
                {
                    type    = 4;
                    highest = nrgy;
                }

                ResistanceType resistType = (ResistanceType)type;

                int amount   = (int)(attacker.Skills[MoveSkill].Value + attacker.Skills[SkillName.Tactics].Value / 12);
                int duration = (MasteryInfo.GetMasteryLevel(attacker, MoveSkill) * 2) + 1;

                if (defender is PlayerMobile)
                {
                    amount /= 2;
                }

                ResistanceMod mod = new ResistanceMod(resistType, -amount);
                defender.AddResistanceMod(mod);

                attacker.PrivateOverheadMessage(MessageType.Regular, 1150, 1156008, attacker.NetState);                                                                                                        // You deliver an onslaught of sword strikes!
                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.Onslaught, 1156009, 1156010, TimeSpan.FromSeconds(duration), defender, String.Format("{0}\t{1}", amount.ToString(), resistType.ToString()))); // -~2_VAL~% ~1_RESIST~ Debuff.

                defender.FixedEffect(0x37B9, 10, 5, 632, 0);

                if (_Table == null)
                {
                    _Table = new Dictionary <Mobile, Mobile>();
                }

                _Table[attacker] = defender;

                Timer.DelayCall(TimeSpan.FromSeconds(duration), () =>
                {
                    defender.RemoveResistanceMod(mod);
                    _Table.Remove(attacker);
                });
            }
        }
예제 #8
0
파일: Stagger.cs 프로젝트: pallop/Servuo
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentMove(attacker);

            attacker.PrivateOverheadMessage(MessageType.Regular, 1150, 1155984, attacker.NetState);

            defender.FixedEffect(0x3779, 20, 10, 2719, 0);

            double skills = (attacker.Skills[MoveSkill].Value + attacker.Skills[SkillName.Tactics].Value + (MasteryInfo.GetMasteryLevel(attacker, MoveSkill) * 40)) / 3;

            AddToTable(defender, (int)(skills / 2));
            BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.Stagger, 1155981, 1155982, TimeSpan.FromSeconds(10), defender, ((int)skills / 2).ToString()));

            defender.Delta(MobileDelta.WeaponDamage);

            AddToCooldown(attacker);
        }
예제 #9
0
파일: Pierce.cs 프로젝트: Argalep/ServUO
        public override void OnHit(Mobile attacker, Mobile defender, int damage)
        {
            if (!Validate(attacker) || !CheckMana(attacker, true))
            {
                return;
            }

            ClearCurrentMove(attacker);

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if (weapon != null && (_Table == null || !_Table.ContainsKey(attacker)))
            {
                int toDrain = (int)(attacker.Skills[MoveSkill].Value + attacker.Skills[SkillName.Tactics].Value + (MasteryInfo.GetMasteryLevel(attacker, SkillName.Fencing) * 40) / 3);
                toDrain /= 3;

                Server.Timer t;

                if (_Table == null)
                {
                    _Table = new Dictionary <Mobile, Timer>();
                }

                _Table[attacker] = t = new InternalTimer(this, attacker, defender, toDrain);
                t.Start();

                attacker.PrivateOverheadMessage(MessageType.Regular, 1150, 1155993, attacker.NetState); // You deliver a piercing blow!
                defender.FixedEffect(0x36BD, 20, 10, 2725, 5);

                int drain = (int)(defender.StamMax * (toDrain / 100.0));

                BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.Pierce, 1155994, 1155995, TimeSpan.FromSeconds(10), defender, (drain / 7).ToString()));
                //-~1_VAL~ Stamina Regeneration.
            }
            else
            {
                attacker.SendLocalizedMessage(1095215); // Your target is already under the effect of this attack.
            }
        }
예제 #10
0
 public int GetMasteryLevel()
 {
     return(Math.Max(Caster is BaseCreature ? 1 : 0, MasteryInfo.GetMasteryLevel(Caster, CastSkill)));
 }
예제 #11
0
 public int GetMasteryLevel()
 {
     return(Caster is BaseCreature ? 1 : MasteryInfo.GetMasteryLevel(Caster, CastSkill));
 }