Beispiel #1
0
void ZMapListBox::Refresh(MZFileSystem* pFS)
{
	m_pListBox->RemoveAll();

#define EXT	".rs"
#define MAPDIRECTORY "Maps/"

	MChannelRule* pRule = ZGetChannelRuleMgr()->GetCurrentRule();
	if (pRule == NULL) {
		mlog("ZMapListBox::Refresh() > No Current ChannelRule \n");
		return;
	}

	int nExtLen = (int)strlen(EXT);
	for(int i=0; i<pFS->GetFileCount(); i++){
		const char* szFileName = pFS->GetFileName(i);
		const MZFILEDESC* desc = pFS->GetFileDesc(i);
		int nLen = (int)strlen(szFileName);

		if( strnicmp(desc->m_szFileName,MAPDIRECTORY,strlen(MAPDIRECTORY))==0 &&
			nLen>nExtLen && stricmp(szFileName+nLen-nExtLen, EXT)==0 )
		{
			char drive[_MAX_DRIVE],dir[_MAX_DIR],fname[_MAX_FNAME],ext[_MAX_EXT];
			_splitpath(szFileName,drive,dir,fname,ext);

			if (ZIsLaunchDevelop()) 
			{
				m_pListBox->Add(fname);
//			} else {
//				if (pRule->CheckMap(fname))
//					m_pListBox->Add(fname);
			}
		}
	}
}
Beispiel #2
0
bool ZModule_HPAP::CheckQuestCheet()
{
#ifdef _PUBLISH
	return false;
#endif

	if (IsMyCharacter((ZObject*)m_pContainer))
	{
		if ((ZIsLaunchDevelop()) && (ZGetGameClient()->GetServerMode() == MSM_TEST))
		{
			if (ZGetGameTypeManager()->IsQuestDerived(ZGetGameClient()->GetMatchStageSetting()->GetGameType()))
			{
				if (ZGetQuest()->GetCheet(ZQUEST_CHEET_GOD) == true) return true;
			}
		}
	}

	return false;
}
Beispiel #3
0
bool ZGameInput::OnEvent(MEvent* pEvent)
{
	int sel = 0;

	if ((ZGetGameInterface()->GetState() != GUNZ_GAME)) return false;
	if ( ZGetGameInterface()->GetGame() == NULL ) return false;

	MWidget* pMenuWidget = ZGetGameInterface()->GetIDLResource()->FindWidget("CombatMenuFrame");
	if ((pMenuWidget) && (pMenuWidget->IsVisible())) return false;
	MWidget* pChatWidget = ZGetGameInterface()->GetIDLResource()->FindWidget("CombatChatInput");
	if ((pChatWidget) && (pChatWidget->IsVisible())) return false;
	MWidget* p112ConfirmWidget = ZGetGameInterface()->GetIDLResource()->FindWidget("112Confirm");
	if (p112ConfirmWidget->IsVisible()) return false;

#ifndef _PUBLISH
	if (m_pInstance) { 
		if (m_pInstance->OnDebugEvent(pEvent) == true) 
			return true;
	}
#endif

	ZMyCharacter* pMyCharacter = ZGetGameInterface()->GetGame()->m_pMyCharacter;
	if ((!pMyCharacter) || (!pMyCharacter->GetInitialized())) return false;


	////////////////////////////////////////////////////////////////////////////
	switch(pEvent->nMessage){
	case MWM_HOTKEY:
		{
			int nKey = pEvent->nKey;
			ZHOTKEY *hk=ZGetConfiguration()->GetHotkey(nKey);
			//if(ProcessLowLevelCommand(hk->command.c_str())==false)
			
			char buffer[256];
			strcpy(buffer,hk->command.c_str());
			ZApplication::GetGameInterface()->GetChat()->Input(buffer);

//			ConsoleInputEvent(hk->command.c_str());
		}break;

	case MWM_LBUTTONDOWN:
		{
			ZCombatInterface* pCombatInterface = ZGetGameInterface()->GetCombatInterface();

			if ( ZGetCombatInterface()->IsShowResult())
			{
				if ( ((ZGetCombatInterface()->m_nReservedOutTime - timeGetTime()) / 1000) < 13)
				{
					if(ZGetGameClient()->IsLadderGame() || ZGetGameClient()->IsDuelTournamentGame())
						ZChangeGameState(GUNZ_LOBBY);
					else
						ZChangeGameState(GUNZ_STAGE);

					return true;
				}
			}

			if (pCombatInterface->IsChat())
			{
				pCombatInterface->EnableInputChat(false);
			}

			if (pCombatInterface->GetObserver()->IsVisible())
			{
				pCombatInterface->GetObserver()->ChangeToNextTarget();
				return true;
			}

/*			if ((pMyCharacter) && (pMyCharacter->IsDie()))	//// 실서비스에서 스폰안되는 버그유발. 원인불명(_PUBLISH누락) 영구봉쇄.
			{
				// 혼자테스트할때 되살아나기
				if(g_pGame->m_CharacterManager.size()==1)
				{
#ifndef _PUBLISH
					ZGetGameInterface()->RespawnMyCharacter();
					return true;
#endif
				}
			}*/
			if (ZGetGameInterface()->IsCursorEnable())
				return false;
		}
		return true;
	case MWM_RBUTTONDOWN:
		{
			if (ZGetGameInterface()->GetCombatInterface()->IsChat())
			{
				ZGetGameInterface()->GetCombatInterface()->EnableInputChat(false);
			}

			ZCombatInterface* pCombatInterface = ZGetGameInterface()->GetCombatInterface();
			if (pCombatInterface->GetObserver()->IsVisible())
			{
				pCombatInterface->GetObserver()->NextLookMode();
			}
		}
		return true;
	case MWM_MBUTTONDOWN:
		if (ZGetGameInterface()->GetCombatInterface()->IsChat())
		{
			ZGetGameInterface()->GetCombatInterface()->EnableInputChat(false);
		}
		return true;
	case MWM_ACTIONRELEASED:
		{
			switch(pEvent->nKey){
			case ZACTION_FORWARD:
			case ZACTION_BACK:
			case ZACTION_LEFT:
			case ZACTION_RIGHT:
				if (m_pInstance) 
					m_pInstance->m_ActionKeyHistory.push_back(ZACTIONKEYITEM(ZGetGame()->GetTime(),false,pEvent->nKey));
				return true;

			case ZACTION_DEFENCE:
				{
					if(ZGetGame()->m_pMyCharacter)
						ZGetGame()->m_pMyCharacter->m_statusFlags.Ref().m_bGuardKey = false;
				}
				return true;
			}
		}break;
	case MWM_ACTIONPRESSED:
		if ( !ZGetGame()->IsReservedSuicide())		// 자살 예정인 경우 대쉬를 할수없게 막는다
		{
		switch(pEvent->nKey){
			case ZACTION_FORWARD:
			case ZACTION_BACK:
			case ZACTION_LEFT:
			case ZACTION_RIGHT:
			case ZACTION_JUMP:
				if (m_pInstance) 
					m_pInstance->m_ActionKeyHistory.push_back(ZACTIONKEYITEM(ZGetGame()->GetTime(),true,pEvent->nKey));
				return true;
			case ZACTION_MELEE_WEAPON:
				{
					if ( !ZGetGame()->IsReplay())
						ZGetGameInterface()->ChangeWeapon(ZCWT_MELEE);
				}
				return true;
			case ZACTION_PRIMARY_WEAPON:
				{
					if ( !ZGetGame()->IsReplay())
						ZGetGameInterface()->ChangeWeapon(ZCWT_PRIMARY);
				}
				return true;
			case ZACTION_SECONDARY_WEAPON:
				{
					if ( !ZGetGame()->IsReplay())
						ZGetGameInterface()->ChangeWeapon(ZCWT_SECONDARY);
				}
				return true;
			case ZACTION_ITEM1:
			case ZACTION_ITEM2:
				{
					int nIndex = pEvent->nKey - ZACTION_ITEM1 + ZCWT_CUSTOM1;
					if ( !ZGetGame()->IsReplay()) {
						ZGetGameInterface()->ChangeWeapon(ZChangeWeaponType(nIndex));
					}
				}
				return true;
			case ZACTION_COMMUNITYITEM1:	mlog("Community Item1 Selected!\n"); return true;
			case ZACTION_COMMUNITYITEM2:	mlog("Community Item2 Selected!\n"); return true;
			case ZACTION_PREV_WEAPON:
				{
					if ( !ZGetGame()->IsReplay())
						ZGetGameInterface()->ChangeWeapon(ZCWT_PREV);
				}
				return true;
			case ZACTION_NEXT_WEAPON:
				{
					if ( !ZGetGame()->IsReplay())
						ZGetGameInterface()->ChangeWeapon(ZCWT_NEXT);
				}
				return true;
			case ZACTION_RELOAD:
				{
					if ( !ZGetGame()->IsReplay())
						ZGetGameInterface()->Reload();
				}
				return true;
			case ZACTION_DEFENCE:
				{
					if ( ZGetGame()->m_pMyCharacter && !ZGetGame()->IsReplay())
						ZGetGame()->m_pMyCharacter->m_statusFlags.Ref().m_bGuardKey = true;
				}
				return true;

			case ZACTION_TAUNT:		// 틸다키
			case ZACTION_BOW:
			case ZACTION_WAVE:
			case ZACTION_LAUGH:
			case ZACTION_CRY:
			case ZACTION_DANCE:
				{
					if ( ZGetGame()->IsReplay())
						break;
					if ( MEvent::GetShiftState())
						break;
					if(ZGetGameInterface()->GetCombatInterface()->GetObserverMode())
						break;

					ZC_SPMOTION_TYPE mtype;

						 if(pEvent->nKey == ZACTION_TAUNT) mtype = ZC_SPMOTION_TAUNT;
					else if(pEvent->nKey == ZACTION_BOW  ) mtype = ZC_SPMOTION_BOW;
					else if(pEvent->nKey == ZACTION_WAVE ) mtype = ZC_SPMOTION_WAVE;
					else if(pEvent->nKey == ZACTION_LAUGH) mtype = ZC_SPMOTION_LAUGH;
					else if(pEvent->nKey == ZACTION_CRY  ) mtype = ZC_SPMOTION_CRY;
					else if(pEvent->nKey == ZACTION_DANCE) mtype = ZC_SPMOTION_DANCE;
					else 
						return true;

					if(ZGetGame())
						ZGetGame()->PostSpMotion( mtype );	// ZPostSpMotion(mtype);
					
				}
				return true;

			case ZACTION_RECORD:
				{
					if ( ZGetGame() && !ZGetGame()->IsReplay())
						ZGetGame()->ToggleRecording();
				}
				return true;
			case ZACTION_MOVING_PICTURE:
				{	// 동영상 캡쳐...2008.10.02
					if (ZGetGameInterface()->GetBandiCapturer() != NULL)
						ZGetGameInterface()->GetBandiCapturer()->ToggleStart();
				}
				return true;
			case ZACTION_TOGGLE_CHAT:
				{
					if(ZGetCombatInterface()->IsShowUI())
					{ // UI토글이 켜져 있을때만 채팅토글을 처리해준다.
						if (ZGetGame())
						{
							ZCombatInterface* pCombatInterface = ZGetGameInterface()->GetCombatInterface();
							ZGetSoundEngine()->PlaySound("if_error");
							pCombatInterface->ShowChatOutput(!ZGetConfiguration()->GetViewGameChat());
						}
					}
				}
				return true;
			case ZACTION_USE_WEAPON:
			case ZACTION_USE_WEAPON2:
				{
					return true;
				}

			case ZACTION_SENSITIVITY_INC:
			case ZACTION_SENSITIVITY_DEC:
				{
					int nPrev = ZGetConfiguration()->GetMouseSensitivityInInt();
					float senstivity = Z_MOUSE_SENSITIVITY;

					if (pEvent->nKey == ZACTION_SENSITIVITY_INC)
						senstivity += 0.01f;
					else
						senstivity -= 0.01f;

					ZGetConfiguration()->SetMouseSensitivityInFloat(senstivity);

					int nNew = ZGetConfiguration()->GetMouseSensitivityInInt();
					
					ZGetConfiguration()->ReserveSave();
					ZChatOutputMouseSensitivityChanged(nPrev, nNew);
					return true;
				}
			} // switch
		}
		break;

	case MWM_KEYDOWN:
		{
			ZCombatInterface* pCombatInterface = ZGetGameInterface()->GetCombatInterface();

			switch (pEvent->nKey)
			{
			
			case VK_F1:
			case VK_F2:
			case VK_F3:
			case VK_F4:
			case VK_F5:
			case VK_F6:
			case VK_F7:
			case VK_F8:

				if( pEvent->nKey == VK_F1 ) sel = 0;
				else if( pEvent->nKey == VK_F2 ) sel = 1;
				else if( pEvent->nKey == VK_F3 ) sel = 2;
				else if( pEvent->nKey == VK_F4 ) sel = 3;
				else if( pEvent->nKey == VK_F5 ) sel = 4;
				else if( pEvent->nKey == VK_F6 ) sel = 5;
				else if( pEvent->nKey == VK_F7 ) sel = 6;
				else if( pEvent->nKey == VK_F8 ) sel = 7;

				if(ZGetConfiguration()) {

					char* str = ZGetConfiguration()->GetMacro()->GetString( sel );

					if(str) {
						if(ZApplication::GetGameInterface())
							if(ZApplication::GetGameInterface()->GetChat())
								ZApplication::GetGameInterface()->GetChat()->Input(str);
					}
				}
				return true;

			case VK_F9:
				if (ZIsLaunchDevelop())
				{
					ZApplication::GetGameInterface()->GetScreenDebugger()->SwitchDebugInfo();
				}
				else
				{
					// 애들이 어떻게 알고서 쓰길래 막음... -_-;
//					if (pEvent->bCtrl)
//						ZApplication::GetGameInterface()->GetScreenDebugger()->SwitchDebugInfo();
				}

				return true;

			case VK_RETURN:
			case VK_OEM_2:
				{
					if (!ShowCombatInputChat()) return false;
				}
				return true;

			case '0':
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':

			case 'A':
			case 'B':
			case 'C':
			case 'D':
			case 'E':
			case 'F':
			case 'Y':
			case 'N':
				if (pCombatInterface->GetObserver()->IsVisible())
					pCombatInterface->GetObserver()->OnKeyEvent(pEvent->bCtrl, pEvent->nKey);

				if (ZGetGameClient()->CanVote() ||
					ZGetGameInterface()->GetCombatInterface()->GetVoteInterface()->GetShowTargetList() ) 
				{
					ZGetGameInterface()->GetCombatInterface()->GetVoteInterface()->VoteInput(pEvent->nKey);
				}
				break;
			case VK_ESCAPE:		// 메뉴를 부르거나 kick player를 취소한다
				if (ZGetGameInterface()->GetCombatInterface()->GetVoteInterface()->GetShowTargetList()) {
					ZGetGameInterface()->GetCombatInterface()->GetVoteInterface()->CancelVote();
				} else {
					ZGetGameInterface()->ShowMenu(!ZGetGameInterface()->IsMenuVisible());
					ZGetGameInterface()->Show112Dialog(false);
				}

				return true;
			case 'M' : 
				if ( ZGetGame()->IsReplay() && pCombatInterface->GetObserver()->IsVisible())
				{
					if(ZGetGameInterface()->GetCamera()->GetLookMode()==ZCAMERA_FREELOOK)
						ZGetGameInterface()->GetCamera()->SetLookMode(ZCAMERA_MINIMAP);
					else
						ZGetGameInterface()->GetCamera()->SetLookMode(ZCAMERA_FREELOOK);
				}
				break;
			case 'T' :
				if(ZGetGame()->m_pMyCharacter->GetTeamID()==MMT_SPECTATOR &&
					ZGetGame()->GetMatch()->IsTeamPlay() && 
					pCombatInterface->GetObserver()->IsVisible()) {
						ZObserver *pObserver = pCombatInterface->GetObserver();
						pObserver->SetType(pObserver->GetType()==ZOM_BLUE ? ZOM_RED : ZOM_BLUE);
						pObserver->ChangeToNextTarget();

				}
			case 'H':
				if ( ZGetGame()->IsReplay() && pCombatInterface->GetObserver()->IsVisible())
				{
					if ( ZGetGame()->IsShowReplayInfo())
						ZGetGame()->ShowReplayInfo( false);
					else
						ZGetGame()->ShowReplayInfo( true);
				}
				break;
			case 'J':
				{
					#ifdef _CMD_PROFILE
						if ((pEvent->bCtrl) && (ZIsLaunchDevelop()))
						{
							#ifndef _PUBLISH
								ZGetGameClient()->m_CommandProfiler.Analysis();
							#endif
						}
					#endif
				}
				break;
#ifdef _DEBUG
			case 'K':
				{
					rvector pos = ZGetGame()->m_pMyCharacter->GetPosition();
					pos.x+=1;
					ZGetGame()->m_pMyCharacter->SetPosition(pos);
				}
				break;
			case 'L':
				{
					rvector pos = ZGetGame()->m_pMyCharacter->GetPosition();
					pos.x-=1;
					ZGetGame()->m_pMyCharacter->SetPosition(pos);
				}
				break;
			//case 'J':
			//	{
			//		ZGetGame()->m_pMyCharacter->GetPosition().z = ZGetGame()->m_pMyCharacter->GetPosition().z+1;
			//	}
			//	break;
			//case 'M':
			//	{
			//		ZGetGame()->m_pMyCharacter->GetPosition().z = ZGetGame()->m_pMyCharacter->GetPosition().z-1;
			//	}
			//	break;
			case 'U':
				{
					rvector pos = ZGetGame()->m_pMyCharacter->GetPosition();
					pos.x = -3809;
					pos.y = -1330;
					pos.z = 100;
					ZGetGame()->m_pMyCharacter->SetPosition(pos);
					//ZGetGame()->m_pMyCharacter->GetPosition().x = -3809;
					//ZGetGame()->m_pMyCharacter->GetPosition().y = -1337.5;
					//ZGetGame()->m_pMyCharacter->GetPosition().z = 461;
				}
				break;
#endif
			}
		}
		break;

	case MWM_CHAR:
		{
			ZMatch* pMatch = ZGetGame()->GetMatch();
			if (pMatch->IsTeamPlay()) {
				switch(pEvent->nKey) {
				case '\'':
				case '\"':
					{
						ZCombatInterface* pCombatInterface = ZGetGameInterface()->GetCombatInterface();
						pCombatInterface->EnableInputChat(true, true);
					}
					return true;
				};
			}

			// for deutsch, spanish keyboard
			if (pEvent->nKey == '/') {
				if (!ShowCombatInputChat()) return false;
			}
		}
		break;

	case MWM_SYSKEYDOWN:
		{
			// alt+a ~ z(65~90)
			if(pEvent->nKey==90){	// Alt+'Z' // 모든 UI 감추기... by kammir 20081020
				ZGetCombatInterface()->SetIsShowUI(!ZGetCombatInterface()->IsShowUI());
				if (ZGetGame())
				{
					ZCombatInterface* pCombatInterface = ZGetGameInterface()->GetCombatInterface();
					ZGetSoundEngine()->PlaySound("if_error");
					pCombatInterface->ShowChatOutput(ZGetCombatInterface()->IsShowUI());
				}
			}
		}
		break;

	case MWM_MOUSEWHEEL:
		{
			if ( ZGetGame()->IsReplay())
				break;

			int nDelta = pEvent->nDelta;

			if ( (ZGetMyInfo()->IsAdminGrade() && ZGetCombatInterface()->GetObserver()->IsVisible()) ||
				(ZGetGameInterface()->GetScreenDebugger()->IsVisible()) || 
				(!ZGetGameInterface()->m_bViewUI))
			{
				ZCamera* pCamera = ZGetGameInterface()->GetCamera();
				pCamera->m_fDist+=-(float)nDelta;
				pCamera->m_fDist=max(CAMERA_DIST_MIN,pCamera->m_fDist);
				pCamera->m_fDist=min(CAMERA_DIST_MAX,pCamera->m_fDist);
				break;
			}

//			if (nDelta > 0)	ZGetGameInterface()->ChangeWeapon(ZCWT_PREV);
//			else if (nDelta < 0) ZGetGameInterface()->ChangeWeapon(ZCWT_NEXT);
		}break;

	case MWM_MOUSEMOVE:
		{
			if(ZGetGameInterface()->IsCursorEnable()==false)
			{
				return true;
			}
		}
		break;
	} // switch (message)


	return false;
}
long FAR PASCAL WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{

	switch (message)
	{
		case WM_SYSCHAR:
			if(ZIsLaunchDevelop() && wParam==VK_RETURN)
			{
#ifndef _PUBLISH
				RFrame_ToggleFullScreen();
#endif
				return 0;
			}
			break;

		case WM_CREATE:
			if (strlen(Z_LOCALE_HOMEPAGE_TITLE) > 0)
			{
		//		ShowIExplorer(false, Z_LOCALE_HOMEPAGE_TITLE);
			}
			break;
		case WM_DESTROY:
			if (strlen(Z_LOCALE_HOMEPAGE_TITLE) > 0)
			{
		//		ShowIExplorer(true, Z_LOCALE_HOMEPAGE_TITLE);
			}
			break;
		case WM_SETCURSOR:
			if(ZApplication::GetGameInterface())
				ZApplication::GetGameInterface()->OnResetCursor();
			return TRUE; // prevent Windows from setting cursor to window class cursor

		case WM_ENTERIDLE:
			// 모달 대화상자가 코드를 블럭하고 있을 때 부모에게 보내는 idle 통지메시지
			// (일본 IME에 모달 대화상자가 있어서 넣었음)
			// 모달 대화상자로 업데이트 루프를 블럭해서 무적 어뷰즈로 악용되기 때문에 여기서 업데이트를 실행한다
			RFrame_UpdateRender();
			break;

			/*
		case  WM_LBUTTONDOWN:
			SetCapture(hWnd);
			return TRUE;
		case WM_LBUTTONUP:
			ReleaseCapture();
			return TRUE;
			*/
		case WM_KEYDOWN:
			{
				bool b = false;
			}
	}

	if(Core::GetInstance()->ProcessEvent(hWnd, message, wParam, lParam)==true)
	{
		if (ZGetGameInterface() && ZGetGameInterface()->IsReservedResetApp())	// for language changing
		{
			ZGetGameInterface()->ReserveResetApp(false);
			ResetAppResource();
		}

		return 0;
	}

	// thread safe하기위해 넣음
	if (message == WM_CHANGE_GAMESTATE)
	{
		_ZChangeGameState(wParam);
	}


	return DefWindowProc(hWnd, message, wParam, lParam);
}
bool ZGameInput::OnDebugEvent(MEvent* pEvent)
{
#ifdef _PUBLISH

	return false;
#endif

	static bool bMusicMute = false;

	switch(pEvent->nMessage){
	case MWM_KEYDOWN:
		{
			switch (pEvent->nKey)
			{
			case VK_END:
				{
					ZGetGameInterface()->m_bTeenVersion = !ZGetGameInterface()->m_bTeenVersion;
				}
				return true;

			case VK_INSERT:
				{
					g_debug_render_mode++;
					if(g_debug_render_mode > 3)
						g_debug_render_mode = 0;
				}
				return true;

			case VK_DELETE:
				{
					g_bVertex_Soft = !g_bVertex_Soft;
				}
				return true;

			
			//---------------------------------------------------------------------------------------------------
			// VK_F1 부터 VK_F8 까지는 새로운 키맵핑을 위해, Ctrl을 눌렀을 때 동작하도록 수정!
			// Added By 홍기주
			case VK_F1:
				{
					if( pEvent->bCtrl ) {
						ZGetGame()->m_pMyCharacter->SetVisible( !ZGetGame()->m_pMyCharacter->IsVisible() );
					}

					return false;					
				}				
				

			case VK_F2: 
				{
					if( pEvent->bCtrl ) {
						ZGetGameInterface()->ShowInterface(	!ZGetGameInterface()->IsShowInterface() );
					}
					
					return false;
				}
				

			case VK_F3:
				{
					if( pEvent->bCtrl ) {
						if (ZIsLaunchDevelop()) {
							ZApplication::GetGameInterface()->GetScreenDebugger()->SwitchDebugInfo();
							return true;
						}						
					}

					return false;
				}
				

			case VK_F4:
				{
					if( pEvent->bCtrl ) {
						ZGetGame()->m_bShowWireframe=!ZGetGame()->m_bShowWireframe;
						return true;
					}

					return false;
				}

			case VK_F5: 
				{
					if( pEvent->bCtrl ) {
						m_bCTOff = !m_bCTOff;
						RMesh::SetTextureRenderOnOff(m_bCTOff);
						return true;
					}

					return false;
				}
				

			case VK_F6:
				{
					if( pEvent->bCtrl ) {
						g_debug_rot =!g_debug_rot;
						return true;
					}

					return false;
				}

			case VK_F7: 
				{	
					if( pEvent->bCtrl ) {
						// 프로파일링 시작/끝
						extern bool g_bProfile;
						if(g_bProfile) {
							ZPOSTCMD0(ZC_END_PROFILE);
							ZChatOutput("Profile saved.");
						} else {
							ZPOSTCMD0(ZC_BEGIN_PROFILE);
							ZChatOutput("Profile started.");
						}
						return true;
					}

					return false;
				}


			case VK_F8:
				{
					if( pEvent->bCtrl ) {
						RSolidBspNode::m_bTracePath = !RSolidBspNode::m_bTracePath;
					}
					return false;
				}

			case VK_F9:
				{
					static int nIndex = 0;
					nIndex++; if (nIndex >= 2) nIndex = 0;

					if (nIndex == 0)
					{
						ZGetGameInterface()->m_bViewUI = true;
						ZGetGameInterface()->GetGame()->m_pMyCharacter->SetVisible(true);

					}
					else if (nIndex == 1)
					{
						ZGetGameInterface()->m_bViewUI = false;
						ZGetGame()->m_pMyCharacter->SetVisible(false);
						ZGetGameInterface()->GetCombatInterface()->ShowCrossHair(false);
					}
				}
				return false;

			case 'U': {

				ZC_ENCHANT zctype;
//				int Module = 20;

				if(ZGetGame() && ZGetGame()->m_pMyCharacter ) {

					zctype = ZGetGame()->m_pMyCharacter->GetEnchantType();

//						 if(zctype==ZC_ENCHANT_FIRE)		Module = ZMID_FIREDAMAGE;
//					else if(zctype==ZC_ENCHANT_COLD)		Module = ZMID_COLDDAMAGE;
//					else if(zctype==ZC_ENCHANT_LIGHTNING)	Module = ZMID_LIGHTNINGDAMAGE;
//					else if(zctype==ZC_ENCHANT_POISON)		Module = ZMID_POISONDAMAGE;

					if(zctype==ZC_ENCHANT_FIRE) {
						ZModule_FireDamage *pModule = (ZModule_FireDamage*)ZGetGame()->m_pMyCharacter->GetModule(ZMID_FIREDAMAGE);
						pModule->BeginDamage(ZGetGame()->m_pMyCharacter,5,10);
					}
					else if(zctype==ZC_ENCHANT_COLD) {
						ZModule_ColdDamage *pModule = (ZModule_ColdDamage*)ZGetGame()->m_pMyCharacter->GetModule(ZMID_COLDDAMAGE);
						pModule->BeginDamage(10,50);
					}
					else if(zctype==ZC_ENCHANT_LIGHTNING) {
						ZModule_LightningDamage *pModule = (ZModule_LightningDamage*)ZGetGame()->m_pMyCharacter->GetModule(ZMID_LIGHTNINGDAMAGE);
						pModule->BeginDamage(ZGetGame()->m_pMyCharacter,5,10);
					}
					else if(zctype==ZC_ENCHANT_POISON) {
						ZModule_PoisonDamage *pModule = (ZModule_PoisonDamage*)ZGetGame()->m_pMyCharacter->GetModule(ZMID_POISONDAMAGE);
						pModule->BeginDamage(ZGetGame()->m_pMyCharacter,5,10);
					}
				}

				//g_pGame->m_pMyCharacter->ShotBlocked();
//				ZApplication::GetSoundEngine()->StopMusic();
				//ZApplication::GetSoundEngine()->load_preset();
					  }break;

			case 'M':
				{
					if (ZApplication::GetInstance()->GetLaunchMode()==ZApplication::ZLAUNCH_MODE_STANDALONE_GAME)
					{

						// 혼자테스트할때 되살아나기
						if (ZGetGame()->GetMatch()->IsTeamPlay())
						{
							ZCharacter* pCharacter = ZGetGame()->m_pMyCharacter;
							pCharacter->InitStatus();
							rvector pos=rvector(0,0,0), dir=rvector(0,1,0);

							static int nTeamIndex = 0;
							static int nSpawnIndex = 0;

							ZMapSpawnData* pSpawnData = ZGetGame()->GetMapDesc()->GetSpawnManager()->GetTeamData(nTeamIndex, nSpawnIndex);
							if (pSpawnData != NULL)
							{
								pos = pSpawnData->m_Pos;
								dir = pSpawnData->m_Dir;
							}

							pCharacter->SetPosition(pos);
							pCharacter->SetDirection(dir);

							nSpawnIndex++;
							if (nSpawnIndex >= 16) 
							{
								nSpawnIndex = 0;
								nTeamIndex++;
								if (nTeamIndex >= 2) nTeamIndex=0;
							}
						}
						else
						{
							if(ZGetGame()->m_CharacterManager.size()==1)
								ZGetGameInterface()->RespawnMyCharacter();
						}
					}

				}break;

			case 'C' : {
//				ZModule_Skills *pmod = (ZModule_Skills *)g_pGame->m_pMyCharacter->GetModule(ZMID_SKILLS);
//				pmod->Excute(0,MUID(0,0),rvector(0,0,0));
					
//				g_pGame->UpdateCombo(true);


					   }break;

#ifdef _DEBUG
			case 'G' : {
//						MNewMemories::Dump();
//						g_pGame->m_pMyCharacter->m_bGuardTest=!g_pGame->m_pMyCharacter->m_bGuardTest;
					   }break;
#endif

				// 테스트용..
			case 'I' : ZGetGame()->m_pMyCharacter->AddIcon(rand()%5); return true;
				// 테스트^^

			case 'F' : DumpFontTexture(); return true;
//			case 'F' : 
//				{
//					static bool toggle = false;
//					if(toggle)
//						ZGetInput()->SetDeviceForcesXY(1,1);
//					else
//						ZGetInput()->SetDeviceForcesXY(0,0);
//					toggle=!toggle;
//					return true;
//				}
			case 'L' :
				{
//					rvector pos = g_pGame->m_pMyCharacter->GetPosition();
//					pos.x += 1000.0f;
//					ZApplication::GetSoundEngine()->PlayNPCSound(NPC_GOBLIN, NPC_SOUND_WOUND, pos, true);

					ZApplication::GetGameInterface()->FinishGame();
//					ZGetScreenEffectManager()->AddScreenEffect("teamredwin");

					/*
					g_pGame->m_pMyCharacter->m_Position = rvector( 2712.99805 , -1691.46191 , 2649.13403 );
					g_pGame->m_pMyCharacter->Move(rvector( 2.561 , -7.040 , -6.471 ));
					*/

					/*
					g_pGame->m_pMyCharacter->m_Position = rvector( 2713.05347 , -1691.56250 , 2929.06738 );
					g_pGame->m_pMyCharacter->Move(rvector( 0.00000000 , 0.00000000 , -2.07031250 ));
					*/

					/*
					g_pGame->m_pMyCharacter->m_Position = rvector( 1648.73877 ,8691.30176 ,1501.03381 -120);
					g_pGame->m_pMyCharacter->Move(rvector( -0.134,0.004, -0.986 ));
					g_pGame->m_pMyCharacter->m_Velocity = rvector( -450,0,0);
					
					ZPostLocalMessage(MSG_HACKING_DETECTED);
					

					ZGetEffectManager()->AddShotgunEffect(rvector(0,0,100),rvector(0,0,100),rvector(0,1,0),g_pGame->m_pMyCharacter);
					*/
				}break;

			case 'K':
				{
//					rvector pos = g_pGame->m_pMyCharacter->GetPosition();
//					pos.x += 1000.0f;
//					ZApplication::GetSoundEngine()->PlayNPCSound(NPC_GOBLIN, NPC_SOUND_WOUND, pos, false);

//					ZGetGameInterface()->GetCamera()->Shock(2000.f, .5f, rvector(0.0f, 0.0f, -1.0f));
					ZGetScreenEffectManager()->ShockBossGauge(35.0f);

					static int n = 0; n++;
					ZGetScreenEffectManager()->AddKO(n);

//					g_pGame->m_pMyCharacter->OnBlast(rvector(1,0,0));
//					ZGetGameInterface()->GetCamera()->Shock(500.f, .5f, rvector(0.0f, 0.0f, -1.0f));
				}break;
			case 'B':
				{
					// test
					ZCombatInterface* pCombatInterface = ZGetGameInterface()->GetCombatInterface();
					pCombatInterface->SetObserverMode(!pCombatInterface->GetObserver()->IsVisible());
				}
				return true;
			case 'N':
				{
					ZCombatInterface* pCombatInterface = ZGetGameInterface()->GetCombatInterface();
					if(pCombatInterface->GetObserverMode())
						pCombatInterface->GetObserver()->ChangeToNextTarget();
				}
				return true;
			case 'P':
				{
					// test
//					g_pGame->m_pMyCharacter->OnKnockback(rvector(1.0f, 0.0f, 0.0f),200.f);
					ZGetEffectManager()->AddMethorEffect(rvector(0,0,0) , 1 );

				}
				return true;
			case 'O':
				{
					if (ZApplication::GetInstance()->GetLaunchMode()==ZApplication::ZLAUNCH_MODE_STANDALONE_AI)
					{
						ZGetObjectManager()->ClearNPC();
						// npc 생성 test
						MUID uidNPC = MUID(0,0);
						uidNPC.High = rand() % RAND_MAX;
						uidNPC.Low = rand() % RAND_MAX;

						int nNPCType = rand() % NPC_GOBLIN_KING+1;

						nNPCType = NPC_GOBLIN_GUNNER;
						rvector ranpos = rvector(0, 0, 0);

						MQuestNPCInfo* pNPCInfo = NULL;

						if(ZGetQuest())
							pNPCInfo = 	ZGetQuest()->GetNPCInfo(MQUEST_NPC(nNPCType));

						ZActor* pNewActor = ZActor::CreateActor(MQUEST_NPC(nNPCType), 1.0f, 0);
						if (pNewActor)
						{
							pNewActor->SetUID(uidNPC);
							pNewActor->SetPosition(ranpos);
							pNewActor->SetMyControl(true);

							if(pNewActor->m_pVMesh && pNPCInfo) {

								D3DCOLORVALUE color;

								color.r = pNPCInfo->vColor.x;
								color.g = pNPCInfo->vColor.y;
								color.b = pNPCInfo->vColor.z;
								color.a = 1.f;

								pNewActor->m_pVMesh->SetNPCBlendColor(color);//색을 지정한 경우..
							}

							ZGetObjectManager()->Add(pNewActor);
							ZGetEffectManager()->AddReBirthEffect(ranpos);
						}
					}
				}
				return true;
			
/*
			case VK_HOME:

				if(ZGetGameInterface()->GetGame()) {
					RFrameTime* ft = &ZGetGameInterface()->GetGame()->m_pMyCharacter->m_pVMesh->m_FrameTime;

					if( ft->m_bActive ) {
						ft->Stop();
					}
					else {
						ft->Start(20,300);
					}
				}
				return true;
*/
			// 앞으로는 NUMPAD는 매크로로 사용될 것이다. 하하!
			// 그러므로, NUMPAD1~NUMPAD9는 Return false로 수정!
			case VK_NUMPAD0: ZGetGameInterface()->TestToggleCharacter();return true;
			case VK_NUMPAD1: ZGetGameInterface()->TestChangeParts(0);	return false;
			case VK_NUMPAD2: ZGetGameInterface()->TestChangeParts(1);	return false;
			case VK_NUMPAD3: ZGetGameInterface()->TestChangeParts(2);	return false;
			case VK_NUMPAD4: ZGetGameInterface()->TestChangeParts(3);	return false;
			case VK_NUMPAD5: ZGetGameInterface()->TestChangeParts(4);	return false;
			case VK_NUMPAD6: ZGetGameInterface()->TestChangeParts(5);	return false;
			case VK_NUMPAD7: ZGetGameInterface()->TestChangeWeapon();	return false;			
			case VK_NUMPAD9:
				bMusicMute = !bMusicMute;
				ZGetSoundEngine()->SetMusicMute(bMusicMute);
				return false;

			/* 이게 뭐꼬 ? -_-
			case VK_OEM_3:	// `
				{
					ZGetGameInterface()->SetCursorEnable(
						!ZGetGameInterface()->IsCursorEnable());
				}
				return true;
			*/

#ifdef USING_VERTEX_SHADER
			case 'V':
				{
					//RShaderMgr::shader_enabled = !RShaderMgr::shader_enabled;
					RShaderMgr::mbUsingShader = !RShaderMgr::mbUsingShader;
				}
				return false;
#endif			

			}

		}
		break;

	} // switch

	return false;
}