예제 #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 static SkillName GetSkillForID(int spellID)
        {
            MasteryInfo info = GetInfo(spellID);

            if (info != null)
            {
                return(info.MasterySkill);
            }

            return(SkillName.Archery);
        }
예제 #3
0
        public static Volume GetVolume(int spellID, SkillName skill)
        {
            MasteryInfo info = GetInfo(spellID, skill);

            if (info != null)
            {
                return(info.Volume);
            }

            return(Volume.None);
        }
예제 #4
0
        public static int GetLocalization(int spellID, SkillName skill)
        {
            MasteryInfo info = GetInfo(spellID, skill);

            if (info != null)
            {
                return(info.NameLocalization);
            }

            return(0);
        }
예제 #5
0
        public static bool CanLearn(Mobile m, int spellID, SkillName skill)
        {
            MasteryInfo info = GetInfo(spellID, skill);

            if (info != null)
            {
                return(m.Skills[info.MasterySkill].Base >= MinSkillRequirement);
            }

            return(false);
        }
예제 #6
0
        public static int GetSpellID(SkillName name)
        {
            MasteryInfo info = Infos.FirstOrDefault(i => i.MasterySkill == name && i.Passive);

            if (info == null)
            {
                return(-1);
            }

            return(info.SpellID);
        }
예제 #7
0
        public static bool LearnMastery(Mobile m, int spellID, SkillName skill)
        {
            MasteryInfo info = GetInfo(spellID, skill);

            if (info != null && !HasLearned(m, spellID, skill))
            {
                m.Skills[info.MasterySkill].LearnMastery((int)info.Volume);
                return(true);
            }

            return(false);
        }
예제 #8
0
        public override bool CheckCast()
        {
            int mana = ScaleMana(RequiredMana);

            if (!base.CheckCast())
            {
                return(false);
            }

            if (IsInCooldown(Caster, this.GetType()))
            {
                return(false);
            }

            if (Caster.Player && Caster.Skills[CastSkill].Value < RequiredSkill)
            {
                Caster.SendLocalizedMessage(1115709); // Your skills are not high enough to invoke this mastery ability.
            }
            else if (Caster is PlayerMobile && Caster.Skills.CurrentMastery != CastSkill)
            {
                Caster.SendLocalizedMessage(1115664); // You are not on the correct path for using this mastery ability.
            }
            else if (Caster is PlayerMobile && !MasteryInfo.HasLearned(Caster, CastSkill))
            {
                Caster.SendLocalizedMessage(1115664); // You are not on the correct path for using this mastery ability.
            }
            else if (Caster.Mana < mana)
            {
                Caster.SendLocalizedMessage(1060174, mana.ToString()); // You must have at least ~1_MANA_REQUIREMENT~ Mana to use this ability.
            }
            else
            {
                if (CancelsWeaponAbility)
                {
                    WeaponAbility.ClearCurrentAbility(Caster);
                }

                if (CancelsSpecialMove)
                {
                    SpecialMove.ClearCurrentMove(Caster);
                }

                return(true);
            }

            return(false);
        }
예제 #9
0
        public static PassiveSpell GetActivePassive(Mobile m)
        {
            if (m == null || m.Skills == null || Infos == null)
            {
                return(PassiveSpell.None);
            }

            SkillName mastery = m.Skills.CurrentMastery;

            MasteryInfo info = Infos.FirstOrDefault(i => i.Passive && i.MasterySkill == mastery && i.PassiveSpell != PassiveSpell.AnticipateHit);

            if (info != null)
            {
                return(info.PassiveSpell);
            }

            return(PassiveSpell.None);
        }
