bool ZSurvival::OnSectorBonus(MCommand* pCommand) { MUID uidPlayer; unsigned long int nExpValue = 0; unsigned long int nAddedBP = 0; pCommand->GetParameter(&uidPlayer, 0, MPT_UID); pCommand->GetParameter(&nExpValue, 1, MPT_UINT); pCommand->GetParameter(&nAddedBP, 2, MPT_UINT); int nAddedXP = GetExpFromTransData(nExpValue); int nExpPercent = GetExpPercentFromTransData(nExpValue); if(ZGetCharacterManager()->Find(uidPlayer) == ZGetGame()->m_pMyCharacter) { m_nRewardXP += nAddedXP; m_nRewardBP += nAddedBP; //ZGetScreenEffectManager()->AddExpEffect(nAddedXP); // 획득 경험치 표시 없애기 ZGetMyInfo()->SetLevelPercent(nExpPercent); ZGetScreenEffectManager()->SetGaugeExpFromMyInfo(); } return true; }
void ZSurvival::OnDestroy() { //m_Map.Final(); ZGetNpcMeshMgr()->UnLoadAll(); m_GameInfo.Final(); ZGetScreenEffectManager()->DestroyQuestRes(); }
bool ZSurvival::OnQuestRoundStart(MCommand* pCommand) { unsigned char nRound; pCommand->GetParameter(&nRound, 0, MPT_UCHAR); ZGetScreenEffectManager()->AddRoundStart(int(nRound)); // 월드아이템 초기화 ZGetWorldItemManager()->Reset(); return true; }
bool ZSurvival::OnCreate() { memset(&m_Cheet, 0, sizeof(m_Cheet)); m_bIsRoundClear = false; ZGetQuest()->GetGameInfo()->ClearNPCKilled(); m_fLastWeightTime = 0.0f; //m_Map.Init(); LoadNPCMeshes(); LoadNPCSounds(); return ZGetScreenEffectManager()->CreateQuestRes(); }
void ZSurvival::MoveToNextSector() { ZCharacter *pMyChar = ZGetGame()->m_pMyCharacter; pMyChar->InitStatus(); // 새로운 월드로 이동!! ZGetWorldManager()->SetCurrent(m_GameInfo.GetCurrSectorIndex()); // 이번에 이동할 캐릭터의 위치 int nPosIndex = ZGetCharacterManager()->GetCharacterIndex(pMyChar->GetUID(), false); if (nPosIndex < 0) nPosIndex=0; ZMapSpawnData* pSpawnData = ZGetWorld()->GetDesc()->GetSpawnManager()->GetSoloData(nPosIndex); // 새 좌표로 이동 if (pSpawnData!=NULL && pMyChar!=NULL) { pMyChar->SetPosition(pSpawnData->m_Pos); pMyChar->SetDirection(pSpawnData->m_Dir); ZGetEffectManager()->AddReBirthEffect(pSpawnData->m_Pos); } // 유저 캐릭터를 보여주지 않는다 for(ZCharacterManager::iterator i = ZGetCharacterManager()->begin();i!=ZGetCharacterManager()->end();i++) { i->second->SetVisible(false); } // 현재 npc, 앞으로 생성될 npc, 이펙트, 탄환 전부 숨긴다 (다음 섹터 시작할때까지) ZGetObjectManager()->GetNPCObjectMap()->SetVisibleAll(false); ZGetObjectManager()->GetNPCObjectMap()->ForceInvisibleNewNpc(true); ZGetEffectManager()->EnableDraw(false); ZGetWorldItemManager()->EnableDraw(false); ZGetGame()->m_WeaponManager.EnableRender(false); // ko수 동기화 ZModule_QuestStatus* pMod = (ZModule_QuestStatus*)pMyChar->GetModule(ZMID_QUESTSTATUS); if (pMod) { int nKills = pMod->GetKills(); ZGetScreenEffectManager()->SetKO(nKills); } }
bool ZSurvival::OnPeerNPCDead(MCommand* pCommand) { MUID uidKiller, uidNPC; pCommand->GetParameter(&uidKiller, 0, MPT_UID); pCommand->GetParameter(&uidNPC, 1, MPT_UID); ZActor* pActor = ZGetObjectManager()->GetNPCObject(uidNPC); if (pActor) { pActor->OnPeerDie(uidKiller); if (uidKiller == ZGetMyUID()) { ZModule_QuestStatus* pMod = (ZModule_QuestStatus*)ZGetGame()->m_pMyCharacter->GetModule(ZMID_QUESTSTATUS); if (pMod) { ZGetScreenEffectManager()->AddKO(); } } } return true; }
void ZInterfaceBackground::Draw(void) { #ifdef _FASTDEBUG MWidget* pWidget = (MWidget*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSelection"); if ( pWidget) { if ( ZApplication::GetGameInterface()->GetState() == GUNZ_CHARSELECTION) pWidget->Show( true); } MPicture* pPicture = (MPicture*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSel_TopScreen"); if ( pPicture) pPicture->SetOpacity( 0); return; #endif // Set rendering state RSetViewport( 0, 0, RGetScreenWidth(), RGetScreenHeight()); RGetDevice()->SetRenderState( D3DRS_CULLMODE ,D3DCULL_CW); // from rbs rendering RGetDevice()->SetRenderState( D3DRS_NORMALIZENORMALS , TRUE ); RGetDevice()->SetSamplerState( 0, D3DSAMP_MINFILTER , D3DTEXF_LINEAR); // Texture filtering RGetDevice()->SetSamplerState( 0, D3DSAMP_MAGFILTER , D3DTEXF_LINEAR); RGetDevice()->SetSamplerState( 0, D3DSAMP_MIPFILTER , D3DTEXF_LINEAR); // Set camera position and direction rvector vCamPos, vCamDir; float fForgDensity; switch ( m_nSceneNumber) { case LOGIN_SCENE_FIXEDSKY : { // Fixed camera vCamPos = m_vCamPosSt; vCamDir = m_vCamDirSt; // Fixed fog -> black screen fForgDensity = 0.0f; break; } case LOGIN_SCENE_FALLDOWN : { // Get current clock DWORD dwClock = ( timeGetTime() - m_dwClock); /* // Show maiet logo if ( !m_bShowMaietLogo) { m_bShowMaietLogo = true; ZGetScreenEffectManager()->AddScreenEffect( "maiet_logo"); } */ // Set fog density fForgDensity = dwClock * 15.0f; // Set wait time if ( dwClock < 500) dwClock = 0; else dwClock -= 500; // Play BGM music //PenguinGuy // if ( dwClock > 2000) // ZApplication::GetSoundEngine()->PlayMusic( true); // End of scroll camera float fSeed = dwClock * 0.00035f; // 카메라가 전부 다 내려오기 까지 걸리는 시간( dwClock에 곱해주는 값이 // 작을수록 빨리 내려옴) if ( fSeed > 3.14) { m_nSceneNumber = LOGIN_SCENE_FIXEDCHAR; // m_bShowMaietLogo = false; } // Move camera position & direction float fGain = ( cos( fSeed) + 1.0f) / 2.0f; // 0 < fGain < 1.0 vCamPos = m_vCamPosEd + ( m_vCamPosSt - m_vCamPosEd) * fGain; vCamDir = m_vCamDirEd + ( m_vCamDirSt - m_vCamDirEd) * fGain; //if (m_bShowMaietLogo) //{ // ZGetScreenEffectManager()->UpdateEffects(); ZGetScreenEffectManager()->DrawEffects(); //} break; } case LOGIN_SCENE_FIXEDCHAR : { // Show menu UI MWidget* pWidget = (MWidget*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSelection"); if ( pWidget) { if ( ZApplication::GetGameInterface()->GetState() == GUNZ_CHARSELECTION) pWidget->Show( true); } MPicture* pPicture = (MPicture*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSel_TopScreen"); if ( pPicture) pPicture->SetOpacity( 0); // Play BGM music //PenguinGuy // ZApplication::GetSoundEngine()->PlayMusic( true); // Fixed camera vCamPos = m_vCamPosEd; vCamDir = m_vCamDirEd; #define FADE_IN_TIME 500 DWORD dwClock = ( timeGetTime() - m_dwClock); float fGain = ((float)dwClock / (float)FADE_IN_TIME); if (fGain > 1.0f) fGain = 1.0f; SetFogMulti(fGain); // Cleared fog fForgDensity = 50000.0f; break; } case LOGIN_SCENE_SELECTCHAR : { // Get current clock DWORD dwClock = ( timeGetTime() - m_dwClock); float fGain = ( cos( dwClock * 0.0012f) + 1.0f) / 2.0f; //vCamPos = m_vCamPosEd + ( m_vCamPosSt - m_vCamPosEd) * fGain; //vCamDir = m_vCamDirEd + ( m_vCamDirSt - m_vCamDirEd) * fGain; vCamPos = m_vCamPosSt; vCamDir = m_vCamDirSt; MPicture* pPicture = (MPicture*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "CharSel_TopScreen"); if ( pPicture) { // Set wait time if ( dwClock < 2000) dwClock = 0; else dwClock -= 2000; // Set opacity of black screen int nOpacity = (int)( dwClock / 3.0f); if ( nOpacity > 255) nOpacity = 255; pPicture->SetOpacity( nOpacity); } // Cleared fog fForgDensity = 50000.0f; break; } case LOGIN_ROAMING : { #define ROAM_SPEED 10000 DWORD dwClock = ( timeGetTime() - m_dwClock); /*if (GetAsyncKeyState(VK_NUMPAD2) & 0x8000) off.y -= 1.0f; if (GetAsyncKeyState(VK_NUMPAD8) & 0x8000) off.y += 1.0f; if (GetAsyncKeyState(VK_NUMPAD4) & 0x8000) off.x += 1.0f; if (GetAsyncKeyState(VK_NUMPAD6) & 0x8000) off.x -= 1.0f; if (GetAsyncKeyState(VK_NUMPAD7) & 0x8000) off.z -= 1.0f; if (GetAsyncKeyState(VK_NUMPAD9) & 0x8000) off.z += 1.0f; vCamPos = m_vCamPosEd + off; vCamDir = m_vCamDirEd; // Cleared fog fForgDensity = 50000.0f;*/ float fGain = ((float)dwClock / (float)ROAM_SPEED); if (fGain > 1.0f) fGain = 1.0f; //vCamDir = mapVecs[mapIndex].second - mapVecs[mapIndex].first; vCamDir = m_vCamDirEd; vCamPos = mapVecs[mapIndex].first + ((mapVecs[mapIndex].second - mapVecs[mapIndex].first) * fGain) + D3DXVECTOR3(0.f,-100.f,0.f); if (dwClock > ROAM_SPEED) { m_dwClock = timeGetTime(); mapIndex = rand() % mapVecs.size(); } //fForgDensity = 50000.0f; //Clear fForgDensity = ((-4 * fGain * fGain) + (4 * fGain)) * 20000.f; break; } } //Fog adjust fForgDensity *= m_fFogMulti; // Set camera RSetCamera( vCamPos, (vCamPos + vCamDir), rvector( 0, 0, 1)); // Draw RSetProjection( D3DX_PI * 70 / 180, RGetScreenWidth() / (float)RGetScreenHeight(), 10.0f, 15000.0f); SetFogState( fForgDensity-10000.0f, fForgDensity, 0x00000000); D3DXMatrixTranslation( &m_matWorld, 0, 0, 0); RGetDevice()->SetTransform( D3DTS_WORLD, &m_matWorld); // Draw background if ( m_pLogin) { m_pLogin->Draw(); m_pLogin->DrawObjects(); } if ( m_pMapDesc) m_pMapDesc->DrawMapDesc(); // Draw effects(smoke, cloud) // ZGetEffectManager()->Draw( timeGetTime()); // Draw maiet logo effect // ZGetScreenEffectManager()->DrawEffects(); }
void ZInterfaceBackground::OnUpdate(float fElapsed) { ZGetEffectManager()->Update( fElapsed); ZGetScreenEffectManager()->UpdateEffects(); }
void ZActor::OnDamaged(ZObject* pAttacker, rvector srcPos, ZDAMAGETYPE damageType, MMatchWeaponType weaponType, float fDamage, float fPiercingRatio, int nMeleeType) { if (!CheckFlag(AF_SOUND_WOUNDED)) { bool bMyKill = false; if (pAttacker) { bMyKill = (pAttacker == g_pGame->m_pMyCharacter); } rvector pos_sound = GetPosition(); pos_sound.z += m_Collision.fHeight - 10.0f; ZApplication::GetSoundEngine()->PlayNPCSound(m_pNPCInfo->nID, NPC_SOUND_WOUND, pos_sound, bMyKill); SetFlag(AF_SOUND_WOUNDED, true); } if ((m_pNPCInfo->nGrade == NPC_GRADE_BOSS) || (m_pNPCInfo->nGrade == NPC_GRADE_LEGENDARY)) { if (ZGetQuest()->GetGameInfo()->GetBoss() == GetUID()) { ZGetScreenEffectManager()->ShockBossGauge(fDamage); } } if ((damageType == ZD_BULLET) || (damageType == ZD_BULLET_HEADSHOT)) { m_nDamageCount++; } if(CheckFlag(AF_MY_CONTROL)) { bool bSkipDamagedAnimation = false; if(m_pNPCInfo->bNeverAttackCancel ) { bSkipDamagedAnimation = ZActorAnimation::IsSkippableDamagedAnimation(GetCurrAni()); } if(bSkipDamagedAnimation==false) { if((damageType==ZD_MELEE) || (damageType==ZD_KATANA_SPLASH)) { ZCharacterObject* pCObj = MDynamicCast(ZCharacterObject, pAttacker); bool bLightningDamage = false; if(pCObj) { ZC_ENCHANT etype = pCObj->GetEnchantType(); if( etype == ZC_ENCHANT_LIGHTNING ) bLightningDamage = true; } if(bLightningDamage && (damageType==ZD_KATANA_SPLASH)) { m_Animation.Input(ZA_EVENT_LIGHTNING_DAMAGED); } else { if(nMeleeType%2) m_Animation.Input(ZA_EVENT_MELEE_DAMAGED1); else m_Animation.Input(ZA_EVENT_MELEE_DAMAGED2); } SetVelocity(0,0,0); } else { if( GetNPCInfo()->bNeverPushed == false) { if (m_nDamageCount >= 5) { m_Animation.Input(ZA_EVENT_RANGE_DAMAGED); m_nDamageCount = 0; } } } } } ZObject::OnDamaged(pAttacker,srcPos,damageType,weaponType,fDamage,fPiercingRatio,nMeleeType); }
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; }