AFK Vendor Mails

03/20/2020 06:51 LuciferMorningStar666#1
Hello, I have this little problem. So when a player used AFK Vendor, and put amount of 1.5M Perins, and then they are off. The Mail only receive 200K perins. Any tips how to increase the maximum mail perins? Thank you.
04/08/2020 08:42 Hyellow#2
You can find the answer here:

Code:
BOOL CMover::AddGold(int nGold, BOOL bSend)
04/08/2020 18:28 Ecrypter#3
Quote:
Originally Posted by LuciferMorningStar666 View Post
Hello, I have this little problem. So when a player used AFK Vendor, and put amount of 1.5M Perins, and then they are off. The Mail only receive 200K perins. Any tips how to increase the maximum mail perins? Thank you.
what files you use?
04/08/2020 19:08 jericho2nd#4
Code:
BOOL CMover::AddGold(int nGold, BOOL bSend)
{
	if (!IsValidObj(this))
		return FALSE;
	if (nGold == 0)
		return TRUE;

	__int64 i64Total = static_cast<__int64>(GetGold()) + static_cast<__int64>(nGold);

	if (i64Total > static_cast<__int64>(INT_MAX))
		i64Total = static_cast<__int64>(INT_MAX);
	else if (i64Total < 0)
		i64Total = 0;

	SetGold(static_cast<int>(i64Total));

	if (bSend)
	{
#ifdef __WORLDSERVER
		if (i64Total > INT_MAX)
			i64Total = INT_MAX;

		g_UserMng.AddSetPointParam(this, DST_GOLD, (int)i64Total);
#endif // __WORLDSERVER
}

	return TRUE;
}
04/10/2020 04:44 Ecrypter#5
Quote:
Originally Posted by LuciferMorningStar666 View Post
Hello, I have this little problem. So when a player used AFK Vendor, and put amount of 1.5M Perins, and then they are off. The Mail only receive 200K perins. Any tips how to increase the maximum mail perins? Thank you.
PHP Code:
BOOL CMover::AddGoldint nGoldBOOL bSend )
{
    if( 
nGold == )
        return 
TRUE;

//#ifdef __WORLDSERVER
//    if( m_vtInfo.TradeGetGold() != 0 )
//        return FALSE;
//#endif    // __WORLDSERVER

#ifdef __PERIN_BUY_BUG
    
__int64 i64Total static_cast<__int64>( GetGold() ) + static_cast<__int64>( nGold );
    
    if( 
i64Total static_cast<__int64>( INT_MAX ) )
        
i64Total static_cast<__int64>( INT_MAX );
    else if( 
i64Total )
        
i64Total 0;

    
SetGoldstatic_cast<int>( i64Total ) );
#else // __PERIN_BUY_BUG
    
int nTotal GetGold() + nGold;

    if( 
nGold )
    {
        if( 
nTotal )        // overflow?
            
nTotal INT_MAX;
    }
    else    
// nGold < 0
    
{
        if( 
nTotal )        // underflow?
        
{
//#ifdef __WORLDSERVER
//            Error( "AddGold: nTotal < 0" );
//#endif    // __WORLDSERVER
            
nTotal    0;
//            return FALSE;
        
}
    }

    
SetGoldnTotal );
#endif // __PERIN_BUY_BUG
    
    
if( bSend )
    {
    
#ifdef __WORLDSERVER
#ifdef __PERIN_BUY_BUG
        
g_UserMng.AddSetPointParamthisDST_GOLDstatic_cast<int>( i64Total ) );
#else // __PERIN_BUY_BUG
        
g_UserMng.AddSetPointParamthisDST_GOLDnTotal );
#endif // __PERIN_BUY_BUG
    #endif    // __WORLDSERVER
    
}

    return 
TRUE;

04/10/2020 06:26 Hyellow#6
Quote:
Originally Posted by Ecrypter View Post
PHP Code:
BOOL CMover::AddGoldint nGoldBOOL bSend )
{
    if( 
nGold == )
        return 
TRUE;

//#ifdef __WORLDSERVER
//    if( m_vtInfo.TradeGetGold() != 0 )
//        return FALSE;
//#endif    // __WORLDSERVER

#ifdef __PERIN_BUY_BUG
    
__int64 i64Total static_cast<__int64>( GetGold() ) + static_cast<__int64>( nGold );
    
    if( 
i64Total static_cast<__int64>( INT_MAX ) )
        
i64Total static_cast<__int64>( INT_MAX );
    else if( 
i64Total )
        
i64Total 0;

    
SetGoldstatic_cast<int>( i64Total ) );
#else // __PERIN_BUY_BUG
    
int nTotal GetGold() + nGold;

    if( 
nGold )
    {
        if( 
nTotal )        // overflow?
            
nTotal INT_MAX;
    }
    else    
// nGold < 0
    
{
        if( 
nTotal )        // underflow?
        
{
//#ifdef __WORLDSERVER
//            Error( "AddGold: nTotal < 0" );
//#endif    // __WORLDSERVER
            
nTotal    0;
//            return FALSE;
        
}
    }

    
SetGoldnTotal );
#endif // __PERIN_BUY_BUG
    
    
if( bSend )
    {
    
#ifdef __WORLDSERVER
#ifdef __PERIN_BUY_BUG
        
g_UserMng.AddSetPointParamthisDST_GOLDstatic_cast<int>( i64Total ) );
#else // __PERIN_BUY_BUG
        
g_UserMng.AddSetPointParamthisDST_GOLDnTotal );
#endif // __PERIN_BUY_BUG
    #endif    // __WORLDSERVER
    
}

    return 
TRUE;

:handsdown::handsdown::handsdown:
Genius :handsdown::handsdown::handsdown:
04/10/2020 06:33 Tweeney#7
Quote:
Originally Posted by Hyellow View Post
You can find the answer here:

Code:
BOOL CMover::AddGold(int nGold, BOOL bSend)
Genius :handsdown::handsdown::handsdown::handsdown:
04/10/2020 09:08 Hyellow#8
Quote:
Originally Posted by Tweeney View Post
Genius :handsdown::handsdown::handsdown::handsdown:
Thank you. ;)