private void SetMods( Mobile wearer )
		{			
			wearer.AddSkillMod( m_SkillMod0 ); 
			wearer.AddSkillMod( m_SkillMod1 ); 
			wearer.AddSkillMod( m_SkillMod2 ); 
			wearer.AddStatMod( m_StatMod0 ); 
		}
Exemple #2
0
 public override bool OnEquip(Mobile from)
 {
     if (UseSkillMod)
     {
         if (from.FindItemOnLayer(Layer.TwoHanded) != this && m_ARCHERYMod == null && m_TACTICSMod == null)
         {
             m_TACTICSMod = new DefaultSkillMod(SkillName.Tactics, true, 15);
             from.AddSkillMod(m_TACTICSMod);
             m_ARCHERYMod = new DefaultSkillMod(SkillName.Archery, true, 10);
             from.AddSkillMod(m_ARCHERYMod);
         }
     }
     return base.OnEquip(from);
 }
Exemple #3
0
        public static void ApplyBonus( Mobile m )
        {
            ApplyBonus( m.FindItemOnLayer( Layer.Neck ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Helm ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );

            List<AttributeMod> mods = new List<AttributeMod>();

            mods.Add( new AttributeMod( MagicalAttribute.ReflectPhysical, 25 ) );

            ApplyMods( m, mods );

            m_Bonus[m] = mods;

            // +10 chivalry (total)
            SkillMod skillmod = new DefaultSkillMod( SkillName.Chivalry, true, 10.0 );
            skillmod.ObeyCap = true;
            m_Table.Add( m, skillmod );
            m.AddSkillMod( skillmod );

            m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!

            Effects.PlaySound( m.Location, m.Map, 503 );
            m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
        }
		public void AddSkillModTo( Mobile to )
		{
			m_SkillMod = new DefaultSkillMod( SkillName.Cooking, true, m_Bonus );
			m_SkillMod.ObeyCap = true;
			to.AddSkillMod( m_SkillMod );
			m_Active = true;

			to.SendLocalizedMessage( 1075540 ); //The scent of fresh herbs begins to fill your home...
		}
		private void SetMods( Mobile wearer )
		{
	wearer.AddSkillMod(m_SkillMod0);
	wearer.AddSkillMod(m_SkillMod1);
	wearer.AddSkillMod(m_SkillMod2);
	wearer.AddSkillMod(m_SkillMod3);
	wearer.AddSkillMod(m_SkillMod4);
	wearer.AddSkillMod(m_SkillMod5);
	wearer.AddSkillMod(m_SkillMod6);
	wearer.AddSkillMod(m_SkillMod7);
		}
		public override bool OnEquip( Mobile from )
		{
			if( UseSkillMod )
			{
                if (m_BSMod != null)
                    m_BSMod.Remove();

			    m_BSMod = new DefaultSkillMod( SkillName.Blacksmith, true, 20 );
                    from.AddSkillMod( m_BSMod );
			}
			return base.OnEquip( from );
		}
		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();
		}
Exemple #8
0
        public static void Toggle(Mobile caster, Mobile target)
        {
            /* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
             * Players under the protection spell have decreased physical resistance stat value (-15 + (Inscription/20),
             * a decreased "resisting spells" skill value by -35 + (Inscription/20),
             * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
             * The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
             * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out,
             * even after dying—until you “turn them off” by casting them again.
             */

            object[] mods = (object[])m_Table[target];

            if (mods == null)
            {
                target.PlaySound(0x1E9);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                mods = new object[2]
                {
                    new ResistanceMod(ResistanceType.Physical, -15 + Math.Min((int)(caster.Skills[SkillName.Inscribe].Value / 20), 15)),
                    new DefaultSkillMod(SkillName.MagicResist, true, -35 + Math.Min((int)(caster.Skills[SkillName.Inscribe].Value / 20), 35))
                };

                m_Table[target]  = mods;
                Registry[target] = 100.0;

                target.AddResistanceMod((ResistanceMod)mods[0]);
                target.AddSkillMod((SkillMod)mods[1]);

                int    physloss   = -15 + (int)(caster.Skills[SkillName.Inscribe].Value / 20);
                int    resistloss = -35 + (int)(caster.Skills[SkillName.Inscribe].Value / 20);
                string args       = String.Format("{0}\t{1}", physloss, resistloss);
                BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString()));
            }
            else
            {
                target.PlaySound(0x1ED);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                m_Table.Remove(target);
                Registry.Remove(target);

                target.RemoveResistanceMod((ResistanceMod)mods[0]);
                target.RemoveSkillMod((SkillMod)mods[1]);

                BuffInfo.RemoveBuff(target, BuffIcon.Protection);
            }
        }
        public static void Toggle( Mobile caster, Mobile target )
        {
            /* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
             * Players under the protection spell have decreased physical resistance stat value (-15 + (Inscription/20),
             * a decreased "resisting spells" skill value by -35 + (Inscription/20),
             * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
             * The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
             * Reactive Armor, Protection, and Magic Reflection will stay on—even after logging out,
             * even after dying—until you “turn them off” by casting them again.
             */

            object[] mods = (object[])m_Table[target];

            if ( mods == null )
            {
                target.PlaySound( 0x1E9 );
                target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );

                mods = new object[2]
                    {
                        new ResistanceMod( ResistanceType.Physical, -15 + Math.Min( (int)(caster.Skills[SkillName.Inscribe].Value / 20), 15 ) ),
                        new DefaultSkillMod( SkillName.MagicResist, true, -35 + Math.Min( (int)(caster.Skills[SkillName.Inscribe].Value / 20), 35 ) )
                    };

                m_Table[target] = mods;
                Registry[target] = 100.0;

                target.AddResistanceMod( (ResistanceMod)mods[0] );
                target.AddSkillMod( (SkillMod)mods[1] );

                int physloss = -15 + (int) (caster.Skills[SkillName.Inscribe].Value / 20);
                int resistloss = -35 + (int) (caster.Skills[SkillName.Inscribe].Value / 20);
                string args = String.Format("{0}\t{1}", physloss, resistloss);
                BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args.ToString()));
            }
            else
            {
                target.PlaySound( 0x1ED );
                target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );

                m_Table.Remove( target );
                Registry.Remove( target );

                target.RemoveResistanceMod( (ResistanceMod)mods[0] );
                target.RemoveSkillMod( (SkillMod)mods[1] );

                BuffInfo.RemoveBuff(target, BuffIcon.Protection);
            }
        }
Exemple #10
0
        public override void OnTrigger(object activator, Mobile m)
        {
            if (m == null || (RequireIdentification && !m_Identified))
            {
                return;
            }

            if ((AttachedTo is BaseArmor || AttachedTo is BaseWeapon) && (((Item)AttachedTo).Layer != Layer.Invalid))
            {
                // when activated via speech will apply mod when equipped by the speaker
                SkillMod sm = new EquippedSkillMod(m_Skill, true, m_Value, (Item)AttachedTo, m);
                m.AddSkillMod(sm);
                // and then remove the attachment
                Delete();
            }
            else
            {
                // when activated it will apply the skill mod that will last for the specified duration
                SkillMod sm = new TimedSkillMod(m_Skill, true, m_Value, m_Duration);
                m.AddSkillMod(sm);
                // and then remove the attachment
                Delete();
            }
        }
