本文整理汇总了C++中CUser::GetQuest方法的典型用法代码示例。如果您正苦于以下问题:C++ CUser::GetQuest方法的具体用法?C++ CUser::GetQuest怎么用?C++ CUser::GetQuest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::GetQuest方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __QuestEndComplete
void __QuestEndComplete( int nPcId, int nNpcId, int& nGlobal, int nVal, int nQuestId )
{
CUser* pUser = prj.GetUser( nPcId );
LPQUEST lpQuest = pUser->GetQuest( nQuestId );
#ifdef __VTN_TIMELIMIT
// mulcom BEGIN100315 베트남 시간 제한
if( ::GetLanguage() == LANG_VTN )
{
if( pUser->IsPlayer() == TRUE )
{
if( pUser->m_nAccountPlayTime > MIN( 180 ) )
{
pUser->AddDefinedText( TID_GAME_ERROR_QUEST_1 );
return;
}
}
}
// mulcom END100315 베트남 시간 제한
#endif // __VTN_TIMELIMIT
// 퀘스트가 진행 중인 경우
if( lpQuest && pUser->IsCompleteQuest( nQuestId ) == FALSE
&& __IsEndQuestCondition( pUser, nQuestId ) )
{
CMover* pMover = prj.GetMover( nNpcId );
if( __EndQuest( nPcId, nQuestId ) == TRUE )
pMover->m_pNpcProperty->RunDialog( "#questEndComplete", NULL, 0, nNpcId, nPcId, nQuestId );
#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
__QuestEnd( nPcId, nNpcId, nGlobal, nQuestId, TRUE );
#else // __IMPROVE_QUEST_INTERFACE
__QuestEnd( nPcId, nNpcId, nGlobal );
#endif // __IMPROVE_QUEST_INTERFACE
}
}
示例2: __RemoveQuest
int __RemoveQuest( int nPcId, int nQuest )
{
QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuest );
if( pQuestProp )
{
CUser* pUser = prj.GetUser( nPcId );
LPQUEST pQuest = pUser->GetQuest( nQuest );
if( pQuest && pQuest->m_nState < 14 )
pUser->AddDefinedText( TID_EVE_CANCELQUEST, "\"%s\"", pQuestProp->m_szTitle );
pUser->RemoveQuest( nQuest );
pUser->AddRemoveQuest( nQuest );
// 시작시 변신을 했으면 퀘스트 삭제시 변신 해제시킨다.
if( pQuest && pQuestProp->m_nBeginSetDisguiseMoverIndex )
{
CUser* pUser = prj.GetUser( nPcId );
pUser->NoDisguise( NULL );
g_UserMng.AddNoDisguise( pUser );
}
}
return 1;
}
示例3: __QuestBeginYes
void __QuestBeginYes( int nPcId, int nNpcId, int nQuestId )
{
CUser* pUser = prj.GetUser( nPcId );
#ifdef __VTN_TIMELIMIT
// mulcom BEGIN100315 베트남 시간 제한
if( ::GetLanguage() == LANG_VTN )
{
if( pUser->IsPlayer() == TRUE )
{
if( pUser->m_nAccountPlayTime > MIN( 180 ) )
{
pUser->AddDefinedText( TID_GAME_ERROR_QUEST_1 );
return;
}
}
}
// mulcom END100315 베트남 시간 제한
#endif // __VTN_TIMELIMIT
LPQUEST lpQuest = pUser->GetQuest( nQuestId );
if( __IsBeginQuestCondition( pUser, nQuestId )
&& lpQuest == NULL
&& pUser->IsCompleteQuest( nQuestId ) == FALSE )
{
__SayQuest( nPcId, nQuestId, QSAY_BEGIN_YES );
__RunQuest( nPcId, nNpcId, nQuestId );
CMover* pMover = prj.GetMover( nNpcId );
#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
__RemoveAllKey( nPcId );
pMover->m_pNpcProperty->RunDialog( "#addKey", NULL, 0, nNpcId, nPcId, 0 );
LPQUEST lpQuestList;
// 퀘스트 리스트 send
vector<int> vecNewQuest;
vector<int> vecNextQuest;
vector<int> vecEndQuest;
vector<int> vecCurrQuest;
LPCHARACTER lpChar = prj.GetCharacter( pMover->m_szCharacterKey );
if( lpChar )
{
for( int i = 0; i < lpChar->m_awSrcQuest.GetSize(); i++ )
{
int nQuest = lpChar->m_awSrcQuest.GetAt( i );
lpQuestList = pUser->GetQuest( nQuest );
// new quest
if( lpQuestList == NULL && pUser->IsCompleteQuest( nQuest ) == FALSE )
{
// now
if( __IsBeginQuestCondition( pUser, nQuest ) )
vecNewQuest.push_back( nQuest );
// next
else if( __IsNextLevelQuest( pUser, nQuest ) )
vecNextQuest.push_back( nQuest );
}
// current quest
else if( lpQuestList && pUser->IsCompleteQuest( nQuest ) == FALSE )
{
// complete
if( __IsEndQuestCondition( pUser, nQuest ) )
vecEndQuest.push_back( nQuest );
// running
else
vecCurrQuest.push_back( nQuest );
}
}
// sort
__QuestSort( vecNewQuest );
__QuestSort( vecNextQuest );
__QuestSort( vecEndQuest );
__QuestSort( vecCurrQuest );
// send
for( DWORD i = 0; i < vecNewQuest.size(); ++i )
__AddQuestKey( nPcId, vecNewQuest[ i ], "QUEST_BEGIN", 0, TRUE );
for( DWORD i = 0; i < vecNextQuest.size(); ++i )
__AddQuestKey( nPcId, vecNextQuest[ i ], "QUEST_NEXT_LEVEL", 0, TRUE );
for( DWORD i = 0; i < vecEndQuest.size(); ++i )
__AddQuestKey( nPcId, vecEndQuest[ i ], "QUEST_END", 0, FALSE );
for( DWORD i = 0; i < vecCurrQuest.size(); ++i )
__AddQuestKey( nPcId, vecCurrQuest[ i ], "QUEST_END", 0, FALSE );
}
#endif // __IMPROVE_QUEST_INTERFACE
pMover->m_pNpcProperty->RunDialog( "#questBeginYes", NULL, 0, nNpcId, nPcId, nQuestId );
}
}
示例4: __QuestEnd
void __QuestEnd( int nPcId, int nNpcId, int& nGlobal )
#endif // __IMPROVE_QUEST_INTERFACE
{
#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
// 현재 진행 중인 퀘스트 중에서 현재 NPC가 처리해야될 퀘스트를 실행(자신일 수도 있음)
CMover* pMover = prj.GetMover( nNpcId );
CUser* pUser = prj.GetUser( nPcId );
LPQUEST lpQuest;
BOOL bNewQuest = FALSE;
__RemoveAllKey( nPcId );
pMover->m_pNpcProperty->RunDialog( "#addKey", NULL, 0, nNpcId, nPcId, 0 );
// 퀘스트 리스트 send
vector<int> vecNewQuest;
vector<int> vecNextQuest;
vector<int> vecEndQuest;
vector<int> vecCurrQuest;
LPCHARACTER lpChar = prj.GetCharacter( pMover->m_szCharacterKey );
if( lpChar )
{
for( int i = 0; i < lpChar->m_awSrcQuest.GetSize(); i++ )
{
int nQuest = lpChar->m_awSrcQuest.GetAt( i );
lpQuest = pUser->GetQuest( nQuest );
// new quest
if( lpQuest == NULL && pUser->IsCompleteQuest( nQuest ) == FALSE )
{
// now
if( __IsBeginQuestCondition( pUser, nQuest ) )
{
bNewQuest = TRUE;
vecNewQuest.push_back( nQuest );
}
// next
else if( __IsNextLevelQuest( pUser, nQuest ) )
vecNextQuest.push_back( nQuest );
}
// current quest
else if( lpQuest && pUser->IsCompleteQuest( nQuest ) == FALSE && lpQuest->m_nState != QS_END )
{
// complete
if( __IsEndQuestCondition( pUser, nQuest ) )
vecEndQuest.push_back( nQuest );
// running
else
vecCurrQuest.push_back( nQuest );
}
}
// sort
__QuestSort( vecNewQuest );
__QuestSort( vecNextQuest );
__QuestSort( vecEndQuest );
__QuestSort( vecCurrQuest );
// send
for( DWORD i = 0; i < vecNewQuest.size(); ++i )
__AddQuestKey( nPcId, vecNewQuest[ i ], "QUEST_BEGIN", 0, TRUE );
for( DWORD i = 0; i < vecNextQuest.size(); ++i )
__AddQuestKey( nPcId, vecNextQuest[ i ], "QUEST_NEXT_LEVEL", 0, TRUE );
for( DWORD i = 0; i < vecEndQuest.size(); ++i )
__AddQuestKey( nPcId, vecEndQuest[ i ], "QUEST_END", 0, FALSE );
for( DWORD i = 0; i < vecCurrQuest.size(); ++i )
__AddQuestKey( nPcId, vecCurrQuest[ i ], "QUEST_END", 0, FALSE );
}
BOOL bDialogText = TRUE;
BOOL bCompleteCheck = TRUE;
if( nQuestId )
{
lpQuest = pUser->GetQuest( nQuestId );
QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuestId );
if( lpQuest && lpQuest->m_nState != QS_END && pQuestProp ) // 진행중인 퀘스트 선택 시
{
bCompleteCheck = FALSE;
if( !bButtOK ) // 퀘스트 목록을 선택하고 들어온 경우
{
if( strcmpi( pQuestProp->m_szEndCondCharacter, pMover->m_szCharacterKey ) == 0 && __IsEndQuestCondition( pUser, nQuestId ) )
{
__SayQuest( nPcId, nQuestId, QSAY_END_COMPLETE1 );
__SayQuest( nPcId, nQuestId, QSAY_END_COMPLETE2 );
__SayQuest( nPcId, nQuestId, QSAY_END_COMPLETE3 );
__AddAnswer( nPcId,"__OK__", "QUEST_END_COMPLETE", 0, nQuestId );
}
else
{
__SayQuest( nPcId, nQuestId, QSAY_END_FAILURE1 );
__SayQuest( nPcId, nQuestId, QSAY_END_FAILURE2 );
__SayQuest( nPcId, nQuestId, QSAY_END_FAILURE3 );
__AddAnswer( nPcId,"__OK__", "QUEST_END_FAIL", 0, nQuestId );
}
bDialogText = FALSE;
}
}
}
//.........这里部分代码省略.........