public override void OnDoubleClick( Mobile from )
		{
			if ( Hue != 1150 )
			{
				base.OnDoubleClick( from );
				return;
			}

			Container pack = from.Backpack;

			if ( !(pack != null && Parent == pack) )
			{
				from.SendLocalizedMessage( 1080058 ); // This must be in your backpack to use it.
				return;
			}

			from.Animate( 34, 5, 1, true, false, 0 );
			from.PlaySound( Utility.Random( 0x3A, 3 ) );

			if ( BlueMageControl.IsBlueMage( from ) )
				BlueMageControl.CheckKnown( from, typeof( AngelsSnackSpell ), true );

			Hue = Utility.RandomList( 0, 0x66D, 0x53D, 0x8A5, 0x21, 0x5, 0x38, 0xD, 0x59B, 0x46F, 0x10, 0x42, 0x2B );
			Name = "grasses";
		}
        public override void OnDoubleClick( Mobile from )
        {
            if ( from.InRange( this.Location, 1 ) )
            {
                if ( !from.Mounted )
                {
                    Flower flower = Activator.CreateInstance( Ingredient ) as Flower;
                    if ( flower != null )
                    {
                        Server.Spells.SpellHelper.Turn( from, this );
                        from.Animate( 32, 5, 1, true, false, 0 );
                        from.PlaySound( 79 );

                        from.SendMessage( "You have picked the flower." );
                        flower.Hue = this.Hue;
                        from.AddToBackpack( flower );
                        ((PlayerMobile)from).Crafting = true;
                        Misc.LevelSystem.AwardMinimumXP( (PlayerMobile)from, 1 );
                        ((PlayerMobile)from).Crafting = false;
                        Delete();
                    }
                }
                else
                    from.SendMessage( "You can't do that while mounted." );
            }
            else
                from.SendMessage( "You are too far away." );
        }
Example #3
0
		public override sealed bool Eat(Mobile from)
		{
			if (from == null || from.Deleted)
			{
				return false;
			}

			if (CheckHunger(from))
			{
				from.PlaySound(Utility.Random(0x3A, 3));

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

				if (Poison != null)
				{
					from.ApplyPoison(Poisoner, Poison);
				}

				OnEaten(from);
				Consume();
				return true;
			}

			return false;
		}
		public static void Target( Mobile from, object target, ACreedJinBori jinbori )
		{
			if ( from == null || jinbori.Parent != from )
				return;

			Mobile to = target as Mobile;

			if ( to == null )
				return;

			int delay = 11;
			delay -= (from.Dex / 30);

			if ( delay < 6 )
				delay = 6;

			jinbori.ThrowDelay = DateTime.Now + TimeSpan.FromSeconds( delay );
			--jinbori.m_Ammo;

			from.Direction = from.GetDirectionTo( to );
			from.Animate( 31, 5, 1, true, false, 0 );
			// SendMovingEffect( IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes )
			Effects.SendMovingEffect( from, to, 0xF51, 10, 1, false, false );

			Timer.DelayCall( TimeSpan.FromSeconds( 1 ), new TimerStateCallback( jinbori.ACreedDaggerDamage_CallBack ), to );
		}
Example #5
0
		public override void OnDoubleClick( Mobile from )
		{
			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else
			{
				if( from.Skills.Magery.Base < 85 )
				{
					from.SendMessage( "The scroll bursts into flame in your hands!" );
					from.FixedParticles( 0x36BD, 20, 10, 5044, EffectLayer.Waist );
					from.Damage( Utility.RandomMinMax( 40, 55 ) );
					
					this.Delete();
				}
				else
				{
					from.Frozen = true;
					from.PublicOverheadMessage( MessageType.Spell, from.SpeechHue, true, "In Kal Quas", false );
					
					if( !from.Mounted && from.Body.IsHuman )
						from.Animate( 206, 7, 1, true, false, 0 );
					
					from.BeginTarget( 10, false, TargetFlags.None, new TargetCallback( BlessingOfKhopesh_OnTarget ) );
				}
			}
		}
