Ejemplo n.º 1
0
        public static Spell GetSpellBeneficial3to5(BaseCreature creature, Mobile target)
        {
            Spell spell = null;

            if (creature == null || target == null)
            {
                return(spell);
            }

            creature.SpellTarget = target;

            List <Spell> m_ValidSpells = new List <Spell>();

            if (target.GetStatMod("[Magic] Str Offset") == null || target.GetStatMod("[Magic] Dex Offset") == null || target.GetStatMod("[Magic] Int Offset") == null)
            {
                m_ValidSpells.Add(new BlessSpell(creature, null));
            }

            if (target.MagicDamageAbsorb <= 0)
            {
                m_ValidSpells.Add(new MagicReflectSpell(creature, null));
            }

            if (m_ValidSpells.Count > 0)
            {
                return(m_ValidSpells[Utility.RandomMinMax(0, m_ValidSpells.Count - 1)]);
            }

            return(spell);
        }
Ejemplo n.º 2
0
        public static bool CanDoCombatSpellSpellBeneficial3to5(BaseCreature creature, Mobile target)
        {
            if (target == null)
            {
                return(false);
            }

            if (DateTime.UtcNow < creature.NextSpellTime)
            {
                return(false);
            }

            if (creature.DictCombatSpell[CombatSpell.SpellBeneficial3to5] > 0)
            {
                if (creature.InLOS(target) && SpellInDefaultRange(creature, target) && creature.Mana >= 14)
                {
                    if (target.GetStatMod("[Magic] Str Offset") == null || target.GetStatMod("[Magic] Dex Offset") == null || target.GetStatMod("[Magic] Int Offset") == null)
                    {
                        return(true);
                    }

                    if (target.MagicDamageAbsorb <= 0)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 3
0
        public static bool AddStatCurse(Mobile caster, Mobile target, StatType type, int curse, TimeSpan duration)
        {
            int    offset = -curse;
            string name   = "Malédiction";

            StatMod mod = target.GetStatMod(name);

            if (mod != null && (mod.Type == type && mod.Offset < offset || mod.Type != type))
            {
                target.RemoveStatMod(name);
                target.AddStatMod(new StatMod(type, name, offset, duration));
                target.SendMessage("Vous sentez une nouvelle force vous tourmenter, supplantant la précédente.");
                return(true);
            }
            else if (mod == null)
            {
                mod = target.GetStatMod("Bénédiction");
                if (mod != null && mod.Type == type)
                {
                    target.RemoveStatMod(name);
                    target.SendMessage("Vous sentez une force vous tourmenter, écrasant les forces bénéfiques en vous.");
                    return(true);
                }
                else if (mod == null)
                {
                    target.SendMessage("Vous sentez une force vous tourmenter.");
                    target.AddStatMod(new StatMod(type, name, offset, duration));
                    return(true);
                }
            }

            target.SendMessage("Étant sous l'effet d'un pouvoir plus grand, celui-ci demeure sans effet.");
            return(false);
        }
Ejemplo n.º 4
0
 public override void Drink(Mobile m)
 {
     if (m.InRange(this.GetWorldLocation(), 1))
     {
         string  modName = m.Serial.ToString();
         StatMod smod    = m.GetStatMod("Str");
         StatMod dmod    = m.GetStatMod("Dex");
         StatMod imod    = m.GetStatMod("Int");
         if (smod != null && imod != null && dmod != null)
         {
             m.SendMessage("You appear to be under a similar effect!");
         }
         else if (smod == null && imod == null && dmod == null)
         {
             m.AddStatMod(new StatMod(StatType.Int, modName + "Int", 10, TimeSpan.FromMinutes(5)));
             m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", 10, TimeSpan.FromMinutes(5)));
             m.AddStatMod(new StatMod(StatType.Str, modName + "Str", 10, TimeSpan.FromMinutes(5)));
             m.Hits = m.HitsMax;
             m.Mana = m.ManaMax;
             m.Stam = m.StamMax;
             BasePotion.PlayDrinkEffect(m);
             this.Consume();
             m.SendMessage("You feel much more superior!");
         }
     }
     else
     {
         m.LocalOverheadMessage(MessageType.Regular, 906, 1019045);                   // I can't reach that.
     }
 }
Ejemplo n.º 5
0
        public BuffType GetRandomBuff(Mobile target)
        {
            List <BuffType> buffs = new List <BuffType>();

            if (MagicReflectSpell.HasReflect(target))
            {
                buffs.Add(BuffType.MagicReflect);
            }

            if (ReactiveArmorSpell.HasArmor(target))
            {
                buffs.Add(BuffType.ReactiveArmor);
            }

            if (ProtectionSpell.HasProtection(target))
            {
                buffs.Add(BuffType.Protection);
            }

            TransformContext context = TransformationSpellHelper.GetContext(target);

            if (context != null && context.Type != typeof(AnimalForm))
            {
                buffs.Add(BuffType.Transformation);
            }

            StatMod mod = target.GetStatMod("[Magic] Str Offset");

            if (mod != null && mod.Offset > 0)
            {
                buffs.Add(BuffType.StrBonus);
            }

            mod = target.GetStatMod("[Magic] Dex Offset");
            if (mod != null && mod.Offset > 0)
            {
                buffs.Add(BuffType.DexBonus);
            }

            mod = target.GetStatMod("[Magic] Int Offset");
            if (mod != null && mod.Offset > 0)
            {
                buffs.Add(BuffType.IntBonus);
            }

            if (buffs.Count == 0)
            {
                return(BuffType.None);
            }

            BuffType type = buffs[Utility.Random(buffs.Count)];

            buffs.Clear();

            return(type);
        }
Ejemplo n.º 6
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (m is BaseCreature && ((BaseCreature)m).IsAnimatedDead)
            {
                Caster.SendLocalizedMessage(1061654);                   // You cannot heal that which is not alive.
            }
            else if (m.IsDeadBondedPet)
            {
                Caster.SendLocalizedMessage(1060177);                   // You cannot heal a creature that is already dead!
            }
            else if (CheckBSequence(m, false))
            {
                SpellHelper.Turn(Caster, m);

                m.FixedParticles(0x376A, 9, 32, 5030, EffectLayer.Waist);
                m.PlaySound(0x202);

                StatMod mod;

                mod = m.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Str Offset");
                }

                mod = m.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Dex Offset");
                }

                mod = m.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Int Offset");
                }

                m.Paralyzed = false;
                m.CurePoison(Caster);

                int toHeal = (int)(Caster.Skills[SkillName.AnimalTaming].Value) + (int)(Caster.Skills[SkillName.AnimalLore].Value);
                SpellHelper.Heal(toHeal, m, Caster);

                EvilOmenSpell.TryEndEffect(m);
                StrangleSpell.RemoveCurse(m);
                CorpseSkinSpell.RemoveCurse(m);
            }

            FinishSequence();
        }