Exemple #11
0
        public static void Toggle(Mobile caster, Mobile target)
        {
            /* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
             * Players under the protection spell have decreased physical resistance stat value (-15 + (Inscription/20),
             * a decreased "resisting spells" skill value by -35 + (Inscription/20),
             * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
             * The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
             * Reactive Armor, Protection, and Magic Reflection will stay on�even after logging out,
             * even after dying�until you �turn them off� by casting them again.
             */

            if (m_Table.TryGetValue(target, out Tuple <ResistanceMod, DefaultSkillMod> mods))
            {
                target.PlaySound(0x1E9);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                mods = new Tuple <ResistanceMod, DefaultSkillMod>(
                    new ResistanceMod(ResistanceType.Physical,
                                      -15 + Math.Min((int)(caster.Skills.Inscribe.Value / 20), 15)),
                    new DefaultSkillMod(SkillName.MagicResist, true,
                                        -35 + Math.Min((int)(caster.Skills.Inscribe.Value / 20), 35))
                    );

                m_Table[target]  = mods;
                Registry[target] = 100.0;

                target.AddResistanceMod(mods.Item1);
                target.AddSkillMod(mods.Item2);

                int    physloss   = -15 + (int)(caster.Skills.Inscribe.Value / 20);
                int    resistloss = -35 + (int)(caster.Skills.Inscribe.Value / 20);
                string args       = $"{physloss}\t{resistloss}";
                BuffInfo.AddBuff(target, new BuffInfo(BuffIcon.Protection, 1075814, 1075815, args));
            }
            else
            {
                target.PlaySound(0x1ED);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                m_Table.Remove(target);
                Registry.Remove(target);

                target.RemoveResistanceMod(mods.Item1);
                target.RemoveSkillMod(mods.Item2);

                BuffInfo.RemoveBuff(target, BuffIcon.Protection);
            }
        }
        public static void Morph(Mobile from, int body)
        {
            if (CheckMorph(from, body))
            {
                IMount mount = from.Mount;

                if (mount != null)
                {
                    mount.Rider = null;
                }

                from.BodyMod = body;

                if (body == 0xEE || body == 0xCD)
                {
                    from.AddSkillMod((SkillMod)mods[0]);
                }

                if (body == 0x51)
                {
                    from.HueMod = 0x5A3;
                }

                if (body == 0x19 || body == 0xF6)
                {
                    from.Hits += 20;
                }

                if (body == 0x84 || body == 0x7A || body == 0xF6 || body == 0x19 || body == 0xDC || body == 0xDA)
                {
                    from.Send(new FastMovePacket(true));
                }

                m_Table[from] = true;

                m_Table2[from] = body;
            }
            else
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 502632);                   // The spell fizzles.

                from.FixedParticles(0x3735, 1, 30, 9503, EffectLayer.Waist);

                from.PlaySound(0x1D6);

                from.NextSpellTime = DateTime.Now;
            }
        }
Exemple #13
0
            public void Apply()
            {
                for (int i = 0; i < m_Mods.Count; ++i)
                {
                    object mod = m_Mods[i];

                    if (mod is StatMod)
                    {
                        m_Creature.AddStatMod((StatMod)mod);
                    }
                    else if (mod is SkillMod)
                    {
                        m_Creature.AddSkillMod((SkillMod)mod);
                    }
                }
            }
        public override void OnDoubleClick(Mobile from)
        {
            Fishing.System.BeginHarvesting(from, this);

            if (Charges >= 1 && m_SkillMod == null && from.FindItemOnLayer(Layer.OneHanded) is DeepSeaFishingPole)
            {
                m_SkillMod = new DefaultSkillMod(SkillName.Fishing, true, 1);
                from.AddSkillMod(m_SkillMod);
            }

            if (!Sphere.EquipOnDouble(from, this))
                return;


            base.OnDoubleClick(from);
        }
Exemple #15
0
        public void Target(Mobile m)
        {
            if (!(m is BaseCreature || m is PlayerMobile))
            {
                Caster.SendLocalizedMessage(1060508); // You can't curse that.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                /* Curses the target so that the next harmful event that affects them is magnified.
                 * Damage to the target's hit points is increased 25%,
                 * the poison level of the attack will be 1 higher
                 * and the Resist Magic skill of the target will be fixed on 50.
                 *
                 * The effect lasts for one harmful event only.
                 */

                m.Spell?.OnCasterHurt();

                m.PlaySound(0xFC);
                m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);

                if (!m_Table.ContainsKey(m))
                {
                    DefaultSkillMod mod = new DefaultSkillMod(SkillName.MagicResist, false, 50.0);

                    if (m.Skills.MagicResist.Base > 50.0)
                    {
                        m.AddSkillMod(mod);
                    }

                    m_Table[m] = mod;
                }

                TimeSpan duration = TimeSpan.FromSeconds(Caster.Skills.SpiritSpeak.Value / 12 + 1.0);

                Timer.DelayCall(duration, mob => TryEndEffect(mob), m);

                HarmfulSpell(m);

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.EvilOmen, 1075647, 1075648, duration, m));
            }

            FinishSequence();
        }
Exemple #16
0
		public void Target( Mobile m )
		{
			if ( !(m is BaseCreature || m is PlayerMobile) )
			{
				Caster.SendLocalizedMessage( 1060508 ); // You can't curse that.
			}
			else if ( CheckHSequence( m ) )
			{
				SpellHelper.Turn( Caster, m );

				/* Curses the target so that the next harmful event that affects them is magnified.
				 * Damage to the target's hit points is increased 25%,
				 * the poison level of the attack will be 1 higher
				 * and the Resist Magic skill of the target will be fixed on 50.
				 * 
				 * The effect lasts for one harmful event only.
				 */

				if ( m.Spell != null )
					m.Spell.OnCasterHurt();

				m.PlaySound( 0xFC );
				m.FixedParticles( 0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head );
				m.FixedParticles( 0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head );

				if ( !m_Table.Contains( m ) )
				{
					SkillMod mod = new DefaultSkillMod( SkillName.MagicResist, false, 50.0 );

					if ( m.Skills[SkillName.MagicResist].Base > 50.0 )
						m.AddSkillMod( mod );

					m_Table[m] = mod;
				}

				TimeSpan duration = TimeSpan.FromSeconds( (Caster.Skills[SkillName.SpiritSpeak].Value / 12) + 1.0 );

				Timer.DelayCall( duration, new TimerStateCallback( EffectExpire_Callback ), m );

				HarmfulSpell( m );

                BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.EvilOmen, 1075647, 1075648, duration, m));

			}

			FinishSequence();
		}
