Example #1
1
 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " " + this.Name));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
         }
     }
     else
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " bales of cotton"));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a bale of cotton"));
         }
     }
 }
Example #2
1
		public override TimeSpan OnSwing( Mobile attacker, Mobile defender ) {
			// Make sure we've been standing still for one second
			if( DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds( Core.AOS ? 0.5 : 1.0 )) || (Core.AOS && WeaponAbility.GetCurrentAbility( attacker ) is MovingShot) ) {
				bool canSwing = true;

				if( Core.AOS ) {
					canSwing = (!attacker.Paralyzed && !attacker.Frozen);

					if( canSwing ) {
						Spell sp = attacker.Spell as Spell;

						canSwing = (sp == null || !sp.IsCasting || !sp.BlocksMovement);
					}
				}

				if( canSwing && attacker.HarmfulCheck( defender ) ) {
					attacker.DisruptiveAction();
					attacker.Send( new Swing( 0, attacker, defender ) );

					if( OnFired( attacker, defender ) ) {
						if( CheckHit( attacker, defender ) )
							OnHit( attacker, defender );
						else
							OnMiss( attacker, defender );
					}
				}

				return GetDelay( attacker );
			} else {
				return TimeSpan.FromSeconds( 0.25 );
			}
		}
Example #3
0
        /*public override void OnSingleClick(Mobile from)
        {
            if (this.Name != null)
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
            }
            else
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a ring"));
            }
        }*/
        public override void OnSingleClick(Mobile from)
        {
            if (this.Name != null)
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
            }
            else
            {
                if (Effect != JewelEffect.None)
                {
                    if (Identified || from.AccessLevel >= AccessLevel.GameMaster)
                    {
                        if (Effect == JewelEffect.Invisibility)
                            from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("a ring of invisibility ({0} charges)", Charges)));
                        else if (Effect == JewelEffect.Teleportation)
                            from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("a ring of teleportation ({0} charges)", Charges)));
                    }
                    else
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a magic ring"));

                }
                else
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a ring"));
            }
        }
Example #4
0
 public override void OnDoubleClick(Mobile from)
 {
     if (Utility.RandomBool())
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Ankhs"));
     else
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Serpents"));
 }
Example #5
0
        public override void OnSingleClick(Mobile from)
        {
            from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a wooden chest"));

            if (this.Locked == false)
            from.Send( new AsciiMessage( Serial, ItemID, MessageType.Label, 0, 3, "", "(" + this.TotalItems + " items, " + this.TotalWeight + " stones)" ) );

            if (m_House != null && BaseHouse.DecayEnabled && m_House.DecayPeriod != TimeSpan.Zero)
            {
                string message;
                string full;

                switch (m_House.DecayLevel)
                {
                    case DecayLevel.Ageless: message = "ageless"; break;
                    case DecayLevel.Fairly: message = "fairly worn"; break;
                    case DecayLevel.Greatly: message = "greatly worn"; break;
                    case DecayLevel.LikeNew: message = "like new"; break;
                    case DecayLevel.Slightly: message = "slightly worn"; break;
                    case DecayLevel.Somewhat: message = "somewhat worn"; break;
                    default: message = "in danger of collapsing"; break;
                }
                full = "This tent is " + message + ".";

                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", full));
            }
        }
Example #6
0
 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", Amount + " " + this.Name));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
         }
     }
     else
     {
         if (Amount >= 2)
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("{0} pieces of cloth ({0} yards of cloth)", Amount)));
         }
         else
         {
             from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a piece of cloth (1 yard of cloth)"));
         }
     }
 }
Example #7
0
 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     else
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a dungeon wall"));
 }
        public override void OnSingleClick(Mobile from)
        {
            int hue = Notoriety.GetHue(Server.Misc.NotorietyHandlers.CorpseNotoriety(from, this));

            if (this.ItemID == 0x2006) // Corpse form
                from.Send(new MessageLocalized(this.Serial, this.ItemID, MessageType.Label, hue, 3, 1049144, "", this.Name)); // the remains of ~1_NAME~ the apprentice
            else
                from.Send(new MessageLocalized(this.Serial, this.ItemID, MessageType.Label, hue, 3, 1049145, "", "")); // the remains of a wizard's apprentice
        }
Example #9
0
 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "A plate decorated with a beautiful painting of Mondain's defeat as the Gem of Immortality shatters."));
     }
 }
Example #10
0
 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", (m_Owner == null ? "ribcage" : "ribcage of " + m_Owner)));
     }
 }
Example #11
0
 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "In Commemoration of the 300th anniversary of Mondain's defeat"));
     }
 }
Example #12
0
 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a dressform"));
     }
 }
Example #13
0
 public override void OnSingleClick(Mobile from)
 {
     if (this.Name != null)
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "(" + this.TotalItems + " items, " + this.TotalWeight + " stones)"));
     }
     else
     {
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a trash chest"));
         from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "(" + this.TotalItems + " items, " + this.TotalWeight + " stones)"));
     }
 }
		public static void SendTo( this Prompt prompt, Mobile m )
		{
            if (m.NetState != null && m.NetState.Version.Major >= 67)
			{
				m.Send( new PromptGumpStub( prompt, m ).GetPacket() );
			}
			else
			{
				if ( prompt.MessageCliloc != 1042971 || prompt.MessageArgs != String.Empty )
					m.SendLocalizedMessage( prompt.MessageCliloc, prompt.MessageArgs, prompt.MessageHue );

				m.Send( new UnicodePrompt( prompt, m ) );
			}
		}
Example #15
0
        public override void OnDoubleClick(Mobile from)
        {
            BaseBook book;
            if (Toggle || mate == null) book = this;
            else book = mate;
            if (book.Title == null && book.Author == null && book.Writable == true)
            {
                book.Title = "a book";
                book.Author = from.Name;
            }

            from.Send(new BookHeader(from, book));
            from.Send(new BookPageDetails(book));
            Toggle = !Toggle;
        }
Example #16
0
 public override void OnEnter(Mobile m)
 {
     if (m.NetState != null &&
         !TransformationSpellHelper.UnderTransformation(m, typeof(AnimalForm)) &&
         m.AccessLevel < AccessLevel.GameMaster)
         m.Send(SpeedControl.WalkSpeed);
 }
Example #17
0
		public override TimeSpan OnSwing( Mobile attacker, Mobile defender )
		{
			// Make sure we've been standing still for .25/.5/1 second depending on Era
			if ( DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds( 1.0 )) )
			{
				if ( attacker.HarmfulCheck( defender ) )
				{
					attacker.DisruptiveAction();
					attacker.Send( new Swing( 0, attacker, defender ) );

					if ( OnFired( attacker, defender ) )
					{
						if ( CheckHit( attacker, defender ) )
							OnHit( attacker, defender );
						else
							OnMiss( attacker, defender );
					}
				}

				attacker.RevealingAction();

				return GetDelay( attacker );
			}
			else
			{
				attacker.RevealingAction();

				return TimeSpan.FromSeconds( 0.25 );
			}
		}
        private void SendMessageTo(Mobile to, string text, int hue)
        {
            if (Deleted || !to.CanSee(this))
                return;

            to.Send(new UnicodeMessage(Serial, ItemID, MessageType.Regular, hue, 3, to.Language, "", text));
        }
            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( targeted is Spellbook )
                {
                    if ( from.CheckAlive() && !m_Scroll.Deleted && m_Scroll.Movable && m_Scroll.Amount >= 1 )
                    {
                        Spellbook book = (Spellbook)targeted;

                        SpellbookType type = Spellbook.GetTypeForSpell( m_Scroll.SpellID );

                        if ( type != book.SpellbookType )
                        {
                        }
                        else if ( book.HasSpell( m_Scroll.SpellID ) )
                        {
                            from.SendAsciiMessage( "That spell is already present in that spellbook." ); // That spell is already present in that spellbook.
                        }
                        else
                        {
                            int val = m_Scroll.SpellID - book.BookOffset;

                            if ( val >= 0 && val < book.BookCount )
                            {
                                book.Content |= (ulong)1 << val;

                                m_Scroll.Consume();

                                from.Send( new Network.PlaySound( 0x249, book.GetWorldLocation() ) );
                            }
                        }
                    }
                }
            }
Example #20
0
		public override bool OnDragDropInto( Mobile from, Item dropped, Point3D point )
		{
			BasePiece piece = dropped as BasePiece;

			if ( piece != null && piece.Board == this && base.OnDragDropInto( from, dropped, point ) )
			{
				Packet p = new PlaySound( 0x127, GetWorldLocation() );

				p.Acquire();

				if ( RootParent == from )
				{
					from.Send( p );
				}
				else
				{
					foreach ( NetState state in this.GetClientsInRange( 2 ) )
						state.Send( p );
				}

				p.Release();

				return true;
			}
			else
			{
				return false;
			}
		}
Example #21
0
        public static void OnEffectEnd(Mobile caster, Type type)
        {
            int spellID = SpellRegistry.GetRegistryNumber(type);

            if (spellID > 0)
                caster.Send(new ToggleSpecialAbility(spellID + 1, false));
        }
Example #22
0
		public override void RemoveEffect( Mobile m )
		{
			#region Mondain's Legacy
			if ( !( m.Region is Server.Regions.TwistedWealdDesert ) )
				m.Send( SpeedControl.Disable );
			#endregion
		}
		private void SendMessageTo( Mobile to, int number, int hue )
		{
			if ( Deleted || !to.CanSee( this ) )
				return;

			to.Send( new Network.MessageLocalized( Serial, ItemID, Network.MessageType.Regular, hue, 3, number, "", "" ) );
		}
		private void SendMessageTo( Mobile to, string text, int hue )
		{
			if ( Deleted || !to.CanSee( this ) )
				return;

			to.Send( new Network.UnicodeMessage( Serial, ItemID, Network.MessageType.Regular, hue, 3, "ENU", "", text ) );
		}
