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>
163 lines
4.3 KiB
C++
163 lines
4.3 KiB
C++
// ItemInstance.h: interface for the CItemInstance class.
|
||
//
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
#if !defined(AFX_ITEMINSTANCE_H__AB450B03_AEF2_455D_85C8_5BF3CA68831F__INCLUDED_)
|
||
#define AFX_ITEMINSTANCE_H__AB450B03_AEF2_455D_85C8_5BF3CA68831F__INCLUDED_
|
||
|
||
#if _MSC_VER > 1000
|
||
#pragma once
|
||
#endif // _MSC_VER > 1000
|
||
|
||
#include "Item\Item.h"
|
||
#include "Sprite.h"
|
||
#include "GUITooltip.h"
|
||
#include <vertex.h>
|
||
|
||
class CItemInstance
|
||
{
|
||
public:
|
||
unsigned short GetProtoTypeID(void) { return m_lpItemBase->GetPrototypeID(); }
|
||
unsigned short GetSkillID(void)
|
||
{
|
||
if(m_lpItemBase->GetItemInfo().m_DetailData.m_cItemType == Item::CItemType::SKILLBOOK)
|
||
{
|
||
return m_lpItemBase->GetItemInfo().m_UseItemInfo.m_usSkill_ID;
|
||
}
|
||
|
||
return 0;
|
||
}
|
||
unsigned char GetMaxDurability(void)
|
||
{
|
||
if(m_bSkill)
|
||
{
|
||
return ((Item::CSkillItem *)m_lpItemBase)->GetMaxNumOrDurability();
|
||
} else
|
||
{
|
||
return m_lpItemBase->GetMaxNumOrDurability();
|
||
}
|
||
}
|
||
void SetNowDurability(unsigned char cNowDurability)
|
||
{
|
||
m_lpItemBase->SetNumOrDurability(cNowDurability);
|
||
}
|
||
unsigned char GetNowDurability(void)
|
||
{
|
||
return m_lpItemBase->GetNumOrDurability();
|
||
}
|
||
const Item::ItemInfo &GetItemInfo(void) { return m_lpItemBase->GetItemInfo(); }
|
||
// Item::ItemPos &GetPos(void) { m_lpItemBase->GetPos(); }
|
||
void SetPos(unsigned short wIndex) { m_lpItemBase->SetPos(wIndex); }
|
||
void SetPos(Item::ItemPos &pItemIndex)
|
||
{
|
||
SetItemPos(pItemIndex.m_cPos);
|
||
SetPos(pItemIndex.m_cIndex);
|
||
if(pItemIndex.m_cPos != ClientSocket::ItemPos_Temp)
|
||
{
|
||
m_ipPreIndex = m_lpItemBase->GetPos();
|
||
}
|
||
}
|
||
void SetPos(unsigned char &cXIndex, unsigned char &cYIndex, unsigned char &cZIndex)
|
||
{
|
||
m_lpItemBase->SetPos(cXIndex, cYIndex, cZIndex);
|
||
}
|
||
|
||
unsigned short GetSkillIDbyChantID(unsigned char cChant);
|
||
unsigned char GetSkillType(void);
|
||
void ClearCoolDown(void);
|
||
BOOL GetIsEnableUpgrade();
|
||
BOOL SetSkillInfo(unsigned short wSkillID, unsigned char cGrade, unsigned char cLevel, unsigned char cPos, unsigned char cIndex, long lCoolDown);
|
||
BOOL SetSkillInfo(CItemInstance *lpSkill);
|
||
void SetCoolDownTime(long lCoolTime)
|
||
{
|
||
m_lCoolDownTime = lCoolTime;
|
||
}
|
||
void StartCoolDown(unsigned short wGrade = 0, unsigned char cCountCooldown = 0);
|
||
BOOL UpdateCoolDownTime(void);
|
||
unsigned short GetSkillGrade(void)
|
||
{
|
||
return m_wGrade;
|
||
}
|
||
void SetItemPos(unsigned short wItemPos)
|
||
{
|
||
m_lpItemBase->SetItemPos(wItemPos);
|
||
if(wItemPos != ClientSocket::ItemPos_Temp)
|
||
{
|
||
m_ipPreIndex.m_cPos = wItemPos;
|
||
}
|
||
}
|
||
unsigned short GetItemPos(void)
|
||
{
|
||
return m_lpItemBase->GetItemPos();
|
||
}
|
||
|
||
unsigned char GetItemType(void)
|
||
{
|
||
return m_lpItemBase->GetItemInfo().m_DetailData.m_cItemType;
|
||
}
|
||
BOOL GetIsEquip(void)
|
||
{
|
||
if(!m_bSkill && m_lpItemBase->GetEnableEquip()) return TRUE;
|
||
|
||
return FALSE;
|
||
}
|
||
BOOL GetIsEnableRepair(void)
|
||
{
|
||
if(!m_bSkill && m_lpItemBase->GetEnableRepair()) return TRUE;
|
||
|
||
return FALSE;
|
||
}
|
||
BOOL GetIsEnableStack(void)
|
||
{
|
||
if(!m_bSkill && m_lpItemBase->GetEnableStack()) return TRUE;
|
||
|
||
return FALSE;
|
||
}
|
||
BOOL GetIsSocketItem(void)
|
||
{
|
||
if(m_lpItemBase->GetSocketItem()) return TRUE;
|
||
|
||
return FALSE;
|
||
}
|
||
BOOL GetTwoHandItem(void)
|
||
{
|
||
if(m_lpItemBase->GetTwohandItem()) return TRUE;
|
||
|
||
return FALSE;
|
||
}
|
||
BOOL IsOverMouse(void);
|
||
BOOL m_bTradeItem;
|
||
short m_wPutX; // ȭ<><C8AD> X <20><>ǥ
|
||
short m_wPutY; // ȭ<><C8AD> Y <20><>ǥ
|
||
// unsigned long m_dwItemPos;
|
||
BOOL m_bSkill;
|
||
BOOL m_bClassSkill;
|
||
long m_lCoolDownTime;
|
||
long m_lCoolDownTimeCount;
|
||
TLVertex m_pCoolDownVertices[10];
|
||
unsigned short m_wCoolDownIndex[24];
|
||
BOOL m_bShowTooltip;
|
||
BOOL m_bCanUsed;
|
||
unsigned char m_cCountCooldown;
|
||
unsigned short m_wGrade;
|
||
Item::ItemPos m_ipPreIndex;
|
||
|
||
__int64 m_dwItemUID;
|
||
|
||
Item::CItem *m_lpItemBase;
|
||
// Item::LPProtoTypeInfo m_lpProtoTypeInfo;
|
||
CSprite *m_lpSprite;
|
||
CGUITooltip *m_lpTooltip;
|
||
|
||
CItemInstance();
|
||
~CItemInstance();
|
||
|
||
void ShowTooltip(BOOL bShow) { m_bShowTooltip = bShow; }
|
||
int SetItemInfo(const char* lpSerializedItem_In, size_t& nParseLength_InOut);
|
||
int SetItemInfo(CItemInstance *lpItem, Item::ItemPos pItemPos);
|
||
int SetItemInfofromID(unsigned short wProtoTypeID, Item::ItemPos &pItemIndex);
|
||
void Render(LPDIRECT3DDEVICE8 lpD3DDevice);
|
||
};
|
||
|
||
#endif // !defined(AFX_ITEMINSTANCE_H__AB450B03_AEF2_455D_85C8_5BF3CA68831F__INCLUDED_)
|