Exemple #17
0
        public void Target(Mobile m)
        {
            if (!(m is BaseCreature || m is PlayerMobile))
            {
                Caster.SendLocalizedMessage(1060508); // You can't curse that.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                Effects.SendTargetParticles(m, 14170, 10, 15, 5013, 0, 0, EffectLayer.CenterFeet); //ID, speed, dura, effect, hue, render, layer
                Effects.SendTargetParticles(m, 14201, 10, 15, 5013, 0, 0, EffectLayer.CenterFeet); //ID, speed, dura, effect, hue, render, layer
                m.PlaySound(514);

                SkillMod[] mods = (SkillMod[])m_Table[m];

                if (mods == null)
                {
                    mods = new SkillMod[]
                    {
                        new DefaultSkillMod(SkillName.Tactiques, false, m.Skills[SkillName.Tactiques].Base + (Caster.Skills[CastSkill].Value / 2)),
                        new DefaultSkillMod(SkillName.Parer, false, m.Skills[SkillName.Parer].Base + (Caster.Skills[CastSkill].Value / 2)),
                        new DefaultSkillMod(SkillName.Epee, false, m.Skills[SkillName.Epee].Base + (Caster.Skills[CastSkill].Value / 2)),
                        new DefaultSkillMod(SkillName.ArmeHaste, false, m.Skills[SkillName.ArmeHaste].Base + (Caster.Skills[CastSkill].Value / 2)),
                        new DefaultSkillMod(SkillName.ArmeDistance, false, m.Skills[SkillName.ArmeDistance].Base + (Caster.Skills[CastSkill].Value / 2)),
                        new DefaultSkillMod(SkillName.ArmePerforante, false, m.Skills[SkillName.ArmePerforante].Base + (Caster.Skills[CastSkill].Value / 2)),
                        new DefaultSkillMod(SkillName.Anatomie, false, m.Skills[SkillName.Anatomie].Base + (Caster.Skills[CastSkill].Value / 2)),
                        new DefaultSkillMod(SkillName.Equitation, false, m.Skills[SkillName.Equitation].Base + (Caster.Skills[CastSkill].Value / 2)),
                        new DefaultSkillMod(SkillName.ArmeContondante, false, m.Skills[SkillName.ArmeContondante].Base + (Caster.Skills[CastSkill].Value / 2))
                    };

                    for (int i = 0; i < mods.Length; ++i)
                    {
                        m.AddSkillMod(mods[i]);
                    }

                    m_Table[m] = mods;

                    TimeSpan duration = TimeSpan.FromSeconds(0);

                    new ZeleDivinMiracle.InternalTimer(m, duration).Start();
                }
            }

            FinishSequence();
        }
        public override void OnDoubleClick(Mobile from)
        {
            Fishing.System.BeginHarvesting(from, this);

            if (Charges >= 1 && m_SkillMod == null && from.FindItemOnLayer(Layer.OneHanded) is DeepSeaFishingPole)
            {
                m_SkillMod = new DefaultSkillMod(SkillName.Fishing, true, 1);
                from.AddSkillMod(m_SkillMod);
            }

            if (!Sphere.EquipOnDouble(from, this))
            {
                return;
            }


            base.OnDoubleClick(from);
        }
        public override void OnDoubleClick(Mobile from)
        {
            if (from.BeginAction(typeof(BaseHealPotion)))
            {
                from.AddSkillMod(new TimedSkillMod(SkillName.AnimalTaming, true, 9.0, TimeSpan.FromMinutes(3.0)));
                from.SendMessage("The dos llamas temporary boosts your Animal Taming skill.");

                from.PlaySound(1014);

                this.Delete();

                Timer.DelayCall(TimeSpan.FromMinutes(3.0), new TimerStateCallback(ReleaseHealLock), from);
            }
            else
            {
                from.SendMessage("Oui matey, you should wait 3 minutes before you drink another one.");
            }
        }
Exemple #20
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.BeginAction(typeof(BaseHealPotion)))
            {
                from.AddSkillMod(new TimedSkillMod(SkillName.Peacemaking, true, 8.0, TimeSpan.FromMinutes(1.0)));
                from.SendMessage("The bum light temporary boosts your Peacemaking skill.");

                from.PlaySound(726);

                this.Delete();

                Timer.DelayCall(TimeSpan.FromMinutes(1.0), new TimerStateCallback(ReleaseHealLock), from);
            }
            else
            {
                from.SendMessage("Oui matey, you should wait 1 minute before you drink another one.");
            }
        }
Exemple #21
0
            public void Apply()
            {
                for (int i = 0; i < m_Mods.Count; ++i)
                {
                    object mod = m_Mods[i];

                    /*if ( mod is ResistanceMod )
                     *      m_Creature.AddResistanceMod( (ResistanceMod) mod );
                     * else*/if (mod is StatMod)
                    {
                        m_Creature.AddStatMod((StatMod)mod);
                    }
                    else if (mod is SkillMod)
                    {
                        m_Creature.AddSkillMod((SkillMod)mod);
                    }
                }
            }
Exemple #22
0
        public virtual void BladeBlessing_OnTarget(Mobile from, object target)
        {
            if (!from.CanSee(target))
            {
                from.SendLocalizedMessage(500237);                   //Target cannot be seen.
            }
            else if (target is BaseWeapon)
            {
                BaseWeapon wep = (BaseWeapon)target;

                wep.MaxHitPoints += Utility.RandomMinMax(80, 120);
                wep.HitPoints     = wep.MaxHitPoints;
                wep.LootType      = LootType.Blessed;

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

                this.Delete();
            }
            else if (target is Mobile)
            {
                Mobile       m  = (Mobile)target;
                PlayerMobile pm = (PlayerMobile)m;

                if (pm.Karma >= 1500)
                {
                    m_StatMod0 = new StatMod(StatType.All, "statbonus", 15, TimeSpan.FromMinutes(5));
                    pm.AddStatMod(m_StatMod0);

                    m_TimedSkillMod0 = new TimedSkillMod(SkillName.Tactics, true, 10, dateTime);
                    from.AddSkillMod(m_TimedSkillMod0);

                    this.Delete();
                }
                else
                {
                    from.SendMessage("You are not worthy of this blessing.");
                }
            }
            else
            {
                from.SendMessage("This spell would not work on that.");
            }
        }
Exemple #23
0
        public static void Toggle(Mobile caster, Mobile target)
        {
            /* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
             * Players under the protection spell have decreased physical resistance stat value (-15 + (Inscription/20),
             * a decreased "resisting spells" skill value by -35 + (Inscription/20),
             * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
             * The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
             * Reactive Armor, Protection, and Magic Reflection will stay on�even after logging out,
             * even after dying�until you �turn them off� by casting them again.
             */

            var mods = (object[])m_Table[target];

            if (mods == null)
            {
                target.PlaySound(0x1E9);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                mods = new object[1]
                {
                    new DefaultSkillMod(SkillName.MagicResist, true,
                                        -35 + Math.Min((int)(caster.Skills[SkillName.Inscribe].Value / 20), 35))
                };

                m_Table[target]  = mods;
                Registry[target] = 100.0;

                target.AddSkillMod((SkillMod)mods[1]);

                var physloss   = -15 + (int)(caster.Skills[SkillName.Inscribe].Value / 20);
                var resistloss = -35 + (int)(caster.Skills[SkillName.Inscribe].Value / 20);
                var args       = $"{physloss}\t{resistloss}";
            }
            else
            {
                target.PlaySound(0x1ED);
                target.FixedParticles(0x375A, 9, 20, 5016, EffectLayer.Waist);

                m_Table.Remove(target);
                Registry.Remove(target);

                target.RemoveSkillMod((SkillMod)mods[1]);
            }
        }
