本文整理汇总了C++中CUser::AddRunScriptFunc方法的典型用法代码示例。如果您正苦于以下问题:C++ CUser::AddRunScriptFunc方法的具体用法?C++ CUser::AddRunScriptFunc怎么用?C++ CUser::AddRunScriptFunc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUser
的用法示例。
在下文中一共展示了CUser::AddRunScriptFunc方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: __AddQuestKey
int __AddQuestKey( int nPcId, int nQuestId, LPCTSTR lpKey, int nParam )
#endif // __IMPROVE_QUEST_INTERFACE
{
CHAR szWord[ 128 ], szKey[ 128 ];
QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuestId );
if( pQuestProp )
strcpy( szWord, pQuestProp->m_szTitle );
if( lpKey[0] == '\0' )
strcpy( szKey, szWord );
else
strcpy( szKey, lpKey );
CUser* pUser = prj.GetUser( nPcId );
RunScriptFunc rsf;
#if __VER >= 15 // __IMPROVE_QUEST_INTERFACE
if( bNew )
rsf.wFuncType = FUNCTYPE_NEWQUEST;
else
rsf.wFuncType = FUNCTYPE_CURRQUEST;
#else // __IMPROVE_QUEST_INTERFACE
rsf.wFuncType = FUNCTYPE_ADDKEY;
#endif // __IMPROVE_QUEST_INTERFACE
lstrcpy( rsf.lpszVal1, szWord );
lstrcpy( rsf.lpszVal2, szKey );
rsf.dwVal1 = nParam;
rsf.dwVal2 = nQuestId;
pUser->AddRunScriptFunc( rsf );
return 1;
}
示例2: __RemoveAllKey
int __RemoveAllKey( int nPcId )
{
CUser* pUser = prj.GetUser( nPcId );
RunScriptFunc rsf;
rsf.wFuncType = FUNCTYPE_REMOVEALLKEY;
pUser->AddRunScriptFunc( rsf );
return 1;
}
示例3: __SayQuest
int __SayQuest( int nPcId,int nQuestId, int nIdx )
{
CString strToken;
QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuestId );
if( pQuestProp && pQuestProp->m_apQuestDialog[ nIdx ] )
strToken = pQuestProp->m_apQuestDialog[ nIdx ];
if( strToken.IsEmpty() == TRUE )
return FALSE;
CUser* pUser = prj.GetUser( nPcId );
RunScriptFunc rsf;
rsf.wFuncType = FUNCTYPE_SAY;//QUEST;
lstrcpy( rsf.lpszVal1, strToken );
rsf.dwVal2 = nQuestId;
pUser->AddRunScriptFunc( rsf );
return 1;
}
示例4: __AddAnswer
int __AddAnswer( int nPcId, LPCTSTR lpszWord, LPCTSTR lpszKey, DWORD dwParam1, int nQuest )
{
CHAR szKey[ 128 ], szWord[ 128 ];
strcpy( szWord, lpszWord );
if( lpszKey[0] == '\0' )
strcpy( szKey, szWord );
else
strcpy( szKey, lpszKey );
CUser* pUser = prj.GetUser( nPcId );
RunScriptFunc rsf;
rsf.wFuncType = FUNCTYPE_ADDANSWER;
lstrcpy( rsf.lpszVal1, szWord );
lstrcpy( rsf.lpszVal2, szKey );
rsf.dwVal1 = (DWORD)dwParam1;
rsf.dwVal2 = nQuest;
pUser->AddRunScriptFunc( rsf );
return 1;
}
示例5: __AddKey
int __AddKey( int nPcId, LPCTSTR lpszWord, LPCTSTR lpszKey, DWORD dwParam )
{
CHAR szKey[ 128 ], szWord[ 128 ];
strcpy( szWord, lpszWord );
if( lpszKey[0] == '\0' )
strcpy( szKey, szWord );
else
strcpy( szKey, lpszKey );
CUser* pUser = prj.GetUser( nPcId );
RunScriptFunc rsf;
rsf.wFuncType = FUNCTYPE_ADDKEY;
lstrcpy( rsf.lpszVal1, szWord );
lstrcpy( rsf.lpszVal2, szKey );
rsf.dwVal1 = dwParam;
rsf.dwVal2 = 0;
pUser->AddRunScriptFunc( rsf );
return 1;
}
示例6: __EndQuest
//int __EndQuest( int nPcId, int nQuestId, BOOL IsEndQuestCondition = TRUE )
int __EndQuest( int nPcId, int nQuestId, BOOL IsEndQuestCondition )
{
int nNum;
QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuestId );
if( pQuestProp )
{
CUser* pUser = prj.GetUser( nPcId );
if( IsEndQuestCondition )
{
if( __IsEndQuestCondition( pUser, nQuestId ) == 0 )
return FALSE;
}
// 보상 아이템 갯수 만큼, 인벤토리 여유가 있는가?
int nItemNum = 0;
for( int i = 0; i < pQuestProp->m_nEndRewardItemNum; i++ )
{
QuestPropItem* pEndRewardItem = &pQuestProp->m_paEndRewardItem[ i ];
if( pEndRewardItem->m_nSex == -1 || pEndRewardItem->m_nSex == pUser->GetSex() )
{
if( pEndRewardItem->m_nType == 0 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pEndRewardItem->m_nJobOrItem == pUser->GetJob() )
{
if( pEndRewardItem->m_nItemIdx )
{
ItemProp* pItemProp = prj.GetItemProp( pEndRewardItem->m_nItemIdx );
int nDiv = pEndRewardItem->m_nItemNum / pItemProp->dwPackMax;
int nSur = pEndRewardItem->m_nItemNum % pItemProp->dwPackMax;
if( nSur ) nDiv++;
nItemNum += nDiv;
}
}
}
else
if( pEndRewardItem->m_nType == 1 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pUser->GetItemNum( pEndRewardItem->m_nJobOrItem ) )
{
if( pEndRewardItem->m_nItemIdx )
{
ItemProp* pItemProp = prj.GetItemProp( pEndRewardItem->m_nItemIdx );
int nDiv = pEndRewardItem->m_nItemNum / pItemProp->dwPackMax;
int nSur = pEndRewardItem->m_nItemNum % pItemProp->dwPackMax;
if( nSur ) nDiv++;
nItemNum += nDiv;
}
}
}
}
}
if( nItemNum > pUser->m_Inventory.GetEmptyCount() )
{
pUser->AddDefinedText( TID_QUEST_NOINVENTORYSPACE ); // 인벤토리 공간이 없어서 퀘스트를 완료할 수 없습니다.
RunScriptFunc rsf;
rsf.wFuncType = FUNCTYPE_EXIT;
pUser->AddRunScriptFunc( rsf );
return FALSE;
}
////////////////////////////
// 보상 지급
////////////////////////////
for( i = 0; i < pQuestProp->m_nEndRewardItemNum; i++ )
{
QuestPropItem* pEndRewardItem = &pQuestProp->m_paEndRewardItem[ i ];
if( pEndRewardItem->m_nSex == -1 || pEndRewardItem->m_nSex == pUser->GetSex() )
{
if( pEndRewardItem->m_nType == 0 )
{
if( pEndRewardItem->m_nJobOrItem == -1 || pEndRewardItem->m_nJobOrItem == pUser->GetJob() )
{
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
}
}
}
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 );
//.........这里部分代码省略.........