// 현재 대전자가 모두 존재하면 대전 시작 void CGuildCombat1to1::GuildCombat1to1War() { CUser* pUser0 = NULL; CUser* pUser1 = NULL; if( (int)( m_vecTenderGuild[m_nIndex[0]].vecMemberId.size() ) > m_nProgWarCount ) pUser0 = (CUser*)prj.GetUserByID( m_vecTenderGuild[m_nIndex[0]].vecMemberId[m_nProgWarCount] ); if( (int)( m_vecTenderGuild[m_nIndex[1]].vecMemberId.size() ) > m_nProgWarCount ) pUser1 = (CUser*)prj.GetUserByID( m_vecTenderGuild[m_nIndex[1]].vecMemberId[m_nProgWarCount] ); // 양쪽 대전자가 모두 존재하면 대전 시작 if( IsPossibleUser( pUser0 ) && IsPossibleUser( pUser1 ) ) { g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[0]].ulGuildId, m_vecTenderGuild[m_nIndex[0]].vecMemberId[m_nProgWarCount], 'N' ); g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[1]].ulGuildId, m_vecTenderGuild[m_nIndex[1]].vecMemberId[m_nProgWarCount], 'N' ); SetTeleportToWarStage( pUser0 ); // 대전장으로 텔레포트 SetTeleportToWarStage( pUser1 ); // 대전장으로 텔레포트 m_nState = GC1TO1WAR_WAR; m_nWaitTime = (int)g_GuildCombat1to1Mng.m_Lua.GetGlobalNumber( "WarTime" ); m_dwTime = GetTickCount(); SendNowStateAllPlayer(); SendWarResultAllPlayer(); // 대전 시작 알림 } else GuildCombat1to1WarWait(); }
// 최근 경기 결과를 저장한다. void CGuildCombat1to1::SetLastWinState( int nIndex ) { // 생명수 초기화 for( int i=0; i<2; i++ ) m_vecTenderGuild[m_nIndex[i]].nNowPlayerLife = g_GuildCombat1to1Mng.m_nPlayerLife; switch( nIndex ) { case 0 : // 0이 이겼을 때 m_vecTenderGuild[m_nIndex[0]].nLastWinState = g_GuildCombat1to1Mng.GC1TO1_PLAYER_WIN; if( (int)( m_vecTenderGuild[m_nIndex[0]].vecMemberId.size() ) > m_nProgWarCount ) g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[0]].ulGuildId, m_vecTenderGuild[m_nIndex[0]].vecMemberId[m_nProgWarCount], 'W' ); m_vecTenderGuild[m_nIndex[1]].nLastWinState = g_GuildCombat1to1Mng.GC1TO1_PLAYER_LOSE; if( (int)( m_vecTenderGuild[m_nIndex[1]].vecMemberId.size() ) > m_nProgWarCount ) g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[1]].ulGuildId, m_vecTenderGuild[m_nIndex[1]].vecMemberId[m_nProgWarCount], 'L' ); break; case 1 : // 1이 이겼을 때 m_vecTenderGuild[m_nIndex[0]].nLastWinState = g_GuildCombat1to1Mng.GC1TO1_PLAYER_LOSE; if( (int)( m_vecTenderGuild[m_nIndex[0]].vecMemberId.size() ) > m_nProgWarCount ) g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[0]].ulGuildId, m_vecTenderGuild[m_nIndex[0]].vecMemberId[m_nProgWarCount], 'L' ); m_vecTenderGuild[m_nIndex[1]].nLastWinState = g_GuildCombat1to1Mng.GC1TO1_PLAYER_WIN; if( (int)( m_vecTenderGuild[m_nIndex[1]].vecMemberId.size() ) > m_nProgWarCount ) g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[1]].ulGuildId, m_vecTenderGuild[m_nIndex[1]].vecMemberId[m_nProgWarCount], 'W' ); break; case 2 : // 비겼을 때 m_vecTenderGuild[m_nIndex[0]].nLastWinState = g_GuildCombat1to1Mng.GC1TO1_PLAYER_DRAW; if( (int)( m_vecTenderGuild[m_nIndex[0]].vecMemberId.size() ) > m_nProgWarCount ) g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[0]].ulGuildId, m_vecTenderGuild[m_nIndex[0]].vecMemberId[m_nProgWarCount], 'D' ); m_vecTenderGuild[m_nIndex[1]].nLastWinState = g_GuildCombat1to1Mng.GC1TO1_PLAYER_DRAW; if( (int)( m_vecTenderGuild[m_nIndex[1]].vecMemberId.size() ) > m_nProgWarCount ) g_dpDBClient.SendGC1to1WarPerson( m_vecTenderGuild[m_nIndex[1]].ulGuildId, m_vecTenderGuild[m_nIndex[1]].vecMemberId[m_nProgWarCount], 'D' ); break; } }