Ejemplo n.º 7
0
        public static void StopTimer(Mobile m)
        {
            if (!m.CanBeginAction(typeof(MetamorphoseSpell)))
            {
                if (m is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)m;
                    pm.Transformation.OnTransformationChange(0, null, -1, true);
                }
                else
                {
                    m.BodyMod = 0;
                    m.NameMod = null;
                    m.HueMod  = -1;
                }

                m.EndAction(typeof(MetamorphoseSpell));

                if (m is PlayerMobile)
                {
                    ((PlayerMobile)m).CheckRaceSkin();
                }

                BaseArmor.ValidateMobile(m);

                Effects.SendTargetParticles(m, 0x373A, 10, 15, 5036, EffectLayer.Head);
                m.PlaySound(0x3BD);

                string  name = String.Format("[Transformation] {0} Offset", StatType.Str);
                StatMod mod  = m.GetStatMod(name);

                if (mod != null)
                {
                    m.RemoveStatMod(name);
                }

                name = String.Format("[Transformation] {0} Offset", StatType.Dex);
                mod  = m.GetStatMod(name);

                if (mod != null)
                {
                    m.RemoveStatMod(name);
                }

                name = String.Format("[Transformation] {0} Offset", StatType.Int);
                mod  = m.GetStatMod(name);

                if (mod != null)
                {
                    m.RemoveStatMod(name);
                }
            }
        }
Ejemplo n.º 8
0
        public Spell CheckCurse()
        {
            Mobile foe = this.m_Mobile.Combatant as Mobile;

            if (foe == null)
            {
                return(null);
            }

            StatMod mod = foe.GetStatMod("[Magic] Int Curse");

            if (mod != null)
            {
                return(null);
            }

            if (this.m_Mobile.Skills[SkillName.Magery].Value >= 40.0)
            {
                return(new CurseSpell(this.m_Mobile, null));
            }

            int   whichone = 1;
            Spell spell    = null;

            if ((mod = foe.GetStatMod("[Magic] Str Curse")) != null)
            {
                whichone++;
            }

            if ((mod = this.m_Mobile.GetStatMod("[Magic] Dex Curse")) != null)
            {
                whichone++;
            }

            switch (whichone)
            {
            case 1:
                spell = new FeeblemindSpell(this.m_Mobile, null);
                break;

            case 2:
                spell = new WeakenSpell(this.m_Mobile, null);
                break;

            case 3:
                spell = new ClumsySpell(this.m_Mobile, null);
                break;
            }

            return(spell);
        }
Ejemplo n.º 9
0
        }// A tasty bite of the enchanted apple lifts all curses from your soul.
        public override bool Eat(Mobile from)
        {
            if (base.Eat(from))
            {
                from.PlaySound(0xF6);
                from.PlaySound(0x1F7);
                from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                IEntity mfrom = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z - 10), from.Map);
                IEntity mto   = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);
                Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                StatMod mod;

                mod = from.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                {
                    from.RemoveStatMod("[Magic] Str Offset");
                }

                mod = from.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                {
                    from.RemoveStatMod("[Magic] Dex Offset");
                }

                mod = from.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                {
                    from.RemoveStatMod("[Magic] Int Offset");
                }

                from.Paralyzed = false;
                from.Asleep    = false;

                EvilOmenSpell.TryEndEffect(from);
                StrangleSpell.RemoveCurse(from);
                CorpseSkinSpell.RemoveCurse(from);
                CurseSpell.RemoveEffect(from);

                BuffInfo.RemoveBuff(from, BuffIcon.Clumsy);
                BuffInfo.RemoveBuff(from, BuffIcon.FeebleMind);
                BuffInfo.RemoveBuff(from, BuffIcon.Weaken);
                BuffInfo.RemoveBuff(from, BuffIcon.MassCurse);

                return(true);
            }

            return(false);
        }
Ejemplo n.º 10
0
        public void Target(Mobile m)
        {
            if (!Caster.CanSee(m))
            {
                Caster.SendLocalizedMessage(500237);                   // Target can not be seen.
            }
            else if (CheckBSequence(m, false))
            {
                SpellHelper.Turn(Caster, m);

                m.PlaySound(0xF6);
                m.PlaySound(0x1F7);
                m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                IEntity from = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), Caster.Map);
                IEntity to   = new Entity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), Caster.Map);
                Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                StatMod mod;

                mod = m.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Str Offset");
                }

                mod = m.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Dex Offset");
                }

                mod = m.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod("[Magic] Int Offset");
                }

                m.Paralyzed = false;
                m.CurePoison(Caster);

                EvilOmenSpell.CheckEffect(m);
                StrangleSpell.RemoveCurse(m);
                CorpseSkinSpell.RemoveCurse(m);
            }

            FinishSequence();
        }
Ejemplo n.º 11
0
        public static void StompAttack(Mobile target)
        {
            StatType type;

            if (target.GetStatMod("[Stomp Attack]") != null)
            {
                return;
            }

            switch (Utility.Random(3))
            {
            default:
            case 0:
                type = StatType.Str;
                break;

            case 1:
                type = StatType.Dex;
                break;

            case 2:
                type = StatType.Int;
                break;
            }

            string name = "[Stomp Attack]";

            int offset = 10 + Utility.Random(10);

            int duration = 60 + Utility.Random(60);

            target.AddStatMod(new StatMod(type, name, -offset, TimeSpan.FromSeconds(duration)));
        }
Ejemplo n.º 12
0
        public static bool RemoveStatCurse(Mobile m, StatType type)
        {
            if (type == StatType.All)
            {
                var success = RemoveStatCurse(m, StatType.Str);
                success = RemoveStatCurse(m, StatType.Dex) || success;
                success = RemoveStatCurse(m, StatType.Int) || success;
                return(success);
            }

#if ServUO
            var name = String.Format("[Magic] {0} Curse", type);
#else
            var name = String.Format("[Magic] {0} Offset", type);
#endif

            var mod = m.GetStatMod(name);

            if (mod != null && mod.Offset <= 0)
            {
                m.RemoveStatMod(mod.Name);
                return(true);
            }

            return(false);
        }
Ejemplo n.º 13
0
        public override bool Use(Mobile from)
        {
            if (from.GetStatMod("blood-rose") == null)
            {
                from.PlaySound(Utility.Random(0x3A, 3));

                if (from.Body.IsHuman && !from.Mounted)
                {
                    from.Animate(34, 5, 1, true, false, 0);
                }

                int amount = Utility.Dice(3, 3, 3);
                int time   = Utility.RandomMinMax(5, 30);

                from.FixedParticles(0x373A, 10, 15, 5018, EffectLayer.Waist);

                from.PlaySound(0x1EE);
                from.AddStatMod(new StatMod(StatType.All, "blood-rose", amount, TimeSpan.FromMinutes(time)));

                return(true);
            }
            else
            {
                from.SendLocalizedMessage(1062927); // You have eaten one of these recently and eating another would provide no benefit.

                return(false);
            }
        }