Example #6
0
		public void Throw( Mobile from )
		{
			BaseKnife knife = from.Weapon as BaseKnife;

			if ( knife == null )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500751 ); // Try holding a knife...
				return;
			}

			from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );
			from.MovingEffect( this, knife.ItemID, 7, 1, false, false );
			from.PlaySound( 0x238 );

			double rand = Utility.RandomDouble();

			int message;
			if ( rand < 0.05 )
				message = 500752; // BULLSEYE! 50 Points!
			else if ( rand < 0.20 )
				message = 500753; // Just missed the center! 20 points.
			else if ( rand < 0.45 )
				message = 500754; // 10 point shot.
			else if ( rand < 0.70 )
				message = 500755; // 5 pointer.
			else if ( rand < 0.85 )
				message = 500756; // 1 point.  Bad throw.
			else
				message = 500757; // Missed.

			PublicOverheadMessage( MessageType.Regular, 0x3B2, message );
		}
Example #7
0
		public virtual void OnChop( Mobile from )
		{
			double chance = (from.Skills[SkillName.Lumberjacking].Value * 0.20);

			if( !from.InRange( this, 2 ) )
			{
				from.SendLocalizedMessage( CommonLocs.YouTooFar );
			}
			else if( Sower != null && from != Sower )
			{
				from.SendMessage( "You cannot chop down this tree." );
			}
			else if( chance > Utility.RandomDouble() )
			{
				from.Animate( 13, 7, 1, true, false, 0 );
				from.PlaySound( 0x13E );
				from.SendMessage( "You manage to cut down the tree." );

				new Weeds().MoveToWorld( this.Location, this.Map );
				new Server.Items.TimedItem( 60.0, 0x1038 ).MoveToWorld( this.Location, this.Map );

				from.AddToBackpack( new Log( 10 ) );

				this.Delete();
			}
			else
			{
				from.SendMessage( "You find yourself unable to cut down this tree right now." );
			}
		}
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				if ( !ValidateUse( from ) )
				{
					SendLocalizedMessageTo( from, 500309 ); // Nothing Happens.
				}
				else if ( m_PlayTimer != null )
				{
					SendLocalizedMessageTo( from, 1042144 ); // This is currently in use.
				}
				else if ( Charges > 0 )
				{
					from.Animate( 34, 7, 1, true, false, 0 );
					from.PlaySound( 0xFF );
					from.SendLocalizedMessage( 1049115 ); // You play the horn and a sense of peace overcomes you...

					--Charges;

					m_PlayTimer = Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerStateCallback( PlayTimer_Callback ), from );
				}
				else
				{
					SendLocalizedMessageTo( from, 1042544 ); // This item is out of charges.
				}
			}
			else
			{
				SendLocalizedMessageTo( from, 1042001 ); // That must be in your pack for you to use it.
			}
		}
Example #9
0
        public override bool Eat( Mobile from )
        {
            if ( !CheckCooldown( from ) )
                return false;

            // The grapes of wrath invigorate you for a short time, allowing you to deal extra damage.
            from.SendLocalizedMessage( 1074847 );

            m_InfluenceList.Add( from );
            m_CooldownTable.Add( from, DateTime.Now + Cooldown );

            Timer.DelayCall( Duration, new TimerStateCallback( delegate { m_InfluenceList.Remove( from ); } ), from );

            // Play a random "eat" sound
            from.PlaySound( Utility.Random( 0x3A, 3 ) );

            from.Animate( 6 );

            if ( Poison != null )
                from.ApplyPoison( Poisoner, Poison );

            Consume();

            return true;
        }
