Files
Client/GameTools/NeoRylClient/AkhanGUI.cpp
LGram16 dd97ddec92 Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code:
- Client: Game client source (moved to Client/Client/)
- Server: Game server source
- GameTools: Development tools
- CryptoSource: Encryption utilities
- database: Database scripts
- Script: Game scripts
- rylCoder_16.02.2008_src: Legacy coder tools
- GMFont, Game: Additional resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 20:17:20 +09:00

3561 lines
118 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// AkhanGUI.cpp: implementation of the CAkhanGUI class.
//
//////////////////////////////////////////////////////////////////////
//#include <crtdbg.h>
#include "ClientMain.h"
#include "FrameTimer.h"
#include "AkhanGUI.h"
#include "Z3DRenderable.h"
#include "GUITextEdit.h"
#include "WinInput.h"
#include "GUIMessageBoxManager.h"
#include <mmsystem.h>
#include "resource.h"
#include "Creature\NPC\NPCList.h"
#include "Item\ItemMgr.h"
#include "Skill\SkillMgr.h"
#include "SkillSystem.h"
#include "AkhanChrSelect1.h"
#include "AkhanChrSelect2.h"
#include "AkhanChrCreate.h"
#include "HumanMiniStates.h"
#include "HumanChatWindow.h"
#include "HumanShortcut.h"
#include "HumanStatus.h"
#include "HumanSkill.h"
#include "AkhanInven.h"
#include "HumanSociety.h"
#include "CommonOption.h"
#include "AkhanTrade.h"
#include "HumanMinimap.h"
#include "HumanQuick.h"
#include "HumanSimpleWindow.h"
#include "HumanSimpleParty.h"
#include "HumanUpgrade.h"
#include "AkhanJobChange.h"
#include "HumanSimpleChat.h"
#include "HumanExchange.h"
#include "HumanChannel.h"
#include "AkhanRespawn.h"
#include "HumanVault.h"
#include "HumanStreetStall.h"
#include "HumanQuestDesc.h"
#include "HumanQuest.h"
#include "RenderOption.h"
#include <dxutil.h>
#include <SectorSoundMap.h>
#include <BGMController.h>
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CAkhanGUI::CAkhanGUI()
{
m_nPreSelectItem=0xffffffff;
m_dwNormalTargetChrID = 0xFFFFFFFF;
m_dwSpecialTargetChrID = 0xFFFFFFFF;
m_pCastingEffect = NULL;
}
CAkhanGUI::~CAkhanGUI()
{
}
BOOL CAkhanGUI::InitChrSelect(void)
{
char strPath[MAX_PATH];
g_ClientMain.m_lpSceneManager->m_ViewerMode = 2;
sprintf(strPath, "%s\\Cslct_a.z3s", g_ClientMain.m_strClientPath);
g_ClientMain.m_lpSceneManager->LoadMap(strPath);
// g_ClientMain.ResetTerrain();
g_ClientMain.m_lpSceneManager->GetCamera()->SetTotalAniTime(3000.0f);
g_ClientMain.m_lpSceneManager->GetCamera()->Unload();
CViewCamera::CameraNode AddNode;
AddNode.m_qAngle.Identity();
AddNode.m_qAngle.x = 0.181763f;
AddNode.m_qAngle.y = -0.478874f;
AddNode.m_qAngle.z = 0.102069f;
AddNode.m_qAngle.w = 0.852774f;
AddNode.m_vecPos = vector3(29157.087891f, 1444.268433f, 6999.378418f);
/* AddNode.m_qAngle.Pitch(FLOAT_DEG(32.0f));
AddNode.m_qAngle.Yaw(FLOAT_DEG(330.0f));
AddNode.m_qAngle.Roll(FLOAT_DEG(0.0f));
AddNode.m_vecPos = vector3(33537.99f, 1455.87f, 4032.49f);*/
AddNode.m_Time = 0;
g_ClientMain.m_lpSceneManager->GetCamera()->m_CameraAnimateList.Add(AddNode);
AddNode.m_Time = 100;
g_ClientMain.m_lpSceneManager->GetCamera()->m_CameraAnimateList.Add(AddNode);
g_ClientMain.m_lpSceneManager->SetWeatherTime(2.0f);
char strShape[15][256], Sex[MAX_PATH], Hair[MAX_PATH], Face[MAX_PATH];
/*
g_ClientMain.m_vecCharSelectPos[0] = vector3(25591.17f, 1144.35f, 4822.25f);
g_ClientMain.m_vecCharSelectPos[1] = vector3(25980.13f, 1199.68f, 4967.17f);
g_ClientMain.m_vecCharSelectPos[2] = vector3(25922.16f, 890.97f, 4930.77f);
*/
g_ClientMain.m_vecCharSelectPos[0] = vector3(28540.56f, 1032.78f - 42.0f, 7050.20f);
g_ClientMain.m_vecCharSelectPos[1] = vector3(28736.34f, 922.89f - 42.0f, 7409.39f);
g_ClientMain.m_vecCharSelectPos[2] = vector3(28831.70f, 1325.58f - 42.0f, 7406.12f);
for(int i = 0; i < 3; i++)
{
if(g_ClientMain.m_scLoginChar[i].UID)
{
if(g_ClientMain.m_scLoginChar[i].Sex == 1) strcpy(Sex, "PC_Akhan_A.GCMDS"); else strcpy(Sex, "PC_Akhan_B.GCMDS");
sprintf(Hair, "HAIR%02d", g_ClientMain.m_scLoginChar[i].Hair);
sprintf(Face, "FACE%02d", g_ClientMain.m_scLoginChar[i].Face);
char *strTemp;
for(int j = 0; j < 15; j++)
{
strTemp = (char *)g_ItemMgr.GetEquipName(g_ClientMain.m_scLoginChar[i].Equip[j]);
if(strTemp) strcpy(strShape[j], strTemp); else strcpy(strShape[j], "");
}
g_CharacterData.AddCharacter(g_ClientMain.m_scLoginChar[i].UID, g_ClientMain.m_scLoginChar[i].Nationality, g_ClientMain.m_scLoginChar[i].Name, Sex, Face, Hair, g_ClientMain.m_vecCharSelectPos[i], 0.0f, strShape);
// g_CharacterData.m_lstCharData[i].SetAlphaLevel(1.0f);
CCreature *lpCreature = g_CharacterData.GetCreature(g_ClientMain.m_scLoginChar[i].UID);
if(lpCreature)
{
lpCreature->m_cNation = g_ClientMain.m_scLoginChar[i].Nationality;
lpCreature->SetShape(strShape);
lpCreature->InitWeapon(0);
}
} else
{
for(int j = 0; j < 15; j++)
{
strcpy(strShape[j], "");
}
g_CharacterData.AddCharacter(0xC0000000 + i, NATION_AKHAN, "", "PC_Akhan_A.GCMDS", "FACE01", "HAIR01", g_ClientMain.m_vecCharSelectPos[i], 0.0f, strShape);
// g_CharacterData.m_lstCharData[i].SetAlphaLevel(0.0f);
CCreature *lpCreature = g_CharacterData.GetCreature(0xC0000000 + i);
if(lpCreature)
{
lpCreature->m_cNation = g_ClientMain.m_scLoginChar[i].Nationality;
lpCreature->SetShape(strShape);
lpCreature->InitWeapon(0);
}
}
}
g_ClientMain.m_lpCommonInterface->InitLoading();
g_ClientMain.m_dwClientMode = CLIENT_CHARACTERSELECTLOADING;
g_ClientMain.m_dwClientState = CHRSELECT_INITSELECT;
g_ClientMain.m_dwSelectChr = 0xFFFFFFFF;
CTexture::SetPath(INTERFACETEXTUREPATH);
CTexture *lpTexture;
// 0
lpTexture = new CTexture;
lpTexture->Load("cslct01.dds");
m_lstTexture.push_back(lpTexture);
// 1
lpTexture = new CTexture;
lpTexture->Load("cslct02.dds");
m_lstTexture.push_back(lpTexture);
// 2
lpTexture = new CTexture;
lpTexture->Load("cslct03.dds");
m_lstTexture.push_back(lpTexture);
// 3
lpTexture = new CTexture;
lpTexture->Load("ccr01_a.dds");
m_lstTexture.push_back(lpTexture);
// 4
lpTexture = new CTexture;
lpTexture->Load("ccr02.dds");
m_lstTexture.push_back(lpTexture);
// 5
lpTexture = new CTexture;
lpTexture->Load("ccr03.dds");
m_lstTexture.push_back(lpTexture);
// 6
lpTexture = new CTexture;
lpTexture->Load("ccr04_a.dds");
m_lstTexture.push_back(lpTexture);
// 7
lpTexture = new CTexture;
lpTexture->Load("ccr05.dds");
m_lstTexture.push_back(lpTexture);
// 8
lpTexture = new CTexture;
lpTexture->Load("ccr06_a.dds");
m_lstTexture.push_back(lpTexture);
// 9
lpTexture = new CTexture;
lpTexture->Load("ccr07_a.dds");
m_lstTexture.push_back(lpTexture);
CGUIWindow *lpWindow;
lpWindow = new CAkhanChrSelect1;
lpWindow->Init(0, 0);
m_lstWindow.push_back(lpWindow);
lpWindow = new CAkhanChrSelect2;
lpWindow->Init(0, 0);
m_lstWindow.push_back(lpWindow);
lpWindow = new CAkhanChrCreate;
lpWindow->Init(22, 37);
m_lstWindow.push_back(lpWindow);
// m_dwEnterGameStep = 0;
try
{
CSoundManager &sm = CSoundManager::GetInstance();
char Temp[MAX_PATH];
sprintf(Temp, "%s\\Chr.ogg", g_ClientMain.m_strClientPath);
g_ClientMain.m_lpBackGroundMusic = &sm.GetBuffer(Temp, false, true);
g_ClientMain.m_lpBackGroundMusic->Play(true);
} catch(exception & e)
{
e = 0;
g_ClientMain.m_lpBackGroundMusic = NULL;
}/**/
return TRUE;
}
void CAkhanGUI::UpdateChrSelect(void)
{
g_ClientMain.m_lpSceneManager->UpdateScene(CFrameTimer::GetUpdateTimer(g_ClientMain.m_nSceneManagerTimerID));
g_ClientMain.m_lpSceneManager->GetCamera()->PlayAnimate();
for(int cChr = 0; cChr < 3; cChr++)
{
if(g_CharacterData.m_lstCharData[cChr]->m_lpChrModel->IsActionFinished(0))
g_CharacterData.m_lstCharData[cChr]->m_lpChrModel->SetMotion("WAIT");
}
BOOL bClick = FALSE, bEdge = FALSE;
switch(g_ClientMain.m_dwClientState)
{
case CHRSELECT_INITSELECT:
m_lstWindow[0]->InitValue();
g_ClientMain.m_dwClientState = CHRSELECT_SELECT;
break;
case CHRSELECT_SELECT:
m_lstWindow[0]->Update(bClick, bEdge);
break;
case CHRSELECT_INITSTART:
m_lstWindow[1]->InitValue();
g_ClientMain.m_dwClientState = CHRSELECT_START;
break;
case CHRSELECT_START:
m_lstWindow[1]->Update(bClick, bEdge);
break;
case CHRSELECT_INITCREATE:
m_lstWindow[2]->InitValue();
g_ClientMain.m_dwClientState = CHRSELECT_CREATE;
break;
case CHRSELECT_CREATE:
m_lstWindow[2]->Update(bClick, bEdge);
break;
}
}
void CAkhanGUI::RenderChrSelect(LPDIRECT3DDEVICE8 lpD3DDevice)
{
lpD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
lpD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
lpD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
lpD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);
lpD3DDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_LESSEQUAL);
lpD3DDevice->SetRenderState(D3DRS_FOGENABLE, TRUE);
lpD3DDevice->SetRenderState(D3DRS_LIGHTING, TRUE);
g_ClientMain.m_lpSceneManager->Render();
lpD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
lpD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
lpD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
lpD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_POINT);
lpD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_POINT);
lpD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
lpD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
lpD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
lpD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
lpD3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
lpD3DDevice->SetRenderState(D3DRS_FOGENABLE, FALSE);
lpD3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
switch(g_ClientMain.m_dwClientState)
{
case CHRSELECT_SELECT:
m_lstWindow[0]->Render(lpD3DDevice);
// g_ClientMain.m_lpCommonInterface->RenderLoading(lpD3DDevice);
break;
case CHRSELECT_START:
m_lstWindow[1]->Render(lpD3DDevice);
break;
case CHRSELECT_CREATE:
m_lstWindow[2]->Render(lpD3DDevice);
break;
}
}
BOOL CAkhanGUI::InitGame(void)
{
DestroyAllObject();
g_CharacterData.DeleteAllCharacter();
InitZone(g_ClientMain.m_dwPresentZone);
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
if(!strcmp(g_ClientMain.m_csStatus.m_Info.Name, ""))
{
g_ClientMain.m_vecStartPosition = vector3(268742.6270f, 2519.8332f, 53045.1599f);
strcpy(g_ClientMain.m_csStatus.m_Info.Name, "Belldandy");
g_ClientMain.m_csStatus.m_Info.Class = 1;
g_ClientMain.m_csStatus.m_Info.Sex = 1;
g_ClientMain.m_csStatus.m_Info.Hair = 2;
g_ClientMain.m_csStatus.m_Info.Face = 1;
g_ClientMain.m_csStatus.m_Info.Level = 1;
g_ClientMain.m_csStatus.m_Info.Nationality = 1;
g_ClientMain.m_csStatus.m_Info.STR = 25;
g_ClientMain.m_csStatus.m_Info.DEX = 20;
g_ClientMain.m_csStatus.m_Info.CON = 20;
g_ClientMain.m_csStatus.m_Info.INT = 20;
g_ClientMain.m_csStatus.m_Info.WIS = 20;
g_ClientMain.m_csStatus.m_Info.Exp = 0;
g_ClientMain.m_csStatus.m_llExpMax = 1100;
g_ClientMain.m_csStatus.m_Info.IP = 1;
g_ClientMain.m_csStatus.m_Info.HP = 100;
g_ClientMain.m_csStatus.m_Info.MP = 100;
g_ClientMain.m_csStatus.m_Info.Merits = 0;
g_ClientMain.m_csStatus.m_Info.Fame = 0;
g_ClientMain.m_csStatus.m_Skill.wSlotNum = 10;
g_ClientMain.m_csStatus.m_Skill.wSkillNum = 100;
for(int i = 0; i < 20; i++)
{
g_ClientMain.m_csStatus.m_lstSkillSlot[i] = NULL;
}
g_ClientMain.m_csStatus.m_PartyInfo.m_cMemberNum = 2;
g_ClientMain.m_csStatus.m_PartyInfo.m_dwLeaderID = g_ClientMain.m_dwMyChrID;
g_ClientMain.m_csStatus.m_PartyInfo.MemberCID[0] = g_ClientMain.m_dwMyChrID;
strcpy(g_ClientMain.m_csStatus.m_PartyInfo.Name[0], g_ClientMain.m_csStatus.m_Info.Name);
g_ClientMain.m_csStatus.m_PartyInfo.MemberCID[1] = 100;
strcpy(g_ClientMain.m_csStatus.m_PartyInfo.Name[1], "<EFBFBD>ٺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
g_ClientMain.m_csStatus.m_Skill.SSlot[0].SKILLINFO.wSkill = 0x8102;
g_ClientMain.m_csStatus.m_Skill.SSlot[0].SKILLINFO.cLockCount = 3;
g_ClientMain.m_csStatus.m_Skill.SSlot[0].SKILLINFO.cSkillLevel = 1;
g_ClientMain.m_csStatus.m_lstSkillSlot[0] = new CItemInstance;
g_ClientMain.m_csStatus.m_lstSkillSlot[0]->SetSkillInfo(g_ClientMain.m_csStatus.m_Skill.SSlot[0].SKILLINFO.wSkill,
g_ClientMain.m_csStatus.m_Skill.SSlot[0].SKILLINFO.cLockCount, g_ClientMain.m_csStatus.m_Skill.SSlot[0].SKILLINFO.cSkillLevel,
ClientSocket::ItemPos_SSlot, 0, 0);
g_ClientMain.m_csStatus.m_Skill.SSlot[1].SKILLINFO.wSkill = 0x8202;
g_ClientMain.m_csStatus.m_Skill.SSlot[1].SKILLINFO.cLockCount = 1;
g_ClientMain.m_csStatus.m_Skill.SSlot[1].SKILLINFO.cSkillLevel = 6;
g_ClientMain.m_csStatus.m_Skill.SSlot[2].SKILLINFO.wSkill = 0x8103;
g_ClientMain.m_csStatus.m_Skill.SSlot[2].SKILLINFO.cLockCount = 1;
g_ClientMain.m_csStatus.m_Skill.SSlot[2].SKILLINFO.cSkillLevel = 2;
g_ClientMain.m_csStatus.m_Skill.SSlot[3].SKILLINFO.wSkill = 0x8104;
g_ClientMain.m_csStatus.m_Skill.SSlot[3].SKILLINFO.cLockCount = 0;
g_ClientMain.m_csStatus.m_Skill.SSlot[3].SKILLINFO.cSkillLevel = 3;
g_ClientMain.m_csStatus.m_Skill.SSlot[4].SKILLINFO.wSkill = 0x8105;
g_ClientMain.m_csStatus.m_Skill.SSlot[4].SKILLINFO.cLockCount = 1;
g_ClientMain.m_csStatus.m_Skill.SSlot[4].SKILLINFO.cSkillLevel = 5;
g_ClientMain.m_csStatus.m_Skill.SSlot[5].SKILLINFO.wSkill = 0x8302;
g_ClientMain.m_csStatus.m_Skill.SSlot[5].SKILLINFO.cLockCount = 0;
g_ClientMain.m_csStatus.m_Skill.SSlot[5].SKILLINFO.cSkillLevel = 1;
g_ClientMain.m_csStatus.m_Skill.SSlot[6].SKILLINFO.wSkill = 0x8403;
g_ClientMain.m_csStatus.m_Skill.SSlot[6].SKILLINFO.cLockCount = 0;
g_ClientMain.m_csStatus.m_Skill.SSlot[6].SKILLINFO.cSkillLevel = 5;
g_ClientMain.m_csStatus.m_Skill.SSlot[7].SKILLINFO.wSkill = 0x8404;
g_ClientMain.m_csStatus.m_Skill.SSlot[7].SKILLINFO.cLockCount = 0;
g_ClientMain.m_csStatus.m_Skill.SSlot[7].SKILLINFO.cSkillLevel = 2;
g_ClientMain.m_csStatus.m_Skill.SSlot[8].SKILLINFO.wSkill = 0x8406;
g_ClientMain.m_csStatus.m_Skill.SSlot[8].SKILLINFO.cLockCount = 2;
g_ClientMain.m_csStatus.m_Skill.SSlot[8].SKILLINFO.cSkillLevel = 6;
g_ClientMain.m_csStatus.m_Skill.SSlot[9].SKILLINFO.wSkill = 0x8504;
g_ClientMain.m_csStatus.m_Skill.SSlot[9].SKILLINFO.cLockCount = 1;
g_ClientMain.m_csStatus.m_Skill.SSlot[9].SKILLINFO.cSkillLevel = 6;
/* CItemInstance *lpItem;
lpItem = new CItemInstance;
lpItem->m_dwItemUID = 0;
lpItem->m_wPutX = 200;
lpItem->m_wPutY = 200;
lpItem->m_lpItem = g_ItemMgr.GetProtoType(1607);
lpItem->m_lpItem->m_lpItemBase->m_ItemInfo.m_nItemIndex.EvenPos.m_PosX = 0;
lpItem->m_lpItem->m_lpItemBase->m_ItemInfo.m_nItemIndex.EvenPos.m_PosY = 0;
lpItem->m_lpItem->m_lpItemBase->m_ItemInfo.m_nItemIndex.EvenPos.m_Tab = 0;
lpItem->m_lpSprite = new CSprite;
lpItem->m_lpSprite->Create(0, 0, lpItem->m_lpItem->m_lpProtoTypeInfo->m_nSpriteMinX,
lpItem->m_lpItem->m_lpProtoTypeInfo->m_nSpriteMinY, lpItem->m_lpItem->m_lpProtoTypeInfo->m_nSpriteMaxX,
lpItem->m_lpItem->m_lpProtoTypeInfo->m_nSpriteMaxY, NULL);
g_ClientMain.m_csStatus.m_lstInventory.push_back(lpItem);
g_ClientMain.m_csStatus.CheckInvenField(1, lpItem);
g_ClientMain.m_csStatus.m_cWeaponPos = 0;*/
g_ClientMain.m_csStatus.m_cWeaponPos = 0;
g_ClientMain.m_csStatus.StatusUpdate();
}/**/
////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
g_ClientMain.m_csStatus.m_cWeaponPos = 0;
if(g_ClientMain.m_vecStartPosition.y<10.0f)
{
g_ClientMain.m_vecStartPosition.y=CSceneManager::m_HeightField.GetHeight(g_ClientMain.m_vecStartPosition);
}
g_ClientMain.m_lpSceneManager->GetCamera()->LookAt(vector3(0.0f, 150.0f, -300.0f) + g_ClientMain.m_vecStartPosition,
vector3(0.0f, 150.0f, 0.0f) + g_ClientMain.m_vecStartPosition,
vector3(0.0f, 1.0f, 0.0f));
g_ClientMain.m_lpSceneManager->GetCamera()->m_vecCameraPosition = vector3(0.0f, 150.0f, -300.0f);
g_ClientMain.m_lpSceneManager->GetCamera()->m_vecCameraPosition.Normalize();
g_CharacterData.m_Camera.m_fCameraRotY += (-50 / 300.0f);
char strSex[MAX_PATH], strFace[MAX_PATH], strHair[MAX_PATH];
char *strTemp, strShape[15][256];
for(int j = 0; j < 15; j++)
{
if(g_ClientMain.m_csStatus.m_lstEquipment[j])
{
strTemp = (char *)g_ItemMgr.GetEquipName(g_ClientMain.m_csStatus.m_lstEquipment[j]->GetProtoTypeID());
} else
{
strTemp = NULL;
}
if(strTemp) strcpy(strShape[j], strTemp); else strcpy(strShape[j], "");
}
if(g_ClientMain.m_csStatus.m_Info.Sex == 1) strcpy(strSex, "PC_Akhan_A.GCMDS"); else strcpy(strSex, "PC_Akhan_B.GCMDS");
sprintf(strFace, "FACE%02d", g_ClientMain.m_csStatus.m_Info.Face);
sprintf(strHair, "HAIR%02d", g_ClientMain.m_csStatus.m_Info.Hair);
g_CharacterData.AddCharacter(g_ClientMain.m_dwMyChrID, g_ClientMain.m_csStatus.m_Info.Nationality, g_ClientMain.m_csStatus.m_Info.Name, strSex, strFace, strHair, g_ClientMain.m_vecStartPosition, 0.0f, strShape);
g_CharacterData.m_nFocusCharacter = g_CharacterData.m_lstCharData.num - 1;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_bPeaceMode = g_ClientMain.m_bPeaceMode;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_bUsed = TRUE;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_dwPartyID = g_ClientMain.m_csStatus.m_Info.Party;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_wClass = g_ClientMain.m_csStatus.m_Info.Class;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_cLevel = g_ClientMain.m_csStatus.m_Info.Level;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_cNation = g_ClientMain.m_csStatus.m_Info.Nationality;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_cSex = g_ClientMain.m_csStatus.m_Info.Sex;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->SetShape(strShape);
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->InitWeapon(0);
if(g_ClientMain.m_csStatus.m_Info.HP <= 0)
{
g_ClientMain.m_csStatus.m_Info.HP = 0;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_sCurrHP = 0;
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->Dead();
g_ClientMain.m_csStatus.ChantDisable();
g_ClientMain.SetAutoRun(FALSE);
}
g_ClientMain.m_lpCommonInterface->InitLoading();
g_ClientMain.m_dwClientMode = CLIENT_GAMELOADING;
g_TextEdit.InitMessage();
g_ClientMain.SetFocus();
g_TextEdit.m_dwEditMode = EDITMODE_CHAT;
g_TextEdit.SetEditLength(100);
g_ClientMain.SetTipBroadTimer(g_ClientMain.m_lTipBroadCounterSeed);
CTexture::SetPath(INTERFACETEXTUREPATH);
// 0
CTexture *lpTexture;
lpTexture = new CTexture;
lpTexture->Load("main_ministat.dds");
m_lstTexture.push_back(lpTexture);
// 1
lpTexture = new CTexture;
lpTexture->Load("main_chatwin.dds");
m_lstTexture.push_back(lpTexture);
// 2
lpTexture = new CTexture;
lpTexture->Load("main_chatbutton.dds");
m_lstTexture.push_back(lpTexture);
// 3
lpTexture = new CTexture;
lpTexture->Load("main_shortcut.dds");
m_lstTexture.push_back(lpTexture);
// 4
lpTexture = new CTexture;
lpTexture->Load("main_status01.dds");
m_lstTexture.push_back(lpTexture);
// 5
lpTexture = new CTexture;
lpTexture->Load("main_status02.dds");
m_lstTexture.push_back(lpTexture);
// 6
lpTexture = new CTexture;
lpTexture->Load("main_skill01.dds");
m_lstTexture.push_back(lpTexture);
// 7
lpTexture = new CTexture;
lpTexture->Load("main_skill02.dds");
m_lstTexture.push_back(lpTexture);
// 8
lpTexture = new CTexture;
lpTexture->Load("main_skill03.dds");
m_lstTexture.push_back(lpTexture);
// 9
lpTexture = new CTexture;
lpTexture->Load("main_inven01_a.dds");
m_lstTexture.push_back(lpTexture);
// 10
lpTexture = new CTexture;
lpTexture->Load("main_inven02_a.dds");
m_lstTexture.push_back(lpTexture);
// 11
lpTexture = new CTexture;
lpTexture->Load("main_inven03.dds");
m_lstTexture.push_back(lpTexture);
// 12
lpTexture = new CTexture;
lpTexture->Load("main_inven04.dds");
m_lstTexture.push_back(lpTexture);
// 13
lpTexture = new CTexture;
lpTexture->Load("social_w_a.dds");
m_lstTexture.push_back(lpTexture);
// 14
lpTexture = new CTexture;
lpTexture->Load("social_w_b.dds");
m_lstTexture.push_back(lpTexture);
// 15
lpTexture = new CTexture;
lpTexture->Load("social_ps_a.dds");
m_lstTexture.push_back(lpTexture);
// 16
lpTexture = new CTexture;
lpTexture->Load("social_ps_b.dds");
m_lstTexture.push_back(lpTexture);
// 17
lpTexture = new CTexture;
lpTexture->Load("social_w_pannel.dds");
m_lstTexture.push_back(lpTexture);
// 18
lpTexture = new CTexture;
lpTexture->Load("social_w_tab.dds");
m_lstTexture.push_back(lpTexture);
// 19
lpTexture = new CTexture;
lpTexture->Load("option_back.dds");
m_lstTexture.push_back(lpTexture);
// 20
lpTexture = new CTexture;
lpTexture->Load("option_button.dds");
m_lstTexture.push_back(lpTexture);
// 21
lpTexture = new CTexture;
lpTexture->Load("option_in.dds");
m_lstTexture.push_back(lpTexture);
// 22
lpTexture = new CTexture;
lpTexture->Load("namebox.dds");
m_lstTexture.push_back(lpTexture);
// 23
lpTexture = new CTexture;
lpTexture->Load("market01.dds");
m_lstTexture.push_back(lpTexture);
// 24
lpTexture = new CTexture;
lpTexture->Load("market02.dds");
m_lstTexture.push_back(lpTexture);
// 25
lpTexture = new CTexture;
lpTexture->Load("market03_a.dds");
m_lstTexture.push_back(lpTexture);
// 26
lpTexture = new CTexture;
lpTexture->Load("mmap01.dds");
m_lstTexture.push_back(lpTexture);
// 27
lpTexture = new CTexture;
lpTexture->Load("mmap02.dds");
m_lstTexture.push_back(lpTexture);
// 28
lpTexture = new CTexture;
lpTexture->Load("mmap03.dds");
m_lstTexture.push_back(lpTexture);
// 29
lpTexture = new CTexture;
lpTexture->Load("bsmith01.dds");
m_lstTexture.push_back(lpTexture);
// 30
lpTexture = new CTexture;
lpTexture->Load("bsmith02.dds");
m_lstTexture.push_back(lpTexture);
// 31
lpTexture = new CTexture;
lpTexture->Load("market04_a.dds");
m_lstTexture.push_back(lpTexture);
// 32
lpTexture = new CTexture;
lpTexture->Load("market05.dds");
m_lstTexture.push_back(lpTexture);
// 33
lpTexture = new CTexture;
lpTexture->Load("market06_a.dds");
m_lstTexture.push_back(lpTexture);
// 34
lpTexture = new CTexture;
lpTexture->Load("market07_a.dds");
m_lstTexture.push_back(lpTexture);
// 35
lpTexture = new CTexture;
lpTexture->Load("mbox01.dds");
m_lstTexture.push_back(lpTexture);
// 36
lpTexture = new CTexture;
lpTexture->Load("mbox02_a.dds");
m_lstTexture.push_back(lpTexture);
// 37
lpTexture = new CTexture;
lpTexture->Load("mbox03_a.dds");
m_lstTexture.push_back(lpTexture);
// 38
lpTexture = new CTexture;
lpTexture->Load("mbox04_a.dds");
m_lstTexture.push_back(lpTexture);
// 39
lpTexture = new CTexture;
lpTexture->Load("exchange01.dds");
m_lstTexture.push_back(lpTexture);
// 40
lpTexture = new CTexture;
lpTexture->Load("option_in02.dds");
m_lstTexture.push_back(lpTexture);
// 41
lpTexture = new CTexture;
lpTexture->Load("channel01.dds");
m_lstTexture.push_back(lpTexture);
// 42
lpTexture = new CTexture;
lpTexture->Load("channel02.dds");
m_lstTexture.push_back(lpTexture);
// 43
lpTexture = new CTexture;
lpTexture->Load("bank01.dds");
m_lstTexture.push_back(lpTexture);
// 44
lpTexture = new CTexture;
lpTexture->Load("market03_1.dds");
m_lstTexture.push_back(lpTexture);
// 45
lpTexture = new CTexture;
lpTexture->Load("market08.dds");
m_lstTexture.push_back(lpTexture);
// 46
lpTexture = new CTexture;
lpTexture->Load("bank02.dds");
m_lstTexture.push_back(lpTexture);
// 47
lpTexture = new CTexture;
lpTexture->Load("bank03.dds");
m_lstTexture.push_back(lpTexture);
// 48
lpTexture = new CTexture;
lpTexture->Load("stall01.dds");
m_lstTexture.push_back(lpTexture);
// 49
lpTexture = new CTexture;
lpTexture->Load("stall02.dds");
m_lstTexture.push_back(lpTexture);
// 50
lpTexture = new CTexture;
lpTexture->Load("Quest_Back01.dds");
m_lstTexture.push_back(lpTexture);
// 51
lpTexture = new CTexture;
lpTexture->Load("Quest_Back02.dds");
m_lstTexture.push_back(lpTexture);
// 52
lpTexture = new CTexture;
lpTexture->Load("Quest_ing01.dds");
m_lstTexture.push_back(lpTexture);
// 53
lpTexture = new CTexture;
lpTexture->Load("Quest_ing02.dds");
m_lstTexture.push_back(lpTexture);
// 54
lpTexture = new CTexture;
lpTexture->Load("Quest_done01.dds");
m_lstTexture.push_back(lpTexture);
// 55
lpTexture = new CTexture;
lpTexture->Load("Quest_done02.dds");
m_lstTexture.push_back(lpTexture);
// 56
lpTexture = new CTexture;
lpTexture->Load("Quest_misc01.dds");
m_lstTexture.push_back(lpTexture);
// 0
CGUIWindow *lpWindow;
lpWindow = new CHumanMiniStates;
lpWindow->Init(0, 480);
m_lstWindow.push_back(lpWindow);
// 1
lpWindow = new CHumanChatWindow;
lpWindow->Init(150, 480);
m_lstWindow.push_back(lpWindow);
// 2
lpWindow = new CHumanShortcut;
lpWindow->Init(659, 480);
m_lstWindow.push_back(lpWindow);
// 3
lpWindow = new CHumanStatus;
lpWindow->Init(578, 0);
m_lstWindow.push_back(lpWindow);
// 4
lpWindow = new CHumanSkill;
lpWindow->Init(578, 0);
m_lstWindow.push_back(lpWindow);
// 5
lpWindow = new CAkhanInven;
lpWindow->Init(578, 0);
m_lstWindow.push_back(lpWindow);
// 6
lpWindow = new CHumanSociety;
lpWindow->Init(578, 0);
m_lstWindow.push_back(lpWindow);
// 7
lpWindow = new CCommonOption;
lpWindow->Init(289, 110);
m_lstWindow.push_back(lpWindow);
// 8
lpWindow = new CAkhanTrade;
lpWindow->Init(356, 0);
m_lstWindow.push_back(lpWindow);
// 9
lpWindow = new CHumanMinimap;
lpWindow->Init(0, 0);
m_lstWindow.push_back(lpWindow);
// 10
lpWindow = new CHumanQuick;
lpWindow->Init(0, 102);
m_lstWindow.push_back(lpWindow);
// 11
lpWindow = new CHumanSimpleWindow;
lpWindow->Init(0, 446);
m_lstWindow.push_back(lpWindow);
// 12
lpWindow = new CHumanSimpleParty;
lpWindow->Init(674, 0);
m_lstWindow.push_back(lpWindow);
// 13
lpWindow = new CHumanUpgrade;
lpWindow->Init(356, 0);
m_lstWindow.push_back(lpWindow);
// 14
lpWindow = new CAkhanJobChange;
lpWindow->Init(233, 92);
m_lstWindow.push_back(lpWindow);
// 15
lpWindow = new CHumanSimpleChat;
lpWindow->Init(40, 501);
m_lstWindow.push_back(lpWindow);
// 16
lpWindow = new CHumanExchange;
lpWindow->Init(134, 0);
m_lstWindow.push_back(lpWindow);
// 17
lpWindow = new CHumanChannel;
lpWindow->Init(218, 134);
m_lstWindow.push_back(lpWindow);
// 18
lpWindow = new CAkhanRespawn;
lpWindow->Init(267, 91);
m_lstWindow.push_back(lpWindow);
// 19
lpWindow = new CHumanVault;
lpWindow->Init(356, 0);
m_lstWindow.push_back(lpWindow);
// 20
lpWindow = new CHumanStreetStall;
lpWindow->Init(356, 0);
m_lstWindow.push_back(lpWindow);
// 21
lpWindow = new CHumanQuestDesc;
lpWindow->Init(233, 92);
m_lstWindow.push_back(lpWindow);
// 22
lpWindow = new CHumanQuest;
lpWindow->Init(578, 0);
m_lstWindow.push_back(lpWindow);
if(!g_ClientMain.m_bInterfaceAlreadyLoad)
{
m_lpSkillGaugeFrame = new CSprite;
m_lpSkillGaugeFrame->Create(99, 2, 40, 183, 256, 216, m_lstTexture[26]);
m_lpSkillGauge[0] = new CSprite;
m_lpSkillGauge[0]->Create(102, 4, 40, 216, 246, 224, m_lstTexture[26]);
m_lpSkillGauge[1] = new CSprite;
m_lpSkillGauge[1]->Create(102, 4, 40, 224, 246, 232, m_lstTexture[26]);
m_lpSkillGauge[2] = new CSprite;
m_lpSkillGauge[2]->Create(102, 4, 40, 232, 246, 240, m_lstTexture[26]);
m_lpSkillGauge[3] = new CSprite;
m_lpSkillGauge[3]->Create(102, 4, 40, 240, 246, 248, m_lstTexture[26]);
m_lpSkillGauge[4] = new CSprite;
m_lpSkillGauge[4]->Create(102, 4, 40, 248, 246, 256, m_lstTexture[26]);
m_lpTarget[0] = new CSprite;
m_lpTarget[0]->Create(0, 0, 0, 0, 64, 64, m_lstTexture[29]);
m_lpTarget[1] = new CSprite;
m_lpTarget[1]->Create(0, 0, 64, 0, 128, 64, m_lstTexture[29]);
g_ClientMain.m_bInterfaceAlreadyLoad = TRUE;
} else
{
m_lpSkillGaugeFrame->m_lpTexture = m_lstTexture[26];
m_lpSkillGauge[0]->m_lpTexture = m_lstTexture[26];
m_lpSkillGauge[1]->m_lpTexture = m_lstTexture[26];
m_lpSkillGauge[2]->m_lpTexture = m_lstTexture[26];
m_lpSkillGauge[3]->m_lpTexture = m_lstTexture[26];
m_lpSkillGauge[4]->m_lpTexture = m_lstTexture[26];
m_lpTarget[0]->m_lpTexture = m_lstTexture[29];
m_lpTarget[1]->m_lpTexture = m_lstTexture[29];
}
g_CharacterData.m_bClientUsed = true;
g_ClientMain.m_dwClientState = GAME_PLAYING;
g_ClientMain.m_Network.SetState(NS_NOWAITING);
g_TextEdit.AddMessage(g_StringTable.m_strString[140], g_ClientMain.m_dwMyChrID, 128);
if(g_ClientMain.m_csStatus.GetExistExchangeItem()) // <20><>ȯ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD>.
{
m_lstWindow[5]->ShowWindow(TRUE);
m_lstWindow[16]->ShowWindow(TRUE);
((CHumanExchange *)m_lstWindow[16])->ExchangeQuit();
}
/* if(g_ClientMain.m_csStatus.m_Info.Level == 1 && g_ClientMain.m_csStatus.m_Info.Exp == 0)
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->m_bShow = FALSE;
m_lstWindow[5]->m_bShow = FALSE;
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_bShowHelp = TRUE;
g_ClientMain.m_lpCommonInterface->InitHelp();
}*/
return TRUE;
}
void CAkhanGUI::UpdateGame(void)
{
BOOL bClick = FALSE, bEdge = FALSE;
/// <20><><EFBFBD>ٿ<EFBFBD> Ÿ<><C5B8> üũ
{
list<CItemInstance *>::iterator it;
for(it = g_ClientMain.m_csStatus.m_lstInventory.begin(); it != g_ClientMain.m_csStatus.m_lstInventory.end(); it++)
{
if((*it)->m_lCoolDownTimeCount)
{
(*it)->UpdateCoolDownTime();
}
}
int i;
vector<CItemInstance *>::iterator itSkill;
for(itSkill = g_ClientMain.m_csStatus.m_lstClassSkill.begin(); itSkill != g_ClientMain.m_csStatus.m_lstClassSkill.end(); itSkill++)
{
if((*itSkill)->m_lCoolDownTimeCount)
{
(*itSkill)->UpdateCoolDownTime();
}
}
for(i = 0; i < 20; i++)
{
if(g_ClientMain.m_csStatus.m_lstSkillSlot[i] && g_ClientMain.m_csStatus.m_lstSkillSlot[i]->m_lCoolDownTimeCount)
{
g_ClientMain.m_csStatus.m_lstSkillSlot[i]->UpdateCoolDownTime();
}
}
for(i = 0; i < 10; i++)
{
if(g_ClientMain.m_csStatus.m_lstQuickSlot[i] && g_ClientMain.m_csStatus.m_lstQuickSlot[i]->m_lCoolDownTimeCount)
{
if(g_ClientMain.m_csStatus.m_lstQuickSlot[i]->UpdateCoolDownTime())
{
if(g_ClientMain.m_dwStartQuickSlot <= i && i < 5 + g_ClientMain.m_dwStartQuickSlot)
{ // <20><><EFBFBD><EFBFBD>Ʈ
char light[256] = {0};
int pos_num = 0;
if(i >=5)
pos_num = i-5;
else
pos_num = i;
if((pos_num >=0) && (pos_num<=4)) {
sprintf(light,"inter_light%d.esf",pos_num+1);
CEffScript *test_script;
// _ASSERTE(_CrtCheckMemory());
test_script = new CEffScript;
test_script->SetInterfaceSet(true);
test_script->GetScriptBinData(light);
//3 105<30><35> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ġ
test_script->m_InterfacePos[0] = 3 + 23;
test_script->m_InterfacePos[1] = 105 + 62 + 16 + (pos_num) * 38;
CSceneManager::m_EffectManager.AddInterfaceScript(test_script);
}
}
if(g_ClientMain.m_csStatus.m_lpQuickSelected != NULL)
{ // Ȱ<><C8B0>ȭ <20><> <20><>ų
if(g_ClientMain.m_csStatus.m_lpQuickSelected == g_ClientMain.m_csStatus.m_lstQuickSlot[i]) {
CEffScript *test_script;
// _ASSERTE(_CrtCheckMemory());
test_script = new CEffScript;
test_script->SetInterfaceSet(true);
test_script->GetScriptBinData("inter_light6.esf");
test_script->m_InterfacePos[0] = 3 + 23;
test_script->m_InterfacePos[1] = 105 + 16;
CSceneManager::m_EffectManager.AddInterfaceScript(test_script);
}
}/**/
}
}
}
float fUpdate = CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID);
g_ClientMain.m_csStatus.m_lPotionCoolDownTime -= fUpdate * 2.0f;
if(g_ClientMain.m_csStatus.m_lPotionCoolDownTime <= 0)
{
g_ClientMain.m_csStatus.m_lPotionCoolDownTime = 0;
}
if(g_ClientMain.m_lpPickItem && g_ClientMain.m_lpPickItem->m_lCoolDownTimeCount)
{
if(g_ClientMain.m_lpPickItem->UpdateCoolDownTime())
{
// <20><><EFBFBD><EFBFBD>Ʈ
}
}
if(!m_bWeaponExchageAble)
{
m_fWeaponExchageAbleTimeCounter -= CFrameTimer::GetUpdateTimer(g_ClientMain.m_dwPartyInfoTimerID);
if(m_fWeaponExchageAbleTimeCounter <= 0.0f)
{
m_bWeaponExchageAble = TRUE;
m_fWeaponExchageAbleTimeCounter = 0.0f;
}
}
}
if(g_ClientMain.m_csStatus.m_PartyInfo.m_cMemberNum && CFrameTimer::GetUpdateTimer(g_ClientMain.m_dwPartyInfoTimerID) > 1.0f)
{
g_ClientMain.m_Network.SendMyInfoforParty();
}
g_ClientMain.SetDayTimer();
g_ClientMain.m_lpSceneManager->UpdateScene(CFrameTimer::GetUpdateTimer(g_ClientMain.m_nSceneManagerTimerID));
g_SkillSystem.Update();
if(g_ClientMain.m_bMouseMode)
{
if(g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.KeyHold(VK_SPACE))
{
g_ClientMain.m_bShowCursor = FALSE;
} else
{
g_ClientMain.m_bShowCursor = TRUE;
}
} else
{
if(g_DeviceInput.KeyHold(VK_SHIFT) ||
((m_lstWindow[3]->m_bShow || m_lstWindow[4]->m_bShow || m_lstWindow[5]->m_bShow || m_lstWindow[6]->m_bShow ||
m_lstWindow[7]->m_bShow || m_lstWindow[14]->m_bShow || m_lstWindow[17]->m_bShow || m_lstWindow[18]->m_bShow ||
g_MessageBoxManager.GetIsExistModal() || m_bPopupShow) && !g_DeviceInput.GetIsMiddleMousePress()))
{
bClick = TRUE;
g_ClientMain.m_bShowCursor = TRUE;
} else
{
g_ClientMain.m_bShowCursor = FALSE;
}
}
if(g_ClientMain.m_bTargetMouseMode)
{
g_ClientMain.m_bShowCursor = TRUE;
}
if(!g_ClientMain.m_bShowCursor)
{
g_DeviceInput.SetCursorPos(400, 250);
}
/* if(g_ClientMain.m_bMouseMode)
{
if(g_DeviceInput.GetIsMiddleMousePress())
{
g_DeviceInput.SetCursorPos(400, 300);
}
} else
{
if(!g_ClientMain.m_bShowCursor)
g_DeviceInput.SetCursorPos(400, 300);
}*/
float fCreatureUpdate = CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID) * 2.0f;
if(g_ClientMain.m_Network.GetState() != NS_NOWAITING || g_ClientMain.m_Network.m_nsNetworkStateforCastObject != NS_NOWAITING) // <20><>Ŷ <20><><EFBFBD>ٸ<EFBFBD><D9B8><EFBFBD>
{
g_CharacterData.SetCamera();
g_CharacterData.UpdateSelfCharacter(FALSE);
NPCSpawn();
g_CharacterData.Update(fCreatureUpdate);
if(g_ClientMain.m_lpPickItem) // <20><><EFBFBD><EFBFBD><ECBDBA> <20><><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ <20><><EFBFBD><EFBFBD>
{
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
g_ClientMain.m_lpPickItem->m_wPutX = ptMousePos->x;
g_ClientMain.m_lpPickItem->m_wPutY = ptMousePos->y;
}
return;
}
if(g_TextEdit.m_deqNoticeMessage.size())
{
deque<CGUITextEdit::Message *>::iterator it;
long count = 0;
for(it = g_TextEdit.m_deqNoticeMessage.begin(); it != g_TextEdit.m_deqNoticeMessage.end(); it++)
{
(*it)->fTimer -= fCreatureUpdate;
if((*it)->fTimer <= 0.0f)
{
count++;
}
}
for(int i = 0; i < count; i++)
{
g_TextEdit.m_deqNoticeMessage.pop_front();
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////
// <20><><EFBFBD><EFBFBD>Ű
if (
!GetIsExchange() && ((g_DeviceInput.KeyDown(VK_ESCAPE) && m_lstWindow[20]->m_bShow) || !g_TextEdit.IsFocus()) &&
(g_DeviceInput.KeyDown(VK_ESCAPE) || (g_ClientMain.m_bMouseMode && g_DeviceInput.KeyDown('W')))
)
{
if((m_lstWindow[3]->m_bShow || m_lstWindow[4]->m_bShow || m_lstWindow[5]->m_bShow ||
m_lstWindow[6]->m_bShow || m_lstWindow[7]->m_bShow || m_lstWindow[14]->m_bShow ||
m_lstWindow[16]->m_bShow || m_lstWindow[17]->m_bShow || m_lstWindow[19]->m_bShow ||
m_lstWindow[20]->m_bShow || m_lstWindow[21]->m_bShow ||
m_bShowHelp || m_bPopupShow || g_MessageBoxManager.GetIsExistModal()) && g_DeviceInput.KeyDown(VK_ESCAPE))
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[17]->ShowWindow(FALSE);
m_lstWindow[19]->ShowWindow(FALSE);
m_lstWindow[20]->ShowWindow(FALSE);
m_lstWindow[21]->ShowWindow(FALSE);
m_bPopupShow = FALSE;
m_dwPopupSelect = 0xFFFFFFFF;
g_MessageBoxManager.DestroyList();
if(m_bShowHelp)
{
m_bShowHelp = FALSE;
g_ClientMain.m_lpCommonInterface->DestroyFullScreen();
}
if(!g_ClientMain.m_bMouseMode)
{
}
} else if((g_DeviceInput.KeyDown(VK_ESCAPE) || g_DeviceInput.KeyDown('W')))
{
g_ClientMain.m_bMouseMode = !g_ClientMain.m_bMouseMode;
CEffScript *test_script;
// _ASSERTE(_CrtCheckMemory());
test_script = new CEffScript;
if(g_ClientMain.m_bMouseMode)
{
//g_CharacterData.m_Camera.m_nCameraMode = 0;
g_CharacterData.MouseModeChange();
g_ClientMain.m_bShowCursor = TRUE;
test_script->GetScriptBinData("inter_interface-type-mouse.esf");
} else
{
//g_CharacterData.m_Camera.m_nCameraMode = 1;
g_CharacterData.MouseModeChange();
g_ClientMain.m_bShowCursor = FALSE;
g_TextEdit.AddMessage(g_StringTable.m_strString[141], g_ClientMain.m_dwMyChrID, 128);
test_script->GetScriptBinData("inter_interface-type-keyboard.esf");
}
test_script->m_InterfacePos[0] += 0.0f;
test_script->m_InterfacePos[1] += 310.0f;
CSceneManager::m_EffectManager.AddInterfaceScript(test_script);
}
}
/* if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('H'))
{
g_ClientMain.m_Network.m_nsNetworkState = NS_UPGRADECLASS;
g_ClientMain.m_Network.m_pSocket->CharClassUpgrade(g_ClientMain.m_dwMyChrID, 21);
}*/
if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown(VK_TAB))
{
g_ClientMain.m_bSimpleMode = !g_ClientMain.m_bSimpleMode;
}
if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('M') && strcmp(g_ClientMain.m_strRecentChatChrID, ""))
{
HIMC hImc;
hImc = ImmGetContext(g_ClientMain.m_hWnd);
ImmSetCompositionString(hImc, SCS_SETSTR, NULL, 0, NULL, 0);
ImmReleaseContext(g_ClientMain.m_hWnd, hImc);
strcpy(g_ClientMain.m_strWhisperChrID, g_ClientMain.m_strRecentChatChrID);
g_ClientMain.m_bInstanceWhisper = TRUE;
g_TextEdit.SetFocus();
}
/* if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('6'))
{
g_ClientMain.m_bTargetMouseMode = !g_ClientMain.m_bTargetMouseMode;
}*/
if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('R'))
{
g_ClientMain.m_bAutoRunMode = TRUE;
}
if(!GetIsExchange())
{
if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('I')) // <20>κ<EFBFBD><CEBA>
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(!m_lstWindow[5]->m_bShow);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[17]->ShowWindow(FALSE);
m_lstWindow[19]->ShowWindow(FALSE);
m_lstWindow[20]->ShowWindow(FALSE);
m_lstWindow[21]->ShowWindow(FALSE);
} else if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('U')) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD>
{
m_lstWindow[3]->m_bShow = !m_lstWindow[3]->m_bShow;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[17]->ShowWindow(FALSE);
m_lstWindow[19]->ShowWindow(FALSE);
m_lstWindow[20]->ShowWindow(FALSE);
m_lstWindow[21]->ShowWindow(FALSE);
} else if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('K'))
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(!m_lstWindow[4]->m_bShow);
m_lstWindow[5]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[17]->ShowWindow(FALSE);
m_lstWindow[19]->ShowWindow(FALSE);
m_lstWindow[20]->ShowWindow(FALSE);
m_lstWindow[21]->ShowWindow(FALSE);
} else if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('Y'))
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = !m_lstWindow[6]->m_bShow;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[17]->ShowWindow(FALSE);
m_lstWindow[19]->ShowWindow(FALSE);
m_lstWindow[20]->ShowWindow(FALSE);
m_lstWindow[21]->ShowWindow(FALSE);
} else if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('T'))
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[17]->ShowWindow(FALSE);
m_lstWindow[19]->ShowWindow(FALSE);
m_lstWindow[20]->ShowWindow(FALSE);
m_lstWindow[21]->ShowWindow(FALSE);
} else if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown(VK_F1))
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[17]->ShowWindow(FALSE);
m_lstWindow[19]->ShowWindow(FALSE);
m_lstWindow[20]->ShowWindow(FALSE);
m_lstWindow[21]->ShowWindow(FALSE);
m_bShowHelp = TRUE;
g_ClientMain.m_lpCommonInterface->InitHelp();
} else if(!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown(VK_F11))
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = !m_lstWindow[7]->m_bShow;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[17]->ShowWindow(FALSE);
m_lstWindow[19]->ShowWindow(FALSE);
m_lstWindow[20]->ShowWindow(FALSE);
m_lstWindow[21]->ShowWindow(FALSE);
}
}
/////////////////////////////////////////////////////////////////////////////////////
if(m_bShowHelp)
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
g_CharacterData.Update(fCreatureUpdate);
g_CharacterData.UpdateSelfCharacter(FALSE);
NPCSpawn();
if(g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsRightMouseUp())
{
m_bShowHelp = FALSE;
g_ClientMain.m_lpCommonInterface->DestroyFullScreen();
}
return;
}
// <20><>ų ij<><C4B3><EFBFBD><EFBFBD> ó<><C3B3>
if(g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_bStillCasting)
{
if(m_pCastingEffect == NULL) { // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD>۽<EFBFBD>.
// _ASSERTE(_CrtCheckMemory());
m_pCastingEffect = new CEffScript;
if(g_ClientMain.m_csStatus.m_lstEquipment[11 + g_ClientMain.m_csStatus.m_cWeaponPos])
{
m_pCastingEffect->SetSkillInfo(g_ClientMain.m_csStatus.m_Info.Sex, g_ClientMain.m_csStatus.m_lstEquipment[11 + g_ClientMain.m_csStatus.m_cWeaponPos]->GetItemType());
} else
{
m_pCastingEffect->SetSkillInfo(g_ClientMain.m_csStatus.m_Info.Sex, 0);
}
switch(g_ClientMain.m_csStatus.m_lpQuickSelected->GetProtoTypeID()) {
case 0x9506: //aimedshot
m_pCastingEffect->GetScriptBinData("ready_akanarrow.esf");
m_pCastingEffect->SetCast(true);
break;
/*case 0x9407: //turnpunch
m_pCastingEffect->GetScriptBinData("ready_tpunch.esf");
m_pCastingEffect->SetCast(true);
break;*/
/*case 0x9603: //shock
break;
case 0x9202: //magic missile
break;
*/
default:
m_pCastingEffect->GetScriptBinData("casting_acol.esf");
break;
}
D3DXVECTOR3 effstartpos(g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.x,
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.y,
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.z);
float fChrDir = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_fDirection;
fChrDir = -fChrDir;
fChrDir -= FLOAT_PHI / 2.0f;
vector3 vecChrToward;
vecChrToward.x = cosf(fChrDir);
vecChrToward.z = sinf(fChrDir);
vecChrToward.y = 0.0f;
vecChrToward.Normalize();
m_pCastingEffect->SetChrFwd(-vecChrToward.x, -vecChrToward.y, -vecChrToward.z);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ
CZ3DObject *snappoint = NULL;
float body_scale = 0.0f;
vector3 r_hand(0.0f,0.0f,0.0f);
if((g_ClientMain.m_csStatus.m_lpQuickSelected->GetProtoTypeID() == 0x9506)/* || (g_ClientMain.m_csStatus.m_lpQuickSelected->GetProtoTypeID() == 0x9407)*/) {
//rhand
snappoint = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_lpChrModel->GetSkeletonPartObject("L_HAND");
body_scale = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_lpChrModel->GetScale();
if(snappoint != NULL) {
vector3 snaptm;
snappoint->GetPosition(snaptm);
r_hand.x = snaptm.x;
r_hand.y = snaptm.y;
r_hand.z = snaptm.z;
r_hand *= body_scale;
}
}
//
m_pCastingEffect->SetStartPos(effstartpos.x + r_hand.x,effstartpos.y + r_hand.y,effstartpos.z + r_hand.z);
m_pCastingEffect->SetEndPos(effstartpos.x,effstartpos.y,effstartpos.z);
CSceneManager::AddEffectScript(m_pCastingEffect);
}
else {
D3DXVECTOR3 effstartpos(g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.x,
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.y,
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.z);
float fChrDir = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_fDirection;
fChrDir = -fChrDir;
fChrDir -= FLOAT_PHI / 2.0f;
vector3 vecChrToward;
vecChrToward.x = cosf(fChrDir);
vecChrToward.z = sinf(fChrDir);
vecChrToward.y = 0.0f;
vecChrToward.Normalize();
m_pCastingEffect->SetChrFwd(-vecChrToward.x, -vecChrToward.y, -vecChrToward.z);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ
CZ3DObject *snappoint = NULL;
float body_scale = 0.0f;
vector3 r_hand(0.0f,0.0f,0.0f);
if((g_ClientMain.m_csStatus.m_lpQuickSelected->GetProtoTypeID() == 0x9506)/* || (g_ClientMain.m_csStatus.m_lpQuickSelected->GetProtoTypeID() == 0x9407)*/) {
//rhand
snappoint = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_lpChrModel->GetSkeletonPartObject("L_HAND");
body_scale = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_lpChrModel->GetScale();
if(snappoint != NULL) {
vector3 snaptm;
snappoint->GetPosition(snaptm);
r_hand.x = snaptm.x;
r_hand.y = snaptm.y;
r_hand.z = snaptm.z;
r_hand *= body_scale;
}
}
//
m_pCastingEffect->SetStartPos(effstartpos.x + r_hand.x,effstartpos.y + r_hand.y,effstartpos.z + r_hand.z);
m_pCastingEffect->SetEndPos(effstartpos.x,effstartpos.y,effstartpos.z);
}
unsigned short wSkill = g_ClientMain.m_csStatus.m_lpQuickSelected->GetProtoTypeID();
unsigned short wLock = g_ClientMain.m_csStatus.m_lpQuickSelected->GetMaxDurability();
unsigned short wLevel = g_ClientMain.m_csStatus.m_lpQuickSelected->GetNowDurability();
unsigned long dwLevelTick;
const Skill::ProtoType *lpSkillTypeTemp = g_SkillMgr.GetSkillProtoType(wSkill);
const Skill::ProtoType *lpSkillType = NULL;
if(lpSkillTypeTemp) lpSkillType = &lpSkillTypeTemp[g_CharacterData.m_dwCastingSkillGrade];
if(lpSkillType)
{
unsigned long level;
if(wLock == g_CharacterData.m_dwCastingSkillGrade)
level = wLevel;
else if(wLock > g_CharacterData.m_dwCastingSkillGrade)
level = 6;
/////// ij<><C4B3><EFBFBD><EFBFBD> Ÿ<>ӿ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
dwLevelTick = lpSkillType->m_LevelTick * ((500 - ((g_ClientMain.m_csStatus.m_Info.DEX + g_ClientMain.m_csStatus.m_lAddDEX) - 20)) / 500.0f);
if(g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->GetChantFlag(27))
g_CharacterData.m_dwCastingSkillTick = timeGetTime() - g_CharacterData.m_dwStartSkillTick;
else
g_CharacterData.m_dwCastingSkillTick = (timeGetTime() - g_CharacterData.m_dwStartSkillTick) / 2;
if(g_CharacterData.m_dwCastingSkillTick < lpSkillType->m_StartTick + dwLevelTick)
//<2F>׷<EFBFBD><D7B7>̵尡 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
g_CharacterData.m_dwCastingSkillTick = dwLevelTick;
else
g_CharacterData.m_dwCastingSkillTick -= lpSkillType->m_StartTick;
if(g_CharacterData.m_dwCastingSkillTick > level * dwLevelTick)
{
if(g_CharacterData.m_dwCastingSkillGrade < wLock)
{
g_CharacterData.m_dwCastingSkillGrade++;
g_CharacterData.m_dwStartSkillTick = timeGetTime();
g_CharacterData.m_dwCastingSkillTick = 0;
// <20>׷<EFBFBD><D7B7>̵<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Ƣ<><C6A2><EFBFBD>ִ<EFBFBD> effect
CEffScript *test_script;
// _ASSERTE(_CrtCheckMemory());
test_script = new CEffScript;
switch(g_ClientMain.m_csStatus.m_lpQuickSelected->GetProtoTypeID()) {
case 0x9506: //aimedshot
/*case 0x9407: //turnpunch
test_script->GetScriptBinData("Archer_up.esf");
break;*/
/*case 0x9603: //shock
break;
case 0x9202: //magic missile
break;
*/
default:
test_script->GetScriptBinData("casting_acol_up.esf");
break;
}
D3DXVECTOR3 startpos(g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.x,
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.y,
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.z);
test_script->SetStartPos(startpos.x,startpos.y,startpos.z);
test_script->SetEndPos(startpos.x,startpos.y,startpos.z);
CSceneManager::AddEffectScript(test_script);
} else
{
g_CharacterData.m_dwCastingSkillTick = level * dwLevelTick;
}
}
m_lpSkillGauge[0]->SetRate(0.0f);
m_lpSkillGauge[1]->SetRate(0.0f);
m_lpSkillGauge[2]->SetRate(0.0f);
m_lpSkillGauge[3]->SetRate(0.0f);
m_lpSkillGauge[4]->SetRate(0.0f);
m_lpSkillGauge[g_CharacterData.m_dwCastingSkillGrade]->SetRate((g_CharacterData.m_dwCastingSkillTick / (float)(dwLevelTick * 6)));
}
}
else {
if(m_pCastingEffect) { // ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD>϶<EFBFBD> effect <20><><EFBFBD><EFBFBD>
CSceneManager::m_EffectManager.DeleteEndScript(m_pCastingEffect);
m_pCastingEffect = NULL;
}
}
if(g_ClientMain.m_bShowCursor)
g_CharacterData.SetCamera(0, 0, g_DeviceInput.m_lMMoveZ);
else
g_CharacterData.SetCamera(g_DeviceInput.m_ptMovePos.x, g_DeviceInput.m_ptMovePos.y, g_DeviceInput.m_lMMoveZ);
NPCSpawn();
g_CharacterData.Update(fCreatureUpdate);
if(g_MessageBoxManager.m_lstMessageBox.size())
{
if(g_MessageBoxManager.GetIsExistModal())
{
bEdge = TRUE;
bClick = TRUE;
}
if(g_MessageBoxManager.Update()) return;
}
if(m_dwPartyCmdResult & MB_YES)
{
switch(m_dwPartyCmdType)
{
case ClientSocket::PartyCmd_Invite:
g_ClientMain.m_Network.SendPartyCmd(m_dwPartyCmdSenderID, ClientSocket::PartyCmd_Accept);
break;
}
m_dwPartyCmdResult = 0;
m_dwPartyCmdType = 0;
return;
} else if(m_dwPartyCmdResult & MB_NO || m_dwPartyCmdResult & MB_EXIT)
{
switch(m_dwPartyCmdType)
{
case ClientSocket::PartyCmd_Invite:
g_ClientMain.m_Network.SendPartyCmd(m_dwPartyCmdSenderID, ClientSocket::PartyCmd_Refuse);
break;
}
m_dwPartyCmdResult = 0;
m_dwPartyCmdType = 0;
return;
}
if(m_dwExchangeCmdResult & MB_YES)
{
switch(m_dwExchangeCmdType)
{
case ClientSocket::ExchangeCmd_Propose:
g_ClientMain.m_Network.SendExchangeCmd(m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Accept);
break;
}
m_dwExchangeCmdResult = 0;
m_dwExchangeCmdType = 0;
return;
} else if(m_dwExchangeCmdResult & MB_NO || m_dwExchangeCmdResult & MB_EXIT)
{
switch(m_dwExchangeCmdType)
{
case ClientSocket::ExchangeCmd_Propose:
g_ClientMain.m_Network.SendExchangeCmd(m_dwExchangeCmdSenderID, ClientSocket::ExchangeCmd_Refuse);
break;
}
m_dwExchangeCmdResult = 0;
m_dwExchangeCmdType = 0;
return;
}
if(m_dwPartyDuelCmdResult & MB_YES)
{
switch(m_dwPartyDuelCmdType)
{
case ClientSocket::DuelCmd_RequestPartyInfo:
g_ClientMain.m_Network.m_pSocket->CharDuelCmd(g_ClientMain.m_dwMyChrID, m_dwPartyDuelCmdSenderID, ClientSocket::DuelCmd_PartyPropose);
break;
case ClientSocket::DuelCmd_PartyPropose:
g_ClientMain.m_Network.m_pSocket->CharDuelCmd(g_ClientMain.m_dwMyChrID, m_dwPartyDuelCmdSenderID, ClientSocket::DuelCmd_PartyReady);
break;
}
m_dwPartyDuelCmdResult = 0;
m_dwPartyDuelCmdType = 0;
return;
} else if(m_dwPartyDuelCmdResult & MB_NO || m_dwPartyDuelCmdResult & MB_EXIT)
{
switch(m_dwPartyDuelCmdType)
{
case ClientSocket::DuelCmd_PartyPropose:
g_ClientMain.m_Network.m_pSocket->CharDuelCmd(g_ClientMain.m_dwMyChrID, m_dwPartyDuelCmdSenderID, ClientSocket::DuelCmd_Refuse);
break;
}
m_dwPartyDuelCmdResult = 0;
m_dwPartyDuelCmdType = 0;
return;
}
if(m_dwDuelCmdResult & MB_YES)
{
switch(m_dwDuelCmdType)
{
case ClientSocket::DuelCmd_Propose:
g_ClientMain.m_Network.m_pSocket->CharDuelCmd(g_ClientMain.m_dwMyChrID, m_dwDuelCmdSenderID, ClientSocket::DuelCmd_Ready);
break;
case 100:
CNetwork::m_pSocket->CharDuelCmd(g_ClientMain.m_dwMyChrID, m_dwDuelCmdSenderID, ClientSocket::DuelCmd_Propose);
g_TextEdit.AddMessage(g_StringTable.m_strString[507], g_ClientMain.m_dwMyChrID, 128);
break;
}
m_dwDuelCmdResult = 0;
m_dwDuelCmdType = 0;
return;
} else if(m_dwDuelCmdResult & MB_NO || m_dwDuelCmdResult & MB_EXIT)
{
switch(m_dwDuelCmdType)
{
case ClientSocket::DuelCmd_Propose:
g_ClientMain.m_Network.m_pSocket->CharDuelCmd(g_ClientMain.m_dwMyChrID, m_dwDuelCmdSenderID, ClientSocket::DuelCmd_Refuse);
break;
}
m_dwDuelCmdResult = 0;
m_dwDuelCmdType = 0;
return;
}
if(!bEdge)
{
if(m_bPopupShow)
{
bEdge = TRUE;
bClick = TRUE;
if(UpdatePopup())
return;
else if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.KeyDown('W') || g_DeviceInput.KeyDown('S') || g_DeviceInput.KeyDown('A') || g_DeviceInput.KeyDown('D'))
{
m_bPopupShow=FALSE;
}
}
if(g_ClientMain.m_bSimpleMode)
{
if(m_lstWindow[11]->m_bShow) m_lstWindow[11]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> â
if(m_lstWindow[15]->m_bShow) m_lstWindow[15]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD> ä<><C3A4>â
} else
{
if(m_lstWindow[0]->m_bShow) m_lstWindow[0]->Update(bClick, bEdge); // <20>̴<EFBFBD> <20><><EFBFBD><EFBFBD>
if(m_lstWindow[1]->m_bShow) m_lstWindow[1]->Update(bClick, bEdge); // ä<><C3A4>â
if(m_lstWindow[2]->m_bShow) m_lstWindow[2]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD> â
}
if(m_lstWindow[7]->m_bShow) if(!m_lstWindow[7]->Update(bClick, bEdge)) return; // <20>ɼ<EFBFBD> â
if(m_lstWindow[3]->m_bShow) m_lstWindow[3]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD> â
if(m_lstWindow[4]->m_bShow) m_lstWindow[4]->Update(bClick, bEdge); // <20><>ų â
if(m_lstWindow[5]->m_bShow) m_lstWindow[5]->Update(bClick, bEdge); // <20>κ<EFBFBD><CEBA>丮 â
if(m_lstWindow[6]->m_bShow) m_lstWindow[6]->Update(bClick, bEdge); // <20><>ȸ â
if(m_lstWindow[8]->m_bShow) m_lstWindow[8]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD> â
if(m_lstWindow[9]->m_bShow) m_lstWindow[9]->Update(bClick, bEdge); // <20>̴ϸ<CCB4>
if(m_lstWindow[10]->m_bShow) m_lstWindow[10]->Update(bClick, bEdge); // <20><> <20><><EFBFBD><EFBFBD>
if(m_lstWindow[13]->m_bShow) m_lstWindow[13]->Update(bClick, bEdge); // <20><><EFBFBD>׷<EFBFBD><D7B7>̵<EFBFBD>â
if(m_lstWindow[14]->m_bShow) m_lstWindow[14]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD>â
if(m_lstWindow[16]->m_bShow) m_lstWindow[16]->Update(bClick, bEdge); // <20><>ȯâ
if(m_lstWindow[17]->m_bShow) m_lstWindow[17]->Update(bClick, bEdge); // ä<><C3A4> <20><><EFBFBD><EFBFBD>â
if(m_lstWindow[18]->m_bShow) m_lstWindow[18]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> â
if(m_lstWindow[19]->m_bShow) m_lstWindow[19]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD>â<EFBFBD><C3A2> â
if(m_lstWindow[20]->m_bShow) m_lstWindow[20]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> â
if(m_lstWindow[21]->m_bShow) m_lstWindow[21]->Update(bClick, bEdge); // <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>â
if(!(m_lstWindow[3]->m_bShow || m_lstWindow[4]->m_bShow || m_lstWindow[5]->m_bShow || m_lstWindow[6]->m_bShow))
{
m_lstWindow[12]->Update(bClick, bEdge); // <20>̴<EFBFBD> <20><>Ƽ
}
}
if(g_ClientMain.m_bTargetMouseMode && !bEdge)
{
if(g_DeviceInput.GetIsLeftMouseDown())
{
// Ÿ<><C5B8> ó<><C3B3>
POINT *ptMouserPos = g_DeviceInput.GetMousePosition();
CZ3DGeneralChrModel *pSelectChr = NULL;
pSelectChr = CSceneManager::PickingCharacter(ptMouserPos->x, ptMouserPos->y);
if(pSelectChr)
{
CCreature *lpCreature = g_CharacterData.GetCreature(pSelectChr);
unsigned long dwType = g_CharacterData.GetClientType(lpCreature->m_dwChrID, TRUE);
if(dwType == CT_MONSTER)
{
// ó<><C3B3>
CGUIMessageBox *lpMessageBox;
lpMessageBox = new CGUIMessageBox;
lpMessageBox->Create("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͱ<EFBFBD> <20><><EFBFBD><EFBFBD>.");
} else if(dwType == CT_NPC)
{
// ó<><C3B3>
CGUIMessageBox *lpMessageBox;
lpMessageBox = new CGUIMessageBox;
lpMessageBox->Create("NPC<EFBFBD><EFBFBD> <20><><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>");
} else if(dwType == CT_PC)
{
// ó<><C3B3>
CGUIMessageBox *lpMessageBox;
lpMessageBox = new CGUIMessageBox;
lpMessageBox->Create("PC<EFBFBD><EFBFBD> <20><><EFBFBD>ĸ<EFBFBD><C4B8><EFBFBD>");
}
} else
{
vector3 vecClickPos = CSceneManager::PickMousePos(ptMouserPos->x, ptMouserPos->y);
// ó<><C3B3>
char strText[200];
sprintf(strText, "%f, %f, %f", vecClickPos.x, vecClickPos.y, vecClickPos.z);
CGUIMessageBox *lpMessageBox;
lpMessageBox = new CGUIMessageBox;
lpMessageBox->Create(strText);
}
g_ClientMain.m_bTargetMouseMode = FALSE;
}
}
if(bEdge)
{
m_dwNormalTargetChrID = 0xFFFFFFFF;
if(g_CharacterData.m_bAutoTargetAttack)
m_dwRangedWeaponTargetChrID = g_CharacterData.m_dwAutoTargetID;
else
m_dwRangedWeaponTargetChrID = 0xFFFFFFFF;
if(!g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_bStillCasting)
m_dwSpecialTargetChrID = 0xFFFFFFFF;
} else
{
if(!g_ClientMain.m_bMouseMode)
{
// ij<><C4B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
m_dwNormalTargetChrID = g_ClientMain.GetScreenPosChr(*ptMousePos, 0, 1000.0f);
if(g_ClientMain.m_csStatus.m_bRangedWeapon)
{
float fLength = 1800.0f;
if(g_ClientMain.m_csStatus.m_Info.Class == 8)
fLength += 600.0f;
m_dwRangedWeaponTargetChrID = g_ClientMain.GetScreenPosChr(*ptMousePos, Skill::Target::ENEMY, fLength);
if(m_dwRangedWeaponTargetChrID != 0xFFFFFFFF)
{
if(g_CharacterData.GetClientType(m_dwRangedWeaponTargetChrID, TRUE) == CT_MONSTER)
{
if(g_ClientMain.m_csStatus.m_lstEquipment[Item::EquipmentPos::WEAPON_HAND1 + g_ClientMain.m_csStatus.m_cWeaponPos])
{
unsigned long dwType = g_ClientMain.m_csStatus.m_lstEquipment[Item::EquipmentPos::WEAPON_HAND1 + g_ClientMain.m_csStatus.m_cWeaponPos]->GetItemType();
g_CharacterData.m_bAttackable = FALSE;
if(g_ClientMain.m_csStatus.m_lstEquipment[Item::EquipmentPos::SHIELD_HAND1 + g_ClientMain.m_csStatus.m_cWeaponPos])
{
unsigned long dwArrowType = g_ClientMain.m_csStatus.m_lstEquipment[Item::EquipmentPos::SHIELD_HAND1 + g_ClientMain.m_csStatus.m_cWeaponPos]->GetItemType();
switch(dwType)
{
case Item::CItemType::BOW:
if(dwArrowType == Item::CItemType::ARROW) g_CharacterData.m_bAttackable = TRUE;
break;
case Item::CItemType::CROSSBOW:
if(dwArrowType == Item::CItemType::BOLT) g_CharacterData.m_bAttackable = TRUE;
break;
}
}
}
} else
{
g_CharacterData.m_bAttackable = FALSE;
m_dwRangedWeaponTargetChrID = 0xFFFFFFFF;
}
}
else
g_CharacterData.m_bAttackable = FALSE;
} else
{
m_dwRangedWeaponTargetChrID = 0xFFFFFFFF;
g_CharacterData.m_bAttackable = TRUE;
}
if(g_ClientMain.m_csStatus.m_lpQuickSelected && !g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_bStillCasting)
{
const Skill::ProtoType *lpSkill = g_SkillMgr.GetSkillProtoType(g_ClientMain.m_csStatus.m_lpQuickSelected->GetProtoTypeID());
if(lpSkill)
{
lpSkill = &lpSkill[g_ClientMain.m_csStatus.m_lpQuickSelected->GetMaxDurability()];
m_dwSpecialTargetChrID = g_ClientMain.GetScreenPosChr(*ptMousePos, lpSkill->m_eTargetType, lpSkill->m_EffectDistance * 100.0f);
} else
{
m_dwSpecialTargetChrID = 0xFFFFFFFF;
}
}
} else
{
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
m_dwNormalTargetChrID = g_CharacterData.m_dwNormalTargetID;
m_dwSpecialTargetChrID = g_CharacterData.m_dwSpecialTargetID;
if(g_ClientMain.m_csStatus.m_bRangedWeapon)
{
if(g_ClientMain.m_csStatus.m_lstEquipment[Item::EquipmentPos::WEAPON_HAND1 + g_ClientMain.m_csStatus.m_cWeaponPos])
{
unsigned long dwType = g_ClientMain.m_csStatus.m_lstEquipment[Item::EquipmentPos::WEAPON_HAND1 + g_ClientMain.m_csStatus.m_cWeaponPos]->GetItemType();
g_CharacterData.m_bAttackable = FALSE;
if(g_ClientMain.m_csStatus.m_lstEquipment[Item::EquipmentPos::SHIELD_HAND1 + g_ClientMain.m_csStatus.m_cWeaponPos])
{
unsigned long dwArrowType = g_ClientMain.m_csStatus.m_lstEquipment[Item::EquipmentPos::SHIELD_HAND1 + g_ClientMain.m_csStatus.m_cWeaponPos]->GetItemType();
switch(dwType)
{
case Item::CItemType::BOW:
if(dwArrowType == Item::CItemType::ARROW) g_CharacterData.m_bAttackable = TRUE;
break;
case Item::CItemType::CROSSBOW:
if(dwArrowType == Item::CItemType::BOLT) g_CharacterData.m_bAttackable = TRUE;
break;
}
}
}
} else
{
g_CharacterData.m_bAttackable = TRUE;
}
m_dwRangedWeaponTargetChrID = g_CharacterData.m_dwNormalTargetMonsterID;
}
// NPC <20>dz<EFBFBD> <20><><EFBFBD><EFBFBD>
m_bClickButton = FALSE;
unsigned long dwLength;
for(int i = g_CharacterData.m_lstCharData.num - 1; i >= 0; i--)
{
if( g_CharacterData.m_lstCharData[i]->m_bUsed && !g_CharacterData.m_lstCharData[i]->m_bCharDead)
{
vector3 vecResult;
float fW;
vector3 vecPos = g_CharacterData.m_lstCharData[i]->m_vecPos;
vecPos.y += 240.0f;
BaseGraphicsLayer::TransformVector(vecPos, vecResult, fW);
if(vecResult.z < 0.0f) continue;
if(vecResult.z > 1.0f) continue;
vecPos = g_CharacterData.m_lstCharData[i]->m_vecPos - g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos;
if(vecPos.GetLens() < 2000.0f)
{
switch(g_CharacterData.GetClientType(g_CharacterData.m_lstCharData[i]->m_dwChrID))
{
case CT_PC:
if(strcmp(g_CharacterData.m_lstCharData[i]->m_strStreetStallName, ""))
{
dwLength = g_TextEdit.GetStringLength(g_CharacterData.m_lstCharData[i]->m_strStreetStallName);
if(g_DeviceInput.InRect(vecResult.x - (dwLength / 2 + 21), vecResult.y - 20, vecResult.x + (dwLength / 2 + 23), vecResult.y + 10))
{
m_dwNormalTargetChrID = g_CharacterData.m_lstCharData[i]->m_dwChrID;
m_bClickButton = TRUE;
}
}
break;
case CT_NPC:
{
dwLength = g_TextEdit.GetStringLength(g_CharacterData.m_lstCharData[i]->m_strName);
if(g_DeviceInput.InRect(vecResult.x - (dwLength / 2 + 21), vecResult.y, vecResult.x + (dwLength / 2 + 23), vecResult.y + 30))
{
m_dwNormalTargetChrID = g_CharacterData.m_lstCharData[i]->m_dwChrID;
m_bClickButton = TRUE;
}
}
break;
}
}
}
}
if(!g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_bCharDead)
{
if(!g_TextEdit.IsFocus() && !g_ClientMain.m_lpPickItem && g_CharacterData.m_lstCharData.num>0)
{
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
{
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
BOOL bOverMouse = FALSE;
unsigned long nSelectItem = g_ClientMain.m_lpSceneManager->MouseOnCheckInstanceObject(ptMousePos->x, ptMousePos->y);
if(nSelectItem != 0xFFFFFFFF)
{
LPFieldInstance lpInstanceItem = g_ClientMain.GetFieldObject(nSelectItem);
if(lpInstanceItem)
{
vector3 vecPos = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos;
vecPos.y = 0.0f;
vector3 vecItem = vector3(lpInstanceItem->m_Pos.fPointX, 0.0f, lpInstanceItem->m_Pos.fPointZ);
vector3 vecLen = vecPos - vecItem;
if(vecLen.GetLens() < 300.0f)
{
bOverMouse = TRUE;
} else
{
bOverMouse = FALSE;
nSelectItem = 0xFFFFFFFF;
}
} else
{
bOverMouse = FALSE;
nSelectItem = 0xFFFFFFFF;
}
}
static CEffScript *pMousePointEff=NULL;
if(pMousePointEff && nSelectItem == 0xFFFFFFFF)
{
pMousePointEff->SetStartPos(0.0f,0.0f,0.0f);
pMousePointEff->SetEndPos(0.0f,0.0f,0.0f);
}
if(nSelectItem == 0xFFFFFFFF)
{
if(g_ClientMain.m_lstFieldItem.size())
{
list<LPFieldInstance>::iterator it;
vector3 vecPos = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos;
vecPos.y = 0.0f;
vector3 vecItem, vecLen;
for(it = g_ClientMain.m_lstFieldItem.begin(); it != g_ClientMain.m_lstFieldItem.end(); it++)
{
vecItem = vector3((*it)->m_Pos.fPointX, 0.0f, (*it)->m_Pos.fPointZ);
vecLen = vecPos - vecItem;
if(vecLen.GetLens() < 300.0f)
{
nSelectItem = (*it)->m_dwInstanceID;
break;
}
}
}
}
if(nSelectItem != 0xFFFFFFFF)
{
if((g_DeviceInput.GetIsLeftMouseDown() && bOverMouse) || (!g_TextEdit.IsFocus() && g_DeviceInput.KeyDown('E')))
{
Item::ItemPos pItemIndex;
LPFieldInstance lpInstance = g_ClientMain.GetFieldObject(nSelectItem);
if(lpInstance)
{
vector3 vecItem = vector3(lpInstance->m_Pos.fPointX, 0.0f, lpInstance->m_Pos.fPointZ);
vector3 vecSelf = g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos;
vecSelf.y = 0.0f;
vecSelf -= vecItem;
if(vecSelf.GetLens() < 300.0f)
{
unsigned char cIndexNum;
if(!(lpInstance->m_dwTypeID & FieldObject::Gold))
{
cIndexNum = g_ClientMain.m_csStatus.GetAbleInven(lpInstance, pItemIndex);
} else
{
cIndexNum = 1;
pItemIndex.m_cIndex = 0;
pItemIndex.m_cPos = 0;
}
if(cIndexNum)
{
g_ClientMain.m_Network.SendFieldObjectPickUp(lpInstance->m_dwOID, pItemIndex);
} else
{
g_TextEdit.AddMessage(g_StringTable.m_strString[142], g_ClientMain.m_dwMyChrID, 129);
}
return;
}
}
}
else
{
LPFieldInstance lpInstance = g_ClientMain.GetFieldObject(nSelectItem);
if(lpInstance)// && m_nPreSelectItem!=nSelectItem)
{
vector3 vecItem = vector3(lpInstance->m_Pos.fPointX, 0.0f, lpInstance->m_Pos.fPointZ);
if(vecItem.y<=50.0f)
vecItem.y=CSceneManager::m_HeightField.GetHeight(vecItem);
if(pMousePointEff==NULL)
{
// _ASSERTE(_CrtCheckMemory());
pMousePointEff=new CEffScript;
CSceneManager::AddEffectScript(pMousePointEff);
pMousePointEff->GetScriptBinData("inter-item.esf");
}
pMousePointEff->SetStartPos(vecItem.x, vecItem.y + 30.0f, vecItem.z);
pMousePointEff->SetEndPos(vecItem.x, vecItem.y + 30.0f,vecItem.z);
}
}
}
m_nPreSelectItem = nSelectItem;
}
///// NPC <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>
if(m_dwNormalTargetChrID != 0xFFFFFFFF)
{
if(GetBusy())
{
g_CharacterData.m_bCharacterTargetNear = FALSE;
g_CharacterData.m_dwNormalTargetID = 0xFFFFFFFF;
} else
{
if(SelectNPC(m_dwNormalTargetChrID, m_bClickButton)) return;
}
}
}
if(g_ClientMain.m_lpPickItem && g_DeviceInput.GetIsLeftMouseDown() &&
(g_ClientMain.m_lpPickItem->GetItemPos() != ClientSocket::ItemPos_Exchange &&
g_ClientMain.m_lpPickItem->GetItemPos() != ClientSocket::ItemPos_Deposit))
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
{
if(g_ClientMain.m_lpPickItem->m_bSkill)
{
if(g_ClientMain.m_lpPickItem->GetItemPos()== ClientSocket::ItemPos_SSlot)
{
delete g_ClientMain.m_lpPickItem;
g_ClientMain.SetPickItem(NULL);
} else if(g_ClientMain.m_lpPickItem->GetItemPos() == ClientSocket::ItemPos_QSlot)
{ // <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƿ<EFBFBD> <20><><EFBFBD>ֹ<EFBFBD><D6B9><EFBFBD><EFBFBD><EFBFBD>. TakeItem
g_ClientMain.m_Network.SendQuickSlotMove(g_ClientMain.m_lpPickItem, ClientSocket::ItemPos_None, 0);
}
}
else
{
if(g_ClientMain.m_lpPickItem->GetItemPos() == ClientSocket::ItemPos_QSlot)
{
g_ClientMain.m_Network.SendQuickSlotMove(g_ClientMain.m_lpPickItem, ClientSocket::ItemPos_None, 0);
} else if(g_ClientMain.m_lpPickItem->GetItemPos() == ClientSocket::ItemPos_Stall)
{
delete g_ClientMain.m_lpPickItem;
g_ClientMain.SetPickItem(NULL);
} else
{
unsigned long dwNum;
if(g_ClientMain.m_lpPickItem->GetIsEnableStack())
dwNum = g_ClientMain.m_lpPickItem->GetNowDurability();
else
dwNum = 1;
g_ClientMain.m_Network.SendFieldObjectPullDown(dwNum, g_ClientMain.m_lpPickItem->m_lpItemBase->GetPos());
}
}
return;
}
}
}
if(g_ClientMain.m_lpPickItem) // <20><><EFBFBD><EFBFBD><ECBDBA> <20><><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ġ <20><><EFBFBD><EFBFBD>
{
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
g_ClientMain.m_lpPickItem->m_wPutX = ptMousePos->x;
g_ClientMain.m_lpPickItem->m_wPutY = ptMousePos->y;
}
if(bClick || g_TextEdit.IsFocus()) // ä<><C3A4><EFBFBD><EFBFBD><EFBFBD>ΰ<EFBFBD> <20>˻<EFBFBD>
{
g_CharacterData.UpdateSelfCharacter(FALSE, bEdge);
}
else
{
g_CharacterData.UpdateSelfCharacter(!bClick, bEdge);
}
if(g_CharacterData.m_lstCharData.num == 0)
return;
if(g_ClientMain.m_bMouseMode)
{
m_dwSpecialTargetChrID = g_CharacterData.m_dwSpecialTargetID;
}
if(!g_CharacterData.m_bAttackResult)
{
if(g_ClientMain.m_csStatus.m_lstEquipment[11 + g_ClientMain.m_csStatus.m_cWeaponPos])
{
unsigned long dwType = g_ClientMain.m_csStatus.m_lstEquipment[11 + g_ClientMain.m_csStatus.m_cWeaponPos]->GetItemType();
switch(dwType)
{
case Item::CItemType::BOW:
g_TextEdit.AddMessage(g_StringTable.m_strString[151], g_ClientMain.m_dwMyChrID, 129);
break;
case Item::CItemType::CROSSBOW:
g_TextEdit.AddMessage(g_StringTable.m_strString[152], g_ClientMain.m_dwMyChrID, 129);
break;
}
}/**/
g_CharacterData.m_bAttackResult = TRUE;
}
if(g_DeviceInput.GetIsRightMouseUp())
{
m_bShowSkillError = FALSE;
}
// <20><>ų <20>ߵ<EFBFBD>
if((g_CharacterData.m_bSkillExecuted || g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_bStillCasting))
{
ProcessSkill();
}
if(g_CharacterData.m_nFocusCharacter >= 0)
{
try
{
CBGMController & BGMC = CBGMController::GetInstance();
BGMC.Update( g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.x,
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.y,
g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos.z);
}
catch(exception & e)
{
MessageBox(NULL, e.what(), " ", MB_OK);
}
}
}
void CAkhanGUI::RenderGame(LPDIRECT3DDEVICE8 lpD3DDevice)
{
lpD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_LINEAR);
lpD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_WRAP);
lpD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
lpD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW);
lpD3DDevice->SetRenderState(D3DRS_ZFUNC,D3DCMP_LESSEQUAL);
lpD3DDevice->SetRenderState(D3DRS_FOGENABLE, TRUE);
lpD3DDevice->SetRenderState(D3DRS_LIGHTING, TRUE);
if(g_ClientMain.m_dwClientState == GAME_PLAYING)
{
g_ClientMain.m_lpSceneManager->Render();
g_CharacterData.Render(BaseGraphicsLayer::GetDevice());
lpD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
lpD3DDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE);
lpD3DDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP);
lpD3DDevice->SetTextureStageState(0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP);
lpD3DDevice->SetTextureStageState(0, D3DTSS_MINFILTER, D3DTEXF_POINT);
lpD3DDevice->SetTextureStageState(0, D3DTSS_MAGFILTER, D3DTEXF_POINT);
lpD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
lpD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
lpD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
lpD3DDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
lpD3DDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
lpD3DDevice->SetRenderState(D3DRS_FOGENABLE, FALSE);
lpD3DDevice->SetRenderState(D3DRS_LIGHTING, FALSE);
// char strDamage[10];
// RECT rcDamage;
for(int i = g_CharacterData.m_lstCharData.num-1 ; i >= 0 ; i--)
{
if(g_CharacterData.m_lstCharData[i]->m_fChatTimer)
{
g_CharacterData.m_lstCharData[i]->m_fChatTimer -= CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID) * 2.0f;
if(g_CharacterData.m_lstCharData[i]->m_fChatTimer <= 0.0f) g_CharacterData.m_lstCharData[i]->m_fChatTimer = 0.0f;
}
//if(g_CharacterData.m_lstCharData[i]->m_lpChrModel && g_CharacterData.m_lstCharData[i]->m_bUsed && g_CharacterData.m_lstCharData[i]->m_bCharDead==FALSE)
if( g_CharacterData.m_lstCharData[i]->m_bUsed)
{
vector3 vecResult, vecDamageResult, vecTextResult;
float fW;
vector3 vecPos = g_CharacterData.m_lstCharData[i]->m_vecPos;
vecPos.y += 240.0f;
BaseGraphicsLayer::TransformVector(vecPos, vecResult, fW);
if(vecResult.z < 0.0f) continue;
if(vecResult.z > 1.0f) continue;
vector3 vecDamagePos = g_CharacterData.m_lstCharData[i]->m_vecPos;
vecDamagePos.y += 150.0f;
BaseGraphicsLayer::TransformVector(vecDamagePos, vecDamageResult, fW);
if(vecDamageResult.z < 0.0f) continue;
if(vecDamageResult.z > 1.0f) continue;
vector3 vecTextPos = g_CharacterData.m_lstCharData[i]->m_vecPos;
vecTextPos.y += 50.0f;
BaseGraphicsLayer::TransformVector(vecTextPos, vecTextResult, fW);
if(vecTextResult.z < 0.0f) continue;
if(vecTextResult.z > 1.0f) continue;
vecPos = g_CharacterData.m_lstCharData[i]->m_vecPos - g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_vecPos;
if(vecPos.GetLens() < 2400.0f)
{
switch(g_CharacterData.GetClientType(g_CharacterData.m_lstCharData[i]->m_dwChrID, TRUE))
{
case CT_PC:
if(!g_CharacterData.m_lstCharData[i]->m_bCharDead && !g_ClientMain.m_bMovieVersion)
{
if(g_CharacterData.m_lstCharData[i]->m_fChatTimer)
{
RECT rcRect = { vecResult.x - 150, vecResult.y - 30, vecResult.x + 150, vecResult.y + 30 };
rcRect.left++; rcRect.right++; rcRect.top++; rcRect.bottom++;
g_TextEdit.DrawText(g_CharacterData.m_lstCharData[i]->m_strChatMessage, &rcRect, DT_CENTER | DT_WORDBREAK, D3DCOLOR_RGBA(0, 0, 0, 255));
rcRect.left--; rcRect.right--; rcRect.top--; rcRect.bottom--;
g_TextEdit.DrawText(g_CharacterData.m_lstCharData[i]->m_strChatMessage, &rcRect, DT_CENTER | DT_WORDBREAK, D3DCOLOR_RGBA(255, 255, 255, 255));
} else
{
if(i != g_CharacterData.m_nFocusCharacter)
{
RenderChrName(lpD3DDevice, g_CharacterData.m_lstCharData[i]->m_dwChrID, vecResult.x, vecResult.y);
if(strcmp(g_CharacterData.m_lstCharData[i]->m_strStreetStallName, ""))
{
RenderChrButton(lpD3DDevice, g_CharacterData.m_lstCharData[i]->m_strStreetStallName, vecResult.x, vecResult.y - 20);
}
}
}
}/**/
if(g_CharacterData.m_lstCharData[i]->m_lstDamageNumber.num)
{
float fUpdate = CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID);
stDamage *lpDamage;
short wAlpha;
for(int d = 0; d < g_CharacterData.m_lstCharData[i]->m_lstDamageNumber.num;)
{
lpDamage = &g_CharacterData.m_lstCharData[i]->m_lstDamageNumber[d];
wAlpha = (lpDamage->sLifeTime / 1500.0f * 255.0f);
if(wAlpha < 0) wAlpha = 0;
if(!g_ClientMain.m_bMovieVersion)
{
switch(lpDamage->wMode)
{
case ClientSocket::Judge_Front:
case ClientSocket::Judge_Side:
case ClientSocket::Judge_Back:
case ClientSocket::Judge_Poisoned:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 1, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_Heal:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 3, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_ManaHeal:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 2, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_Guard:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 7, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_Critical:
if(lpDamage->sLifeTime >= 1200)
{
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 6, lpDamage->lValue, (5.0f - (1.0f - ((lpDamage->sLifeTime - 1200.0f) / 300.0f)) * 4.0f) * lpDamage->fScale);
// 150, 6, lpDamage->lValue, 3.0f - (1.0f - ((lpDamage->sLifeTime - 500.0f) / 1000.0f)) * 2.0f);
} else
{
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 6, lpDamage->lValue, lpDamage->fScale);
}
break;
case ClientSocket::Judge_Evade:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 9, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_Resist:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 10, lpDamage->lValue, lpDamage->fScale);
break;
}/**/
}
if(lpDamage->sLifeTime <= 0)
{
g_CharacterData.m_lstCharData[i]->m_lstDamageNumber.DelIndex(d);
continue;
} else
{
d++;
}
lpDamage->sLifeTime -= fUpdate * 2.0f;
}
}
break;
case CT_NPC:
if(!g_CharacterData.m_lstCharData[i]->m_bCharDead && !g_ClientMain.m_bMovieVersion)
{
RenderChrButton(lpD3DDevice, g_CharacterData.m_lstCharData[i]->m_dwChrID, vecResult.x, vecResult.y);
}/**/
break;
case CT_MONSTER:
if(!g_ClientMain.m_bMovieVersion && !g_CharacterData.m_lstCharData[i]->GetChantFlag(17))
{
if(!g_CharacterData.m_lstCharData[i]->m_bCharDead)
{
RenderChrName(lpD3DDevice, g_CharacterData.m_lstCharData[i]->m_dwChrID, vecResult.x, vecResult.y);
}
if(g_CharacterData.m_lstCharData[i]->m_wMaxHP != 0)
{ // ü<><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
float fHPRate = ((float)g_CharacterData.m_lstCharData[i]->m_sCurrHP / (float)g_CharacterData.m_lstCharData[i]->m_wMaxHP) * 68.0f;
RECT rcRect;
SetRect(&rcRect, vecResult.x - 34, vecResult.y + 30, vecResult.x + 34, vecResult.y + 34);
if(rcRect.left > g_ClientMain.m_BaseGraphicLayer.m_lScreenSx) continue; if(rcRect.left < 0) rcRect.left = 0;
if(rcRect.right < 0) continue; if(rcRect.right > g_ClientMain.m_BaseGraphicLayer.m_lScreenSx) rcRect.right = g_ClientMain.m_BaseGraphicLayer.m_lScreenSx;
if(rcRect.top > g_ClientMain.m_BaseGraphicLayer.m_lScreenSy) continue; if(rcRect.top < 0) rcRect.top = 0;
if(rcRect.bottom < 0) continue; if(rcRect.bottom > g_ClientMain.m_BaseGraphicLayer.m_lScreenSy) rcRect.bottom = g_ClientMain.m_BaseGraphicLayer.m_lScreenSy;
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, rcRect.left, rcRect.top, rcRect.right, rcRect.bottom, 0xFF302D65, 0xFF);
SetRect(&rcRect, vecResult.x - 34, vecResult.y + 30, vecResult.x - 34 + fHPRate, vecResult.y + 34);
if(rcRect.left > g_ClientMain.m_BaseGraphicLayer.m_lScreenSx) continue; if(rcRect.left < 0) rcRect.left = 0;
if(rcRect.right < 0) continue; if(rcRect.right > g_ClientMain.m_BaseGraphicLayer.m_lScreenSx) rcRect.right = g_ClientMain.m_BaseGraphicLayer.m_lScreenSx;
if(rcRect.top > g_ClientMain.m_BaseGraphicLayer.m_lScreenSy) continue; if(rcRect.top < 0) rcRect.top = 0;
if(rcRect.bottom < 0) continue; if(rcRect.bottom > g_ClientMain.m_BaseGraphicLayer.m_lScreenSy) rcRect.bottom = g_ClientMain.m_BaseGraphicLayer.m_lScreenSy;
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, rcRect.left, rcRect.top, rcRect.right, rcRect.bottom, 0xFF2AE955, 0xFF);
m_lpHPGauge->m_nPutX = vecResult.x - 41;
m_lpHPGauge->m_nPutY = vecResult.y + 29;
m_lpHPGauge->Render(lpD3DDevice);
}/**/
}
if(g_CharacterData.m_lstCharData[i]->m_lstDamageNumber.num)
{
float fUpdate = CFrameTimer::GetUpdateTimer(g_ClientMain.m_nShowInterfaceTimerID);
stDamage *lpDamage;
short wAlpha;
for(int d = 0; d < g_CharacterData.m_lstCharData[i]->m_lstDamageNumber.num;)
{
lpDamage = &g_CharacterData.m_lstCharData[i]->m_lstDamageNumber[d];
wAlpha = (lpDamage->sLifeTime / 1500.0f * 255.0f);
if(wAlpha < 0) wAlpha = 0;
if(!g_ClientMain.m_bMovieVersion)
{
switch(lpDamage->wMode)
{
case ClientSocket::Judge_Front:
case ClientSocket::Judge_Side:
case ClientSocket::Judge_Back:
case ClientSocket::Judge_Poisoned:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 0, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_Heal:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 3, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_ManaHeal:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 2, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_Guard:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 8, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_Critical:
if(lpDamage->sLifeTime >= 1200.0f)
{
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 5, lpDamage->lValue, (5.0f - (1.0f - ((lpDamage->sLifeTime - 1200.0f) / 300.0f)) * 4.0f) * lpDamage->fScale);
// 150, 5, lpDamage->lValue, 3.0f - (1.0f - ((lpDamage->sLifeTime - 500.0f) / 1000.0f)) * 2.0f);
} else
{
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 5, lpDamage->lValue, lpDamage->fScale);
}
break;
case ClientSocket::Judge_Evade:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 9, lpDamage->lValue, lpDamage->fScale);
break;
case ClientSocket::Judge_Resist:
g_ClientMain.m_lpCommonInterface->RenderNumber(lpD3DDevice,
vecDamageResult.x, vecDamageResult.y - (1.0f - lpDamage->sLifeTime / 1500.0f) * 90.0f,
(unsigned char)wAlpha * lpDamage->fScale, 10, lpDamage->lValue, lpDamage->fScale);
break;
}/**/
}
if(lpDamage->sLifeTime <= 0)
{
g_CharacterData.m_lstCharData[i]->m_lstDamageNumber.DelIndex(d);
continue;
} else
{
d++;
}
lpDamage->sLifeTime -= fUpdate * 2.0f;
}
}
break;
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <20>Ϲ<EFBFBD> Ÿ<><C5B8><EFBFBD><EFBFBD> ǥ<><C7A5>
if(m_dwNormalTargetChrID != 0xFFFFFFFF)
{
vector3 *vecChrPos = g_CharacterData.GetFindChrPos(m_dwNormalTargetChrID);
if(g_CharacterData.GetClientType(m_dwNormalTargetChrID, TRUE) == CT_MONSTER)
{
// g_ClientMain.m_pEnemySelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
// g_ClientMain.m_pEnemySelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
// g_ClientMain.m_pEnemySelectEff->SetStartPos(vecChrPos->x, vecChrPos->y + 30.0f, vecChrPos->z);
// g_ClientMain.m_pEnemySelectEff->SetEndPos(vecChrPos->x, vecChrPos->y + 30.0f, vecChrPos->z);
g_ClientMain.m_pPlayerSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
} else
{
// g_ClientMain.m_pEnemySelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
// g_ClientMain.m_pEnemySelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
if(vecChrPos)
{
g_ClientMain.m_pPlayerSelectEff->SetStartPos(vecChrPos->x, vecChrPos->y + 30.0f, vecChrPos->z);
g_ClientMain.m_pPlayerSelectEff->SetEndPos(vecChrPos->x, vecChrPos->y + 30.0f, vecChrPos->z);
} else
{
g_ClientMain.m_pPlayerSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
}
}
} else
{
// g_ClientMain.m_pEnemySelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
// g_ClientMain.m_pEnemySelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <20><>ų Ÿ<><C5B8><EFBFBD><EFBFBD> ǥ<><C7A5>
if(m_dwSpecialTargetChrID != 0xFFFFFFFF)
{
if(g_ClientMain.m_csStatus.m_lpQuickSelected && !g_ClientMain.m_csStatus.m_lpQuickSelected->m_lCoolDownTimeCount)
{
vector3 *vecChrPos = g_CharacterData.GetFindChrPos(m_dwSpecialTargetChrID);
if(vecChrPos)
{
if(g_CharacterData.GetClientType(m_dwSpecialTargetChrID, TRUE) == CT_MONSTER)
{
g_ClientMain.m_pEnemySkillSelectEff->SetStartPos(vecChrPos->x, vecChrPos->y, vecChrPos->z);
g_ClientMain.m_pEnemySkillSelectEff->SetEndPos(vecChrPos->x, vecChrPos->y, vecChrPos->z);
g_ClientMain.m_pPlayerSkillSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSkillSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
} else
{
g_ClientMain.m_pEnemySkillSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pEnemySkillSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSkillSelectEff->SetStartPos(vecChrPos->x, vecChrPos->y, vecChrPos->z);
g_ClientMain.m_pPlayerSkillSelectEff->SetEndPos(vecChrPos->x, vecChrPos->y, vecChrPos->z);
}
} else
{
g_ClientMain.m_pEnemySkillSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pEnemySkillSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSkillSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSkillSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
}
} else
{
g_ClientMain.m_pEnemySkillSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pEnemySkillSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSkillSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSkillSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
}
} else
{
g_ClientMain.m_pEnemySkillSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pEnemySkillSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSkillSelectEff->SetStartPos(0.0f, 0.0f, 0.0f);
g_ClientMain.m_pPlayerSkillSelectEff->SetEndPos(0.0f, 0.0f, 0.0f);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if(g_ClientMain.m_bSimpleMode)
{
if(m_lstWindow[11]->m_bShow && !g_ClientMain.m_bMovieVersion) m_lstWindow[11]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> â
if(m_lstWindow[15]->m_bShow) m_lstWindow[15]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD> ä<><C3A4>â
} else
{
if(m_lstWindow[0]->m_bShow && !g_ClientMain.m_bMovieVersion) m_lstWindow[0]->Render(lpD3DDevice); // <20>̴<EFBFBD> <20><><EFBFBD><EFBFBD>
if(m_lstWindow[1]->m_bShow && !g_ClientMain.m_bMovieVersion) m_lstWindow[1]->Render(lpD3DDevice); // ä<><C3A4>â
if(m_lstWindow[2]->m_bShow && !g_ClientMain.m_bMovieVersion) m_lstWindow[2]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD> â
}/**/
if(m_lstWindow[3]->m_bShow) m_lstWindow[3]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͽ<EFBFBD> â
if(m_lstWindow[4]->m_bShow) m_lstWindow[4]->Render(lpD3DDevice); // <20><>ų â
if(m_lstWindow[5]->m_bShow) m_lstWindow[5]->Render(lpD3DDevice); // <20>κ<EFBFBD><CEBA>丮 â
if(m_lstWindow[6]->m_bShow) m_lstWindow[6]->Render(lpD3DDevice); // <20><>ȸ â
if(m_lstWindow[8]->m_bShow) m_lstWindow[8]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD> â
if(m_lstWindow[9]->m_bShow && !g_ClientMain.m_bMovieVersion) m_lstWindow[9]->Render(lpD3DDevice); // <20>̴ϸ<CCB4>
if(m_lstWindow[10]->m_bShow && !g_ClientMain.m_bMovieVersion) m_lstWindow[10]->Render(lpD3DDevice); // <20><> <20><><EFBFBD><EFBFBD>
if(m_lstWindow[13]->m_bShow) m_lstWindow[13]->Render(lpD3DDevice); // <20><><EFBFBD>׷<EFBFBD><D7B7>̵<EFBFBD>â
if(m_lstWindow[14]->m_bShow) m_lstWindow[14]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD>â
if(m_lstWindow[16]->m_bShow) m_lstWindow[16]->Render(lpD3DDevice); // <20><>ȯâ
if(m_lstWindow[17]->m_bShow) m_lstWindow[17]->Render(lpD3DDevice); // ä<><C3A4> <20><><EFBFBD><EFBFBD>â
if(m_lstWindow[18]->m_bShow) m_lstWindow[18]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> â
if(m_lstWindow[19]->m_bShow) m_lstWindow[19]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD>â<EFBFBD><C3A2> â
if(m_lstWindow[20]->m_bShow) m_lstWindow[20]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> â
if(m_lstWindow[21]->m_bShow) m_lstWindow[21]->Render(lpD3DDevice); // <20><><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD>â
if(!(m_lstWindow[3]->m_bShow || m_lstWindow[4]->m_bShow || m_lstWindow[5]->m_bShow || m_lstWindow[6]->m_bShow))
{
if(!g_ClientMain.m_bMovieVersion) m_lstWindow[12]->Render(lpD3DDevice); // <20>̴<EFBFBD><CCB4><EFBFBD>Ƽ
}/**/
if(m_lstWindow[7]->m_bShow) m_lstWindow[7]->Render(lpD3DDevice); // <20>ɼ<EFBFBD> â
RenderSkillGauge(lpD3DDevice); // <20><>ų <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if(g_ClientMain.m_lpPickItem && g_MessageBoxManager.m_lstMessageBox.empty())
{
g_ClientMain.m_lpPickItem->Render(lpD3DDevice);
}
if(m_bPopupShow)
{
RenderPopUp(lpD3DDevice);
}
g_MessageBoxManager.Render(lpD3DDevice);
if(g_TextEdit.m_deqNoticeMessage.size())
{
RECT rcRect;
unsigned long count = 0;
deque<CGUITextEdit::Message *>::iterator it;
for(it = g_TextEdit.m_deqNoticeMessage.begin(); it != g_TextEdit.m_deqNoticeMessage.end(); it++)
{
SetRect(&rcRect, 120, count * 16, 623, count * 16 + 16);
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, rcRect.left, rcRect.top, rcRect.right, rcRect.bottom, 0x00000000, 200);
rcRect.left += 10; rcRect.right -= 10;
g_TextEdit.DrawText((*it)->strMessage, &rcRect, DT_VCENTER | DT_LEFT, (*it)->dwColor);
rcRect.left++; rcRect.right++;
g_TextEdit.DrawText((*it)->strMessage, &rcRect, DT_VCENTER | DT_LEFT, (*it)->dwColor);
count++;
}
}
if(!g_ClientMain.m_bMouseMode)
{
BOOL bTarget = FALSE;
if(g_ClientMain.m_csStatus.m_lpQuickSelected)
{
const Skill::ProtoType *lpSkillType = g_SkillMgr.GetSkillProtoType(g_ClientMain.m_csStatus.m_lpQuickSelected->GetProtoTypeID());
switch(lpSkillType->m_eTargetType)
{
case Skill::Target::DEAD_ENEMY:
case Skill::Target::FRIEND:
case Skill::Target::ENEMY:
case Skill::Target::DEAD_FRIEND:
case Skill::Target::FRIEND_OBJECT:
case Skill::Target::ENEMY_OBJECT:
case Skill::Target::PARTY:
case Skill::Target::FRIEND_EXCEPT_SELF:
if(lpSkillType->m_EffectDistance != 0.0f) bTarget = TRUE;
break;
}
}
if(bTarget || g_ClientMain.m_csStatus.m_bRangedWeapon)
{
if(m_dwSpecialTargetChrID != 0xFFFFFFFF)
{
if(g_CharacterData.GetClientType(m_dwSpecialTargetChrID, TRUE) != CT_MONSTER)
RenderCrossHair(lpD3DDevice, 2);
else
RenderCrossHair(lpD3DDevice, 1);
} else if(g_ClientMain.m_csStatus.m_bRangedWeapon && m_dwRangedWeaponTargetChrID != 0xFFFFFFFF)
{
if(g_CharacterData.GetClientType(m_dwRangedWeaponTargetChrID, TRUE) != CT_MONSTER)
RenderCrossHair(lpD3DDevice, 2);
else
RenderCrossHair(lpD3DDevice, 1);
} else
{
RenderCrossHair(lpD3DDevice, 0);
}
}
}
RenderChant(lpD3DDevice);
if(m_bShowHelp) { g_ClientMain.m_lpCommonInterface->RenderHelp(lpD3DDevice); }
}
if(g_ClientMain.m_bSystemConsoleShow)
{
static FLOAT fLastTime = 0.0f;
static DWORD dwFrames = 0L;
static char strFrameStats[256];
FLOAT fTime = DXUtil_Timer( TIMER_GETABSOLUTETIME );
++dwFrames;
static float fFPS = 0.0f;
// Update the scene stats once per second
if( fTime - fLastTime > 1.0f )
{
fFPS = dwFrames / (fTime - fLastTime);
fLastTime = fTime;
dwFrames = 0L;
g_ClientMain.m_Network.m_lTCPPAcketPerSecond = g_ClientMain.m_Network.m_lTCPPacketTotalByte - g_ClientMain.m_Network.m_lTCPPacketOldByte;
g_ClientMain.m_Network.m_lTCPPacketOldByte = g_ClientMain.m_Network.m_lTCPPacketTotalByte;
g_ClientMain.m_Network.m_lUDPPAcketPerSecond = g_ClientMain.m_Network.m_lUDPPacketTotalByte - g_ClientMain.m_Network.m_lUDPPacketOldByte;
g_ClientMain.m_Network.m_lUDPPacketOldByte = g_ClientMain.m_Network.m_lUDPPacketTotalByte;
}
unsigned long dwPCNum = 0;
for(int i = 0; i < g_CharacterData.m_lstCharData.num; i++)
{
if(g_CharacterData.GetClientType(g_CharacterData.m_lstCharData[i]->m_dwChrID) == CT_PC)
{
dwPCNum++;
}
}
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
COORD cd = { 0, 0 };
DWORD dwWordLens;
char strObjectInfo[256];
cd.Y = 0;
sprintf(strObjectInfo, "Tcp/Ip PTB = %d, Tcp/Ip PPS = %d, Tcp/Ip PB = %d ",
g_ClientMain.m_Network.m_lTCPPacketTotalByte, g_ClientMain.m_Network.m_lTCPPAcketPerSecond, g_ClientMain.m_Network.m_pSocket->GetUseRecvBuffer());
WriteConsoleOutputCharacter(hStdOut, strObjectInfo, strlen(strObjectInfo), cd, &dwWordLens);
cd.Y = 1;
sprintf(strObjectInfo, "UDP PTB = %d, UDP PPS = %d, UDP PB = %d, UDP PC = %d ",
g_ClientMain.m_Network.m_lUDPPacketTotalByte, g_ClientMain.m_Network.m_lUDPPAcketPerSecond, g_ClientMain.m_Network.m_pSocket->GetUseRecvUDPBuffer(), g_ClientMain.m_Network.m_pSocket->GetListCount(ClientSocket::ListType_Client));
WriteConsoleOutputCharacter(hStdOut, strObjectInfo, strlen(strObjectInfo), cd, &dwWordLens);
cd.Y = 2;
sprintf(strObjectInfo, "Creature Node = %d, PC Creature Node = %d, FPS = %f ",
g_CharacterData.m_lstCharData.num, dwPCNum, fFPS);
WriteConsoleOutputCharacter(hStdOut, strObjectInfo, strlen(strObjectInfo), cd, &dwWordLens);
for(i = 0; i < 100; i++)
{
cd.X = 0;
cd.Y = 3 + i;
strcpy(strObjectInfo, " ");
WriteConsoleOutputCharacter(hStdOut, strObjectInfo, strlen(strObjectInfo), cd, &dwWordLens);
}
unsigned long count = 0;
for(i = 0; i < g_CharacterData.m_lstCharData.num; i++)
{
// if(g_CharacterData.GetClientType(g_CharacterData.m_lstCharData[i]->m_dwChrID) == CT_PC)
{
cd.X = 0;
cd.Y = 3 + count;
sprintf(strObjectInfo, "0x%08x, %d",
g_CharacterData.m_lstCharData[i]->m_dwChrID,
g_CharacterData.m_lstCharData[i]->m_dwSpendTime[4] - g_CharacterData.m_lstCharData[i]->m_dwSpendTime[3]);
/* sprintf(strObjectInfo, "0x%08x, %d, %d, %d, %d, %d",
g_CharacterData.m_lstCharData[i]->m_dwChrID,
g_CharacterData.m_lstCharData[i]->m_dwSpendTime[0] - g_CharacterData.m_lstCharData[i]->m_dwSpendTime[0],
m_dwSpendTime[0] - g_CharacterData.m_lstCharData[i]->m_dwSpendTime[0],
m_dwSpendTime[1] - g_CharacterData.m_lstCharData[i]->m_dwSpendTime[0],
g_CharacterData.m_lstCharData[i]->m_dwSpendTime[1] - g_CharacterData.m_lstCharData[i]->m_dwSpendTime[0],
g_CharacterData.m_lstCharData[i]->m_dwSpendTime[2] - g_CharacterData.m_lstCharData[i]->m_dwSpendTime[0]);*/
WriteConsoleOutputCharacter(hStdOut, strObjectInfo, strlen(strObjectInfo), cd, &dwWordLens);
count++;
}
}
/* i = 0;
list<unsigned long>::iterator it;
for(it = g_ClientMain.m_Network.m_lstSendShape.begin(); it != g_ClientMain.m_Network.m_lstSendShape.end(); it++)
{
cd.X = 0;
cd.Y = 3 + i;
sprintf(strObjectInfo, "Send Node = 0x%08x", (*it));
WriteConsoleOutputCharacter(hStdOut, strObjectInfo, strlen(strObjectInfo), cd, &dwWordLens);
i++;
}
i = 0;
for(it = g_ClientMain.m_Network.m_lstRecvShape.begin(); it != g_ClientMain.m_Network.m_lstRecvShape.end(); it++)
{
cd.X = 30;
cd.Y = 3 + i;
sprintf(strObjectInfo, "Recv Node = 0x%08x", (*it));
WriteConsoleOutputCharacter(hStdOut, strObjectInfo, strlen(strObjectInfo), cd, &dwWordLens);
i++;
}
i = 0;
for(it = m_lstDeleteChr.begin(); it != m_lstDeleteChr.end(); it++)
{
cd.X = 60;
cd.Y = 3 + i;
sprintf(strObjectInfo, "Del Node = 0x%08x", (*it));
WriteConsoleOutputCharacter(hStdOut, strObjectInfo, strlen(strObjectInfo), cd, &dwWordLens);
i++;
}*/
}
}
void CAkhanGUI::InitTrade(unsigned long dwKindMarket, unsigned long dwNPCID)
{
m_dwKindMarket = dwKindMarket;
switch(m_dwKindMarket)
{
case POPUP_A_WEAPONMERCHANT:
case POPUP_A_ARMOURMERCHANT:
case POPUP_A_ETCMERCHANT:
case POPUP_A_BEGINNERTRAINER:
case POPUP_A_COMBATANTTRAINER:
case POPUP_A_OPPICATERTRAINER:
case POPUP_A_DARKWEAPONMERCHANT:
case POPUP_A_DARKARMOURMERCHANT:
case POPUP_A_DARKETCMERCHANT:
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(TRUE);
m_lstWindow[8]->ShowWindow(TRUE);
((CAkhanTrade *)m_lstWindow[8])->InitTrade(dwNPCID);
break;
case POPUP_A_BLACKSMITH:
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(TRUE);
m_lstWindow[13]->ShowWindow(TRUE);
break;
}
}
BOOL CAkhanGUI::GetIsTrade(void)
{
if(m_lstWindow[8]->m_bShow || m_lstWindow[20]->m_bShow)
return TRUE;
else
return FALSE;
}
BOOL CAkhanGUI::GetIsExchange(void)
{
return m_lstWindow[16]->m_bShow;
}
void CAkhanGUI::InitClassChange(unsigned long dwNPCID)
{
m_lstWindow[14]->m_bShow = TRUE;
m_lstWindow[14]->InitValue();
LPNPCNode lpNode = g_NPCList.GetNPCNode(dwNPCID);
if(lpNode)
{
LPDialogNode lpDialog = lpNode->GetScript(0x8000);
if(lpDialog)
{
((CAkhanJobChange *)m_lstWindow[14])->SetText(lpDialog->m_strWord);
}
}
}
void CAkhanGUI::ProcessExchangeCmd(unsigned long dwSenderID, unsigned short wCmd)
{
switch(wCmd)
{
case ClientSocket::ExchangeCmd_Accept:
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(TRUE);
m_lstWindow[16]->ShowWindow(TRUE);
break;
case ClientSocket::ExchangeCmd_OK:
((CHumanExchange *)m_lstWindow[16])->ExchangeAccept(dwSenderID);
break;
case ClientSocket::ExchangeCmd_Cancel:
((CHumanExchange *)m_lstWindow[16])->ExchangeCancel(dwSenderID);
break;
case ClientSocket::ExchangeCmd_Exchange:
((CHumanExchange *)m_lstWindow[16])->ProcessExchange();
g_TextEdit.AddMessage(g_StringTable.m_strString[153], g_ClientMain.m_dwMyChrID, 128);
break;
case ClientSocket::ExchangeCmd_Quit:
((CHumanExchange *)m_lstWindow[16])->ExchangeQuit();
g_TextEdit.AddMessage(g_StringTable.m_strString[154], g_ClientMain.m_dwMyChrID, 129);
break;
case ClientSocket::ExchangeCmd_Lock:
((CHumanExchange *)m_lstWindow[16])->ExchangeLock(dwSenderID);
break;
case ClientSocket::ExchangeCmd_UnLock:
((CHumanExchange *)m_lstWindow[16])->ExchangeUnLock(dwSenderID);
break;
case 100:
if(((CHumanExchange *)m_lstWindow[16])->m_bSingleWindow)
{
((CHumanExchange *)m_lstWindow[16])->ShowWindow(FALSE);
}
break;
}
}
void CAkhanGUI::InitPos(CItemInstance *lpItem)
{
switch(lpItem->GetItemPos())
{
case ClientSocket::ItemPos_Exchange:
((CHumanExchange *)m_lstWindow[16])->InitPos(lpItem);
break;
}
}
/*BOOL CAkhanGUI::StartSkill(void)
{
return TRUE;
}*/
BOOL CAkhanGUI::InitPopup(unsigned long dwKindPopup, unsigned long dwUID, unsigned long dwKindPos)
{
if(g_CharacterData.GetClientType(dwUID, TRUE) == CT_MONSTER)
{
m_dwKindPopup = 0;
m_dwPopupSelectChrID = 0;
m_bPopupShow = FALSE;
m_dwKindPos = 0;
return FALSE;
} else
{
m_dwKindPopup = dwKindPopup;
m_dwPopupSelectChrID = dwUID;
m_bPopupShow = TRUE;
m_dwKindPos = dwKindPos;
}
switch(m_dwKindPopup)
{
case POPUP_PC:
{
CCreature *lpCreature = g_CharacterData.GetCreature(m_dwPopupSelectChrID);
if(lpCreature)
{
if(lpCreature->m_dwPartyID == g_ClientMain.m_csStatus.m_PartyInfo.m_dwPartyID)
{
if(!lpCreature->m_dwPartyID)
{
m_dwPopupMenu = 3;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_EXCHANGE;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[14]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_DUEL;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[509]);
m_pmPopupMenu[2].m_dwPopupKind = POPUPMENU_PARTYINVATE;
strcpy(m_pmPopupMenu[2].m_strPopupStr, g_StringTable.m_strString[0]);
if(strcmp(lpCreature->m_strStreetStallName, ""))
{
m_dwPopupMenu = 4;
m_pmPopupMenu[3].m_dwPopupKind = POPUPMENU_STREETSTALL;
strcpy(m_pmPopupMenu[3].m_strPopupStr, g_StringTable.m_strString[510]);
}
} else if(g_ClientMain.m_csStatus.m_PartyInfo.m_dwLeaderID == g_ClientMain.m_dwMyChrID)
{ // <20><><EFBFBD><EFBFBD>
m_dwKindPopup = POPUP_LEADER;
m_dwPopupMenu = 4;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_EXCHANGE;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[14]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_DUEL;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[509]);
m_pmPopupMenu[2].m_dwPopupKind = POPUPMENU_LEADER;
strcpy(m_pmPopupMenu[2].m_strPopupStr, g_StringTable.m_strString[1]);
m_pmPopupMenu[3].m_dwPopupKind = POPUPMENU_VANISH;
strcpy(m_pmPopupMenu[3].m_strPopupStr, g_StringTable.m_strString[2]);
if(strcmp(lpCreature->m_strStreetStallName, ""))
{
m_dwPopupMenu = 5;
m_pmPopupMenu[4].m_dwPopupKind = POPUPMENU_STREETSTALL;
strcpy(m_pmPopupMenu[4].m_strPopupStr, g_StringTable.m_strString[510]);
}
} else
{
m_dwKindPopup = POPUP_MEMBER;
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_EXCHANGE;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[14]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_DUEL;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[509]);
if(strcmp(lpCreature->m_strStreetStallName, ""))
{
m_dwPopupMenu = 3;
m_pmPopupMenu[2].m_dwPopupKind = POPUPMENU_STREETSTALL;
strcpy(m_pmPopupMenu[2].m_strPopupStr, g_StringTable.m_strString[510]);
}
}
} else if(!lpCreature->m_dwPartyID)
{ // <20><>Ƽ<EFBFBD><C6BC> <20><><EFBFBD><EFBFBD>.
m_dwPopupMenu = 3;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_EXCHANGE;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[14]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_DUEL;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[509]);
m_pmPopupMenu[2].m_dwPopupKind = POPUPMENU_PARTYINVATE;
strcpy(m_pmPopupMenu[2].m_strPopupStr, g_StringTable.m_strString[0]);
if(strcmp(lpCreature->m_strStreetStallName, ""))
{
m_dwPopupMenu = 4;
m_pmPopupMenu[3].m_dwPopupKind = POPUPMENU_STREETSTALL;
strcpy(m_pmPopupMenu[3].m_strPopupStr, g_StringTable.m_strString[510]);
}
} else
{
m_dwKindPopup = POPUP_MEMBER;
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_EXCHANGE;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[14]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_DUEL;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[509]);
if(strcmp(lpCreature->m_strStreetStallName, ""))
{
m_dwPopupMenu = 3;
m_pmPopupMenu[2].m_dwPopupKind = POPUPMENU_STREETSTALL;
strcpy(m_pmPopupMenu[2].m_strPopupStr, g_StringTable.m_strString[510]);
}
if(g_ClientMain.m_csStatus.m_PartyInfo.m_dwLeaderID == g_ClientMain.m_dwMyChrID)
{
m_dwPopupMenu++;
m_pmPopupMenu[m_dwPopupMenu - 1].m_dwPopupKind = POPUPMENU_PARTYDUEL;
strcpy(m_pmPopupMenu[m_dwPopupMenu - 1].m_strPopupStr, g_StringTable.m_strString[511]);
}
}
if(!g_ClientMain.m_csStatus.GetIsFriend(lpCreature->m_dwChrID) && g_ClientMain.m_csStatus.m_lstFriendList.size() < 100)
{
m_pmPopupMenu[m_dwPopupMenu].m_dwPopupKind = POPUPMENU_FRIEND;
strcpy(m_pmPopupMenu[m_dwPopupMenu].m_strPopupStr, g_StringTable.m_strString[517]);
m_dwPopupMenu++;
}
if(!g_ClientMain.m_csStatus.GetIsBan(lpCreature->m_dwChrID) && g_ClientMain.m_csStatus.m_lstBanList.size() < 100)
{
m_pmPopupMenu[m_dwPopupMenu].m_dwPopupKind = POPUPMENU_BAN;
strcpy(m_pmPopupMenu[m_dwPopupMenu].m_strPopupStr, g_StringTable.m_strString[518]);
m_dwPopupMenu++;
}
}
}
break;
case POPUP_A_GUARD:
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_SAVEPOS;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[6]);
break;
case POPUP_A_NORMAL:
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_SAVEPOS;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[6]);
break;
case POPUP_A_NOBIND:
m_dwPopupMenu = 1;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
break;
case POPUP_A_WEAPONMERCHANT:
case POPUP_A_ARMOURMERCHANT:
case POPUP_A_ETCMERCHANT:
case POPUP_A_DARKWEAPONMERCHANT:
case POPUP_A_DARKARMOURMERCHANT:
case POPUP_A_DARKETCMERCHANT:
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_TRADE;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[7]);
break;
case POPUP_A_COUNSELLER:
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_SAVEPOS;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[6]);
break;
case POPUP_A_BLACKSMITH:
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_UPGRADE;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[8]);
break;
case POPUP_A_BEGINNERTRAINER:
m_dwPopupMenu = 3;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_TRADE;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[7]);
m_pmPopupMenu[2].m_dwPopupKind = POPUPMENU_UNLOCK;
strcpy(m_pmPopupMenu[2].m_strPopupStr, g_StringTable.m_strString[155]);
break;
case POPUP_A_COMBATANTTRAINER:
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_TRADE;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[7]);
if(g_ClientMain.m_csStatus.m_Info.Level >= 10 && g_ClientMain.m_csStatus.m_Info.Class == 17)
{
m_dwPopupMenu = 3;
m_pmPopupMenu[2].m_dwPopupKind = POPUPMENU_JOBCHANGE;
strcpy(m_pmPopupMenu[2].m_strPopupStr, g_StringTable.m_strString[9]);
}/**/
break;
case POPUP_A_OPPICATERTRAINER:
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_TRADE;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[7]);
if(g_ClientMain.m_csStatus.m_Info.Level >= 10 && g_ClientMain.m_csStatus.m_Info.Class == 18)
{
m_dwPopupMenu = 3;
m_pmPopupMenu[2].m_dwPopupKind = POPUPMENU_JOBCHANGE;
strcpy(m_pmPopupMenu[2].m_strPopupStr, g_StringTable.m_strString[9]);
}/**/
break;
case POPUP_TELEPORTER:
case POPUP_A_TELEPORTER:
{
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
NPCNode *lpNode = g_NPCList.GetNPCNode(dwUID);
if(lpNode)
{
LPWarpNode lpZone = lpNode->GetWarpNode(0);
if(lpZone)
{
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_ZONEMOVE;
switch(lpZone->m_wZoneNumber)
{
case 1:
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[156]);
break;
case 2:
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[157]);
break;
case 3:
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[158]);
break;
case 4:
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[512]);
break;
case 5:
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[513]);
break;
case 6:
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[514]);
break;
default:
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[159]);
break;
}
} else
{
m_dwKindPopup = 0;
m_dwPopupSelectChrID = 0;
m_bPopupShow = FALSE;
m_dwKindPos = 0;
}
} else
{
m_dwKindPopup = 0;
m_dwPopupSelectChrID = 0;
m_bPopupShow = FALSE;
m_dwKindPos = 0;
}
}
break;
case POPUP_A_CONTAINER:
m_dwPopupMenu = 3;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG2;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[515]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_DEPOSIT;
strcpy(m_pmPopupMenu[1].m_strPopupStr, g_StringTable.m_strString[516]);
m_pmPopupMenu[2].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[2].m_strPopupStr, g_StringTable.m_strString[5]);
break;
case POPUP_A_PEACEGUILD:
m_dwPopupMenu = 2;
m_pmPopupMenu[0].m_dwPopupKind = POPUPMENU_DIALOG;
strcpy(m_pmPopupMenu[0].m_strPopupStr, g_StringTable.m_strString[5]);
m_pmPopupMenu[1].m_dwPopupKind = POPUPMENU_PEACE;
if(g_CharacterData.m_lstCharData[g_CharacterData.m_nFocusCharacter]->m_bPeaceMode)
strcpy(m_pmPopupMenu[1].m_strPopupStr, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ü Ż<><C5BB>");
else
strcpy(m_pmPopupMenu[1].m_strPopupStr, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ü <20><><EFBFBD><EFBFBD>");
break;
default:
m_dwKindPopup = 0;
m_dwPopupSelectChrID = 0;
m_bPopupShow = FALSE;
m_dwKindPos = 0;
return TRUE;
break;
}
m_dwPopupWindowLength = 0;
unsigned long lengthtemp;
for(unsigned long i = 0; i < m_dwPopupMenu; i++)
{
lengthtemp = g_TextEdit.GetStringLength(m_pmPopupMenu[i].m_strPopupStr);
if(m_dwPopupWindowLength < lengthtemp) m_dwPopupWindowLength = lengthtemp;
}
switch(m_dwKindPos)
{
case 0:
{
vector3 vecResult, vecChrPos;
float fW;
CCreature *lpCreature = g_CharacterData.GetCreature(m_dwPopupSelectChrID);
if(lpCreature)
{
vecChrPos = lpCreature->m_vecPos;
vecChrPos.y += 180.0f;
BaseGraphicsLayer::TransformVector(vecChrPos, vecResult, fW);
if(vecResult.z > 1.0f)
{
m_bPopupShow = FALSE;
return TRUE;
}
m_nPopupWindowX = vecResult.x + 50.0f - 0.5;
m_nPopupWindowY = vecResult.y - 0.5f;
} else
{
m_dwKindPopup = 0;
m_dwPopupSelectChrID = 0;
m_bPopupShow = FALSE;
m_dwKindPos = 0;
return FALSE;
}
}
break;
case 1:
{
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
m_nPopupWindowX = ptMousePos->x;
m_nPopupWindowY = ptMousePos->y;
}
break;
}
if(m_nPopupWindowX + 32 + m_dwPopupWindowLength > BaseGraphicsLayer::m_lScreenSx) { m_nPopupWindowX -= (m_nPopupWindowX + 32 + m_dwPopupWindowLength) - BaseGraphicsLayer::m_lScreenSx; }
if(m_nPopupWindowY + 24 + m_dwPopupMenu * 18 > BaseGraphicsLayer::m_lScreenSy) { m_nPopupWindowY -= (m_nPopupWindowY + 24 + m_dwPopupMenu * 18) - BaseGraphicsLayer::m_lScreenSy; }
return TRUE;
}
void CAkhanGUI::InitSkillUnLock(unsigned long dwNPCID)
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[8]->ShowWindow(FALSE);
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[4]->ShowWindow(TRUE);
m_lstWindow[4]->InitValue();
((CHumanSkill *)m_lstWindow[4])->m_bSkillUnLock = TRUE;
}
void CAkhanGUI::InitChannel(unsigned char cChannelNum, unsigned short *lpChannel)
{
((CHumanChannel *)m_lstWindow[17])->ShowWindow(TRUE);
((CHumanChannel *)m_lstWindow[17])->SetChannel(cChannelNum, lpChannel);
}
void CAkhanGUI::InitRespawn(unsigned char cZoneNum)
{
((CAkhanRespawn *)m_lstWindow[18])->ShowWindow(TRUE);
((CAkhanRespawn *)m_lstWindow[18])->SetRespawn(cZoneNum);
}
BOOL CAkhanGUI::GetIsRespawn(void)
{
return m_lstWindow[18]->m_bShow;
}
void CAkhanGUI::DestroyRespawn(void)
{
m_lstWindow[18]->ShowWindow(FALSE);
}
BOOL CAkhanGUI::GetEnableChat(void)
{
if(g_MessageBoxManager.GetIsExistModal() || m_bPopupShow)
return FALSE;
return TRUE;
}
void CAkhanGUI::InitDeposit(void)
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(TRUE);
m_lstWindow[19]->ShowWindow(TRUE);
((CHumanVault *)m_lstWindow[19])->InitVault();
}
void CAkhanGUI::ShowWindow(unsigned long dwWindowNum)
{
if(dwWindowNum == 3) m_lstWindow[3]->m_bShow = !m_lstWindow[3]->m_bShow; else m_lstWindow[3]->m_bShow = FALSE;
if(dwWindowNum == 4) m_lstWindow[4]->ShowWindow(!m_lstWindow[4]->m_bShow); else m_lstWindow[4]->ShowWindow(FALSE);
if(dwWindowNum == 5) m_lstWindow[5]->ShowWindow(!m_lstWindow[5]->m_bShow); else m_lstWindow[5]->ShowWindow(FALSE);
if(dwWindowNum == 6) m_lstWindow[6]->m_bShow = !m_lstWindow[6]->m_bShow; else m_lstWindow[6]->m_bShow = FALSE;
if(dwWindowNum == 7) m_lstWindow[7]->m_bShow = !m_lstWindow[7]->m_bShow; else m_lstWindow[7]->m_bShow = FALSE;
if(!m_lstWindow[5]->m_bShow)
{
if(m_lstWindow[8]->m_bShow) m_lstWindow[8]->ShowWindow(FALSE);
if(m_lstWindow[13]->m_bShow) m_lstWindow[13]->ShowWindow(FALSE);
if(m_lstWindow[16]->m_bShow) m_lstWindow[16]->ShowWindow(FALSE);
if(m_lstWindow[19]->m_bShow) m_lstWindow[19]->ShowWindow(FALSE);
}
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[17]->ShowWindow(FALSE);
}
BOOL CAkhanGUI::GetBusy(void)
{
if(m_lstWindow[7]->m_bShow || m_lstWindow[8]->m_bShow || m_lstWindow[13]->m_bShow ||
m_lstWindow[14]->m_bShow || m_lstWindow[16]->m_bShow || m_lstWindow[17]->m_bShow ||
m_lstWindow[18]->m_bShow || m_lstWindow[19]->m_bShow || m_lstWindow[20]->m_bShow ||
m_lstWindow[21]->m_bShow)
{
return TRUE;
}
return FALSE;
}
BOOL CAkhanGUI::GetIsBlackMarket(void)
{
if(m_lstWindow[8])
{
return ((CAkhanTrade *)m_lstWindow[8])->m_bBalckMarket;
}
return FALSE;
}
void CAkhanGUI::InitStreetStall(unsigned long dwChrID, char *lpstrStreetName)
{
m_lstWindow[3]->m_bShow = FALSE;
m_lstWindow[4]->ShowWindow(FALSE);
m_lstWindow[6]->m_bShow = FALSE;
m_lstWindow[7]->m_bShow = FALSE;
m_lstWindow[13]->ShowWindow(FALSE);
m_lstWindow[14]->ShowWindow(FALSE);
m_lstWindow[16]->ShowWindow(FALSE);
m_lstWindow[5]->ShowWindow(TRUE);
m_lstWindow[20]->ShowWindow(TRUE);
((CHumanStreetStall *)m_lstWindow[20])->InitStreetStall(dwChrID, lpstrStreetName);
}
void CAkhanGUI::InitQuest(unsigned long dwChrID, unsigned long dwQuestID)
{
m_lstWindow[21]->ShowWindow(TRUE);
m_lstWindow[21]->InitValue();
LPNPCNode lpNode = g_NPCList.GetNPCNode(dwChrID);
if(lpNode)
{
LPQuestNode lpQuest = lpNode->GetQuestforID(dwQuestID);
if(lpQuest)
{
((CHumanQuestDesc *)m_lstWindow[21])->SetText(dwChrID, dwQuestID, lpQuest->m_strQuestDesc);
}
}
}