Example #1
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                from.RevealingAction();

                if ( targeted is BaseCreature && from.CanBeHarmful( (Mobile) targeted, true ) )
                {
                    BaseCreature creature = (BaseCreature) targeted;

                    if ( !m_Instrument.IsChildOf( from.Backpack ) )
                    {
                        from.SendLocalizedMessage( 1062488 ); // The instrument you are trying to play is no longer in your backpack!
                    }
                    else if ( creature.Controlled )
                    {
                        from.SendLocalizedMessage( 501590 ); // They are too loyal to their master to be provoked.
                    }
                    else if ( creature.IsParagon && BaseInstrument.GetBaseDifficulty( creature ) >= 160.0 )
                    {
                        from.SendLocalizedMessage( 1049446 ); // You have no chance of provoking those creatures.
                    }
                    else
                    {
                        from.RevealingAction();
                        m_Instrument.PlayInstrumentWell( from );
                        from.SendLocalizedMessage( 1008085 ); // You play your music and your target becomes angered.  Whom do you wish them to attack?
                        from.Target = new InternalSecondTarget( from, m_Instrument, creature );
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 501589 ); // You can't incite that!
                }
            }
Example #2
0
        public static TimeSpan OnUse(Mobile m)
        {
            m.RevealingAction();

            m.Target = new InternalTarget();
            m.RevealingAction();

            m.SendAsciiMessage("Select the map upon which to draw.");

            return TimeSpan.FromSeconds(10.0);
        }
        public static TimeSpan OnUse( Mobile m )
        {
            m.RevealingAction();

            m.Target = new InternalTarget();
            m.RevealingAction();

            m.SendLocalizedMessage( 500397 ); // To whom do you wish to grovel?

            return TimeSpan.FromHours( 6.0 );
        }
Example #4
0
        public static TimeSpan OnUse( Mobile m )
        {
            m.RevealingAction();

            m.Target = new InternalTarget();
            m.RevealingAction();

            if ( !m_DisableMessage )
                m.SendLocalizedMessage( 502789 ); // Tame which animal?

            return TimeSpan.FromHours( 6.0 );
        }
Example #5
0
        public static TimeSpan OnUse( Mobile m )
        {
            if ( !m.Hidden )
            {
                m.SendLocalizedMessage( 502725 ); // You must hide first
            }
            else if ( m.Skills[SkillName.Hiding].Base < 30.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 if ( m.Flying )
            {
                m.SendLocalizedMessage( 1113415 ); // You cannot use this ability while flying.
                m.RevealingAction();
            }
            else
            {
                int armorRating = GetArmorRating( m );

                if ( armorRating >= 42 ) // 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 ), 60.0 + ( armorRating * 2 ) ) )
                {
                    int steps = (int) ( m.Skills[SkillName.Stealth].Value / 5.0 );

                    if ( steps < 1 )
                        steps = 1;

                    m.AllowedStealthSteps = steps;
                    m.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 );
        }
Example #6
0
        public static TimeSpan OnUse( Mobile m )
        {
            m.RevealingAction();

            m.Target = new InternalTarget();
            m.RevealingAction();

            if (!m_DisableMessage)
                m.SendAsciiMessage("Tame which animal?");

            return TimeSpan.FromHours( 6.0 );
        }
		public override void Drink( Mobile from )
		{
			if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
			{
				from.SendLocalizedMessage( 1062725 ); // You can not use that potion while paralyzed.
				return;
			}

			int delay = GetDelay( from );

			if ( delay > 0 )
			{
				from.SendLocalizedMessage( 1072529, String.Format( "{0}\t{1}", delay, delay > 1 ? "seconds." : "second." ) ); // You cannot use that for another ~1_NUM~ ~2_TIMEUNITS~
				return;
			}

			ThrowTarget targ = from.Target as ThrowTarget;

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

			from.RevealingAction();

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

			from.Target = new ThrowTarget( this );
		}
Example #8
0
        public override void Drink( Mobile from )
        {
            if ( Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)) )
            {
                from.SendLocalizedMessage( 1062725 ); // You can not use a purple potion while paralyzed.
                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 )
            {
                from.SendLocalizedMessage( 500236 ); // You should throw it now!

                if( Core.ML )
                    m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 1.0 ), TimeSpan.FromSeconds( 1.25 ), 5, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 3 } ); // 3.6 seconds explosion delay
                else
                    m_Timer = Timer.DelayCall( TimeSpan.FromSeconds( 0.75 ), TimeSpan.FromSeconds( 1.0 ), 4, new TimerStateCallback( Detonate_OnTick ), new object[]{ from, 3 } ); // 2.6 seconds explosion delay
            }
        }
