Пример #1
0
		public void Polymorph( Mobile m )
		{
			if ( !m.CanBeginAction( typeof( PolymorphSpell ) ) || !m.CanBeginAction( typeof( IncognitoSpell ) ) || m.IsBodyMod )
				return;

			IMount mount = m.Mount;

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

			if ( m.Mounted )
				return;

			if ( m.BeginAction( typeof( PolymorphSpell ) ) )
			{
				Item disarm = m.FindItemOnLayer( Layer.OneHanded );

				if ( disarm != null && disarm.Movable )
					m.AddToBackpack( disarm );

				disarm = m.FindItemOnLayer( Layer.TwoHanded );

				if ( disarm != null && disarm.Movable )
					m.AddToBackpack( disarm );

				m.BodyMod = 42;
				m.HueMod = 0;

				new ExpirePolymorphTimer( m ).Start();
			}
		}
Пример #2
0
        public bool ValidateUse(Mobile from)
        {
            PlayerMobile pm = from as PlayerMobile;

            if (!this.IsChildOf(from.Backpack))
            {
                // That must be in your pack for you to use it.
                from.SendLocalizedMessage(1042001);
            }
            else if (pm == null || pm.NpcGuild != NpcGuild.ThievesGuild)
            {
                // Only Members of the thieves guild are trained to use this item.
                from.SendLocalizedMessage(501702);
            }
            else if (Stealing.SuspendOnMurder && pm.Kills > 0)
            {
                // You are currently suspended from the thieves guild.  They would frown upon your actions.
                from.SendLocalizedMessage(501703);
            }
            else if (!from.CanBeginAction(typeof(IncognitoSpell)))
            {
                // You cannot disguise yourself while incognitoed.
                from.SendLocalizedMessage(501704);
            }
            else if (Factions.Sigil.ExistsOn(from))
            {
                from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil
            }
            else if (TransformationSpellHelper.UnderTransformation(from))
            {
                // You cannot disguise yourself while in that form.
                from.SendLocalizedMessage(1061634);
            }
            else if (from.BodyMod == 183 || from.BodyMod == 184)
            {
                // You cannot disguise yourself while wearing body paint
                from.SendLocalizedMessage(1040002);
            }
            else if (!from.CanBeginAction(typeof(PolymorphSpell)) || from.IsBodyMod)
            {
                // You cannot disguise yourself while polymorphed.
                from.SendLocalizedMessage(501705);
            }
            else
            {
                return true;
            }

            return false;
        }
Пример #3
0
		public override void OnDoubleClick(Mobile from)
		{
			if (IsChildOf(from.Backpack))
			{
				if (Sigil.ExistsOn(from))
				{
					from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil.
				}
				else if (!from.CanBeginAction(typeof(IncognitoSpell)))
				{
					from.SendLocalizedMessage(501698); // You cannot disguise yourself while incognitoed.
				}
				else if (!from.CanBeginAction(typeof(PolymorphSpell)))
				{
					from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
				}
				else if (TransformationSpellHelper.UnderTransformation(from))
				{
					from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
				}
				else if (from.IsBodyMod || from.FindItemOnLayer(Layer.Helm) is OrcishKinMask)
				{
					from.SendLocalizedMessage(501605); // You are already disguised.
				}
				else
				{
					from.BodyMod = (from.Female ? 184 : 183);
					from.HueMod = Hue;

                    if (from is PlayerMobile && Hue == 1358)
				    {
				        ((PlayerMobile) from).HalloweenPaintExpirationOrange = TimeSpan.FromDays(7.0);
				    }
				    else
				    {
                        ((PlayerMobile)from).HalloweenPaintExpirationPurple = TimeSpan.FromDays(7.0);			        
				    }

					from.SendMessage("Well, aren't you spooky looking now?.");
						// You now bear the markings of the savage tribe.  Your body paint will last about a week or you can remove it with an oil cloth.

					Consume();
				}
			}
			else
			{
				from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
			}
		}
Пример #4
0
		public override void OnDoubleClick(Mobile from)
		{
			if (IsChildOf(from.Backpack))
			{
				if (Sigil.ExistsOn(from))
				{
					from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil.
				}
				else if (!from.CanBeginAction(typeof(IncognitoSpell)))
				{
					from.SendLocalizedMessage(501698); // You cannot disguise yourself while incognitoed.
				}
				else if (!from.CanBeginAction(typeof(PolymorphSpell)))
				{
					from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
				}
				else if (TransformationSpellHelper.UnderTransformation(from))
				{
					from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
				}
				else if (from.IsBodyMod || from.FindItemOnLayer(Layer.Helm) is OrcishKinMask)
				{
					from.SendLocalizedMessage(501605); // You are already disguised.
				}
				else
				{
					from.BodyMod = (from.Female ? 184 : 183);
					from.HueMod = Hue;

				    if (from is PlayerMobile && Hue == 61)
				    {
				        ((PlayerMobile) from).ZombiePaintExperationBooger = TimeSpan.FromDays(7.0);
				    }
				    else
				    {
                        ((PlayerMobile)from).ZombiePaintExperationVesper = TimeSpan.FromDays(7.0);			        
				    }

					from.SendMessage("You have painted yourself with zombie juices.  Yuck.");

					Consume();
				}
			}
			else
			{
				from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
			}
		}
Пример #5
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1040019 ); // The bola must be in your pack to use it.
			}
			else if ( !from.CanBeginAction( typeof( Bola ) ) )
			{
				from.SendLocalizedMessage( 1049624 ); // You have to wait a few moments before you can use another bola!
			}
			else if ( from.Target is BolaTarget )
			{
				from.SendLocalizedMessage( 1049631 ); // This bola is already being used.
			}
			else if ( !HasFreeHands( from ) )
			{
				from.SendLocalizedMessage( 1040015 ); // Your hands must be free to use this
			}
			else if ( from.Mounted )
			{
				from.SendLocalizedMessage( 1040016 ); // You cannot use this while riding a mount
			}
			else if ( Server.Spells.Ninjitsu.AnimalForm.UnderTransformation( from ) )
			{
				from.SendLocalizedMessage( 1070902 ); // You can't use this while in an animal form!
			}
			else
			{
				EtherealMount.StopMounting( from );

				from.Target = new BolaTarget( this );
				from.LocalOverheadMessage( MessageType.Emote, 0x3B2, 1049632 ); // * You begin to swing the bola...*
				from.NonlocalOverheadMessage( MessageType.Emote, 0x3B2, 1049633, from.Name ); // ~1_NAME~ begins to menacingly swing a bola...
			}
		}
