📄 party.cpp
字号:
//
// bRequest - REQUEST / REQUESTMISSION 牢瘤 八荤 ...
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_Request(int pQuestIndex, _LPSOCKET_FD pSocketFD, bool bRequest )
{
BOOL nOK = FALSE;;
//
// 颇萍盔甸狼 QUEST甫 积己矫糯
//
for( int i = 1; i < MAX_PARTY_NUM ; i ++ )
{
#ifdef DEF_PARTYQUEST
if( !IsSocketValidity( m_pPartySocket[i] ) )
{
// 2004.10.18 by kuma
// 颇萍 府胶飘俊绰 乐绰单 促弗 甘辑滚俊 楷搬等 糕滚捞促..
if( ( bRequest ) &&
( m_pPartyMember->PARTYLIST[i].dwPlayerHandle != NULL ) &&
( m_pPartyMember->PARTYLIST[i].dwMapID != _Module.m_nMapSeq ) )
{
g_lpDBSock->WorldSend_PartyQuestMapChange( NULL,
PARTYQUEST_REQUEST,
m_pPartyMember->dwPartyHandle,
m_pPartyMember->PARTYLIST[i].dwPlayerHandle,
pQuestIndex,
0,
0 );
}
continue;
}
#else
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
#endif
if ( ( !bRequest ) &&
( m_pPartySocket[i]->pPlayer->GetLocationMapType() != MAP_EVENT ) )
continue;
if( m_pPartySocket[i] == pSocketFD )
m_pPartySocket[i]->pPlayer->QuestRequest( pQuestIndex, true );
else
m_pPartySocket[i]->pPlayer->QuestRequest( pQuestIndex, false );
}
//
// 颇萍 付胶磐狼 QUEST甫 积己 矫糯
//
if( IsSocketValidity( m_pPartySocket[0] ) )
{
if( m_pPartySocket[0] == pSocketFD )
m_pPartySocket[0]->pPlayer->QuestRequest( pQuestIndex, true );
else
m_pPartySocket[0]->pPlayer->QuestRequest( pQuestIndex, false );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 涅胶飘狼 TITLE阑 涝仿矫糯
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_SetVarTitle(int pQuestIndex, int pID, CString pTitle, int pTriggerID, int pExeCount)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
// 秦寸 QUEST沥焊甫 掘澜
CActiveQuest *pAtiveQuest = (CActiveQuest *)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pAtiveQuest ) continue;
pAtiveQuest->SetVarTitle( pID, pTitle, pTriggerID, pExeCount );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 涅胶飘狼 TODO甫 涝仿矫糯
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_SetTodo(int pQuestIndex, CString pTodo, int pTriggerID, int pExeCount)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
// 秦寸 QUEST沥焊甫 掘澜
CActiveQuest *pAtiveQuest = (CActiveQuest *)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pAtiveQuest ) continue;
pAtiveQuest->SetTodo( pTodo, pTriggerID, pExeCount );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 涅胶飘狼 SETVAR阑 角青矫糯
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_SetVar(int pQuestIndex, int pSlot, int pValue)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
// 秦寸 QUEST沥焊甫 掘澜
CActiveQuest *pAtiveQuest = (CActiveQuest *)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pAtiveQuest ) continue;
pAtiveQuest->SetVar( pSlot, pValue );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 涅胶飘狼 DELTAVAR
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_DeltaVar(int pQuestIndex, int pSlot, int pDelta)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
// 秦寸 QUEST沥焊甫 掘澜
CActiveQuest *pAtiveQuest = (CActiveQuest *)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pAtiveQuest ) continue;
pAtiveQuest->DeltaVar( pSlot, pDelta );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 颇萍俊 Timer ID甫 技泼 矫糯
//
// - Party Master牢 版快父 Timer Msg甫 傈价窃
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_SetTimerID(int pQuestIndex, int pTimerSlot, int pTimerID)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
// 秦寸 QUEST沥焊甫 掘澜
CActiveQuest *pAtiveQuest = (CActiveQuest *)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pAtiveQuest ) continue;
// Party MOnster牢 版快 悸泼矫糯
if( i == 0 )
pAtiveQuest->SetTimerID( pTimerSlot, pTimerID);
g_pServer->PacketSend_QuestSetTimer( m_pPartySocket[i], pQuestIndex, pTimerSlot, pTimerID );
// g_pServer->PacketSend_QuestSetTimer( m_pPartySocket[i], pQuestIndex, pAtiveQuest->GetVar(0), pAtiveQuest->GetVar(1) );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 颇萍狼 Timer ID甫 秦力 矫糯
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_KillTimerID(int pQuestIndex, int pTimerSlot)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
// 秦寸 QUEST沥焊甫 掘澜
CActiveQuest *pAtiveQuest = (CActiveQuest *)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pAtiveQuest ) continue;
pAtiveQuest->KillTimerID( pAtiveQuest->GetVar(0) );
g_pServer->PacketSend_QuestKillTimer( m_pPartySocket[i], pAtiveQuest->GetIndex(), pAtiveQuest->GetVar(0) );
}
}
////////////////////////////////////////////////////////////////////////////////////////
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_Update(int pQuestIndex)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
// 秦寸 QUEST沥焊甫 掘澜
CActiveQuest *pAtiveQuest = (CActiveQuest *)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pAtiveQuest ) continue;
pAtiveQuest->PacketSend_QuestUpdate();
}
}
////////////////////////////////////////////////////////////////////////////////////////
// QUEST - SET GLOBAL
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_SetGlobal(int pQuestIndex, int pVar, int pNum)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
// 秦寸 QUEST沥焊甫 掘澜
CActiveQuest *pAtiveQuest = (CActiveQuest *)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pAtiveQuest ) continue;
m_pPartySocket[i]->pPlayer->QuestGlobal_SetValue( pVar, pNum );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// QUEST - CLEAR GLOBAL
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_ClearGlobal( int pQuestIndex )
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
// 秦寸 QUEST沥焊甫 掘澜
CActiveQuest *pAtiveQuest = (CActiveQuest *)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pAtiveQuest ) continue;
m_pPartySocket[i]->pPlayer->QuestGlobal_Clear();
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 秦寸 QUEST甫 茫酒 昏力矫糯
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_RemoveQuest(int pQuestIndex)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
//
// Remove瞪 Qeust沥焊甫掘澜
//
CActiveQuest *pRemoveQuest = (CActiveQuest*)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pRemoveQuest )
{
continue;
}
m_pPartySocket[i]->pPlayer->QuestDelete( pRemoveQuest );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 秦寸 颇萍盔俊霸 GATE甫 ON/OFF矫糯
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_Gate( int pQuestIndex, int pGate, int pLock)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
CActiveQuest *pRemoveQuest = (CActiveQuest*)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pRemoveQuest ) continue;
g_pServer->PacketSend_QuestGate( m_pPartySocket[i], pGate, pLock );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 秦寸 颇萍盔俊霸 Mission Complete甫 舅覆
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_MissionComplete(int pQuestIndex, BYTE pComplete)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
//
// 秦寸 涅胶飘狼 粮犁 咯何甫 魄窜
//
CActiveQuest *pQuest = (CActiveQuest*)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pQuest ) continue;
g_pServer->PacketSend_QuestMissionComplete( m_pPartySocket[i], pQuestIndex, pComplete );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 秦寸 颇萍 涅胶飘狼 吝窜阑 烹焊窃
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_Abandon(int pQuestIndex)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
#ifdef DEF_PARTYQUEST
if( !IsSocketValidity( m_pPartySocket[i] ) )
{
// 2004.10.18 by kuma
// 颇萍 府胶飘俊绰 乐绰单 促弗 甘辑滚俊 楷搬等 糕滚捞促..
if( ( m_pPartyMember->PARTYLIST[i].dwPlayerHandle != NULL ) &&
( m_pPartyMember->PARTYLIST[i].dwMapID != _Module.m_nMapSeq ) )
{
g_lpDBSock->WorldSend_PartyQuestMapChange( NULL,
PARTYQUEST_ABANDON,
m_pPartyMember->dwPartyHandle,
m_pPartyMember->PARTYLIST[i].dwPlayerHandle,
pQuestIndex,
0,
0 );
}
continue;
}
#else
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
#endif
//
// 器扁且 涅胶飘 沥焊甫 掘澜
//
CActiveQuest *pQuest = (CActiveQuest*)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pQuest ) continue;
//
// 2004.10.14 by kuma
// 颇萍 付胶磐啊 颇萍 涅胶飘甫 器扁窍搁 m_dwPartyQuest甫 檬扁拳 秦林磊
//
if ( i == 0 )
m_pPartySocket[i]->pPlayer->m_dwPartyQuest = 0;
m_pPartySocket[i]->pPlayer->QuestDelete( pQuest );
pQuest->ExecuteTriggerMissionStop();
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 窍大 颇萍俊 涅胶飘 Effect沥焊甫 傈价窃
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_Effect( DWORD pQuestIndex, DWORD pID, BYTE pOption)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
//
// 秦寸 涅胶飘狼 粮犁 咯何甫 魄窜
//
CActiveQuest *pQuest = (CActiveQuest*)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pQuest ) continue;
g_pServer->PacketSend_QuestEffect( m_pPartySocket[i], pID, pOption );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 颇萍狼 捞亥飘 甘 沥焊甫 悸泼矫糯
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_SetEventMapPath( int pQuestIndex, int pMapBase, int pMapPath, int pMapSelect)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
//
// 秦寸 涅胶飘狼 粮犁 咯何甫 魄窜
//
CActiveQuest *pQuest = (CActiveQuest*)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pQuest ) continue;
m_pPartySocket[i]->pPlayer->Quest_SetEventMapPath( pMapBase, pMapPath, pMapSelect );
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 颇萍 甘狼 PATH甫 促澜 亲格栏肺 捞悼矫糯
//
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_SetNextEventMap( int pQuestIndex )
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
//
// 秦寸 涅胶飘狼 粮犁 咯何甫 魄窜
//
CActiveQuest *pQuest = (CActiveQuest*)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pQuest ) continue;
m_pPartySocket[i]->pPlayer->Quest_SetNextEventMap();
}
}
////////////////////////////////////////////////////////////////////////////////////////
// 颇萍 付胶磐狼 SOCKET_FD甫 馆券矫糯
//
////////////////////////////////////////////////////////////////////////////////////////
_LPSOCKET_FD CParty::GetPartyMasterFD()
{
if( !IsSocketValidity( m_pPartySocket[0] ) ) return NULL;
return m_pPartySocket[0];
}
////////////////////////////////////////////////////////////////////////////////////////
// QUEST NPC SHOUT
////////////////////////////////////////////////////////////////////////////////////////
void CParty::PartyQuest_QuestNPCSHOUT(int pQuestIndex, DWORD pNPCID, char *pMsg)
{
for( int i = 0; i < MAX_PARTY_NUM ; i ++ )
{
if( !IsSocketValidity( m_pPartySocket[i] ) ) continue;
//
// 秦寸 涅胶飘狼 粮犁 咯何甫 魄窜
//
CActiveQuest *pQuest = (CActiveQuest*)m_pPartySocket[i]->pPlayer->m_ActiveQuest.Find( pQuestIndex );
if( !pQuest ) continue;
g_pServer->PacketSend_QuestNPCSHOUT( m_pPartySocket[i], pNPCID, pMsg );
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -