Beispiel #1
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 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." );
        }
		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." );
			}
		}
Beispiel #4
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 ) );
				}
			}
		}
		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.
			}
		}
Beispiel #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 );
		}
		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";
		}
Beispiel #8
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;
        }
		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 );
		}
Beispiel #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;
		}
Beispiel #11
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 });
        }
Beispiel #12
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);
		}
		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);
		}
Beispiel #14
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 );
				}
			}
		}
			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" );
					}
				}
			}
Beispiel #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." );
			}
		}
Beispiel #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);
      }
  }
Beispiel #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.");
        }
Beispiel #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 );
			}
Beispiel #20
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;
		}
Beispiel #22
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!");
 }
		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.
			}
		}
Beispiel #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!
			}
		}
Beispiel #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.
		}
Beispiel #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 );
				}
			}
		}
Beispiel #31
0
        public static int Damage(Mobile m, Mobile from, int damage, bool ignoreArmor, int phys, int fire, int cold, int pois, int nrgy, int chaos, int direct, bool keepAlive, bool archer)
        {
            if (m == null || m.Deleted || !m.Alive || damage <= 0)
            {
                return(0);
            }

            if (phys == 0 && fire == 100 && cold == 0 && pois == 0 && nrgy == 0)
            {
                MeerMage.StopEffect(m, true);
            }

            if (!Core.AOS)
            {
                //Taran: This caused a huge bug where you could keep using skills and stack them when this was called
                //if (from is PlayerMobile)
                //    ((PlayerMobile)from).EndPlayerAction();

                if (m.Body.IsHuman)
                {
                    if (m.Mounted)
                    {
                        m.Animate(29, 5, 1, true, false, 2);
                    }
                    else
                    {
                        m.Animate(20, 5, 1, true, false, 2);
                    }
                }

                m.PlaySound(m.GetHurtSound());

                m.Damage(damage, from);
                return(damage);
            }

            Fix(ref phys);
            Fix(ref fire);
            Fix(ref cold);
            Fix(ref pois);
            Fix(ref nrgy);
            Fix(ref chaos);
            Fix(ref direct);

            if (Core.ML && chaos > 0)
            {
                switch (Utility.Random(5))
                {
                case 0: phys += chaos; break;

                case 1: fire += chaos; break;

                case 2: cold += chaos; break;

                case 3: pois += chaos; break;

                case 4: nrgy += chaos; break;
                }
            }

            BaseQuiver quiver = null;

            if (archer && from != null)
            {
                quiver = from.FindItemOnLayer(Layer.Cloak) as BaseQuiver;
            }

            int totalDamage;

            if (!ignoreArmor)
            {
                // Armor Ignore on OSI ignores all defenses, not just physical.
                int resPhys = m.PhysicalResistance;
                int resFire = m.FireResistance;
                int resCold = m.ColdResistance;
                int resPois = m.PoisonResistance;
                int resNrgy = m.EnergyResistance;

                totalDamage  = damage * phys * (100 - resPhys);
                totalDamage += damage * fire * (100 - resFire);
                totalDamage += damage * cold * (100 - resCold);
                totalDamage += damage * pois * (100 - resPois);
                totalDamage += damage * nrgy * (100 - resNrgy);

                totalDamage /= 10000;

                if (Core.ML)
                {
                    totalDamage += damage * direct / 100;

                    if (quiver != null)
                    {
                        totalDamage += totalDamage * quiver.DamageIncrease / 100;
                    }
                }

                if (totalDamage < 1)
                {
                    totalDamage = 1;
                }
            }
            else if (Core.ML && m is PlayerMobile && from is PlayerMobile)
            {
                if (quiver != null)
                {
                    damage += damage * quiver.DamageIncrease / 100;
                }

                totalDamage = Math.Min(damage, 35);                     //Direct Damage cap of 35
            }
            else
            {
                totalDamage = damage;

                if (Core.ML && quiver != null)
                {
                    totalDamage += totalDamage * quiver.DamageIncrease / 100;
                }
            }

            #region Dragon Barding
            if ((from == null || !from.Player) && m.Player && m.Mount is SwampDragon)
            {
                SwampDragon pet = m.Mount as SwampDragon;

                if (pet != null && pet.HasBarding)
                {
                    int percent  = (pet.BardingExceptional ? 20 : 10);
                    int absorbed = Scale(totalDamage, percent);

                    totalDamage   -= absorbed;
                    pet.BardingHP -= absorbed;

                    if (pet.BardingHP < 0)
                    {
                        pet.HasBarding = false;
                        pet.BardingHP  = 0;

                        m.SendLocalizedMessage(1053031);                           // Your dragon's barding has been destroyed!
                    }
                }
            }
            #endregion

            if (keepAlive && totalDamage > m.Hits)
            {
                totalDamage = m.Hits;
            }

            if (from != null && !from.Deleted && from.Alive)
            {
                int reflectPhys = AosAttributes.GetValue(m, AosAttribute.ReflectPhysical);

                if (reflectPhys != 0)
                {
                    if (from is ExodusMinion && ((ExodusMinion)from).FieldActive || from is ExodusOverseer && ((ExodusOverseer)from).FieldActive)
                    {
                        from.FixedParticles(0x376A, 20, 10, 0x2530, EffectLayer.Waist);
                        from.PlaySound(0x2F4);
                        m.SendAsciiMessage("Your weapon cannot penetrate the creature's magical barrier");
                    }
                    else
                    {
                        from.Damage(Scale((damage * phys * (100 - (ignoreArmor ? 0 : m.PhysicalResistance))) / 10000, reflectPhys), m);
                    }
                }
            }

            m.Damage(totalDamage, from);
            return(totalDamage);
        }
        public static void DrunkardThrowBottle(Mobile from)
        {
            if (from == null)
            {
                return;
            }

            Point3D location = from.Location;
            Map     map      = from.Map;

            int throwSound = 0x5D3;
            int itemId     = Utility.RandomList(2459, 2463, 2503);
            int itemHue    = 0;
            int hitSound   = Utility.RandomList(0x38D, 0x38E, 0x38F, 0x390);

            bool    foundLocation  = false;
            Point3D targetLocation = new Point3D();

            List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(from.Location, true, false, from.Location, from.Map, 1, 25, 2, 8, true);

            if (m_ValidLocations.Count > 0)
            {
                targetLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)];
                foundLocation  = true;

                from.Direction = from.GetDirectionTo(targetLocation);

                Timer.DelayCall(TimeSpan.FromSeconds(.25), delegate
                {
                    if (from == null)
                    {
                        return;
                    }
                    if (!from.Alive)
                    {
                        return;
                    }

                    from.Animate(31, 7, 1, true, false, 0); //Throw Bottle
                    from.PublicOverheadMessage(MessageType.Regular, 0, false, "*drunkenly throws bottle*");
                });
            }

            if (!foundLocation)
            {
                from.PublicOverheadMessage(MessageType.Regular, 0, false, "*drops bottle*");

                TimedStatic bottle = new TimedStatic(Utility.RandomList(0x38D, 0x38E, 0x38F, 0x390), 1);
                bottle.Name = "a drunkard's bottle";
                bottle.MoveToWorld(from.Location, from.Map);

                Effects.PlaySound(targetLocation, map, hitSound);

                return;
            }

            Timer.DelayCall(TimeSpan.FromSeconds(.75), delegate
            {
                if (from == null)
                {
                    return;
                }
                if (!from.Alive)
                {
                    return;
                }

                if (foundLocation)
                {
                    Effects.PlaySound(from.Location, from.Map, throwSound);

                    IEntity startLocation = new Entity(Serial.Zero, new Point3D(from.Location.X, from.Location.Y, from.Location.Z + 10), from.Map);
                    IEntity endLocation   = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 5), from.Map);

                    Direction direction = from.GetDirectionTo(targetLocation);

                    double speedModifier = .66;

                    Effects.SendMovingEffect(startLocation, endLocation, itemId, (int)(15 * speedModifier), 0, true, false, itemHue, 0);

                    double distance         = from.GetDistanceToSqrt(targetLocation);
                    double destinationDelay = (double)distance * .08 * (.5 / speedModifier);

                    Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate
                    {
                        Effects.PlaySound(targetLocation, map, hitSound);
                    });
                }
            });
        }