Example #9
0
 public static void OnPickedInstrument( Mobile from, BaseInstrument instrument )
 {
     from.RevealingAction();
     from.SendLocalizedMessage( 1049525 ); // Whom do you wish to calm?
     from.Target = new InternalTarget( from, instrument );
     from.NextSkillTime = DateTime.Now + TimeSpan.FromHours( 6.0 );
 }
Example #10
0
        public static TimeSpan OnUse( Mobile m )
        {
            m.RevealingAction();

            Timer t = m_Table[m] as Timer;
            if ( t != null && t.Running )
                t.Stop();
            if ( m.CheckSkill( SkillName.SpiritSpeak, 0, 100 ) )
            {
                if ( t == null )
                    m_Table[m] = t = new SpiritSpeakTimer( m );

                double secs = m.Skills[SkillName.SpiritSpeak].Base / 50;
                secs *= 90;
                if ( secs < 10 )
                    secs = 10;

                t.Delay = TimeSpan.FromSeconds( secs );//15 seconds to 3 minutes
                t.Start();
                m.CanHearGhosts = true;

                m.PlaySound( 0x24A );
                m.SendLocalizedMessage( 502444 );//You contact the neitherworld.
            }
            else
            {
                m_Table.Remove( m );
                m.SendLocalizedMessage( 502443 );//You fail to contact the neitherworld.
                m.CanHearGhosts = false;
            }

            return TimeSpan.FromSeconds( 10.0 );
        }
Example #11
0
		protected override void OnTarget( Mobile from, object o )
		{
			IPoint3D ip = o as IPoint3D;

			if ( ip != null )
			{
				if ( ip is Item )
					ip = ((Item)ip).GetWorldTop();

				Point3D p = new Point3D( ip );

				Region reg = Region.Find( new Point3D( p ), from.Map );

				if ( from.AccessLevel >= AccessLevel.GameMaster || reg.AllowHousing( from, p ) )
					m_Deed.OnPlacement( from, p );
				else if ( reg.IsPartOf( typeof( TempNoHousingRegion ) ) )
					from.SendLocalizedMessage( 501270 ); // Lord British has decreed a 'no build' period, thus you cannot build this house at this time.
				else if ( reg.IsPartOf( typeof( TreasureRegion ) ) || reg.IsPartOf( typeof( HouseRegion ) ) )
					from.SendLocalizedMessage( 1043287 ); // The house could not be created here.  Either something is blocking the house, or the house would not be on valid terrain.
				else
					from.SendLocalizedMessage( 501265 ); // Housing can not be created in this area.

                if (HouseSystemController._MaxPlaceDelay > 0)
                {
                    from.BeginAction(typeof(HouseDeed));
                    Timer.DelayCall<Mobile>(TimeSpan.FromSeconds(Utility.RandomMinMax(HouseSystemController._MinPlaceDelay, HouseSystemController._MaxPlaceDelay)), new TimerStateCallback<Mobile>(ReleasePlacementLock), from);
                }
                from.RevealingAction();
			}
		}
Example #12
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (!m.Hidden)
            {
                m.SendLocalizedMessage(502725); // You must hide first
            }
            else if (m.Skills[SkillName.Hiding].Base < 80.0)
            {
                m.SendLocalizedMessage(502726); // You are not hidden well enough.  Become better at hiding.
            }
            else if (GetArmorOffset(m) >= 15)
            {
                m.SendLocalizedMessage(502727); // You could not hope to move quietly wearing this much armor.
            }
            else if (m.CheckSkill(SkillName.Stealth, 0.0, 100.0))
            {
                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);
        }
        public override void Drink(Mobile from)
        {
            if (Core.AOS && (from.Paralyzed || from.Frozen || (from.Spell != null && from.Spell.IsCasting)))
            {
                from.SendLocalizedMessage(1062725); // You can not use a purple potion while paralyzed.
                return;
            }

            ThrowTarget targ = from.Target as ThrowTarget;

            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)
            {
                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 });
            }
        }