Пример #6
0
		private bool CheckUse( Mobile from )
		{
			if ( !IsAccessibleTo( from ) )
				return false;

			if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS(this) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
				return false;
			}

			if ( !from.CanBeginAction( typeof( FireHorn ) ) )
			{
				from.SendLocalizedMessage( 1049615 ); // You must take a moment to catch your breath.
				return false;
			}

			int sulfAsh = Core.AOS ? 4 : 15;
			if ( from.Backpack == null || from.Backpack.GetAmount( typeof( SulfurousAsh ) ) < sulfAsh )
			{
				from.SendLocalizedMessage( 1049617 ); // You do not have enough sulfurous ash.
				return false;
			}

			return true;
		}
Пример #7
0
		public static bool VerifyCast( Mobile Caster, bool messages )
		{
			if( Caster == null ) // Sanity
				return false;

			BaseWeapon weap = Caster.FindItemOnLayer( Layer.OneHanded ) as BaseWeapon;

			if( weap == null )
				weap = Caster.FindItemOnLayer( Layer.TwoHanded ) as BaseWeapon;

			if ( weap != null ) {
				if ( Core.ML && Caster.Skills[weap.Skill].Base < 50 ) {
					if ( messages ) {
						Caster.SendLocalizedMessage( 1076206 ); // Your skill with your equipped weapon must be 50 or higher to use Evasion.
					}
					return false;
				}
			} else if ( !( Caster.FindItemOnLayer( Layer.TwoHanded ) is BaseShield ) ) {
				if ( messages ) {
					Caster.SendLocalizedMessage( 1062944 ); // You must have a weapon or a shield equipped to use this ability!
				}
				return false;
			}

			if ( !Caster.CanBeginAction( typeof( Evasion ) ) ) {
				if ( messages ) {
					Caster.SendLocalizedMessage( 501789 ); // You must wait before trying again.
				}
				return false;
			}

			return true;
		}
Пример #8
0
        public static TimeSpan OnUse( Mobile m )
        {
            if ( !m.Hidden )
            {
                m.SendLocalizedMessage( 502725 ); // You must hide first
            }
            else if ( m.Skills[SkillName.Hiding].Base < ((Core.ML) ? 30.0 : (Core.SE) ? 50.0 : 80.0) )
            {
                m.SendLocalizedMessage( 502726 ); // You are not hidden well enough.  Become better at hiding.
                m.RevealingAction();
            }
            else if( !m.CanBeginAction( typeof( Stealth ) ) )
            {
                m.SendLocalizedMessage( 1063086 ); // You cannot use this skill right now.
                m.RevealingAction();
            }
            else
            {
                int armorRating = GetArmorRating( m );

                if( armorRating >= (Core.AOS ? 42 : 26) )	//I have a hunch '42' was chosen cause someone's a fan of DNA
                {
                    m.SendLocalizedMessage( 502727 ); // You could not hope to move quietly wearing this much armor.
                    m.RevealingAction();
                }
                else if( m.CheckSkill( SkillName.Stealth, -20.0 + (armorRating * 2), (Core.AOS ? 60.0 : 80.0) + (armorRating * 2) ) )
                {
                    int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.AOS ? 5.0 : 10.0));

                    if( steps < 1 )
                        steps = 1;

                    m.AllowedStealthSteps = steps;

            // ------ NERUN's DISTRO - Orc Scout bug fix -----
                    if ( m is PlayerMobile )
                    {
                        PlayerMobile pm = m as PlayerMobile; // IsStealthing should be moved to Server.Mobiles
                        pm.IsStealthing = true;
                    }
            /*
                    PlayerMobile pm = m as PlayerMobile; // IsStealthing should be moved to Server.Mobiles

                    if( pm != null )
                            pm.IsStealthing = true;
            */
            // ------ END
                    m.SendLocalizedMessage( 502730 ); // You begin to move quietly.

                    return TimeSpan.FromSeconds( 10.0 );
                }
                else
                {
                    m.SendLocalizedMessage( 502731 ); // You fail in your attempt to move unnoticed.
                    m.RevealingAction();
                }
            }

            return TimeSpan.FromSeconds( 10.0 );
        }
Пример #9
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            base.OnMovement(m, oldLocation);

            Tournament tourny = null;

            if (this.m_Tournament != null)
                tourny = this.m_Tournament.Tournament;

            if (this.InRange(m, 4) && !this.InRange(oldLocation, 4) && tourny != null && tourny.Stage == TournamentStage.Signup && m.CanBeginAction(this))
            {
                Ladder ladder = Ladder.Instance;

                if (ladder != null)
                {
                    LadderEntry entry = ladder.Find(m);

                    if (entry != null && Ladder.GetLevel(entry.Experience) < tourny.LevelRequirement)
                        return;
                }

                if (tourny.HasParticipant(m))
                    return;

                this.PrivateOverheadMessage(MessageType.Regular, 0x35, false, String.Format("Hello m'{0}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.Female ? "Lady" : "Lord"), m.NetState);
                m.BeginAction(this);
                Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(ReleaseLock_Callback), m);
            }
        }
Пример #10
0
        }// savage kin paint
        public override void OnDoubleClick(Mobile from)
        {
            if (this.IsChildOf(from.Backpack))
            {
                if (Factions.Sigil.ExistsOn(from))
                {
                    from.SendLocalizedMessage(1010465); // You cannot disguise yourself while holding a sigil.
                }
                else if (!from.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
                {
                    from.SendLocalizedMessage(501698); // You cannot disguise yourself while incognitoed.
                }
                else if (!from.CanBeginAction(typeof(Spells.Seventh.PolymorphSpell)))
                {
                    from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
                }
                else if (TransformationSpellHelper.UnderTransformation(from))
                {
                    from.SendLocalizedMessage(501699); // You cannot disguise yourself while polymorphed.
                }
                else if (Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
                {
                    from.SendLocalizedMessage(1061634); // You cannot disguise yourself while in that form.
                }
                else if (from.IsBodyMod || from.FindItemOnLayer(Layer.Helm) is OrcishKinMask)
                {
                    from.SendLocalizedMessage(501605); // You are already disguised.
                }
                else
                {
                    from.BodyMod = (from.Female ? 184 : 183);
                    from.HueMod = 0;

                    if (from is PlayerMobile)
                        ((PlayerMobile)from).SavagePaintExpiration = TimeSpan.FromDays(7.0);

                    from.SendLocalizedMessage(1042537); // You now bear the markings of the savage tribe.  Your body paint will last about a week or you can remove it with an oil cloth.

                    this.Consume();
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
Пример #11
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (!m.Hidden)
            {
                m.SendLocalizedMessage(502725); // You must hide first
            }
            else if (m.Skills[SkillName.Hiding].Base < HidingRequirement)
            {
                m.SendLocalizedMessage(502726); // You are not hidden well enough.  Become better at hiding.
                m.RevealingAction();
                BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
            }
            else if (!m.CanBeginAction(typeof(Stealth)))
            {
                m.SendLocalizedMessage(1063086); // You cannot use this skill right now.
                m.RevealingAction();
                BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
            }
            else
            {
                int armorRating = GetArmorRating(m);

                if (armorRating >= (Core.AOS ? 42 : 26)) //I have a hunch '42' was chosen cause someone's a fan of DNA
                {
                    m.SendLocalizedMessage(502727); // You could not hope to move quietly wearing this much armor.
                    m.RevealingAction();
                    BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
                }
                else if (m.CheckSkill(SkillName.Stealth, -20.0 + (armorRating * 2), (Core.AOS ? 60.0 : 80.0) + (armorRating * 2)))
                {
                    int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.AOS ? 5.0 : 10.0));

                    if (steps < 1)
                        steps = 1;

                    m.AllowedStealthSteps = steps;

                    PlayerMobile pm = m as PlayerMobile; // IsStealthing should be moved to Server.Mobiles

                    if (pm != null)
                        pm.IsStealthing = true;

                    m.SendLocalizedMessage(502730); // You begin to move quietly.

                    BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.HidingAndOrStealth, 1044107, 1075655));
                    return TimeSpan.FromSeconds(10.0);
                }
                else
                {
                    m.SendLocalizedMessage(502731); // You fail in your attempt to move unnoticed.
                    m.RevealingAction();
                    BuffInfo.RemoveBuff(m, BuffIcon.HidingAndOrStealth);
                }
            }

            return TimeSpan.FromSeconds(10.0);
        }