예제 #10
0
        public ChooseTrainingGump(Mobile caster, BaseCreature target, CombatTrainingSpell spell) : base(100, 100)
        {
            Spell  = spell;
            Caster = caster;
            Target = target;

            AddBackground(0, 0, 260, 187, 3600);
            AddAlphaRegion(10, 10, 240, 167);

            AddImageTiled(220, 15, 30, 162, 10464);

            AddHtmlLocalized(20, 20, 150, 16, 1156113, Hue, false, false); // Select Training

            int y = 40;

            if (MasteryInfo.HasLearned(caster, SkillName.AnimalTaming, 1))
            {
                AddButton(20, y, 9762, 9763, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(43, y, 150, 16, 1156109, Hue, false, false); // Empowerment
                y += 20;
            }

            if (MasteryInfo.HasLearned(caster, SkillName.AnimalTaming, 2))
            {
                AddButton(20, y, 9762, 9763, 2, GumpButtonType.Reply, 0);
                AddHtmlLocalized(43, y, 150, 16, 1153271, Hue, false, false); // Berserk
                y += 20;
            }

            if (MasteryInfo.HasLearned(caster, SkillName.AnimalTaming, 3))
            {
                AddButton(20, y, 9762, 9763, 3, GumpButtonType.Reply, 0);
                AddHtmlLocalized(43, y, 150, 16, 1156108, Hue, false, false); // Consume Damage
                y += 20;
            }

            if (MasteryInfo.HasLearned(caster, SkillName.AnimalTaming, 1))
            {
                AddButton(20, y, 9762, 9763, 4, GumpButtonType.Reply, 0);
                AddHtmlLocalized(43, y, 150, 16, 1157544, Hue, false, false); // As One
                y += 20;
            }
        }
예제 #11
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);
                }
            }
        }
예제 #12
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);
        }
예제 #13
0
        public static int GetSpellID(SkillName name)
        {
            MasteryInfo info = null;

            for (var index = 0; index < Infos.Count; index++)
            {
                var i = Infos[index];

                if (i.MasterySkill == name && i.Passive)
                {
                    info = i;
                    break;
                }
            }

            if (info == null)
            {
                return(-1);
            }

            return(info.SpellID);
        }
예제 #14
0
        public override void OnHit(Mobile defender, ref int damage)
        {
            BaseWeapon weapon = GetWeapon();

            if (!CheckWeapon())
            {
                return;
            }

            Poison p = weapon.Poison;

            if (p == null || weapon.PoisonCharges <= 0)
            {
                Caster.SendLocalizedMessage(1061141); // Your weapon must have a dose of poison to perform an infectious strike!
                return;
            }

            // Skill Masteries
            int noChargeChance = MasteryInfo.NonPoisonConsumeChance(Caster);

            if (noChargeChance > 0 && noChargeChance < Utility.Random(100))
            {
                --weapon.PoisonCharges;
            }
            else
            {
                Caster.SendLocalizedMessage(1156095); // Your mastery of poisoning allows you to use your poison charge without consuming it.
            }
            int maxLevel = Caster.Skills[SkillName.Poisoning].Fixed / 200;

            if (maxLevel < 0)
            {
                maxLevel = 0;
            }

            #region Mondain's Legacy
            if (p == Poison.DarkGlow)
            {
                p = Poison.GetPoison(10 + Math.Min(maxLevel, 2));
            }
            else if (p == Poison.Parasitic)
            {
                p = Poison.GetPoison(14 + Math.Min(maxLevel, 3));
            }
            else if (p.Level > maxLevel)
            {
                p = Poison.GetPoison(maxLevel);
            }
            #endregion

            if ((Caster.Skills[SkillName.Poisoning].Value / 100.0) > Utility.RandomDouble())
            {
                int    level     = p.Level + 1;
                Poison newPoison = Poison.GetPoison(level);

                if (newPoison != null)
                {
                    p = newPoison;

                    Caster.SendLocalizedMessage(1060080);   // Your precise strike has increased the level of the poison by 1
                    defender.SendLocalizedMessage(1060081); // The poison seems extra effective!
                }
            }

            defender.PlaySound(0xDD);
            defender.FixedParticles(0x3728, 244, 25, 9941, 1266, 0, EffectLayer.Waist);

            if (defender.ApplyPoison(Caster, p) != ApplyPoisonResult.Immune)
            {
                Caster.SendLocalizedMessage(1008096, true, defender.Name);  // You have poisoned your target :
                defender.SendLocalizedMessage(1008097, false, Caster.Name); //  : poisoned you!
            }

            int malus = (int)(BaseSkillBonus / 4);
            if (defender is PlayerMobile)
            {
                malus /= 2;
            }

            ResistanceMod mod = new ResistanceMod(ResistanceType.Poison, -malus);
            defender.AddResistanceMod(mod);

            BuffInfo.AddBuff(defender, new BuffInfo(BuffIcon.InjectedStrikeDebuff, 1155927, BuffInfo.Blank, ""));

            Server.Timer.DelayCall(TimeSpan.FromSeconds(4), () =>
            {
                defender.RemoveResistanceMod(mod);
                BuffInfo.RemoveBuff(defender, BuffIcon.InjectedStrikeDebuff);
            });

            Expire();
        }
