public override void OnResponse( NetState sender, RelayInfo info )
{
if ( info.ButtonID == 0 )
{
if ( m_Used )
m_From.SendLocalizedMessage( 501706 ); // Disguises wear off after 2 hours.
else
m_From.SendLocalizedMessage( 501707 ); // You're looking good.
return;
}
int[] switches = info.Switches;
if ( switches.Length == 0 )
return;
int switched = switches[0];
int type = switched % 2;
int index = switched / 2;
bool hair = ( type == 0 );
DisguiseEntry[] entries = ( hair ? m_HairEntries : m_BeardEntries );
if ( index >= 0 && index < entries.Length )
{
DisguiseEntry entry = entries[index];
if ( entry == null )
return;
if ( !m_Kit.ValidateUse( m_From ) )
return;
if ( !hair && (m_From.Female || m_From.Body.IsFemale) )
return;
m_From.NameMod = NameList.RandomName( m_From.Female ? "female" : "male" );
if ( m_From is PlayerMobile )
{
PlayerMobile pm = (PlayerMobile)m_From;
if ( hair )
pm.SetHairMods( entry.m_ItemID, -2 );
else
pm.SetHairMods( -2, entry.m_ItemID );
}
m_From.SendGump( new DisguiseGump( m_From, m_Kit, hair, true ) );
DisguiseTimers.RemoveTimer( m_From );
DisguiseTimers.CreateTimer( m_From, TimeSpan.FromHours( 2.0 ) );
DisguiseTimers.StartTimer( m_From );
}
}