Пример #12
0
        public static double GetScalar( Mobile m )
        {
            double val = 1.0;

            if ( m.CanBeginAction( typeof( ClericDivineFocusSpell ) ) )
                val = 1.5;

            return val;
        }
Пример #13
0
		public bool ValidateUse( Mobile from )
		{
			PlayerMobile pm = from as PlayerMobile;

            if (!from.InRange(this.GetWorldLocation(), 1))
            {
                from.SendMessage("You are too far away.");
            }

            else if ( from.Skills.Forensics.Value < 80) 
            {
                from.SendMessage("You are not skilled enough in forensics.");
            }

            else if (!from.CanBeginAction(typeof(IncognitoSpell)))
            {
                // You cannot disguise yourself while incognitoed.
                from.SendLocalizedMessage(501704);
            }
            else if (TransformationSpellHelper.UnderTransformation(from))
            {
                // You cannot disguise yourself while in that form.
                from.SendLocalizedMessage(1061634);
            }
            else if (from.BodyMod == 183 || from.BodyMod == 184)
            {
                // You cannot disguise yourself while wearing body paint
                from.SendLocalizedMessage(1040002);
            }
            else if (!from.CanBeginAction(typeof(PolymorphSpell)) || from.IsBodyMod)
            {
                // You cannot disguise yourself while polymorphed.
                from.SendLocalizedMessage(501705);
            }
            else
            {
                return true;
            }

			return false;
		}
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
				from.SendLocalizedMessage( 1042010 ); // You must have the object in your backpack to use it.
			else if ( from.CanBeginAction( typeof( SnowPile ) ) )
			{
				from.SendLocalizedMessage( 1005575 ); // You carefully pack the snow into a ball...
				from.Target = new SnowTarget( from, this );
			}
			else
				from.SendLocalizedMessage( 1005574 ); // The snow is not ready to be packed yet.  Keep trying.
		}
Пример #15
0
		public static TimeSpan OnUse( Mobile m )
		{
			if ( !m.Hidden )
			{
				m.SendLocalizedMessage( 502725 ); // You must hide first
			}
			else if ( m.Skills[SkillName.Hiding].Base < HidingRequirement )
			{
				m.SendLocalizedMessage( 502726 ); // You are not hidden well enough.  Become better at hiding.
				m.RevealingAction();
			}
			else if( !m.CanBeginAction( typeof( Stealth ) ) )
			{
				m.SendLocalizedMessage( 1063086 ); // You cannot use this skill right now.
				m.RevealingAction();
			}
			else
			{
				int armorRating = GetArmorRating( m );

				if( armorRating >= 26 )
				{
					m.SendLocalizedMessage( 502727 ); // You could not hope to move quietly wearing this much armor.
					m.RevealingAction();
				}
				else if( m.CheckSkill( SkillName.Stealth, -20.0 + (armorRating * 2), 80.0 + (armorRating * 2) ) )
				{
					int steps = (int)(m.Skills[SkillName.Stealth].Value / 10.0);

					if( steps < 1 )
						steps = 1;

					m.AllowedStealthSteps = steps;

					PlayerMobile pm = m as PlayerMobile; // IsStealthing should be moved to Server.Mobiles

					if( pm != null )
						pm.IsStealthing = true;

					m.SendLocalizedMessage( 502730 ); // You begin to move quietly.

					return TimeSpan.FromSeconds( 10.0 );
				}
				else
				{
					m.SendLocalizedMessage( 502731 ); // You fail in your attempt to move unnoticed.
					m.RevealingAction();
				}
			}

			return TimeSpan.FromSeconds( 10.0 );
		}
Пример #16
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1040019); // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendLocalizedMessage(1049624); // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                from.SendLocalizedMessage(1049631); // This bola is already being used.
            }
            else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
            {
                from.SendLocalizedMessage(1040015); // Your hands must be free to use this
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1040016); // You cannot use this while riding a mount
            }
            else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
            {
                from.SendLocalizedMessage(1070902); // You can't use this while in an animal form!
            }
			else if (from.Flying)
			{
				from.SendLocalizedMessage(1113414); // You cannot use this while flying!
			}
            else
            {
                EtherealMount.StopMounting(from);

                if (Core.AOS)
                {
                    Item one = from.FindItemOnLayer(Layer.OneHanded);
                    Item two = from.FindItemOnLayer(Layer.TwoHanded);

                    if (one != null)
                        from.AddToBackpack(one);

                    if (two != null)
                        from.AddToBackpack(two);
                }

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632); // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Пример #17
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( m_Thorn.Deleted )
					return;

				if ( !m_Thorn.IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
					return;
				}

				if ( !from.CanBeginAction( typeof( GreenThorns ) ) )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061908 ); // * You must wait a while before planting another thorn. *
					return;
				}

				if ( from.Map != Map.Trammel && from.Map != Map.Felucca )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x2B2, true, "No solen lairs exist on this facet.  Try again in Trammel or Felucca." );
					return;
				}

				LandTarget land = targeted as LandTarget;

				if ( land == null )
				{
					from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061912 ); // * You cannot plant a green thorn there! *
				}
				else
				{
					GreenThornsEffect effect = GreenThornsEffect.Create( from, land );

					if ( effect == null )
					{
						from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061913 ); // * You sense it would be useless to plant a green thorn there. *
					}
					else
					{
						m_Thorn.Consume();

						from.LocalOverheadMessage( MessageType.Emote, 0x961, 1061914 ); // * You push the strange green thorn into the ground *
						from.NonlocalOverheadMessage( MessageType.Emote, 0x961, 1061915, from.Name ); // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. *

						from.BeginAction( typeof( GreenThorns ) );
						new GreenThorns.EndActionTimer( from ).Start();

						effect.Start();
					}
				}
			}