Ejemplo n.º 14
0
        public static bool AddStatCurse(Mobile caster, Mobile target, StatType type, int curse, TimeSpan duration)
        {
            int    offset = -curse;
            string name   = String.Format("[Magic] {0} Offset", type);

            StatMod mod = target.GetStatMod(name);

            if (mod != null && mod.Offset > 0)
            {
                if (target.Spell is MagerySpell && ((MagerySpell)target.Spell).State == SpellState.Casting)
                {
                    ((MagerySpell)target.Spell).OnCasterHurt(1);
                }
                target.AddStatMod(new StatMod(type, name, mod.Offset + offset, duration));
                return(true);
            }
            else if (mod == null || mod.Offset > offset)
            {
                if (target.Spell is MagerySpell && ((MagerySpell)target.Spell).State == SpellState.Casting)
                {
                    ((MagerySpell)target.Spell).OnCasterHurt(1);
                }
                target.AddStatMod(new StatMod(type, name, offset, duration));
                return(true);
            }

            return(false);
        }
Ejemplo n.º 15
0
        public static bool AddStatCurse(Mobile caster, Mobile target, StatType type, int curse, TimeSpan duration)
        {
            if (type == StatType.All)
            {
                var success = AddStatCurse(caster, target, StatType.Str, curse, duration);
                success = AddStatCurse(caster, target, StatType.Dex, curse, duration) || success;
                success = AddStatCurse(caster, target, StatType.Int, curse, duration) || success;
                return(success);
            }

            var offset = -curse;

#if ServUO
            var name = String.Format("[Magic] {0} Curse", type);
#else
            var name = String.Format("[Magic] {0} Offset", type);
#endif

            var mod = target.GetStatMod(name);

            if (mod != null && mod.Offset > 0)
            {
                target.AddStatMod(new StatMod(type, name, mod.Offset + offset, duration));
                return(true);
            }

            if (mod == null || mod.Offset > offset)
            {
                target.AddStatMod(new StatMod(type, name, offset, duration));
                return(true);
            }

            return(false);
        }
Ejemplo n.º 16
0
        public int GetStatMod(Mobile mob, StatType type)
        {
            int     offset = 0;
            StatMod buff   = mob.GetStatMod(String.Format("[Magic] {0} Buff", type));
            StatMod curse  = mob.GetStatMod(String.Format("[Magic] {0} Curse", type));

            if (buff != null)
            {
                offset += buff.Offset;
            }
            if (curse != null)
            {
                offset += curse.Offset;
            }

            return(offset);
        }
Ejemplo n.º 17
0
        public static bool CanDoCombatSpellSpellBeneficial1to2(BaseCreature creature, Mobile target)
        {
            if (target == null)
            {
                return(false);
            }

            if (DateTime.UtcNow < creature.NextSpellTime)
            {
                return(false);
            }

            if (creature.DictCombatSpell[CombatSpell.SpellBeneficial1to2] > 0)
            {
                if (creature.InLOS(target) && SpellInDefaultRange(creature, target) && creature.Mana >= 6)
                {
                    if (target.GetStatMod("[Magic] Str Offset") == null)
                    {
                        return(true);
                    }

                    if (target.GetStatMod("[Magic] Dex Offset") == null)
                    {
                        return(true);
                    }

                    if (target.GetStatMod("[Magic] Int Offset") == null)
                    {
                        return(true);
                    }

                    if (Spells.Second.ProtectionSpell.Registry.Contains(target) == false)
                    {
                        return(true);
                    }

                    if (target.MeleeDamageAbsorb <= 0)
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Ejemplo n.º 18
0
        public static Spell GetSpellBeneficial1to2(BaseCreature creature, Mobile target)
        {
            Spell spell = null;

            if (creature == null || target == null)
            {
                return(spell);
            }

            creature.SpellTarget = target;

            List <Spell> m_ValidSpells = new List <Spell>();

            if (target.GetStatMod("[Magic] Str Offset") == null)
            {
                m_ValidSpells.Add(new StrengthSpell(creature, null));
            }

            if (target.GetStatMod("[Magic] Dex Offset") == null)
            {
                m_ValidSpells.Add(new AgilitySpell(creature, null));
            }

            if (target.GetStatMod("[Magic] Int Offset") == null)
            {
                m_ValidSpells.Add(new CunningSpell(creature, null));
            }

            if (Spells.Second.ProtectionSpell.Registry.Contains(target) == false)
            {
                m_ValidSpells.Add(new ProtectionSpell(creature, null));
            }

            if (target.MeleeDamageAbsorb <= 0)
            {
                m_ValidSpells.Add(new ReactiveArmorSpell(creature, null));
            }

            if (m_ValidSpells.Count > 0)
            {
                return(m_ValidSpells[Utility.RandomMinMax(0, m_ValidSpells.Count - 1)]);
            }

            return(spell);
        }
Ejemplo n.º 19
0
        public override void OnGaveMeleeAttack(Mobile defender)
        {
            base.OnGaveMeleeAttack(defender);//encounter during fight

            if (0.2 > Utility.RandomDouble() && defender.GetStatMod("Niporailem Str Curse") == null)
            {
                defender.AddStatMod(new StatMod(StatType.Str, "Niporailem Str Curse", -30, TimeSpan.FromSeconds(15.0)));
            }
        }
Ejemplo n.º 20
0
        }// A tasty bite of the enchanted apple lifts all curses from your soul.
        public override bool Eat(Mobile from)
        {
            if (base.Eat(from))
            {
                from.PlaySound(0xF6);
                from.PlaySound(0x1F7);
                from.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

                IEntity mfrom = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z - 10), from.Map);
                IEntity mto = new Entity(Serial.Zero, new Point3D(from.X, from.Y, from.Z + 50), from.Map);
                Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

                StatMod mod;

                mod = from.GetStatMod("[Magic] Str Offset");
                if (mod != null && mod.Offset < 0)
                    from.RemoveStatMod("[Magic] Str Offset");

                mod = from.GetStatMod("[Magic] Dex Offset");
                if (mod != null && mod.Offset < 0)
                    from.RemoveStatMod("[Magic] Dex Offset");

                mod = from.GetStatMod("[Magic] Int Offset");
                if (mod != null && mod.Offset < 0)
                    from.RemoveStatMod("[Magic] Int Offset");

                from.Paralyzed = false;
                from.Asleep = false;

                EvilOmenSpell.TryEndEffect(from);
                StrangleSpell.RemoveCurse(from);
                CorpseSkinSpell.RemoveCurse(from);
                CurseSpell.RemoveEffect(from);

                BuffInfo.RemoveBuff(from, BuffIcon.Clumsy);
                BuffInfo.RemoveBuff(from, BuffIcon.FeebleMind);
                BuffInfo.RemoveBuff(from, BuffIcon.Weaken);
                BuffInfo.RemoveBuff(from, BuffIcon.MassCurse);	
				
                return true;
            }
			
            return false;
        }
