示例#1
0
        public override void OnDoubleClick( Mobile from )
        {
            if ( m_IsRewardItem && !RewardSystem.CheckIsUsableBy( from, this, null ) )
                return;

            if ( IsChildOf( from.Backpack ) )
            {
                RewardPottedCactus cactus = new RewardPottedCactus();
                cactus.IsRewardItem = m_IsRewardItem;

                if ( !from.PlaceInBackpack( cactus ) )
                {
                    cactus.Delete();
                    from.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
                }
                else
                    Delete();
            }
            else
                from.SendLocalizedMessage( 1062334 ); // This item must be in your backpack to be used.
        }
示例#2
0
			public override void OnResponse( NetState sender, RelayInfo info )
			{
				if ( m_Cactus == null | m_Cactus.Deleted )
					return;		
				
				Mobile m = sender.Mobile;	
			
				if ( info.ButtonID >= 0x1E0F && info.ButtonID <= 0x1E14 )
				{
					RewardPottedCactus cactus = new RewardPottedCactus( info.ButtonID );
					cactus.IsRewardItem = m_Cactus.IsRewardItem;

					if ( !m.PlaceInBackpack( cactus ) )
					{
						cactus.Delete();
						m.SendLocalizedMessage( 1078837 ); // Your backpack is full! Please make room and try again.
					}
					else
						m_Cactus.Delete();
				}
			}