Пример #18
0
        public static TimeSpan OnUse( Mobile m )
        {
            m.SendAsciiMessage("This skill has been disabled for historical accuracy.");
            return TimeSpan.FromSeconds(0.0);

            if ( !m.Hidden )
            {
                m.SendLocalizedMessage( 502725 ); // You must hide first
            }
            else if ( m.Skills[SkillName.Hiding].Base < ((Core.SE) ? 50.0 : 80.0) )
            {
                m.SendLocalizedMessage( 502726 ); // You are not hidden well enough.  Become better at hiding.
                m.RevealingAction();
            }
            else if( !m.CanBeginAction( typeof( Stealth ) ) )
            {
                m.SendLocalizedMessage( 1063086 ); // You cannot use this skill right now.
                m.RevealingAction();
            }
            else
            {
                int armorRating = GetArmorRating( m );

                if( armorRating >= (Core.AOS ? 42 : 26) )	//I have a hunch '42' was chosen cause someone's a fan of DNA
                {
                    m.SendLocalizedMessage( 502727 ); // You could not hope to move quietly wearing this much armor.
                    m.RevealingAction();
                }
                else if( m.CheckSkill( SkillName.Stealth, -20.0 + (armorRating * 2), (Core.AOS ? 60.0 : 80.0) + (armorRating * 2) ) )
                {
                    int steps = (int)(m.Skills[SkillName.Stealth].Value / (Core.AOS ? 5.0 : 10.0));

                    if( steps < 1 )
                        steps = 1;

                    m.AllowedStealthSteps = steps;

                    m.SendLocalizedMessage( 502730 ); // You begin to move quietly.

                    return TimeSpan.FromSeconds( 10.0 );
                }
                else
                {
                    m.SendLocalizedMessage( 502731 ); // You fail in your attempt to move unnoticed.
                    m.RevealingAction();
                }
            }

            return TimeSpan.FromSeconds( 10.0 );
        }
Пример #19
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( from.CanBeginAction( this ) )
			{
				from.BeginAction( this );
				Timer.DelayCall<Mobile>( m_ShoutCooldown, EndLock, from );
			}

			MLQuestSystem.TurnToFace( this, from );
			from.SendGump( m_Gump );

			// Paperdoll doesn't open
			//base.OnDoubleClick( from );
		}
Пример #20
0
		public virtual bool Apply( Mobile from )
		{
			if (!from.CanBeginAction( typeof( BaseMega ) ) )
			{
				from.SendLocalizedMessage( 502173 ); // You are already under a similar effect.
				return false;
			}

			bool applied = Spells.SpellHelper.AddStatOffset( from, Type, Bonus, TimeSpan.FromSeconds( 30 ) );

			if ( applied )
				from.BeginAction( typeof( BaseMega ) );

			return true;
		}
Пример #21
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1040019);                   // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendLocalizedMessage(1049624);                   // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                from.SendLocalizedMessage(1049631);                   // This bola is already being used.
            }
            else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
            {
                from.SendLocalizedMessage(1040015);                   // Your hands must be free to use this
            }
            else if (from.Mounted)
            {
                from.SendLocalizedMessage(1040016);                   // You cannot use this while riding a mount
            }
            else if (Server.Spells.Ninjitsu.AnimalForm.UnderTransformation(from))
            {
                from.SendLocalizedMessage(1070902);                   // You can't use this while in an animal form!
            }
            else
            {
                EtherealMount.StopMounting(from);

                Item one = from.FindItemOnLayer(Layer.OneHanded);
                Item two = from.FindItemOnLayer(Layer.TwoHanded);

                if (one != null)
                {
                    from.AddToBackpack(one);
                }

                if (two != null)
                {
                    from.AddToBackpack(two);
                }

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);                   // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name);     // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Пример #22
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1040019, from.NetState); // The bola must be in your pack to use it.
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1049624, from.NetState); // // You have to wait a few moments before you can use another bola!
            }
            else if (from.Target is BolaTarget)
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1049631, from.NetState); // This bola is already being used.
            }
            else if (from.Mounted)
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1042053, from.NetState); // You can't use this while on a mount!
            }
            else if (from.Flying)
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1113414, from.NetState); // You can't use this while flying!
            }
            else if (AnimalForm.UnderTransformation(from))
            {
                PrivateOverheadMessage(MessageType.Regular, 946, 1070902, from.NetState); // You can't use this while in an animal form!
            }
            else
            {
                EtherealMount.StopMounting(from);

                Item one = from.FindItemOnLayer(Layer.OneHanded);
                Item two = from.FindItemOnLayer(Layer.TwoHanded);

                if (one != null)
                {
                    from.AddToBackpack(one);
                }

                if (two != null)
                {
                    from.AddToBackpack(two);
                }

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 201, 1049632);               // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 201, 1049633, from.Name); // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Пример #23
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1042010);                   // You must have the object in your backpack to use it.
     }
     else if (from.CanBeginAction(typeof(SnowPile)))
     {
         from.SendLocalizedMessage(1005575);                   // You carefully pack the snow into a ball...
         from.Target = new SnowTarget(from, this);
     }
     else
     {
         from.SendLocalizedMessage(1005574);                   // The snow is not ready to be packed yet.  Keep trying.
     }
 }
Пример #24
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendAsciiMessage("You must have the object in your backpack to use it.");
     }
     else if (from.CanBeginAction(typeof(SnowPile)))
     {
         from.SendAsciiMessage("You carefully pack the snow into a ball...");
         from.Target = new SnowTarget(from, this);
     }
     else
     {
         from.SendAsciiMessage("The snow is not ready to be packed yet.  Keep trying.");
     }
 }
Пример #25
0
			protected override void OnTick()
			{
				if ( !m_Owner.CanBeginAction( typeof( IncognitoSpell ) ) )
				{
					if ( m_Owner is PlayerMobile )
						((PlayerMobile)m_Owner).SetHairMods( -1, -1 );

					m_Owner.BodyMod = 0;
					m_Owner.HueMod = -1;
					m_Owner.NameMod = null;
					m_Owner.EndAction( typeof( IncognitoSpell ) );

					BaseArmor.ValidateMobile( m_Owner );
					BaseClothing.ValidateMobile( m_Owner );
				}
			}
