Ejemplo n.º 1
0
void CGuildWar::Process( CTime & time )
{
	if( m_nFlag == WF_WARTIME )
	{
		if( GetEndTime() < time )
		{
			m_nFlag	= WF_END;
			g_DPCoreClient.SendWarTimeout( m_idWar );
			TRACE( "SendWarTimeout, %d\n", m_idWar );
		}
		else
		{
			CGuild* pDecl	= g_GuildMng.GetGuild( m_Decl.idGuild );
			CGuild* pAcpt	= g_GuildMng.GetGuild( m_Acpt.idGuild );
			if( pDecl && pAcpt )
			{
				CUser* pMaster	= g_UserMng.GetUserByPlayerID( pDecl->m_idMaster );
				if( IsInvalidObj( pMaster ) )
					g_DPCoreClient.SendWarMasterAbsent( m_idWar, TRUE );
				pMaster	= g_UserMng.GetUserByPlayerID( pAcpt->m_idMaster );
				if( IsInvalidObj( pMaster ) )
					g_DPCoreClient.SendWarMasterAbsent( m_idWar, FALSE );
			}
		}
	}
}
Ejemplo n.º 2
0
void CCoupleHelper::OnDecoupleResult( CAr & ar )
{
	u_long idPlayer;
	int nResult;
	ar >> idPlayer >> nResult;
	election::OutputDebugString( "S: CCoupleHelper.OnDecoupleResult: %d, %d", idPlayer, nResult );
	CUser* pUser	= static_cast<CUser*>( prj.GetUserByID( idPlayer ) );
	if( nResult == 0 )
	{
		CCouple* pCouple	= m_pMgr->GetCouple( idPlayer );
		ASSERT( pCouple );
		if( !pCouple )
			return;
		CUser* pPartner	= static_cast<CUser*>( prj.GetUserByID( pCouple->GetPartner( idPlayer ) ) );
		m_pMgr->Decouple( idPlayer );
		if( IsValidObj( pUser ) )
		{
			pUser->AddDecoupleResult();
			g_UserMng.SandCoupleInfo(pUser,0, NULL);
#if __VER >= 13 // __HONORABLE_TITLE			// 달인
			int nIdx = CTitleManager::Instance()->GetIdx(HS_COUPLE_LV,HI_COUNT_CHECK);
			if( nIdx >= 0)
			{	
				int nPrevLvl = pUser->GetHonorTitle(nIdx);
				pUser->SetHonorCount(nIdx,0);
				int nNeedCount = CTitleManager::Instance()->GetNeedCount(HS_COUPLE_LV,HI_COUNT_CHECK);
				if( nNeedCount >= nPrevLvl )
					pUser->AddHonorListAck();
			}
#endif	// __HONORABLE_TITLE			// 달인
		}
		if( IsValidObj( pPartner ) )
		{
			pPartner->AddDecoupleResult();
			g_UserMng.SandCoupleInfo(pPartner,0, NULL);
#if __VER >= 13 // __HONORABLE_TITLE			// 달인
			int nIdx = CTitleManager::Instance()->GetIdx(HS_COUPLE_LV,HI_COUNT_CHECK);
			if( nIdx >= 0)
			{	
				int nPrevLvl = pPartner->GetHonorTitle(nIdx);
				pPartner->SetHonorCount(nIdx,0);
				int nNeedCount = CTitleManager::Instance()->GetNeedCount(HS_COUPLE_LV,HI_COUNT_CHECK);
				if( nNeedCount >= nPrevLvl )
					pPartner->AddHonorListAck();
			}
#endif	// __HONORABLE_TITLE			// 달인
		}
	}
	else
	{
		if( IsValidObj( pUser ) )
			pUser->AddDefinedText( nResult );
	}
}
Ejemplo n.º 3
0
void CShipLoop::Process()
{
	D3DXMatrixInverse( GetInvTM(), NULL, &m_matWorld );		// 좌표변환이 이뤄지기전 매트릭스로 역행렬을 구해놔야 한다.
	
	D3DXVECTOR3	vPos = GetPos();
	D3DXVECTOR3 vDeltaAccu;
	FLOAT fAng = GetAngle();
	
	vDeltaAccu = D3DXVECTOR3(0, 0, 0);		// 누적 벡터는 항상 초기화 해줘야 한다.
	m_fDeltaAng = 0.07f;
#ifdef __X15
	int		i;
	for( i = 0; i < 4; i ++ )
#endif	
	{
		fAng += m_fDeltaAng;		// 왼쪽으로 계속 회전
		AngleToVectorXZ( &m_vAcc, fAng, 0.05f );		// fAng방향으로 추진력발생.
		vDeltaAccu += m_vAcc;		// 서버 15프레임에서만 사용되는 것으로 4번을 누적함.
	}
	
	m_vDelta = vDeltaAccu;
	vPos += m_vDelta;
	SetPos( vPos );
	SetAngle( fAng );
	
#ifdef __WORLDSERVER
	if( (m_nCount & 127) == 0 )
	{
		OBJID idCtrl = NULL_ID;

		g_UserMng.AddSetPosAngle( this, GetPos(), GetAngle() );		// 먼저 this(Ship)의 위치를 sync시킴.
		// 링크되어 있는 모든 ctrl의 위치를 다시 sync시킴.
		for( i = 0; i < MAX_LINKCTRL; i ++ )		
		{
			if( m_LinkCtrl[i] == 0 )	continue;
			idCtrl = m_LinkCtrl[i];
			CCtrl *pCtrl = prj.GetCtrl( idCtrl );
			if( IsValidObj( pCtrl ) )
			{
				if( pCtrl->GetIAObjLink() == this )
					g_UserMng.AddSetPosAngle( pCtrl, pCtrl->GetPos(), pCtrl->GetAngle() );		// this(Ship)의 위치를 sync시킴.
				else
					RemoveCtrl( pCtrl->GetId() );
			}
		}
	}
#endif
	
	// IA오브젝트는 다른 오브젝트를 태우고 다녀야 하므로
	// 실시간으로 매트릭스가 갱신되어야 한다.
	UpdateLocalMatrix();		

	m_nCount ++;
}
Ejemplo n.º 4
0
void CCoupleHelper::PlayProposeAnimation( CUser* pProposer, CUser* pTarget )
{
	ASSERT( pProposer );
	ASSERT( pTarget );
	FLOAT fAngle	= GetDegree( pTarget->GetPos(), pProposer->GetPos());
	pProposer->SetAngle( fAngle );
	pProposer->SendActMsg( OBJMSG_MOTION, MTI_CHEEROTHER, ANILOOP_1PLAY );
	g_UserMng.AddCreateSfxObj( pProposer, XI_CHEERSENDEFFECT );
	g_UserMng.AddCreateSfxObj( pTarget, XI_CHEERRECEIVEEFFECT );
	g_UserMng.AddMoverBehavior( pProposer, pProposer->GetPos(), pProposer->m_pActMover->m_vDelta,
		pProposer->GetAngle(), pProposer->m_pActMover->GetState(), pProposer->m_pActMover->GetStateFlag(), 
		pProposer->m_dwMotion, pProposer->m_pActMover->m_nMotionEx, pProposer->m_pModel->m_nLoop, pProposer->m_dwMotionOption, g_TickCount.GetTickCount(), TRUE );
}
Ejemplo n.º 5
0
void CParty::DoDuelPartyStart( CParty *pDst )
{
	int		i, j;
	OBJID	pDstMember[ MAX_PTMEMBER_SIZE ];
	memset( pDstMember, 0xff, sizeof(pDstMember) );
	
	m_idDuelParty = pDst->m_uPartyId;		// this파티의 상대
	
	CMover *pMember, *pMember2;

	LPCSTR pszLeader;
	if( pDst->m_nKindTroup )	// 순회극단 극단 이름 보냄
	{
		pszLeader = pDst->m_sParty;
	}
	else	// 단막극단 일때는 리더이름을 보냄
	{
#if __VER >= 11 // __SYS_PLAYER_DATA
		pszLeader	= CPlayerDataCenter::GetInstance()->GetPlayerString( pDst->GetPlayerId( 0 ) );
#else	// __SYS_PLAYER_DATA
		pszLeader	= prj.GetPlayerString( pDst->GetPlayerId( 0 ) );
#endif	//__SYS_PLAYER_DATA
	}
	
	if( !pszLeader )
	{
		Error( "Error Party PVP 1" );
		return;
	}

	for( i = 0; i < m_nSizeofMember; i ++ )		// 극단원들 루프.
	{
		pMember	= (CMover *)g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId );
		if( IsValidObj( pMember ) )
		{
			pMember->m_nDuel = 2;		// 2는 파티듀얼중.
			pMember->m_idDuelParty = m_idDuelParty;
			pMember->m_nDuelState = 104;
			// 상대방 파티의 멤버아이디를 다 꺼냄.
			for( j = 0; j < pDst->m_nSizeofMember; j ++ )
			{
				pMember2 = (CMover *)g_UserMng.GetUserByPlayerID( pDst->m_aMember[j].m_uPlayerId );
				if( IsValidObj(pMember2) )
					pDstMember[j] = pMember2->GetId();
			}
			// 상대 파티에 대한 정보를 우리멤버들에게 보냄
			((CUser *)pMember)->AddDuelPartyStart( pszLeader , pDst->m_nSizeofMember, pDstMember, pDst->m_uPartyId );		// 상대방 멤버의 ID를 다보낸다.
		}
	}
}	
Ejemplo n.º 6
0
int __RunQuest( int nPcId, int nNpcId, int nQuestId )
{
	CMover* pMover = prj.GetMover( nNpcId );
	QuestProp* pQuestProp = prj.m_aPropQuest.GetAt( nQuestId );

	if( pQuestProp )
	{
		for( int  i = 0; i < 4; i++ )
		{
			if( pQuestProp->m_nBeginSetAddItemIdx[ i ] )
			{
				__CreateItem( nPcId, pQuestProp->m_nBeginSetAddItemIdx[ i ], pQuestProp->m_nBeginSetAddItemNum[ i ] );
			}
		}
		if( pQuestProp->m_nBeginSetAddGold )
		{
			__AddGold( nPcId, pQuestProp->m_nBeginSetAddGold );
		}

		// 퀘스트 시작시 변신함 
		if( pQuestProp->m_nBeginSetDisguiseMoverIndex )
		{
			CUser* pUser = prj.GetUser( nPcId );
			pUser->Disguise( NULL, pQuestProp->m_nBeginSetDisguiseMoverIndex );
			g_UserMng.AddDisguise( pUser, pQuestProp->m_nBeginSetDisguiseMoverIndex );
		}
		__SetQuest( nPcId, nQuestId );
	}
	return 1;
}
Ejemplo n.º 7
0
void	CMover::CMD_SetMeleeAttack( OBJID idTarget, FLOAT fRange )
{
	ItemProp *pProp = GetActiveHandItemProp();
	if( pProp->dwItemKind2 == IK2_TOOLS )			// 툴을 들고선 공격못한다,.
		return;

	if( m_pActMover->IsActAttack() )	
		return;
	if( IsDie() )	
		return;										// 죽었을때 사용금지.

	// 요요는 밀리어택이긴 하나 약간 거리를 두고 공격한다.( 프로퍼티 참조함 )
	if( pProp->dwItemKind3 == IK3_YOYO )
		fRange = GetAttackRange( pProp->dwAttackRange );
	
#ifdef __CLIENT
	ClearActParam();
	SetDestObj( idTarget, fRange );		// 이동할 목표물을 idTarget으로 설정.
	SetCmd( OBJACT_MELEE_ATTACK, idTarget );		// 사정거리가 되었을때 실행할 명령 셋팅.
#elif defined(__WORLDSERVER)
#ifdef __TRAFIC_1222
	if( GetDestId() == idTarget )
		return;
#endif	// __TRAFIC_1222
	SetDestObj( idTarget, fRange );		// 이동할 목표물을 idTarget으로 설정.
	g_UserMng.AddMoverSetDestObj( this, idTarget, fRange );
#endif // WORLDSERVER
}
Ejemplo n.º 8
0
void CParty::Replace( DWORD dwWorldId, D3DXVECTOR3 & vPos, BOOL bMasterAround )
{
	CUser *pMember;
	for( int i = 0; i < m_nSizeofMember; i ++ )		// 극단원 모두에게 듀얼 해제를 세팅하고 클라에도 알림.
	{
		pMember	= g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId );

		if( IsValidObj( pMember ) )
		{
			/*
			if( GetQuest( QUEST_BOSS_LV1 ) != NULL )
				pMember->UnequipRide();
			
			if( GetQuest( QUEST_BOSS_LV2 ) != NULL )
				pMember->UnequipRide();
			
			if( GetQuest( QUEST_BOSS_LV3 ) != NULL )
				pMember->UnequipRide();
			*/			
			pMember->REPLACE( g_uIdofMulti, dwWorldId, vPos, REPLACE_NORMAL, nTempLayer );
#ifdef __BUFF_1107
			pMember->m_buffs.RemoveBuffs( RBF_COMMON, 0 );
#else	// __BUFF_1107
			pMember->m_SkillState.RemoveAllSkillInfluence();
#endif	// __BUFF_1107
		}
	}
}
Ejemplo n.º 9
0
// 대전장 대기실로 입장
void	CGuildCombat1to1Mng::SetTeleportToStage( CUser* pUser )
{
	if( m_nState != GC1TO1_ENTRANCE )
	{
		pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_NOENTRANCETIME );
		return;
	}
	
	if( !IsLineUpMember( pUser ) )
	{
		pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_NOT_GUILD_MEMBER );
		return;
	}

	int nIndex = GetTenderGuildIndexByUser( pUser );
	if( nIndex == NULL_ID )
		return;
	int nStageId = m_vecTenderGuild[nIndex].nStageId;
	if( nStageId == NULL_ID )
		return;
	m_vecGuilCombat1to1[nStageId].SetTeleportToWaitStage( pUser );
	
	// 버프 없애기
	pUser->RemoveCommonBuffs();
	g_UserMng.AddRemoveAllSkillInfluence( pUser );
	// 파티 탈퇴
	if( pUser->GetPartyId() > 0 )
		g_DPCoreClient.SendGCRemoveParty( pUser->GetPartyId(), pUser->m_idPlayer );
}	
Ejemplo n.º 10
0
//
// 극단 듀얼 해제
// 
void CParty::DoDuelPartyCancel( CParty* pDuelParty )
{
#ifndef __CORESERVER
	int		i;
	
	CMover *pMember;
	for( i = 0; i < m_nSizeofMember; i ++ )		// 극단원 모두에게 듀얼 해제를 세팅하고 클라에도 알림.
	{
#ifdef __WORLDSERVER
		pMember	= (CMover *)g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId );
#else
#ifdef __CLIENT
		pMember	= prj.GetUserByID( m_aMember[i].m_uPlayerId );
#endif
#endif // worldserver
		if( IsValidObj( pMember ) )
		{
#ifdef __WORLDSERVER
			if( pDuelParty )
				((CUser *)pMember)->AddDuelPartyCancel( pDuelParty );		// 각 멤버들에게 듀얼이 취소되었다고 알림.
			else
				((CUser *)pMember)->AddDuelPartyCancel( NULL );		// 각 멤버들에게 듀얼이 취소되었다고 알림.
			if( pMember->m_idDuelParty != m_idDuelParty )
				Error( "CParty::DoDuelPartyCancel : 파티멤버 %s의 정보이상. %d %d", pMember->GetName(), pMember->m_idDuelParty, m_idDuelParty );
			pMember->ClearDuelParty();
#endif // worldserver
		}
	}
	m_idDuelParty = 0;		// 파티 해제