Example #25
0
 public override void OnExit(Mobile m)
 {
     if (m.NetState != null &&
         !TransformationSpellHelper.UnderTransformation(m, typeof(AnimalForm)) &&
         !TransformationSpellHelper.UnderTransformation(m, typeof(Server.Spells.Spellweaving.ReaperFormSpell)))
         m.Send(SpeedControl.Disable);
 }
Example #26
0
		public override void OnSingleClick( Mobile from )
		{
			LabelToExpansion(from);

			int number = (Amount == 1) ? 1049122 : 1049121;

			from.Send( new MessageLocalized( Serial, ItemID, MessageType.Label, 0x3B2, 3, number, "", (Amount * 50).ToString() ) );
		}
Example #27
0
 public override void OnSingleClick( Mobile from )
 {
     if ( this.Name == null )
     {
         if ( this.Amount > 1 )
         {
             from.Send( new AsciiMessage( this.Serial, 0, MessageType.Label, 0x3B2, 3, null, this.Amount + " agapite ingots" ) );
         }
         else
         {
             from.Send( new AsciiMessage( this.Serial, 0, MessageType.Label, 0x3B2, 3, null, "an agapite ingot" ) );
         }
     }
     else
     {
         LabelTo( from, this.Name );
     }
 }
Example #28
0
		public override TimeSpan OnSwing( Mobile attacker, Mobile defender )
		{
			WeaponAbility a = WeaponAbility.GetCurrentAbility( attacker );

			// Make sure we've been standing still for .25/.5/1 second depending on Era
			if ( DateTime.Now > (attacker.LastMoveTime + TimeSpan.FromSeconds( Core.SE ? 0.25 : (Core.AOS ? 0.5 : 1.0) )) || (Core.AOS && WeaponAbility.GetCurrentAbility( attacker ) is MovingShot) )
			{
				bool canSwing = true;

				if ( Core.AOS )
				{
					canSwing = ( !attacker.Paralyzed && !attacker.Frozen );

					if ( canSwing )
					{
						Spell sp = attacker.Spell as Spell;

						canSwing = ( sp == null || !sp.IsCasting || !sp.BlocksMovement );
					}
				}

                #region Dueling
                if (attacker is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)attacker;

                    if (pm.DuelContext != null && !pm.DuelContext.CheckItemEquip(attacker, this))
                        canSwing = false;
                }
                #endregion


				if ( canSwing && attacker.HarmfulCheck( defender ) )
				{
					attacker.DisruptiveAction();
					attacker.Send( new Swing( 0, attacker, defender ) );

					if ( OnFired( attacker, defender ) )
					{
						if ( CheckHit( attacker, defender ) )
							OnHit( attacker, defender );
						else
							OnMiss( attacker, defender );
					}
				}

				attacker.RevealingAction();

				return GetDelay( attacker );
			}
			else
			{
				attacker.RevealingAction();

				return TimeSpan.FromSeconds( 0.25 );
			}
		}
Example #29
0
 public override void OnSingleClick( Mobile from )
 {
     if ( this.Name == null )
     {
         if ( this.Quality != ClothingQuality.Exceptional && this.LootType != LootType.Blessed )
         {
             from.Send( new AsciiMessage( this.Serial, 0, MessageType.Label, 0x3B2, 3, null, "a bandana" ) );
         }
         else if ( this.Quality != ClothingQuality.Exceptional && this.LootType == LootType.Blessed )
         {
             from.Send( new AsciiMessage( this.Serial, 0, MessageType.Label, 0x3B2, 3, null, "a blessed bandana" ) );
         }
         else if ( this.Quality == ClothingQuality.Exceptional )
         {
             if ( this.LootType != LootType.Blessed )
             {
                 if ( this.Crafter == null )
                 {
                     from.Send( new AsciiMessage( this.Serial, 0, MessageType.Label, 0x3B2, 3, null, "an exceptional bandana" ) );
                 }
                 else
                 {
                     from.Send( new AsciiMessage( this.Serial, 0, MessageType.Label, 0x3B2, 3, null, "an exceptional bandana (crafted by:" + this.Crafter.Name + ")" ) );
                 }
             }
             else if ( this.LootType == LootType.Blessed )
             {
                 if ( this.Crafter == null )
                 {
                     from.Send( new AsciiMessage( this.Serial, 0, MessageType.Label, 0x3B2, 3, null, "a blessed, exceptional bandana" ) );
                 }
                 else
                 {
                     from.Send( new AsciiMessage( this.Serial, 0, MessageType.Label, 0x3B2, 3, null, "a blessed, exceptional bandana (crafted by:" + this.Crafter.Name + ")" ) );
                 }
             }
         }
         base.OnSingleClick( from );
     }
     else
     {
         LabelTo( from, this.Name );
     }
 }
Example #30
0
			protected override void OnTarget( Mobile from, object o )
			{
				if ( o is RecallRune )
				{
					m_Owner.Target( (RecallRune) o );
				}
				else
				{
					from.Send( new MessageLocalized( from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 501797, from.Name, "" ) ); // I cannot mark that object.
				}
			}
Example #31
0
        public override void OnSingleClick(Mobile from)
        {
            if (this.Name != null)
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
            }
            else
            {
                switch (m_Type)
                {
                case 1:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "One: Seek ye signs of shattered stones! Seek ye gatherings of glimmers!")); break;

                case 2:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Two: For alas and alack and lo! they fall from heavens to tempt all the sinners...")); break;

                case 3:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Three: Complete the prophecy to find the secret of the days to come")); break;

                case 4:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Four: For runes and crystals whisper rhymes to frighten everyone...")); break;

                case 11:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "One: Hast thou heard the dead shall walk?")); break;

                case 12:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Two: 'Tis prophesied here that castles fall.")); break;

                case 13:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Three: When crystals shatter and magic gathers")); break;

                case 14:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Four: And spirits make their ghastly call.")); break;

                case 21:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "One: 'Pon this eve the aether flows and dances madly in the air")); break;

                case 22:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Two: The spirits rise and walk again and slaughter in the moon's red glare")); break;

                case 23:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Three: Beware, ye men of mortal flesh, lest ghosts seize all thy lifespan's time")); break;

                case 24:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Four: For soon the night shall come and soon shall set the sun")); break;

                case 25:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Five: And soon shall rise the bones to walk and seek the magic sign...")); break;

                case 31:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "One: Where bones of land rise broken from the earth")); break;

                case 32:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Two: And where the wind whistles 'til the rock itself speaks,")); break;

                case 33:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Three: By the sea, north of sandstone, south of swamp,")); break;

                case 34:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Four: A magic sign doth rest 'pon the smallest of peaks.")); break;

                case 41:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "One: Some say a message floated in a corked and sunburnt bottle")); break;

                case 42:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Two: And washed ashore where fisherfolk found it with a smile--")); break;

                case 43:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Three: 'Til wounds did grow upon their flesh and disease did rot:")); break;

                case 44:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Four: A magic sign must live lonely lost upon a deserted isle.")); break;

                case 51:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "One: Soon the world shall split, and lives will lose their luster.")); break;

                case 52:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Two: The cadavers shall rise from their restless aching sleep!")); break;

                case 53:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Three: Soon shall monsters walk with bones broke all asunder,")); break;

                case 54:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Four: For a magic sign doth dwell in caverns dark and deep!")); break;

                case 61:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "One: Where swords were shattered and brothers fell")); break;

                case 62:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Two: In battles well divided")); break;

                case 63:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Three: Where naught can live save pride and sting")); break;

                case 64:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Four: And dry is air in hiding")); break;

                case 65:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Five: A magic sign is caught in sand and sun")); break;

                case 66:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Six: Where blood lays idle")); break;

                case 71:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "One: Upon a day when snow doth fall")); break;

                case 72:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Two: A gathering will form of noblemen")); break;

                case 73:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Three: Among them some who quarrel still")); break;

                case 74:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Four: Between free will and civil men")); break;

                case 75:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Five: Whilst watched by mice and monsters both")); break;

                case 76:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Six: A challenge shall be made")); break;

                case 77:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Seven: That breaketh lances and severs growth")); break;

                case 78:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Eight: And stains fair grass with hate")); break;

                case 79:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Nine: Someday perhaps shall reconcile, (Wis)")); break;

                case 80:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Ten: Two men whose hearts were once the same (Corp)")); break;

                case 81:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Eleven: 'Til then the world shall tremble dire (Hur)")); break;

                case 82:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "Twelve: And none shall fix the blame... (Mani)")); break;

                default:
                case 0:
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "I am broken. Page a GM.")); break;
                }
            }
        }
Example #32
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(GetWorldLocation(), 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            Point2D[] banks;
            PMList    moongates;

            if (from.Map == Map.Trammel)
            {
                banks     = m_TrammelBanks;
                moongates = PMList.Trammel;
            }
            else if (from.Map == Map.Felucca)
            {
                banks     = m_FeluccaBanks;
                moongates = PMList.Felucca;
            }
            else if (from.Map == Map.Ilshenar)
            {
#if false
                banks     = m_IlshenarBanks;
                moongates = PMList.Ilshenar;
#else
                from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x482, 3, 1061684, "", "")); // The magic of the sextant fails...
                return;
