void CParty::SendToSameContinentPC(CNetMsg::SP& msg, int nExcludeCharIndex) { CPC *pc = PCManager::instance()->getPlayerByCharIndex(nExcludeCharIndex); if (!pc) return ; int continent_no = -1; int i; if(!pc->m_pZone) return ; CPartyMember* pMember = NULL; bool IsPartyMemberinSameContinent = false; continent_no = pc->m_pZone->m_iContinent_no; for(i = 0; i < MAX_PARTY_MEMBER; i++) { if(m_listMember[i] != NULL) { pMember = (CPartyMember*)m_listMember[i]; if(pMember != NULL) { if(pMember->GetCharIndex() != nExcludeCharIndex) { CPC *pPC = pMember->GetMemberPCPtr(); if(pPC != NULL) { if(pPC->m_pZone->m_iContinent_no == continent_no) { if( pPC->m_plusEffect & CLIENT_OPTION_WARP ) { CNetMsg::SP rmsg(new CNetMsg); WarpErrorMsg(rmsg, MSG_WARP_ERROR_NOTALLOW, pPC->GetName()); SEND_Q( rmsg, pc->m_desc ); IsPartyMemberinSameContinent = true; } else { if(!pPC->m_pZone->IsGuildRoom() && !pPC->m_pZone->IsPartyRaidZone()) { IsPartyMemberinSameContinent = true; SEND_Q(msg, pPC->m_desc); } } } } } } } } if(!IsPartyMemberinSameContinent) // 파티는 있으나 모든 파티원들이 같은 대륙에 없을 때..에러메세지 발송 { PartyRecallErrorMsg(msg, MSG_EX_PARTY_RECALL_ERROR_NOT_FOUND_PARTY_PLAYER); SEND_Q(msg, pc->m_desc); } }
void CParty::SetEndParty() { updateCalcMember(); { // 파티 해체 알림 CNetMsg::SP rmsg(new CNetMsg); PartyMsg(rmsg, MSG_PARTY_END); SendToAllPC(rmsg); } // 초대 거절 if (GetRequestIndex() > 0) { CPC* pRequestPC = PCManager::instance()->getPlayerByCharIndex(GetRequestIndex()); if (pRequestPC) { CNetMsg::SP rmsg(new CNetMsg); PartyMsg(rmsg, MSG_PARTY_REJECT_SRC); SEND_Q(rmsg, pRequestPC->m_desc); } SetRequest(-1, ""); } for(int i=0; i < MAX_PARTY_MEMBER; i++) { CPartyMember* pMember = (CPartyMember*)GetMemberByListIndex(i); if(pMember) { CPC* pc = pMember->GetMemberPCPtr(); if(pc && (pc->m_pZone->IsExpedRaidZone() || pc->m_pZone->IsPartyRaidZone()) && pc->m_nJoinInzone_ZoneNo >=0 && pc->m_nJoinInzone_RoomNo >= 0) { CNetMsg::SP rmsg(new CNetMsg); RaidInzoneQuitReq(rmsg,1,0); do_Raid(pc, rmsg); } } } CPartyMember* pMember=NULL; for(int i=0; i < MAX_PARTY_MEMBER; i++) { pMember = (CPartyMember*)GetMemberByListIndex(i); if(pMember) SetMemberPCPtr(pMember->GetCharIndex(), NULL); delete m_listMember[i]; m_listMember[i] = NULL; } }
bool CParty::ChangeBoss(const char* strNewBossName) { int i; for (i = 0; i < MAX_PARTY_MEMBER; i++) { if (m_listMember[i] && m_listMember[i]->m_nLevel > 0 ) { if (strcmp(m_listMember[i]->GetCharName(), strNewBossName) == 0) { CPartyMember* pMember = m_listMember[0]; m_listMember[0] = m_listMember[i]; m_listMember[i] = pMember; gserver->m_listParty.erase(pMember->GetCharIndex()); gserver->m_listParty.insert(map_listparty_t::value_type(m_listMember[0]->GetCharIndex(), this)); return true; } } } return false; }
void CParty::SetPartyRecallUseInfo(int zoneID, CPos& pos, int guildIndex, char cIsInCastle, int nExcludeCharIndex) { int i; CPartyMember* pMember = NULL; for (i = 0; i < MAX_PARTY_MEMBER; i++) { if(m_listMember[i] != NULL) { pMember = (CPartyMember*)m_listMember[i]; if(pMember->GetCharIndex() != nExcludeCharIndex) { CPC *pPC = TO_PC(pMember->GetMemberPCPtr()); if(pPC != NULL && pPC->m_index > 0 && pPC->m_level>0 ) { pPC->getPartyRecallInfo()->setPartyRecallInfo(zoneID, pos, guildIndex, cIsInCastle); } } } } }
void CParty::SendToPartyRecallPC(CNetMsg::SP& msg, int nReqIndex) { CPC* reqPC = PCManager::instance()->getPlayerByCharIndex(nReqIndex); if(!reqPC) return ; int i; CPartyMember* pMember = NULL; for (i = 0; i < MAX_PARTY_MEMBER; i++) { if(m_listMember[i] != NULL) { pMember = (CPartyMember*)m_listMember[i]; if(pMember != NULL) { if(pMember->GetCharIndex() != nReqIndex) { CPC *pPC = pMember->GetMemberPCPtr(); if(pPC != NULL && pPC->m_index > 0 && pPC->m_level>0 ) { if( pPC->m_plusEffect & CLIENT_OPTION_WARP ) { CNetMsg::SP rmsg(new CNetMsg); WarpErrorMsg(rmsg, MSG_WARP_ERROR_NOTALLOW, pPC->GetName()); SEND_Q( rmsg, reqPC->m_desc ); } else { if(STATE(pPC->m_desc) == CON_PLAYING) { m_warPartyRecall.insert(pMember->GetCharIndex()); } SEND_Q(msg, pPC->m_desc); } /////////소환거부자에게는 메세지 보내지 않음///////// } } } } } }
//서버 다운 수정(09.05.11) void CParty::SendToAllPC(CNetMsg::SP& msg, int nExcludeCharIndex) { int i; CPartyMember* pMember = NULL; for (i = 0; i < MAX_PARTY_MEMBER; i++) { if(m_listMember[i] != NULL) { pMember = (CPartyMember*)m_listMember[i]; if(pMember != NULL) { if(pMember->GetCharIndex() != nExcludeCharIndex) { CPC *pPC = TO_PC(pMember->GetMemberPCPtr()); if(pPC != NULL && pPC->m_index > 0 && pPC->m_level>0 ) { SEND_Q(msg, pPC->m_desc); } } } } } }
//서버 다운 수정(09.05.11) void CParty::SendToPCInSameZone(int nZone, int nArea, CNetMsg::SP& msg) { int i; CPartyMember* pMember = NULL; for (i = 0; i < MAX_PARTY_MEMBER; i++) { if(m_listMember[i] != NULL) { pMember = (CPartyMember*)m_listMember[i]; if(pMember != NULL) { CPC *pPC = pMember->GetMemberPCPtr(); if(pPC != NULL && pPC->m_index>0 && pPC->m_level > 0 && pPC->m_pZone && pPC->m_pArea && pPC->m_pZone->m_index == nZone && pPC->m_pArea->m_index == nArea) { SEND_Q(msg, pPC->m_desc); } } } } }
void ProcDeadQuestProc(CPC* dpc, CPC* opc) { if(opc == NULL) return; if(!opc->IsParty()) // 파티가 없으면 나만 퀘스트 업데이트 { CQuest* pQuest = NULL; CQuest* pQuestNext = opc->m_questList.GetNextQuest(NULL, QUEST_STATE_RUN); while((pQuest = pQuestNext)) { pQuestNext = opc->m_questList.GetNextQuest(pQuestNext, QUEST_STATE_RUN); switch(pQuest->GetQuestType0()) { case QTYPE_KIND_REPEAT: case QTYPE_KIND_COLLECTION: case QTYPE_KIND_DEFEAT: case QTYPE_KIND_SAVE: { if(pQuest->GetPartyScale() == QTYPE_SCALE_PERSONAL || pQuest->GetPartyScale() == QTYPE_SCALE_PARTY) pQuest->QuestUpdateData(opc, dpc); } break; default: break; } } return ; } else { int i; CPartyMember* pPartyMember = NULL; CPC* pMember = NULL; for(i = 0; i < MAX_PARTY_MEMBER; i++) { pPartyMember = opc->m_party->GetMemberByListIndex(i); if(pPartyMember && pPartyMember->GetMemberPCPtr()) { pMember = pPartyMember->GetMemberPCPtr(); if(opc->m_pArea->FindCharInCell(opc, pMember->m_index, MSG_CHAR_PC)) { CQuest* pQuest = NULL; CQuest* pQuestNext = pMember->m_questList.GetNextQuest(NULL, QUEST_STATE_RUN); while((pQuest = pQuestNext)) { pQuestNext = pMember->m_questList.GetNextQuest(pQuestNext, QUEST_STATE_RUN); switch(pQuest->GetQuestType0()) { case QTYPE_KIND_REPEAT: case QTYPE_KIND_COLLECTION: case QTYPE_KIND_DEFEAT: case QTYPE_KIND_SAVE: { if(pQuest->GetPartyScale() == QTYPE_SCALE_PERSONAL || pQuest->GetPartyScale() == QTYPE_SCALE_PARTY) pQuest->QuestUpdateData(pMember, dpc); } break; default: break; } } } } } } }
void ProcDeadQuestProc(CPC * opc,CNPC * df, int partyScale) { #ifdef HUNT_QUEST_COMPLETE_FOR_OTHER_PARTYMEMBER // 파티 스케일이 어떤것이 넘어오든 상관없다. // 막타친사람이 원정대인지, 파티인지, 솔로인지만 체크한다. // 원정대일 경우 원정대 퀘스트만 수행된다. 솔로퀘스트도 수행이 안된다. // 솔로나 파티일경우 자기 퀘스트도 되고, 파티원 퀘스트도 같이 된다. if(opc->IsExped()) { // 원정대 퀘스트 int i, j; CPC* pExpedPC = NULL; if(opc->m_Exped) { for(i = 0; i < MAX_EXPED_GROUP; i++) { for(j = 0; j < MAX_EXPED_GMEMBER; j++) { pExpedPC = opc->m_Exped->GetMemberPCPtr(i, j); if(pExpedPC == NULL) continue; if(opc->m_pArea->FindCharInCell(opc, pExpedPC->m_index, MSG_CHAR_PC)) { CQuest* pQuest = NULL; CQuest* pQuestNext = pExpedPC->m_questList.GetNextQuest(NULL, QUEST_STATE_RUN); while((pQuest = pQuestNext)) { pQuestNext = pExpedPC->m_questList.GetNextQuest(pQuestNext, QUEST_STATE_RUN); switch(pQuest->GetQuestType0()) { case QTYPE_KIND_REPEAT: case QTYPE_KIND_COLLECTION: case QTYPE_KIND_DEFEAT: case QTYPE_KIND_SAVE: { if(pQuest->GetPartyScale() == QTYPE_SCALE_BATTLEGROUP) pQuest->QuestUpdateData(pExpedPC, df); } break; default: break; } } } } } } return ; } else { if(!opc->IsParty()) // 파티가 없으면 나만 퀘스트 업데이트 { CQuest* pQuest = NULL; CQuest* pQuestNext = opc->m_questList.GetNextQuest(NULL, QUEST_STATE_RUN); while((pQuest = pQuestNext)) { pQuestNext = opc->m_questList.GetNextQuest(pQuestNext, QUEST_STATE_RUN); switch(pQuest->GetQuestType0()) { case QTYPE_KIND_REPEAT: case QTYPE_KIND_COLLECTION: case QTYPE_KIND_DEFEAT: case QTYPE_KIND_SAVE: { if(pQuest->GetPartyScale() == QTYPE_SCALE_PERSONAL || pQuest->GetPartyScale() == QTYPE_SCALE_PARTY) pQuest->QuestUpdateData(opc, df); } break; default: break; } } return ; } else { int i; CPartyMember* pPartyMember = NULL; CPC* pMember = NULL; for(i = 0; i < MAX_PARTY_MEMBER; i++) { pPartyMember = opc->m_party->GetMemberByListIndex(i); if(pPartyMember && pPartyMember->GetMemberPCPtr()) { pMember = pPartyMember->GetMemberPCPtr(); if(opc->m_pArea->FindCharInCell(opc, pMember->m_index, MSG_CHAR_PC)) { CQuest* pQuest = NULL; CQuest* pQuestNext = pMember->m_questList.GetNextQuest(NULL, QUEST_STATE_RUN); while((pQuest = pQuestNext)) { pQuestNext = pMember->m_questList.GetNextQuest(pQuestNext, QUEST_STATE_RUN); switch(pQuest->GetQuestType0()) { case QTYPE_KIND_REPEAT: case QTYPE_KIND_COLLECTION: case QTYPE_KIND_DEFEAT: case QTYPE_KIND_SAVE: { if(pQuest->GetPartyScale() == QTYPE_SCALE_PERSONAL || pQuest->GetPartyScale() == QTYPE_SCALE_PARTY) pQuest->QuestUpdateData(pMember, df); } break; default: break; } } } } } } } #else // HUNT_QUEST_COMPLETE_FOR_OTHER_PARTYMEMBER CQuest* pQuest = NULL; CQuest* pQuestNext = opc->m_questList.GetNextQuest(NULL, QUEST_STATE_RUN); while ((pQuest = pQuestNext)) { pQuestNext = opc->m_questList.GetNextQuest(pQuestNext, QUEST_STATE_RUN); // 퀘스트 있고 수행중이고 반복, 수집, 격파, 구출 퀘스트이면 if( (partyScale == QTYPE_SCALE_PARTY && pQuest->GetPartyScale() != QTYPE_SCALE_PARTY ) #ifdef _BATTLEGROUP_QUEST_BUG_PIX || (partyScale == QTYPE_SCALE_BATTLEGROUP && pQuest->GetPartyScale() != QTYPE_SCALE_BATTLEGROUP ) #endif // _BATTLEGROUP_QUEST_BUG_PIX ) { return; } switch (pQuest->GetQuestType0() ) { case QTYPE_KIND_REPEAT: case QTYPE_KIND_COLLECTION: case QTYPE_KIND_DEFEAT: case QTYPE_KIND_SAVE: pQuest->QuestUpdateDataForParty(opc, df); break; default: break; } } #endif // HUNT_QUEST_COMPLETE_FOR_OTHER_PARTYMEMBER }