Пример #26
0
            protected override void OnTick()
            {
                if (!player.CanBeginAction(typeof(ChampDeStaseSpell)))
                {
                    m_Timers.Remove(player);

                    player.RevealingAction();
                    player.Blessed = false;
                    player.Hidden  = false;

                    //if (player is PlayerMobile)
                    //    ((PlayerMobile)player).Aphonie = false;

                    player.EndAction(typeof(ChampDeStaseSpell));
                }
            }
Пример #27
0
            protected override void OnTick()
            {
                if (!m_Owner.CanBeginAction(typeof(PolymorphSpell)))
                {
                    m_Owner.BodyMod = 0;
                    //m_Owner.HueMod = -1;
                    m_Owner.EndAction(typeof(PolymorphSpell));

                    //BaseArmor.ValidateMobile(m_Owner);

                    if (m_Owner is PlayerMobile)
                    {
                        ((PlayerMobile)m_Owner).CheckRaceSkin();
                    }
                }
            }
Пример #28
0
 public override void OnDoubleClick( Mobile from )
 {
     if ( !IsChildOf( from.Backpack ) )
     {
         from.SendAsciiMessage( "You must have the object in your backpack to use it." );
     }
     else if ( from.CanBeginAction( typeof( SnowPile ) ) )
     {
         from.SendAsciiMessage( "You carefully pack the snow into a ball..." );
         from.Target = new SnowTarget( from, this );
     }
     else
     {
         from.SendAsciiMessage( "The snow is not ready to be packed yet.  Keep trying." );
     }
 }
Пример #29
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Thorn.Deleted)
                {
                    return;
                }

                if (!m_Thorn.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042664);                       // You must have the object in your backpack to use it.
                    return;
                }

                if (!from.CanBeginAction(typeof(GreenThorns)))
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061908);                       // * You must wait a while before planting another thorn. *
                    return;
                }

                LandTarget land = targeted as LandTarget;

                if (land == null)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061912);                       // * You cannot plant a green thorn there! *
                }
                else
                {
                    GreenThornsEffect effect = GreenThornsEffect.Create(from, land);

                    if (effect == null)
                    {
                        from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061913);                           // * You sense it would be useless to plant a green thorn there. *
                    }
                    else
                    {
                        m_Thorn.Consume();

                        from.LocalOverheadMessage(MessageType.Emote, 0x961, 1061914);                           // * You push the strange green thorn into the ground *
                        from.NonlocalOverheadMessage(MessageType.Emote, 0x961, 1061915, from.Name);             // * ~1_PLAYER_NAME~ pushes a strange green thorn into the ground. *

                        from.BeginAction(typeof(GreenThorns));
                        new GreenThorns.EndActionTimer(from).Start();

                        effect.Start();
                    }
                }
            }
Пример #30
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Seed.Deleted)
                {
                    return;
                }

                if (!m_Seed.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042664);                       // You must have the object in your backpack to use it.
                    return;
                }

                if (!from.CanBeginAction(typeof(MonsterSeed)))
                {
                    from.SendMessage("You must wait before planting another seed.");
                    return;
                }

                LandTarget land = targeted as LandTarget;

                if (land == null)
                {
                    from.SendMessage("You cannot plant that there.");
                }
                else
                {
                    //MonsterSeedEffect effect = MonsterSeedEffect.Create( from, land, m_Seed.CreatureType );

                    if (false)                       // Target is in tiles
                    {
                        from.SendMessage("That would be futile.");
                    }
                    else
                    {
                        m_Seed.Consume();

                        from.SendMessage("You push the seed into the ground.");
                        from.Emote("*Pushes a seed into the ground.*");

                        object[] arg = new object[] { from, land, m_Creature };


                        Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerStateCallback(SpawnCreature), arg);
                    }
                }
            }
Пример #31
0
        public virtual bool Apply(Mobile from)
        {
            if (!from.CanBeginAction(typeof(BaseMega)))
            {
                from.SendLocalizedMessage(502173);                   // You are already under a similar effect.
                return(false);
            }

            bool applied = Spells.SpellHelper.AddStatOffset(from, Type, Bonus, TimeSpan.FromSeconds(30));

            if (applied)
            {
                from.BeginAction(typeof(BaseMega));
            }

            return(true);
        }
Пример #32
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.CanBeginAction( typeof( BaseWand ) ) )
				return;

			if ( Parent == from )
			{
				if ( Charges > 0 )
					OnWandUse( from );
				else
					from.SendLocalizedMessage( 1019073 ); // This item is out of charges.
			}
			else
			{
				from.SendLocalizedMessage( 502641 ); // You must equip this item to use it.
			}
		}
Пример #33
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
                return;
            }

            if (!from.CanBeginAction(typeof(GreenThorns)))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1061908); // * You must wait a while before planting another thorn. *
                return;
            }

            from.Target = new InternalTarget(this);
            from.SendLocalizedMessage(1061906); // Choose a spot to plant the thorn.
        }
Пример #34
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042664);                   // You must have the object in your backpack to use it.
                return;
            }

            if (!from.CanBeginAction(typeof(MonsterSeed)))
            {
                from.SendMessage("You must wait before planting another seed.");
                return;
            }

            from.Target = new InternalTarget(this, m_Creature);
            from.SendMessage("Choose a spot to plant the seed.");
        }
Пример #35
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
				return;
			}

			if ( !from.CanBeginAction( typeof( GreenThorns ) ) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1061908 ); // * You must wait a while before planting another thorn. *
				return;
			}

			from.Target = new InternalTarget( this );
			from.SendLocalizedMessage( 1061906 ); // Choose a spot to plant the thorn.
		}
Пример #36
0
            protected override void OnTick()
            {
                if (m_Owner.CanBeginAction <IncognitoSpell>())
                {
                    return;
                }

                (m_Owner as PlayerMobile)?.SetHairMods(-1, -1);

                m_Owner.BodyMod = 0;
                m_Owner.HueMod  = -1;
                m_Owner.NameMod = null;
                m_Owner.EndAction <IncognitoSpell>();

                BaseArmor.ValidateMobile(m_Owner);
                BaseClothing.ValidateMobile(m_Owner);
            }
