Exemplo n.º 1
0
        public static void AddHair( Mobile m, int itemID, int hue )
        {
            Item item;

            switch ( itemID & 0x3FFF )
            {
                case 0x2044: item = new Mohawk( hue ); break;
                case 0x2045: item = new PageboyHair( hue ); break;
                case 0x2046: item = new BunsHair( hue ); break;
                case 0x2047: item = new Afro( hue ); break;
                case 0x2048: item = new ReceedingHair( hue ); break;
                case 0x2049: item = new TwoPigTails( hue ); break;
                case 0x204A: item = new KrisnaHair( hue ); break;
                case 0x203B: item = new ShortHair( hue ); break;
                case 0x203C: item = new LongHair( hue ); break;
                case 0x203D: item = new PonyTail( hue ); break;
                default: return;
            }

            m.AddItem( item );
        }
			public override void OnResponse( NetState sender, RelayInfo info )
			{
                if (m_Deed.Deleted || m_From.Backpack == null || !m_Deed.IsChildOf(m_From.Backpack))
                    return;

				Item newHair = null;

				switch ( info.ButtonID )
				{
					case 0: return;

                    case 1: newHair = new LongFeatherHair(); break;
                    case 2: newHair = new ShortElfHair(); break;
                    case 3: newHair = new Mullet(); break;
                    case 4:
                        if (!m_From.Female) return;
                        newHair = new FlowerHair();
                        break;
                    case 5:
						if (m_From.Female) return;
						newHair = new FlowerHair();
						newHair = new LongElfTwoHair(); break;
                    case 6: newHair = new LongElfHair(); break;
                    case 7: newHair = new LongBigKnobHair(); break;
                    case 8: newHair = new LongBigBraidHair(); break;
                    case 9: newHair = new SpikedHair(); break;
                    case 10: newHair = new BunsHair(); break;
                }

				if ( m_From is PlayerMobile )
				{
					PlayerMobile pm = (PlayerMobile)m_From;

					pm.SetHairMods( -1, -1 ); // clear any hairmods (disguise kit, incognito)
				}

				Item oldHair = m_From.FindItemOnLayer( Layer.Hair );

				if ( oldHair != null )
					oldHair.Delete();

				if ( newHair != null )
				{
					if ( oldHair != null )
						newHair.Hue = oldHair.Hue;

					m_From.AddItem( newHair );
				}

				m_Deed.Delete();
			}