#endif
            }
            else if (from.Map == Map.Malas)
            {
                banks     = m_MalasBanks;
                moongates = PMList.Malas;
            }
            else
            {
                banks     = null;
                moongates = null;
            }

            Point3D closestMoongate  = Point3D.Zero;
            double  moongateDistance = double.MaxValue;
            if (moongates != null)
            {
                foreach (PMEntry entry in moongates.Entries)
                {
                    double dist = from.GetDistanceToSqrt(entry.Location);
                    if (moongateDistance > dist)
                    {
                        closestMoongate  = entry.Location;
                        moongateDistance = dist;
                    }
                }
            }

            Point2D closestBank  = Point2D.Zero;
            double  bankDistance = double.MaxValue;
            if (banks != null)
            {
                foreach (Point2D p in banks)
                {
                    double dist = from.GetDistanceToSqrt(p);
                    if (bankDistance > dist)
                    {
                        closestBank  = p;
                        bankDistance = dist;
                    }
                }
            }

            int moonMsg;
            if (moongateDistance == double.MaxValue)
            {
                moonMsg = 1048021; // The sextant fails to find a Moongate nearby.
            }
            else if (moongateDistance > m_LongDistance)
            {
                moonMsg = 1046449 + (int)from.GetDirectionTo(closestMoongate); // A moongate is * from here
            }
            else if (moongateDistance > m_ShortDistance)
            {
                moonMsg = 1048010 + (int)from.GetDirectionTo(closestMoongate); // There is a Moongate * of here.
            }
            else
            {
                moonMsg = 1048018; // You are next to a Moongate at the moment.
            }
            from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x482, 3, moonMsg, "", ""));

            int bankMsg;
            if (bankDistance == double.MaxValue)
            {
                bankMsg = 1048020; // The sextant fails to find a Bank nearby.
            }
            else if (bankDistance > m_LongDistance)
            {
                bankMsg = 1046462 + (int)from.GetDirectionTo(closestBank); // A town is * from here
            }
            else if (bankDistance > m_ShortDistance)
            {
                bankMsg = 1048002 + (int)from.GetDirectionTo(closestBank); // There is a city Bank * of here.
            }
            else
            {
                bankMsg = 1048019; // You are next to a Bank at the moment.
            }
            from.Send(new MessageLocalized(Serial, ItemID, MessageType.Label, 0x5AA, 3, bankMsg, "", ""));
        }
Example #33
0
        public void DisplayTo(Mobile to)
        {
            // The client must know about the spellbook or it will crash!

            if (Parent == null)
            {
                to.Send(this.WorldPacket);
            }
            else if (Parent is Item)
            {
                if (to.NetState == null)
                {
                    return;
                }

                // What will happen if the client doesn't know about our parent?
                if (to.NetState.IsPost6017)
                {
                    to.Send(new ContainerContentUpdate6017(this));
                }
                else
                {
                    to.Send(new ContainerContentUpdate(this));
                }
            }
            else if (Parent is Mobile)
            {
                // What will happen if the client doesn't know about our parent?
                to.Send(new EquipUpdate(this));
            }

            to.Send(new DisplaySpellbook(this));

            if (to.NetState == null)
            {
                return;
            }

            if (Core.AOS)
            {
                if (to.NetState.Version != null && to.NetState.Version >= Version_400a)
                {
                    to.Send(new NewSpellbookContent(this, ItemID, BookOffset + 1, m_Content));
                }
                else
                {
                    to.Send(new SpellbookContent(m_Count, BookOffset + 1, m_Content, this));
                }
            }
            else
            {
                if (to.NetState.IsPost6017)
                {
                    to.Send(new SpellbookContent6017(m_Count, BookOffset + 1, m_Content, this));
                }
                else
                {
                    to.Send(new SpellbookContent(m_Count, BookOffset + 1, m_Content, this));
                }
            }
        }
Example #34
0
        public override void OnSingleClick(Mobile from)
        {
            int number = (Amount == 1) ? 1049124 : 1049123;

            from.Send(new MessageLocalized(Serial, ItemID, MessageType.Regular, 0x3B2, 3, number, "", Amount.ToString()));
        }
Example #35
0
        public static MorphResult Morph(Mobile m, int entryID)
        {
            if (entryID < 0 || entryID >= Entries.Length)
            {
                return(MorphResult.Fail);
            }

            var entry = Entries[entryID];

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

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

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

            var ninjitsu = m.Skills.Ninjitsu.Value;

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

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

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

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

            var bodyMod = entry.BodyMod;
            var hueMod  = entry.HueMod;

            m.BodyMod = bodyMod;
            m.HueMod  = hueMod;

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

            SkillMod mod = null;

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

            SkillMod stealingMod = null;

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

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

            timer.Start();

            AddContext(m, new AnimalFormContext(timer, mod, entry.SpeedBoost, entry.Type, stealingMod));
            m.CheckStatTimers();
            return(MorphResult.Success);
        }
        public virtual void VendorBuy(Mobile from)
        {
            if (!IsActiveSeller)
            {
                return;
            }

            if (!from.CheckAlive())
            {
                return;
            }

            if (!CheckVendorAccess(from))
            {
                Say(501522);                   // I shall not treat with scum like thee!
                return;
            }

            if (DateTime.UtcNow - m_LastRestock > RestockDelay)
            {
                Restock();
            }

            int count = 0;

            List <BuyItemState> list;

            IBuyItemInfo[]  buyInfo  = this.GetBuyInfo();
            IShopSellInfo[] sellInfo = this.GetSellInfo();

            list = new List <BuyItemState>(buyInfo.Length);
            Container cont = this.BuyPack;

            List <ObjectPropertyList> opls = null;

            for (int idx = 0; idx < buyInfo.Length; idx++)
            {
                IBuyItemInfo buyItem = (IBuyItemInfo)buyInfo[idx];

                if (buyItem.Amount <= 0 || list.Count >= 250)
                {
                    continue;
                }

                GenericBuyInfo gbi  = (GenericBuyInfo)buyItem;
                IEntity        disp = gbi.GetDisplayEntity();

                list.Add(new BuyItemState(buyItem.Name, cont.Serial, disp == null ? (Serial)0x7FC0FFEE : disp.Serial, buyItem.Price, buyItem.Amount, buyItem.ItemID, buyItem.Hue));
                count++;

                if (opls == null)
                {
                    opls = new List <ObjectPropertyList>();
                }

                if (disp is Item)
                {
                    opls.Add((( Item )disp).PropertyList);
                }

                else if (disp is Mobile)
                {
                    opls.Add((( Mobile )disp).PropertyList);
                }
            }

            if (list.Count > 0)
            {
                list.Sort(new BuyItemStateComparer());

                SendPacksTo(from);

                NetState ns = from.NetState;

                if (ns == null)
                {
                    return;
                }

                if (ns.ContainerGridLines)
                {
                    from.Send(new VendorBuyContent6017(list));
                }

                else
                {
                    from.Send(new VendorBuyContent(list));
                }

                from.Send(new VendorBuyList(this, list));

                if (ns.HighSeas)
                {
                    from.Send(new DisplayBuyListHS(this));
                }

                else
                {
                    from.Send(new DisplayBuyList(this));
                }

                from.Send(new MobileStatusExtended(from));

                if (opls != null)
                {
                    for (int i = 0; i < opls.Count; ++i)
                    {
                        from.Send(opls[i]);
                    }
                }

                SayTo(from, 500186); // Greetings.  Have a look around.
            }
        }
Example #37
0
        public void Start(Arena arena, Tournament tourney)
        {
            TourneyParticipant first = Participants[0];

            DuelContext dc = new DuelContext(first.Players[0], tourney.Ruleset.Layout, false);

            dc.Ruleset.Options.SetAll(false);
            dc.Ruleset.Options.Or(tourney.Ruleset.Options);

            for (int i = 0; i < Participants.Count; ++i)
            {
                TourneyParticipant tourneyPart = Participants[i];
                Participant        duelPart    = new Participant(dc, tourneyPart.Players.Count)
                {
                    TourneyPart = tourneyPart
                };

                for (int j = 0; j < tourneyPart.Players.Count; ++j)
                {
                    duelPart.Add(tourneyPart.Players[j]);
                }

                for (int j = 0; j < duelPart.Players.Length; ++j)
                {
                    if (duelPart.Players[j] != null)
                    {
                        duelPart.Players[j].Ready = true;
                    }
                }

                dc.Participants.Add(duelPart);
            }

            if (tourney.EventController != null)
            {
                dc.m_EventGame = tourney.EventController.Construct(dc);
            }

            dc.m_Tournament = tourney;
            dc.m_Match      = this;

            dc.m_OverrideArena = arena;

            if (tourney.SuddenDeath > TimeSpan.Zero &&
                (tourney.SuddenDeathRounds == 0 || tourney.Pyramid.Levels.Count <= tourney.SuddenDeathRounds))
            {
                dc.StartSuddenDeath(tourney.SuddenDeath);
            }

            dc.SendReadyGump(0);

            if (dc.StartedBeginCountdown)
            {
                Context = dc;

                for (int i = 0; i < Participants.Count; ++i)
                {
                    TourneyParticipant p = Participants[i];

                    for (int j = 0; j < p.Players.Count; ++j)
                    {
                        Mobile mob = p.Players[j];

                        foreach (Mobile view in mob.GetMobilesInRange(18))
                        {
                            if (!mob.CanSee(view))
                            {
                                mob.Send(view.RemovePacket);
                            }
                        }

                        mob.LocalOverheadMessage(MessageType.Emote, 0x3B2, false,
                                                 "* Your mind focuses intently on the fight and all other distractions fade away *");
                    }
                }
            }
            else
            {
                dc.Unregister();
                dc.StopCountdown();
            }
        }