Exemple #24
0
        public static void ApplySkillLoss(Mobile mob)
        {
            var pm = mob as PlayerMobile;

            if (pm == null || pm.StatEnd < DateTime.UtcNow)
            {
                return;
            }

            try
            {
                TimeSpan lossperiod = pm.StatEnd - DateTime.UtcNow;
                double   loss       = 0.40;         // 40% loss

                ClearSkillLoss(pm);

                var context = new SkillLossContext();
                m_SkillLoss[pm] = context;

                List <SkillMod> mods = context.m_SkillMods = new List <SkillMod>();

                foreach (Skill sk in pm.Skills)
                {
                    double baseValue = sk.Base;

                    if (baseValue > 0)
                    {
                        SkillMod mod = new DefaultSkillMod(sk.SkillName, true, -(baseValue * loss));

                        mods.Add(mod);
                        mob.AddSkillMod(mod);
                    }
                }

                mob.AddStatMod(new StatMod(StatType.Str, "Murder Penalty Str", -(int)(mob.RawStr * loss), lossperiod));
                mob.AddStatMod(new StatMod(StatType.Dex, "Murder Penalty Dex", -(int)(mob.RawDex * loss), lossperiod));
                mob.AddStatMod(new StatMod(StatType.Int, "Murder Penalty Int", -(int)(mob.RawInt * loss), lossperiod));

                context.m_Timer = Timer.DelayCall(lossperiod, m => ClearSkillLoss(m), mob);
            }
            catch
            { }
        }
Exemple #25
0
        public static void Toggle( Mobile caster, Mobile target )
        {
            /* Players under the protection spell effect can no longer have their spells "disrupted" when hit.
             * Players under the protection spell have decreased physical resistance stat value,
             * a decreased "resisting spells" skill value by -35,
             * and a slower casting speed modifier (technically, a negative "faster cast speed") of 2 points.
             * The protection spell has an indefinite duration, becoming active when cast, and deactivated when re-cast.
             * Reactive Armor, Protection, and Magic Reflection will stay on�even after logging out,
             * even after dying�until you �turn them off� by casting them again.
             */

            object[] mods = (object[])m_Table[target];

            if ( mods == null )
            {
                target.PlaySound( 0x1E9 );
                target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );

                mods = new object[2]
                    {
                        new ResistanceMod( ResistanceType.Physical, -15 + (int)(caster.Skills[SkillName.Inscribe].Value / 20) ),
                        new DefaultSkillMod( SkillName.MagicResist, true, -35 + (int)(caster.Skills[SkillName.Inscribe].Value / 20) )
                    };

                m_Table[target] = mods;
                Registry[target] = 100.0;

                target.AddResistanceMod( (ResistanceMod)mods[0] );
                target.AddSkillMod( (SkillMod)mods[1] );
            }
            else
            {
                target.PlaySound( 0x1ED );
                target.FixedParticles( 0x375A, 9, 20, 5016, EffectLayer.Waist );

                m_Table.Remove( target );
                Registry.Remove( target );

                target.RemoveResistanceMod( (ResistanceMod)mods[0] );
                target.RemoveSkillMod( (SkillMod)mods[1] );
            }
        }
Exemple #26
0
            public void Apply()
            {
                for (var i = 0; i < m_Mods.Count; ++i)
                {
                    var mod = m_Mods[i];

                    if (mod is ResistanceMod resistanceMod)
                    {
                        m_Creature.AddResistanceMod(resistanceMod);
                    }
                    else if (mod is StatMod statMod)
                    {
                        m_Creature.AddStatMod(statMod);
                    }
                    else if (mod is SkillMod skillMod)
                    {
                        m_Creature.AddSkillMod(skillMod);
                    }
                }
            }
Exemple #27
0
        public static void MustardBomb(Mobile from, Mobile to)
        {
            if (!Ability.CanUse(to, from, true))
            {
                return;
            }

            Point3D point = to.Location;

            for (int i = -3; i < 4; i++)
            {
                for (int j = -3; j < 4; j++)
                {
                    point = new Point3D(to.X + i, to.Y + j, to.Z);

                    if (BlueSpell.GetDist(point, to.Location) < 3.1)
                    {
                        Effects.SendLocationEffect(point, to.Map, 0x3728, 13, 1283 /*Hue*/, 4);
                    }
                }
            }

            ResistanceMod[] mods = new ResistanceMod[] { new ResistanceMod(ResistanceType.Fire, -300),
                                                         new ResistanceMod(ResistanceType.Cold, -300) };

            for (int i = 0; i < mods.Length; ++i)
            {
                to.AddResistanceMod(mods[i]);
            }

            TimedResistanceMod.AddMod(
                to,
                "Mustard Bomb",
                mods,
                TimeSpan.FromSeconds(60)
                );

            to.AddSkillMod(new TimedSkillMod(SkillName.MagicResist, true, -120.0, TimeSpan.FromSeconds(60)));

            to.SendMessage("The intense heat scalds your elemental resistance.");
        }
Exemple #28
0
        public static void ApplyBonus( Mobile m )
        {
            ApplyBonus( m.FindItemOnLayer( Layer.Gloves ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Pants ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.Arms ) as BaseArmor );
            ApplyBonus( m.FindItemOnLayer( Layer.InnerTorso ) as BaseArmor );

            // +10 dex (total)
            m.AddStatMod( new StatMod( StatType.Dex, "AssassinSetDex", 12, TimeSpan.Zero ) );

            // +30 stealth (total)
            SkillMod skillmod = new DefaultSkillMod( SkillName.Stealth, true, 30.0 );
            skillmod.ObeyCap = true;
            m_Table.Add( m, skillmod );
            m.AddSkillMod( skillmod );

            m.SendLocalizedMessage( 1072391 ); // The magic of your armor combines to assist you!

            Effects.PlaySound( m.Location, m.Map, 503 );
            m.FixedParticles( 0x376A, 9, 32, 5030, EffectLayer.Waist );
        }
Exemple #29
0
        public static void AddBonus(Mobile m)
        {
            if (_Table == null)
            {
                _Table = new Dictionary <Mobile, Tuple <bool, DateTime, SkillMod> >();
            }

            DefaultSkillMod mod = new DefaultSkillMod(SkillName.Carpentry, true, 5.0);

            mod.ObeyCap = false;
            m.AddSkillMod(mod);

            _Table[m] = new Tuple <bool, DateTime, SkillMod>(true, DateTime.UtcNow, mod);

            if (_Timer == null)
            {
                _Timer          = Timer.DelayCall(TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1), CheckTable);
                _Timer.Priority = TimerPriority.FiveSeconds;
                _Timer.Start();
            }
        }
            public void Apply()
            {
                if (m_Mods == null)
                {
                    return;
                }

                for (var i = 0; i < m_Mods.Count; ++i)
                {
                    var mod = m_Mods[i];

                    if (mod is ResistanceMod resistanceMod)
                    {
                        m_Mobile.AddResistanceMod(resistanceMod);
                    }
                    else if (mod is SkillMod skillMod)
                    {
                        m_Mobile.AddSkillMod(skillMod);
                    }
                }
            }
