コード例 #1
0
ファイル: BeeHiveGumps.cs プロジェクト: zerodowned/UO-Forever
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            if (info.ButtonID == 0 || m_hive.Deleted || !from.InRange(m_hive.GetWorldLocation(), 3))
            {
                return;
            }

            if (!m_hive.IsAccessibleTo(from))
            {
                m_hive.LabelTo(from, "You cannot use that.");
                return;
            }

            switch (info.ButtonID)
            {
            case (int)Buttons.butCancel:                     //cancel
            {
                from.SendGump(new BeehiveMainGump(from, m_hive));
                break;
            }

            case (int)Buttons.butOkay:                     //okay
            {
                BeehiveDeed deed = new BeehiveDeed();

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

                    m_hive.LabelTo(from, "You cannot destroy the hive with a full backpack!");
                    from.SendGump(new BeehiveMainGump(from, m_hive));

                    break;
                }

                m_hive.Delete();

                break;
            }
            }
        }
コード例 #2
0
		public override void OnResponse( NetState sender, RelayInfo info )
		{
			Mobile from = sender.Mobile;

			if ( info.ButtonID == 0 || m_hive.Deleted || !from.InRange( m_hive.GetWorldLocation(), 3 ) )
				return;

			if( !m_hive.IsAccessibleTo( from ) )
			{
				m_hive.LabelTo( from, "You cannot use that." );
				return;
			}

			switch ( info.ButtonID )
			{
				case (int)Buttons.butCancel: //cancel
				{
					from.SendGump( new BeehiveMainGump( from, m_hive ) );
					break;
				}
				case (int)Buttons.butOkay: //okay
				{
					BeehiveDeed deed = new BeehiveDeed();

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

						m_hive.LabelTo( from, "You cannot destroy the hive with a full backpack!" );
						from.SendGump( new BeehiveMainGump( from, m_hive ) );

						break;
					}

					m_hive.Delete();

					break;
				}
			}
		}