Пример #37
0
        public static void OnHealFromPotion(Mobile from, int healed)
        {
            if (from.Backpack != null)
            {
                var stone = from.Backpack.FindItemByType <HealingStone>();

                if (stone != null)
                {
                    stone.m_MaxHeal = 1;

                    if (from.CanBeginAction(typeof(HealingStone)))
                    {
                        Timer.DelayCall(TimeSpan.FromSeconds(2), m => m.EndAction(typeof(HealingStone)), from);
                    }
                }
            }
        }
        public override void Drink(Mobile from)
        {
            if (Core.AOS && (from.Paralyzed || from.Frozen || from.IsHindered() || (from.Spell != null && from.Spell.IsCasting)))
            {
                from.SendLocalizedMessage(1062725); // You can not use a purple potion while paralyzed.
                return;
            }

            if (!from.CanBeginAction(typeof(BaseExplosionPotion)))
            {
                from.PrivateOverheadMessage(MessageType.Regular, 0x22, false, "You must wait a few seconds before using another explosion potion.", from.NetState);
                return;
            }

            ThrowTarget targ = from.Target as ThrowTarget;

            this.Stackable = false; // Scavenged explosion potions won't stack with those ones in backpack, and still will explode.

            if (targ != null && targ.Potion == this)
            {
                return;
            }

            from.RevealingAction();

            if (m_Users == null)
            {
                m_Users = new ArrayList();
            }

            if (!m_Users.Contains(from))
            {
                m_Users.Add(from);
            }

            from.Target = new ThrowTarget(this);

            if (m_Timer == null)
            {
                Timer.DelayCall(TimeSpan.FromSeconds(10.0), new TimerStateCallback(ReleaseExploLock), from);

                from.SendLocalizedMessage(500236); // You should throw it now!
                m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(0.75), TimeSpan.FromSeconds(1.0), 4, new TimerStateCallback(Detonate_OnTick), new object[] { from, 3 });
            }
        }
Пример #39
0
        public static bool VerifyCast(Mobile Caster, bool messages)
        {
            if (Caster == null) // Sanity
            {
                return(false);
            }

            BaseWeapon weap = Caster.FindItemOnLayer(Layer.OneHanded) as BaseWeapon;

            if (weap == null)
            {
                weap = Caster.FindItemOnLayer(Layer.TwoHanded) as BaseWeapon;
            }

            if (weap != null)
            {
                if (Core.ML && Caster.Skills[weap.Skill].Base < 50)
                {
                    if (messages)
                    {
                        Caster.SendLocalizedMessage(1076206); // Your skill with your equipped weapon must be 50 or higher to use Evasion.
                    }
                    return(false);
                }
            }
            else if (!(Caster.FindItemOnLayer(Layer.TwoHanded) is BaseShield))
            {
                if (messages)
                {
                    Caster.SendLocalizedMessage(1062944); // You must have a weapon or a shield equipped to use this ability!
                }
                return(false);
            }

            if (!Caster.CanBeginAction(typeof(Evasion)))
            {
                if (messages)
                {
                    Caster.SendLocalizedMessage(501789); // You must wait before trying again.
                }
                return(false);
            }

            return(true);
        }
Пример #40
0
            protected override void OnTick()
            {
                if (!m_Owner.CanBeginAction(typeof(AncientPeerSpell)))
                {
                    if (fake != null && !fake.Deleted)
                    {
                        loc = new Point3D(fake.X, fake.Y, fake.Z);
                        m_Owner.Location = loc;
                        m_Owner.Blessed  = fake.Blessed;
                        fake.Delete();
                    }
                    m_Owner.BodyValue = m_OldBody;
                    m_spell.RemovePeerMod();
                    m_Owner.EndAction(typeof(AncientPeerSpell));

                    BaseArmor.ValidateMobile(m_Owner);
                }
            }
Пример #41
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage("The bola must be in your pack to use it.");
            }
            else if (!from.CanBeginAction(typeof(Bola)))
            {
                from.SendAsciiMessage("You have to wait a few moments before you can use another bola!");
            }
            else if (from.Target is BolaTarget)
            {
                from.SendAsciiMessage("This bola is already being used.");
            }
            else if (!Core.AOS && (from.FindItemOnLayer(Layer.OneHanded) != null || from.FindItemOnLayer(Layer.TwoHanded) != null))
            {
                from.SendAsciiMessage("Your hands must be free to use this");
            }
            else if (from.Mounted)
            {
                from.SendAsciiMessage("You cannot use this while riding a mount.");
            }
            else
            {
                EtherealMount.StopMounting(from);

                Item one = from.FindItemOnLayer(Layer.OneHanded);
                Item two = from.FindItemOnLayer(Layer.TwoHanded);

                if (one != null)
                {
                    from.AddToBackpack(one);
                }

                if (two != null)
                {
                    from.AddToBackpack(two);
                }

                from.Target = new BolaTarget(this);
                from.LocalOverheadMessage(MessageType.Emote, 0x3B2, 1049632);                   // * You begin to swing the bola...*
                from.NonlocalOverheadMessage(MessageType.Emote, 0x3B2, 1049633, from.Name);     // ~1_NAME~ begins to menacingly swing a bola...
            }
        }
Пример #42
0
        public bool Recall(Mobile m)
        {
            if (m == null || m.Deleted)
            {
                return(false);
            }

            if (_Location.Internal || _Location.Zero)
            {
                m.SendMessage("That rune is blank.");
                return(false);
            }

            if (m.Player)
            {
                var t = GetType();

                if (m.AccessLevel < AccessLevel.Counselor && !m.CanBeginAction(t))
                {
                    m.SendMessage("You must wait before using the rune codex again.");
                    return(false);
                }

                var spell = new RecallSpell(
                    m,
                    null,
                    new RunebookEntry(_Location.Location, _Location.Map, _Description, null, RecallRuneType.Normal),
                    null);

                if (!spell.Cast())
                {
                    return(false);
                }

                m.BeginAction(t, TimeSpan.FromSeconds(3));
            }
            else
            {
                _Location.MoveToWorld(m);
            }

            return(true);
        }
Пример #43
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1062334); // This item must be in your backpack to be used.
            }
            else if (from.IsBodyMod || from.HueMod > 0 || !from.CanBeginAction(typeof(Spells.Fifth.IncognitoSpell)))
            {
                from.SendLocalizedMessage(1073648); // You may only proceed while in your original state...
            }
            else if (from is PlayerMobile mobile)
            {
                _HairID  = 0;
                _BeardID = 0;

                mobile.CloseGump(typeof(GenderChangeConfirmGump));
                BaseGump.SendGump(new GenderChangeConfirmGump(mobile, this));
            }
        }
Пример #44
0
            protected override void OnTick()
            {
                if (!m_Owner.CanBeginAction(typeof(IncognitoSpell)))
                {
                    //m_Owner.BodyMod = 0;
                    //m_Owner.HueMod = -1;
                    m_Owner.NameMod = null;
                    m_Owner.EndAction(typeof(IncognitoSpell));

                    /*BaseArmor.ValidateMobile(m_Owner);
                     *
                     * if (m_Owner is PlayerMobile)
                     * {
                     *  ((PlayerMobile)m_Owner).SetHairMods(-1, -1);
                     *
                     *  ((PlayerMobile)m_Owner).CheckRaceGump();
                     * }*/
                }
            }