Exemple #31
0
        public void Target(Mobile m)
        {
            if (!(m is BaseCreature || m is PlayerMobile))
            {
                Caster.SendLocalizedMessage(1060508);                   // You can't curse that.
            }
            else if (CheckHSequence(m))
            {
                SpellHelper.Turn(Caster, m);

                SpellHelper.CheckReflect((int)this.Circle, Caster, ref m);

                /* Curses the target so that the next harmful event that affects them is magnified.
                 * Damage to the target's hit points is increased 25%,
                 * the poison level of the attack will be 1 higher
                 * and the Resist Magic skill of the target will be fixed on 50.
                 *
                 * The effect lasts for one harmful event only.
                 */

                m.PlaySound(0xFC);
                Effects.SendTargetParticles(m, 0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
                Effects.SendTargetParticles(m, 0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);

                if (!m_Table.Contains(m))
                {
                    SkillMod mod = new DefaultSkillMod(SkillName.Concentration, false, m.Skills[SkillName.Concentration].Value + (Caster.Skills[SkillName.ArtMagique].Value / 2));

                    m.AddSkillMod(mod);

                    m_Table[m] = mod;
                }

                TimeSpan duration = TimeSpan.FromSeconds(0);

                Timer.DelayCall(duration, new TimerStateCallback(EffectExpire_Callback), m);
            }

            FinishSequence();
        }
Exemple #32
0
        public void ApplyEffects(Mobile m, double strength = 1.0)
        {
            /* Curses the target so that the next harmful event that affects them is magnified.
             * Damage to the target's hit points is increased 25%,
             * the poison level of the attack will be 1 higher
             * and the Resist Magic skill of the target will be fixed on 50.
             *
             * The effect lasts for one harmful event only.
             */

            if (m.Spell != null)
            {
                m.Spell.OnCasterHurt();
            }

            m.PlaySound(0xFC);
            m.FixedParticles(0x3728, 1, 13, 9912, 1150, 7, EffectLayer.Head);
            m.FixedParticles(0x3779, 1, 15, 9502, 67, 7, EffectLayer.Head);

            if (!m_Table.Contains(m))
            {
                SkillMod mod = new DefaultSkillMod(SkillName.MagicResist, false, 50.0);

                if (m.Skills[SkillName.MagicResist].Base > 50.0)
                {
                    m.AddSkillMod(mod);
                }

                m_Table[m] = mod;
            }

            TimeSpan duration = TimeSpan.FromSeconds(((Caster.Skills[SkillName.SpiritSpeak].Value / 12) + 1.0) * strength);

            Timer.DelayCall(duration, new TimerStateCallback(EffectExpire_Callback), m);

            this.HarmfulSpell(m);

            BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.EvilOmen, 1075647, 1075648, duration, m));
        }
Exemple #33
0
        public static void ApplySkillLoss(Mobile mob)
        {
            SkillLossContext context = (SkillLossContext)m_SkillLoss[mob];

            if (context != null)
            {
                return;
            }

            context          = new SkillLossContext();
            m_SkillLoss[mob] = context;

            ArrayList mods = context.m_Mods = new ArrayList();

            int      ShortsLost      = mob.ShortTermMurders / 2;
            double   SkillLossFactor = Math.Min(ShortsLost * 0.01, 0.5);                    //1 percent per short. Max 50%.
            TimeSpan SkillLossPeriod = TimeSpan.FromMinutes(10 + Math.Min(50, ShortsLost)); //10 to 60 minutes.

            //mob.ShortTermMurders -= ShortsLost; //Lose half your shorts. Disable till title system set up.

            for (int i = 0; i < mob.Skills.Length; ++i)
            {
                Skill  sk        = mob.Skills[i];
                double baseValue = sk.Base;

                if (baseValue > 0)
                {
                    SkillMod mod = new DefaultSkillMod(sk.SkillName, true, -(baseValue * SkillLossFactor));

                    mods.Add(mod);
                    mob.AddSkillMod(mod);
                }
            }

            mob.SendMessage(String.Format("You have lost {0}% of your skill for {1} minutes for being a criminal.", (int)(SkillLossFactor * 100), 10 + Math.Min(50, ShortsLost)));

            context.m_Timer = Timer.DelayCall(SkillLossPeriod, new TimerStateCallback(ClearSkillLoss_Callback), mob);
        }
Exemple #34
0
            public InternalTimer(Mobile owner, int body, Souless m_Fake, AncientPeerSpell spell)
                : base(TimeSpan.FromSeconds(0))
            {
                m_Owner   = owner;
                m_OldBody = body;
                fake      = m_Fake;
                m_spell   = spell;

                int val = (int)owner.Skills[SkillName.Magery].Value;

                if (val > 100)
                {
                    val = 100;
                }
                double   loss2 = (0 - m_Owner.Skills[SkillName.Magery].Base);
                SkillMod sk2   = new DefaultSkillMod(SkillName.Magery, true, loss2);

                m_Owner.AddSkillMod(sk2);
                m_spell.m_PeerMod.Add(sk2);

                Delay    = TimeSpan.FromSeconds(val);
                Priority = TimerPriority.TwoFiftyMS;
            }