Example #38
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is TreasureMap)
            {
                if (m_Entries.Count < 500)
                {
                    TreasureMap tmap = (TreasureMap)dropped;
                    if (tmap.Completed)
                    {
                        from.SendMessage("This map is completed and can not be stored in this book");
                        InvalidateProperties();
                        dropped.Delete();
                        return(false);
                    }
                    if (tmap.ChestMap != null)
                    {
                        bool matched = false;

                        Point2D p2d       = tmap.ChestLocation;
                        Point3D p3d       = Point3D.Zero;
                        string  mapnumber = "B";


                        Console.WriteLine("Searching for TMap point matching {0}", p2d);


                        foreach (TMList list in TMList.UORLists)
                        {
                            foreach (TMEntry entry in list.Entries)
                            {
                                p3d       = entry.Location;
                                mapnumber = entry.Text;

                                if (p2d.X == p3d.X && p2d.Y == p3d.Y)
                                {
                                    matched = true;
                                    //Setting of Map #

                                    break;                                     // Escape from TMEntry loop.
                                }
                            }

                            if (matched)
                            {
                                break;                                 // Escape from TMList loop.
                            }
                        }

                        if (matched)
                        {
                            Console.WriteLine("Matched TMap point: {0} - {1}", p3d, mapnumber);
                        }
                        else
                        {
                            Console.WriteLine("Unable to find valid spot @ {0}", p3d);
                            mapnumber = "Unknown Spot";
                        }


                        Point3D p3D = new Point3D(0, 0, 0);
                        m_Entries.Add(new DaviesLockerEntry(1, tmap.Level, tmap.Decoder, tmap.ChestMap, tmap.ChestLocation, p3D, tmap.Bounds, mapnumber));
                        InvalidateProperties();
                        dropped.Delete();
                        from.Send(new PlaySound(0x42, GetWorldLocation()));

                        from.CloseGump(typeof(DaviesLockerGump));
                        from.SendGump(new DaviesLockerGump(from, this));

                        return(true);
                    }
                    else
                    {
                        from.SendMessage("This map is invalid");
                    }
                }
                else
                {
                    from.SendMessage("This TMap Book is full");
                }
            }

            else if (dropped is SOS)
            {
                if (m_Entries.Count < 500)
                {
                    SOS     sos = (SOS)dropped;
                    Point2D p2D = new Point2D(0, 0);
                    m_Entries.Add(new DaviesLockerEntry(2, sos.Level, null, sos.TargetMap, p2D, sos.TargetLocation, new Rectangle2D(0, 0, 0, 0), "Blank"));
                    InvalidateProperties();
                    dropped.Delete();
                    from.Send(new PlaySound(0x42, GetWorldLocation()));

                    from.CloseGump(typeof(DaviesLockerGump));
                    from.SendGump(new DaviesLockerGump(from, this));

                    return(true);
                }
                else
                {
                    from.SendMessage("This TMap Book is full");
                }
            }
            else if (dropped is MessageInABottle)
            {
                if (m_Entries.Count < 500)
                {
                    MessageInABottle bottle = (MessageInABottle)dropped;
                    Point2D          p2D    = new Point2D(0, 0);
                    Point3D          p3D    = new Point3D(0, 0, 0);
                    m_Entries.Add(new DaviesLockerEntry(3, bottle.Level, null, bottle.TargetMap, p2D, p3D, new Rectangle2D(0, 0, 0, 0), "Blank"));
                    InvalidateProperties();
                    dropped.Delete();
                    from.Send(new PlaySound(0x42, GetWorldLocation()));

                    from.CloseGump(typeof(DaviesLockerGump));
                    from.SendGump(new DaviesLockerGump(from, this));

                    return(true);
                }
                else
                {
                    from.SendMessage("This TMap Book is full");
                }
            }


            return(false);
        }
Example #39
0
        public override void OnSingleClick(Mobile from)
        {
            string durabilitylevel = GetDurabilityString();
            string accuracylevel   = GetAccuracyString();
            string damagelevel     = GetDamageString();
            string beginning;

            if ((durabilitylevel == "indestructible") || (accuracylevel == "accurate") || (accuracylevel == "eminently accurate") || (accuracylevel == "exceedingly accurate"))
            {
                beginning = "an ";
            }
            else
            {
                beginning = "a ";
            }

            if (this.Name != null)
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", this.Name));
            }
            else
            {
                if (this.Quality == WeaponQuality.Exceptional)
                {
                    if (this.Crafter != null)
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", String.Format("an exceptional cutlass (crafted by {0})", this.Crafter.Name)));
                    }
                    else
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "an exceptional cutlass"));
                    }
                }
                else if ((this.IsInIDList(from) == false) && ((this.DamageLevel != WeaponDamageLevel.Regular) || (Slayer == SlayerName.Silver) || (Effect != WeaponEffect.None) || (this.DurabilityLevel != WeaponDurabilityLevel.Regular) || (this.AccuracyLevel != WeaponAccuracyLevel.Regular)))
                {
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a magic cutlass"));
                }
                else if (IsInIDList(from) || from.AccessLevel >= AccessLevel.GameMaster)
                {
                    if ((this.DamageLevel > WeaponDamageLevel.Regular || Effect != WeaponEffect.None) && ((this.DurabilityLevel == WeaponDurabilityLevel.Regular) && (this.AccuracyLevel == WeaponAccuracyLevel.Regular)))
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a " + (Slayer == SlayerName.Silver ? "silver " : "") + "cutlass " + damagelevel));
                    }
                    else if ((this.DurabilityLevel > WeaponDurabilityLevel.Regular) && ((this.DamageLevel == WeaponDamageLevel.Regular && Effect == WeaponEffect.None) && (this.AccuracyLevel == WeaponAccuracyLevel.Regular)))
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", beginning + durabilitylevel + " cutlass"));
                    }
                    else if ((this.AccuracyLevel > WeaponAccuracyLevel.Regular) && ((this.DamageLevel == WeaponDamageLevel.Regular && Effect == WeaponEffect.None) && (this.DurabilityLevel == WeaponDurabilityLevel.Regular)))
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", beginning + accuracylevel + " cutlass"));
                    }



                    else if (((this.DamageLevel > WeaponDamageLevel.Regular || Effect != WeaponEffect.None) && (this.DurabilityLevel > WeaponDurabilityLevel.Regular)) && (this.AccuracyLevel == WeaponAccuracyLevel.Regular))
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", beginning + durabilitylevel + " cutlass " + damagelevel));
                    }
                    else if ((this.DamageLevel > WeaponDamageLevel.Regular || Effect != WeaponEffect.None) && (this.AccuracyLevel > WeaponAccuracyLevel.Regular) && (this.DurabilityLevel == WeaponDurabilityLevel.Regular))
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", beginning + accuracylevel + " cutlass " + damagelevel));
                    }
                    else if ((this.DurabilityLevel > WeaponDurabilityLevel.Regular) && (this.AccuracyLevel > WeaponAccuracyLevel.Regular) && (this.DamageLevel == WeaponDamageLevel.Regular && Effect == WeaponEffect.None))
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", beginning + durabilitylevel + ", " + accuracylevel + " cutlass"));
                    }
                    else if ((this.DurabilityLevel > WeaponDurabilityLevel.Regular) && (this.AccuracyLevel > WeaponAccuracyLevel.Regular) && (this.DamageLevel > WeaponDamageLevel.Regular || Effect != WeaponEffect.None))
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", beginning + durabilitylevel + ", " + accuracylevel + " cutlass " + damagelevel));
                    }
                    else
                    {
                        from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a " + (Slayer == SlayerName.Silver ? "silver " : "") + "cutlass"));
                    }
                }
                else
                {
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Label, 0, 3, "", "a cutlass"));
                }
            }
        }
Example #40
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is RecallRune)
                {
                    RecallRune rune = (RecallRune)o;

                    if (rune.Marked)
                    {
                        m_Owner.Effect(rune.Target, rune.TargetMap, true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(501805); // That rune is not yet marked.
                    }
                }
                else if (o is Runebook)
                {
                    RunebookEntry e = ((Runebook)o).Default;

                    if (e != null)
                    {
                        m_Owner.Effect(e.Location, e.Map, true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(502354); // Target is not marked.
                    }
                }
                else if (o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseBoat)
                {
                    BaseBoat boat = ((Key)o).Link as BaseBoat;

                    if (!boat.Deleted && boat.CheckKey(((Key)o).KeyValue))
                    {
                        m_Owner.Effect(boat.GetMarkedLocation(), boat.Map, false);
                    }
                    else
                    {
                        from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                    }
                }
                else if (o is SoulSliver)
                {
                    SoulSliver soul = (SoulSliver)o;

                    if (soul.Marked)
                    {
                        TeiravonMobile summoned = soul.Target as TeiravonMobile;

                        if (summoned.Map != Map.Internal && summoned != null)
                        {
                            m_Owner.Summon(soul);
                        }
                        else
                        {
                            from.SendMessage("The soul lies dormant and does not answer your summons.");
                        }
                    }
                    else
                    {
                        from.SendMessage("This sliver has not been attuned.");
                    }
                }
                else
                {
                    from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                }
            }
 public static void PlayerSendASCII(Mobile player, int index)
 {
     player.Send(new AsciiMessage(Serial.MinusOne, 0xFFFF, MessageType.Label, MsgParams[index][0], MsgParams[index][1], null, Msgs[index]));
 }
Example #42
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is RecallRune)
            {
                if (!CheckAccess(from))
                {
                    from.SendLocalizedMessage(502413);                       // That cannot be done while the book is locked down.
                }
                else if (IsOpen(from))
                {
                    from.SendLocalizedMessage(1005571);                       // You cannot place objects in the book while viewing the contents.
                }
                else if (m_Entries.Count < 16)
                {
                    RecallRune rune = (RecallRune)dropped;

                    if (rune.Marked && rune.TargetMap != null)
                    {
                        m_Entries.Add(new RunebookEntry(rune.Target, rune.TargetMap, rune.Description, rune.House));

                        dropped.Delete();

                        from.Send(new PlaySound(0x42, GetWorldLocation()));

                        string desc = rune.Description;

                        if (desc == null || (desc = desc.Trim()).Length == 0)
                        {
                            desc = "(indescript)";
                        }

                        from.SendMessage(desc);

                        return(true);
                    }
                    else
                    {
                        from.SendLocalizedMessage(502409);                           // This rune does not have a marked location.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502401);                       // This runebook is full.
                }
            }
            else if (dropped is RecallScroll)
            {
                if (m_CurCharges < m_MaxCharges)
                {
                    from.Send(new PlaySound(0x249, GetWorldLocation()));

                    int amount = dropped.Amount;

                    if (amount > (m_MaxCharges - m_CurCharges))
                    {
                        dropped.Consume(m_MaxCharges - m_CurCharges);
                        m_CurCharges = m_MaxCharges;
                    }
                    else
                    {
                        m_CurCharges += amount;
                        dropped.Delete();

                        return(true);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502410);                       // This book already has the maximum amount of charges.
                }
            }

            return(false);
        }
Example #43
0
        public override void OnSingleClick(Mobile from)
        {
            base.OnSingleClick(from);

            from.Send(new UnicodeMessage(Serial, ItemID, MessageType.Regular, 0x3B2, 3, "ENU", "", "(single use)"));
        }