Пример #45
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1042001);
     }
     else if (CastHide)
     {
         new HideSpell(this, from).Cast();
     }
     else if (CastArea)
     {
         new CastAreaSpell(this, from).Cast();
     }
     else if (from.CanBeginAction <BaseStaffHide>())
     {
         HideEffects(from);
     }
 }
Пример #46
0
        public override void OnEnter(Mobile m)
        {
            if (m.CanBeginAction(typeof(Teleporter)))
            {
                var pm = m as PlayerMobile;

                if (pm != null)
                {
                    if (pm.DisabledPvpWarning)
                    {
                        DoTeleport(m);
                    }
                    else if (!pm.HasGump(typeof(PvpWarningGump)))
                    {
                        pm.SendGump(new PvpWarningGump(m, this));
                    }
                }
            }
        }
Пример #47
0
        public override bool CanEquip(Mobile from)
        {
            if (!from.CanBeginAction(typeof(BaseWeapon)))
            {
                return(false);
            }
            else if (_Owner != null && _Owner != from)
            {
                from.SendLocalizedMessage(501023); // You must be the owner to use this item.
                return(false);
            }
            else if (IsVvVItem && !Engines.VvV.ViceVsVirtueSystem.IsVvV(from))
            {
                from.SendLocalizedMessage(1155496); // This item can only be used by VvV participants!
                return(false);
            }

            return(base.CanEquip(from));
        }
Пример #48
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Thorn.Deleted)
                {
                    return;
                }

                if (!m_Thorn.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042664); // You must have the object in your backpack to use it.
                    return;
                }

                if (!from.CanBeginAction <GreenThorns>())
                {
                    from.LocalOverheadMessage(
                        MessageType.Regular,
                        0x3B2,
                        1061908
                        ); // * You must wait a while before planting another thorn. *
                    return;
                }

                if (from.Map != Map.Trammel && from.Map != Map.Felucca)
                {
                    from.LocalOverheadMessage(
                        MessageType.Regular,
                        0x2B2,
                        true,
                        "No solen lairs exist on this facet.  Try again in Trammel or Felucca."
                        );
                    return;
                }

                if (!(targeted is LandTarget land))
                {
                    from.LocalOverheadMessage(
                        MessageType.Regular,
                        0x3B2,
                        1061912
                        ); // * You cannot plant a green thorn there! *
                }
Пример #49
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.CanBeginAction(typeof(BaseMagicObject)))
            {
                return;
            }

            if (Parent == from)
            {
                if (Charges > 0)
                {
                    OnMagicObjectUse(from);
                    ConsumeCharge(from);
                }
            }
            else
            {
                from.SendLocalizedMessage(502641);                   // You must equip this item to use it.
            }
        }
Пример #50
0
        public static bool CheckCast(Mobile caster, Spell spell)
        {
            if (Factions.Sigil.ExistsOn(caster))
            {
                caster.SendLocalizedMessage(1061632);                   // You can't do that while carrying the sigil.
                return(false);
            }
            else if (!caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                caster.SendLocalizedMessage(1061628);                   // You can't do that while polymorphed.
                return(false);
            }
            else if (AnimalForm.UnderTransformation(caster))
            {
                caster.SendLocalizedMessage(1061091);                   // You cannot cast that spell in this form.
                return(false);
            }

            return(true);
        }
Пример #51
0
 public override void OnDoubleClick(Mobile from)
 {
     if (!IsChildOf(from.Backpack))
     {
         from.SendMessage("You must have that pile more accessible before throwing.");
         return;
     }
     else
     {
         if (from.CanBeginAction(typeof(RockPile)))
         {
             from.Target = new RockTarget(from);
             from.SendMessage("You chip off a large piece of the rock pile.");
         }
         else
         {
             from.SendMessage("That piece is too solid. Try another.");
         }
     }
 }
Пример #52
0
 public void OnBeginDig(Mobile from)
 {
     if (m_Completed)
     {
         from.SendLocalizedMessage(503014);                   // This treasure hunt has already been completed.
     }
     else if (from != m_Decoder)
     {
         from.SendLocalizedMessage(503016);                   // Only the person who decoded this map may actually dig up the treasure.
     }
     else if (!from.CanBeginAction(typeof(TreasureMap)))
     {
         from.SendLocalizedMessage(503020);                   // You are already digging treasure.
     }
     else
     {
         from.SendLocalizedMessage(503033);                   // Where do you wish to dig?
         from.Target = new DigTarget(this);
     }
 }
Пример #53
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.CanBeginAction( typeof( BaseWand ) ) )
				return;
		
			if ( Parent == from )
			{
				if ( Charges > 0 )
				{
					from.Target = new LightningBowTarget( from, this );
					from.SendMessage( "Where do you wish to teleport?" );
				}
				else
					from.SendLocalizedMessage( 1019073 ); // This item is out of charges.
			}
			else
			{
				from.SendLocalizedMessage( 502641 ); // You must equip this item to use it.
			}
		}
        public override void OnComponentUsed(AddonComponent c, Mobile from)
        {
            base.OnComponentUsed(c, from);

            if (!from.Alive)
            {
                return;
            }

            if (!from.CanBeginAction(typeof(StreamerFountainAddon)))
            {
                from.SendMessage("You must wait a few moments before attempting to use that again.");
                return;
            }

            from.BeginAction(typeof(StreamerFountainAddon));

            Timer.DelayCall(TimeSpan.FromSeconds(1), delegate
            {
                if (from != null)
                {
                    from.EndAction(typeof(StreamerFountainAddon));
                }
            });

            for (int a = 0; a < 3; a++)
            {
                TimedStatic water = new TimedStatic(Utility.RandomList(4650, 4651, 4653, 4654, 4655), 5);
                water.Name = "water";
                water.Hue  = 2580;

                Point3D waterLocation = new Point3D(c.X + Utility.RandomList(-1, 1), c.Y + Utility.RandomList(-1, 1), c.Z);

                SpellHelper.AdjustField(ref waterLocation, Map, 12, false);
                waterLocation.Z++;

                water.MoveToWorld(waterLocation, Map);
            }

            Effects.PlaySound(c.Location, c.Map, Utility.RandomList(0x027, 0x026, 0x025));
        }