Ejemplo n.º 21
0
        public static void DoRemoveCurses(Mobile m)
        {
            StatMod mod;

            mod = m.GetStatMod("[Magic] Str Malus");
            if (mod != null && mod.Offset < 0)
            {
                m.RemoveStatMod("[Magic] Str Malus");
            }

            mod = m.GetStatMod("[Magic] Dex Malus");
            if (mod != null && mod.Offset < 0)
            {
                m.RemoveStatMod("[Magic] Dex Malus");
            }

            mod = m.GetStatMod("[Magic] Int Malus");
            if (mod != null && mod.Offset < 0)
            {
                m.RemoveStatMod("[Magic] Int Malus");
            }

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.EndEffect(m);
            SpellPlagueSpell.RemoveEffect(m);

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);

            // TODO: Should this remove blood oath? Pain spike?
        }
Ejemplo n.º 22
0
        public void Target( Mobile m )
        {
            if ( !Caster.CanSee( m ) )
            {
                Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
            }
            else if ( CheckBSequence( m, false ) )
            {
                SpellHelper.Turn( Caster, m );

                m.PlaySound( 0xF6 );
                m.PlaySound( 0x1F7 );
                m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );

                IEntity from = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 10 ), Caster.Map );
                IEntity to = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 50 ), Caster.Map );
                Effects.SendMovingParticles( from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );

                StatMod mod;

                mod = m.GetStatMod( "[Magic] Str Offset" );
                if ( mod != null && mod.Offset < 0 )
                    m.RemoveStatMod( "[Magic] Str Offset" );

                mod = m.GetStatMod( "[Magic] Dex Offset" );
                if ( mod != null && mod.Offset < 0 )
                    m.RemoveStatMod( "[Magic] Dex Offset" );

                mod = m.GetStatMod( "[Magic] Int Offset" );
                if ( mod != null && mod.Offset < 0 )
                    m.RemoveStatMod( "[Magic] Int Offset" );

                m.Paralyzed = false;
                m.CurePoison( Caster );

                EvilOmenSpell.CheckEffect( m );
                StrangleSpell.RemoveCurse( m );
                CorpseSkinSpell.RemoveCurse( m );
            }

            FinishSequence();
        }
Ejemplo n.º 23
0
        public int GetStatMod(Mobile mob, StatType type)
        {
            StatMod mod = mob.GetStatMod(String.Format("[Magic] {0} Malus", type));

            if (mod == null)
            {
                return(0);
            }

            return(mod.Offset);
        }
Ejemplo n.º 24
0
        public static bool HasStatEffect(Mobile target, StatType type)
        {
            if (type == StatType.All)
            {
                return(HasStatEffect(target, StatType.Dex) && HasStatEffect(target, StatType.Int) && HasStatEffect(target, StatType.Str));
            }
            else
            {
                StatMod mod = target.GetStatMod(String.Format("[Magic] {0} Offset", type));

                return(mod != null);
            }
        }
Ejemplo n.º 25
0
        public static void RemoveCurses(Mobile m)
        {
            // play the sound
            m.PlaySound(0xF6);
            m.PlaySound(0x1F7);

            // do the effects
            m.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head);

            IEntity from = new DummyEntity(Serial.Zero, new Point3D(m.X, m.Y, m.Z - 10), m.Map);
            IEntity to   = new DummyEntity(Serial.Zero, new Point3D(m.X, m.Y, m.Z + 50), m.Map);

            Effects.SendMovingParticles(from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100);

            // remove stat mods
            StatMod mod;

            foreach (string statModName in StatModNames)
            {
                mod = m.GetStatMod(statModName);
                if (mod != null && mod.Offset < 0)
                {
                    m.RemoveStatMod(statModName);
                }
            }

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect(m);
            StrangleSpell.RemoveCurse(m);
            CorpseSkinSpell.RemoveCurse(m);
            CurseSpell.RemoveEffect(m);
            MortalStrike.EndWound(m);
            BloodOathSpell.EndEffect(m);
            SpellPlagueSpell.RemoveEffect(m);
            SleepSpell.RemoveEffect(m);
            MindRotSpell.ClearMindRotScalar(m);

            BuffInfo.RemoveBuff(m, BuffIcon.Clumsy);
            BuffInfo.RemoveBuff(m, BuffIcon.FeebleMind);
            BuffInfo.RemoveBuff(m, BuffIcon.Weaken);
            BuffInfo.RemoveBuff(m, BuffIcon.MassCurse);
            BuffInfo.RemoveBuff(m, BuffIcon.Curse);
            BuffInfo.RemoveBuff(m, BuffIcon.EvilOmen);
            BuffInfo.RemoveBuff(m, BuffIcon.MortalStrike);
            BuffInfo.RemoveBuff(m, BuffIcon.Sleep);
            BuffInfo.RemoveBuff(m, BuffIcon.MassSleep);
            BuffInfo.RemoveBuff(m, BuffIcon.Mindrot);
        }
Ejemplo n.º 26
0
        public override void OnHit(Mobile attacker, Mobile defender)
        {
            base.OnHit(attacker, defender);

            /* Publish 5
             * Two-handed Weapons
             * Any melee weapon that requires two hands to wield will gain a special attack. The type of special attack will depend on the type of weapon used. These special attacks will only work against player characters, not against monsters or animals.
             * Mace Weapon: Crushing blow, a hit for double damage. Only applies to true maces, not staves.
             * Sword Weapon: Concussion blow, victim’s intelligence is halved for 30 seconds. Note the effects of a concussion blow are not cumulative, once a target is the victim of a concussion blow, they cannot be hit in that manner again for 30 seconds.
             * Fencing Weapon: Paralyzing blow, victim is paralyzed for 4 seconds. Once paralyzed, the victim cannot fight back (s/he wont auto-defend) or cast spells, however s/he can still use potions and bandages. The paralysis will not break by any means, even if the victim takes damage. Once paralyzed, the victim cannot be paralyzed again with another special attack until the paralysis wears off.
             * Upon a successful hit, there will be a small chance to inflict one of the special attacks. The base chance to inflict one of the special attacks is 20%. A high intelligence will give a small bonus towards the chance to execute a special attack up to a total chance of 30%.
             */

            // old runuo test.. I don't think it's right.
            // if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble())

            // these publishes don't have random special moves
            if (Core.UOAI || Core.UOAR || Core.UOMO || Core.AOS || Core.Publish >= 18)
            {
                return;
            }

            // humanoids can use the moves I guess, but only on players.
            if (!((attacker.Player || attacker.Body.IsHuman) && defender.Player && Layer == Layer.TwoHanded))
            {
                return;
            }

            // calc the chance: anat bonus max 20% + int bonue max 10% = max total bonus 30%
            double chance = (attacker.Skills[SkillName.Anatomy].Value / 500.0) + (attacker.Int / 1000.0);

            if (chance >= Utility.RandomDouble())
            {
                StatMod mod = defender.GetStatMod("Concussion");

                if (mod == null)
                {
                    defender.SendMessage("You receive a concussion blow!");
                    defender.AddStatMod(new StatMod(StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds(30.0)));

                    attacker.SendMessage("You deliver a concussion blow!");
                    attacker.PlaySound(0x308);
                }
            }
        }