Exemple #35
0
		public static MorphResult Morph(Mobile m, int entryID)
		{
			if (entryID < 0 || entryID >= m_Entries.Length)
				return MorphResult.Fail;

			AnimalFormEntry entry = m_Entries[entryID];

			m_LastAnimalForms[m] = entryID;	//On OSI, it's the last /attempted/ one not the last succeeded one

			if (m.Skills.Ninjitsu.Value < entry.ReqSkill)
			{
				string args = String.Format("{0}\t{1}\t ", entry.ReqSkill.ToString("F1"), SkillName.Ninjitsu);
				m.SendLocalizedMessage(1063013, args); // You need at least ~1_SKILL_REQUIREMENT~ ~2_SKILL_NAME~ skill to use that ability.
				return MorphResult.NoSkill;
			}

			/*
			if( !m.CheckSkill( SkillName.Ninjitsu, entry.ReqSkill, entry.ReqSkill + 37.5 ) )
				return MorphResult.Fail;
			 *
			 * On OSI,it seems you can only gain starting at '0' using Animal form.
			*/

			double ninjitsu = m.Skills.Ninjitsu.Value;

			if (ninjitsu < entry.ReqSkill + 37.5)
			{
				double chance = (ninjitsu - entry.ReqSkill) / 37.5;

				if (chance < Utility.RandomDouble())
					return MorphResult.Fail;
			}

			m.CheckSkill(SkillName.Ninjitsu, 0.0, 37.5);

            if (!BaseFormTalisman.EntryEnabled(m, entry.Type))
                return MorphResult.Success; // Still consumes mana, just no effect

            BaseMount.Dismount(m);

            int bodyMod = entry.BodyMod;
            int hueMod = entry.HueMod;
            string namemod = entry.NameMod;

            m.BodyMod = bodyMod;
            m.HueMod = hueMod;
            m.NameMod = namemod; //Vinds : animal form anonymise, après tout, c'est pour les métiers de l'ombre

            if (entry.SpeedBoost)  
                m.Send(SpeedControl.MountSpeed);


			SkillMod mod = null;

			if (entry.StealthBonus)
			{
				mod = new DefaultSkillMod(SkillName.Stealth, true, 20.0);
				mod.ObeyCap = true;
				m.AddSkillMod(mod);
			}

			SkillMod stealingMod = null;

			if (entry.StealingBonus)
			{
				stealingMod = new DefaultSkillMod(SkillName.Stealing, true, 10.0);
				stealingMod.ObeyCap = true;
				m.AddSkillMod(stealingMod);
			}

            Timer timer = new AnimalFormTimer(m, bodyMod, hueMod);
			timer.Start();

			AddContext(m, new AnimalFormContext(timer, mod, entry.SpeedBoost, entry.Type, stealingMod));
			m.CheckStatTimers();
			return MorphResult.Success;
		}
		public override void SpellEffect( Mobile target )
		{
			if ( target == Caster )
				return;

			target.SendMessage( "You breath in a noxious gas" );

			// Done primarly to draw aggro.
			SpellHelper.Damage( this, target, GetDamage( Caster, target, DamageSkill, 0.5 ), 0, 0, 100, 0, 0 );

			if ( target == null )
				return;

			int dc = 10 + (int)ScaleBySkill( Caster, DamageSkill );
			int debuff = (int)( ScaleBySkill( Caster, DamageSkill ) / 2 );
			debuff = -debuff;
			bool totalfail = true;

			StringBuilder sb = new StringBuilder();
			sb.Append( "You see " );
			sb.Append( target.Name );
			sb.Append( " suffer penalties to:" );

			if ( FullPower() )
				dc += 120;

			if ( !SavingThrow( target, DDSave.Will, dc ) )
			{
				Slow.SlowWalk( target, dc*2 );
				target.SendMessage( "You have been slowed" );
				sb.Append (" Speed" );
				totalfail = false;
			}

			if ( !SavingThrow( target, DDSave.Fort, dc ) )
			{
				target.AddSkillMod( new TimedSkillMod( SkillName.Tactics, true, debuff, TimeSpan.FromSeconds( dc*2 ) ) );
				target.AddStatMod( new StatMod( StatType.Str, "Bad Breath Str", debuff, TimeSpan.FromSeconds( dc*2 ) ) );
				target.AddStatMod( new StatMod( StatType.Dex, "Bad Breath Dex", debuff, TimeSpan.FromSeconds( dc*2 ) ) );
				target.AddStatMod( new StatMod( StatType.Int, "Bad Breath Int", debuff, TimeSpan.FromSeconds( dc*2 ) ) );
				sb.Append( " Tactics" );
				totalfail = false;

				if ( dc > 120 )
					target.AddSkillMod( new TimedSkillMod( SkillName.MagicResist, true, debuff, TimeSpan.FromSeconds( dc*2 ) ) );
			}

			if ( !SavingThrow( target, DDSave.Refl, dc ) )
			{
				ResistanceMod[] mods =
				{
					new ResistanceMod( ResistanceType.Physical, debuff ),
					new ResistanceMod( ResistanceType.Fire, debuff ),
					new ResistanceMod( ResistanceType.Cold, debuff ),
					new ResistanceMod( ResistanceType.Poison, debuff ),
					new ResistanceMod( ResistanceType.Energy, debuff )
				};

				for ( int i = 0; i < mods.Length; ++i )
					target.AddResistanceMod( mods[i] );

				TimedResistanceMod.AddMod( target, "Bad Breath", mods, TimeSpan.FromSeconds( Caster.Skills[DamageSkill].Value ) );
				sb.Append( " Resistance" );
				totalfail = false;
			}

			if ( dc > 120 )
			{
				target.ApplyPoison( Caster, Poison.Greater );
			}

			if ( totalfail )
				Caster.SendMessage( target.Name + " saved against your spell." );
			else
				Caster.SendMessage( sb.ToString() );
		}
		public override bool OnEquip(Mobile from)
		{
			int strBonus = m_AosAttributes.BonusStr;
			int dexBonus = m_AosAttributes.BonusDex;
			int intBonus = m_AosAttributes.BonusInt;

			if ((strBonus != 0 || dexBonus != 0 || intBonus != 0))
			{
				Mobile m = from;

				string modName = Serial.ToString();

				if (strBonus != 0)
				{
					m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));
				}

				if (dexBonus != 0)
				{
					m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));
				}

				if (intBonus != 0)
				{
					m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
				}
			}

			from.NextCombatTime = Core.TickCount + (int)GetDelay(from).TotalMilliseconds;

			if (UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular)
			{
				if (m_SkillMod != null)
				{
					m_SkillMod.Remove();
				}

				m_SkillMod = new DefaultSkillMod(AccuracySkill, true, (int)m_AccuracyLevel * 5);
				from.AddSkillMod(m_SkillMod);
			}

			if (Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30)
			{
				if (m_MageMod != null)
				{
					m_MageMod.Remove();
				}

				m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon);
				from.AddSkillMod(m_MageMod);
			}

			XmlAttach.CheckOnEquip(this, from);

			return true;
		}
Exemple #38
0
        public static void ApplySkillLoss(Mobile mob)
        {
            if (InSkillLoss(mob))
                return;

            SkillLossContext context = new SkillLossContext();
            m_SkillLoss[mob] = context;

            List<SkillMod> mods = context.m_Mods = new List<SkillMod>();

            for (int i = 0; i < mob.Skills.Length; ++i)
            {
                Skill sk = mob.Skills[i];
                double baseValue = sk.Base;

                if (baseValue > 0)
                {
                    SkillMod mod = new DefaultSkillMod(sk.SkillName, true, -(baseValue * SkillLossFactor));

                    mods.Add(mod);
                    mob.AddSkillMod(mod);
                }
            }

            context.m_Timer = Timer.DelayCall(SkillLossPeriod, new TimerStateCallback(ClearSkillLoss_Callback), mob);
        }
		private void SetMods( Mobile wearer )
		{
	
	wearer.AddSkillMod(m_SkillMod6);
	;
		}