예제 #15
0
 public int GetMasteryLevel()
 {
     return(Caster is BaseCreature ? 1 : MasteryInfo.GetMasteryLevel(Caster, CastSkill));
 }
예제 #16
0
 public int GetMasteryLevel()
 {
     return(Math.Max(Caster is BaseCreature ? 1 : 0, MasteryInfo.GetMasteryLevel(Caster, CastSkill)));
 }
예제 #17
0
        public static bool HasLearned(Mobile m, Type spell, SkillName skill)
        {
            MasteryInfo info = GetInfo(spell, skill);

            return(info != null && m.Skills[info.MasterySkill].HasLearnedMastery());
        }
예제 #18
0
        public static bool HasLearned(Mobile m, int spellID, SkillName skill)
        {
            MasteryInfo info = GetInfo(spellID, skill);

            return(info != null && m.Skills[skill].HasLearnedMastery((int)info.Volume));
        }
예제 #19
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);
            }
        }
예제 #20
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);
        }
예제 #21
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.
            }
        }
예제 #22
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);
        }
예제 #23
0
 public int GetMasteryLevel()
 {
     return((int)MasteryInfo.GetMasteryLevel(Caster, CastSkill));
 }
예제 #24
0
        public static int GetAttributeBonus(Mobile m, AosAttribute attr)
        {
            int value = 0;
            SkillMasterySpell spell = null;

            switch (attr)
            {
            case AosAttribute.AttackChance:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(InspireSpell));
                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }

                spell = SkillMasterySpell.GetSpellForParty(m, typeof(TribulationSpell));
                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }

                value += FocusedEyeSpell.HitChanceBonus(m);
                value += PlayingTheOddsSpell.HitChanceBonus(m);
                value += CalledShotSpell.GetHitChanceBonus(m);
                value += CombatTrainingSpell.GetHitChanceBonus(m);

                value += MasteryInfo.SavingThrowChance(m, attr);
                break;

            case AosAttribute.DefendChance:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(PerseveranceSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }

                if (Server.Spells.SkillMasteries.WhiteTigerFormSpell.IsActive(m))
                {
                    value += 20;
                }

                value += MasteryInfo.SavingThrowChance(m, attr);
                break;

            case AosAttribute.RegenHits:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(ResilienceSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }
                break;

            case AosAttribute.RegenStam:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(ResilienceSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }
                break;

            case AosAttribute.RegenMana:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(ResilienceSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }
                break;

            case AosAttribute.WeaponDamage:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(InspireSpell));

                if (spell != null)
                {
                    value += spell.DamageBonus();
                }

                value += MasteryInfo.SavingThrowChance(m, attr);
                break;

            case AosAttribute.SpellDamage:
                spell = SkillMasterySpell.GetSpellForParty(m, typeof(InspireSpell));

                if (spell != null)
                {
                    value += spell.PropertyBonus();
                }
                break;

            case AosAttribute.WeaponSpeed:
                value += RampageSpell.GetBonus(m, RampageSpell.BonusType.SwingSpeed);
                value += PlayingTheOddsSpell.SwingSpeedBonus(m);
                value -= StaggerSpell.GetStagger(m);
                break;

            case AosAttribute.BonusStr:
                value += MasteryInfo.SavingThrowChance(m, attr);
                break;
            }

            return(value);
        }
예제 #25
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);
                });
            }
        }