Example #44
0
        public override void OnResponse(GameClient sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant)
            {
                return;
            }

            if (((info.ButtonID >= 6 && info.ButtonID <= 10) || info.ButtonID == 12) && !from.InRange(m_Plant.GetWorldLocation(), 3))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 500446);                   // That is too far away.
                return;
            }

            if (!m_Plant.IsUsableBy(from))
            {
                m_Plant.LabelTo(from, 1061856);                   // You must have the item in your backpack or locked down in order to use it.
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // Reproduction menu
            {
                if (m_Plant.PlantStatus > PlantStatus.BowlOfDirt)
                {
                    from.SendGump(new ReproductionGump(m_Plant));
                }
                else
                {
                    from.SendLocalizedMessage(1061885);                                       // You need to plant a seed in the bowl first.

                    from.SendGump(new MainPlantGump(m_Plant));
                }

                break;
            }

            case 2:                                        // Infestation
            {
                from.Send(new DisplayHelpTopic(54, true)); // INFESTATION LEVEL

                from.SendGump(new MainPlantGump(m_Plant));

                break;
            }

            case 3:                                        // Fungus
            {
                from.Send(new DisplayHelpTopic(56, true)); // FUNGUS LEVEL

                from.SendGump(new MainPlantGump(m_Plant));

                break;
            }

            case 4:                                        // Poison
            {
                from.Send(new DisplayHelpTopic(58, true)); // POISON LEVEL

                from.SendGump(new MainPlantGump(m_Plant));

                break;
            }

            case 5:                                        // Disease
            {
                from.Send(new DisplayHelpTopic(60, true)); // DISEASE LEVEL

                from.SendGump(new MainPlantGump(m_Plant));

                break;
            }

            case 6:                     // Water
            {
                Item[] item = from.Backpack.FindItemsByType(typeof(BaseBeverage));

                bool foundUsableWater = false;

                if (item != null && item.Length > 0)
                {
                    for (int i = 0; i < item.Length; ++i)
                    {
                        BaseBeverage beverage = (BaseBeverage)item[i];

                        if (!beverage.IsEmpty && beverage.Pourable && beverage.Content == BeverageType.Water)
                        {
                            foundUsableWater = true;
                            m_Plant.Pour(from, beverage);
                            break;
                        }
                    }
                }

                if (!foundUsableWater)
                {
                    from.Target = new PlantPourTarget(m_Plant);
                    from.SendLocalizedMessage(1060808, "#" + m_Plant.GetLocalizedPlantStatus().ToString());                                       // Target the container you wish to use to water the ~1_val~.
                }

                from.SendGump(new MainPlantGump(m_Plant));

                break;
            }

            case 7:                     // Poison potion
            {
                AddPotion(from, PotionEffect.PoisonGreater, PotionEffect.PoisonDeadly);

                break;
            }

            case 8:                     // Cure potion
            {
                AddPotion(from, PotionEffect.CureGreater);

                break;
            }

            case 9:                     // Heal potion
            {
                AddPotion(from, PotionEffect.HealGreater);

                break;
            }

            case 10:                     // Strength potion
            {
                AddPotion(from, PotionEffect.StrengthGreater);

                break;
            }

            case 11:                                       // Help
            {
                from.Send(new DisplayHelpTopic(48, true)); // PLANT GROWING

                from.SendGump(new MainPlantGump(m_Plant));

                break;
            }

            case 12:                     // Empty the bowl
            {
                from.SendGump(new EmptyTheBowlGump(m_Plant));

                break;
            }
            }
        }
Example #45
0
        public SecureTrade(Mobile from, Mobile to)
        {
            m_Valid = true;

            m_From = new SecureTradeInfo(this, from, new SecureTradeContainer(this));
            m_To   = new SecureTradeInfo(this, to, new SecureTradeContainer(this));

            var from6017 = (from.NetState != null && from.NetState.ContainerGridLines);
            var to6017   = (to.NetState != null && to.NetState.ContainerGridLines);

            var from704565 = (from.NetState != null && from.NetState.NewSecureTrading);
            var to704565   = (to.NetState != null && to.NetState.NewSecureTrading);

            from.Send(new MobileStatus(from, to));
            from.Send(new UpdateSecureTrade(m_From.Container, false, false));

            if (from6017)
            {
                from.Send(new SecureTradeEquip6017(m_To.Container, to));
            }
            else
            {
                from.Send(new SecureTradeEquip(m_To.Container, to));
            }

            from.Send(new UpdateSecureTrade(m_From.Container, false, false));

            if (from6017)
            {
                from.Send(new SecureTradeEquip6017(m_From.Container, from));
            }
            else
            {
                from.Send(new SecureTradeEquip(m_From.Container, from));
            }

            from.Send(new DisplaySecureTrade(to, m_From.Container, m_To.Container, to.Name));
            from.Send(new UpdateSecureTrade(m_From.Container, false, false));

            if (from.Account != null && from704565)
            {
                from.Send(
                    new UpdateSecureTrade(m_From.Container, TradeFlag.UpdateLedger, from.Account.TotalGold, from.Account.TotalPlat));
            }

            to.Send(new MobileStatus(to, from));
            to.Send(new UpdateSecureTrade(m_To.Container, false, false));

            if (to6017)
            {
                to.Send(new SecureTradeEquip6017(m_From.Container, from));
            }
            else
            {
                to.Send(new SecureTradeEquip(m_From.Container, from));
            }

            to.Send(new UpdateSecureTrade(m_To.Container, false, false));

            if (to6017)
            {
                to.Send(new SecureTradeEquip6017(m_To.Container, to));
            }
            else
            {
                to.Send(new SecureTradeEquip(m_To.Container, to));
            }

            to.Send(new DisplaySecureTrade(from, m_To.Container, m_From.Container, from.Name));
            to.Send(new UpdateSecureTrade(m_To.Container, false, false));

            if (to.Account != null && to704565)
            {
                to.Send(new UpdateSecureTrade(m_To.Container, TradeFlag.UpdateLedger, to.Account.TotalGold, to.Account.TotalPlat));
            }
        }
            protected override void OnTarget(Mobile src, object targ)
            {
                bool foundAnything = false;

                double  srcSkill = src.Skills[SkillName.DetectHidden].Value;
                Point3D p;

                if (targ is Mobile)
                {
                    p = ((Mobile)targ).Location;
                }
                else if (targ is Item)
                {
                    p = ((Item)targ).Location;
                }
                else if (targ is IPoint3D)
                {
                    p = new Point3D((IPoint3D)targ);
                }
                else
                {
                    p = src.Location;
                }

                double skillLevel = src.Skills.DetectHidden.Value;

                bool success = src.CheckSkill(SkillName.DetectHidden, 0.0, 100.0);
                int  range   = ((int)Math.Min(100.0, skillLevel)) / 25;

                BaseHouse house   = BaseHouse.FindHouseAt(p, src.Map, 16);
                bool      inHouse = (house != null && house.IsFriend(src));

                if (success || inHouse)
                {
                    IPooledEnumerable inRange = src.Map.GetMobilesInRange(p, inHouse ? 22 : range);
                    foreach (Mobile trg in inRange)
                    {
                        if (trg.Hidden && src != trg)
                        {
                            double ss = srcSkill + Utility.RandomMinMax(-20, 20);
                            double ts = trg.Skills[SkillName.Hiding].Value + Utility.RandomMinMax(-20, 20);
                            if (src.AccessLevel >= trg.AccessLevel && (!inHouse && ss >= ts || inHouse && house.IsInside(trg)))
                            {
                                trg.RevealingAction();
                                trg.SendLocalizedMessage(500814); // You have been revealed!
                                foundAnything = true;
                            }
                        }
                    }
                    inRange.Free();



                    inRange = src.Map.GetItemsInRange(p, range);
                    foreach (Item trg in inRange)
                    {
                        if (!(trg is TrapableContainer))
                        {
                            continue;
                        }
                        TrapableContainer cont = (TrapableContainer)trg;
                        if (cont.Visible && cont.Trapped && Utility.RandomDouble() * 100 < skillLevel)
                        {
                            int hue;
                            switch (cont.TrapType)
                            {
                            case TrapType.DartTrap:
                                hue = 123;
                                break;

                            case TrapType.ExplosionTrap:
                            case TrapType.MagicTrap:
                                hue = 0x7D;
                                break;

                            case TrapType.PoisonTrap:
                                hue = 90;
                                break;

                            default:
                                hue = 0x3B2;
                                break;
                            }
                            src.Send(new Server.Network.MessageLocalized(cont.Serial, cont.ItemID, Server.Network.MessageType.Regular, hue, 3, 500813, "", "")); // [trapped]
                            foundAnything = true;
                        }
                    }
                    inRange.Free();
                }

                if (!foundAnything)
                {
                    src.SendLocalizedMessage(500817); // You can see nothing hidden there.
                }
            }
        public virtual void VendorSell(Mobile from)
        {
            if (!IsActiveBuyer)
            {
                return;
            }

            if (!from.CheckAlive())
            {
                return;
            }

            if (!CheckVendorAccess(from))
            {
                Say(501522);                   // I shall not treat with scum like thee!

                return;
            }

            //TEST: Figure Out Budgets Concept
            if (m_Budgets.ContainsKey(from.Serial))
            {
                /*
                 *              if ( from.AccessLevel >= AccessLevel.GameMaster )
                 *              {
                 *                      SayTo( from, true, "Your current budget is {0}, which resets at {1}",
                 *                              m_Budgets[from.Serial].CurrentBudget, m_Budgets[from.Serial].ResetBudgetAt );
                 *              }
                 */

                if (DateTime.UtcNow < m_Budgets[from.Serial].ResetBudgetAt)
                {
                }

                else
                {
                    m_Budgets[from.Serial].CurrentBudget = 0;
                    m_Budgets[from.Serial].ResetBudgetAt = DateTime.UtcNow + Budget.TimeFrame;
                }
            }

            else
            {
                m_Budgets.Add(from.Serial, new Budget(0, DateTime.UtcNow + Budget.TimeFrame));
            }

            Container pack = from.Backpack;

            if (pack != null)
            {
                IShopSellInfo[] info    = GetSellInfo();
                IBuyItemInfo[]  buyinfo = GetBuyInfo();

                Hashtable table = new Hashtable();

                int numItemsNotCraftedBySeller = 0;

                foreach (IShopSellInfo ssi in info)
                {
                    Item[] items = pack.FindItemsByType(ssi.Types);

                    foreach (Item item in items)
                    {
                        if (item is Container && ((Container)item).Items.Count != 0)
                        {
                            continue;
                        }

                        if (item.IsStandardLoot() && item.Movable && ssi.IsSellable(item))
                        {
                            int price = ssi.GetSellPriceFor(item);

                            for (int idx = 0; idx < buyinfo.Length; idx++)
                            {
                                IBuyItemInfo   buyItem = (IBuyItemInfo)buyinfo[idx];
                                GenericBuyInfo gbi     = (GenericBuyInfo)buyItem;

                                if (item.GetType().IsAssignableFrom(gbi.Type) && !(item is BaseWeapon) && !(item is BaseArmor))
                                {
                                    if (price >= buyItem.Price)
                                    {
                                        price = buyItem.Price - 1;
                                    }
                                }
                            }

                            table[item] = new SellItemState(item, price, ssi.GetNameFor(item));
                        }
                    }
                }

                if (table.Count > 0)
                {
                    SendPacksTo(from);

                    from.Send(new VendorSellList(this, table));
                }

                else
                {
                    Say(true, "You have nothing I would be interested in.");
                }
            }
        }
