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>
607 lines
19 KiB
C++
607 lines
19 KiB
C++
// HumanSkill.cpp: implementation of the CHumanSkill class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#include "ClientMain.h"
|
|
#include "HumanSkill.h"
|
|
#include "GUITextEdit.h"
|
|
#include "WinInput.h"
|
|
#include "GUIMessageBox.h"
|
|
|
|
#include "Skill\SkillMgr.h"
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
// Construction/Destruction
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
CHumanSkill::CHumanSkill()
|
|
{
|
|
|
|
}
|
|
|
|
CHumanSkill::~CHumanSkill()
|
|
{
|
|
|
|
}
|
|
|
|
void CHumanSkill::InitValue(void)
|
|
{
|
|
m_bSkillUnLock = FALSE;
|
|
m_dwStartSlot = 0;
|
|
m_dwLockResult = 0;
|
|
m_dwEraseResult = 0;
|
|
m_dwUnLockResult = 0;
|
|
m_dwProcessSkillIndex = 0;
|
|
}
|
|
|
|
BOOL CHumanSkill::Init(unsigned short x, unsigned short y)
|
|
{
|
|
CSprite *lpSprite;
|
|
lpSprite = new CSprite;
|
|
lpSprite->Create(x, y, 0, 0, 222, 256, g_ClientMain.m_lpInterface->m_lstTexture[6]);
|
|
m_lstSprite.push_back(lpSprite);
|
|
|
|
lpSprite = new CSprite;
|
|
lpSprite->Create(x, y + 256, 0, 0, 222, 224, g_ClientMain.m_lpInterface->m_lstTexture[7]);
|
|
m_lstSprite.push_back(lpSprite);
|
|
|
|
// 백판
|
|
lpSprite = new CSprite;
|
|
lpSprite->Create(0, 0, 0, 0, 193, 53, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
m_lstSprite.push_back(lpSprite);
|
|
|
|
// 슬롯 감추기
|
|
lpSprite = new CSprite;
|
|
lpSprite->Create(0, 0, 80, 106, 161, 115, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
m_lstSprite.push_back(lpSprite);
|
|
|
|
// 스킬 게이지
|
|
lpSprite = new CSprite;
|
|
lpSprite->Create(0, 0, 70, 106, 80, 111, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
m_lstSprite.push_back(lpSprite);
|
|
|
|
// INSTANT
|
|
lpSprite = new CSprite;
|
|
lpSprite->Create(0, 0, 193, 36, 235, 47, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
m_lstSprite.push_back(lpSprite);
|
|
|
|
// PASSIVE
|
|
lpSprite = new CSprite;
|
|
lpSprite->Create(0, 0, 193, 47, 235, 58, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
m_lstSprite.push_back(lpSprite);
|
|
|
|
// CHANT
|
|
lpSprite = new CSprite;
|
|
lpSprite->Create(0, 0, 193, 58, 235, 69, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
m_lstSprite.push_back(lpSprite);
|
|
|
|
// CAST
|
|
lpSprite = new CSprite;
|
|
lpSprite->Create(0, 0, 193, 69, 235, 80, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
m_lstSprite.push_back(lpSprite);
|
|
|
|
CGUIButton *lpButton;
|
|
for(int i = 0; i < 7; i++)
|
|
{
|
|
// 1
|
|
lpButton = new CGUIButton;
|
|
lpButton->m_nMethod = BUTTON_SIMPLE;
|
|
lpButton->m_lpNormalButton = new CSprite;
|
|
lpButton->m_lpNormalButton->Create(155, 74 + i * 53, 0, 106, 35, 123, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
lpButton->m_lpClickMouseButton = new CSprite;
|
|
lpButton->m_lpClickMouseButton->Create(155, 74 + i * 53, 0, 123, 35, 140, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
lpButton->SetTooltip(&m_TooltipManager, "");
|
|
lpButton->SetMove(x, y);
|
|
m_ButtonManager.AddButton(lpButton);
|
|
|
|
lpButton = new CGUIButton;
|
|
lpButton->m_nMethod = BUTTON_SIMPLE;
|
|
lpButton->m_lpNormalButton = new CSprite;
|
|
lpButton->m_lpNormalButton->Create(155, 95 + i * 53, 35, 106, 70, 123, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
lpButton->m_lpClickMouseButton = new CSprite;
|
|
lpButton->m_lpClickMouseButton->Create(155, 95 + i * 53, 35, 123, 70, 140, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
lpButton->SetTooltip(&m_TooltipManager, "");
|
|
lpButton->SetMove(x, y);
|
|
m_ButtonManager.AddButton(lpButton);
|
|
}
|
|
|
|
lpButton = new CGUIButton;
|
|
lpButton->m_nMethod = BUTTON_SIMPLE;
|
|
lpButton->m_lpNormalButton = new CSprite;
|
|
lpButton->m_lpNormalButton->Create(190, 1, 0, 0, 28, 28, g_ClientMain.m_lpInterface->m_lpCommonWindow);
|
|
lpButton->m_lpClickMouseButton = new CSprite;
|
|
lpButton->m_lpClickMouseButton->Create(190, 1, 28, 0, 56, 28, g_ClientMain.m_lpInterface->m_lpCommonWindow);
|
|
lpButton->SetTooltip(&m_TooltipManager, g_StringTable.m_strString[210]);
|
|
lpButton->SetMove(x, y);
|
|
m_ButtonManager.AddButton(lpButton);
|
|
|
|
for(i = 0; i < 7; i++)
|
|
{
|
|
lpButton = new CGUIButton;
|
|
lpButton->m_nMethod = BUTTON_SIMPLE;
|
|
lpButton->m_lpNormalButton = new CSprite;
|
|
lpButton->m_lpNormalButton->Create(153, 78 + i * 53, 0, 140, 42, 169, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
lpButton->m_lpClickMouseButton = new CSprite;
|
|
lpButton->m_lpClickMouseButton->Create(153, 78 + i * 53, 42, 140, 84, 169, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
lpButton->SetTooltip(&m_TooltipManager, "");
|
|
lpButton->SetMove(x, y);
|
|
m_ButtonManager.AddButton(lpButton);
|
|
}
|
|
|
|
CGUIScroll *lpScroll;
|
|
lpScroll = new CGUIScroll;
|
|
lpScroll->m_lpBarButton = new CGUIButton;
|
|
lpScroll->m_lpBarButton->m_nMethod = BUTTON_SIMPLE;
|
|
lpScroll->m_lpBarButton->m_lpNormalButton = new CSprite;
|
|
lpScroll->m_lpBarButton->m_lpNormalButton->Create(206, 71, 228, 0, 239, 20, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
lpScroll->m_lpBarButton->m_lpClickMouseButton = new CSprite;
|
|
lpScroll->m_lpBarButton->m_lpClickMouseButton->Create(206, 71, 228, 0, 239, 20, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
|
|
lpScroll->m_lpUpArrowButton = new CGUIButton;
|
|
lpScroll->m_lpUpArrowButton->m_nMethod = BUTTON_SIMPLE;
|
|
lpScroll->m_lpUpArrowButton->m_lpNormalButton = new CSprite;
|
|
lpScroll->m_lpUpArrowButton->m_lpNormalButton->Create(206, 62, 243, 2, 254, 12, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
lpScroll->m_lpUpArrowButton->m_lpClickMouseButton = new CSprite;
|
|
lpScroll->m_lpUpArrowButton->m_lpClickMouseButton->Create(206, 62, 243, 14, 254, 24, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
|
|
lpScroll->m_lpDownArrowButton = new CGUIButton;
|
|
lpScroll->m_lpDownArrowButton->m_nMethod = BUTTON_SIMPLE;
|
|
lpScroll->m_lpDownArrowButton->m_lpNormalButton = new CSprite;
|
|
lpScroll->m_lpDownArrowButton->m_lpNormalButton->Create(206, 431, 243, 26, 254, 36, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
lpScroll->m_lpDownArrowButton->m_lpClickMouseButton = new CSprite;
|
|
lpScroll->m_lpDownArrowButton->m_lpClickMouseButton->Create(206, 431, 243, 40, 254, 50, g_ClientMain.m_lpInterface->m_lstTexture[8]);
|
|
|
|
lpScroll->m_lValue = (long *)&m_dwStartSlot;
|
|
lpScroll->SetMove(x, y);
|
|
lpScroll->SetPosition(206, 73);
|
|
lpScroll->SetEdge(0, 0, 10, 338);
|
|
lpScroll->SetRange(0, 0);
|
|
m_lstScroll.push_back(lpScroll);
|
|
|
|
m_bShow = FALSE;
|
|
|
|
m_dwWindowKind = WINDOW_FIX;
|
|
|
|
m_rcWindowSize.left = x; m_rcWindowSize.top = y;
|
|
m_rcWindowSize.right = x + 222; m_rcWindowSize.bottom = y + 480;
|
|
|
|
m_rcMoveEdge.left = x; m_rcMoveEdge.top = y;
|
|
m_rcMoveEdge.right = x + 150; m_rcMoveEdge.bottom = y + 20;
|
|
|
|
InitValue();
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
BOOL CHumanSkill::Update(BOOL &bClick, BOOL &bEdge)
|
|
{
|
|
if(g_DeviceInput.InRect(m_rcWindowSize.left, m_rcWindowSize.top, m_rcWindowSize.right, m_rcWindowSize.bottom))
|
|
{
|
|
bEdge = TRUE;
|
|
|
|
if(g_DeviceInput.GetIsLeftMouseDown() || g_DeviceInput.GetIsMiddleMouseDown() || g_DeviceInput.GetIsRightMouseDown() ||
|
|
g_DeviceInput.GetIsLeftMousePress() || g_DeviceInput.GetIsMiddleMousePress() || g_DeviceInput.GetIsRightMousePress() ||
|
|
g_DeviceInput.GetIsLeftMouseUp() || g_DeviceInput.GetIsMiddleMouseUp() || g_DeviceInput.GetIsRightMouseUp())
|
|
{
|
|
bClick = TRUE;
|
|
}
|
|
}
|
|
|
|
m_ButtonManager.Update();
|
|
m_TooltipManager.Update();
|
|
|
|
//////// 스킬 락
|
|
if(m_dwLockResult & MB_YES)
|
|
{
|
|
g_ClientMain.m_Network.m_pSocket->CharSkillLock(g_ClientMain.m_dwMyChrID,
|
|
g_ClientMain.m_csStatus.m_Skill.SSlot[m_dwProcessSkillIndex].SKILLINFO.wSkill,
|
|
m_dwProcessSkillIndex);
|
|
|
|
m_dwLockResult = 0;
|
|
return TRUE;
|
|
} else if(m_dwLockResult & MB_NO || m_dwLockResult & MB_EXIT)
|
|
{
|
|
m_dwLockResult = 0;
|
|
return TRUE;
|
|
}
|
|
|
|
//////// 스킬 지우기
|
|
if(m_dwEraseResult & MB_YES)
|
|
{
|
|
g_ClientMain.m_Network.m_nsNetworkState = NS_SKILLERASE;
|
|
g_ClientMain.m_Network.m_pSocket->CharSkillErase(g_ClientMain.m_dwMyChrID,
|
|
g_ClientMain.m_csStatus.m_Skill.SSlot[m_dwProcessSkillIndex].SKILLINFO.wSkill,
|
|
m_dwProcessSkillIndex);
|
|
|
|
m_dwEraseResult = 0;
|
|
return TRUE;
|
|
} else if(m_dwEraseResult & MB_NO || m_dwEraseResult & MB_EXIT)
|
|
{
|
|
m_dwEraseResult = 0;
|
|
return TRUE;
|
|
}
|
|
|
|
//////// 스킬 락 해제
|
|
if(m_dwUnLockResult & MB_YES)
|
|
{
|
|
unsigned short wForgotStone = 9914;
|
|
CItemInstance *lpItem = g_ClientMain.m_csStatus.GetInventoryItemfromID(wForgotStone);
|
|
|
|
if(lpItem)
|
|
{
|
|
if(g_ClientMain.m_csStatus.m_Info.Level * 10000 > g_ClientMain.m_csStatus.m_Info.Gold)
|
|
{
|
|
CGUIMessageBox *lpMessageBox;
|
|
lpMessageBox = new CGUIMessageBox;
|
|
lpMessageBox->Create(g_StringTable.m_strString[216]);
|
|
} else
|
|
{
|
|
g_ClientMain.m_Network.m_nsNetworkState = NS_SKILLUNLOCK;
|
|
g_ClientMain.m_Network.m_pSocket->CharSkillUnLock(g_ClientMain.m_dwMyChrID,
|
|
g_ClientMain.m_csStatus.m_Skill.SSlot[m_dwProcessSkillIndex].SKILLINFO.wSkill,
|
|
m_dwProcessSkillIndex, &lpItem->m_lpItemBase->GetPos());
|
|
}
|
|
} else
|
|
{
|
|
CGUIMessageBox *lpMessageBox;
|
|
lpMessageBox = new CGUIMessageBox;
|
|
lpMessageBox->Create(g_StringTable.m_strString[217]);
|
|
}
|
|
|
|
m_dwUnLockResult = 0;
|
|
return TRUE;
|
|
} else if(m_dwEraseResult & MB_NO || m_dwEraseResult & MB_EXIT)
|
|
{
|
|
m_dwUnLockResult = 0;
|
|
return TRUE;
|
|
}
|
|
|
|
/////////////// 스크롤 부분
|
|
if((g_ClientMain.m_csStatus.m_lstClassSkill.size() + g_ClientMain.m_csStatus.m_Skill.wSlotNum) < 7)
|
|
m_lstScroll[0]->SetRange(0, 0);
|
|
else
|
|
m_lstScroll[0]->SetRange(0, (g_ClientMain.m_csStatus.m_lstClassSkill.size() + g_ClientMain.m_csStatus.m_Skill.wSlotNum) - 7);
|
|
m_lstScroll[0]->Update();
|
|
|
|
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
|
|
|
long lStartSkill;
|
|
if(m_dwStartSlot < g_ClientMain.m_csStatus.m_lstClassSkill.size())
|
|
{
|
|
lStartSkill = 0;
|
|
} else
|
|
{
|
|
lStartSkill = m_dwStartSlot - g_ClientMain.m_csStatus.m_lstClassSkill.size();
|
|
}
|
|
|
|
unsigned long dwSlot = 0;
|
|
for(unsigned long i = m_dwStartSlot; i < g_ClientMain.m_csStatus.m_lstClassSkill.size(); i++)
|
|
{
|
|
if(dwSlot < 7)
|
|
{
|
|
dwSlot++;
|
|
} else
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
|
|
lStartSkill -= dwSlot;
|
|
/* for(i = 0 + lStartSkill; i < 7 + lStartSkill; i++)
|
|
{
|
|
if(dwSlot < 7)
|
|
{
|
|
RenderSlot(lpD3DDevice, g_ClientMain.m_csStatus.m_lstSkillSlot[i], dwSlot, m_cAlpha, m_rcWindowSize.left + 8, m_rcWindowSize.top + 66 + dwSlot * 53);
|
|
dwSlot++;
|
|
} else
|
|
{
|
|
break;
|
|
}
|
|
}*/
|
|
|
|
unsigned long dwFunction;
|
|
if(!g_ClientMain.CheckStillCasting(dwFunction))
|
|
{
|
|
for(long i = 0; i < 7; i++)
|
|
{
|
|
if(m_ButtonManager.m_lstButton[i * 2]->m_nState == BUTTON_CLICK)
|
|
{
|
|
if(g_ClientMain.m_csStatus.m_Skill.SSlot[i + lStartSkill].SKILLINFO.cSkillLevel < 6)
|
|
{
|
|
// 스킬이 부족합니다.
|
|
CGUIMessageBox *lpMessageBox;
|
|
lpMessageBox = new CGUIMessageBox;
|
|
lpMessageBox->Create(g_StringTable.m_strString[211]);
|
|
} else
|
|
{
|
|
// Yes / No 창 뜨기
|
|
CGUIMessageBox *lpMessageBox;
|
|
lpMessageBox = new CGUIMessageBox;
|
|
lpMessageBox->Create(g_StringTable.m_strString[212], MB_YES | MB_NO | MB_EXIT);
|
|
lpMessageBox->SetResult(&m_dwLockResult);
|
|
m_dwLockResult = 0;
|
|
m_dwProcessSkillIndex = i + lStartSkill;
|
|
}
|
|
|
|
return TRUE;
|
|
} else if(m_ButtonManager.m_lstButton[1 + i * 2]->m_nState == BUTTON_CLICK)
|
|
{
|
|
if(g_ClientMain.m_csStatus.m_Skill.SSlot[i + lStartSkill].SKILLINFO.cSkillLevel)
|
|
{
|
|
// Yes / No 창 뜨기
|
|
CGUIMessageBox *lpMessageBox;
|
|
lpMessageBox = new CGUIMessageBox;
|
|
lpMessageBox->Create(g_StringTable.m_strString[213], MB_YES | MB_NO | MB_EXIT);
|
|
lpMessageBox->SetResult(&m_dwEraseResult);
|
|
m_dwEraseResult = 0;
|
|
m_dwProcessSkillIndex = i + lStartSkill;
|
|
} else
|
|
{
|
|
// 스킬이 부족합니다.
|
|
CGUIMessageBox *lpMessageBox;
|
|
lpMessageBox = new CGUIMessageBox;
|
|
lpMessageBox->Create(g_StringTable.m_strString[214]);
|
|
}
|
|
|
|
return TRUE;
|
|
} else if(m_ButtonManager.m_lstButton[15 + i]->m_nState == BUTTON_CLICK)
|
|
{
|
|
if(g_ClientMain.m_csStatus.m_Skill.SSlot[i + lStartSkill].SKILLINFO.cLockCount)
|
|
{
|
|
// Yes / No 창 뜨기
|
|
char strText[MAX_PATH];
|
|
unsigned long dwGold = g_ClientMain.m_csStatus.m_Info.Level * 10000;
|
|
sprintf(strText, g_StringTable.m_strString[218], dwGold);
|
|
|
|
CGUIMessageBox *lpMessageBox;
|
|
lpMessageBox = new CGUIMessageBox;
|
|
lpMessageBox->Create(strText, MB_YES | MB_NO | MB_EXIT);
|
|
lpMessageBox->SetResult(&m_dwUnLockResult);
|
|
m_dwUnLockResult = 0;
|
|
m_dwProcessSkillIndex = i + lStartSkill;
|
|
} else
|
|
{
|
|
// 락 된 스킬이 없습니다.
|
|
CGUIMessageBox *lpMessageBox;
|
|
lpMessageBox = new CGUIMessageBox;
|
|
lpMessageBox->Create(g_StringTable.m_strString[219]);
|
|
}
|
|
|
|
return TRUE;
|
|
} else if(g_DeviceInput.GetIsLeftMouseDown())
|
|
{
|
|
if(i < dwSlot)
|
|
{
|
|
if(g_ClientMain.m_csStatus.m_lstClassSkill[g_ClientMain.m_csStatus.m_lstClassSkill.size() - dwSlot + i] &&
|
|
g_ClientMain.m_csStatus.m_lstClassSkill[g_ClientMain.m_csStatus.m_lstClassSkill.size() - dwSlot + i]->IsOverMouse() &&
|
|
!g_ClientMain.m_lpPickItem)
|
|
{
|
|
const Skill::ProtoType *lpProtoType = g_SkillMgr.g_SkillMgr.GetSkillProtoType(g_ClientMain.m_csStatus.m_lstClassSkill[g_ClientMain.m_csStatus.m_lstClassSkill.size() - dwSlot + i]->GetProtoTypeID());
|
|
|
|
if(lpProtoType)
|
|
{
|
|
if(lpProtoType->m_eSkillType != Skill::Type::PASSIVE)
|
|
{
|
|
g_ClientMain.m_lpPickItem = new CItemInstance;
|
|
g_ClientMain.m_lpPickItem->SetSkillInfo(g_ClientMain.m_csStatus.m_lstClassSkill[g_ClientMain.m_csStatus.m_lstClassSkill.size() - dwSlot + i]);
|
|
g_ClientMain.SetPickItem(g_ClientMain.m_lpPickItem);
|
|
|
|
return TRUE;
|
|
} else
|
|
{
|
|
g_TextEdit.AddMessage(g_StringTable.m_strString[215], g_ClientMain.m_dwMyChrID, 0);
|
|
}
|
|
}
|
|
}
|
|
} else
|
|
{
|
|
if(g_ClientMain.m_csStatus.m_lstSkillSlot[i + lStartSkill] && g_ClientMain.m_csStatus.m_lstSkillSlot[i + lStartSkill]->IsOverMouse() && !g_ClientMain.m_lpPickItem)
|
|
{
|
|
const Skill::ProtoType *lpProtoType = g_SkillMgr.g_SkillMgr.GetSkillProtoType(g_ClientMain.m_csStatus.m_lstSkillSlot[i + lStartSkill]->GetProtoTypeID());
|
|
|
|
if(lpProtoType)
|
|
{
|
|
if(lpProtoType->m_eSkillType != Skill::Type::PASSIVE)
|
|
{
|
|
g_ClientMain.m_lpPickItem = new CItemInstance;
|
|
g_ClientMain.m_lpPickItem->SetSkillInfo(g_ClientMain.m_csStatus.m_lstSkillSlot[i + lStartSkill]);
|
|
g_ClientMain.SetPickItem(g_ClientMain.m_lpPickItem);
|
|
|
|
return TRUE;
|
|
} else
|
|
{
|
|
g_TextEdit.AddMessage(g_StringTable.m_strString[215], g_ClientMain.m_dwMyChrID, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if(m_ButtonManager.m_lstButton[14]->m_nState == BUTTON_CLICK)
|
|
{
|
|
m_ButtonManager.m_lstButton[14]->m_nState = BUTTON_NONE;
|
|
m_bShow = FALSE;
|
|
}
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
void CHumanSkill::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
|
{
|
|
m_lstSprite[0]->Render(lpD3DDevice, m_cAlpha);
|
|
m_lstSprite[1]->Render(lpD3DDevice, m_cAlpha);
|
|
|
|
for(int i = 0; i < 7; i++)
|
|
{
|
|
m_ButtonManager.m_lstButton[i * 2]->ShowButton(FALSE);
|
|
m_ButtonManager.m_lstButton[1 + i * 2]->ShowButton(FALSE);
|
|
m_ButtonManager.m_lstButton[15 + i]->ShowButton(FALSE);
|
|
}
|
|
|
|
long lStartSkill;
|
|
if(m_dwStartSlot < g_ClientMain.m_csStatus.m_lstClassSkill.size())
|
|
{
|
|
lStartSkill = 0;
|
|
} else
|
|
{
|
|
lStartSkill = m_dwStartSlot - g_ClientMain.m_csStatus.m_lstClassSkill.size();
|
|
}
|
|
|
|
unsigned long dwSlot = 0;
|
|
for(i = m_dwStartSlot; i < g_ClientMain.m_csStatus.m_lstClassSkill.size(); i++)
|
|
{
|
|
if(dwSlot < 7)
|
|
{
|
|
RenderClassSlot(lpD3DDevice, g_ClientMain.m_csStatus.m_lstClassSkill[i], dwSlot, m_cAlpha, m_rcWindowSize.left + 8, m_rcWindowSize.top + 66 + dwSlot * 53);
|
|
dwSlot++;
|
|
} else
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
|
|
for(i = 0 + lStartSkill; i < 7 + lStartSkill; i++)
|
|
{
|
|
if(dwSlot < 7)
|
|
{
|
|
RenderSlot(lpD3DDevice, g_ClientMain.m_csStatus.m_lstSkillSlot[i], dwSlot, m_cAlpha, m_rcWindowSize.left + 8, m_rcWindowSize.top + 66 + dwSlot * 53);
|
|
dwSlot++;
|
|
} else
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
|
|
RECT rcRect;
|
|
char strString[MAX_PATH];
|
|
// 현재 스킬수
|
|
SetRect(&rcRect, 100 + m_rcWindowSize.left, 35 + m_rcWindowSize.top, 124 + m_rcWindowSize.left, 47 + m_rcWindowSize.top);
|
|
sprintf(strString, "%d", g_ClientMain.m_csStatus.m_Skill.wSkillNum);
|
|
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
|
|
|
// 레벨
|
|
long lINT = (((g_ClientMain.m_csStatus.m_Info.INT + g_ClientMain.m_csStatus.m_lAddINT) - 20) / 10.0f);
|
|
if(lINT < 0 ) lINT = 0;
|
|
SetRect(&rcRect, 132 + m_rcWindowSize.left, 35 + m_rcWindowSize.top, 155 + m_rcWindowSize.left, 47 + m_rcWindowSize.top);
|
|
sprintf(strString, "%d", g_ClientMain.m_csStatus.m_Info.Level + lINT);
|
|
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
|
|
|
m_lstScroll[0]->Render(lpD3DDevice, m_cAlpha);
|
|
|
|
m_ButtonManager.Render(lpD3DDevice);
|
|
}
|
|
|
|
void CHumanSkill::RenderClassSlot(LPDIRECT3DDEVICE8 lpD3DDevice, CItemInstance *lpSkill, long lSlot, unsigned char cAlpha, long lMoveX, long lMoveY)
|
|
{
|
|
if(lpSkill)
|
|
{
|
|
m_lstSprite[2]->Render(lpD3DDevice, cAlpha, lMoveX, lMoveY);
|
|
|
|
RECT rcRect;
|
|
char strString[MAX_PATH];
|
|
|
|
lpSkill->m_wPutX = lMoveX + 9;
|
|
lpSkill->m_wPutY = lMoveY + 5;
|
|
lpSkill->Render(lpD3DDevice);
|
|
|
|
// 스킬 이름
|
|
SetRect(&rcRect, 50 + lMoveX, 7 + lMoveY, 135 + lMoveX, 20 + lMoveY);
|
|
strcpy(strString, lpSkill->GetItemInfo().m_SpriteData.m_szName);
|
|
if(strlen(strString) > 13)
|
|
{
|
|
strString[13] = '.';
|
|
strString[14] = '.';
|
|
strString[15] = '.';
|
|
strString[16] = '\0';
|
|
}
|
|
g_TextEdit.DrawText(strString, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
|
|
|
m_lstSprite[3]->Render(lpD3DDevice, cAlpha, 63 + lMoveX, 42 + lMoveY);
|
|
}
|
|
}
|
|
|
|
void CHumanSkill::RenderSlot(LPDIRECT3DDEVICE8 lpD3DDevice, CItemInstance *lpSkill, long lSlot, unsigned char cAlpha, long lMoveX, long lMoveY)
|
|
{
|
|
if(lpSkill)
|
|
{
|
|
m_lstSprite[2]->Render(lpD3DDevice, cAlpha, lMoveX, lMoveY);
|
|
/* switch(GetSkillClass(CGameData::m_Status.m_Skill.SSlot[nSkillSlot + m_StartSkillSlot].SKILLINFO.wSkill))
|
|
{
|
|
case SKILL_PASSIVE:
|
|
RenderSprite(m_FramePassive, pd3dDevice, Alpha, 10 + MoveX, 39 + MoveY);
|
|
break;
|
|
|
|
case SKILL_INSTANCE:
|
|
RenderSprite(m_FrameInstance, pd3dDevice, Alpha, 10 + MoveX, 39 + MoveY);
|
|
break;
|
|
|
|
case SKILL_CHANT:
|
|
RenderSprite(m_FrameChant, pd3dDevice, Alpha, 10 + MoveX, 39 + MoveY);
|
|
break;
|
|
|
|
case SKILL_CAST:
|
|
RenderSprite(m_FrameCast, pd3dDevice, Alpha, 10 + MoveX, 39 + MoveY);
|
|
break;
|
|
}*/
|
|
|
|
// int nSkillPos = GetSkillPos(CGameData::m_Status.m_Skill.SSlot[nSkillSlot + m_StartSkillSlot].SKILLINFO.wSkill);
|
|
RECT rcRect;
|
|
char strString[MAX_PATH];
|
|
|
|
if(lpSkill)
|
|
{
|
|
lpSkill->m_wPutX = lMoveX + 9;
|
|
lpSkill->m_wPutY = lMoveY + 5;
|
|
lpSkill->Render(lpD3DDevice);
|
|
|
|
// 스킬 이름
|
|
SetRect(&rcRect, 50 + lMoveX, 7 + lMoveY, 135 + lMoveX, 20 + lMoveY);
|
|
strcpy(strString, lpSkill->GetItemInfo().m_SpriteData.m_szName);
|
|
if(strlen(strString) > 13)
|
|
{
|
|
strString[13] = '.';
|
|
strString[14] = '.';
|
|
strString[15] = '.';
|
|
strString[16] = '\0';
|
|
}
|
|
g_TextEdit.DrawText(strString, &rcRect, DT_LEFT | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
|
}
|
|
|
|
if(lpSkill)
|
|
{
|
|
// 스킬 레벨
|
|
SetRect(&rcRect, 127 + lMoveX, 23 + lMoveY, 138 + lMoveX, 39 + lMoveY);
|
|
sprintf(strString, "%d", lpSkill->GetNowDurability());
|
|
g_TextEdit.DrawText(strString, &rcRect, DT_CENTER | DT_VCENTER, D3DCOLOR_RGBA(255, 255, 255, m_cAlpha));
|
|
|
|
for(int i = 0; i < lpSkill->GetNowDurability(); i++)
|
|
{
|
|
m_lstSprite[4]->Render(lpD3DDevice, cAlpha, 70 + lMoveX + i * 12, 43 + lMoveY);
|
|
}
|
|
|
|
if(m_bSkillUnLock)
|
|
{
|
|
if(lpSkill->GetMaxDurability()) m_ButtonManager.m_lstButton[15 + lSlot]->ShowButton(TRUE);
|
|
} else
|
|
{
|
|
if(lpSkill->GetNowDurability() == 6) m_ButtonManager.m_lstButton[lSlot * 2]->ShowButton(TRUE);
|
|
if(lpSkill->GetNowDurability() != 0) m_ButtonManager.m_lstButton[1 + lSlot * 2]->ShowButton(TRUE);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
void CHumanSkill::ShowWindow(BOOL bShow)
|
|
{
|
|
if(bShow)
|
|
{
|
|
m_bShow = TRUE;
|
|
InitValue();
|
|
} else
|
|
{
|
|
m_bShow = FALSE;
|
|
m_bSkillUnLock = FALSE;
|
|
}
|
|
} |