void CGSelectWayPointHandler::executeEnterQuestZone(CGSelectWayPoint* pPacket , Player* pPlayer, int targetDynamicZoneType) throw(Error) { __BEGIN_TRY #ifdef __GAME_SERVER__ GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pPlayer); Assert(pGamePlayer != NULL); Creature* pCreature = pGamePlayer->getCreature(); Assert(pCreature != NULL); PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pCreature); Assert(pPC != NULL); bool bQuestCondition = pPC->getGQuestManager()->canEnterDynamicZone(pPacket->getZoneID()); DynamicZoneGroup* pDynamicZoneGroup = g_pDynamicZoneManager->getDynamicZoneGroup(targetDynamicZoneType); Assert(pDynamicZoneGroup != NULL); bool bDynamicZoneAvailable = pDynamicZoneGroup->canEnter(); if (bQuestCondition && bDynamicZoneAvailable ) { DynamicZone* pDynamicZone = pDynamicZoneGroup->getAvailableDynamicZone(); transportCreature(pPC, pDynamicZone->getZoneID(), 15, 15, true); pPC->getGQuestManager()->enterDynamicZone(pPacket->getZoneID()); } #endif __END_CATCH }
//////////////////////////////////////////////////////////////////////////////// // 액션을 실행한다. //////////////////////////////////////////////////////////////////////////////// void ActionEnterQuestZone::execute (Creature * pNPC , Creature * pCreature) throw(Error) { __BEGIN_TRY __BEGIN_DEBUG Assert(pCreature != NULL); Assert(pCreature->isPC()); GamePlayer* pGamePlayer = dynamic_cast<GamePlayer*>(pCreature->getPlayer()); PlayerCreature* pPC = dynamic_cast<PlayerCreature*>(pCreature); Assert(pPC != NULL); bool bTransport = true; #if defined(__PAY_SYSTEM_ZONE__) || defined(__PAY_SYSTEM_FREE_LIMIT__) try { ZoneInfo* pZoneInfo = g_pZoneInfoManager->getZoneInfo(m_ZoneID); // 유료존인데 유료사용자가 아니면... if (pZoneInfo==NULL || pZoneInfo->isPayPlay() && !(pGamePlayer->isPayPlaying() || pGamePlayer->isFamilyFreePass())) { string connectIP = pGamePlayer->getSocket()->getHost(); // 유료 서비스 사용이 가능한가? if (pGamePlayer->loginPayPlay(connectIP, pGamePlayer->getID())) { sendPayInfo(pGamePlayer); } else { // 유료 서비스 사용 불가인 경우 GCSystemMessage gcSystemMessage; if (g_pConfig->getPropertyInt("IsNetMarble")==0) { gcSystemMessage.setMessage(g_pStringPool->getString(STRID_CANNOT_ENTER_PAY_ZONE )); } else { gcSystemMessage.setMessage(g_pStringPool->getString(STRID_CANNOT_ENTER )); } pGamePlayer->sendPacket (&gcSystemMessage); bTransport = false; } } } catch (NoSuchElementException&) { } #endif if (bTransport) { // Dynamic 존인지 확인. int targetDynamicZoneType = g_pDynamicZoneInfoManager->getDynamicZoneTypeByZoneID(m_ZoneID); if (targetDynamicZoneType != DYNAMIC_ZONE_MAX ) { // Dynamic 존일 경우 DynamicZoneGroup* pDynamicZoneGroup = g_pDynamicZoneManager->getDynamicZoneGroup(targetDynamicZoneType); Assert(pDynamicZoneGroup != NULL); DynamicZone* pDynamicZone = pDynamicZoneGroup->getAvailableDynamicZone(); Assert(pDynamicZone != NULL); transportCreature(pCreature, pDynamicZone->getZoneID(), m_X, m_Y, true); if (targetDynamicZoneType == DYNAMIC_ZONE_ALTER_OF_BLOOD ) { DynamicZoneAlterOfBlood* pAlterOfBlood = dynamic_cast<DynamicZoneAlterOfBlood*>(pDynamicZone); Assert(pAlterOfBlood != NULL); pAlterOfBlood->setRace(pPC->getRace()); } } else { // Dynamic 존이 아닐 경우 transportCreature(pCreature, m_ZoneID, m_X, m_Y, true); } } else { GCNPCResponse response; response.setCode(NPC_RESPONSE_QUIT_DIALOGUE); pGamePlayer->sendPacket(&response); } __END_DEBUG __END_CATCH }