Example #48
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                int OldHue = 0;

                if (from == targeted)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "You know yourself quite well enough already.");                       // You know yourself quite well enough already.
                }
                else if (targeted is TownCrier)
                {
                    ((TownCrier)targeted).SayTo(from, true, "This person looks fine to me, though he may have some news...");
                    //((TownCrier)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500322, from.NetState ); // This person looks fine to me, though he may have some news...
                }
                else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable)
                {
                    OldHue = ((BaseVendor)targeted).SpeechHue;
                    ((BaseVendor)targeted).SpeechHue = 0;
                    ((BaseVendor)targeted).SayTo(from, true, "That can not be inspected.");
                    //((BaseVendor)targeted).PrivateOverheadMessage( MessageType.Regular, 0x3B2, 500326, from.NetState ); // That can not be inspected.
                    ((BaseVendor)targeted).SpeechHue = OldHue;
                }
                else if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;

                    OldHue         = targ.SpeechHue;
                    targ.SpeechHue = 0;

                    int marginOfError = Math.Max(0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4));

                    int str = targ.Str + Utility.RandomMinMax(-marginOfError, +marginOfError);
                    int dex = targ.Dex + Utility.RandomMinMax(-marginOfError, +marginOfError);
                    int stm = ((targ.Stam * 100) / Math.Max(targ.StamMax, 1)) + Utility.RandomMinMax(-marginOfError, +marginOfError);

                    int strMod = str / 10;
                    int dexMod = dex / 10;
                    int stmMod = stm / 10;

                    if (strMod < 0)
                    {
                        strMod = 0;
                    }
                    else if (strMod > 10)
                    {
                        strMod = 10;
                    }

                    if (dexMod < 0)
                    {
                        dexMod = 0;
                    }
                    else if (dexMod > 10)
                    {
                        dexMod = 10;
                    }

                    if (stmMod > 10)
                    {
                        stmMod = 10;
                    }
                    else if (stmMod < 0)
                    {
                        stmMod = 0;
                    }

                    if (from.CheckTargetSkill(SkillName.Anatomy, targ, 0, 100))
                    {
                        switch (strMod)
                        {
                        case 0:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks like they have trouble lifting small objects and superhumanly agile."); break;
                            }
                            break;

                        case 1:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks rather feeble and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks rather feeble and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks rather feeble and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks rather feeble and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks rather feeble and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks rather feeble and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks rather feeble and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks rather feeble and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks rather feeble and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks rather feeble and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks rather feeble and superhumanly agile."); break;
                            }
                            break;

                        case 2:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks somewhat weak and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks somewhat weak and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks somewhat weak and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks somewhat weak and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks somewhat weak and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks somewhat weak and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks somewhat weak and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks somewhat weak and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks somewhat weak and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks somewhat weak and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks somewhat weak and superhumanly agile."); break;
                            }
                            break;

                        case 3:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks to be of normal strength and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks to be of normal strength and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks to be of normal strength and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks to be of normal strength and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks to be of normal strength and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks to be of normal strength and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks to be of normal strength and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks to be of normal strength and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks to be of normal strength and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks to be of normal strength and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks to be of normal strength and superhumanly agile."); break;
                            }
                            break;

                        case 4:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks somewhat strong and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks somewhat strong and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks somewhat strong and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks somewhat strong and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks somewhat strong and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks somewhat strong and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks somewhat strong and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks somewhat strong and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks somewhat strong and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks somewhat strong and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks somewhat strong and superhumanly agile."); break;
                            }
                            break;

                        case 5:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks very strong and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks very strong and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks very strong and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks very strong and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks very strong and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks very strong and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks very strong and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks very strong and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks very strong and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks very strong and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks very strong and superhumanly agile."); break;
                            }
                            break;

                        case 6:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks extremely strong and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks extremely strong and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks extremely strong and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks extremely strong and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks extremely strong and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks extremely strong and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks extremely strong and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks extremely strong and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks extremely strong and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks extremely strong and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks extremely strong and superhumanly agile."); break;
                            }
                            break;

                        case 7:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks extraordinarily strong and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks extraordinarily strong and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks extraordinarily strong and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks extraordinarily strong and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks extraordinarily strong and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks extraordinarily strong and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks extraordinarily strong and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks extraordinarily strong and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks extraordinarily strong and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks extraordinarily strong and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks extraordinarily strong and superhumanly agile."); break;
                            }
                            break;

                        case 8:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks strong as an ox and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks strong as an ox and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks strong as an ox and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks strong as an ox and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks strong as an ox and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks strong as an ox and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks strong as an ox and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks strong as an ox and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks strong as an ox and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks strong as an ox and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks strong as an ox and superhumanly agile."); break;
                            }
                            break;

                        case 9:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and like they barely manage to stay standing."); break;

                            case 1: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and very clumsy."); break;

                            case 2: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and somewhat uncoordinated."); break;

                            case 3: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and moderately dexterous."); break;

                            case 4: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and somewhat agile."); break;

                            case 5: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and very agile."); break;

                            case 6: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and extremely agile."); break;

                            case 7: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and extraordinarily agile."); break;

                            case 8: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and moves like quicksilver."); break;

                            case 9: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and faster than anything you have ever seen."); break;

                            case 10: targ.SayTo(from, true, "That looks stronger than anything you have ever seen and superhumanly agile."); break;
                            }
                            break;

                        case 10:
                            switch (dexMod)
                            {
                            case 0: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 1: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 2: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 3: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 4: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 5: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 6: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 7: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 8: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 9: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;

                            case 10: targ.SayTo(from, true, "That looks superhumanly strong and superhumanly agile."); break;
                            }
                            break;
                        }
                        //targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState ); // That looks [strong] and [dexterous].

                        if (from.Skills[SkillName.Anatomy].Base >= 65.0)
                        {
                            switch (stmMod)
                            {
                            case 0: targ.SayTo(from, true, "This being is at zero percent endurance."); break;

                            case 1: targ.SayTo(from, true, "This being is at ten percent endurance."); break;

                            case 2: targ.SayTo(from, true, "This being is at twenty percent endurance."); break;

                            case 3: targ.SayTo(from, true, "This being is at thirty percent endurance."); break;

                            case 4: targ.SayTo(from, true, "This being is at forty percent endurance."); break;

                            case 5: targ.SayTo(from, true, "This being is at fifty percent endurance."); break;

                            case 6: targ.SayTo(from, true, "This being is at sixty percent endurance."); break;

                            case 7: targ.SayTo(from, true, "This being is at seventy percent endurance."); break;

                            case 8: targ.SayTo(from, true, "This being is at eighty percent endurance."); break;

                            case 9: targ.SayTo(from, true, "This being is at ninety percent endurance."); break;

                            case 10: targ.SayTo(from, true, "This being is at one-hundred percent endurance."); break;
                            }
                            //targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState); // That being is at [10,20,...] percent endurance.
                            targ.SpeechHue = OldHue;
                        }
                    }
                    else
                    {
                        OldHue         = targ.SpeechHue;
                        targ.SpeechHue = 0;
                        targ.SayTo(from, true, "You can not quite get a sense of their physical characteristics.");
                        targ.SpeechHue = OldHue;
                        //targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1042666, from.NetState ); // You can not quite get a sense of their physical characteristics.
                    }
                }
                else if (targeted is Item)
                {
                    from.Send(new AsciiMessage(((Item)targeted).Serial, ((Item)targeted).ItemID, MessageType.Regular, 0, 3, "", "Only living things have anatomies!"));
                    //((Item)targeted).SendLocalizedMessageTo( from, 500323, "" ); // Only living things have anatomies!
                }
            }
Example #49
0
 public void OnRequestedAnimation(Mobile from)
 {
     from.Send(new UpdateStatueAnimation(this, 1, this.m_Animation, this.m_Frames));
 }