Пример #55
0
		public override void OnDoubleClick(Mobile from)
		{
			if (from is BaseCreature)
			{
				from.SendMessage("You can't place a house as a monster!"); // pseudoseer is possessing a monster
				return;
			}

			if (!BaseHouse.CanOwnHouse(from))
			{
				from.SendMessage(
					38,
					"You do not meet the requirements to own a house. " +
					"You must have over {0} skill points total across all characters " +
					"on your account and also have accrued {1} of game time on your account.",
					HouseSystemController._OwnHouseMinSkillsOnAccount,
					UberScriptFunctions.Methods.TIMESPANSTRING(null, HouseSystemController._OwnHouseMinGameTime));

				return;
			}

			if (IsChildOf(from.Backpack))
			{
				//from.LocalOverheadMessage(MessageType.Regular, 38, false, "WARNING! After placement, houses lose SIGNIFICANT value to NPCs!");
				if (from.CanBeginAction(typeof(HousePlacementTool)))
				{
					from.SendGump(new HousePlacementCategoryGump(from));
					from.RevealingAction();
				}
				else
				{
					from.SendMessage("You must wait a moment before attempting to place another house!");
				}
			}
			else
			{
				from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
			}
		}
Пример #56
0
		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendMessage( "You must have that pile more accessible before throwing." );
				return;
			}
			else
			{
				if( from.CanBeginAction( typeof( RockPile ) ) )
				{
					from.Target = new RockTarget( from );
					from.SendMessage( "You chip off a large piece of the rock pile." );
				}
				else
				{
					from.SendMessage( "That piece is too solid. Try another." );
				}

			}

		}
Пример #57
0
        public static bool OnCast(Mobile caster, Spell spell)
        {
            ITransformationSpell transformSpell = spell as ITransformationSpell;

            if (transformSpell == null)
                return false;

            if (Factions.Sigil.ExistsOn(caster))
            {
                caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
            }
            else if (!caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
            }
            else if (DisguiseTimers.IsDisguised(caster))
            {
                caster.SendLocalizedMessage(1061631); // You can't do that while disguised.
                return false;
            }
            else if (AnimalForm.UnderTransformation(caster))
            {
                caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
            }
            else if (!caster.CanBeginAction(typeof(IncognitoSpell)) || (caster.IsBodyMod && GetContext(caster) == null))
            {
                spell.DoFizzle();
            }
            else if (spell.CheckSequence())
            {
                TransformContext context = GetContext(caster);
                Type ourType = spell.GetType();

                bool wasTransformed = (context != null);
                bool ourTransform = (wasTransformed && context.Type == ourType);

                if (wasTransformed)
                {
                    RemoveContext(caster, context, ourTransform);

                    if (ourTransform)
                    {
                        caster.PlaySound(0xFA);
                        caster.FixedParticles(0x3728, 1, 13, 5042, EffectLayer.Waist);
                    }
                }

                if (!ourTransform)
                {
                    List<ResistanceMod> mods = new List<ResistanceMod>();

                    if (transformSpell.PhysResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Physical, transformSpell.PhysResistOffset));

                    if (transformSpell.FireResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Fire, transformSpell.FireResistOffset));

                    if (transformSpell.ColdResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Cold, transformSpell.ColdResistOffset));

                    if (transformSpell.PoisResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Poison, transformSpell.PoisResistOffset));

                    if (transformSpell.NrgyResistOffset != 0)
                        mods.Add(new ResistanceMod(ResistanceType.Energy, transformSpell.NrgyResistOffset));

                    if (!((Body)transformSpell.Body).IsHuman)
                    {
                        Mobiles.IMount mt = caster.Mount;

                        if (mt != null)
                            mt.Rider = null;
                    }

                    caster.BodyMod = transformSpell.Body;
                    caster.HueMod = transformSpell.Hue;

                    for (int i = 0; i < mods.Count; ++i)
                        caster.AddResistanceMod(mods[i]);

                    transformSpell.DoEffect(caster);

                    Timer timer = new TransformTimer(caster, transformSpell);
                    timer.Start();

                    AddContext(caster, new TransformContext(timer, mods, ourType, transformSpell));
                    return true;
                }
            }

            return false;
        }
Пример #58
0
        public static bool CheckCast(Mobile caster, Spell spell)
        {
            if (Factions.Sigil.ExistsOn(caster))
            {
                caster.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil.
                return false;
            }
            else if (!caster.CanBeginAction(typeof(PolymorphSpell)))
            {
                caster.SendLocalizedMessage(1061628); // You can't do that while polymorphed.
                return false;
            }
            else if (AnimalForm.UnderTransformation(caster))
            {
                caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
                return false;
            }

            return true;
        }
Пример #59
0
		public override bool CanEquip(Mobile from)
		{
			if (!Ethic.CheckEquip(from, this))
			{
				return false;
			}

			#region Stygian Abyss
			if (from.Race == Race.Gargoyle && !CanBeWornByGargoyles && from.IsPlayer())
			{
				from.SendLocalizedMessage(1111708); // Gargoyles can't wear this.
				return false;
			}
			#endregion

			if (RequiredRace != null && from.Race != RequiredRace)
			{
				if (RequiredRace == Race.Elf)
				{
					from.SendLocalizedMessage(1072203); // Only Elves may use this.
				}
					#region SA
				else if (RequiredRace == Race.Gargoyle)
				{
					from.SendLocalizedMessage(1111707); // Only gargoyles can wear this.
				}
					#endregion

				else
				{
					from.SendMessage("Only {0} may use this.", RequiredRace.PluralName);
				}

				return false;
			}
			else if (from.Dex < DexRequirement)
			{
				from.SendMessage("You are not nimble enough to equip that.");
				return false;
			}
			else if (from.Str < AOS.Scale(StrRequirement, 100 - GetLowerStatReq()))
			{
				from.SendLocalizedMessage(500213); // You are not strong enough to equip that.
				return false;
			}
			else if (from.Int < IntRequirement)
			{
				from.SendMessage("You are not smart enough to equip that.");
				return false;
			}
			else if (!from.CanBeginAction(typeof(BaseWeapon)))
			{
				return false;
			}
				#region Personal Bless Deed
			else if (BlessedBy != null && BlessedBy != from)
			{
				from.SendLocalizedMessage(1075277); // That item is blessed by another player.

				return false;
			}
			else if (!XmlAttach.CheckCanEquip(this, from))
			{
				return false;
			}
				#endregion

			else
			{
				return base.CanEquip(from);
			}
		}
Пример #60
0
        private static void EndPolymorph(Mobile m)
        {
            if (!m.CanBeginAction(typeof(PolymorphSpell)))
            {
                m.BodyMod = 0;
                m.HueMod = -1;
                m.EndAction(typeof(PolymorphSpell));

                BaseArmor.ValidateMobile(m);
                BaseClothing.ValidateMobile(m);
            }
        }