protected override void OnTarget( Mobile from, object targeted )
{
from.RevealingAction();
int number = -1;
if ( targeted is Mobile )
{
Mobile targ = (Mobile)targeted;
if ( targ.Player ) // We can't beg from players
{
number = 500398; // Perhaps just asking would work better.
}
else if ( !targ.Body.IsHuman ) // Make sure the NPC is human
{
number = 500399; // There is little chance of getting money from that!
}
else if ( !from.InRange( targ, 2 ) )
{
if ( !targ.Female )
number = 500401; // You are too far away to beg from him.
else
number = 500402; // You are too far away to beg from her.
}
else if ( from.Mounted ) // If we're on a mount, who would give us money?
{
number = 500404; // They seem unwilling to give you any money.
}
else
{
// Face eachother
from.Direction = from.GetDirectionTo( targ );
targ.Direction = targ.GetDirectionTo( from );
from.Animate( 32, 5, 1, true, false, 0 ); // Bow
new InternalTimer( from, targ ).Start();
m_SetSkillTime = false;
}
}
else // Not a Mobile
{
number = 500399; // There is little chance of getting money from that!
}
if ( number != -1 )
from.SendLocalizedMessage( number );
}