Example #50
0
        public virtual void VendorBuy(Mobile from)
        {
            if (!IsActiveSeller)
            {
                return;
            }

            if (!from.CheckAlive())
            {
                return;
            }

            if (!CheckVendorAccess(from))
            {
                Say(501522);                   // I shall not treat with scum like thee!
                return;
            }

            if (DateTime.Now - m_LastRestock > RestockDelay)
            {
                Restock();
            }

            UpdateBuyInfo();

            int       count = 0;
            ArrayList list;

            IBuyItemInfo[]  buyInfo  = this.GetBuyInfo();
            IShopSellInfo[] sellInfo = this.GetSellInfo();

            list = new ArrayList(buyInfo.Length);
            Container cont = this.BuyPack;

            ArrayList opls = new ArrayList();

            for (int idx = 0; idx < buyInfo.Length; idx++)
            {
                IBuyItemInfo buyItem = (IBuyItemInfo)buyInfo[idx];

                if (buyItem.Amount <= 0 || list.Count >= 250)
                {
                    continue;
                }

                // NOTE: Only GBI supported; if you use another implementation of IBuyItemInfo, this will crash
                GenericBuyInfo gbi  = (GenericBuyInfo)buyItem;
                IEntity        disp = gbi.GetDisplayObject() as IEntity;

                list.Add(new BuyItemState(buyItem.Name, cont.Serial, disp == null ? (Serial)0x7FC0FFEE : disp.Serial, buyItem.Price, buyItem.Amount, buyItem.ItemID, buyItem.Hue));
                count++;

                if (disp is Item)
                {
                    opls.Add((disp as Item).PropertyList);
                }
                else if (disp is Mobile)
                {
                    opls.Add((disp as Mobile).PropertyList);
                }
            }

            List <Item> playerItems = cont.Items;

            for (int i = playerItems.Count - 1; i >= 0; --i)
            {
                if (i >= playerItems.Count)
                {
                    continue;
                }

                Item item = playerItems[i];

                if ((item.LastMoved + InventoryDecayTime) <= DateTime.Now)
                {
                    item.Delete();
                }
            }

            for (int i = 0; i < playerItems.Count; ++i)
            {
                Item item = playerItems[i];

                int    price = 0;
                string name  = null;

                foreach (IShopSellInfo ssi in sellInfo)
                {
                    if (ssi.IsSellable(item))
                    {
                        price = ssi.GetBuyPriceFor(item);
                        name  = ssi.GetNameFor(item);
                        break;
                    }
                }

                if (name != null && list.Count < 250)
                {
                    list.Add(new BuyItemState(name, cont.Serial, item.Serial, price, item.Amount, item.ItemID, item.Hue));
                    count++;

                    opls.Add(item.PropertyList);
                }
            }

            //one (not all) of the packets uses a byte to describe number of items in the list.  Osi = dumb.
            //if ( list.Count > 255 )
            //	Console.WriteLine( "Vendor Warning: Vendor {0} has more than 255 buy items, may cause client errors!", this );

            if (list.Count > 0)
            {
                list.Sort(new BuyItemStateComparer());

                SendPacksTo(from);

                from.Send(new VendorBuyContent(list));
                from.Send(new VendorBuyList(this, list));
                from.Send(new DisplayBuyList(this));
                from.Send(new MobileStatusExtended(from));                    //make sure their gold amount is sent

                for (int i = 0; i < opls.Count; ++i)
                {
                    from.Send(opls[i] as Packet);
                }

                SayTo(from, 500186);                   // Greetings.  Have a look around.
            }
        }
Example #51
0
 public override void RemoveEffect(Mobile m)
 {
     m.Send(SpeedControl.Disable);
 }
Example #52
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant)
            {
                return;
            }

            if (info.ButtonID == 3 && !from.InRange(m_Plant.GetWorldLocation(), 3))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 500446); // That is too far away.
                return;
            }

            if (!m_Plant.IsUsableBy(from))
            {
                m_Plant.LabelTo(from, 1061856); // You must have the item in your backpack or locked down in order to use it.
                return;
            }

            switch (info.ButtonID)
            {
            case 1:     // Cancel
            {
                from.SendGump(new MainPlantGump(m_Plant));

                break;
            }

            case 2:                                        // Help
            {
                from.Send(new DisplayHelpTopic(71, true)); // EMPTYING THE BOWL

                from.SendGump(new EmptyTheBowlGump(m_Plant));

                break;
            }

            case 3:     // Ok
            {
                PlantBowl bowl = new PlantBowl();

                if (!from.PlaceInBackpack(bowl))
                {
                    bowl.Delete();

                    m_Plant.LabelTo(from, 1053047);         // You cannot empty a bowl with a full pack!
                    from.SendGump(new MainPlantGump(m_Plant));

                    break;
                }

                if (m_Plant.PlantStatus != PlantStatus.BowlOfDirt && m_Plant.PlantStatus < PlantStatus.Plant)
                {
                    Seed seed = new Seed(m_Plant.PlantType, m_Plant.PlantHue, m_Plant.ShowType);

                    if (!from.PlaceInBackpack(seed))
                    {
                        bowl.Delete();
                        seed.Delete();

                        m_Plant.LabelTo(from, 1053047);         // You cannot empty a bowl with a full pack!
                        from.SendGump(new MainPlantGump(m_Plant));

                        break;
                    }
                }

                m_Plant.Delete();

                break;
            }
            }
        }