Beispiel #33
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            int val = info.ButtonID - 1;

            if (val < 0)
            {
                return;
            }

            Mobile from = m_From;

            int type  = val % 15;
            int index = val / 15;

            switch (type)
            {
            case 0:
            {
                EmotePage page;

                switch (index)
                {
                case 1: page = EmotePage.P1; break;

                case 2: page = EmotePage.P2; break;

                case 3: page = EmotePage.P3; break;

                case 4: page = EmotePage.P4; break;

                default: return;
                }

                from.SendGump(new EmoteGump(from, page));
                break;
            }

            case 1:
            {
                switch (index)
                {
                case 1:
                {
                    if (from.Female)
                    {
                        from.PlaySound(778);
                        from.Say("Ah!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1049);
                        from.Say("Ah!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 2:
                {
                    if (from.Female)
                    {
                        from.PlaySound(779);
                        from.Say("Ah Ah!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1050);
                        from.Say("Ah Ah!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 3:
                {
                    if (from.Female)
                    {
                        from.PlaySound(780);
                        from.Emote("*clap*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1051);
                        from.Emote("*Clap*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 5:
                {
                    from.Emote("*Bow*");
                    if (!from.Mounted)
                    {
                        from.Animate(32, 5, 1, true, false, 0);
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 6:
                {
                    if (from.Female)
                    {
                        from.PlaySound(786);
                        from.Emote("*Cough*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1057);
                        from.Emote("*Cough*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 7:
                {
                    if (from.Female)
                    {
                        from.PlaySound(782);
                        from.Emote("*Burp*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1053);
                        from.Emote("*Burp*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 8:
                {
                    if (from.Female)
                    {
                        from.PlaySound(784);
                        from.Say("Hum hum..");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1055);
                        from.Say("Hum hum..");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 9:
                {
                    if (from.Female)
                    {
                        from.PlaySound(785);
                        from.Emote("*Cough*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1056);
                        from.Emote("*Cough*");
                        if (!from.Mounted)
                        {
                            from.Animate(33, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 10:
                {
                    if (from.Female)
                    {
                        from.PlaySound(787);
                        from.Emote("*Cry*");
                        if (!from.Mounted)
                        {
                            from.Animate(34, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1058);
                        from.Emote("*Cry*");
                        if (!from.Mounted)
                        {
                            from.Animate(34, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 11:
                {
                    if (from.Female)
                    {
                        from.PlaySound(791);
                        from.Emote("*Fall*");
                        if (!from.Mounted)
                        {
                            from.Animate(22, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1063);
                        from.Emote("*Fall*");
                        if (!from.Mounted)
                        {
                            from.Animate(22, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 12:
                {
                    if (from.Female)
                    {
                        from.PlaySound(792);
                        from.Emote("*Fart*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1064);
                        from.Emote("*Fall*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P1));
                    break;
                }

                case 13:
                {
                    if (from.Female)
                    {
                        from.PlaySound(793);
                        from.Emote("*Gasp*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1065);
                        from.Emote("*Gasp*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 14:
                {
                    if (from.Female)
                    {
                        from.PlaySound(794);
                        from.Emote("*Laught*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1066);
                        from.Emote("*Laught*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 15:
                {
                    if (from.Female)
                    {
                        from.PlaySound(795);
                        from.Emote("*Groan*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1067);
                        from.Emote("*Groan*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 16:
                {
                    if (from.Female)
                    {
                        from.PlaySound(796);
                        from.Emote("*Growl*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1068);
                        from.Emote("*Growl*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 17:
                {
                    if (from.Female)
                    {
                        from.PlaySound(797);
                        from.Say("Hey!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1069);
                        from.Say("Hey!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 18:
                {
                    if (from.Female)
                    {
                        from.PlaySound(798);
                        from.Say("Hic!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1070);
                        from.Say("Hic!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 19:
                {
                    if (from.Female)
                    {
                        from.PlaySound(799);
                        from.Say("Hu?!*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1071);
                        from.Say("Hu?!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 20:
                {
                    if (from.Female)
                    {
                        from.PlaySound(800);
                        from.Emote("*Kiss*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1072);
                        from.Emote("*Kiss*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 21:
                {
                    if (from.Female)
                    {
                        from.PlaySound(801);
                        from.Emote("*Laught*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1073);
                        from.Emote("*Laught*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 22:
                {
                    if (from.Female)
                    {
                        from.PlaySound(802);
                        from.Say("No!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1074);
                        from.Say("No!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 23:
                {
                    if (from.Female)
                    {
                        from.PlaySound(803);
                        from.Say("Oh!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1075);
                        from.Say("Oh!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 24:
                {
                    if (from.Female)
                    {
                        from.PlaySound(811);
                        from.Say("Oooh!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1085);
                        from.Say("Oooh!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P2));
                    break;
                }

                case 25:
                {
                    if (from.Female)
                    {
                        from.PlaySound(812);
                        from.Say("Oups!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1086);
                        from.Say("Oups!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 26:
                {
                    if (from.Female)
                    {
                        from.PlaySound(813);
                        from.Emote("*Puke*");
                        if (!from.Mounted)
                        {
                            from.Animate(32, 5, 1, true, false, 0);
                        }
                    }
                    if (!from.Female)
                    {
                        from.PlaySound(1087);
                        from.Emote("*Puke*");
                        if (!from.Mounted)
                        {
                            from.Animate(32, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 27:
                {
                    from.PlaySound(315);
                    from.Emote("*Strike*");
                    if (!from.Mounted)
                    {
                        from.Animate(31, 5, 1, true, false, 0);
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 28:
                {
                    if (from.Female)
                    {
                        from.PlaySound(814);
                        from.Emote("*Howl*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1088);
                        from.Emote("*Howl*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }


                case 29:
                {
                    if (from.Female)
                    {
                        from.PlaySound(815);
                        from.Say("Shuut!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1089);
                        from.Say("Shuut!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 30:
                {
                    if (from.Female)
                    {
                        from.PlaySound(816);
                        from.Emote("*sigh*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1090);
                        from.Emote("*Sigh*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 31:
                {
                    from.PlaySound(948);
                    from.Emote("*Knock*");
                    if (!from.Mounted)
                    {
                        from.Animate(11, 5, 1, true, false, 0);
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 32:
                {
                    if (from.Female)
                    {
                        from.PlaySound(817);
                        from.Emote("*Sneeze*");
                        if (!from.Mounted)
                        {
                            from.Animate(32, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1091);
                        from.Emote("*Sneez*");
                        if (!from.Mounted)
                        {
                            from.Animate(32, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 33:
                {
                    if (from.Female)
                    {
                        from.PlaySound(818);
                        from.Emote("*Blownose*");
                        if (!from.Mounted)
                        {
                            from.Animate(34, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1092);
                        from.Emote("*blownose*");
                        if (!from.Mounted)
                        {
                            from.Animate(34, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 34:
                {
                    if (from.Female)
                    {
                        from.PlaySound(819);
                        from.Emote("*Snore*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1093);
                        from.Emote("*Snore*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 35:
                {
                    if (from.Female)
                    {
                        from.PlaySound(820);
                        from.Emote("*Spit*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1094);
                        from.Emote("*Spit*");
                        if (!from.Mounted)
                        {
                            from.Animate(6, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 36:
                {
                    from.PlaySound(792);
                    from.Emote("*Fart*");
                    from.SendGump(new EmoteGump(from, EmotePage.P3));
                    break;
                }

                case 38:
                {
                    if (from.Female)
                    {
                        from.PlaySound(821);
                        from.Emote("*Wistle*");
                        if (!from.Mounted)
                        {
                            from.Animate(5, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1095);
                        from.Emote("*Wistle*");
                        if (!from.Mounted)
                        {
                            from.Animate(5, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P4));
                    break;
                }

                case 39:
                {
                    if (from.Female)
                    {
                        from.PlaySound(783);
                        from.Say("Wouhou!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1054);
                        from.Say("Wouhou!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P4));
                    break;
                }

                case 40:
                {
                    if (from.Female)
                    {
                        from.PlaySound(822);
                        from.Emote("*Yawn*");
                        if (!from.Mounted)
                        {
                            from.Animate(17, 5, 1, true, false, 0);
                        }
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1096);
                        from.Emote("*Yawn*");
                        if (!from.Mounted)
                        {
                            from.Animate(17, 5, 1, true, false, 0);
                        }
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P4));
                    break;
                }

                case 41:
                {
                    if (from.Female)
                    {
                        from.PlaySound(823);
                        from.Say("Yeah!");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1097);
                        from.Say("Yeah!");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P4));
                    break;
                }

                case 42:
                {
                    if (from.Female)
                    {
                        from.PlaySound(824);
                        from.Emote("*Yell*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1098);
                        from.Emote("*Yell*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P4));
                    break;
                }

                case 43:
                {
                    if (from.Female)
                    {
                        from.PlaySound(1385);
                        from.Emote("*Fall into a hole*");
                    }
                    else if (!from.Female)
                    {
                        from.PlaySound(1385);
                        from.Emote("*Fall into a hole*");
                    }
                    from.SendGump(new EmoteGump(from, EmotePage.P4));
                    break;
                }
                }
                break;
            }
            }
        }
        public static void Honor(Mobile from, object targeted)
        {
            if (!from.CheckAlive())
            {
                return;
            }

            Mobile targ = targeted as Mobile;

            if (targ == null)
            {
                return;
            }

            VirtueLevel level = VirtueHelper.GetLevel(from, VirtueName.Honor);

            if (targ == from)
            {
                if (CantEmbrace(from))
                {
                    from.SendLocalizedMessage(1063230);                       // You must wait awhile before you can embrace honor again.

                    return;
                }

                if (level < VirtueLevel.Seeker)
                {
                    from.SendLocalizedMessage(1063234);                       // You do not have enough honor to do that

                    return;
                }

                Timer t = (Timer)m_Table[from];

                if (t != null)
                {
                    t.Stop();
                }

                Timer t2 = (Timer)m_Table2[from];

                if (t2 != null)
                {
                    t.Stop();
                }

                double delay = 0;

                switch (level)
                {
                case VirtueLevel.Seeker:
                    delay = 60.0;
                    break;

                case VirtueLevel.Follower:
                    delay = 90.0;
                    break;

                case VirtueLevel.Knight:
                    delay = 120.0;
                    break;
                }

                m_Table[from] = t = Timer.DelayCall(TimeSpan.FromSeconds(delay), new TimerStateCallback(Expire_Callback), from);

                m_Table2[from] = t2 = Timer.DelayCall(TimeSpan.FromMinutes(5.0), new TimerStateCallback(Expire_Callback2), from);

                from.SendLocalizedMessage(1063235);                   // You embrace your honor

                if (VirtueHelper.Atrophy(from, VirtueName.Honor))
                {
                    from.SendLocalizedMessage(1063227);                       // You have lost some Honor.
                }
            }
            else
            {
                if (targ is BaseCreature)
                {
                    BaseCreature cr = targ as BaseCreature;

                    if (cr.HonorOpponent != null && cr.HonorOpponent != from)
                    {
                        from.SendLocalizedMessage(1063233);                           // Somebody else is honoring this opponent

                        return;
                    }
                }

                if (targ is PlayerMobile)
                {
                    PlayerMobile pm = targ as PlayerMobile;

                    if (pm.HonorOpponent != null && pm.HonorOpponent != from)
                    {
                        from.SendLocalizedMessage(1063233);                           // Somebody else is honoring this opponent

                        return;
                    }
                }

                if (VirtueHelper.IsHighestPath(from, VirtueName.Honor))
                {
                    from.SendLocalizedMessage(1063228);                       // You cannot gain more Honor.

                    return;
                }

                if (!from.InRange(targ.Location, 5))
                {
                    from.SendLocalizedMessage(1063232);                       // You are too far away to honor your opponent

                    return;
                }

                if (((targ.Hits * 100) / Math.Max(targ.HitsMax, 1)) < 85)
                {
                    from.SendLocalizedMessage(1063166);                       // You cannot honor this monster because it is too damaged.

                    return;
                }

                if (!NotorietyHandlers.Mobile_AllowHarmful(from, targ))
                {
                    return;
                }

                if (!from.CanSee(targ) || !from.InLOS(targ))
                {
                    return;
                }

                from.Direction = from.GetDirectionTo(targ.Location);

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

                from.Say(1063231);                   // I honor you

                PlayerMobile player = from as PlayerMobile;

                player.HonorOpponent = targ;

                if (targ is BaseCreature)
                {
                    ((BaseCreature)targ).HonorOpponent = player;
                }

                if (targ is PlayerMobile)
                {
                    ((PlayerMobile)targ).HonorOpponent = player;
                }

                player.SpotHonor = player.Location;

                player.Perfection = 0;
            }
        }
Beispiel #35
0
        // Main Aura Method
        public static void Aura(Point3D location, Map map, Mobile from, int min, int max, ResistanceType type, int range, Poison poison, string text, bool scales, bool allownull, bool effects, int itemid, int hue)
        {
            if (from == null && !allownull)
            {
                return;
            }

            List <Mobile> targets = new List <Mobile>();

            foreach (Mobile m in Map.AllMaps[map.MapID].GetMobilesInRange(location, range))
            {
                if (CanTarget(from, m, true, false, allownull))
                {
                    targets.Add(m);
                }
            }

            if (effects && from != null)
            {
                from.Animate(12, 5, 1, true, false, 0);
            }

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

                if (text != "")
                {
                    m.SendMessage(text);
                }

                int auradamage = Utility.RandomMinMax(min, max);

                if (scales)
                {
                    auradamage = (int)((auradamage / GetDist(location, m.Location)) * range);
                }

                if (poison != null)
                {
                    m.ApplyPoison((from == null) ? m : from, poison);
                }

                if (effects)
                {
                    m.FixedParticles(itemid, 10, 15, 5030 /*what the hell does this number do?*/, hue, 0, EffectLayer.Waist);
                }

                switch (type)
                {
                case ResistanceType.Physical:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 100, 0, 0, 0, 0);
                    break;

                case ResistanceType.Fire:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 100, 0, 0, 0);
                    break;

                case ResistanceType.Cold:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 100, 0, 0);
                    break;

                case ResistanceType.Poison:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 100, 0);
                    break;

                case ResistanceType.Energy:
                    AOS.Damage(m, (from == null) ? m : from, auradamage, 0, 0, 0, 0, 100);
                    break;
                }
            }

            targets.Clear();
        }