Ejemplo n.º 27
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042038);                   // You must have the object in your backpack to use it.
            }
            else if (from.GetStatMod("RoseOfTrinsicPetal") != null)
            {
                from.SendLocalizedMessage(1062927);                   // You have eaten one of these recently and eating another would provide no benefit.
            }
            else
            {
                from.PlaySound(0x1EE);
                from.AddStatMod(new StatMod(StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes(5.0)));

                Consume();
            }
        }
Ejemplo n.º 28
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042038);
            }
            else if (from.GetStatMod("ChickenSoup") != null)
            {
                from.SendLocalizedMessage(1062927);                   // This gives the player the message "You have eaten one of these recently and eating another would provide no benefit."
            }
            else
            {
                from.PlaySound(0x1EE);
                from.AddStatMod(new StatMod(StatType.Str, "ChickenSoup", 5, TimeSpan.FromMinutes(5.0)));                       // this makes DantesInks give you 5 INT for 15 mins when eaten

                Consume();
            }
        }
Ejemplo n.º 29
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            base.OnHit(attacker, defender, damageBonus);

            if ((attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && attacker.Skills[SkillName.Anatomy].Value / 400.0 >= Utility.RandomDouble())
            {
                StatMod mod = defender.GetStatMod("Concussion");

                if (mod == null)
                {
                    defender.SendMessage("You receive a concussion blow!");
                    defender.AddStatMod(new StatMod(StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds(30.0)));

                    attacker.SendMessage("You deliver a concussion blow!");
                    attacker.PlaySound(0x11C);
                }
            }
        }
Ejemplo n.º 30
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            base.OnHit(attacker, defender, damageBonus);

            if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 500.0) >= Utility.RandomDouble())
            {
                StatMod mod = defender.GetStatMod("Concussion");

                if (mod == null)
                {
                    defender.SendLocalizedMessage(1060165);                       // You have delivered a concussion!
                    defender.AddStatMod(new StatMod(StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds(30.0)));

                    attacker.SendLocalizedMessage(1060165);                       // You have delivered a concussion!
                    attacker.PlaySound(0x11C);
                }
            }
        }
Ejemplo n.º 31
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            base.OnHit(attacker, defender, damageBonus);

            if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility(attacker, "Concussion Blow", false))
            {
                StatMod mod = defender.GetStatMod("Concussion");

                if (mod == null)
                {
                    defender.SendMessage("You receive a concussion blow!");
                    defender.AddStatMod(new StatMod(StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds(30.0)));

                    attacker.SendMessage("You deliver a concussion blow!");
                    attacker.PlaySound(0x308);
                }
            }
        }
Ejemplo n.º 32
0
        public bool AddStatBonus(Mobile target, int offset, StatType type, TimeSpan duration)
        {
            if (target == null)
            {
                return(false);
            }

            string name         = String.Format("[Magic] {0} Offset:item-{1}", type, this.Serial);
            string itemtypename = String.Format("[Magic] {0} Offset:item-", type);

            StatMod mod = target.GetStatMod(name);

            for (int i = 0; i < target.StatMods.Count; i++)
            {
                StatMod sm = target.StatMods[i] as StatMod;
                if (sm != null)
                {
                    if (sm.Name.IndexOf(itemtypename) == 0)
                    {
                        //found this item statmod type already - don't apply
                        return(false);
                    }
                }
            }

            // If they have a negative effect on them, replace the effect with
            // the negative effect plus the new positive effect
            if (mod != null && mod.Offset < 0)
            {
                target.AddStatMod(new StatMod(type, name, mod.Offset + offset, duration));
                return(true);
            }
            // If they have no effect or the current effect is weaker than the new effect
            // Apply the new effect
            else if (mod == null || mod.Offset < offset)
            {
                target.AddStatMod(new StatMod(type, name, offset, duration));
                return(true);
            }
            // They already have an effect equal to or greater than the new effect
            // do nothing.
            return(false);
        }
Ejemplo n.º 33
0
		public override void OnTarget( Mobile target )
		{
			if ( CheckHSequence( target ) )
			{
				if ( target.GetStatMod( "MindBlast" ) == null )
				{
					int offset = (int)(target.Skills[SkillName.Magery].Value / 2);
					offset += (int)(target.Skills[SkillName.Necromancy].Value / 2);
					offset += (int)(target.Skills[SkillName.EvalInt].Value / 4);
					offset += (int)(target.Skills[SkillName.SpiritSpeak].Value / 4);

					if ( target is PlayerMobile )
						offset /= 2;

					offset -= ((int)ScaleBySkill( target, SkillName.MagicResist )) -5;

					if ( offset < 15 )
						offset = 15;

					int duration = (int)(Caster.Skills[CastSkill].Value * 2);

					target.AddStatMod( new StatMod( StatType.Int, "MindBlast", -offset, TimeSpan.FromSeconds( duration ) ) );
					target.AddSkillMod( new TimedSkillMod( SkillName.Meditation, true, -offset, TimeSpan.FromSeconds( duration ) ) );
					target.AddSkillMod( new TimedSkillMod( SkillName.Focus, true, -offset, TimeSpan.FromSeconds( duration ) ) );

					target.SendMessage("Your mind has been blown!");

					SpellHelper.Damage( this, target, offset * 2, 0, 0, 100, 0, 0 );
				}

				target.FixedParticles( 0x374A, 10, 15, 5038, 1181, 2, EffectLayer.Head );
				target.PlaySound( 0x213 );
				BlueMageControl.CheckKnown( target, this, CanTeach( target ) );
			}

			FinishSequence();
		}
Ejemplo n.º 34
0
        public static void DoRemoveCurses( Mobile m )
        {
            StatMod mod;

            mod = m.GetStatMod( "[Magic] Str Malus" );
            if ( mod != null && mod.Offset < 0 )
                m.RemoveStatMod( "[Magic] Str Malus" );

            mod = m.GetStatMod( "[Magic] Dex Malus" );
            if ( mod != null && mod.Offset < 0 )
                m.RemoveStatMod( "[Magic] Dex Malus" );

            mod = m.GetStatMod( "[Magic] Int Malus" );
            if ( mod != null && mod.Offset < 0 )
                m.RemoveStatMod( "[Magic] Int Malus" );

            m.Paralyzed = false;

            EvilOmenSpell.CheckEffect( m );
            StrangleSpell.RemoveCurse( m );
            CorpseSkinSpell.RemoveCurse( m );
            CurseSpell.RemoveEffect( m );
            MortalStrike.EndWound( m );
            BloodOathSpell.EndEffect( m );
            SpellPlagueSpell.RemoveEffect( m );

            BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
            BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
            BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
            BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
            BuffInfo.RemoveBuff( m, BuffIcon.Curse );
            BuffInfo.RemoveBuff( m, BuffIcon.EvilOmen );
            BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );

            // TODO: Should this remove blood oath? Pain spike?
        }
Ejemplo n.º 35
0
        public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
        {
            base.OnHit(attacker, defender, damageBonus);

            if (!Core.AOS && (attacker.Player || attacker.Body.IsHuman) && this.Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() && Engines.ConPVP.DuelContext.AllowSpecialAbility(attacker, "Concussion Blow", false))
            {
                StatMod mod = defender.GetStatMod("Concussion");

                if (mod == null)
                {
                    defender.SendMessage("You receive a concussion blow!");
                    defender.AddStatMod(new StatMod(StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds(30.0)));

                    attacker.SendMessage("You deliver a concussion blow!");
                    attacker.PlaySound(0x308);
                }
            }
        }
