Guild Buff

04/06/2018 22:16 xToffer#1
what im going to change instead of price is penya change to perin?

thanks :D

Code:
    CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );
    CMover* pMover = pUser;
    int nCurSel;
    int nGold;
    nGold = 0;
    int valid = 0;
    ar >> nCurSel;
    CCtrl* pCtrl = (CCtrl*)pMover;
    CGuild *pGuild = pUser->GetGuild();
    if( IsValidObj( pUser ) )
    {
        if ( pGuild )
        {
            switch( nCurSel )
            {
                case 0:
                {
                    if ( pGuild->m_nLevel > 19 )
                    {
                        if(    pUser->HasBuff(BUFF_SKILL, SI_BUFF_GUILD01) )
                            valid = 1;
                       
                        if ( valid != 1 )
                        {
                            nGold = 2100000000;
                            if ( pUser->GetGold() > nGold )
                            {   
                                pUser->AddGold( -nGold );
                                pCtrl->DoAddBuff( SI_BUFF_GUILD01, 1, pCtrl );
                            }
                            else
                                pUser->AddDefinedText( TID_GUILD_ERROR_NO_PENYA );
                        }
                        else
                            pUser->AddDefinedText( TID_GUILD_DEJA_BUFF );
                    }
                    else
                    {
                        pUser->AddDefinedText( TID_GUILD_LOW_LVL );
                    }
                }
                break;
04/07/2018 09:08 Rhea03#2
PHP Code:
     CUserpUser g_UserMng.GetUserdpidCachedpidUser );
    
CMoverpMover pUser;
    
int nCurSel;
    
int nPerin;
    
nPerin 0;
    
int valid 0;
    
ar >> nCurSel;
    
CCtrlpCtrl = (CCtrl*)pMover;
    
CGuild *pGuild pUser->GetGuild();
    if( 
IsValidObjpUser ) )
    {
        if ( 
pGuild )
        {
            switch( 
nCurSel )
            {
                case 
0:
                {
                    if ( 
pGuild->m_nLevel 19 )
                    {
                        if(    
pUser->HasBuff(BUFF_SKILLSI_BUFF_GUILD01) )
                            
valid 1;
                       
                        if ( 
valid != )
                        {
                            
nPenya 100000000;
                }
                else
                            
nPerin 1;
                            if ( 
pUser->GetPerin() > nPerin )
                            {   
                                
pUser->AddPerin( -nPerin );
                                
pCtrl->DoAddBuffSI_BUFF_GUILD011pCtrl );
                            }
                            else
                                
pUser->AddDefinedTextTID_GUILD_ERROR_NO_PERIN );
                        }
                        else
                            
pUser->AddDefinedTextTID_GUILD_DEJA_BUFF );
                    }
                    else
                    {
                        
pUser->AddDefinedTextTID_GUILD_LOW_LVL );
                    }
                }
                break; 
DefineText.h
PHP Code:
TID_GUILD_ERROR_NO_PERIN 
Trying hard :D
04/07/2018 15:55 xToffer#3
Quote:
Originally Posted by Rhea03 View Post
PHP Code:
     CUserpUser g_UserMng.GetUserdpidCachedpidUser );
    
CMoverpMover pUser;
    
int nCurSel;
    
int nPerin;
    
nPerin 0;
    
int valid 0;
    
ar >> nCurSel;
    
CCtrlpCtrl = (CCtrl*)pMover;
    
CGuild *pGuild pUser->GetGuild();
    if( 
IsValidObjpUser ) )
    {
        if ( 
pGuild )
        {
            switch( 
nCurSel )
            {
                case 
0:
                {
                    if ( 
pGuild->m_nLevel 19 )
                    {
                        if(    
pUser->HasBuff(BUFF_SKILLSI_BUFF_GUILD01) )
                            
valid 1;
                       
                        if ( 
valid != )
                        {
                            
nPenya 100000000;
                }
                else
                            
nPerin 1;
                            if ( 
pUser->GetPerin() > nPerin )
                            {   
                                
pUser->AddPerin( -nPerin );
                                
pCtrl->DoAddBuffSI_BUFF_GUILD011pCtrl );
                            }
                            else
                                
pUser->AddDefinedTextTID_GUILD_ERROR_NO_PERIN );
                        }
                        else
                            
pUser->AddDefinedTextTID_GUILD_DEJA_BUFF );
                    }
                    else
                    {
                        
pUser->AddDefinedTextTID_GUILD_LOW_LVL );
                    }
                }
                break; 
DefineText.h
PHP Code:
TID_GUILD_ERROR_NO_PERIN 
Trying hard :D
not working
04/07/2018 16:28 Avalion#4
sir use GetTotalGold and RemoveTotalGold. that way it work with penya + perin sir.
04/07/2018 16:41 xToffer#5
Quote:
Originally Posted by Avalion View Post
sir use GetTotalGold and RemoveTotalGold. that way it work with penya + perin sir.

Code:
                     if ( valid != 1 )
                        {
                            nGold = 21;
                            if ( pUser->GetTotalGold() > nGold )
                            {   
                                pUser->RemoveTotalGold( -nGold );
like this sir?