Example #10
0
		public override bool Use( Mobile from ) {
			if ( from.BeginAction( typeof( ClarityPotion ) ) ) {
				int amount = Utility.Dice( 3, 3, 3 );
				int time = Utility.RandomMinMax( 5, 30 );

				from.PlaySound( 0x2D6 );

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

				from.FixedParticles( 0x375A, 10, 15, 5011, EffectLayer.Head );
				from.PlaySound( 0x1EB );

				StatMod mod = from.GetStatMod( "Concussion" );

				if ( mod != null ) {
					from.RemoveStatMod( "Concussion" );
					from.Mana -= mod.Offset;
				}

				from.PlaySound( 0x1EE );
				from.AddStatMod( new StatMod( StatType.Int, "clarity-potion", amount, TimeSpan.FromMinutes( time ) ) );

				Timer.DelayCall( TimeSpan.FromMinutes( time ), delegate() {
					from.EndAction( typeof( ClarityPotion ) );
				} );

				return true;
			}

			return false;
		}
Example #11
0
		public void AttackAnimation(Mobile from, Mobile to)
		{
			if (from.Body.IsHuman && !from.Mounted)
			{
				from.Animate(33, 2, 1, true, true, 0);
			}

			from.PlaySound(0x223);
			from.MovingEffect(to, 0x2804, 5, 0, false, false);
		}
Example #12
0
        public void OnMine(Mobile from, Item tool)
        {
            if (tool is IUsesRemaining && ((IUsesRemaining)tool).UsesRemaining < 1)
                return;

            from.Direction = from.GetDirectionTo(this.Location);
            from.Animate(11, 5, 1, true, false, 0);

            Timer.DelayCall(TimeSpan.FromSeconds(1), new TimerStateCallback(DoMine), new object[] { from, tool });
        }
Example #13
0
		public void AttackAnimation(Mobile from, Mobile to)
		{
			if (from.Body.IsHuman)
			{
				from.Animate(from.Mounted ? 26 : 9, 7, 1, true, false, 0);
			}

			from.PlaySound(0x23A);
			from.MovingEffect(to, 0x27AC, 1, 0, false, false);
		}
			protected override void OnTarget( Mobile from, object obj )
			{
				if ( m_BaseThrowingItem.Deleted || m_BaseThrowingItem.Map == Map.Internal)
					return;

				if ( obj is Mobile )
				{
					Mobile to = (Mobile)obj;

					if ( !from.CanBeHarmful( to ) )
					{
					}
					else
					{	from.Direction = from.GetDirectionTo( to );
						from.Animate( 11, 5, 1, true, false, 0 );
						from.MovingEffect( to, m_BaseThrowingItem.ItemID, 10, 0, false, false );

						Timer.DelayCall<ThrowInfo>( TimeSpan.FromSeconds( 0.5 ), new TimerStateCallback<ThrowInfo>( FinishThrow ), new ThrowInfo( from, to, m_DamageMin, m_DamageMax, m_Break, m_BaseThrowingItem ) );

						if ( m_DeleteOnThrow || m_Break )
							m_BaseThrowingItem.Delete();
					}
				}
				else
				{
					IPoint3D p = obj as IPoint3D;

					if ( p == null )
						return;

					Map map = from.Map;

					if ( map == null )
						return;

					IEntity to;

					to = new Entity( Serial.Zero, new Point3D( p ), map );

					from.Direction = from.GetDirectionTo( to );
					Effects.SendMovingEffect( from, to, m_BaseThrowingItem.ItemID & 0x3FFF, 7, 0, false, false, m_BaseThrowingItem.Hue, 0 );
					from.Animate( 11, 5, 1, true, false, 0 );

					if ( m_DeleteOnThrow )
					{
						m_BaseThrowingItem.Delete();
						from.SendMessage( "You miss the target and the {0} is wasted", m_BaseThrowingItem.Name );
					}
					else
					{
						Timer.DelayCall<object[]>( TimeSpan.FromSeconds( 0.5 ), new TimerStateCallback<object[]>( FinishMiss ), new object[]{ to, map, m_BaseThrowingItem } );
						from.SendMessage( "You miss the target" );
					}
				}
			}
Example #15
0
		public virtual void OnDoubleClick( Mobile from, bool createWeedsAndDelete )
		{
			if( !from.CanSee( this ) )
			{
				from.SendMessage( "You cannot see that." );
			}
			else if( !(this is HarvestableTree) && !from.InRange( this, 1 ) )
			{
				from.SendLocalizedMessage( CommonLocs.YouTooFar );
			}
			else if( this is HarvestableTree && !from.InRange( this, 2 ) )
			{
				from.SendLocalizedMessage( CommonLocs.YouTooFar );
			}
			else if( (Sower != null && from != m_Sower) && !(this is HarvestableTree) )
			{
				from.SendMessage( "You cannot harvest any of this crop." );
			}
			else if( from.Mounted )
			{
				from.SendMessage( "You cannot do this while riding a mount." );
			}
			else
			{
				int calcYield = CalculateYield( from );
				Item crop = null;

				try { crop = CreateCrop( calcYield ); }
				catch( Exception e ) { Server.Utilities.ExceptionManager.LogException( "BaseGrownCrop.cs", e ); }

				if( crop == null )
				{
					from.SendMessage( "You are unable to harvest any of this crop!" );
				}
				else
				{
					from.AddToBackpack( crop );

					from.Direction = from.GetDirectionTo( this );
					from.Animate( AnimationFrame, 5, 1, true, false, 0 );
					from.PlaySound( 0x133 );
					from.SendMessage( "You successfully harvest the crop!" );
				}

				if( createWeedsAndDelete )
				{
					new Weeds().MoveToWorld( this.Location, this.Map );
					this.Delete();
				}
				else
				{
					OnHarvest( from );
				}
			}
		}
Example #16
0
		public override void OnDoubleClick( Mobile from )
		{
			if( this.ItemID == 0x913 )
			{
			}
			else if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( CommonLocs.MustBeInPack );
			}
			else if( from.Mounted )
			{
				from.SendMessage( "You cannot do that while mounted." );
			}
			else if( !CheckPlantSeed( from.Location, from.Map, 0 ) )
			{
				from.SendMessage( "You cannot plant this so close to another crop." );
			}
			else if( CheckWeeds( from.Location, from.Map ) )
			{
				from.SendMessage( "These weeds will not help your crop grow!" );
			}
			else if( CanGrow( from.Location, from.Map ) )
			{
				from.Animate( 32, 5, 1, true, false, 0 );
				from.SendMessage( "You have planted the seed." );

				try
				{
					CropSeedling seedling = Activator.CreateInstance( typeof( CropSeedling ), m_FullCropType, m_SeedlingID ) as CropSeedling;
					BaseCropSeed tempSeed = new BaseCropSeed( 0, null );
					tempSeed.ItemID = 0x913;
					tempSeed.Movable = false;
					tempSeed.MoveToWorld( from.Location, from.Map );

					if( seedling != null )
						seedling.Plant( from, tempSeed );
				}
				catch( Exception e )
				{
					Server.Utilities.ExceptionManager.LogException( "BaseCropSeed.cs", e );

					from.SendMessage( "A problem has ocurred while planting the seed. This exception has been logged. Please contact an administrator for further assistance." );
				}

				if( --(this.Amount) <= 0 )
					this.Delete();
			}
			else
			{
				from.SendMessage( "You cannot plant this seed at this location." );
			}
		}
Example #17
0
 public override void OnComponentUsed(AddonComponent ac, Mobile from)
  {
      if (!from.InRange(GetWorldLocation(), 2))  
          from.SendMessage("You are too far away.");
      else
      {
          from.Emote("*stirs the brew*");
          from.Say("hihihihiiii!");
          from.PlaySound(32);
          if (!from.Mounted)
              from.Animate(33, 5, 1, true, false, 0);
      }
  }