Ejemplo n.º 36
0
		public int GetStatMod(Mobile mob, StatType type)
		{
			StatMod mod = mob.GetStatMod(String.Format("[Magic] {0} Offset", type));

			if (mod == null)
			{
				return 0;
			}

			return mod.Offset;
		}
Ejemplo n.º 37
0
        public virtual void OnHit( Mobile attacker, Mobile defender, double damageBonus )
        {
            PlayHurtAnimation( defender );

            attacker.PlaySound( GetHitAttackSound( attacker, defender ) );
            defender.PlaySound( GetHitDefendSound( attacker, defender ) );

            int damage = ComputeDamage( attacker, defender );

            if (Effect != WeaponEffect.None && Charges > 0)
            {
                #region Magic Weapon Effects
                if (Effect == WeaponEffect.Clumsy)
                {
                    string name = String.Format("[Magic] {0} Offset", StatType.Dex);
                    StatMod mod = defender.GetStatMod(name);

                    if (mod != null && mod.Offset < 0)
                        defender.AddStatMod(new StatMod(StatType.Dex, name, mod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (mod == null || mod.Offset < -10)
                        defender.AddStatMod(new StatMod(StatType.Dex, name, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head);
                    defender.PlaySound(0x1DF);
                }
                else if (Effect == WeaponEffect.Feeblemind)
                {
                    string name = String.Format("[Magic] {0} Offset", StatType.Int);
                    StatMod mod = defender.GetStatMod(name);

                    if (mod != null && mod.Offset < 0)
                        defender.AddStatMod(new StatMod(StatType.Int, name, mod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (mod == null || mod.Offset < 10)
                        defender.AddStatMod(new StatMod(StatType.Int, name, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x3779, 10, 15, 5004, EffectLayer.Head);
                    defender.PlaySound(0x1E4);
                }
                else if (Effect == WeaponEffect.MagicArrow)
                {
                    DoMagicArrow(attacker, defender);
                    Charges--;
                    /*attacker.MovingParticles(defender, 0x36E4, 5, 0, false, true, 3006, 4006, 0);
                    attacker.PlaySound(0x1E5);*/
                }
                else if (Effect == WeaponEffect.Weakness)
                {
                    string name = String.Format("[Magic] {0} Offset", StatType.Str);
                    StatMod mod = defender.GetStatMod(name);

                    if (mod != null && mod.Offset < 0)
                        defender.AddStatMod(new StatMod(StatType.Str, name, mod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (mod == null || mod.Offset < 10)
                        defender.AddStatMod(new StatMod(StatType.Str, name, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x3779, 10, 15, 5009, EffectLayer.Waist);
                    defender.PlaySound(0x1E6);
                }
                else if (Effect == WeaponEffect.Harm)
                {
                    DoHarm(attacker, defender);
                    Charges--;
                    /*defender.FixedParticles(0x374A, 10, 15, 5013, EffectLayer.Waist);
                    defender.PlaySound(0x1F1);*/
                }
                else if (Effect == WeaponEffect.Paralyze)
                {
                    defender.Paralyze(TimeSpan.FromSeconds(7));
                    Charges--;
                    defender.PlaySound(0x204);
                    defender.FixedEffect(0x376A, 6, 1);
                }
                else if (Effect == WeaponEffect.Fireball)
                {
                    DoFireball(attacker, defender);
                    Charges--;
                    /*attacker.MovingParticles(defender, 0x36D4, 7, 0, false, true, 9502, 4019, 0x160);
                    attacker.PlaySound(0x15E);*/
                }
                else if (Effect == WeaponEffect.Curse)
                {
                    string nameS = String.Format("[Magic] {0} Offset", StatType.Str);
                    string nameD = String.Format("[Magic] {0} Offset", StatType.Dex);
                    string nameI = String.Format("[Magic] {0} Offset", StatType.Int);
                    StatMod strmod = defender.GetStatMod(nameS);
                    StatMod dexmod = defender.GetStatMod(nameD);
                    StatMod intmod = defender.GetStatMod(nameI);

                    if (strmod != null && strmod.Offset > 0)
                        defender.AddStatMod(new StatMod(StatType.Str, nameS, strmod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (strmod == null || strmod.Offset > 10)
                        defender.AddStatMod(new StatMod(StatType.Str, nameS, -10, TimeSpan.FromSeconds(60.0)));

                    if (dexmod != null && dexmod.Offset > 0)
                        defender.AddStatMod(new StatMod(StatType.Dex, nameD, dexmod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (dexmod == null || dexmod.Offset > 10)
                        defender.AddStatMod(new StatMod(StatType.Dex, nameD, -10, TimeSpan.FromSeconds(60.0)));

                    if (intmod != null && intmod.Offset > 0)
                        defender.AddStatMod(new StatMod(StatType.Int, nameI, intmod.Offset + -10, TimeSpan.FromSeconds(60.0)));
                    else if (intmod == null || intmod.Offset > 10)
                        defender.AddStatMod(new StatMod(StatType.Int, nameI, -10, TimeSpan.FromSeconds(60.0)));

                    Charges--;
                    defender.FixedParticles(0x374A, 10, 15, 5028, EffectLayer.Waist);
                    defender.PlaySound(0x1EA);
                }
                else if (Effect == WeaponEffect.ManaDrain)
                {
                    defender.Mana -= 10;
                    Charges--;
                    defender.FixedParticles(0x374A, 10, 15, 5032, EffectLayer.Head);
                    defender.PlaySound(0x1F8);
                }
                else if (Effect == WeaponEffect.Lightning)
                {
                    DoLightning(attacker, defender);
                    Charges--;
                    /*defender.BoltEffect(0);*/
                }
                #endregion
            }

            CheckSlayerResult cs = CheckSlayers( attacker, defender );

            if ( cs != CheckSlayerResult.None )
            {
                if ( cs == CheckSlayerResult.Slayer )
                    defender.FixedEffect( 0x37B9, 10, 5 );

                damage *= 2;
            }

            if ( attacker is BaseCreature )
                ((BaseCreature)attacker).AlterMeleeDamageTo( defender, ref damage );

            if ( defender is BaseCreature )
                ((BaseCreature)defender).AlterMeleeDamageFrom( attacker, ref damage );

            damage = AbsorbDamage( attacker, defender, damage );

            // Halve the computed damage and return
            damage /= 2;

            if (damage < 1)
                damage = 1;

            if (attacker is PlayerMobile)
                damage += 2;

            AddBlood( attacker, defender, damage );
            defender.Damage(damage, attacker);

            if (defender is Slime)
            {
                if ((damage > (defender.Hits / 4)) && (defender.Hits > 5))
                {
                    defender.Say(true, "*The slime splits when struck!*");
                    BaseCreature slime = new Slime();
                    slime.Hits = (defender.Hits / 2);
                    defender.Hits /= 2;
                    slime.MoveToWorld(new Point3D(defender.X, defender.Y, defender.Z), defender.Map);
                }
            }

            Item hammer = attacker.FindItemOnLayer(Layer.OneHanded);

            if ( (m_MaxHits > 0 || (hammer != null && hammer is SmithHammer && ((SmithHammer)hammer).MaxHitPoints > 0)) && ((MaxRange <= 1 && (defender is Slime || defender is ToxicElemental)) || Utility.Random( 25 ) == 0) ) // Stratics says 50% chance, seems more like 4%..
            {
                if ((MaxRange <= 1 || (hammer != null && hammer is SmithHammer)) && (defender is Slime || defender is ToxicElemental))
                    attacker.LocalOverheadMessage( MessageType.Regular, 0x3B2, true, "*Acid blood scars your weapon!*" );

                    if (( m_Hits > 0 ) || (hammer != null && hammer is SmithHammer && ((SmithHammer)hammer).HitPoints > 0))
                    {
                        --HitPoints;
                    }
                    else if (( m_MaxHits > 1 ) || (hammer != null && hammer is SmithHammer && ((SmithHammer)hammer).MaxHitPoints > 1))
                    {
                        --MaxHitPoints;

                        if ( Parent is Mobile )
                            ((Mobile)Parent).LocalOverheadMessage( MessageType.Regular, 0x3B2, true, "Your equipment is severely damaged." );
                    }
                    else
                    {
                        Delete();
                    }
            }

            if ( attacker is BaseCreature )
                ((BaseCreature)attacker).OnGaveMeleeAttack( defender );

            if ( defender is BaseCreature )
                ((BaseCreature)defender).OnGotMeleeAttack( attacker );
        }
Ejemplo n.º 38
0
		public int GetStatMod(Mobile mob, StatType type)
		{
			int offset = 0;
			StatMod buff = mob.GetStatMod(String.Format("[Magic] {0} Buff", type));
			StatMod curse = mob.GetStatMod(String.Format("[Magic] {0} Curse", type));

			if (buff != null)
				offset += buff.Offset;
			if (curse != null)
				offset += buff.Offset;

			return offset;
		}
Ejemplo n.º 39
0
		private void FixMobile(Mobile m)
		{
			if (!m.Alive)
				m.Resurrect();

			HandleCorpse(m);

			m.Aggressed.Clear();
			m.Aggressors.Clear();
			m.Hits = m.HitsMax;
			m.Stam = m.StamMax;
			m.Mana = m.ManaMax;
			m.DamageEntries.Clear();
			m.Combatant = null;
			m.InvalidateProperties();

            m.Criminal = false;

			StatMod mod;

			mod = m.GetStatMod("[Magic] Str Offset");
			if (mod != null && mod.Offset < 0)
				m.RemoveStatMod("[Magic] Str Offset");

			mod = m.GetStatMod("[Magic] Dex Offset");
			if (mod != null && mod.Offset < 0)
				m.RemoveStatMod("[Magic] Dex Offset");

			mod = m.GetStatMod("[Magic] Int Offset");
			if (mod != null && mod.Offset < 0)
				m.RemoveStatMod("[Magic] Int Offset");

			m.Paralyzed = false;
			m.CurePoison(m);

			// EvilOmenSpell.CheckEffect(m);
			StrangleSpell.RemoveCurse(m);
			CorpseSkinSpell.RemoveCurse(m);

			#region Buff Icons
			if (m is PlayerMobile)
			{
				PlayerMobile pm = (PlayerMobile)m;
				pm.RemoveBuff(BuffIcon.Clumsy);
				pm.RemoveBuff(BuffIcon.CorpseSkin);
				pm.RemoveBuff(BuffIcon.EvilOmen);
				pm.RemoveBuff(BuffIcon.Curse);
				pm.RemoveBuff(BuffIcon.FeebleMind);
				pm.RemoveBuff(BuffIcon.MassCurse);
				pm.RemoveBuff(BuffIcon.Paralyze);
				pm.RemoveBuff(BuffIcon.Poison);
				pm.RemoveBuff(BuffIcon.Strangle);
				pm.RemoveBuff(BuffIcon.Weaken);
			}
			#endregion

			m.SendMessage("The duel has ended.");
		}
Ejemplo n.º 40
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042038); // You must have the object in your backpack to use it.
            }
            else if (from.GetStatMod("RoseOfTrinsicPetal") != null)
            {
                from.SendLocalizedMessage(1062927); // You have eaten one of these recently and eating another would provide no benefit.
            }
            else
            {
                from.PlaySound(0x1EE);
                from.AddStatMod(new StatMod(StatType.Str, "RoseOfTrinsicPetal", 5, TimeSpan.FromMinutes(5.0)));

                this.Consume();
            }
        }
Ejemplo n.º 41
0
		public override void OnHit( Mobile attacker, Mobile defender, double damageBonus )
		{
			base.OnHit( attacker, defender, damageBonus );

			if ( (attacker.Player || attacker.Body.IsHuman) && Layer == Layer.TwoHanded && (attacker.Skills[SkillName.Anatomy].Value / 400.0) >= Utility.RandomDouble() )
			{
				StatMod mod = defender.GetStatMod( "Concussion" );

				if ( mod == null )
				{
					defender.SendMessage( "You receive a concussion blow!" );
					defender.AddStatMod( new StatMod( StatType.Int, "Concussion", -(defender.RawInt / 2), TimeSpan.FromSeconds( 30.0 ) ) );

					attacker.SendMessage( "You deliver a concussion blow!" );
					attacker.PlaySound( 0x11C );
				}
			}
		}
Ejemplo n.º 42
0
        public static bool AddStatBonus( Mobile caster, Mobile target, StatType type, int bonus, TimeSpan duration )
        {
            int offset = bonus;
            string name = String.Format( "[Magic] {0} Offset", type );

            StatMod mod = target.GetStatMod( name );

            //one is negative and the other is positive, so adding up
            if( mod != null && ((mod.Offset <= 0 && offset > 0) || (offset < 0 && mod.Offset >= 0)) )
            {
                target.RemoveStatMod( name );
                target.AddStatMod( new StatMod( type, name, mod.Offset + offset, duration ) );
                return true;
            }
            //nothing to replace, just adding
            else if( mod == null )
            {
                target.AddStatMod( new StatMod( type, name, offset, duration ) );
                return true;
            }
            //replacing the current mod with a larger one
            else if( mod != null && ((mod.Offset <= 0 && offset < mod.Offset) || (mod.Offset >= 0 && mod.Offset < offset)) )
            {
                target.RemoveStatMod( name );
                target.AddStatMod( new StatMod( type, name, offset, duration ) );
                return true;
            }

            return false;
        }
Ejemplo n.º 43
0
        public static bool AddStatCurse(Mobile caster, Mobile target, StatType type, int curse, TimeSpan duration)
        {
            int offset = curse;
            string name = String.Format("[Magic] {0} Curse", type);

            StatMod mod = target.GetStatMod(name);
			if (mod != null)
				offset = Math.Max(mod.Offset, offset);
			offset *= -1;

            target.AddStatMod(new StatMod(type, name, offset, duration));
			Timer.DelayCall(duration, RemoveStatOffsetCallback, target);
			return true;
        }
Ejemplo n.º 44
0
		public void Target( Mobile m )
		{
			if ( CheckBSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Attempts to remove all Curse effects from Target.
				 * Curses include Mage spells such as Clumsy, Weaken, Feeblemind and Paralyze
				 * as well as all Necromancer curses.
				 * Chance of removing curse is affected by Caster's Karma.
				 */

				int chance = 0;

				if ( Caster.Karma < -5000 )
					chance = 0;
				else if ( Caster.Karma < 0 )
					chance = (int) Math.Sqrt( 20000 + Caster.Karma ) - 122;
				else if ( Caster.Karma < 5625 )
					chance = (int) Math.Sqrt( Caster.Karma ) + 25;
				else
					chance = 100;

				if ( chance > Utility.Random( 100 ) )
				{
					m.PlaySound( 0xF6 );
					m.PlaySound( 0x1F7 );
					m.FixedParticles( 0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head );

					IEntity from = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z - 10 ), Caster.Map );
					IEntity to = new Entity( Serial.Zero, new Point3D( m.X, m.Y, m.Z + 50 ), Caster.Map );
					Effects.SendMovingParticles( from, to, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100 );

					StatMod mod;

					mod = m.GetStatMod( "[Magic] Str Offset" );
					if ( mod != null && mod.Offset < 0 )
						m.RemoveStatMod( "[Magic] Str Offset" );

					mod = m.GetStatMod( "[Magic] Dex Offset" );
					if ( mod != null && mod.Offset < 0 )
						m.RemoveStatMod( "[Magic] Dex Offset" );

					mod = m.GetStatMod( "[Magic] Int Offset" );
					if ( mod != null && mod.Offset < 0 )
						m.RemoveStatMod( "[Magic] Int Offset" );

					m.Paralyzed = false;

					EvilOmenSpell.TryEndEffect( m );
					StrangleSpell.RemoveCurse( m );
					CorpseSkinSpell.RemoveCurse( m );
					CurseSpell.RemoveEffect( m );
					MortalStrike.EndWound( m );
					if (Core.ML) { BloodOathSpell.RemoveCurse ( m ); }
					MindRotSpell.ClearMindRotScalar ( m );

					BuffInfo.RemoveBuff( m, BuffIcon.Clumsy );
					BuffInfo.RemoveBuff( m, BuffIcon.FeebleMind );
					BuffInfo.RemoveBuff( m, BuffIcon.Weaken );
					BuffInfo.RemoveBuff ( m, BuffIcon.Curse );
					BuffInfo.RemoveBuff( m, BuffIcon.MassCurse );
					BuffInfo.RemoveBuff( m, BuffIcon.MortalStrike );
					BuffInfo.RemoveBuff ( m, BuffIcon.Mindrot );

					// TODO: Should this remove blood oath? Pain spike?
				}
				else
				{
					m.PlaySound( 0x1DF );
				}
			}

			FinishSequence();
		}
Ejemplo n.º 45
0
        public override bool OnMoveOver( Mobile m )
        {
            if( !Visible )
                return true;

            if( m == null || !m.Player )
                return true;

            if(!PvpCore.IsInDeathmatch( m ) )
                return true;

            Visible = false;

            StatMod mod = m.GetStatMod( String.Format( "[DM] {0}", m_PowerUp ) );

            if( mod != null )
                m.RemoveStatMod( String.Format( "[DM] {0}", m_PowerUp ) );

            switch( m_PowerUp )
            {
                case PowerUpType.Dex:
                {
                    m.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
                    m.PlaySound( 0x1E6 );
                    m.AddStatMod( new StatMod( StatType.Dex, String.Format("[DM] {0}", m_PowerUp ), 5, TimeSpan.FromMinutes( 1.0 ) ) );
                    break;
                }
                case PowerUpType.Fury:
                {
                    m.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
                    m.PlaySound( 0x1E6 );
                    m.AddStatMod( new StatMod( StatType.All, String.Format( "[DM] {0}", m_PowerUp ), 5, TimeSpan.FromMinutes( 1.0 ) ) );
                    break;
                }
                case PowerUpType.Int:
                {
                    m.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
                    m.PlaySound( 0x1E6 );
                    m.AddStatMod( new StatMod( StatType.Int, String.Format( "[DM] {0}", m_PowerUp ), 5, TimeSpan.FromMinutes( 1.0 ) ) );
                    break;
                }
                case PowerUpType.Rage:
                {
                    m.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
                    m.PlaySound( 0x1E6 );
                    m.AddStatMod( new StatMod( StatType.All, String.Format( "[DM] {0}", m_PowerUp ), 10, TimeSpan.FromMinutes( 1.0 ) ) );
                    break;
                }
                case PowerUpType.Spirit:
                {
                    m.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
                    m.PlaySound( 0x1E6 );
                    m.AddStatMod( new StatMod( StatType.Int, String.Format( "[DM] {0}", m_PowerUp ), 15, TimeSpan.FromMinutes( 1.0 ) ) );
                    break;
                }
                case PowerUpType.Str:
                {
                    m.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
                    m.PlaySound( 0x1E6 );
                    m.AddStatMod( new StatMod( StatType.Str, String.Format( "[DM] {0}", m_PowerUp ), 5, TimeSpan.FromMinutes( 1.0 ) ) );
                    break;
                }
                case PowerUpType.Supremacy:
                {
                    m.FixedParticles( 0x3779, 10, 15, 5009, EffectLayer.Waist );
                    m.PlaySound( 0x1E6 );
                    m.AddStatMod( new StatMod( StatType.All, String.Format( "[DM] {0}", m_PowerUp ), 20, TimeSpan.FromSeconds( 20.0 ) ) );
                    break;
                }
            }

            new RespawnTimer( this ).Start();
            return true;
        }
Ejemplo n.º 46
0
        public static bool AddStatCurse(Mobile caster, Mobile target, StatType type, int curse, TimeSpan duration)
        {
            int offset = -curse;
            string name = String.Format("[Magic] {0} Offset", type);

            StatMod mod = target.GetStatMod(name);

            if (mod != null && mod.Offset > 0)
            {
                target.AddStatMod(new StatMod(type, name, mod.Offset + offset, duration));
                return true;
            }
            else if (mod == null || mod.Offset > offset)
            {
                target.AddStatMod(new StatMod(type, name, offset, duration));
                return true;
            }

            return false;
        }
Ejemplo n.º 47
0
        public static bool HasStatEffect(Mobile target, StatType type)
        {
            if (type == StatType.All)
            {
                return HasStatEffect(target, StatType.Dex) && HasStatEffect(target, StatType.Int) && HasStatEffect(target, StatType.Str);
            }
            else
            {
                StatMod mod = target.GetStatMod(String.Format("[Magic] {0} Offset", type));

                return mod != null;
            }
        }