Example #14
0
            protected override void OnTarget( Mobile from, object targeted )
            {
                from.RevealingAction();

                int number = -1;

                if ( targeted is Mobile )
                {
                    Mobile targ = (Mobile)targeted;

                    if ( targ.Player ) // We can't beg from players
                    {
                        from.SendAsciiMessage("Perhaps just asking would work better.");
                        number = 500398; // Perhaps just asking would work better.
                    }
                    else if ( !targ.Body.IsHuman ) // Make sure the NPC is human
                    {
                        from.SendAsciiMessage("There is little chance of getting money from that!");
                        number = 500399; // There is little chance of getting money from that!
                    }
                    else if ( !from.InRange( targ, 2 ) )
                    {
                        if (!targ.Female)
                        {
                            from.SendAsciiMessage("You are too far away to beg from him.");
                            number = 500401; // You are too far away to beg from him.
                        }
                        else
                            from.SendAsciiMessage("You are too far away to beg from her.");
                            //number = 500402; // You are too far away to beg from her.
                    }
                    else if ( from.Mounted ) // If we're on a mount, who would give us money?
                    {
                        from.SendAsciiMessage("They seem unwilling to give you any money.");
                        number = 500404; // They seem unwilling to give you any money.
                    }
                    else
                    {
                        // Face eachother
                        from.Direction = from.GetDirectionTo( targ );
                        targ.Direction = targ.GetDirectionTo( from );

                        from.Animate( 32, 5, 1, true, false, 0 ); // Bow

                        new InternalTimer( from, targ ).Start();

                        m_SetSkillTime = false;
                    }
                }
                else // Not a Mobile
                {
                    from.SendAsciiMessage("There is little chance of getting money from that!");
                    //number = 500399; // There is little chance of getting money from that!
                }

                number = -1;
                if ( number != -1 )
                    from.SendLocalizedMessage( number );
            }
		public override void OnDoubleClick(Mobile from)
		{
				if (from == null)
					return;

				from.RevealingAction();
				from.BeginTarget(1, false, TargetFlags.None, new TargetCallback(ItemClaimer_OnTarget));
		}
Example #16
0
		public static TimeSpan OnUse( Mobile m )
		{
			m.Target = new ForensicTarget();
			m.RevealingAction();
			m.SendLocalizedMessage( 500906 ); // What would you like to evaluate?

			return TimeSpan.FromSeconds( 1.0 ); // default 1 second - 10 seconds is applied on valid target
		}
Example #17
0
        // Scriptiz : ajout d'une m├ęthode pour la commande .bandself
        public static void BandSelfCommandCall(Mobile from, Item m_Bandage)
        {
            from.RevealingAction();

            if (BandageContext.BeginHeal(from, from) != null && !Engines.ConPVP.DuelContext.IsFreeConsume(from))
                m_Bandage.Consume();

        }
Example #18
0
        public static TimeSpan OnUse( Mobile m )
        {
            m.RevealingAction();

            BaseInstrument.PickInstrument( m, new InstrumentPickedCallback( OnPickedInstrument ) );

            return TimeSpan.FromSeconds( 1.0 ); // Cannot use another skill for 1 second
        }
Example #19
0
        public static TimeSpan OnUse( Mobile m )
        {
            m.RevealingAction();

            new Engines.Craft.CartographySystem().Begin( m, null );

            return TimeSpan.FromSeconds( 10.0 );
        }
Example #20
0
//This method added for [bandself command to call.
		public static void BandSelfCommandCall( Mobile from, Item m_Bandage )
		{
			from.RevealingAction();

			if ( BandageContext.BeginHeal( from, from ) != null )
				m_Bandage.Consume();

		}
      public override void Drink( Mobile from )
      {
         from.RevealingAction();

         from.SendLocalizedMessage( 500236 ); // You should throw it now!
         from.Target = new InternalTarget( this );

         new DelayTimer( from, this ).Start();
      }
Example #22
0
        public static TimeSpan OnUse(Mobile m)
        {
            m.Target = new ForensicTarget();
            m.RevealingAction();

            m.SendLocalizedMessage(500906); // What would you like to evaluate?

            return TimeSpan.FromSeconds(10.0);
        }
Example #23
0
        public static TimeSpan OnUse( Mobile m )
        {
            m.Target = new ForensicTarget();
            m.RevealingAction();

            m.SendAsciiMessage( "What would you like to evaluate?" );

            return TimeSpan.FromSeconds( 1.0 );
        }
        public override void OnHit( Mobile attacker, Mobile defender, int damage )
        {
            if ( !Validate( attacker )  )
                return;

            ClearCurrentAbility( attacker );

            Map map = attacker.Map;

            if ( map == null )
                return;

            BaseWeapon weapon = attacker.Weapon as BaseWeapon;

            if ( weapon == null )
                return;

            if ( !CheckMana( attacker, true ) )
                return;

            attacker.FixedEffect( 0x3728, 10, 15 );
            attacker.PlaySound( 0x2A1 );

            ArrayList list = new ArrayList();

            foreach ( Mobile m in attacker.GetMobilesInRange( 1 ) )
                list.Add( m );

            Party p = Party.Get( attacker );

            for ( int i = 0; i < list.Count; ++i )
            {
                Mobile m = (Mobile)list[i];

                if (m != defender && m != attacker &&
                    SpellHelper.ValidIndirectTarget(attacker, m) &&
                    attacker.CanBeHarmful(m, false) &&
                    (p == null || !p.Contains(m)))
                {
                    if ( m == null || m.Deleted || attacker.Deleted || m.Map != attacker.Map || !m.Alive || !attacker.Alive || !attacker.CanSee( m ) )
                        continue;

                    if ( !attacker.InRange( m, weapon.MaxRange ) )
                        continue;

                    if ( attacker.InLOS( m ) )
                    {
                        attacker.RevealingAction();

                        attacker.SendLocalizedMessage( 1060161 ); // The whirling attack strikes a target!
                        m.SendLocalizedMessage( 1060162 ); // You are struck by the whirling attack and take damage!

                        weapon.OnHit( attacker, m );
                    }
                }
            }
        }