Example #53
0
        public void Fire(Mobile from)
        {
            BaseRanged bow = from.Weapon as BaseRanged;

            if (bow == null)
            {
                from.Send(new AsciiMessage(Serial, ItemID, MessageType.Regular, 0, 3, "", "You must practice with ranged weapons on this."));
                //from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "You must practice with ranged weapons on this.");
                //SendLocalizedMessageTo( from, 500593 ); // You must practice with ranged weapons on this.
                return;
            }

            if (DateTime.Now < (m_LastUse + UseDelay))
            {
                return;
            }

            Point3D worldLoc = GetWorldLocation();

            if (FacingEast ? from.X <= worldLoc.X : from.Y <= worldLoc.Y)
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "You would do better to stand in front of the archery butte.");                   // You would do better to stand in front of the archery butte.
                return;
            }

            if (FacingEast ? from.Y != worldLoc.Y : from.X != worldLoc.X)
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "You aren't properly lined up with the archery butte to get an accurate shot.");                   // You aren't properly lined up with the archery butte to get an accurate shot.
                return;
            }

            if (!from.InRange(worldLoc, 6))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "You are too far away from the archery butte to get an accurate shot.");                   // You are too far away from the archery butte to get an accurate shot.
                return;
            }
            else if (from.InRange(worldLoc, 4))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "You are too close to the target.");                   // You are too close to the target.
                return;
            }

            Container pack     = from.Backpack;
            Type      ammoType = bow.AmmoType;

            bool isArrow = (ammoType == typeof(Arrow));
            bool isBolt  = (ammoType == typeof(Bolt));
            bool isKnown = (isArrow || isBolt);

            if (pack == null || !pack.ConsumeTotal(ammoType, 1))
            {
                if (isArrow)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "You do not have any arrows with which to practice.");                       // You do not have any arrows with which to practice.
                }
                else if (isBolt)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, true, "You do not have any crossbow bolts with which to practice.");                       // You do not have any crossbow bolts with which to practice.
                }
                else
                {
                    from.Send(new AsciiMessage(Serial, ItemID, MessageType.Regular, 0, 3, "", "You must practice with ranged weapons on this."));
                }
                //SendLocalizedMessageTo( from, 500593 ); // You must practice with ranged weapons on this.

                return;
            }

            m_LastUse = DateTime.Now;

            from.Direction = from.GetDirectionTo(GetWorldLocation());
            bow.PlaySwingAnimation(from);
            from.MovingEffect(this, bow.EffectID, 18, 1, false, false);

            ScoreEntry se = GetEntryFor(from);

            if (!from.CheckSkill(bow.Skill, m_MinSkill, m_MaxSkill))
            {
                from.PlaySound(bow.MissSound);

                PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} misses the target altogether.", from.Name));
                //PublicOverheadMessage( MessageType.Regular, 0x3B2, 500604, from.Name ); // You miss the target altogether.

                se.Record(0);

                if (se.Count == 1)
                {
                    PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("Score: {0} after the first shot.", se.Total.ToString()));
                }
                else
                {
                    PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("Score: {0} after {1} shots.", se.Total, se.Count));                     //1042683, String.Format( "{0}\t{1}", se.Total, se.Count ) );
                }
                if (0.4 >= Utility.RandomDouble())
                {
                    if (isArrow)
                    {
                        Item Ammo = new Arrow();
                        Ammo.MoveToWorld(new Point3D(this.X + Utility.RandomMinMax(-1, 1), this.Y + Utility.RandomMinMax(-1, 1), this.Z), this.Map);
                    }
                    else if (isBolt)
                    {
                        Item Ammo = new Bolt();
                        Ammo.MoveToWorld(new Point3D(this.X + Utility.RandomMinMax(-1, 1), this.Y + Utility.RandomMinMax(-1, 1), this.Z), this.Map);
                    }
                }
                return;
            }

            Effects.PlaySound(Location, Map, /*0x2B1*/ 564);

            double rand = Utility.RandomDouble();

            int area, score, splitScore;

            if (0.10 > rand)
            {
                area       = 0;           // bullseye
                score      = 50;
                splitScore = 100;
            }
            else if (0.25 > rand)
            {
                area       = 1;           // inner ring
                score      = 10;
                splitScore = 20;
            }
            else if (0.50 > rand)
            {
                area       = 2;           // middle ring
                score      = 5;
                splitScore = 15;
            }
            else
            {
                area       = 3;           // outer ring
                score      = 2;
                splitScore = 5;
            }

            bool split = (isKnown && ((m_Arrows + m_Bolts) * 0.02) > Utility.RandomDouble());

            if (split)
            {
                if (isArrow)
                {
                    switch (area)
                    {
                    case 0: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} robinhoods another arrow in the bullseye!", from.Name)); break;

                    case 1: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} robinhoods another arrow in the inner ring!", from.Name)); break;

                    case 2: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} robinhoods another arrow in the middle ring.", from.Name)); break;

                    case 3: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} robinhoods another arrow in the outer ring.", from.Name)); break;
                    }
                }
                else
                {
                    switch (area)
                    {
                    case 0: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} robinhoods another bolt in the bullseye!", from.Name)); break;

                    case 1: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} robinhoods another bolt in the inner ring!", from.Name)); break;

                    case 2: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} robinhoods another bolt in the middle ring.", from.Name)); break;

                    case 3: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} robinhoods another bolt in the outer ring.", from.Name)); break;
                    }
                }
                //PublicOverheadMessage( MessageType.Regular, 0x3B2, 1010027 + (isArrow ? 0 : 4) + area, from.Name );
            }
            else
            {
                switch (area)
                {
                case 0: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} hits the bullseye!", from.Name)); break;

                case 1: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} hits the inner ring!", from.Name)); break;

                case 2: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} hits the middle ring.", from.Name)); break;

                case 3: PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("{0} hits the outer ring.", from.Name)); break;
                }
                //PublicOverheadMessage( MessageType.Regular, 0x3B2, 1010035 + area, from.Name );

                if (isArrow)
                {
                    ++m_Arrows;
                }
                else if (isBolt)
                {
                    ++m_Bolts;
                }
            }

            se.Record(split ? splitScore : score);

            /*if ( se.Count == 1 )
             *      PublicOverheadMessage( MessageType.Regular, 0x3B2, 1062719, se.Total.ToString() );
             * else
             *      PublicOverheadMessage( MessageType.Regular, 0x3B2, 1042683, String.Format( "{0}\t{1}", se.Total, se.Count ) );*/
            if (se.Count == 1)
            {
                PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("Score: {0} after the first shot.", se.Total.ToString()));
            }
            else
            {
                PublicOverheadMessage(MessageType.Regular, 0x3B2, true, String.Format("Score: {0} after {1} shots.", se.Total, se.Count));//1042683, String.Format( "{0}\t{1}", se.Total, se.Count ) );
            }
        }
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID == 0 || m_Plant.Deleted || m_Plant.PlantStatus >= PlantStatus.DecorativePlant || m_Plant.PlantStatus == PlantStatus.BowlOfDirt || !from.InRange(m_Plant.GetWorldLocation(), 3))
            {
                return;
            }

            if (!m_Plant.IsUsableBy(from))
            {
                m_Plant.LabelTo(from, 1061856);                   // You must have the item in your backpack or locked down in order to use it.
                return;
            }

            switch (info.ButtonID)
            {
            case 1:                     // Main menu
            {
                from.SendGump(new MainPlantGump(m_Plant));

                break;
            }

            case 2:                     // Set to decorative
            {
                if (m_Plant.PlantStatus == PlantStatus.Stage9)
                {
                    from.SendGump(new SetToDecorativeGump(m_Plant));
                }

                break;
            }

            case 3:                                        // Pollination
            {
                from.Send(new DisplayHelpTopic(67, true)); // POLLINATION STATE

                from.SendGump(new ReproductionGump(m_Plant));

                break;
            }

            case 4:                                        // Resources
            {
                from.Send(new DisplayHelpTopic(69, true)); // RESOURCE PRODUCTION

                from.SendGump(new ReproductionGump(m_Plant));

                break;
            }

            case 5:                                        // Seeds
            {
                from.Send(new DisplayHelpTopic(68, true)); // SEED PRODUCTION

                from.SendGump(new ReproductionGump(m_Plant));

                break;
            }

            case 6:                     // Gather pollen
            {
                if (!m_Plant.IsCrossable)
                {
                    m_Plant.LabelTo(from, 1053050);                               // You cannot gather pollen from a mutated plant!
                }
                else if (!m_Plant.PlantSystem.PollenProducing)
                {
                    m_Plant.LabelTo(from, 1053051);                               // You cannot gather pollen from a plant in this stage of development!
                }
                else if (m_Plant.PlantSystem.Health < PlantHealth.Healthy)
                {
                    m_Plant.LabelTo(from, 1053052);                               // You cannot gather pollen from an unhealthy plant!
                }
                else
                {
                    from.Target = new PollinateTarget(m_Plant);
                    from.SendLocalizedMessage(1053054);                               // Target the plant you wish to cross-pollinate to.

                    break;
                }

                from.SendGump(new ReproductionGump(m_Plant));

                break;
            }

            case 7:                     // Gather resources
            {
                PlantResourceInfo resInfo = PlantResourceInfo.GetInfo(m_Plant.PlantType, m_Plant.PlantHue);
                PlantSystem       system  = m_Plant.PlantSystem;

                if (resInfo == null)
                {
                    if (m_Plant.IsCrossable)
                    {
                        m_Plant.LabelTo(from, 1053056);                                   // This plant has no resources to gather!
                    }
                    else
                    {
                        m_Plant.LabelTo(from, 1053055);                                   // Mutated plants do not produce resources!
                    }
                }
                else if (system.AvailableResources == 0)
                {
                    m_Plant.LabelTo(from, 1053056);                               // This plant has no resources to gather!
                }
                else
                {
                    Item resource = resInfo.CreateResource();

                    if (from.PlaceInBackpack(resource))
                    {
                        system.AvailableResources--;
                        m_Plant.LabelTo(from, 1053059);                                   // You gather resources from the plant.
                    }
                    else
                    {
                        resource.Delete();
                        m_Plant.LabelTo(from, 1053058);                                   // You attempt to gather as many resources as you can hold, but your backpack is full.
                    }
                }

                from.SendGump(new ReproductionGump(m_Plant));

                break;
            }

            case 8:                     // Gather seeds
            {
                PlantSystem system = m_Plant.PlantSystem;

                if (!m_Plant.IsCrossable)
                {
                    m_Plant.LabelTo(from, 1053060);                               // Mutated plants do not produce seeds!
                }
                else if (system.AvailableSeeds == 0)
                {
                    m_Plant.LabelTo(from, 1053061);                               // This plant has no seeds to gather!
                }
                else
                {
                    Seed seed = new Seed(system.SeedType, system.SeedHue, true);

                    if (from.PlaceInBackpack(seed))
                    {
                        system.AvailableSeeds--;
                        m_Plant.LabelTo(from, 1053063);                                   // You gather seeds from the plant.
                    }
                    else
                    {
                        seed.Delete();
                        m_Plant.LabelTo(from, 1053062);                                   // You attempt to gather as many seeds as you can hold, but your backpack is full.
                    }
                }

                from.SendGump(new ReproductionGump(m_Plant));

                break;
            }
            }
        }
Example #55
0
 public static void SendCommandTo(Mobile to, ChatCommand type, string param1 = null, string param2 = null)
 {
     to?.Send(new ChatMessagePacket(null, (int)type + 20, param1, param2));
 }
Example #56
0
 public virtual void SayPriceTo(Mobile m)
 {
     m.Send(new MessageLocalizedAffix(this.Serial, this.Body, MessageType.Regular, this.SpeechHue, 3, 1008052, this.Name, AffixType.Append, this.JoinCost.ToString(), ""));
 }
Example #57
0
            protected override void OnTarget(Mobile from, object o)
            {
                if (o is RecallRune)
                {
                    RecallRune rune = (RecallRune)o;

                    if (rune.Marked)
                    {
                        if (rune.Type == RecallRuneType.Ship)
                        {
                            m_Owner.Effect(rune.Galleon);
                        }
                        else
                        {
                            m_Owner.Effect(rune.Target, rune.TargetMap, true);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(501805); // That rune is not yet marked.
                    }
                }
                else if (o is Runebook)
                {
                    RunebookEntry e = ((Runebook)o).Default;

                    if (e != null)
                    {
                        if (e.Type == RecallRuneType.Ship)
                        {
                            m_Owner.Effect(e.Galleon);
                        }
                        else
                        {
                            m_Owner.Effect(e.Location, e.Map, true);
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(502354); // Target is not marked.
                    }
                }
                else if (o is Key && ((Key)o).KeyValue != 0 && ((Key)o).Link is BaseBoat)
                {
                    BaseBoat boat = ((Key)o).Link as BaseBoat;

                    if (!boat.Deleted && boat.CheckKey(((Key)o).KeyValue))
                    {
                        m_Owner.Effect(boat.GetMarkedLocation(), boat.Map, false, true);
                    }
                    else
                    {
                        from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                    }
                }
                else if (o is Engines.NewMagincia.WritOfLease)
                {
                    Engines.NewMagincia.WritOfLease lease = (Engines.NewMagincia.WritOfLease)o;

                    if (lease.RecallLoc != Point3D.Zero && lease.Facet != null && lease.Facet != Map.Internal)
                    {
                        m_Owner.Effect(lease.RecallLoc, lease.Facet, false);
                    }
                    else
                    {
                        from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                    }
                }

                else
                {
                    from.Send(new MessageLocalized(from.Serial, from.Body, MessageType.Regular, 0x3B2, 3, 502357, from.Name, "")); // I can not recall from that object.
                }
            }
Example #58
0
        public static MorphResult Morph(Mobile m, int entryID)
        {
            if (entryID < 0 || entryID >= m_Entries.Length)
            {
                return(MorphResult.Fail);
            }

            AnimalFormEntry entry = m_Entries[entryID];

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

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

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

            double ninjitsu = m.Skills.Ninjitsu.Value;

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

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

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

            BaseMount.Dismount(m);

            m.BodyMod = entry.BodyMod;

            if (entry.HueMod > 0)
            {
                m.HueMod = entry.HueMod;
            }

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

            SkillMod mod = null;

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

            #region Heritage Items
            else if (entry.StealingBonus)
            {
                mod         = new DefaultSkillMod(SkillName.Stealing, true, 10.0);
                mod.ObeyCap = true;
                m.AddSkillMod(mod);
            }

            m.Target = null;
            #endregion

            Timer timer = new AnimalFormTimer(m, entry.BodyMod, entry.HueMod);
            timer.Start();

            AddContext(m, new AnimalFormContext(timer, mod, entry.SpeedBoost, entry.Type, entry.StealingBonus));
            m.CheckStatTimers();
            return(MorphResult.Success);
        }
Example #59
0
 public override void OnSingleClick(Mobile from)
 {
     from.Send(new MessageLocalizedAffix(Serial, ItemID, MessageType.Label, 0x3B2, 3, 1041361, "", AffixType.Append, String.Concat(" ", m_Worth.ToString()), ""));                   // A bank check:
 }
Example #60
0
        public override void DoEffect(Mobile m)
        {
            m.PlaySound(0x1BA);

            m.Send(SpeedControl.WalkSpeed);
        }