Exemple #40
0
		public override bool OnEquip( Mobile from )
		{

			try
			{
				/*
				int strBonus = m_AosAttributes.BonusStr;
				int dexBonus = m_AosAttributes.BonusDex;
				int intBonus = m_AosAttributes.BonusInt;

				if ((strBonus != 0 || dexBonus != 0 || intBonus != 0))
				{
					Mobile m = from;

					string modName = this.Serial.ToString();

					if (strBonus != 0)
						m.AddStatMod(new StatMod(StatType.Str, modName + "Str", strBonus, TimeSpan.Zero));

					if (dexBonus != 0)
						m.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero));

					if (intBonus != 0)
						m.AddStatMod(new StatMod(StatType.Int, modName + "Int", intBonus, TimeSpan.Zero));
				}
				*/

				from.NextCombatTime = DateTime.Now + GetDelay(from);

				if (UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular)
				{
					if (m_SkillMod != null)
						m_SkillMod.Remove();

					m_SkillMod = new DefaultSkillMod(SkillName.Tactics, true, (int)m_AccuracyLevel * 5);
					from.AddSkillMod(m_SkillMod);
				}

				/*
				if (Core.AOS && m_AosWeaponAttributes.MageWeapon != 0)
				{
					if (m_MageMod != null)
						m_MageMod.Remove();

					m_MageMod = new DefaultSkillMod(SkillName.Magery, true, -m_AosWeaponAttributes.MageWeapon);
					from.AddSkillMod(m_MageMod);
				}
				*/
			}
			catch (Exception ex)
			{
				LogHelper.LogException(ex);
				if (from is PlayerMobile)
				{
					PlayerMobile pm = (PlayerMobile)from;
					Console.WriteLine("Exception" + ex + from.Name);
				}
				else
					Console.WriteLine("Exception" + ex);
			}

			return true;
		}
Exemple #41
0
        public override bool OnEquip(Mobile from)
        {
            if (!from.IsT2A)
                from.NextCombatTime = DateTime.UtcNow + GetDelay(from);

            if (UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular ||
                UseSkillMod && m_EthicState != null && m_EthicState.IsRunic)
            {
                if (m_SkillMod != null)
                {
                    m_SkillMod.Remove();
                }

                if (m_Identified && !(this is BaseRanged))
                {
                    if (m_EthicState == null || m_EthicState != null && !m_EthicState.IsRunic)
                    {
                        m_SkillMod = new DefaultSkillMod(AccuracySkill, true, (int) m_AccuracyLevel * 5);
                    }
                    else if (m_EthicState != null && m_EthicState.IsRunic)
                    {
                        m_SkillMod = new DefaultSkillMod(AccuracySkill, true, (int) WeaponAccuracyLevel.Exceedingly * 5);
                    }
                    from.AddSkillMod(m_SkillMod);
                }
                else if (m_Identified && this is BaseRanged)
                {
                    if (m_EthicState == null || m_EthicState != null && !m_EthicState.IsRunic)
                    {
                        m_SkillMod = new DefaultSkillMod(SkillName.Archery, true, (int)m_AccuracyLevel * 5);
                    }
                    else if (m_EthicState != null && m_EthicState.IsRunic)
                    {
                        m_SkillMod = new DefaultSkillMod(SkillName.Archery, true, (int)WeaponAccuracyLevel.Exceedingly * 5);
                    }
                    from.AddSkillMod(m_SkillMod);
                }
            }

            // XmlAttachment check for OnEquip
            XmlAttach.CheckOnEquip(this, from);

            // true if return override
            if (XmlScript.HasTrigger(this, TriggerName.onEquip) &&
                UberScriptTriggers.Trigger(this, from, TriggerName.onEquip))
            {
                return false;
            }

            return true;
        }
Exemple #42
0
		public override bool OnEquip( Mobile from )
		{
			from.NextCombatTime = DateTime.Now + GetDelay( from );

			if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular )
			{
				if ( m_SkillMod != null )
					m_SkillMod.Remove();

				m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
				from.AddSkillMod( m_SkillMod );
			}

			return true;
		}
 public override bool OnEquip(Mobile m)
 {
     base.OnEquip(m);
     if (Charges >= 1 && m_SkillMod == null)
     {
         m_SkillMod = new DefaultSkillMod(SkillName.Fishing, true, 1);
         m.AddSkillMod(m_SkillMod);
     }
     return true;
 }
Exemple #44
0
		public override void OnTrigger(object activator, Mobile m)
		{
			if(m == null || (RequireIdentification && !m_Identified)) return;

			if((AttachedTo is BaseArmor || AttachedTo is BaseWeapon) && (((Item)AttachedTo).Layer != Layer.Invalid))
			{
				// when activated via speech will apply mod when equipped by the speaker
				SkillMod sm = new EquipedSkillMod( m_Skill, true, m_Value, (Item)AttachedTo, m );
				m.AddSkillMod( sm );
				// and then remove the attachment
				Delete();
			} 
			else
			{
				// when activated it will apply the skill mod that will last for the specified duration
				SkillMod sm = new TimedSkillMod( m_Skill, true, m_Value, m_Duration );
				m.AddSkillMod( sm );
				// and then remove the attachment
				Delete();
			}
		}
Exemple #45
0
        public override void OnTrigger(object activator, Mobile m)
        {
            if (m == null || this.Word == null || (this.RequireIdentification && !this.m_Identified))
                return;

            if (DateTime.Now < this.m_EndTime)
                return;

            string msgstr = "Activating the power of " + this.Word;

            // assign powers to certain words
            switch ( this.Word )
            {
                case "Shoda":
                    m.AddStatMod(new StatMod(StatType.Int, "Shoda", 20, this.Duration));
                    m.SendMessage("Your mind expands!");
                    break;
                case "Malik":
                    m.AddStatMod(new StatMod(StatType.Str, "Malik", 20, this.Duration));
                    m.SendMessage("Your strength surges!");
                    break;
                case "Lepto":
                    m.AddStatMod(new StatMod(StatType.Dex, "Lepto", 20, this.Duration));
                    m.SendMessage("You are more nimble!");
                    break;
                case "Velas":
                    Timer.DelayCall(TimeSpan.Zero, new TimerStateCallback(Hide_Callback), new object[] { m });
                    m.SendMessage("You disappear!");
                    break;
                case "Tarda":
                    m.AddSkillMod(new TimedSkillMod(SkillName.Tactics, true, 20, this.Duration));
                    m.SendMessage("You are more skillful warrior!");
                    break;
                case "Marda":
                    m.AddSkillMod(new TimedSkillMod(SkillName.Magery, true, 20, this.Duration));
                    m.SendMessage("You are more skillful mage!");
                    break;
                case "Vas Malik":
                    m.AddStatMod(new StatMod(StatType.Str, "Vas Malik", 40, this.Duration));
                    m.SendMessage("You are exceptionally strong!");
                    break;
                case "Nartor":
                    BaseCreature b = new Drake();
                    b.MoveToWorld(m.Location, m.Map);
                    b.Owners.Add(m);
                    b.SetControlMaster(m);
                    if (b.Controlled)
                        m.SendMessage("You master the beast!");
                    break;
                case "Santor":
                    b = new Horse();
                    b.MoveToWorld(m.Location, m.Map);
                    b.Owners.Add(m);
                    b.SetControlMaster(m);
                    if (b.Controlled)
                        m.SendMessage("You master the beast!");
                    break;
                default:
                    m.SendMessage("There is no effect.");
                    break;
            }
            
            // display activation effects
            Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x3728, 8, 20, 5042);
            Effects.PlaySound(m, m.Map, 0x201);

            // display a message over the item it was attached to
            if (this.AttachedTo is Item)
            {
                ((Item)this.AttachedTo).PublicOverheadMessage(MessageType.Regular, 0x3B2, true, msgstr);
            }
            
            this.Charges--;

            // remove the attachment after the charges run out
            if (this.Charges == 0)
            {
                this.Delete();
            }
            else
            {
                this.m_EndTime = DateTime.Now + this.Refractory;
            }
        }
        public void Discord(Mobile target)
        {
            if (Utility.RandomDouble() < 0.9)
            {
                target.AddSkillMod(new TimedSkillMod(SkillName.Magery, true, this.Combatant.Skills.Magery.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Necromancy, true, this.Combatant.Skills.Necromancy.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Tactics, true, this.Combatant.Skills.Tactics.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Swords, true, this.Combatant.Skills.Swords.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Meditation, true, this.Combatant.Skills.Meditation.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Focus, true, this.Combatant.Skills.Focus.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Chivalry, true, this.Combatant.Skills.Chivalry.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Wrestling, true, this.Combatant.Skills.Wrestling.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));
                target.AddSkillMod(new TimedSkillMod(SkillName.Spellweaving, true, this.Combatant.Skills.Spellweaving.Base * this.DiscordModifier * -1, TimeSpan.FromSeconds(this.DiscordDuration)));

                Timer.DelayCall(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(1), (int)this.DiscordDuration, new TimerStateCallback(Animate), target);

                target.SendMessage("The Lich's touch weakens all of your fighting skills!");
                target.PlaySound(0x458);////
            }
            else
            {
                target.SendMessage("The Lich barely misses touching you, saving you from harm!"); 
                target.PlaySound(0x458);/////
            }

            this.m_NextDiscordTime = DateTime.UtcNow + TimeSpan.FromSeconds(this.DiscordMinDelay + Utility.RandomDouble() * this.DiscordMaxDelay);
        }
