示例#1
0
void CObjUSER::AddSummonedMob( int iIndex, int iSkillIDX )
{ 
	/// If you already have him.
	std::list< SummonMobInfo >::iterator begin = m_SummonedMobList.begin();

	for( ; begin != m_SummonedMobList.end() ; ++begin )
	{
		SummonMobInfo& monInfo = *begin;

		if( monInfo.iIndex == iIndex )
			return;
	}
		
	///if( itor == m_SummonedMobList.end() )
	{
		SummonMobInfo summonMobInfo;
		summonMobInfo.iIndex	= iIndex;
		summonMobInfo.iSkillIDX = iSkillIDX;

		CObjCHAR* pObj = g_pObjMGR->Get_ClientCharOBJ( iIndex, false );
		if( pObj )
		{
			m_iSummonMobCapacity += NPC_NEED_SUMMON_CNT( pObj->Get_CharNO() );

			summonMobInfo.iCapacity = NPC_NEED_SUMMON_CNT( pObj->Get_CharNO() );
			m_SummonedMobList.push_back( summonMobInfo ); 
		}
	}
}
//--------------------------------------------------------------------------------
void CObjCHAR_Collision::AdjustHeight_Monster (void)
//--------------------------------------------------------------------------------
{
		
	::getPosition( m_hNodeModel, m_vCurrent );
	::getModelCOMPositionWorld( m_hNodeModel, m_vCOM );
		
	int nZonePatchX, nZonePatchY;
	float fZonePatchSize;

	fZonePatchSize = (GRID_COUNT_PER_PATCH_AXIS * fGRID_SIZE );
	
    nZonePatchX = (short) ( m_vCurrent.x / fZonePatchSize );
	nZonePatchY = (short) ( m_vCurrent.y / fZonePatchSize );
	
	CMAP_PATCH *pPatch;
	pPatch = g_pTerrain->GetPATCH(nZonePatchX , nZonePatchY);
	
	if(pPatch)
	{


		if(CollisionResponseMonster(pPatch))
		{

			m_vCurrent.z = g_pTerrain->GetHeightTop( m_vCurrent.x, m_vCurrent.y ) + m_pObj->m_fAltitude;
			m_pObj->ResetCUR_POS( m_vCurrent);	
			CObjCHAR *pTarget = (CObjCHAR*)m_pObj->Get_TARGET(); 
    		if(pTarget != NULL)
			m_pObj->Restart_MOVE_AL( pTarget->Get_CurPOS() );
		}
		else
		{
			m_vCurrent.z = g_pTerrain->GetHeightTop( m_vCOM.x, m_vCOM.y ) + m_pObj->m_fAltitude;
			m_pObj->ResetCUR_POS( m_vCurrent );	
		}
	
	}
	else
	{
		m_vCurrent.z = g_pTerrain->GetHeightTop( m_vCOM.x, m_vCOM.y ) + m_pObj->m_fAltitude;
		m_pObj->ResetCUR_POS( m_vCurrent );	
	}
	
	
}
示例#3
0
bool classPARSESTR::CheckEventNPCZeroVAR(int iNpcNum, int iNpcZeroVAR)
{
		int npc = 0;
		int npcVar0 = 0;
	
		CObjCHAR * pNPC = (CObjCHAR*)g_pObjMGR->Get_ClientCharOBJBySTBIndex(iNpcNum);

		if(pNPC)
		{
			npcVar0 = QF_getNpcQuestZeroVal(pNPC->Get_INDEX());
		}
		else
		{
			g_itMGR.AppendChatMsg( CStr::Printf("%d NPC로 이동한 다음에 치트를 사용해보세요..^^",  iNpcNum), IT_MGR::CHAT_TYPE_SYSTEM );
		}
		if( npcVar0 == iNpcZeroVAR )
			return 1;
		else
			return 0;
};
示例#4
0
unsigned char _stdcall IsPKable(classUSER* user, unsigned short targetid){
	CObjCHAR* targetObj = g_pObjMGR->Get_CharOBJ(targetid, true);	// CheckHP = true -> no dead mobs plx :D
	if(!targetObj) return false;
	if(!targetObj->IsUSER()) return true;

	classUSER* target = static_cast<classUSER*>(targetObj);
	CustomAvatarData* userData = CustomAvatarData::Get(user);
	CustomAvatarData* targetData = CustomAvatarData::Get(targetObj);

	if(targetData->pDuel.mInDuel || userData->pDuel.mInDuel){
		if(!targetData->pDuel.mIsDead && !userData->pDuel.mIsDead){
			if(targetData->pDuel.mRequestID == user->Get_INDEX() && userData->pDuel.mRequestID == target->Get_INDEX())
				return true;
		}

		return false;
	}

	return g_TblZONE[target->m_nZoneNO][18].GetINT() != PVP_CANT;
}
示例#5
0
void CTargetMenu::Show()
{
	CObjCHAR *pObj = (CObjCHAR*)g_pObjMGR->Get_CharOBJ( m_iTargetAvatarID, true );

	if( pObj == NULL )
		return;
	
	///Target이 아바타일경우에만 현재 스크린 좌표에 따라서 윈도우의 위치 조정
	if( pObj->Get_TYPE() == OBJ_AVATAR ) 
	{
		D3DVECTOR   PosSCR;
		POINT		ptNew;
		pObj->GetScreenPOS (PosSCR);	
		ptNew.x = (int)PosSCR.x - GetWidth() / 2;
		ptNew.y = (int)PosSCR.y - ( GetHeight() * 2 / 3 );
		MoveWindow( ptNew );
		CTDialog::Show();
	}
	SetEnableChild( IID_BTN_FRIEND, false );
	SetEnableChild(	IID_BTN_INFORMATION,false );

}
示例#6
0
void RunBossScript(){
	int bossIcon = gCurrentInstance->mGame->mBossIcon;
	if(!bossIcon) return;

	int monsterID1;

	if(gCurrentInstance->mID == 1)
		monsterID1 = 2029;
	else if(gCurrentInstance->mID == 2)
		monsterID1 = 2037;
	else if(gCurrentInstance->mID == 3)
		monsterID1 = 2019;

	for(int i = 1; i <= 65535; i++){
		CObjCHAR* boss = CObjMGR::Instance()->Get_ClientCharOBJ(i, false);

		if(!boss || ((boss->GetCharNO() != monsterID1) && (boss->GetCharNO() != (monsterID1 + 1))))
			continue;

		if(boss->GetCharNO() == monsterID1) 
			bossIcon++;

		int hp = boss->GetHP();
		if(hp <= 0) continue;

		int maximumHP = boss->GetMaxHP();
		float percentage = (100.0f * hp / maximumHP);
		int leftPosition = 235 + 20;
		int topPosition = 75;

		tagRECT pos;
		SetRect(&pos, leftPosition + 56, topPosition + 19, leftPosition + 309, topPosition + 42);

		ResetTransform(0, 0);
		DrawImpl::Instance()->Draw2DW(leftPosition + 56.0f, topPosition + 19.0f, 0.0f, 260, IMAGE_RES_UI, gBossGUI);
		ResetTransform(0, 0);
		DrawImpl::Instance()->Draw2DW(leftPosition + 58.0f, topPosition + 22.0f, 0.0f, 249 * hp / maximumHP, IMAGE_RES_UI, gBossGUI + 1);		
		ResetTransform(0, 0);
		DrawImpl::Instance()->Draw2D(leftPosition, topPosition, IMAGE_RES_UI, bossIcon, 0xFFFFFFFF);
		ResetTransform(0, 0);
		drawFont(GameDATA->m_hFONT[FONT_NORMAL_OUTLINE], 1, &pos, 0xFFFFFFFF, DT_CENTER | DT_VCENTER, String("%1%2").arg(percentage).arg("%"));

		return;
	}
}
示例#7
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;
}
示例#8
0
/// @todo 타겟의 HP를 체크해야하는가?
/// 당연히 죽은놈한테 쏠수는 없으니 해야될듯
/*static*/ bool CSkillManager::CheckCastingTarget( int iSkillIDX, CObjCHAR* pCaster, int iTargetObjIDX )
{
	if( pCaster == NULL )
		return false;

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

	int iSkillTargetType = CSkillManager::GetSkillTargetType( iSkillIDX );

	switch( iSkillTargetType )
	{
	case SKILL_TARGET_NONE:			
		return true;

	case SKILL_TARGET_OBJECT:	
		{
			/// 스킬이 리절렉션이라면 HP체크없이 타겟을 얻어돈다.
			if( SKILL_TYPE( iSkillIDX ) == SKILL_ACTION_RESURRECTION )
			{
				pTargetCHAR = g_pObjMGR->Get_CharOBJ( iTargetObjIDX, false );
			}

			if( pTargetCHAR == NULL )
				return false;

			//06. 03. 03 - 김주현 : 스킬이 상태값을 가지고 있고 그 대상이 시전할려고 하는 HP 보다 적다면
			//스킬 시전을 안하게 막았다, 차후에 서버에서 처리해줘야함...
			for(int iColumn = 0 ; iColumn < 2; iColumn++)
			{
				if( SKILL_INCREASE_ABILITY_VALUE( iSkillIDX, iColumn ) )
				{
					int iIncreaseAbilityValue = 0;
					switch( SKILL_TYPE( iSkillIDX) )
					{
					case 8:
					case 9:
					case 10:
					case 11:
						iIncreaseAbilityValue = SKILL_INCREASE_ABILITY_VALUE( iSkillIDX, iColumn ) * ( g_pAVATAR->Get_INT() + 300 ) / 315;
						break;
					default:
						iIncreaseAbilityValue = SKILL_INCREASE_ABILITY_VALUE( iSkillIDX, iColumn );
						break;
					}

					if(SKILL_INCREASE_ABILITY(iSkillIDX,iColumn) == 16 )
						if(iIncreaseAbilityValue < 0)
							if(abs(iIncreaseAbilityValue) >= pTargetCHAR->Get_HP())
								return false;
				}
			}
		}		
		return true;

	case SKILL_TARGET_GROUND:			
		return true;

	case SKILL_TARGET_PB:			
		return true;

	case SKILL_TARGET_SCREEN:			
		return true;

	case SKILL_TARGET_ZONE:			
		return true;

	case SKILL_TARGET_SERVER:						
		return true;

	default:
		break;
	}

	return false;
}
void CObjCHAR_Collision2NPC::CollisionDetectionAvatar2Mob(CObjCHAR * pObjAvater)
{
	m_iObjTYPE = pObjAvater->Get_TYPE();

	if((m_iObjTYPE != OBJ_AVATAR) && (m_iObjTYPE != OBJ_USER) && (m_iObjTYPE != OBJ_CART) && (m_iObjTYPE != OBJ_CGEAR) && (m_iObjTYPE != OBJ_NRIDE))
		return;

	if (pObjAvater->GetPetMode() >= 0) { // if is on the PET, then ignore UpdateHeight
		return;
	}

	CObjCHAR *pObjectChar;
	HNODE hNPCBoneNode;
    	
	float fAvaterPositionXYZ[3];
	float fAvaterFrontPositionXYZ[3];
	float fPreAvaterRotaitonWXYZ[4];
	float fPreAvaterPositionXYZ[3];
	float fPreAvaterFrontPositionXYZ[3];

	float fBoneRotationWXYZ[4];
	float fBonePositionXYZ[3];
	float fPreBoneRotaitonWXYZ[4];
	float fPreBonePositionXYZ[3];

    D3DXVECTOR4 vlocalPos, vWorldPos;
    D3DXMATRIX boneModelM, bonePreModelM, invBonePreModelM;
	D3DXMATRIX boneModelRotationM; 
	
	Initialize(pObjAvater);
	
	::getPosition(m_hNodeModel, fAvaterPositionXYZ);
	fAvaterFrontPositionXYZ[0] = fAvaterPositionXYZ[0] + m_vLocalCollisionPoint.x;
	fAvaterFrontPositionXYZ[1] = fAvaterPositionXYZ[1] + m_vLocalCollisionPoint.y;
	fAvaterFrontPositionXYZ[2] = fAvaterPositionXYZ[2] + m_vLocalCollisionPoint.z;

	classDLLNODE< int > *pNode;
	pNode = g_pObjMGR->m_CharLIST.GetHeadNode ();
	
	while( pNode ) 
	{
		if ( g_pObjMGR->m_pOBJECTS[ pNode->DATA ] ) 
		{			
			if (g_pObjMGR->m_pOBJECTS[ pNode->DATA ]) {

				if(g_pObjMGR->m_pOBJECTS[ pNode->DATA ]->IsNPC())
				{
					pObjectChar = (CObjCHAR*)g_pObjMGR->m_pOBJECTS[ pNode->DATA ];
					if(pObjectChar->m_bCollisionOnOff)
					{
						hNPCBoneNode = ::getBone(pObjectChar->GetZMODEL(), pObjectChar->m_iCollisionBoneIndex);
						getRotationQuad(hNPCBoneNode, fBoneRotationWXYZ);
						getPosition(hNPCBoneNode, fBonePositionXYZ);
						
						D3DXMatrixRotationQuaternion(&boneModelM, &D3DXQUATERNION(fBoneRotationWXYZ[1], fBoneRotationWXYZ[2], fBoneRotationWXYZ[3], fBoneRotationWXYZ[0]));
						boneModelM._41 = fBonePositionXYZ[0];	boneModelM._42 = fBonePositionXYZ[1];	boneModelM._43 = fBonePositionXYZ[2];

//						::InputSceneOBB2(fBonePositionXYZ, fBoneRotationWXYZ, pObjectChar->m_fCollisionBoxLength[0], pObjectChar->m_fCollisionBoxLength[1], pObjectChar->m_fCollisionBoxLength[2]);
//						::InputSceneSphere(fAvaterFrontPositionXYZ[0], fAvaterFrontPositionXYZ[1], fAvaterFrontPositionXYZ[2], 50.0f);
   										
						if(CollisionPosition2OBBOnOff(&boneModelM, pObjectChar->m_fCollisionBoxLength[0], pObjectChar->m_fCollisionBoxLength[1], pObjectChar->m_fCollisionBoxLength[2], &D3DXVECTOR3(fAvaterFrontPositionXYZ[0], fAvaterFrontPositionXYZ[1], fAvaterFrontPositionXYZ[2])))
						{
							::getPrevPosition (hNPCBoneNode, fPreBonePositionXYZ);
							::getPrevRotation (hNPCBoneNode, fPreBoneRotaitonWXYZ);

							::getPrevPosition (m_hNodeModel, fPreAvaterPositionXYZ);
							::getPrevRotation (m_hNodeModel, fPreAvaterRotaitonWXYZ);
							
							fAvaterFrontPositionXYZ[0] = fPreAvaterPositionXYZ[0] + m_vLocalCollisionPoint.x;
							fAvaterFrontPositionXYZ[1] = fPreAvaterPositionXYZ[1] + m_vLocalCollisionPoint.y;
							fAvaterFrontPositionXYZ[2] = fPreAvaterPositionXYZ[2] + m_vLocalCollisionPoint.z;
							
							
							if(CollisionPosition2OBBOnOff(&boneModelM, pObjectChar->m_fCollisionBoxLength[0], pObjectChar->m_fCollisionBoxLength[1], pObjectChar->m_fCollisionBoxLength[2], &D3DXVECTOR3(fAvaterFrontPositionXYZ[0], fAvaterFrontPositionXYZ[1], fAvaterFrontPositionXYZ[2])))
							{
								D3DXVECTOR3 vContactPositon;
								CollisionPosition2OBBResponse(&boneModelM, pObjectChar->m_fCollisionBoxLength[0], pObjectChar->m_fCollisionBoxLength[1], pObjectChar->m_fCollisionBoxLength[2], &D3DXVECTOR3(fAvaterFrontPositionXYZ[0], fAvaterFrontPositionXYZ[1], fAvaterFrontPositionXYZ[2]), &vContactPositon);

								fPreAvaterPositionXYZ[0] = vContactPositon.x - m_vLocalCollisionPoint.x;
								fPreAvaterPositionXYZ[1] = vContactPositon.y - m_vLocalCollisionPoint.y;
								fPreAvaterPositionXYZ[2] = vContactPositon.z - m_vLocalCollisionPoint.z;
										
							}
						
							
/*							fPreAvaterFrontPositionXYZ[0] = fPreAvaterPositionXYZ[0] + m_vLocalCollisionPoint.x;
                            fPreAvaterFrontPositionXYZ[1] = fPreAvaterPositionXYZ[1] + m_vLocalCollisionPoint.y;
							fPreAvaterFrontPositionXYZ[2] = fPreAvaterPositionXYZ[2] + m_vLocalCollisionPoint.z;
			
							
							D3DXMatrixRotationQuaternion(&bonePreModelM, &D3DXQUATERNION(fPreBoneRotaitonWXYZ[1], fPreBoneRotaitonWXYZ[2], fPreBoneRotaitonWXYZ[3], fPreBoneRotaitonWXYZ[0]));
						    bonePreModelM._41 = fPreBonePositionXYZ[0];	bonePreModelM._42 = fPreBonePositionXYZ[1];	bonePreModelM._43 = fPreBonePositionXYZ[2];
							
							::InputSceneSphere(m_vLocalCollisionPoint.x + fPreAvaterPositionXYZ[0], m_vLocalCollisionPoint.y + fPreAvaterPositionXYZ[1], m_vLocalCollisionPoint.z + fPreAvaterPositionXYZ[2], 50.0f);
   							
							D3DXVECTOR3 vContactPoint;							
							if(CollisionPosition2OBBOnOff(&bonePreModelM, pObjectChar->m_fCollisionBoxLength[0], pObjectChar->m_fCollisionBoxLength[1], pObjectChar->m_fCollisionBoxLength[2], &D3DXVECTOR3(fPreAvaterFrontPositionXYZ[0], fPreAvaterFrontPositionXYZ[1], fPreAvaterFrontPositionXYZ[2])))
							{
								if(ContactRay2OBBIn(&bonePreModelM, pObjectChar->m_fCollisionBoxLength[0], pObjectChar->m_fCollisionBoxLength[1], pObjectChar->m_fCollisionBoxLength[2], &vContactPoint))
								{
									fPreAvaterPositionXYZ[0] = vContactPoint.x;
									fPreAvaterPositionXYZ[1] = vContactPoint.y;
									fPreAvaterPositionXYZ[2] = vContactPoint.z;
								}
								else
								{
									assert(true);

								}
							}
												
							D3DXMatrixInverse(&invBonePreModelM, NULL, &bonePreModelM);
								
							boneModelRotationM = invBonePreModelM * boneModelM;
                                
							D3DXVec4Transform(&vWorldPos, &D3DXVECTOR4(fPreAvaterPositionXYZ[0], fPreAvaterPositionXYZ[1], fPreAvaterPositionXYZ[2], 1.0f), &boneModelRotationM);
						
							fPreAvaterPositionXYZ[0] = vWorldPos.x - m_vLocalCollisionPoint.x;
							fPreAvaterPositionXYZ[1] = vWorldPos.y - m_vLocalCollisionPoint.y;
							fPreAvaterPositionXYZ[2] = vWorldPos.z - m_vLocalCollisionPoint.z;

*/							
							if(true)
							{
								m_pObjAvater->Set_CurPOS(D3DXVECTOR3(fPreAvaterPositionXYZ[0], fPreAvaterPositionXYZ[1], fPreAvaterPositionXYZ[2]));
							
								if(m_iObjTYPE == OBJ_USER)
									g_pNet->Send_cli_CANTMOVE();
								else
								{
									if(m_iObjTYPE == OBJ_CGEAR||m_iObjTYPE ==OBJ_NRIDE)
									{
										CObjCastleGear* pCgear = (CObjCastleGear*)pObjAvater;
										CObjCHAR* pParent = pCgear->GetParent();
										
										if(pParent)
										{
											if( pParent->Get_TYPE() == OBJ_USER)
												g_pNet->Send_cli_CANTMOVE();
										}
									}
									else if(m_iObjTYPE == OBJ_CART)
									{
										CObjCART* pCart = (CObjCART*)pObjAvater;
										CObjCHAR* pParent = pCart->GetParent();
										if( pParent )
										{
											if( pParent->Get_TYPE() == OBJ_USER)
												g_pNet->Send_cli_CANTMOVE();
										}
									}

								}
								
								m_pObjAvater->SetCMD_STOP();
								setPositionVec3( m_hNodeModel, fPreAvaterPositionXYZ );
							}

							::setRotationQuat(m_hNodeModel, fPreAvaterRotaitonWXYZ); 
							::stopModelRotation(m_hNodeModel);

							if(m_iObjTYPE == OBJ_CGEAR||m_iObjTYPE == OBJ_NRIDE)
							{
								CObjCastleGear* pCgear = (CObjCastleGear*)pObjAvater;
								CObjCHAR* pParent = pCgear->GetParent();
								if( pParent )
								{
									pParent->Set_CurPOS( pObjAvater->Get_CurPOS() );
								}
							}
							else if(m_iObjTYPE == OBJ_CART)
							{
								CObjCART* pCart = (CObjCART*)pObjAvater;
								CObjCHAR* pParent = pCart->GetParent();
								if( pParent )
								{
									pParent->Set_CurPOS( pObjAvater->Get_CurPOS() );
								}

							}


						}
						
					}
                 
				}
			}			
		}

		pNode = g_pObjMGR->m_CharLIST.GetNextNode( pNode );
	} 
}
示例#10
0
void CTargetMenu::Update( POINT ptMouse )
{
	if( !IsVision()) return;

	CTDialog::Update( ptMouse );
	if( m_iTargetAvatarID )
	{
		CObjCHAR *pObj = (CObjCHAR*)g_pObjMGR->Get_CharOBJ( m_iTargetAvatarID, true );
		/// 유효하지 않은 타겟이다.. 마우스 컴맨드 초기화
		if( pObj == NULL )
		{
			Hide();
		}
		else
		{
			if( g_pAVATAR->Get_DISTANCE( pObj ) >= 1200 )
				Hide();
			else
			{
				D3DVECTOR   PosSCR;
				POINT		ptNew;
				pObj->GetScreenPOS (PosSCR);	
				ptNew.x = (int)PosSCR.x - GetWidth() / 2;
				ptNew.y = (int)PosSCR.y - ( GetHeight() * 2 / 3 );
				MoveWindow( ptNew );

			}
		}
	}
	

	WINCTRL_LIST_ITOR iter;
	CWinCtrl*	pCtrl;
	
	for( iter = m_listChild.begin(); iter != m_listChild.end(); ++iter)
	{
		pCtrl = *iter;
		if( pCtrl->GetControlType() == CTRL_IMAGE )
			continue;

		if( pCtrl->IsInside(ptMouse.x, ptMouse.y ) )
		{
//			g_itMGR.DrawToolTip( (short)ptMouse.x, (short)ptMouse.y, GetDialogType(), pCtrl->GetControlID());
			break;
		}
	}


/*
	int iTargetID = g_pAVATAR->m_iServerTarget;
	if( iTargetID )
	{
		CObjCHAR *pObj = (CObjCHAR*)g_pObjMGR->Get_CharOBJ( g_CommandState.GetCurrentTarget(), true );
		/// 유효하지 않은 타겟이다.. 마우스 컴맨드 초기화
		if( pObj == NULL )
		{
			g_CommandState.ClearMouseState();
			Hide();
			return;
		}
		
		///Target이 아바타일경우에만 현재 스크린 좌표에 따라서 윈도우의 위치 조정
		if( pObj->Get_TYPE() == OBJ_AVATAR ) 
		{
			D3DVECTOR   PosSCR;
			POINT		ptNew;
			pObj->GetScreenPOS (PosSCR);	
			ptNew.x = (int)PosSCR.x - GetWidth() / 2;
			ptNew.y = (int)PosSCR.y - ( GetHeight() * 2 / 3 );
			MoveWindow( ptNew );
			m_iTargetAvatarID = iTargetID;
//			Show();
		}
		else
		{
			Hide();
		}
	}
	else
		Hide();
*/
}
//--------------------------------------------------------------------------------
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;
	}	
}