本文整理汇总了C++中CUser::AddGold方法的典型用法代码示例。如果您正苦于以下问题:C++ CUser::AddGold方法的具体用法?C++ CUser::AddGold怎么用?C++ CUser::AddGold使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::AddGold方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __AddGold
void __AddGold( DWORD dwIdMover, int nGold )
{
CUser* pUser = prj.GetUser( dwIdMover );
pUser->AddGold( nGold );
pUser->AddGoldText( nGold );
}
示例2: __RemoveGold
void __RemoveGold( DWORD dwIdMover, int nGold )
{
CUser* pUser = prj.GetUser( dwIdMover );
if( pUser->AddGold( -nGold ) == FALSE )
pUser->SetGold( 0 );
}
示例3: __EndQuest
//.........这里部分代码省略.........
}
}
}
else
if( pEndRewardItem->m_nType == 1 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pUser->GetItemNum( pEndRewardItem->m_nJobOrItem ) )
{
if( pEndRewardItem->m_nItemIdx )
{
int nItemNum = pEndRewardItem->m_nItemNum;
#ifdef __JEFF_11
#if __VER >= 13 // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption, pEndRewardItem->m_byFlag );
#else // __CHIPI_QUESTITEM_FLAG
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum, pEndRewardItem->m_nAbilityOption );
#endif // __CHIPI_QUESTITEM_FLAG
#else // __JEFF_11
__CreateItem( nPcId, pEndRewardItem->m_nItemIdx, nItemNum );
#endif // __JEFF_11
}
}
}
}
}
#if __VER >= 9 // __PET_0410
if( pQuestProp->m_bEndRewardPetLevelup )
pUser->PetLevelup();
#endif // __PET_0410
if( pQuestProp->m_nEndRewardGoldMin )
{
nNum = pQuestProp->m_nEndRewardGoldMax - pQuestProp->m_nEndRewardGoldMin + 1;
int nGold = pQuestProp->m_nEndRewardGoldMin + xRandom( nNum );
pUser->AddGold( nGold );
pUser->AddGoldText( nGold );
}
if( pQuestProp->m_nEndRewardExpMin )
{
nNum = pQuestProp->m_nEndRewardExpMax - pQuestProp->m_nEndRewardExpMin + 1;
int nExp = pQuestProp->m_nEndRewardExpMin + xRandom( nNum );
if( pUser->AddExperience( nExp, TRUE, FALSE ) )
pUser->LevelUpSetting();
else
pUser->ExpUpSetting();
pUser->AddSetExperience( pUser->GetExp1(), (WORD)pUser->m_nLevel, pUser->m_nSkillPoint, pUser->m_nSkillLevel );
pUser->AddDefinedText( TID_GAME_REAPEXP );
}
if( pQuestProp->m_nEndRewardSkillPoint )
{
pUser->AddSkillPoint( pQuestProp->m_nEndRewardSkillPoint );
pUser->AddSetExperience( pUser->GetExp1(), (WORD)pUser->m_nLevel, pUser->m_nSkillPoint, pUser->m_nSkillLevel );
g_dpDBClient.SendLogSkillPoint( LOG_SKILLPOINT_GET_QUEST, pQuestProp->m_nEndRewardSkillPoint, (CMover*)pUser, NULL );
}
#if __VER >= 8 // __S8_PK
if( pQuestProp->m_nEndRewardPKValueMin || pQuestProp->m_nEndRewardPKValueMax )
{
if( pQuestProp->m_nEndRewardPKValueMin <= pQuestProp->m_nEndRewardPKValueMax )
{
int nPKValue = pUser->GetPKValue() - xRandom( pQuestProp->m_nEndRewardPKValueMin, pQuestProp->m_nEndRewardPKValueMax + 1 );
if( nPKValue < 0 )
nPKValue = 0;
pUser->SetPKValue( nPKValue );
pUser->AddPKValue();
g_dpDBClient.SendLogPkPvp( (CMover*)pUser, NULL, 0, 'P' );