当前位置: 首页>>代码示例>>C++>>正文


C++ CNpc::GetNpcJob方法代码示例

本文整理汇总了C++中CNpc::GetNpcJob方法的典型用法代码示例。如果您正苦于以下问题:C++ CNpc::GetNpcJob方法的具体用法?C++ CNpc::GetNpcJob怎么用?C++ CNpc::GetNpcJob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CNpc的用法示例。


在下文中一共展示了CNpc::GetNpcJob方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: AddStaticNpcIcon

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 );
	}
}
开发者ID:xianyinchen,项目名称:LUNAPlus,代码行数:34,代码来源:MiniMapDlg.cpp

示例2: ExcuteAction

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;
  			}
//.........这里部分代码省略.........
开发者ID:xianyinchen,项目名称:LUNAPlus,代码行数:101,代码来源:CAction.cpp

示例3: SendFishing_Ready

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);
}
开发者ID:xianyinchen,项目名称:LUNAPlus,代码行数:86,代码来源:FishingManager.cpp


注:本文中的CNpc::GetNpcJob方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。