本文整理汇总了C++中NPC::getQuestInfoManager方法的典型用法代码示例。如果您正苦于以下问题:C++ NPC::getQuestInfoManager方法的具体用法?C++ NPC::getQuestInfoManager怎么用?C++ NPC::getQuestInfoManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NPC
的用法示例。
在下文中一共展示了NPC::getQuestInfoManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void CGSelectQuestHandler::execute (CGSelectQuest* pPacket , Player* pPlayer)
throw(Error)
{
__BEGIN_TRY __BEGIN_DEBUG_EX
#ifdef __GAME_SERVER__
GamePlayer* pGP = dynamic_cast<GamePlayer*>(pPlayer);
Assert(pGP != NULL);
PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pGP->getCreature());
GCNPCResponse gcNPCR;
gcNPCR.setCode(NPC_RESPONSE_QUEST);
Creature* pCreature = pPC->getZone()->getCreature(pPacket->getNPCObjectID());
if (pCreature == NULL || !pCreature->isNPC() )
{
gcNPCR.setParameter((uint)START_FAIL_CANNOT_APPLY_QUEST);
pPlayer->sendPacket(&gcNPCR);
return;
}
NPC* pNPC = dynamic_cast<NPC*>(pCreature);
if (pNPC == NULL )
{
gcNPCR.setParameter((uint)START_FAIL_CANNOT_APPLY_QUEST);
pPlayer->sendPacket(&gcNPCR);
return;
}
QuestInfoManager* pQIM = pNPC->getQuestInfoManager();
if (pQIM == NULL )
{
gcNPCR.setParameter((uint)START_FAIL_CANNOT_APPLY_QUEST);
pPlayer->sendPacket(&gcNPCR);
return;
}
pPC->getQuestManager()->adjustQuestStatus();
QuestMessage code = pQIM->startQuest(pPacket->getQuestID(), pPC);
list<QuestID_t> qList;
pQIM->getEventQuestIDs(pPC->getQuestManager()->getEventQuestAdvanceManager()->getQuestLevel(), pPC, back_inserter(qList));
gcNPCR.setParameter((uint)code);
if (!pQIM->isEventQuest(pPacket->getQuestID() ) )
pPlayer->sendPacket(&gcNPCR);
if (code == START_SUCCESS )
{
pPC->sendCurrentQuestInfo();
//cout << "Quest 시작 " << pPC->getName() << " " << pPacket->getQuestID() << endl;
}
else
{
//cout << "Quest 시작 실패 " << pPC->getName() << " " << (int)code << endl;
}
#endif // __GAME_SERVER__
__END_DEBUG_EX __END_CATCH
}