#endif	// __CORESERVER
}	
Ejemplo n.º 11
0
void CParty::ReplaceLodestar( const CRect &rect )
{
	// locked
	CUser* pUser;
	for( int i = 0; i < m_nSizeofMember; i ++ )		// 극단원 모두에게 듀얼 해제를 세팅하고 클라에도 알림.
	{
		pUser	= g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId );

		if( IsValidObj( pUser ) )
		{
			CWorld* pWorld	= pUser->GetWorld();
			if( pWorld )
			{
				POINT point	= { (int)pUser->GetPos().x, (int)pUser->GetPos().z	};
				if( rect.PtInRect( point ) )
				{
					PRegionElem pRgnElem	= NULL;
					if( pWorld->GetID() != pWorld->m_dwIdWorldRevival && pWorld->m_dwIdWorldRevival != 0 )
						pRgnElem	= g_WorldMng.GetRevivalPos( pWorld->m_dwIdWorldRevival, pWorld->m_szKeyRevival );
					if( !pRgnElem )	// Find near revival pos
						pRgnElem	= g_WorldMng.GetNearRevivalPos( pWorld->GetID(), pUser->GetPos() );
					if( pRgnElem )
						pUser->REPLACE( g_uIdofMulti, pRgnElem->m_dwWorldId, pRgnElem->m_vPos, REPLACE_NORMAL, nRevivalLayer );
				}
			}
		}
	}
}
Ejemplo n.º 12
0
void CQuiz::RemoveNPC()
{
	CMover* pMover = prj.GetMover( m_sNPC.idNpc );
	if( IsValidObj( pMover ) )
	{
		g_UserMng.AddCreateSfxObj( pMover, XI_SKILL_MER_ONE_SPECIALHIT02 );
		pMover->Delete();
	}
}
Ejemplo n.º 13
0
CMover* CParty::GetLeader( void ) 
{ 
#ifdef __WORLDSERVER
	CMover *pLeader = (CMover *)g_UserMng.GetUserByPlayerID( m_aMember[0].m_uPlayerId );	// 리더의 포인터
	return pLeader;
#else
	CMover *pLeader = (CMover *)prj.GetUserByID( m_aMember[0].m_uPlayerId );	// 리더의 포인터
	return pLeader;
#endif
}
Ejemplo n.º 14
0
void CAIMonster2::MoveToDst( const D3DXVECTOR3& vDst )
{
	CMover* pMover = GetMover();
	if( pMover->GetDestPos() == vDst )
		return;

	pMover->SetDestPos( vDst );
	pMover->m_nCorr	= -1;
	g_UserMng.AddSetDestPos( pMover, vDst, 1 );
}
Ejemplo n.º 15
0
void CCoupleHelper::OnUpdatePlayerData( u_long idPlayer, PlayerData* pPlayerData )
{
	CCouple* pCouple	= GetCouple( idPlayer );
	if( pCouple )
	{
		u_long idPartner	= pCouple->GetPartner( idPlayer );
		CUser* pPartner		= g_UserMng.GetUserByPlayerID( idPartner );
		if( IsValidObj( pPartner ) )
			pPartner->AddQueryPlayerData( idPlayer, pPlayerData );
	}
}
Ejemplo n.º 16
0
int CCampus::GetBuffLevel( u_long idPlayer )
{
	int nLevel = 0;
	if( IsMaster( idPlayer ) )
	{
		for( MAP_CM::iterator it = m_mapCM.begin(); it != m_mapCM.end(); ++it )
		{
			CUser* pPupil = g_UserMng.GetUserByPlayerID( ( it->second )->GetPlayerId() );
			if( IsValidObj( pPupil ) && ( it->second )->GetLevel() == CAMPUS_PUPIL )
				++nLevel;
		}
	}
	else
	{
		CUser* pMaster = g_UserMng.GetUserByPlayerID( GetMaster() );
		if( IsValidObj( pMaster ) )
			++nLevel;
	}
	return nLevel;
}
Ejemplo n.º 17
0
void CCoupleHelper::OnCoupleResult( CAr & ar )
{
	u_long idProposer, idTarget;
	int nResult;
	ar >> idProposer >> idTarget >> nResult;
	election::OutputDebugString( "S: CCoupleHelper.OnCoupleResult: %d, %d, %d", idProposer, idTarget, nResult );
	CUser* pProposer	= static_cast<CUser*>( prj.GetUserByID( idProposer ) );
	CUser* pTarget	= static_cast<CUser*>( prj.GetUserByID( idTarget ) );
	if( nResult == 0 )
	{
		m_pMgr->Couple( idProposer, idTarget );
		const char* pszProposer	= CPlayerDataCenter::GetInstance()->GetPlayerString( idProposer );
		const char* pszTarget	= CPlayerDataCenter::GetInstance()->GetPlayerString( idTarget );
		if( !pszProposer )	pszProposer	= "";
		if( !pszTarget )	pszTarget	= "";
		if( IsValidObj( pProposer ) )
		{
			pProposer->AddCoupleResult( idTarget, pszTarget );
#if __VER >= 13 // __HONORABLE_TITLE			// 달인
			pProposer->SetHonorAdd(	HS_COUPLE_COUNT,HI_COUNT_CHECK );
#endif	// __HONORABLE_TITLE
			g_UserMng.SandCoupleInfo(pProposer,1, pszTarget);
		}
		if( IsValidObj( pTarget ) )
		{
			pTarget->AddCoupleResult( idProposer, pszProposer );
#if __VER >= 13 // __HONORABLE_TITLE			// 달인
			pTarget->SetHonorAdd(HS_COUPLE_COUNT,HI_COUNT_CHECK );
#endif	// __HONORABLE_TITLE			// 달인
			g_UserMng.SandCoupleInfo(pTarget,1, pszProposer);
		}
		CString szString;
		szString.Format("鯤소 %s 宅鯤소 %s 써槨죄헙쩟,댕소龍르儉쳬!",pProposer->GetName(),pTarget->GetName());
		g_DPCoreClient.SendSystem( szString );
	}
	else
	{
		if( IsValidObj( pTarget ) )
			pTarget->AddDefinedText( nResult );
	}
}
Ejemplo n.º 18
0
//
// 파티원들에게 bWin에 따라 승/패 사실을 알리고 듀얼을 종료시킴.
//
void CParty::DoDuelResult( CParty *pDuelOther, BOOL bWin, int nAddFame, float fSubFameRatio )
{
	CUser *pMember;
	int		i;
	
	for( i = 0; i < m_nSizeofMember; i ++ )
	{
		pMember = g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId );
		if( IsValidObj( pMember ) )
		{
			pMember->AddDuelPartyResult( pDuelOther, bWin );		// 각 멤버들에게 승/패 사실을 알림. / 상대파티원 리스트도 보냄.
			pMember->ClearDuelParty();

			if( bWin )
			{
				pMember->m_nFame += nAddFame;	// 이긴측이면 명성 증가
				pMember->AddDefinedText( TID_GAME_GETFAMEPOINT, "%d", nAddFame );	// xxx 명성 포인트가 증가
#ifdef __WORLDSERVER
				g_dpDBClient.SendLogPkPvp( pMember, NULL, nAddFame, 'E' );
#endif // __WORLDSERVER
			} 
			else
			{
				int nDecVal;
				fSubFameRatio = fSubFameRatio / 100.0f;	// 비율로 환산.
				nDecVal = (int)(pMember->m_nFame * fSubFameRatio);
				if( nDecVal == 0 )	nDecVal = 1;
				pMember->m_nFame -= nDecVal;
				if( pMember->m_nFame < 0 )	pMember->m_nFame = 0;
				pMember->AddDefinedText( TID_GAME_DECFAMEPOINT, "%d", nDecVal );	// xxx 명성 포인트가 감소.
#ifdef __WORLDSERVER
				g_dpDBClient.SendLogPkPvp( NULL, pMember, nAddFame, 'E' );
#endif // __WORLDSERVER
			}
			
			// 바뀐 명성치를 pMember의 주위에 날려줌.
			g_UserMng.AddSetFame( pMember, pMember->m_nFame );
		}
	}
	m_idDuelParty = 0;
}
Ejemplo n.º 19
0
void CAIMonster2::OnBeginState( int nInput, DWORD dwParam1, DWORD dwParam2 )
{
	CMover* pMover = GetMover();

	switch( GetState() )
	{
	case AI2_MOVE:
		{
			D3DXVECTOR3 vPos = m_vPosBegin;
			int x = xRandom( 20 );
			int z = xRandom( 20 );
			vPos.x += (float)(x - 10);
			vPos.z += (float)(z - 10);

			MoveToDst( vPos );		// y는 어떻게 되나?
		}
		break;
	case AI2_IDLE:
		//m_dwReattack = GetTickCount() + xRandom( 0, 2000 );
		m_dwReattack = GetTickCount() + 2000;
		m_idTarget = NULL_ID;			
		m_vTarget.x = m_vTarget.y = m_vTarget.z = 0.0f;
		pMover->SetStop(); 
		MoveToDst( pMover->GetPos() );
		break;

	case AI2_ATTACK:
		if( BeginAttack() == FALSE )						// 공격 
			SendAIMsg( AIMSG_END_MELEEATTACK, 0, 0 );			// 실패할 경우 공격완료 메세지는 오지 않는다.
		break;

	case AI2_TRACKING:
		if( m_idTarget == NULL_ID )
		{
			m_idTarget = m_idLastAttacker;
			ASSERT( m_idTarget != NULL_ID );
		}

#ifdef __TRAFIC_1222
		if( pMover->GetDestId() == m_idTarget )
			break;
#endif	// __TRAFIC_1222
		// 이동할 목표물을 idTarget으로 설정.
		pMover->SetDestObj( m_idTarget, m_fAttackRange );
		g_UserMng.AddMoverSetDestObj( pMover, m_idTarget, m_fAttackRange );
		break;
	case AI2_SEARCH:
		break;
	}
}
Ejemplo n.º 20
0
void CParty::Replace( DWORD dwWorldId, LPCTSTR sKey )
{
	CUser *pMember;
	for( int i = 0; i < m_nSizeofMember; i ++ )		// 극단원 모두에게 듀얼 해제를 세팅하고 클라에도 알림.
	{
		pMember	= g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId );
		
		if( IsValidObj( pMember ) )
		{
			PRegionElem pRgnElem = g_WorldMng.GetRevivalPos( dwWorldId, sKey );
			if( NULL != pRgnElem )
				pMember->REPLACE( g_uIdofMulti, pRgnElem->m_dwWorldId, pRgnElem->m_vPos, REPLACE_NORMAL, nRevivalLayer );
		}
	}
}
Ejemplo n.º 21
0
void CParty::DoUsePartyReCall( u_long uPartyId, u_long uLeaderid, int nSkill )
{
	CUser* pMember	= NULL;
	int		i;

	CUser* pUser    = NULL;
	pUser = g_UserMng.GetUserByPlayerID( uLeaderid );
	if( !IsValidObj( (CObj*)pUser ) )
		return;
	
	for( i = 0; i < m_nSizeofMember; i ++ )		// 단장(0)에게는 보낼필요 없다.
	{
		pMember		= g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId );
		if( IsValidObj( (CObj*)pMember ) )
		{
			if(pMember->m_idPlayer != pUser->m_idPlayer)
#ifdef __LAYER_1015
				g_DPCoreClient.SendSummonPlayer( pUser->m_idPlayer, pUser->GetWorld()->GetID(), pUser->GetPos(), pMember->m_idPlayer, pUser->GetLayer() );
#else	// __LAYER_1015
				g_DPCoreClient.SendSummonPlayer( pUser->m_idPlayer, pUser->GetWorld()->GetID(), pUser->GetPos(), pMember->m_idPlayer );
#endif	// __LAYER_1015
		}
	}
}
Ejemplo n.º 22
0
void CDPCoreClient::OnQueryRemovePlayer( CAr & ar )
{
	char lpszAccount[MAX_ACCOUNT] = { 0, };
	ar.ReadString( lpszAccount, MAX_ACCOUNT );

	CMclAutoLock	Lock( g_UserMng.m_AddRemoveLock );
	CUser* pUser	= g_UserMng.GetUser( lpszAccount );
	if( pUser )
	{
		pUser->m_idPlayer	= 0;
		g_dpLoginSrvr.DestroyPlayer( pUser->m_dpid );
	}
	else
	{
		WriteLog( "OnQueryRemovePlayer(): lpszAccount not found, %s", lpszAccount );
	}
}
Ejemplo n.º 23
0
// 대전장으로 텔레포트
void	CGuildCombat1to1::SetTeleportToWarStage( CUser* pUser )
{
	int nIndex = g_GuildCombat1to1Mng.GetTenderGuildIndexByUser( pUser );

	pUser->m_nGuildCombatState = 1; // 길드대전 모드
	g_UserMng.AddGuildCombatUserState( pUser );
	if( m_vecTenderGuild[nIndex].nPosition == 0 )
	{
		pUser->SetAngle( 0 );
		pUser->REPLACE( g_uIdofMulti, m_vecTenderGuild[nIndex].dwWorldId, D3DXVECTOR3( 260, 75, 252 ), REPLACE_NORMAL, nDefaultLayer );
	}
	else
	{
		pUser->SetAngle( 180 );
		pUser->REPLACE( g_uIdofMulti, m_vecTenderGuild[nIndex].dwWorldId, D3DXVECTOR3( 260, 75, 235 ), REPLACE_NORMAL, nDefaultLayer );
	}
}
Ejemplo n.º 24
0
BOOL CParty::ReplaceChkLv( int Lv )
{
	CUser *pMember;
	for( int i = 0; i < m_nSizeofMember; i ++ )		// 극단원 모두에게 듀얼 해제를 세팅하고 클라에도 알림.
	{
		pMember	= g_UserMng.GetUserByPlayerID( m_aMember[i].m_uPlayerId );
		
		if( IsValidObj( pMember ) )
		{
			if( pMember->GetLevel() > Lv )
			{
				return FALSE;
			}
		}
	}

	return TRUE;
}
Ejemplo n.º 25
0
void CDPCoreClient::OnPreJoin( CAr & ar )
{
	CHAR lpszAccount[MAX_ACCOUNT], lpszPlayer[MAX_PLAYER];
	DWORD dwAuthKey;
	u_long idPlayer;
	BYTE f;
	ar >> dwAuthKey;
	ar.ReadString( lpszAccount, MAX_ACCOUNT );
	ar >> idPlayer;
	ar.ReadString( lpszPlayer, MAX_PLAYER );
	ar >> f;

	CMclAutoLock	Lock( g_UserMng.m_AddRemoveLock );

	CUser* pUser	= g_UserMng.GetUser( lpszAccount );
	if( pUser )
	{
		if( pUser->m_dwAuthKey == dwAuthKey )
		{
			if( f )	// o
				g_dpLoginSrvr.SendHdr( PACKETTYPE_PRE_JOIN, pUser->m_dpid );
			else
			{
				WriteLog( "OnPreJoin(): recv 0 from CORE, %s", lpszAccount );
				pUser->m_idPlayer	= 0;
				g_dpLoginSrvr.DestroyPlayer( pUser->m_dpid );
			}
		}
		else
		{
			WriteLog( "OnPreJoin(): Different dwAuthKey" );
			g_dpLoginSrvr.DestroyPlayer( pUser->m_dpid );
		}
	}
	else
	{
		WriteLog( "OnPreJoin(): Account not found, %s", lpszAccount );
		//
	}
}
Ejemplo n.º 26
0
int __RemoveQuest( int nPcId, int nQuest )      
{
	QuestProp* pQuestProp	= prj.m_aPropQuest.GetAt( nQuest );
	if( pQuestProp )
	{
		CUser* pUser	= prj.GetUser( nPcId );
		LPQUEST pQuest	= pUser->GetQuest( nQuest );

		if( pQuest && pQuest->m_nState < 14 ) 
			pUser->AddDefinedText( TID_EVE_CANCELQUEST, "\"%s\"", pQuestProp->m_szTitle );
		pUser->RemoveQuest( nQuest );
		pUser->AddRemoveQuest( nQuest );
		// 시작시 변신을 했으면 퀘스트 삭제시 변신 해제시킨다.
		if( pQuest && pQuestProp->m_nBeginSetDisguiseMoverIndex )
		{
			CUser* pUser = prj.GetUser( nPcId );
			pUser->NoDisguise( NULL );
			g_UserMng.AddNoDisguise( pUser );
		}
	}
	return 1;
}
Ejemplo n.º 27
0
//
// fRange = 도달범위.  디폴트는 0.0f은 상대방의 반경까지 붙는거다.
void CMover::SetDestObj( OBJID objid, float fRange, BOOL bSend )
{
#ifdef __WORLDSERVER
	if( FALSE == IsPlayer() && m_idDest != objid )
		m_nCorr	= -1;
#else	// __WORLDSERVER
	if( bSend && IsActiveMover() && m_idDest != objid )
	{
#ifdef __BS_ADJUST_SYNC
		CMover* pTarget = prj.GetMover( m_idDest );
		if( pTarget )
		{
			if( pTarget->IsPlayer( ) )
				g_DPlay.SendPlayerBehavior();	// 새로운 Obj로 이동할경우 동기화 한번 맞춰주고....
		}
#endif
		g_DPlay.SendPlayerDestObj( objid, fRange );
		m_nCorr	= -1;
	}
#endif	// not __WORLDSERVER

	m_idDest	    = objid;
	m_fArrivalRange = fRange;
	ClearDestPos();

#ifdef __WORLDSERVER
	// 서버에서 SetDestObj를 실행하면 클라들에게 보내주는게 없어서 이걸 넣음.
	if( bSend )
		g_UserMng.AddMoverSetDestObj( this, objid, fRange, FALSE );
#endif	// __WORLDSERVER

#ifdef __CLIENT
	m_oaCmd = OBJACT_NONE;		// CMD_ 시리즈를 거치지 않고 이것만 호출되는 경우는 Cmd를 해제시키자.
#endif // Client

//	if( IsPlayer() )
//		TRACE( "SetDestObj %08x\n", objid );
}
Ejemplo n.º 28
0
// 대기실로 텔레포트(입장시, 대전종료시)
void	CGuildCombat1to1::SetTeleportToWaitStage( CUser* pUser )
{
	int nIndex = g_GuildCombat1to1Mng.GetTenderGuildIndexByUser( pUser );
	if( !g_WorldMng.GetWorld( m_vecTenderGuild[nIndex].dwWorldId ) )
	{
		pUser->AddText( "Not Exist World" );
		return;
	}
	pUser->m_nGuildCombatState = 2; // 관전자 모드
	g_UserMng.AddGuildCombatUserState( pUser );
	
	int nRandx = xRandom(4) - 2;
	int nRandz = xRandom(4) - 2;
	if( m_vecTenderGuild[nIndex].nPosition == 0 )
	{
		pUser->SetAngle( 0 );
		pUser->REPLACE( g_uIdofMulti, m_vecTenderGuild[nIndex].dwWorldId, D3DXVECTOR3( (float)( 256+nRandx ), 90.0f, (float)( 277+nRandz ) ), REPLACE_NORMAL, nDefaultLayer );
	}
	else
	{
		pUser->SetAngle( 180 );
		pUser->REPLACE( g_uIdofMulti, m_vecTenderGuild[nIndex].dwWorldId, D3DXVECTOR3( (float)( 272+nRandx ), 90.0f, (float)( 212+nRandz ) ), REPLACE_NORMAL, nDefaultLayer );
	}
}
Ejemplo n.º 29
0
	FOR_LINKMAP( GetWorld(), vPos, pObj, nRange, CObj::linkPlayer, GetLayer() )
	{
		if( pObj->GetType() == OT_MOVER )				// 대상이 무버일때만.
		{
			CMover *pTarget = (CMover *)pObj;
			if( pTarget->IsLive() && pAttacker != pTarget )
			{
				if( pObj->IsRangeObj( vPos, 1.0f ) )
				{
#if __VER >= 9	// __SKILL_0706
					int n = 0;
					if( bPVP && pAttacker->IsPVPTarget( pTarget ) )
						n	= pTarget->m_pActMover->SendDamage( AF_FORCE, pAttacker->GetId(), nDamagePVP, FALSE );	
					else if( bPVP && (m_bControl || pAttacker->IsGuildCombatTarget( pTarget )
								/*아레나 추가*/	|| pAttacker->IsArenaTarget( pTarget ) 
						) )
						n	= pTarget->m_pActMover->SendDamage( AF_FORCE, pAttacker->GetId(), nDamage, FALSE );	
#else	// __SKILL_0706
					int n	= pTarget->m_pActMover->SendDamage( AF_FORCE, pAttacker->GetId(), nDamage, FALSE );	
#endif	// __SKILL_0706
					if( n > 0 )
					{
						m_nLife ++;		// 부딪힐때마다 카운트 올라감
						if( m_nLife >= (int)( m_pAddSkillProp->dwSkillLvl / 2 ) )
							DestroyWall();

						// 뒤로 밀리기 처리.
						FLOAT fPushAngle = pTarget->GetAngle() + 180.0f;
						FLOAT fPower = 0.825f;
						AngleToVectorXZ( &pTarget->m_pActMover->m_vDeltaE, fPushAngle, fPower );
						g_UserMng.AddPushPower( pTarget, pTarget->GetPos(), pTarget->GetAngle(), fPushAngle, fPower );
					}
				}
			}
		}
	}