Example #18
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.InRange(this.Location, 1))
            {
                if (!from.Mounted)
                {
                    BaseIngredient ingredient = Activator.CreateInstance(Ingredient) as BaseIngredient;
                    if (ingredient != null)
                    {
                        int skillReq = ingredient.SkillRequired;
                        int herbalLore = from.Skills[(SkillName)36].Fixed;
                        if (herbalLore < skillReq || (ingredient is PusantiaRoot && ((PlayerMobile)from).Feats.GetFeatLevel(FeatList.Pusantia) < 1))
                        {
                            from.SendMessage("You have no chance of harvesting this crop.");
                            return;
                        }

                        Server.Spells.SpellHelper.Turn(from, this);
                        from.Animate(32, 5, 1, true, false, 0);
                        from.PlaySound(79);

                        double successChance = ((double)(herbalLore - skillReq + 500)) / 1000;
                        if (successChance > Utility.RandomDouble())
                        {
                            from.SendMessage("You skillfully remove the relevant ingredient from the plant.");
                            ingredient.Amount += ((PlayerMobile)from).Feats.GetFeatLevel(FeatList.HerbalGathering);
                            from.AddToBackpack(ingredient);
                            ((PlayerMobile)from).Crafting = true;
                            Misc.LevelSystem.AwardMinimumXP((PlayerMobile)from, 1);
                            ((PlayerMobile)from).Crafting = false;
                            IsPlanted(from);

                            Seed.PickPlantSeed(from, "Agrimony");

                            Delete();
                        }

                        else
                        {
                            from.SendMessage("You try to remove the ingredient from the plant, but end up only ruining it.");
                            IsPlanted(from);
                            Delete();
                        }
                    }
                }
                else
                    from.SendMessage("You can't do that while mounted.");
            }
            else
                from.SendMessage("You are too far away.");
        }
Example #19
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
					{
						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.Female )
							number = 500401; // You are too far away to beg from him.
						else
							number = 500402; // You are too far away to beg from her.
					}
					else if ( !Core.ML && from.Mounted ) // If we're on a mount, who would give us money? TODO: guessed it's removed since ML
					{
						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
				{
					number = 500399; // There is little chance of getting money from that!
				}

				if ( number != -1 )
					from.SendLocalizedMessage( number );
			}
Example #20
0
 public void Net_OnTarget(Mobile from, object targeted)
 {
     if (targeted is Corpse && (((Corpse)targeted).Owner == null || !((Corpse)targeted).Owner.Player))
     {
         if (SOS.ValidateDeepWater(((Corpse)targeted).Map, ((Corpse)targeted).X, ((Corpse)targeted).Y))
         {
             from.Animate(12, 5, 1, true, false, 0);
             Timer.DelayCall(TimeSpan.FromSeconds(0.5), new TimerStateCallback(MoveCorpse), new object[] { (Corpse)targeted, from });
         }
         else
             from.SendMessage("This can only be used in deep water.");
     }
     else
         from.SendMessage("You can only net corpses!");
 }
Example #21
0
		public virtual void Chop( Mobile m )
		{
			m.Animate( 13, 7, 1, true, false, 0 );
			m.PlaySound( 0x13E );
			m.SendMessage( "Your axe cuts through the thin trunk with ease." );

			new Weeds().MoveToWorld( this.Location, this.Map );
			new Server.Items.TimedItem( 60.0, 0x1038 ).MoveToWorld( this.Location, this.Map );

			m.AddToBackpack( new Server.Items.Kindling( 4 ) );

			if( m_Timer != null )
				m_Timer.Stop();
			this.Delete();
		}
		public override bool Eat(Mobile from)
		{
			from.PlaySound(Utility.Random(0x3A, 3));

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

			if (Utility.RandomDouble() < 0.05)
				GiveToothAche(from, 0);
			else
				from.SendLocalizedMessage(1077387);

			Consume();
			return true;
		}
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
				{
					//from.SendLocalizedMessage( 501698 ); // You cannot disguise yourself while incognitoed.
					from.SendMessage( "You decide against eating it while incognitoed " );
				}
				else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
				{
					//from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
					from.SendMessage( "You can not be polymorphed at this time" );
				}
				else if ( Spells.Necromancy.TransformationSpell.UnderTransformation( from ) )
				{
					//from.SendLocalizedMessage( 501699 ); // You cannot disguise yourself while polymorphed.
					from.SendMessage( "You decide against eating it while polymorphed" );
				}
				else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask || from.FindItemOnLayer( Layer.Helm ) is OrcishKinRPMask )
				{
					//from.SendLocalizedMessage( 501605 ); // You are already disguised.
					from.SendMessage( "You decide against eating it while as your disguised" );
				}
				else
				{
					from.BodyMod = ( from.Female ? 186 : 185 );
					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.
					from.SendMessage( "You now bear the markings of the undead pirates.  This will last about a week" );
					from.PlaySound( Utility.Random( 0x3A, 3 ) );
					if ( from.Body.IsHuman && !from.Mounted )
						from.Animate( 34, 5, 1, true, false, 0 );
					from.ApplyPoison( from, Poison.Lethal );
					Consume();
				}
			}
			else
			{
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
			}
		}
