void CMiniMapDlg::AddStaticNpcIcon(CObject* pObject) { CNpc* pNpc = (CNpc*)pObject; switch( pNpc->GetNpcJob() ) { case NOTE_ROLE: case SIEGEFLAGROLE_RUSHEN: case SIEGEFLAGROLE_ZEVYN: case CANDLESTAND_ROLE: // 우체통은 미니맵 아이콘 그리지 않는다. // 080929 LYW --- MiniMapDlg : 공성전으로 인한, 길드 깃발 촛대의 아이콘은 미니맵에 출력하지 않는다. ( 송가람 ) return; case 30: case 31: { AddIcon( eMNMICON_LOADINGPOINT, pObject->GetID(), NULL, pObject, NULL, NULL ); } break; default: { AddIcon( eMNMICON_NORMALNPC, pObject->GetID(), NULL, pObject, NULL, NULL ); } break; } CBigMapDlg* dialog = GAMEIN->GetBigMapDialog(); if( dialog ) { dialog->AddStaticNpcIcon( pObject ); } }
BOOL CAction::ExcuteAction(CHero* pOperator) { switch(m_ActionKind) { case eActionKind_Skill: { // 100617 ShinJS 서버에서 스킬이 제거된 후 발동시킨다. if( HERO->GetCurrentSkill() > 0 ) return FALSE; cActiveSkillInfo* pNextSkill = (cActiveSkillInfo*)m_pActionInfo; // 080904 LYW --- SkillManager : 공성전 중 사용할 수 없는 스킬 체크. if( SIEGEWARFAREMGR->Is_CastleMap() == FALSE && SIEGEWARFAREMGR->IsSiegeWarfareZone() && SIEGEWARFAREMGR->GetState() > eSiegeWarfare_State_Before ) { if( SIEGEWARFAREMGR->IsFobiddenSkill(pNextSkill->GetIndex()) ) { WINDOWMGR->MsgBox( MBI_SKILL_SIEGEWAR_FORBIDDENSKILL, MBT_OK, CHATMGR->GetChatMsg(358) ) ; return TRUE; } } if(pNextSkill->IsInRange(*pOperator, m_ActionTarget)) { SKILLMGR->ExcuteSkillSYN(pOperator,&m_ActionTarget,pNextSkill); } else { // 실패 SKILLMGR->ExcuteSkillSYN(pOperator,&m_ActionTarget,TRUE); } } break; case eActionKind_Skill_RealExecute: { // 080904 LYW --- SkillManager : 공성전 중 사용할 수 없는 스킬 체크. if( SIEGEWARFAREMGR->Is_CastleMap() == FALSE && SIEGEWARFAREMGR->IsSiegeWarfareZone() && SIEGEWARFAREMGR->GetState() > eSiegeWarfare_State_Before ) { if( SIEGEWARFAREMGR->IsFobiddenSkill( ((cSkillInfo*)m_pActionInfo)->GetIndex()) ) { WINDOWMGR->MsgBox( MBI_SKILL_SIEGEWAR_FORBIDDENSKILL, MBT_OK, CHATMGR->GetChatMsg(358) ) ; return TRUE; } } SKILLMGR->RealExcuteSkillSYN(pOperator,&m_ActionTarget,(cSkillInfo*)m_pActionInfo); } break; case eActionKind_TalkToNpc: { // 조합/인챈트/강화/분해 중인 경우 불가 { cDialog* mixDialog = WINDOWMGR->GetWindowForID( ITMD_MIXDLG ); cDialog* enchantDialog = WINDOWMGR->GetWindowForID( ITD_UPGRADEDLG ); cDialog* reinforceDialog = WINDOWMGR->GetWindowForID( ITR_REINFORCEDLG ); cDialog* dissoloveDialog = WINDOWMGR->GetWindowForID( DIS_DISSOLUTIONDLG ); ASSERT( mixDialog && enchantDialog && reinforceDialog && dissoloveDialog ); const BOOL isOpen = mixDialog->IsActive() || enchantDialog->IsActive() || reinforceDialog->IsActive() || dissoloveDialog->IsActive(); if( isOpen ) { CHATMGR->AddMsg( CTC_SYSMSG, CHATMGR->GetChatMsg( 1104 ) ); break; } } CNpc* pNpc = (CNpc*)OBJECTMGR->GetObject( m_ActionTarget.GetTargetID() ); if( pNpc == NULL ) break; if((pNpc->GetNpcJob() == BOMUL_ROLE) && (pNpc->GetState() == eObjectState_Die)) { CHATMGR->AddMsg(CTC_SYSMSG, CHATMGR->GetChatMsg(918)); break; } // 080922 LYW --- CAction : 루쉔 깃발. else if( pNpc->GetNpcJob() == SIEGEFLAGROLE_RUSHEN || pNpc->GetNpcJob() == SIEGEFLAGROLE_ZEVYN ) { MSG_WORD msg ; msg.Category = MP_SIEGEWARFARE ; msg.Protocol = MP_SIEGEWARFARE_CHECK_FLAGUSE_SYN ; msg.dwObjectID = HEROID ; msg.wData = pNpc->GetNpcKind() ; NETWORK->Send( &msg, sizeof(MSG_WORD) ) ; //WINDOWMGR->MsgBox(MBI_SIEGEWARFLAG, MBT_YESNO, CHATMGR->GetChatMsg(1686)) ; break; } // 081125 LYW --- CAction : 리미트 던전 입장 게이트 체크. else if( pNpc->GetNpcJob() == LIMITDUNGEON_ROLE ) { cMapMoveDialog* const pDlg = GAMEIN->GetMapMoveDlg() ; if( pDlg ) { pDlg->SetUseCase(eLimitDungeon) ; pDlg->SetActive(TRUE) ; } break; } // 091014 ONS 스위치기능 NPC. else if( pNpc->GetNpcJob() == DUNGEON_SWITCH_ROLE ) { MSG_DWORD2 msg; msg.Category = MP_NPC; msg.Protocol = MP_NPC_SWITCHNPC_SYN; msg.dwObjectID = HEROID; msg.dwData1 = m_ActionTarget.GetTargetID(); //NPC Idx msg.dwData2 = pNpc->GetNpcUniqueIdx(); NETWORK->Send( &msg, sizeof( msg ) ); break; } // 100329 ShinJS --- 던전 입장 else if( DungeonMGR->IsDungeonEntranceNpc( pNpc->GetNpcJob() ) ) { cMapMoveDialog* const pDlg = GAMEIN->GetMapMoveDlg() ; if( pDlg ) { pDlg->SetUseCase(eDungeon, pNpc->GetID()) ; if( pDlg->GetMapListCount() > 0 ) { pDlg->SetActive(TRUE) ; } else { pDlg->SetActive(FALSE) ; WINDOWMGR->MsgBox( MBI_NOTICE, MBT_OK, CHATMGR->GetChatMsg(2297) ); } } break; } // 080822 LYW --- CAction : 소환 된 npc인지 확인한다. NPC_TOTALINFO* pTotalInfo = NULL ; pTotalInfo = pNpc->GetNpcTotalInfo() ; if( pTotalInfo ) { if( NPCRECALLMGR->Check_RecallNpc(pTotalInfo->dwRecallNpcIdx) ) { pNpc->OnClicked() ; break; } } // 090227 ShinJS --- 이동NPC인 경우 이동전 준비중인지 확인한다 if( pNpc->IsReadyToMove() ) { CHATMGR->AddMsg( CTC_SYSMSG, CHATMGR->GetChatMsg( 1907 ), pNpc->GetObjectName() ); break; } MSG_DWORD2 msg; msg.Category = MP_NPC; msg.Protocol = MP_NPC_SPEECH_SYN; msg.dwObjectID = HERO->GetID(); msg.dwData1 = m_ActionTarget.GetTargetID(); //NPC Idx msg.dwData2 = pNpc->GetNpcUniqueIdx(); OBJECTSTATEMGR->StartObjectState(HERO, eObjectState_Deal); NETWORK->Send(&msg, sizeof(msg)); pNpc->OnClicked(); } break; case eActionKind_TalkToOwner: //노점기능 정상화 될때까지 패치올리자. // CHATMGR->AddMsg( CTC_SYSMSG, "노점상 기능이 일시적으로 중단되었습니다. 이용에 불편을 드려 죄송합니다." ); STREETSTALLMGR->EnterStreetStall( m_ActionTarget.GetTargetID() ); break; case eActionKind_Move: MOVEMGR->SetHeroTarget( m_ActionTarget.GetTargetPosition(), TRUE); break; case eActionKind_EquipItem: { CItem* pItem = ITEMMGR->GetItem((DWORD)m_pActionInfo); if(pItem == NULL) break; GAMEIN->GetInventoryDialog()->UseItem(pItem); } break; case eActionKind_VehicleGetOn: { CVehicle* pVehicle = (CVehicle*)OBJECTMGR->GetSelectedObject(); if( !pVehicle || pVehicle->GetObjectKind() != eObjectKind_Vehicle ) { // 잘못된 데이터가 선택된경우 팝업창을 닫는다 CRidePopupMenuDlg* pDlg = GAMEIN->GetRidePopupMenuDlg(); if( pDlg ) pDlg->SetActive( FALSE ); break; } else if(0 == pVehicle->CanGetOn(HERO)) { break; } MSG_DWORD2 message; ZeroMemory( &message, sizeof( message ) ); message.Category = MP_VEHICLE; message.Protocol = MP_VEHICLE_MOUNT_ASK_SYN; message.dwObjectID = HEROID; message.dwData1 = pVehicle->GetID(); NETWORK->Send( &message, sizeof( message ) ); } default: ASSERT(0); break; } return TRUE; }
void CFishingManager::SendFishing_Ready(DWORD dwBaitIdx, POSTYPE BaitPos) { const EObjectState IsRestMode = OBJECTSTATEMGR->GetObjectState(HERO) ; if(IsRestMode == eObjectState_FishingResult) { OBJECTSTATEMGR->EndObjectState(HERO, eObjectState_FishingResult); OBJECTSTATEMGR->StartObjectState(HERO, eObjectState_None); } else if(IsRestMode != eObjectState_None) { CHATMGR->AddMsg( CTC_SYSMSG, CHATMGR->GetChatMsg(1524) ); goto FISHING_SENDREADY_ERROR; } if(m_bActive) { CHATMGR->AddMsg( CTC_SYSMSG, CHATMGR->GetChatMsg(1525) ); goto FISHING_SENDREADY_ERROR; } CObject* pObject = OBJECTMGR->GetSelectedObject(); if(pObject && pObject->GetObjectKind() == eObjectKind_Npc) { CNpc* pNpc = (CNpc*)pObject; if(pNpc->GetNpcJob() != FISHINGPLACE_ROLE) { CHATMGR->AddMsg( CTC_SYSMSG, CHATMGR->GetChatMsg(1526) ); goto FISHING_SENDREADY_ERROR; } if(HERO->GetWeaponEquipType() != eWeaponType_FishingPole) { CHATMGR->AddMsg( CTC_SYSMSG, CHATMGR->GetChatMsg(1532) ); goto FISHING_SENDREADY_ERROR; } if(pNpc->IsDied()) { CHATMGR->AddMsg( CTC_SYSMSG, CHATMGR->GetChatMsg(1524) ); goto FISHING_SENDREADY_ERROR; } if(0==dwBaitIdx) { CHATMGR->AddMsg( CTC_SYSMSG, CHATMGR->GetChatMsg(1527) ); goto FISHING_SENDREADY_ERROR; } // 거리제한 VECTOR3 vHeroPos; HERO->GetPosition(&vHeroPos) ; float fDistance = CalcDistanceXZ(&vHeroPos, &pObject->GetBaseMoveInfo()->CurPosition) ; if(MAX_FISHING_DISTANCE < fDistance) { CHATMGR->AddMsg(CTC_SYSMSG, CHATMGR->GetChatMsg(1548)) ; goto FISHING_SENDREADY_ERROR; } // 방향전환 VECTOR3 pos; pNpc->GetPosition(&pos); MOVEMGR->SetLookatPos(HERO,&pos,0,gCurTime); GAMEIN->GetFishingDlg()->SetLastFishingEndTime(0); MSG_FISHING_READY_SYN msg; msg.Category = MP_FISHING; msg.Protocol = MP_FISHING_READY_SYN; msg.dwObjectID = HEROID; msg.dwPlaceIdx = pNpc->GetID(); msg.dwPoleItemIdx = HERO->GetWearedItemIdx(eWearedItem_Weapon); msg.wBaitItemPos = BaitPos; msg.dwBaitItemIdx = dwBaitIdx; NETWORK->Send(&msg, sizeof(msg)); return; } CHATMGR->AddMsg( CTC_SYSMSG, CHATMGR->GetChatMsg(1526) ); goto FISHING_SENDREADY_ERROR; FISHING_SENDREADY_ERROR: GAMEIN->GetFishingDlg()->SetPushStartBtn(FALSE); GAMEIN->GetFishingDlg()->SetLastFishingEndTime(0); }