public override void OnResponse( NetState sender, RelayInfo info )
{
int index = info.ButtonID - 1;
if ( index >= 0 && index < m_SellList.Length )
{
HairstylistBuyInfo buyInfo = m_SellList[index];
int balance = Banker.GetBalance( m_From );
bool isFemale = ( m_From.Female || m_From.Body.IsFemale );
if ( buyInfo.FacialHair && isFemale )
{
// You cannot place facial hair on a woman!
m_Vendor.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1010639, m_From.NetState );
}
else if ( balance >= buyInfo.Price )
{
try
{
object[] origArgs = buyInfo.GumpArgs;
object[] args = new object[origArgs.Length];
for ( int i = 0; i < args.Length; ++i )
{
if ( origArgs[i] == CustomHairstylist.Price )
args[i] = m_SellList[index].Price;
else if ( origArgs[i] == CustomHairstylist.From )
args[i] = m_From;
else if ( origArgs[i] == CustomHairstylist.Vendor )
args[i] = m_Vendor;
else
args[i] = origArgs[i];
}
Gump g = Activator.CreateInstance( buyInfo.GumpType, args ) as Gump;
m_From.SendGump( g );
}
catch
{
}
}
else
{
// You cannot afford my services for that style.
m_Vendor.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1042293, m_From.NetState );
}
}
}