Ejemplo n.º 30
0
void LogPerformance( DWORD dwCurTick )
{
	static int nFrame = 0;			
	static DWORD dwPrev = 0;
	static DWORD dwElapsed = 0;

	++nFrame;
	DWORD dwTick = dwCurTick - dwPrev; 
	dwPrev = dwCurTick;
	dwElapsed += dwTick;

	if( dwTick > 100 )
	{
		SetLogInfo( LOGTYPE_WARN1, "warning - tick:%d", dwTick );

		if( g_bProfiling )
		{
			float sum = r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10 + r11 + r12 + 1.0f;

			char szBuffer[256];
			sprintf( szBuffer, 
					"%d, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f\n",
					dwTick,
					( r1 * 100.0f / sum ),
					( r2 * 100.0f / sum ),
					( r3 * 100.0f / sum ),
					( r4 * 100.0f / sum ),
					( r5 * 100.0f / sum ),
					( r6 * 100.0f / sum ),
					( r7 * 100.0f / sum ),
					( r8 * 100.0f / sum ),
					( r9 * 100.0f / sum ),
					( r10 * 100.0f / sum ),
					( r11 * 100.0f / sum ),
					( r12 * 100.0f / sum ) );

			SetLogInfo( LOGTYPE_WARN2, szBuffer );
			OutputDebugString( szBuffer );
		}
	}

#ifdef __INFINITE_0227
	if( dwTick > 1000 )
	{
		char szBuffer[256];
			sprintf( szBuffer, 
					"OP: %d, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f, %2.1f\n",
					dwTick, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12 );
			Error( szBuffer );
	}
#endif	// __INFINITE_0227

	if( dwElapsed > 1000 )
	{
		SetLogInfo( LOGTYPE_CCU, "CCU:%d", g_UserMng.GetCount() );

		if( g_bProfiling )
			SetLogInfo( LOGTYPE_PERFOMANCE, "frame:%d tick:%d", nFrame, dwTick );

		dwElapsed = 0; // -= 1000
		nFrame = 0;

		r1 = r2 = r3 = r4 = r5 = r6 = r7 = r8 = r9 = r10 = r11 = r12 = 0;
		SetLogInfo( LOGTYPE_REDRAW, "" );
#ifdef __NEW_PROFILE
		if( CProfileInfo::GetInstance()->IsToggleProfiling() )
			CProfileInfo::GetInstance()->SetProfileInfo();
#endif // __NEW_PROFILE
	}

}