Example #24
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 )
                    {
                        number = 500398; // Perhaps just asking would work better.
                    }
                    else if ( !targ.Body.IsHuman )
                    {
                        number = 500399; // There is little chance of getting money from that!
                    }
                    else if ( !from.InRange( targ, 2 ) )
                    {
                        if ( !targ.Female )
                            number = 500401; // You are too far away to beg from him.
                        else
                            number = 500402; // You are too far away to beg from her.
                    }
                    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
                {
                    number = 500399; // There is little chance of getting money from that!
                }

                if ( number != -1 )
                    from.SendLocalizedMessage( number );
            }
		public void Throw( Mobile from )
		{
			BaseKnife knife = from.Weapon as BaseKnife;

			if ( knife == null )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 500751 ); // Try holding a knife...
				return;
			}

			from.Animate( from.Mounted ? 26 : 9, 7, 1, true, false, 0 );
			from.MovingEffect( this, knife.ItemID, 7, 1, false, false );
			from.PlaySound( 0x238 );

			double rand = Utility.RandomDouble();

			int message;
			if ( rand < 0.05 )
				message = 500752; // BULLSEYE! 50 Points!
			else if ( rand < 0.20 )
				message = 500753; // Just missed the center! 20 points.
			else if ( rand < 0.45 )
				message = 500754; // 10 point shot.
			else if ( rand < 0.70 )
				message = 500755; // 5 pointer.
			else if ( rand < 0.85 )
				message = 500756; // 1 point.  Bad throw.
			else
				message = 500757; // Missed.

			PublicOverheadMessage( MessageType.Regular, 0x3B2, message );
			if ( m_NextSound < DateTime.Now && message != 500757 )
			{
				if ( message == 500752 )
					Effects.PlaySound( Location, Map, 426 );
				else
					Effects.PlaySound( Location, Map, 425 );

				if ( message < 500756 )
					AnimateMongbat();

				m_NextSound = DateTime.Now + TimeSpan.FromSeconds( 2 );
			}
		}
        public void decreaseUses(Mobile from)
        {
            UsesRemaining--;
            Name = "Pelle de Fermier (" + UsesRemaining + ")";

            if (this.UsesRemaining <= 0)
            {
                from.SendMessage("La pelle se brise entre vos mains.");
                from.PlaySound(0x2A);
                this.Delete();
            }
            else
            {
                int[] sons = new int[] { 0x125, 0x126 };
                int son = Utility.Random(0, 1);
                from.PlaySound(sons[son]);
                from.Animate(11, 1, 1, true, false, 0);
            }
        }
		public void OnTarget( Mobile from, object obj )
		{
			m_Player = from;
			
			if ( Deleted )
				return;

			IPoint3D p3D = obj as IPoint3D;

			if ( p3D == null )
				return;

			Map map = from.Map;

			if ( map == null || map == Map.Internal )
				return;

			int x = p3D.X, y = p3D.Y;

			if ( !from.InRange( p3D, 6 ) )
			{
				from.SendLocalizedMessage( 500976 ); // You need to be closer to the water to fish!
			}
			else if ( FullValidation( map, x, y ) )
			{
				Point3D p = new Point3D( x, y, map.GetAverageZ( x, y ) );

				Movable = false;
				MoveToWorld( p, map );

				from.Animate( 12, 5, 1, true, false, 0 );

				Timer.DelayCall( TimeSpan.FromSeconds( 1.5 ), TimeSpan.FromSeconds( 1.0 ), 20, new TimerStateCallback( DoEffect ), new object[]{ p, 0 } );

				from.SendLocalizedMessage( 1010487 ); // You plunge the net into the sea...
			}
			else
			{
				from.SendLocalizedMessage( 1010485 ); // You can only use this net in deep water!
			}
		}