Exemple #47
0
        public override bool OnEquip( Mobile from )
        {
            int strBonus = m_AosAttributes.BonusStr;
            int dexBonus = m_AosAttributes.BonusDex;
            int intBonus = m_AosAttributes.BonusInt;

            if ( (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
            {
                Mobile m = from;

                string modName = this.Serial.ToString();

                if ( strBonus != 0 )
                    m.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

                if ( dexBonus != 0 )
                    m.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

                if ( intBonus != 0 )
                    m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
            }

            from.NextCombatTime = DateTime.Now + GetDelay( from );

            if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular )
            {
                if ( m_SkillMod != null )
                    m_SkillMod.Remove();

                m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
                from.AddSkillMod( m_SkillMod );
            }

            return true;
        }
		public override bool OnEquip( Mobile from )
		{
			int strBonus = m_AosAttributes.BonusStr;
			int dexBonus = m_AosAttributes.BonusDex;
			int intBonus = m_AosAttributes.BonusInt;

			if ( (strBonus != 0 || dexBonus != 0 || intBonus != 0) )
			{
				Mobile m = from;

				string modName = this.Serial.ToString();

				if ( strBonus != 0 )
					m.AddStatMod( new StatMod( StatType.Str, modName + "Str", strBonus, TimeSpan.Zero ) );

				if ( dexBonus != 0 )
					m.AddStatMod( new StatMod( StatType.Dex, modName + "Dex", dexBonus, TimeSpan.Zero ) );

				if ( intBonus != 0 )
					m.AddStatMod( new StatMod( StatType.Int, modName + "Int", intBonus, TimeSpan.Zero ) );
			}

			from.NextCombatTime = DateTime.Now + GetDelay( from );

			if ( UseSkillMod && m_AccuracyLevel != WeaponAccuracyLevel.Regular )
			{
				if ( m_SkillMod != null )
					m_SkillMod.Remove();

				m_SkillMod = new DefaultSkillMod( AccuracySkill, true, (int)m_AccuracyLevel * 5 );
				from.AddSkillMod( m_SkillMod );
			}

			if ( Core.AOS && m_AosWeaponAttributes.MageWeapon != 0 && m_AosWeaponAttributes.MageWeapon != 30 )
			{
				if ( m_MageMod != null )
					m_MageMod.Remove();

				m_MageMod = new DefaultSkillMod( SkillName.Magery, true, -30 + m_AosWeaponAttributes.MageWeapon );
				from.AddSkillMod( m_MageMod );
			}

				// XmlAttachment check for OnEquip
	Server.Engines.XmlSpawner2.XmlAttach.CheckOnEquip(this, from);

	return true;
		}
		public static void ApplySkillLoss(Mobile mob)
		{
			var pm = mob as PlayerMobile;

			if (pm == null || pm.StatEnd < DateTime.UtcNow)
			{
				return;
			}

			try
			{
				TimeSpan lossperiod = pm.StatEnd - DateTime.UtcNow;
				double loss = 0.40; // 40% loss

				ClearSkillLoss(pm);

				var context = new SkillLossContext();
				m_SkillLoss[pm] = context;

				List<SkillMod> mods = context.m_SkillMods = new List<SkillMod>();

				foreach (Skill sk in pm.Skills)
				{
					double baseValue = sk.Base;

					if (baseValue > 0)
					{
						SkillMod mod = new DefaultSkillMod(sk.SkillName, true, -(baseValue * loss));

						mods.Add(mod);
						mob.AddSkillMod(mod);
					}
				}

				mob.AddStatMod(new StatMod(StatType.Str, "Murder Penalty Str", -(int)(mob.RawStr * loss), lossperiod));
				mob.AddStatMod(new StatMod(StatType.Dex, "Murder Penalty Dex", -(int)(mob.RawDex * loss), lossperiod));
				mob.AddStatMod(new StatMod(StatType.Int, "Murder Penalty Int", -(int)(mob.RawInt * loss), lossperiod));

				context.m_Timer = Timer.DelayCall(lossperiod, m => ClearSkillLoss(m), mob);
			}
			catch
			{ }
		}
Exemple #50
0
        public void Suppress( Mobile target )
        {
            if ( target == null || m_Suppressed.ContainsKey( target ) || Deleted || !Alive || m_NextSuppress > DateTime.Now || 0.1 < Utility.RandomDouble() )
                return;

            TimeSpan delay = TimeSpan.FromSeconds( Utility.RandomMinMax( 20, 80 ) );

            if ( !target.Hidden && CanBeHarmful( target ) )
            {
                target.SendLocalizedMessage( 1072061 ); // You hear jarring music, suppressing your strength.

                for ( int i = 0; i < target.Skills.Length; i++ )
                {
                    Skill s = target.Skills[ i ];

                    target.AddSkillMod( new TimedSkillMod( s.SkillName, true, s.Base * -0.28, delay ) );
                }

                int count = (int) Math.Round( delay.TotalSeconds / 1.25 );
                Timer timer = new AnimateTimer( target, count );
                m_Suppressed.Add( target, timer );
                timer.Start();

                PlaySound( 0x58C );
            }

            m_NextSuppress = DateTime.Now + TimeSpan.FromSeconds( 10 );
        }
Exemple #51
0
		private void SetMods( Mobile m )
		{
			m.AddSkillMod( skillMod );
		}
Exemple #52
0
 private void SetMods(Mobile wearer)
 { 
     wearer.AddSkillMod(this.m_SkillMod0); 
 }