#ifdef ENABLE_CHEQUE_SYSTEM
void CHARACTER::GiveCheque(int iAmount)
{
if (iAmount <= 0)
return;
//sys_log(0, "GIVE_GOLD: %s %lld", GetName(), iAmount);
if (GetParty())
{
LPPARTY pParty = GetParty();
// ??? ?? ?? ??? ???.
DWORD dwTotal = iAmount;
DWORD dwMyAmount = dwTotal;
NPartyPickupDistribute::FCountNearMember funcCountNearMember(this);
pParty->ForEachOnlineMember(funcCountNearMember);
if (funcCountNearMember.total > 1)
{
DWORD dwShare = dwTotal / funcCountNearMember.total;
dwMyAmount -= dwShare * (funcCountNearMember.total - 1);
NPartyPickupDistribute::FChequeDistributor funcChequeDist(this, dwShare);
pParty->ForEachOnlineMember(funcChequeDist);
}
PointChange(POINT_CHEQUE, dwMyAmount, true);
if (dwMyAmount > 1000) // ?? ??? ????.
LogManager::instance().CharLog(this, dwMyAmount, "GET_CHEQUE", "");
}
else
{
PointChange(POINT_CHEQUE, iAmount, true);
// ???? ?? ????? ??? ???,
// ??? ???? ?? ???,
// ????, ?? ?? 1000? ??? ?? ?? ?? ??? 0?? ???,
// ?? ????? ?? ???? ?? ?? ??.
// ??? ?? ??? ?? ?? ?? ??? ??? ???? ??? ??.
if (LC_IsBrazil() == true)
{
if (iAmount >= 213)
LogManager::instance().CharLog(this, iAmount, "GET_CHEQUE", "");
}
else
{
if (iAmount > 1000) // ?? ??? ????.
LogManager::instance().CharLog(this, iAmount, "GET_CHEQUE", "");
}
}
}
#endif