本文整理汇总了C++中PlayerCreature::sendCurrentQuestInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerCreature::sendCurrentQuestInfo方法的具体用法?C++ PlayerCreature::sendCurrentQuestInfo怎么用?C++ PlayerCreature::sendCurrentQuestInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCreature
的用法示例。
在下文中一共展示了PlayerCreature::sendCurrentQuestInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void CGFailQuestHandler::execute (CGFailQuest* 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());
pPC->getQuestManager()->adjustQuestStatus();
QuestMessage code;
if (pPacket->isFail() )
code = pPC->getQuestManager()->failQuest();
else
code = pPC->getQuestManager()->cancelQuest();
if (code == CANCEL_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
}
示例2: 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
}
示例3: execute
void CGLotterySelectHandler::execute (CGLotterySelect* pPacket , Player* pPlayer)
throw(Error)
{
__BEGIN_TRY __BEGIN_DEBUG_EX
#ifdef __GAME_SERVER__
GamePlayer* pGP = dynamic_cast<GamePlayer*>(pPlayer);
Assert(pGP != NULL);
Creature* pCreature = pGP->getCreature();
Assert(pCreature != NULL);
PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pCreature);
Assert(pPC != NULL);
filelog("EventQuest.log", "CGLotterySelectHandler : got [%d:%d:%d] from %s", pPacket->getType(), pPacket->getGiftID(), pPacket->getQuestLevel(),
pPC->getName().c_str());
switch (pPacket->getType() )
{
case TYPE_SELECT_LOTTERY:
{
// 인벤에서 퀘스트 아이템 삭제
QuestID_t qID;
EventQuestAdvance::Status status = pPC->getQuestManager()->getEventQuestAdvanceManager()->getStatus(pPacket->getQuestLevel());
int ownerQuestLevel = pPC->getQuestManager()->getEventQuestAdvanceManager()->getQuestLevel();
if (
(ownerQuestLevel > pPacket->getQuestLevel() && status == EventQuestAdvance::EVENT_QUEST_ADVANCED ) ||
(pPacket->getQuestLevel() == 4 && ownerQuestLevel== -1 ) ||
pPC->getQuestManager()->successEventQuest(pPacket->getQuestLevel(), qID ) )
{
pPC->getQuestManager()->getEventQuestAdvanceManager()->rewarded(pPacket->getQuestLevel());
pPC->getQuestManager()->getEventQuestAdvanceManager()->save();
pPC->getQuestManager()->questRewarded(qID);
pPC->sendCurrentQuestInfo();
list<Item*> iList;
pPC->getInventory()->clearQuestItem(iList);
list<Item*>::iterator itr = iList.begin();
list<Item*>::iterator endItr = iList.end();
for (; itr != endItr ; ++itr )
{
GCDeleteInventoryItem gcDII;
gcDII.setObjectID((*itr)->getObjectID());
pPC->getPlayer()->sendPacket(&gcDII);
(*itr)->destroy();
SAFE_DELETE(*itr);
}
iList.clear();
}
else
{
filelog("EventBug.txt", "CGLotterySelectHandler : 복권 선택이 날라왔는데 완료한 퀘스트가 없다. -_-; %s[%d:%d]",
pPC->getName().c_str(), pPacket->getQuestLevel(), pPacket->getGiftID());
return;
}
GCNoticeEvent gcNE;
gcNE.setCode(NOTICE_EVENT_RESULT_LOTTERY);
if (bWinPrize(pPacket->getGiftID(), pPacket->getQuestLevel() ) )
{
// PlayerCreature 에 정보를 저장한다
pPC->setLotto(true);
pPC->setLottoRewardID(pPacket->getGiftID());
pPC->setLottoQuestLevel(pPacket->getQuestLevel());
gcNE.setParameter((uint)1);
}
else
{
// PlayerCreature 에 정보를 저장한다
pPC->setLotto(false);
pPC->setLottoRewardID(pPacket->getGiftID());
pPC->setLottoQuestLevel(pPacket->getQuestLevel());
gcNE.setParameter((uint)0);
}
pGP->sendPacket(&gcNE);
filelog("EventQuest.log", "CGLotterySelectHandler : %d to %s", gcNE.getParameter(), pPC->getName().c_str());
}
break;
case TYPE_FINISH_SCRATCH:
{
// 당첨된 경우 디비에 저장
if (pPC->isLotto() )
{
// 다시 false 로 만들어줘야함.
// 아님 담번 퀘스트에서 무조건 당첨으로 처리되니 ;;
pPC->setLotto(false);
Statement* pStmt = NULL;
BEGIN_DB
{
pStmt = g_pDatabaseManager->getConnection("DARKEDEN")->createStatement();
//.........这里部分代码省略.........