Пример #1
0
/// 타겟 필터링 검사
bool CSkillManager::CheckCastingTargetFilter( int iSkillIDX, CObjCHAR* pCaster, int iTargetObjIDX )
{
	if( pCaster == NULL )
		return false;

	int iSkillTargetType = CSkillManager::GetSkillTargetType( iSkillIDX );

	switch( iSkillTargetType )
	{
		case SKILL_TARGET_NONE:			
			return true;
	}


	CObjCHAR *pTargetCHAR = g_pObjMGR->Get_CharOBJ( iTargetObjIDX, false );

	int iTargetFilterType = SKILL_CLASS_FILTER( iSkillIDX );

	switch( iTargetFilterType )
	{
		case SKILL_TARGET_FILTER_SELF:
			return true;

		case SKILL_TARGET_FILTER_GROUP:
			{	
				/// 타겟이 있을경우.. 타겟이 우리편이 아니면.. false
				if( pTargetCHAR != NULL )
				{
					/// 파티원이 아니다.
					if( !CParty::GetInstance().IsPartyMember( g_pObjMGR->Get_ServerObjectIndex( iTargetObjIDX ) ))
					{				
						g_itMGR.AppendChatMsg( CStr::Printf("%s", STR_SKILL_TARGET_FILTER_NOTIFY_01 ), IT_MGR::CHAT_TYPE_SYSTEM );
						return false;
					}
				}
			}
			break;
		case SKILL_TARGET_FILTER_GUILD:
			{
				//AddMsgToChatWND ( CStr::Printf("%s", STR_SKILL_TARGET_FILTER_NOTIFY_02, g_dwRED,CChatDLG::CHAT_TYPE_SYSTEM );
			}
			break;
		case SKILL_TARGET_FILTER_FRIEND_ALL:
			{
				/// 타겟이 있을경우 나랑 동맹이 아닐경우 false
				if( pTargetCHAR != NULL )
				{
					if( CUserInputState::IsEnemy( pTargetCHAR ) )
					{
						g_itMGR.AppendChatMsg( CStr::Printf("%s", STR_SKILL_TARGET_FILTER_NOTIFY_03 ), IT_MGR::CHAT_TYPE_SYSTEM );
						return false;
					}
				}
			}
			break;
		case SKILL_TARGET_FILTER_MOB:
			{
				if( pTargetCHAR == NULL )
					return false;

				if( !pTargetCHAR->IsA( OBJ_MOB ) )
				{
					g_itMGR.AppendChatMsg( CStr::Printf("%s", STR_SKILL_TARGET_FILTER_NOTIFY_04 ), IT_MGR::CHAT_TYPE_SYSTEM );
					return false;
				}
			}
			break;
		case SKILL_TARGET_FILTER_ENEMY_ALL:
			{
				if( pTargetCHAR == NULL )
					return false;

				if( CUserInputState::IsEnemy( pTargetCHAR ) == false )
				{
					g_itMGR.AppendChatMsg( CStr::Printf("%s", STR_SKILL_TARGET_FILTER_NOTIFY_05 ), IT_MGR::CHAT_TYPE_SYSTEM );
					return false;
				}
			}
			break;
		case SKILL_TARGET_FILTER_ENEMY_PC:
			{
				if( pTargetCHAR == NULL )
					return false;

				/// 동맹이거나.. 아바타가 아닐경우는..
				if( CUserInputState::IsEnemy( pTargetCHAR ) == false || !pTargetCHAR->IsA( OBJ_AVATAR ) )
				{
					g_itMGR.AppendChatMsg( CStr::Printf("%s", STR_SKILL_TARGET_FILTER_NOTIFY_05 ), IT_MGR::CHAT_TYPE_SYSTEM );
					return false;
				}
			}
			break;

		case SKILL_TARGET_FILTER_ALL_PC:
			{
				if( pTargetCHAR == NULL )
					return false;

				if( !pTargetCHAR->IsUSER( ) )
				{
					g_itMGR.AppendChatMsg( CStr::Printf("%s", STR_SKILL_TARGET_FILTER_NOTIFY_06 ), IT_MGR::CHAT_TYPE_SYSTEM );
					return false;
				}
			}			
			break;
		case SKILL_TARGET_FILTER_ALL_CHAR:
			{
				if( pTargetCHAR == NULL )
					return false;

				if( !( pTargetCHAR->IsUSER() || pTargetCHAR->IsA( OBJ_MOB ) ) )
				{
					g_itMGR.AppendChatMsg( CStr::Printf("%s", STR_SKILL_TARGET_FILTER_NOTIFY_07 ), IT_MGR::CHAT_TYPE_SYSTEM );
					return false;
				}
			}
			break;

		/// 죽은 유져일 경우는 아군만
		case SKILL_TARGET_FILTER_DEAD_USER:
			{
				/// 타겟이 있을경우 나랑 동맹이 아닐경우 false
				if( pTargetCHAR != NULL )
				{
					if( CUserInputState::IsEnemy( pTargetCHAR ) )
					{
						g_itMGR.AppendChatMsg( CStr::Printf("%s", STR_SKILL_TARGET_FILTER_NOTIFY_03 ), IT_MGR::CHAT_TYPE_SYSTEM );
						return false;
					}
				}
			}
			break;

		default:
			break;
	}

	return true;
}
//--------------------------------------------------------------------------------
void CObjCHAR_Collision::UpdateHeight ( CObjCHAR * pObj )
//--------------------------------------------------------------------------------
{
	m_pObj = pObj;
	assert(m_pObj);

	if (pObj->GetPetMode() >= 0) { // if is on the PET, then ignore UpdateHeight
		return;
	}
			
	m_hNodeModel = m_pObj->GetZMODEL();
	int iObjTYPE = m_pObj->Get_TYPE();

	m_footCollisionPass = false;
	
	
	switch( iObjTYPE )
	{
		case OBJ_MORPH:
		case OBJ_ITEM:
		case OBJ_GROUND:
		case OBJ_CNST:
		case OBJ_NPC:		// OBJ_NPC >= character object ...~
		case OBJ_MOB:
			AdjustHeight_Monster();
			break;
		case OBJ_AVATAR:
			AdjustHeight_Other();			
			break;
		case OBJ_USER:
			if( g_GameDATA.m_bFilmingMode )
				AdjustHeight_Monster();
			else
				AdjustHeight_Avatar();
			break;
		case OBJ_CART:
			{
				CObjCART* pCart = (CObjCART*)pObj;
				CObjCHAR* pParent = pCart->GetParent();
				if( pParent )
				{
					/// 내 아바타일경우
					if( pParent->IsA( OBJ_USER ) )
						AdjustHeight_AvatarCart();
					else
						AdjustHeight_OtherCart();	

					pParent->Set_CurPOS( m_pObj->Get_CurPOS() );
				}
			}
			break;
		case OBJ_CGEAR:
		case OBJ_NRIDE:
			{
				CObjCastleGear* pCgear = (CObjCastleGear*)pObj;
				CObjCHAR* pParent = pCgear->GetParent();
				if( pParent )
				{
					/// 내 아바타일경우
					if( pParent->IsA( OBJ_USER ) )
						AdjustHeight_AvatarCgear();
					else
						AdjustHeight_OtherCgear();	

					pParent->Set_CurPOS( m_pObj->Get_CurPOS() );
				}
			}
			break;
	}	
}