Example #25
0
        public static TimeSpan OnUse( Mobile m )
        {
            m.Target = new ForensicTarget();
            m.RevealingAction();

            m.SendLocalizedMessage( 501000 ); // Show me the crime.

            return TimeSpan.FromSeconds( 1.0 );
        }
Example #26
0
        public static TimeSpan OnUse(Mobile m)
        {
            if (!(m is PlayerMobile))
                return TimeSpan.Zero;

            m.Target = new Stealing.StealingTarget((PlayerMobile)m);
            m.RevealingAction();
            m.SendLocalizedMessage(502698); // Which item do you want to steal?
            return TimeSpan.Zero;
        }
Example #27
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.InRange(GetWorldLocation(), Range)) {
         from.RevealingAction();
         from.SendMessage("Who will you use the medkit on?");
         from.Target = new InternalTarget( this );
     } else {
         from.SendLocalizedMessage( 500295 ); // You are too far away to do that.
     }
 }
        public override void Drink( Mobile from )
        {
            ThrowTarget targ = from.Target as ThrowTarget;

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

            from.RevealingAction();

            from.Target = new ThrowTarget( this );
        }
Example #29
0
			protected override void OnTarget( Mobile from, object targeted )
			{
				from.RevealingAction();

                IEntity entity = targeted as IEntity;
                if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, null, 0, null, SkillName.Begging, from.Skills[SkillName.Begging].Value))
                {
                    return;
                }

				int number = -1;

				if ( targeted is Mobile )
				{
					Mobile targ = (Mobile)targeted;

					if ( targ.Player ) // We can't beg from players
						number = 500398; // Perhaps just asking would work better.
					else if ( !targ.Body.IsHuman ) // Make sure the NPC is human
						number = 500399; // There is little chance of getting money from that!
					else if ( !from.InRange( targ, 2 ) )
					{
						if ( !(targ is IBegged) )
							number = 500403; // That's too far away.  You couldn't beg from it anyway.
						else if ( targ.Female )
							number = 500402; // You are too far away to beg from her.
						else
							number = 500401; // You are too far away to beg from him.
					}
					else if ( from.Mounted ) // If we're on a mount, who would give us money?
						number = 500404; // They seem unwilling to give you any money.
					else if ( targ is IBegged )
					{
						// Face eachother
						from.Direction = from.GetDirectionTo( targ );
						targ.Direction = targ.GetDirectionTo( from );

						from.Animate( 32, 5, 1, true, false, 0 ); // Bow

						new InternalTimer( from, (IBegged)targ ).Start();

						m_SetSkillTime = false;
					}
					else
						number = 500404; // They seem unwilling to give you any money.

				}
				else // Not a Mobile
					number = 500399; // There is little chance of getting money from that!

				if ( number != -1 )
					from.SendLocalizedMessage( number );
			}
Example #30
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(this, 1))
            {
                SendLocalizedMessageTo(from, 1076766); // That is too far away.
                return;
            }

            from.RevealingAction();

            if (0.025 > Utility.RandomDouble())
            {
                from.AddToBackpack(new RareSerpentEgg());
                from.SendLocalizedMessage(1112581); // You reach in and find a rare serpent egg!!
            }
            else
            {
                switch (Utility.Random(3))
                {
                    case 0:
                        {
                            from.SendLocalizedMessage(1112578); // You try to reach the eggs, but the hole is too deep.

                            break;
                        }
                    case 1:
                        {
                            from.SendLocalizedMessage(1112579); // You reach in but clumsily destroy the eggs inside the nest.
                            this.Collapse(from);

                            break;
                        }
                    case 2:
                        {
                            from.SendLocalizedMessage(1112580); // Beware! You've hatched the eggs!!
                            this.HatchEggs(from);

                            from.PrivateOverheadMessage(MessageType.Regular, 33, 1112940, from.NetState); // Your hand remains stuck!!!
                            from.Frozen = true;

                            Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerCallback(
                                delegate
                                {
                                    from.Frozen = false;
                                    from.PrivateOverheadMessage(MessageType.Regular, 65, 1112941, from.NetState); // You manage to free your hand!
                                }));

                            break;
                        }
                }
            }
        }