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>
1696 lines
55 KiB
C++
1696 lines
55 KiB
C++
// GUITooltipItem.cpp: implementation of the CGUITooltipItem class.
|
||
//
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
#include "ClientMain.h"
|
||
#include "WinInput.h"
|
||
#include "GUITextEdit.h"
|
||
#include "GUITooltipItem.h"
|
||
#include "ItemStorage.h"
|
||
|
||
#include "Item\ItemMgr.h"
|
||
#include "Item\ItemFactory.h"
|
||
#include "Skill\SkillMgr.h"
|
||
|
||
//////////////////////////////////////////////////////////////////////
|
||
// Construction/Destruction
|
||
//////////////////////////////////////////////////////////////////////
|
||
|
||
CGUITooltipItem::CGUITooltipItem()
|
||
{
|
||
m_lpItem = NULL;
|
||
}
|
||
|
||
CGUITooltipItem::~CGUITooltipItem()
|
||
{
|
||
|
||
}
|
||
|
||
BOOL CGUITooltipItem::GetIsTooltip(void)
|
||
{
|
||
if(m_lpItem)
|
||
return TRUE;
|
||
else
|
||
return FALSE;
|
||
}
|
||
|
||
void CGUITooltipItem::DestroyTooltip(void)
|
||
{
|
||
}
|
||
|
||
void CGUITooltipItem::Render(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
if(m_lpItem->m_bSkill)
|
||
{
|
||
RenderSkill(lpD3DDevice);
|
||
} else
|
||
{
|
||
switch(m_lpItem->GetItemType())
|
||
{
|
||
case Item::ItemType::SKILLBOOK:
|
||
RenderBook(lpD3DDevice);
|
||
break;
|
||
|
||
case Item::ItemType::ETC:
|
||
case Item::ItemType::GEM:
|
||
case Item::ItemType::MATERIAL:
|
||
case Item::ItemType::POTION:
|
||
case Item::ItemType::AMMO:
|
||
RenderEtc(lpD3DDevice);
|
||
break;
|
||
|
||
case Item::ItemType::BOLT:
|
||
case Item::ItemType::ARROW:
|
||
default:
|
||
RenderEquip(lpD3DDevice);
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
void CGUITooltipItem::RenderBook(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||
short SizeX = ptMousePos->x + 7;
|
||
short SizeY = ptMousePos->y + 11;
|
||
short sLength, sLine;
|
||
GetBookTooltipPos(SizeX, SizeY, sLength, sLine);
|
||
|
||
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, SizeX, SizeY, SizeX + sLength + 10, SizeY + sLine * 16 + 6, 0x00000000, 0x99);
|
||
|
||
unsigned long dwWhiteColor = D3DCOLOR_RGBA(255, 255, 255, 255);
|
||
unsigned long dwRedColor = D3DCOLOR_RGBA(255, 0, 0, 255);
|
||
|
||
RECT rcRect;
|
||
char strText[100];
|
||
int Count = 0;
|
||
sprintf(strText, "%s", m_lpItem->GetItemInfo().m_SpriteData.m_szName);
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
|
||
if(g_ClientMain.m_lpInterface->GetIsTrade())
|
||
{
|
||
if(m_lpItem->m_bTradeItem)
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(m_lpItem->m_lpItemBase->GetBuyPrice()));
|
||
else
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(m_lpItem->m_lpItemBase->GetSellPrice()));
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
}
|
||
|
||
Item::CUseItem *lpItem = Item::CUseItem::DowncastToUseItem(m_lpItem->m_lpItemBase);
|
||
if(!lpItem) return;
|
||
|
||
unsigned short wLockCount = lpItem->GetItemInfo().m_UseItemInfo.m_usSkill_LockCount;
|
||
const Skill::ProtoType *lpSkillBook = g_SkillMgr.GetSkillProtoType(lpItem->GetItemInfo().m_UseItemInfo.m_usSkill_ID);
|
||
if(lpSkillBook) lpSkillBook = &lpSkillBook[wLockCount];
|
||
|
||
if(lpSkillBook)
|
||
{
|
||
/* sprintf(strText, g_StringTable.m_strString[36], lpSkillBook->m_SpriteInfo.m_szName);
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;*/
|
||
|
||
SKILLSLOT *lpSkillSlot = g_ClientMain.m_csStatus.GetSkillSlot(lpItem->GetItemInfo().m_UseItemInfo.m_usSkill_ID);
|
||
if(lpSkillSlot && wLockCount < lpSkillSlot->SKILLINFO.cLockCount)
|
||
{
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(g_StringTable.m_strString[93], &rcRect, DT_VCENTER | DT_CENTER, dwRedColor);
|
||
Count++;
|
||
} else if(lpSkillSlot && wLockCount == lpSkillSlot->SKILLINFO.cLockCount && lpSkillSlot->SKILLINFO.cSkillLevel == 6)
|
||
{
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(g_StringTable.m_strString[94], &rcRect, DT_VCENTER | DT_CENTER, dwRedColor);
|
||
Count++;
|
||
} else
|
||
{
|
||
for(int i = 0; i < 2; i++)
|
||
{
|
||
if(lpSkillBook->m_StatusLimitType[i])
|
||
{
|
||
unsigned long dwColor = dwWhiteColor;
|
||
unsigned long dwValue;
|
||
if(lpSkillSlot)
|
||
{
|
||
if(wLockCount == lpSkillSlot->SKILLINFO.cLockCount)
|
||
{
|
||
dwValue = (wLockCount * 6 + lpSkillSlot->SKILLINFO.cSkillLevel + 1) * lpSkillBook->m_StatusLimitValue[i];
|
||
} else
|
||
{
|
||
dwValue = (wLockCount * 6 + 1) * lpSkillBook->m_StatusLimitValue[i];
|
||
}
|
||
} else
|
||
dwValue = (wLockCount * 6 + 1) * lpSkillBook->m_StatusLimitValue[i];
|
||
|
||
switch(lpSkillBook->m_StatusLimitType[i])
|
||
{
|
||
case Skill::StatusLimit::STR:
|
||
sprintf(strText, g_StringTable.m_strString[37], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.STR < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Skill::StatusLimit::DEX:
|
||
sprintf(strText, g_StringTable.m_strString[38], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.DEX < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Skill::StatusLimit::CON:
|
||
sprintf(strText, g_StringTable.m_strString[39], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.CON < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Skill::StatusLimit::INT:
|
||
sprintf(strText, g_StringTable.m_strString[40], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.INT < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Skill::StatusLimit::WIS:
|
||
sprintf(strText, g_StringTable.m_strString[41], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.WIS < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
}
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwColor);
|
||
Count++;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
void CGUITooltipItem::RenderEquip(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||
short SizeX = ptMousePos->x + 7;
|
||
short SizeY = ptMousePos->y + 11;
|
||
short sLength, sLine;
|
||
unsigned long dwLength, dwStart;
|
||
GetEquipTooltipPos(SizeX, SizeY, sLength, sLine);
|
||
|
||
Item::CEquipment *lpBase = (Item::CEquipment *)Item::CItemFactory::GetInstance().CreateItem(m_lpItem->GetProtoTypeID());
|
||
Item::CEquipment *lpItem = Item::CEquipment::DowncastToEquipment(m_lpItem->m_lpItemBase);
|
||
|
||
unsigned long dwSocketSize = 0;
|
||
if(0 < lpItem->m_cMaxSocket && lpItem->m_cMaxSocket <= 4)
|
||
dwSocketSize = 32;
|
||
else if(4 < lpItem->m_cMaxSocket && lpItem->m_cMaxSocket <= 8)
|
||
dwSocketSize = 64;
|
||
if(m_lpItem->m_bTradeItem && g_ClientMain.m_lpInterface->GetIsBlackMarket())
|
||
{
|
||
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, SizeX, SizeY, SizeX + sLength + 10, SizeY + sLine * 16 + 6, 0x00000000, 0x99);
|
||
} else
|
||
{
|
||
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, SizeX, SizeY, SizeX + sLength + 10, SizeY + sLine * 16 + 6 + dwSocketSize, 0x00000000, 0x99);
|
||
}
|
||
|
||
unsigned long dwWhiteColor = D3DCOLOR_RGBA(255, 255, 255, 255);
|
||
unsigned long dwGreenColor = D3DCOLOR_RGBA(0, 255, 0, 255);
|
||
unsigned long dwRedColor = D3DCOLOR_RGBA(255, 0, 0, 255);
|
||
|
||
RECT rcRect;
|
||
char strText[100];
|
||
int i, Count = 0;
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
if(m_lpItem->m_bTradeItem && g_ClientMain.m_lpInterface->GetIsBlackMarket())
|
||
{
|
||
g_TextEdit.DrawText(lpItem->GetItemTypeName(), &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
} else
|
||
{
|
||
char strItemName[MAX_PATH];
|
||
if(lpItem->GetUpgradeLevel() > 0)
|
||
{
|
||
sprintf(strItemName, "%s +%d", m_lpItem->GetItemInfo().m_SpriteData.m_szName, lpItem->GetUpgradeLevel());
|
||
} else
|
||
{
|
||
strcpy(strItemName, lpItem->GetItemInfo().m_SpriteData.m_szName);
|
||
}
|
||
|
||
if(lpItem->GetItemInfo().m_DetailData.m_ItemGrade == Item::Grade::RARE)
|
||
{
|
||
g_TextEdit.DrawText(strItemName, &rcRect, DT_VCENTER | DT_CENTER, D3DCOLOR_RGBA(244, 217, 123, 255));
|
||
} else if(lpItem->GetItemInfo().m_DetailData.m_ItemGrade == Item::Grade::ENHANCED)
|
||
{
|
||
g_TextEdit.DrawText(strItemName, &rcRect, DT_VCENTER | DT_CENTER, D3DCOLOR_RGBA(93, 215, 202, 255));
|
||
} else
|
||
{
|
||
g_TextEdit.DrawText(strItemName, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
}
|
||
Count++;
|
||
}
|
||
|
||
unsigned long dwClass[4] = { 0, 0, 0, 0 }, count = 0;
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ǻ<EFBFBD><C7BA>ϴ<EFBFBD> if<69><66> <20>߰<EFBFBD><DFB0>Ǿ<EFBFBD><C7BE>Ѵ<EFBFBD>.
|
||
if(lpItem->GetItemInfo().m_UseLimit.m_dwClassLimit != 0x00000FFF && lpItem->GetItemInfo().m_UseLimit.m_dwClassLimit != 0x00FF0000)
|
||
{
|
||
BOOL bCanClass = FALSE;
|
||
for(int i = 1; i <= 24; i++)
|
||
{
|
||
if(lpItem->GetItemInfo().m_UseLimit.m_dwClassLimit & (0x00000001 << (i - 1)))
|
||
{
|
||
dwClass[count] = i;
|
||
count++;
|
||
|
||
if(g_ClientMain.m_csStatus.m_Info.Class == i) bCanClass = TRUE;
|
||
}
|
||
}
|
||
|
||
unsigned long dwColor;
|
||
if(bCanClass)
|
||
dwColor = D3DCOLOR_RGBA(248, 200, 112, 255);
|
||
else
|
||
dwColor = dwRedColor;
|
||
|
||
if(dwClass[0])
|
||
{
|
||
sprintf(strText, "%s", g_ClientMain.m_lpCommonInterface->GetClassName(dwClass[0]));
|
||
}
|
||
if(dwClass[1])
|
||
{
|
||
strcat(strText, ", ");
|
||
strcat(strText, g_ClientMain.m_lpCommonInterface->GetClassName(dwClass[1]));
|
||
}
|
||
|
||
if(dwClass[0])
|
||
{
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwColor);
|
||
Count++;
|
||
}
|
||
|
||
if(dwClass[2])
|
||
{
|
||
sprintf(strText, "%s", g_ClientMain.m_lpCommonInterface->GetClassName(dwClass[2]));
|
||
}
|
||
if(dwClass[3])
|
||
{
|
||
strcat(strText, ", ");
|
||
strcat(strText, g_ClientMain.m_lpCommonInterface->GetClassName(dwClass[3]));
|
||
}
|
||
|
||
if(dwClass[2])
|
||
{
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwColor);
|
||
Count++;
|
||
}
|
||
}
|
||
|
||
if(g_ClientMain.m_lpInterface->GetIsTrade())
|
||
{
|
||
if(m_lpItem->m_bTradeItem)
|
||
{
|
||
if(g_ClientMain.m_lpInterface->GetIsBlackMarket())
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(lpItem->GetBuyBlackPrice()));
|
||
} else
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(lpItem->GetBuyPrice()));
|
||
}
|
||
}
|
||
else
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(lpItem->GetSellPrice()));
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
}
|
||
|
||
if(m_lpItem->m_bTradeItem && g_ClientMain.m_lpInterface->GetIsBlackMarket()) return;
|
||
|
||
if(m_lpItem->GetItemType() != Item::ItemType::ARROW && m_lpItem->GetItemType() != Item::ItemType::BOLT)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[42], lpItem->GetNumOrDurability(), lpItem->GetMaxNumOrDurability());
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
dwStart = ((sLength + 10) / 2) - (dwLength / 2);
|
||
strcpy(strText, g_StringTable.m_strString[43]);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, SizeX + dwStart, SizeY + Count * 16 + 3, SizeX + dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
|
||
sprintf(strText, "%d ", lpItem->GetNumOrDurability());
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, dwStart, SizeY + Count * 16 + 3, dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
if(lpBase->GetMaxNumOrDurability() < lpItem->GetMaxNumOrDurability())
|
||
{
|
||
if(lpItem->GetNumOrDurability() == lpItem->GetMaxNumOrDurability())
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwGreenColor);
|
||
} else
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
}
|
||
} else
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
}
|
||
|
||
strcpy(strText, "/ ");
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, dwStart, SizeY + Count * 16 + 3, dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
|
||
sprintf(strText, "%d", lpItem->GetMaxNumOrDurability());
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, dwStart, SizeY + Count * 16 + 3, dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
if(lpBase->GetMaxNumOrDurability() < lpItem->GetMaxNumOrDurability())
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwGreenColor);
|
||
} else if(lpBase->GetMaxNumOrDurability() == lpItem->GetMaxNumOrDurability())
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
} else if(lpBase->GetMaxNumOrDurability() > lpItem->GetMaxNumOrDurability())
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwRedColor);
|
||
}
|
||
Count++;
|
||
}
|
||
|
||
for(i = 1; i < 6; i++)
|
||
{
|
||
if(lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i])
|
||
{
|
||
unsigned dwColor = dwWhiteColor;
|
||
switch(i)
|
||
{
|
||
case Item::StatusLimit::LEVEL:
|
||
sprintf(strText, g_StringTable.m_strString[44], lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]);
|
||
if(g_ClientMain.m_csStatus.m_Info.Level < lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Item::StatusLimit::STR:
|
||
sprintf(strText, g_StringTable.m_strString[37], lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]);
|
||
if(g_ClientMain.m_csStatus.m_Info.STR < lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Item::StatusLimit::DEX:
|
||
sprintf(strText, g_StringTable.m_strString[38], lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]);
|
||
if(g_ClientMain.m_csStatus.m_Info.DEX < lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Item::StatusLimit::CON:
|
||
sprintf(strText, g_StringTable.m_strString[39], lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]);
|
||
if(g_ClientMain.m_csStatus.m_Info.CON < lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Item::StatusLimit::INT:
|
||
sprintf(strText, g_StringTable.m_strString[40], lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]);
|
||
if(g_ClientMain.m_csStatus.m_Info.INT < lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Item::StatusLimit::WIS:
|
||
sprintf(strText, g_StringTable.m_strString[41], lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]);
|
||
if(g_ClientMain.m_csStatus.m_Info.WIS < lpItem->GetItemInfo().m_UseLimit.m_nStatusLimit[i]) dwColor = dwRedColor;
|
||
break;
|
||
}
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwColor);
|
||
Count++;
|
||
}
|
||
}
|
||
|
||
unsigned char cBaseMinDamage = 0, cBaseMaxDamage = 0, cBaseDefense = 0;
|
||
for(i = 0; i < Item::Attribute::MAX_ATTRIBUTE_NUM; i++)
|
||
{
|
||
if(lpBase->m_usAttribute[i])
|
||
{
|
||
switch(i)
|
||
{
|
||
case Item::Attribute::MIN_DAMAGE:
|
||
cBaseMinDamage = lpBase->m_usAttribute[i];
|
||
break;
|
||
|
||
case Item::Attribute::MAX_DAMAGE:
|
||
cBaseMaxDamage = lpBase->m_usAttribute[i];
|
||
break;
|
||
|
||
case Item::Attribute::DEFENCE:
|
||
cBaseDefense = lpBase->m_usAttribute[i];
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
unsigned char cMinDamage = 0, cMaxDamage = 0, cDefense = 0;
|
||
for(i = 0; i < Item::Attribute::MAX_ATTRIBUTE_NUM; i++)
|
||
{
|
||
if(lpItem->m_usAttribute[i])
|
||
{
|
||
switch(i)
|
||
{
|
||
case Item::Attribute::MIN_DAMAGE:
|
||
cMinDamage = lpItem->m_usAttribute[i];
|
||
break;
|
||
|
||
case Item::Attribute::MAX_DAMAGE:
|
||
cMaxDamage = lpItem->m_usAttribute[i];
|
||
break;
|
||
|
||
case Item::Attribute::DEFENCE:
|
||
cDefense = lpItem->m_usAttribute[i];
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
if(cMinDamage || cMaxDamage)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[45], cMinDamage, cMaxDamage);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
dwStart = ((sLength + 10) / 2) - (dwLength / 2);
|
||
strcpy(strText, g_StringTable.m_strString[46]);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, SizeX + dwStart, SizeY + Count * 16 + 3, SizeX + dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
|
||
sprintf(strText, "%d ", cMinDamage);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, dwStart, SizeY + Count * 16 + 3, dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
if(cBaseMinDamage < cMinDamage)
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwGreenColor);
|
||
} else if(cBaseMinDamage == cMinDamage)
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
} else if(cBaseMinDamage > cMinDamage)
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwRedColor);
|
||
}
|
||
|
||
strcpy(strText, "~ ");
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, dwStart, SizeY + Count * 16 + 3, dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
|
||
sprintf(strText, "%d", cMaxDamage);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, dwStart, SizeY + Count * 16 + 3, dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
if(cBaseMaxDamage < cMaxDamage)
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwGreenColor);
|
||
} else if(cBaseMaxDamage == cMaxDamage)
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
} else if(cBaseMaxDamage > cMaxDamage)
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwRedColor);
|
||
}
|
||
Count++;
|
||
}
|
||
|
||
if(cDefense)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[47], cDefense);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
dwStart = ((sLength + 10) / 2) - (dwLength / 2);
|
||
strcpy(strText, g_StringTable.m_strString[48]);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, SizeX + dwStart, SizeY + Count * 16 + 3, SizeX + dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
|
||
sprintf(strText, "%d", cDefense);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, dwStart, SizeY + Count * 16 + 3, dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
if(cBaseDefense < cDefense)
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwGreenColor);
|
||
} else if(cBaseDefense == cDefense)
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
} else if(cBaseDefense > cDefense)
|
||
{
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwRedColor);
|
||
}
|
||
Count++;
|
||
}
|
||
|
||
for(i = 0; i < Item::Attribute::MAX_ATTRIBUTE_NUM; i++)
|
||
{
|
||
if(lpItem->m_usAttribute[i])
|
||
{
|
||
switch(i)
|
||
{
|
||
case Item::Attribute::CRITICAL_PERCENTAGE:
|
||
strcpy(strText, g_StringTable.m_strString[49]);
|
||
break;
|
||
|
||
case Item::Attribute::OFFENCE_REVISION:
|
||
strcpy(strText, g_StringTable.m_strString[50]);
|
||
break;
|
||
|
||
case Item::Attribute::DEFENCE_REVISION:
|
||
strcpy(strText, g_StringTable.m_strString[51]);
|
||
break;
|
||
|
||
case Item::Attribute::MAGIC_RESISTANCE:
|
||
strcpy(strText, g_StringTable.m_strString[52]);
|
||
break;
|
||
|
||
case Item::Attribute::BLOCKING_PERCENTAGE:
|
||
strcpy(strText, g_StringTable.m_strString[53]);
|
||
break;
|
||
|
||
case Item::Attribute::MAX_HP:
|
||
strcpy(strText, g_StringTable.m_strString[54]);
|
||
break;
|
||
|
||
case Item::Attribute::MAX_MP:
|
||
strcpy(strText, g_StringTable.m_strString[55]);
|
||
break;
|
||
|
||
case Item::Attribute::HP_REGEN_AMOUNT:
|
||
strcpy(strText, g_StringTable.m_strString[56]);
|
||
break;
|
||
|
||
case Item::Attribute::MP_REGEN_AMOUNT:
|
||
strcpy(strText, g_StringTable.m_strString[57]);
|
||
break;
|
||
|
||
case Item::Attribute::FIRE_ATTACK:
|
||
strcpy(strText, g_StringTable.m_strString[58]);
|
||
break;
|
||
|
||
case Item::Attribute::LIGHTNING_ATTACK:
|
||
strcpy(strText, g_StringTable.m_strString[59]);
|
||
break;
|
||
|
||
case Item::Attribute::COLD_ATTACK:
|
||
strcpy(strText, g_StringTable.m_strString[60]);
|
||
break;
|
||
|
||
case Item::Attribute::DRAIN_ATTACK:
|
||
strcpy(strText, g_StringTable.m_strString[61]);
|
||
break;
|
||
|
||
case Item::Attribute::POISON_ATTACK:
|
||
strcpy(strText, g_StringTable.m_strString[62]);
|
||
break;
|
||
|
||
case Item::Attribute::FIRE_RESISTANCE:
|
||
strcpy(strText, g_StringTable.m_strString[63]);
|
||
break;
|
||
|
||
case Item::Attribute::LIGHTNING_RESISTANCE:
|
||
strcpy(strText, g_StringTable.m_strString[64]);
|
||
break;
|
||
|
||
case Item::Attribute::COLD_RESISTANCE:
|
||
strcpy(strText, g_StringTable.m_strString[65]);
|
||
break;
|
||
|
||
case Item::Attribute::DRAIN_RESISTANCE:
|
||
strcpy(strText, g_StringTable.m_strString[66]);
|
||
break;
|
||
|
||
case Item::Attribute::POISON_RESISTANCE:
|
||
strcpy(strText, g_StringTable.m_strString[67]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_STR:
|
||
strcpy(strText, g_StringTable.m_strString[68]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_DEX:
|
||
strcpy(strText, g_StringTable.m_strString[69]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_CON:
|
||
strcpy(strText, g_StringTable.m_strString[70]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_INT:
|
||
strcpy(strText, g_StringTable.m_strString[71]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_WIS:
|
||
strcpy(strText, g_StringTable.m_strString[72]);
|
||
break;
|
||
|
||
default:
|
||
continue;
|
||
}
|
||
char strTemp[100], a[10];
|
||
strcpy(strTemp, strText);
|
||
if(i == Item::Attribute::CRITICAL_PERCENTAGE || i == Item::Attribute::MAGIC_RESISTANCE)
|
||
{
|
||
sprintf(a, "%d%%", lpItem->m_usAttribute[i]);
|
||
} else if(i == Item::Attribute::BLOCKING_PERCENTAGE)
|
||
{
|
||
sprintf(a, "%3.1f%%", lpItem->m_usAttribute[i] / 2.0f);
|
||
} else if(i == Item::Attribute::MAX_HP || i == Item::Attribute::MAX_MP)
|
||
{
|
||
sprintf(a, "%d", lpItem->m_usAttribute[i] * 50);
|
||
} else
|
||
{
|
||
sprintf(a, "%d", lpItem->m_usAttribute[i]);
|
||
}
|
||
strcat(strTemp, a);
|
||
dwLength = g_TextEdit.GetStringLength(strTemp);
|
||
dwStart = ((sLength + 10) / 2) - (dwLength / 2);
|
||
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
::SetRect(&rcRect, SizeX + dwStart, SizeY + Count * 16 + 3, SizeX + dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
|
||
dwLength = g_TextEdit.GetStringLength(a);
|
||
::SetRect(&rcRect, dwStart, SizeY + Count * 16 + 3, dwStart + dwLength, SizeY + Count * 16 + 16 + 3);
|
||
dwStart = rcRect.right;
|
||
unsigned char cBaseValue = 0;
|
||
for(int base = 0; base < Item::Attribute::MAX_ATTRIBUTE_NUM; base++)
|
||
{
|
||
if(base == i)
|
||
{
|
||
cBaseValue = lpBase->m_usAttribute[base];
|
||
break;
|
||
}
|
||
}
|
||
if(cBaseValue < lpItem->m_usAttribute[i])
|
||
{
|
||
g_TextEdit.DrawText(a, &rcRect, DT_VCENTER | DT_LEFT, dwGreenColor);
|
||
} else if(cBaseValue == lpItem->m_usAttribute[i])
|
||
{
|
||
g_TextEdit.DrawText(a, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
} else if(cBaseValue > lpItem->m_usAttribute[i])
|
||
{
|
||
g_TextEdit.DrawText(a, &rcRect, DT_VCENTER | DT_LEFT, dwRedColor);
|
||
}
|
||
Count++;
|
||
}
|
||
}
|
||
|
||
if(lpItem->m_cMaxSocket)
|
||
{
|
||
if(lpItem->m_cMaxSocket < 4)
|
||
{
|
||
dwStart = ((sLength + 10) / 2) - ((lpItem->m_cMaxSocket * 32) / 2);
|
||
} else
|
||
{
|
||
dwStart = ((sLength + 10) / 2) - 64;
|
||
}
|
||
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = 0xFFFFFFFF;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
pVertices[0].tu = pVertices[1].tu = 0.0f;
|
||
pVertices[2].tu = pVertices[3].tu = 1.0f;
|
||
pVertices[0].tv = pVertices[2].tv = 0.0f;
|
||
pVertices[1].tv = pVertices[3].tv = 1.0f;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(0, g_ClientMain.m_lpInterface->m_lpSocket->GetTexture());
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
|
||
for(i = 0; i < lpItem->m_cMaxSocket; i++)
|
||
{
|
||
pVertices[0].v.x = pVertices[1].v.x = SizeX + dwStart + (i % 4) * 32 - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = SizeX + dwStart + (i % 4) * 32 + 32 - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = SizeY + Count * 16 + 3 + (i / 4) * 32 - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = SizeY + Count * 16 + 3 + (i / 4) * 32 + 32 - 0.5f;
|
||
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
}
|
||
|
||
const Item::ItemInfo *lpPT;
|
||
unsigned long count = 0;
|
||
unsigned long SpriteSizeX;
|
||
unsigned long SpriteSizeY;
|
||
for(i = 0; i < 8; i++)
|
||
{
|
||
if(lpItem->m_cSocket[i])
|
||
{
|
||
lpPT = g_ItemMgr.GetItemInfo(lpItem->m_cSocket[i] + 1900);
|
||
|
||
SpriteSizeX = (lpPT->m_SpriteData.m_nSpriteMaxX - lpPT->m_SpriteData.m_nSpriteMinX);
|
||
SpriteSizeY = (lpPT->m_SpriteData.m_nSpriteMaxY - lpPT->m_SpriteData.m_nSpriteMinY);
|
||
|
||
pVertices[0].v.x = pVertices[1].v.x = SizeX + 16 - (SpriteSizeX / 2) + dwStart + (count % 4) * 32 - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = SizeX + 16 - (SpriteSizeX / 2) + dwStart + (count % 4) * 32 + SpriteSizeX - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = SizeY + 16 - (SpriteSizeY / 2) + Count * 16 + 3 + (count / 4) * 32 - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = SizeY + 16 - (SpriteSizeY / 2) + Count * 16 + 3 + (count / 4) * 32 + SpriteSizeY - 0.5f;
|
||
|
||
pVertices[0].tu = pVertices[1].tu = lpPT->m_SpriteData.m_nSpriteMinX / 256.0f;
|
||
pVertices[2].tu = pVertices[3].tu = lpPT->m_SpriteData.m_nSpriteMaxX / 256.0f;
|
||
pVertices[0].tv = pVertices[2].tv = lpPT->m_SpriteData.m_nSpriteMinY / 256.0f;
|
||
pVertices[1].tv = pVertices[3].tv = lpPT->m_SpriteData.m_nSpriteMaxY / 256.0f;
|
||
|
||
lpD3DDevice->SetTexture(0, ((CTexture *)g_ItemStorage.GetItemTexture(lpPT->m_SpriteData.m_szSpriteName))->GetTexture());
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
count++;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
void CGUITooltipItem::GetSkillTooltipPos(short &sPosX, short &sPosY, short &sLength, short &sLine)
|
||
{
|
||
char strText[100];
|
||
unsigned long dwLength;
|
||
int i;
|
||
|
||
const Skill::ProtoType *lpSkillBase = g_SkillMgr.GetSkillProtoType(m_lpItem->GetProtoTypeID()), *lpSkill;
|
||
if(lpSkillBase)
|
||
{
|
||
lpSkill = &lpSkillBase[m_lpItem->GetMaxDurability()];
|
||
|
||
sprintf(strText, "%s %d Lvl", lpSkill->m_SpriteInfo.m_szName, m_lpItem->GetNowDurability());
|
||
sLength = dwLength = g_TextEdit.GetStringLength(strText);
|
||
sLine = 3;
|
||
|
||
if(m_lpItem->GetNowDurability() != 6)
|
||
{
|
||
unsigned char cNextLevel = m_lpItem->GetNowDurability() + 1;
|
||
sprintf(strText, g_StringTable.m_strString[73], cNextLevel);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
|
||
SKILLSLOT *lpSkillSlot = g_ClientMain.m_csStatus.GetSkillSlot(m_lpItem->GetProtoTypeID());
|
||
for(i = 0; i < 2; i++)
|
||
{
|
||
if(lpSkill->m_StatusLimitType[i])
|
||
{
|
||
unsigned long dwValue;
|
||
|
||
if(lpSkillSlot)
|
||
dwValue = (lpSkillSlot->SKILLINFO.cLockCount * 6 + lpSkillSlot->SKILLINFO.cSkillLevel + 1) * lpSkill->m_StatusLimitValue[i];
|
||
else
|
||
dwValue = lpSkill->m_StatusLimitValue[i];
|
||
|
||
switch(lpSkill->m_StatusLimitType[i])
|
||
{
|
||
case Skill::StatusLimit::STR:
|
||
sprintf(strText, g_StringTable.m_strString[37], dwValue);
|
||
break;
|
||
|
||
case Skill::StatusLimit::DEX:
|
||
sprintf(strText, g_StringTable.m_strString[38], dwValue);
|
||
break;
|
||
|
||
case Skill::StatusLimit::CON:
|
||
sprintf(strText, g_StringTable.m_strString[39], dwValue);
|
||
break;
|
||
|
||
case Skill::StatusLimit::INT:
|
||
sprintf(strText, g_StringTable.m_strString[40], dwValue);
|
||
break;
|
||
|
||
case Skill::StatusLimit::WIS:
|
||
sprintf(strText, g_StringTable.m_strString[41], dwValue);
|
||
break;
|
||
}
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
}
|
||
sLine++;
|
||
} else
|
||
{
|
||
strcpy(strText, g_StringTable.m_strString[74]);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
|
||
switch(lpSkill->m_eSkillType)
|
||
{
|
||
case Skill::Type::PASSIVE:
|
||
strcpy(strText, g_StringTable.m_strString[75]);
|
||
break;
|
||
|
||
case Skill::Type::INSTANCE:
|
||
strcpy(strText, g_StringTable.m_strString[76]);
|
||
break;
|
||
|
||
case Skill::Type::CAST:
|
||
strcpy(strText, g_StringTable.m_strString[77]);
|
||
break;
|
||
|
||
case Skill::Type::CHANT:
|
||
strcpy(strText, g_StringTable.m_strString[78]);
|
||
break;
|
||
}
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
|
||
if(lpSkillBase->m_LevelMP != 0)
|
||
{
|
||
unsigned long cMinMP = lpSkill->m_StartMP + lpSkillBase->m_LevelMP;
|
||
unsigned long cMaxMP = 0;
|
||
|
||
for(i = 0; i <= m_lpItem->GetMaxDurability(); i++)
|
||
{
|
||
cMaxMP += lpSkill->m_StartMP;
|
||
if(i < m_lpItem->GetMaxDurability())
|
||
{
|
||
cMaxMP += (lpSkillBase[i].m_LevelMP * 6);
|
||
} else
|
||
{
|
||
cMaxMP += (lpSkillBase[i].m_LevelMP * m_lpItem->GetNowDurability());
|
||
}
|
||
}
|
||
|
||
if(cMinMP == cMaxMP)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[79], cMinMP);
|
||
} else
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[80], cMinMP, cMaxMP);
|
||
}
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
|
||
switch(lpSkill->m_eTargetType)
|
||
{
|
||
case Skill::Target::DEAD_ENEMY:
|
||
strcpy(strText, g_StringTable.m_strString[81]);
|
||
break;
|
||
|
||
case Skill::Target::DEAD_FRIEND:
|
||
strcpy(strText, g_StringTable.m_strString[82]);
|
||
break;
|
||
|
||
case Skill::Target::ENEMY:
|
||
strcpy(strText, g_StringTable.m_strString[83]);
|
||
break;
|
||
|
||
case Skill::Target::ENEMY_OBJECT:
|
||
strcpy(strText, g_StringTable.m_strString[84]);
|
||
break;
|
||
|
||
case Skill::Target::FRIEND:
|
||
strcpy(strText, g_StringTable.m_strString[85]);
|
||
break;
|
||
|
||
case Skill::Target::FRIEND_EXCEPT_SELF:
|
||
strcpy(strText, g_StringTable.m_strString[86]);
|
||
break;
|
||
|
||
case Skill::Target::FRIEND_OBJECT:
|
||
strcpy(strText, g_StringTable.m_strString[87]);
|
||
break;
|
||
|
||
case Skill::Target::LINE_ENEMY:
|
||
strcpy(strText, g_StringTable.m_strString[88]);
|
||
break;
|
||
|
||
case Skill::Target::MELEE:
|
||
strcpy(strText, g_StringTable.m_strString[89]);
|
||
break;
|
||
|
||
case Skill::Target::PARTY:
|
||
strcpy(strText, g_StringTable.m_strString[90]);
|
||
break;
|
||
}
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
|
||
if(lpSkill->m_EffectDistance)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[91], lpSkill->m_EffectDistance);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
|
||
if(lpSkill->m_EffectExtent)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[92], lpSkill->m_EffectExtent);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
}
|
||
|
||
sPosX = (g_ClientMain.m_BaseGraphicLayer.m_lScreenSx / 2) - ((sLength + 40) / 2);
|
||
sPosY = (g_ClientMain.m_BaseGraphicLayer.m_lScreenSy / 2) - ((sLine * 16 + 36 + 32) / 2) - 40;
|
||
|
||
if(sPosX + (sLength + 40) > g_ClientMain.m_BaseGraphicLayer.m_lScreenSx)
|
||
{
|
||
sPosX = g_ClientMain.m_BaseGraphicLayer.m_lScreenSx - (sLength + 40);
|
||
}
|
||
if(sPosY + (sLine * 16 + 36 + 32) > g_ClientMain.m_BaseGraphicLayer.m_lScreenSy)
|
||
{
|
||
sPosY = g_ClientMain.m_BaseGraphicLayer.m_lScreenSy - (sLine * 16 + 36 + 32);
|
||
}
|
||
}
|
||
|
||
void CGUITooltipItem::RenderSkill(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
short SizeX = 0;
|
||
short SizeY = 0;
|
||
short sLength, sLine;
|
||
GetSkillTooltipPos(SizeX, SizeY, sLength, sLine);
|
||
|
||
RECT rcRect;
|
||
char strText[100];
|
||
int Count = 1, i;
|
||
|
||
Item::CUseItem *lpItem = (Item::CUseItem *)m_lpItem->m_lpItemBase;
|
||
|
||
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, SizeX, SizeY, SizeX + sLength + 40, SizeY + sLine * 16 + 36 + 32, 0x00000000, 0x99);
|
||
|
||
unsigned long dwWhiteColor = D3DCOLOR_RGBA(255, 255, 255, 255);
|
||
unsigned long dwRedColor = D3DCOLOR_RGBA(255, 0, 0, 255);
|
||
|
||
const Skill::ProtoType *lpSkillBase = g_SkillMgr.GetSkillProtoType(m_lpItem->GetProtoTypeID()), *lpSkill;
|
||
if(lpSkillBase)
|
||
{
|
||
lpSkill = &lpSkillBase[m_lpItem->GetMaxDurability()];
|
||
|
||
TLVertex pVertices[4];
|
||
pVertices[0].Diffuse.c = pVertices[1].Diffuse.c = pVertices[2].Diffuse.c = pVertices[3].Diffuse.c = 0xFFFFFFFF;
|
||
pVertices[0].Specular.c = pVertices[1].Specular.c = pVertices[2].Specular.c = pVertices[3].Specular.c = 0;
|
||
pVertices[0].w = pVertices[1].w = pVertices[2].w = pVertices[3].w = 0.1f;
|
||
pVertices[0].v.z = pVertices[1].v.z = pVertices[2].v.z = pVertices[3].v.z = 0.1f;
|
||
|
||
unsigned long SpriteSizeX = (lpSkill->m_SpriteInfo.m_nSpriteMaxX - lpSkill->m_SpriteInfo.m_nSpriteMinX);
|
||
unsigned long SpriteSizeY = (lpSkill->m_SpriteInfo.m_nSpriteMaxY - lpSkill->m_SpriteInfo.m_nSpriteMinY);
|
||
pVertices[0].v.x = pVertices[1].v.x = SizeX + ((sLength + 40) / 2) - (SpriteSizeX / 2) - 0.5f;
|
||
pVertices[2].v.x = pVertices[3].v.x = SizeX + ((sLength + 40) / 2) - (SpriteSizeX / 2) + 32 - 0.5f;
|
||
pVertices[0].v.y = pVertices[2].v.y = SizeY + 18 - 0.5f;
|
||
pVertices[1].v.y = pVertices[3].v.y = SizeY + 18 + 32 - 0.5f;
|
||
|
||
pVertices[0].tu = pVertices[1].tu = lpSkill->m_SpriteInfo.m_nSpriteMinX / 256.0f;
|
||
pVertices[2].tu = pVertices[3].tu = lpSkill->m_SpriteInfo.m_nSpriteMaxX / 256.0f;
|
||
pVertices[0].tv = pVertices[2].tv = lpSkill->m_SpriteInfo.m_nSpriteMinY / 256.0f;
|
||
pVertices[1].tv = pVertices[3].tv = lpSkill->m_SpriteInfo.m_nSpriteMaxY / 256.0f;
|
||
|
||
lpD3DDevice->SetVertexShader(TLVERTEXFVF);
|
||
lpD3DDevice->SetTexture(0, ((CTexture *)g_ItemStorage.GetSkillTexture(lpSkill->m_SpriteInfo.m_szSpriteName))->GetTexture());
|
||
lpD3DDevice->SetTexture(1, NULL);
|
||
lpD3DDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, pVertices, sizeof(TLVertex));
|
||
|
||
sprintf(strText, "%s %d Lvl", lpSkill->m_SpriteInfo.m_szName, m_lpItem->GetNowDurability());
|
||
::SetRect(&rcRect, SizeX + 20, SizeY + Count * 16 + 18 + 32, SizeX + 20 + sLength, SizeY + Count * 16 + 16 + 18 + 32);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count+=2;
|
||
|
||
if(m_lpItem->GetNowDurability() != 6)
|
||
{
|
||
unsigned char cNextLevel = m_lpItem->GetNowDurability() + 1;
|
||
sprintf(strText, g_StringTable.m_strString[73], cNextLevel);
|
||
::SetRect(&rcRect, SizeX + 20, SizeY + Count * 16 + 18 + 32, SizeX + 20 + sLength, SizeY + Count * 16 + 16 + 18 + 32);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
|
||
SKILLSLOT *lpSkillSlot = g_ClientMain.m_csStatus.GetSkillSlot(m_lpItem->GetProtoTypeID());
|
||
for(i = 0; i < 2; i++)
|
||
{
|
||
if(lpSkill->m_StatusLimitType[i])
|
||
{
|
||
unsigned long dwColor = dwWhiteColor;
|
||
unsigned long dwValue;
|
||
|
||
if(lpSkillSlot)
|
||
dwValue = (lpSkillSlot->SKILLINFO.cLockCount * 6 + lpSkillSlot->SKILLINFO.cSkillLevel + 1) * lpSkill->m_StatusLimitValue[i];
|
||
else
|
||
dwValue = lpSkill->m_StatusLimitValue[i];
|
||
|
||
switch(lpSkill->m_StatusLimitType[i])
|
||
{
|
||
case Skill::StatusLimit::STR:
|
||
sprintf(strText, g_StringTable.m_strString[37], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.STR < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Skill::StatusLimit::DEX:
|
||
sprintf(strText, g_StringTable.m_strString[38], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.DEX < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Skill::StatusLimit::CON:
|
||
sprintf(strText, g_StringTable.m_strString[39], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.CON < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Skill::StatusLimit::INT:
|
||
sprintf(strText, g_StringTable.m_strString[40], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.INT < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
|
||
case Skill::StatusLimit::WIS:
|
||
sprintf(strText, g_StringTable.m_strString[41], dwValue);
|
||
if(g_ClientMain.m_csStatus.m_Info.WIS < dwValue) dwColor = dwRedColor;
|
||
break;
|
||
}
|
||
::SetRect(&rcRect, SizeX + 20, SizeY + Count * 16 + 18 + 32, SizeX + 20 + sLength, SizeY + Count * 16 + 16 + 18 + 32);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwColor);
|
||
Count++;
|
||
}
|
||
}
|
||
Count++;
|
||
} else
|
||
{
|
||
strcpy(strText, g_StringTable.m_strString[74]);
|
||
::SetRect(&rcRect, SizeX + 20, SizeY + Count * 16 + 18 + 32, SizeX + 20 + sLength, SizeY + Count * 16 + 16 + 18 + 32);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwRedColor);
|
||
Count++;
|
||
}
|
||
|
||
switch(lpSkill->m_eSkillType)
|
||
{
|
||
case Skill::Type::PASSIVE:
|
||
strcpy(strText, g_StringTable.m_strString[75]);
|
||
break;
|
||
|
||
case Skill::Type::INSTANCE:
|
||
strcpy(strText, g_StringTable.m_strString[76]);
|
||
break;
|
||
|
||
case Skill::Type::CAST:
|
||
strcpy(strText, g_StringTable.m_strString[77]);
|
||
break;
|
||
|
||
case Skill::Type::CHANT:
|
||
strcpy(strText, g_StringTable.m_strString[78]);
|
||
break;
|
||
}
|
||
::SetRect(&rcRect, SizeX + 20, SizeY + Count * 16 + 18 + 32, SizeX + 20 + sLength, SizeY + Count * 16 + 16 + 18 + 32);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
|
||
if(lpSkill->m_StartMP != 0)
|
||
{
|
||
unsigned long cMinMP = lpSkill->m_StartMP + lpSkillBase->m_LevelMP;
|
||
unsigned long cMaxMP = 0;
|
||
|
||
for(i = 0; i <= m_lpItem->GetMaxDurability(); i++)
|
||
{
|
||
cMaxMP += lpSkill->m_StartMP;
|
||
if(i < m_lpItem->GetMaxDurability())
|
||
{
|
||
cMaxMP += (lpSkillBase[i].m_LevelMP * 6);
|
||
} else
|
||
{
|
||
cMaxMP += (lpSkillBase[i].m_LevelMP * m_lpItem->GetNowDurability());
|
||
}
|
||
}
|
||
|
||
if(cMinMP == cMaxMP)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[79], cMinMP);
|
||
} else
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[80], cMinMP, cMaxMP);
|
||
}
|
||
::SetRect(&rcRect, SizeX + 20, SizeY + Count * 16 + 18 + 32, SizeX + 20 + sLength, SizeY + Count * 16 + 16 + 18 + 32);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
}
|
||
|
||
switch(lpSkill->m_eTargetType)
|
||
{
|
||
case Skill::Target::DEAD_ENEMY:
|
||
strcpy(strText, g_StringTable.m_strString[81]);
|
||
break;
|
||
|
||
case Skill::Target::DEAD_FRIEND:
|
||
strcpy(strText, g_StringTable.m_strString[82]);
|
||
break;
|
||
|
||
case Skill::Target::ENEMY:
|
||
strcpy(strText, g_StringTable.m_strString[83]);
|
||
break;
|
||
|
||
case Skill::Target::ENEMY_OBJECT:
|
||
strcpy(strText, g_StringTable.m_strString[84]);
|
||
break;
|
||
|
||
case Skill::Target::FRIEND:
|
||
strcpy(strText, g_StringTable.m_strString[85]);
|
||
break;
|
||
|
||
case Skill::Target::FRIEND_EXCEPT_SELF:
|
||
strcpy(strText, g_StringTable.m_strString[86]);
|
||
break;
|
||
|
||
case Skill::Target::FRIEND_OBJECT:
|
||
strcpy(strText, g_StringTable.m_strString[87]);
|
||
break;
|
||
|
||
case Skill::Target::LINE_ENEMY:
|
||
strcpy(strText, g_StringTable.m_strString[88]);
|
||
break;
|
||
|
||
case Skill::Target::MELEE:
|
||
strcpy(strText, g_StringTable.m_strString[89]);
|
||
break;
|
||
|
||
case Skill::Target::PARTY:
|
||
strcpy(strText, g_StringTable.m_strString[90]);
|
||
break;
|
||
}
|
||
::SetRect(&rcRect, SizeX + 20, SizeY + Count * 16 + 18 + 32, SizeX + 20 + sLength, SizeY + Count * 16 + 16 + 18 + 32);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
|
||
if(lpSkill->m_EffectDistance)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[91], lpSkill->m_EffectDistance);
|
||
::SetRect(&rcRect, SizeX + 20, SizeY + Count * 16 + 18 + 32, SizeX + 20 + sLength, SizeY + Count * 16 + 16 + 18 + 32);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
}
|
||
|
||
if(lpSkill->m_EffectExtent)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[92], lpSkill->m_EffectExtent);
|
||
::SetRect(&rcRect, SizeX + 20, SizeY + Count * 16 + 18 + 32, SizeX + 20 + sLength, SizeY + Count * 16 + 16 + 18 + 32);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
}
|
||
}
|
||
}
|
||
|
||
void CGUITooltipItem::GetEquipTooltipPos(short &sPosX, short &sPosY, short &sLength, short &sLine)
|
||
{
|
||
char strText[100];
|
||
unsigned long dwLength;
|
||
int i;
|
||
|
||
Item::CEquipment *lpItem = Item::CEquipment::DowncastToEquipment(m_lpItem->m_lpItemBase);
|
||
if(!lpItem) return;
|
||
|
||
if(m_lpItem->m_bTradeItem && g_ClientMain.m_lpInterface->GetIsBlackMarket())
|
||
{
|
||
sLength = dwLength = g_TextEdit.GetStringLength(lpItem->GetItemTypeName());
|
||
sLine = 1;
|
||
} else
|
||
{
|
||
if(lpItem->GetUpgradeLevel() > 0)
|
||
{
|
||
char strItemName[MAX_PATH];
|
||
sprintf(strItemName, "%s +%d", m_lpItem->GetItemInfo().m_SpriteData.m_szName, lpItem->GetUpgradeLevel());
|
||
sLength = dwLength = g_TextEdit.GetStringLength(strItemName);
|
||
} else
|
||
{
|
||
sLength = dwLength = g_TextEdit.GetStringLength(m_lpItem->GetItemInfo().m_SpriteData.m_szName);
|
||
}
|
||
sLine = 1;
|
||
}
|
||
|
||
const Item::UseLimit *lpLimit = &lpItem->GetItemInfo().m_UseLimit;
|
||
|
||
unsigned long dwClass[4] = { 0, 0, 0, 0 }, count = 0;
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ǻ<EFBFBD><C7BA>ϴ<EFBFBD> if<69><66> <20>߰<EFBFBD><DFB0>Ǿ<EFBFBD><C7BE>Ѵ<EFBFBD>.
|
||
if(lpLimit->m_dwClassLimit != 0x00000FFF && lpLimit->m_dwClassLimit != 0x00FF0000)
|
||
{
|
||
for(int i = 1; i <= 24; i++)
|
||
{
|
||
if(lpLimit->m_dwClassLimit & (0x00000001 << (i - 1)))
|
||
{
|
||
dwClass[count] = i;
|
||
count++;
|
||
}
|
||
}
|
||
|
||
if(dwClass[0])
|
||
{
|
||
sprintf(strText, "%s", g_ClientMain.m_lpCommonInterface->GetClassName(dwClass[0]));
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
if(dwClass[1])
|
||
{
|
||
strcat(strText, ", ");
|
||
strcat(strText, g_ClientMain.m_lpCommonInterface->GetClassName(dwClass[1]));
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
}
|
||
if(dwClass[2])
|
||
{
|
||
sprintf(strText, "%s", g_ClientMain.m_lpCommonInterface->GetClassName(dwClass[2]));
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
if(dwClass[3])
|
||
{
|
||
strcat(strText, ", ");
|
||
strcat(strText, g_ClientMain.m_lpCommonInterface->GetClassName(dwClass[3]));
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
}
|
||
}
|
||
|
||
// <20><><EFBFBD><EFBFBD>
|
||
if(g_ClientMain.m_lpInterface->GetIsTrade())
|
||
{
|
||
if(m_lpItem->m_bTradeItem)
|
||
{
|
||
if(g_ClientMain.m_lpInterface->GetIsBlackMarket())
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(lpItem->GetBuyBlackPrice()));
|
||
} else
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(lpItem->GetBuyPrice()));
|
||
}
|
||
}
|
||
else
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(lpItem->GetSellPrice()));
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
|
||
if(m_lpItem->m_bTradeItem && g_ClientMain.m_lpInterface->GetIsBlackMarket()) return;
|
||
|
||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||
if(m_lpItem->GetItemType() != Item::ItemType::ARROW && m_lpItem->GetItemType() != Item::ItemType::BOLT)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[42], m_lpItem->GetNowDurability(), m_lpItem->GetMaxDurability());
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
|
||
for(i = 1; i < 7; i++)
|
||
{
|
||
if(lpLimit->m_nStatusLimit[i])
|
||
{
|
||
switch(i)
|
||
{
|
||
case Item::StatusLimit::LEVEL:
|
||
sprintf(strText, g_StringTable.m_strString[44], lpLimit->m_nStatusLimit[i]);
|
||
break;
|
||
|
||
case Item::StatusLimit::STR:
|
||
sprintf(strText, g_StringTable.m_strString[37], lpLimit->m_nStatusLimit[i]);
|
||
break;
|
||
|
||
case Item::StatusLimit::DEX:
|
||
sprintf(strText, g_StringTable.m_strString[38], lpLimit->m_nStatusLimit[i]);
|
||
break;
|
||
|
||
case Item::StatusLimit::CON:
|
||
sprintf(strText, g_StringTable.m_strString[39], lpLimit->m_nStatusLimit[i]);
|
||
break;
|
||
|
||
case Item::StatusLimit::INT:
|
||
sprintf(strText, g_StringTable.m_strString[40], lpLimit->m_nStatusLimit[i]);
|
||
break;
|
||
|
||
case Item::StatusLimit::WIS:
|
||
sprintf(strText, g_StringTable.m_strString[41], lpLimit->m_nStatusLimit[i]);
|
||
break;
|
||
}
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
}
|
||
|
||
unsigned char cMinDamage = 0, cMaxDamage = 0, cDefense = 0;
|
||
for(i = 0; i < Item::Attribute::MAX_ATTRIBUTE_NUM; i++)
|
||
{
|
||
if(lpItem->m_usAttribute[i])
|
||
{
|
||
switch(i)
|
||
{
|
||
case Item::Attribute::MIN_DAMAGE:
|
||
cMinDamage = lpItem->m_usAttribute[i];
|
||
break;
|
||
|
||
case Item::Attribute::MAX_DAMAGE:
|
||
cMaxDamage = lpItem->m_usAttribute[i];
|
||
break;
|
||
|
||
case Item::Attribute::DEFENCE:
|
||
cDefense = lpItem->m_usAttribute[i];
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
if(cMinDamage || cMaxDamage)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[45], cMinDamage, cMaxDamage);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
|
||
if(cDefense)
|
||
{
|
||
sprintf(strText, g_StringTable.m_strString[47], cDefense);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
|
||
for(i = 0; i < Item::Attribute::MAX_ATTRIBUTE_NUM; i++)
|
||
{
|
||
if(lpItem->m_usAttribute[i])
|
||
{
|
||
switch(i)
|
||
{
|
||
case Item::Attribute::CRITICAL_PERCENTAGE:
|
||
sprintf(strText, "%s%d%%", g_StringTable.m_strString[49], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::OFFENCE_REVISION:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[50], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::DEFENCE_REVISION:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[51], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::MAGIC_RESISTANCE:
|
||
sprintf(strText, "%s%d%%", g_StringTable.m_strString[52], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::BLOCKING_PERCENTAGE:
|
||
sprintf(strText, "%s%3.1f%%", g_StringTable.m_strString[53], strText, lpItem->m_usAttribute[i] / 2.0f);
|
||
break;
|
||
|
||
case Item::Attribute::MAX_HP:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[54], strText, lpItem->m_usAttribute[i] * 50);
|
||
break;
|
||
|
||
case Item::Attribute::MAX_MP:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[55], strText, lpItem->m_usAttribute[i] * 50);
|
||
break;
|
||
|
||
case Item::Attribute::HP_REGEN_AMOUNT:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[56], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::MP_REGEN_AMOUNT:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[57], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::FIRE_ATTACK:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[58], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::LIGHTNING_ATTACK:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[59], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::COLD_ATTACK:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[60], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::DRAIN_ATTACK:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[61], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::POISON_ATTACK:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[62], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::FIRE_RESISTANCE:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[63], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::LIGHTNING_RESISTANCE:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[64], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::COLD_RESISTANCE:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[65], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::DRAIN_RESISTANCE:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[66], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::POISON_RESISTANCE:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[67], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_STR:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[68], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_DEX:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[69], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_CON:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[70], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_INT:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[71], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
case Item::Attribute::ADD_WIS:
|
||
sprintf(strText, "%s%d", g_StringTable.m_strString[72], strText, lpItem->m_usAttribute[i]);
|
||
break;
|
||
|
||
default:
|
||
continue;
|
||
}
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
}
|
||
|
||
if(lpItem->m_cMaxSocket >= 4)
|
||
{
|
||
dwLength = 32 * 4;
|
||
} else
|
||
{
|
||
dwLength = 32 * lpItem->m_cMaxSocket;
|
||
}
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
|
||
if(sPosX + (sLength + 10) > g_ClientMain.m_BaseGraphicLayer.m_lScreenSx)
|
||
{
|
||
sPosX = g_ClientMain.m_BaseGraphicLayer.m_lScreenSx - (sLength + 10);
|
||
}
|
||
|
||
unsigned long dwSocketSize = 0;
|
||
if(0 < lpItem->m_cMaxSocket && lpItem->m_cMaxSocket <= 4)
|
||
dwSocketSize = 32;
|
||
else if(4 < lpItem->m_cMaxSocket && lpItem->m_cMaxSocket <= 8)
|
||
dwSocketSize = 64;
|
||
if(sPosY + ((sLine * 16 + 6) + dwSocketSize) > g_ClientMain.m_BaseGraphicLayer.m_lScreenSy)
|
||
{
|
||
sPosY = g_ClientMain.m_BaseGraphicLayer.m_lScreenSy - ((sLine * 16 + 6) + dwSocketSize);
|
||
}
|
||
}
|
||
|
||
void CGUITooltipItem::GetBookTooltipPos(short &sPosX, short &sPosY, short &sLength, short &sLine)
|
||
{
|
||
char strText[100];
|
||
unsigned long dwLength;
|
||
|
||
sprintf(strText, "%s", m_lpItem->GetItemInfo().m_SpriteData.m_szName);
|
||
sLength = dwLength = g_TextEdit.GetStringLength(strText);
|
||
sLine = 1;
|
||
|
||
if(g_ClientMain.m_lpInterface->GetIsTrade())
|
||
{
|
||
if(m_lpItem->m_bTradeItem)
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(m_lpItem->m_lpItemBase->GetBuyPrice()));
|
||
else
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(m_lpItem->m_lpItemBase->GetSellPrice()));
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
|
||
Item::CUseItem *lpItem = Item::CUseItem::DowncastToUseItem(m_lpItem->m_lpItemBase);
|
||
if(!lpItem) return;
|
||
|
||
unsigned short wLockCount = lpItem->GetItemInfo().m_UseItemInfo.m_usSkill_LockCount;
|
||
const Skill::ProtoType *lpSkillBook = g_SkillMgr.GetSkillProtoType(lpItem->GetItemInfo().m_UseItemInfo.m_usSkill_ID);
|
||
if(lpSkillBook)
|
||
{
|
||
lpSkillBook = &lpSkillBook[wLockCount];
|
||
}
|
||
|
||
if(lpSkillBook)
|
||
{
|
||
/* sprintf(strText, g_StringTable.m_strString[36], lpSkillBook->m_SpriteInfo.m_szName);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;*/
|
||
|
||
SKILLSLOT *lpSkillSlot = g_ClientMain.m_csStatus.GetSkillSlot(lpItem->GetItemInfo().m_UseItemInfo.m_usSkill_ID);
|
||
if(lpSkillSlot && wLockCount < lpSkillSlot->SKILLINFO.cLockCount)
|
||
{
|
||
strcpy(strText, g_StringTable.m_strString[93]);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
} else if(lpSkillSlot && wLockCount == lpSkillSlot->SKILLINFO.cLockCount && lpSkillSlot->SKILLINFO.cSkillLevel == 6)
|
||
{
|
||
strcpy(strText, g_StringTable.m_strString[94]);
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
} else
|
||
{
|
||
for(int i = 0; i < 2; i++)
|
||
{
|
||
if(lpSkillBook->m_StatusLimitType[i])
|
||
{
|
||
unsigned long dwValue;
|
||
if(lpSkillSlot)
|
||
{
|
||
if(wLockCount == lpSkillSlot->SKILLINFO.cLockCount)
|
||
{
|
||
dwValue = (wLockCount * 6 + lpSkillSlot->SKILLINFO.cSkillLevel + 1) * lpSkillBook->m_StatusLimitValue[i];
|
||
} else
|
||
{
|
||
dwValue = (wLockCount * 6 + 1) * lpSkillBook->m_StatusLimitValue[i];
|
||
}
|
||
} else
|
||
dwValue = (wLockCount * 6 + 1) * lpSkillBook->m_StatusLimitValue[i];
|
||
|
||
switch(lpSkillBook->m_StatusLimitType[i])
|
||
{
|
||
case Skill::StatusLimit::STR:
|
||
sprintf(strText, g_StringTable.m_strString[37], dwValue);
|
||
break;
|
||
|
||
case Skill::StatusLimit::DEX:
|
||
sprintf(strText, g_StringTable.m_strString[38], dwValue);
|
||
break;
|
||
|
||
case Skill::StatusLimit::CON:
|
||
sprintf(strText, g_StringTable.m_strString[39], dwValue);
|
||
break;
|
||
|
||
case Skill::StatusLimit::INT:
|
||
sprintf(strText, g_StringTable.m_strString[40], dwValue);
|
||
break;
|
||
|
||
case Skill::StatusLimit::WIS:
|
||
sprintf(strText, g_StringTable.m_strString[41], dwValue);
|
||
break;
|
||
}
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
if(sPosX + (sLength + 10) > g_ClientMain.m_BaseGraphicLayer.m_lScreenSx)
|
||
{
|
||
sPosX = g_ClientMain.m_BaseGraphicLayer.m_lScreenSx - (sLength + 10);
|
||
}
|
||
if(sPosY + (sLine * 16 + 6) > g_ClientMain.m_BaseGraphicLayer.m_lScreenSy)
|
||
{
|
||
sPosY = g_ClientMain.m_BaseGraphicLayer.m_lScreenSy - (sLine * 16 + 6);
|
||
}
|
||
}
|
||
|
||
void CGUITooltipItem::GetEtcTooltipPos(short &sPosX, short &sPosY, short &sLength, short &sLine)
|
||
{
|
||
char strText[100];
|
||
unsigned long dwLength;
|
||
|
||
sLength = dwLength = g_TextEdit.GetStringLength(m_lpItem->GetItemInfo().m_SpriteData.m_szName);
|
||
sLine = 1;
|
||
|
||
if(g_ClientMain.m_lpInterface->GetIsTrade())
|
||
{
|
||
if(m_lpItem->m_bTradeItem)
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(m_lpItem->m_lpItemBase->GetBuyPrice()));
|
||
else
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(m_lpItem->m_lpItemBase->GetSellPrice()));
|
||
dwLength = g_TextEdit.GetStringLength(strText);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
sLine++;
|
||
}
|
||
|
||
if(strcmp(m_lpItem->GetItemInfo().GetItemDescribe(), ""))
|
||
{
|
||
char strText[200], *token, spes[] = "\\n";
|
||
strcpy(strText, m_lpItem->GetItemInfo().GetItemDescribe());
|
||
token = strtok(strText, spes);
|
||
unsigned long dwLength;
|
||
while(token != NULL)
|
||
{
|
||
dwLength = g_TextEdit.GetStringLength(token);
|
||
if(sLength < dwLength) sLength = dwLength;
|
||
token = strtok(NULL, spes);
|
||
sLine++;
|
||
}
|
||
}
|
||
|
||
if(sPosX + (sLength + 10) > g_ClientMain.m_BaseGraphicLayer.m_lScreenSx)
|
||
{
|
||
sPosX = g_ClientMain.m_BaseGraphicLayer.m_lScreenSx - (sLength + 10);
|
||
}
|
||
if(sPosY + (sLine * 16 + 6) > g_ClientMain.m_BaseGraphicLayer.m_lScreenSy)
|
||
{
|
||
sPosY = g_ClientMain.m_BaseGraphicLayer.m_lScreenSy - (sLine * 16 + 6);
|
||
}
|
||
}
|
||
|
||
void CGUITooltipItem::RenderEtc(LPDIRECT3DDEVICE8 lpD3DDevice)
|
||
{
|
||
POINT *ptMousePos = g_DeviceInput.GetMousePosition();
|
||
short SizeX = ptMousePos->x + 7;
|
||
short SizeY = ptMousePos->y + 11;
|
||
short sLength, sLine;
|
||
GetEtcTooltipPos(SizeX, SizeY, sLength, sLine);
|
||
|
||
g_ClientMain.m_lpCommonInterface->RenderRect(lpD3DDevice, SizeX, SizeY, SizeX + sLength + 10, SizeY + sLine * 16 + 6, 0x00000000, 0x99);
|
||
|
||
unsigned long dwWhiteColor = D3DCOLOR_RGBA(255, 255, 255, 255);
|
||
|
||
RECT rcRect;
|
||
char strText[100];
|
||
int Count = 0;
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(m_lpItem->GetItemInfo().m_SpriteData.m_szName, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
|
||
if(g_ClientMain.m_lpInterface->GetIsTrade())
|
||
{
|
||
if(m_lpItem->m_bTradeItem)
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(m_lpItem->m_lpItemBase->GetBuyPrice()));
|
||
else
|
||
sprintf(strText, g_StringTable.m_strString[35], g_TextEdit.MakePrintGold(m_lpItem->m_lpItemBase->GetSellPrice()));
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(strText, &rcRect, DT_VCENTER | DT_CENTER, dwWhiteColor);
|
||
Count++;
|
||
}
|
||
|
||
if(strcmp(m_lpItem->GetItemInfo().GetItemDescribe(), ""))
|
||
{
|
||
char strText[200], *token, spes[] = "\\n";
|
||
strcpy(strText, m_lpItem->GetItemInfo().GetItemDescribe());
|
||
token = strtok(strText, spes);
|
||
while(token != NULL)
|
||
{
|
||
::SetRect(&rcRect, SizeX + 5, SizeY + Count * 16 + 3, SizeX + 5 + sLength, SizeY + Count * 16 + 16 + 3);
|
||
g_TextEdit.DrawText(token, &rcRect, DT_VCENTER | DT_LEFT, dwWhiteColor);
|
||
token = strtok(NULL, spes);
|
||
Count++;
|
||
}
|
||
}
|
||
}
|