예제 #1
0
// 현재 대전의 경기 시작과 결과를 대전장의 모든 유저에게 전달
void	CGuildCombat1to1::SendWarResultAllPlayer()
{
	CUser* pUser = NULL;
	for( int i=0; i<2; i++ )
	{
		for( int j=0; j<(int)( m_vecTenderGuild[m_nIndex[i]].vecMemberId.size() ); j++ )
		{
			pUser = (CUser*)prj.GetUserByID( m_vecTenderGuild[m_nIndex[i]].vecMemberId[j] );
			if( IsPossibleUser( pUser ) )
			{
				u_long uIdPlayer = NULL_ID;
				if( (int)( m_vecTenderGuild[m_nIndex[i]].vecMemberId.size() ) > m_nProgWarCount	)
					uIdPlayer = m_vecTenderGuild[m_nIndex[i]].vecMemberId[m_nProgWarCount];
				//else
				//	continue;

				switch( m_nState )
				{
					case GC1TO1WAR_WAR :	// 경기 시작시
					{
						pUser->AddGC1to1WarResult( g_GuildCombat1to1Mng.GC1TO1_PLAYER_WAR, uIdPlayer, 0, 0 );
						break;
					}

					case GC1TO1WAR_FINISH :		// 경기 종료시
					{
						int nOurWinCount = m_vecTenderGuild[m_nIndex[i]].nWinCount;
						int nOtherWinCount = m_vecTenderGuild[m_nIndex[(i+1)%2]].nWinCount;
						
						pUser->AddGC1to1WarResult( m_vecTenderGuild[m_nIndex[i]].nLastWinState, uIdPlayer, nOurWinCount, nOtherWinCount );
						
						// 전체 메세지 출력
						int nIndex = 2;	// 비겼을 때 
						if( m_vecTenderGuild[m_nIndex[0]].nLastWinState == g_GuildCombat1to1Mng.GC1TO1_PLAYER_WIN )
							nIndex = 0; // 0길드가 승리했을 때
						else if( m_vecTenderGuild[m_nIndex[1]].nLastWinState == g_GuildCombat1to1Mng.GC1TO1_PLAYER_WIN )
							nIndex = 1;	// 1길드가 승리했을 때
						
						// 대전장의 모든 선수에게 메세지 출력	
						if( nIndex == 2 ) // 비겼을 때
							pUser->AddDefinedCaption( TRUE, TID_GAME_GUILDCOMBAT1TO1_DRAWMSG, "%d", m_nProgWarCount+1 );
						else
						{
							CUser* pWinUser = NULL;
							if( (int)( m_vecTenderGuild[m_nIndex[nIndex]].vecMemberId.size() ) > m_nProgWarCount	)								
								pWinUser = (CUser*)prj.GetUserByID( m_vecTenderGuild[m_nIndex[nIndex]].vecMemberId[m_nProgWarCount] );
							if( IsValidObj( pWinUser ) )
							{
								CGuild* pGuild = pWinUser->GetGuild();
								if( pGuild )
									pUser->AddDefinedCaption( TRUE, TID_GAME_GUILDCOMBAT1TO1_WINMSG, "%d %s %s", m_nProgWarCount+1, pGuild->m_szGuild, pWinUser->GetName() );
							}
						}
						break;
					}
				} // switch
			} // if
		} // for j
	} // for i
}
예제 #2
0
// 현재 대전장의 대전이 모두 끝나고 텔레포트전 대기 시간...
void	CGuildCombat1to1::GuildCombat1to1CloseWait()
{
	ClearTime();
	m_nState = GC1TO1WAR_CLOSEWAIT;
	m_nWaitTime = (int)( g_GuildCombat1to1Mng.m_Lua.GetGlobalNumber( "WarCloseWaitTime" ) );
	m_dwTime = GetTickCount();
	SendNowStateAllPlayer();

	// 승리 길드 판별
	int nWinIndex = NULL_ID;
	if( m_vecTenderGuild[m_nIndex[0]].nWinCount > m_vecTenderGuild[m_nIndex[1]].nWinCount )
		nWinIndex = m_nIndex[0];
	else if( m_vecTenderGuild[m_nIndex[0]].nWinCount < m_vecTenderGuild[m_nIndex[1]].nWinCount )
		nWinIndex = m_nIndex[1];
	
	// 길드 승패 메세지 출력(승리 길드는 칩 추가 지급)
	CUser* pUser = NULL;
	for( int i=0; i<2; i++ )
	{
		for( int j=0; j<(int)( m_vecTenderGuild[m_nIndex[i]].vecMemberId.size() ); j++ )
		{
			pUser = (CUser*)prj.GetUserByID( m_vecTenderGuild[m_nIndex[i]].vecMemberId[j] );
			if( IsPossibleUser( pUser ) )
			{
				if( m_nIndex[i] == nWinIndex )	// 승리 길드
				{
					SetWinChip( pUser, NULL, FALSE, FALSE );
					pUser->AddDefinedCaption( TRUE, TID_GAME_GUILDCOMBAT1TO1_WARGUILDWIN, "" );
					pUser->AddDefinedText( TID_GAME_GUILDCOMBAT1TO1_WARGUILDWINCHIP, "%d", GetChipNum() );
				}
				else if( nWinIndex == NULL_ID ) // 비김
				{
					SetWinChip( pUser, NULL, TRUE, FALSE );
					pUser->AddDefinedCaption( TRUE, TID_GAME_GUILDCOMBAT1TO1_WARGUILDDRAW, "" );
				}
				else							// 패배 길드
				{
					SetWinChip( NULL, pUser, FALSE, FALSE );
					pUser->AddDefinedCaption( TRUE, TID_GAME_GUILDCOMBAT1TO1_WARGUILDLOST, "" );
				}

				SendNowState( pUser );
			}
		}
	}

	g_dpDBClient.SendGC1to1Tender( 'U', m_vecTenderGuild[m_nIndex[0]].ulGuildId, m_vecTenderGuild[m_nIndex[0]].nPenya, 'E' );
	g_dpDBClient.SendGC1to1Tender( 'U', m_vecTenderGuild[m_nIndex[1]].ulGuildId, m_vecTenderGuild[m_nIndex[1]].nPenya, 'E' );
	g_dpDBClient.SendGC1to1WarGuild( m_vecTenderGuild[m_nIndex[0]].dwWorldId, 0, 0, 'E' );
}
예제 #3
0
// 입장전 대기...
void	CGuildCombat1to1Mng::GuildCombat1to1EntranceWait()
{
	m_nState = GC1TO1_ENTRANCE;
	m_nWaitTime = (int)m_Lua.GetGlobalNumber( "EntranceWaitTime" );
	m_dwTime = GetTickCount();

	for( int i=0; i<(int)( m_vecTenderGuild.size() ); i++ )
	{
		CGuild* pGuild = g_GuildMng.GetGuild( m_vecTenderGuild[i].ulGuildId );
		if( pGuild )
		{
			CUser* pUser = (CUser*)prj.GetUserByID( pGuild->m_idMaster );
			if( IsValidObj( pUser ) && !IsLineUpMember( pUser ) )
				SendNowState( pUser );
		}

		for( int j=0; j<(int)( m_vecTenderGuild[i].vecMemberId.size() ); j++ )
		{
			CUser* pUser = (CUser*)prj.GetUserByID( m_vecTenderGuild[i].vecMemberId[j] );
			if( IsValidObj( pUser ) )
			{
				pUser->AddDefinedCaption( TRUE, TID_GAME_GUILDCOMBAT1TO1_ENTRANCETIME, "" );
				SendNowState( pUser );
			}
		}
	}
}