public override void OnDoubleClick( Mobile from )
		{
			PlayerMobile pm = from as PlayerMobile;

			if ( pm == null || pm.Backpack == null )
				return;

			if ( pm.InRange( GetWorldLocation(), 2 ) )
			{
				MLQuestContext context = MLQuestSystem.GetContext( pm );

				if ( context != null && context.IsDoingQuest( typeof( UnfadingMemoriesPartOne ) ) && pm.Backpack.FindItemByType( typeof( PrismaticAmber ), false ) == null )
				{
					Item amber = new PrismaticAmber();

					if ( pm.PlaceInBackpack( amber ) )
					{
						MLQuestSystem.MarkQuestItem( pm, amber );
						Delete();
					}
					else
					{
						pm.SendLocalizedMessage( 502385 ); // Your pack cannot hold this item.
						amber.Delete();
					}
				}
				else
					pm.SendLocalizedMessage( 1075464 ); // You already have as many of those as you need.
			}
			else
				pm.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
		}
Exemple #2
0
        public override int LabelNumber => 1074269; // prismatic crystal

        public override void OnDoubleClick(Mobile from)
        {
            if (!(from is PlayerMobile pm) || pm.Backpack == null)
            {
                return;
            }

            if (pm.InRange(GetWorldLocation(), 2))
            {
                if (MLQuestSystem.GetContext(pm)?.IsDoingQuest(typeof(UnfadingMemoriesPartOne)) == true &&
                    pm.Backpack.FindItemByType <PrismaticAmber>(false) == null)
                {
                    Item amber = new PrismaticAmber();

                    if (pm.PlaceInBackpack(amber))
                    {
                        MLQuestSystem.MarkQuestItem(pm, amber);
                        Delete();
                    }
                    else
                    {
                        pm.SendLocalizedMessage(502385); // Your pack cannot hold this item.
                        amber.Delete();
                    }
                }
                else
                {
                    pm.SendLocalizedMessage(1075464); // You already have as many of those as you need.
                }
            }
            else
            {
                pm.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            }
        }