Example #28
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( IsChildOf( from.Backpack ) )
			{
				if ( !from.CanBeginAction( typeof( Spells.Fifth.IncognitoSpell ) ) )
					from.SendMessage( "You decide against eating it while in incognito." );
				else if ( !from.CanBeginAction( typeof( Spells.Seventh.PolymorphSpell ) ) )
					from.SendMessage( "You can not be polymorphed at this time." );
				//else if ( TransformationSpellHelper.UnderTransformation( Caster, typeof( WraithFormSpell ) ) )
				//	from.SendMessage( "You decide against eating it while polymorphed." );
				else if ( from.IsBodyMod || from.FindItemOnLayer( Layer.Helm ) is OrcishKinMask )
					from.SendMessage( "You decide against eating it while in your disguise." );
				else
				{
					if ( from is PlayerMobile )
					{
						PlayerMobile pm = from as PlayerMobile;
						if ( pm.SavagePaintExpiration > TimeSpan.Zero )
							from.SendMessage( "You already have the markings of another tribe." );
						else
						{
							from.BodyMod = ( from.Female ? 186 : 185 );
							from.HueMod = 0;

							pm.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.
							from.SendMessage( "You now bear the markings of the undead pirates.  This will last about a week." );
							from.PlaySound( Utility.Random( 0x3A, 3 ) );
							if ( from.Body.IsHuman && !from.Mounted )
								from.Animate( 34, 5, 1, true, false, 0 );
							from.ApplyPoison( from, Poison.Greater );
							Consume();
						}
					}
				}
			}
			else
				from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
		}
Example #29
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                Map map = from.Map;

                if (targeted is LandTarget && map != null)
                {
                    LandTarget lt = (LandTarget)targeted;
                    Region r = Region.Find(lt.Location, map);

                    if (r != null && r.IsPartOf("Magincia") && (lt.Name == "dirt" || lt.Name == "grass"))
                    {
                        if (!MaginciaPlantSystem.Enabled)
                            from.SendMessage("Magincia plant placement is currently disabled.");
                        else if (MaginciaPlantSystem.CanAddPlant(from, lt.Location))
                        {
                            int fertileDirt = from.Backpack == null ? 0 : from.Backpack.GetAmount(typeof(FertileDirt), false);

                            if (fertileDirt > 0)
                                from.SendGump(new FertileDirtGump(null, fertileDirt, lt));
                            else
                            {
                                if (from.Body.IsHuman && !from.Mounted)
                                    from.Animate(11, 5, 1, true, false, 0);

                                from.PlaySound(0x125);

                                MaginciaPlantItem dirt = new MaginciaPlantItem();
                                dirt.StartTimer();

                                Timer.DelayCall(TimeSpan.FromSeconds(.7), new TimerStateCallback(MoveItem_Callback), new object[] { dirt, lt.Location, map } );
                            }
                        }
                    }
                    else
                        from.SendLocalizedMessage(1150457); // The ground here is not good for gardening.
                    
                }
            }
		public override void OnGaveMeleeAttack( Mobile defender )
		{
			base.OnGaveMeleeAttack( defender );

			if ( !m_Stunning && 0.3 > Utility.RandomDouble() )
			{
				m_Stunning = true;

				defender.Animate( 21, 6, 1, true, false, 0 );
				this.PlaySound( 0xEE );
				defender.LocalOverheadMessage( MessageType.Regular, 0x3B2, false, "You have been stunned by a colossal blow!" );

				BaseWeapon weapon = this.Weapon as BaseWeapon;
				if ( weapon != null )
					weapon.OnHit( this, defender );

				if ( defender.Alive )
				{
					defender.Frozen = true;
					Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerStateCallback( Recover_Callback ), defender );
				}
			}
		}