本文整理汇总了C++中LPITEM::CopyAttributeTo方法的典型用法代码示例。如果您正苦于以下问题:C++ LPITEM::CopyAttributeTo方法的具体用法?C++ LPITEM::CopyAttributeTo怎么用?C++ LPITEM::CopyAttributeTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPITEM
的用法示例。
在下文中一共展示了LPITEM::CopyAttributeTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TItemPos
bool COver9RefineManager::Over9Refine(LPCHARACTER pChar, LPITEM item)
{
DWORD dwVnum = item->GetRefinedVnum();
if (dwVnum == 0)
return false;
LPITEM over9 = ITEM_MANAGER::instance().CreateItem(dwVnum, 1);
if (over9 == NULL)
return false;
item->CopySocketTo(over9);
item->CopyAttributeTo(over9);
int iEmptyCell = pChar->GetEmptyInventory(over9->GetSize());
if (iEmptyCell == -1)
return false;
item->RemoveFromCharacter();
over9->AddToCharacter(pChar, TItemPos(INVENTORY, iEmptyCell));
char szBuf[256];
snprintf(szBuf, sizeof(szBuf), "SUCCESS %u %s %u", over9->GetID(), over9->GetName(), over9->GetOriginalVnum());
LogManager::instance().ItemLog(pChar, item, "REFINE OVER9", szBuf);
return true;
}
示例2: DoRefineStrength
//.........这里部分代码省略.........
return false;
}
if (NULL != pDragonSoul)
{
GetDragonSoulInfo(pDragonSoul->GetVnum(), bType, bGrade, bStep, bStrength);
float fWeight = 0.f;
// °ЎБЯДЎ °ЄАМ ѕшґЩёй °ИЗТ јц ѕшґВ їлИҐј®
if (!m_pTable->GetWeight(bType, bGrade, bStep, bStrength + 1, fWeight))
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°ИЗТ јц ѕшґВ їлИҐј®АФґПґЩ."));
SendRefineResultPacket(ch, DS_SUB_HEADER_REFINE_FAIL_MAX_REFINE, TItemPos(pDragonSoul->GetWindow(), pDragonSoul->GetCell()));
return false;
}
// °ИЗЯА» ¶§ °ЎБЯДЎ°Ў 0АМ¶уёй ґх АМ»у °ИµЗјґВ ѕИµИґЩ.
if (fWeight < FLT_EPSILON)
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°ИЗТ јц ѕшґВ їлИҐј®АФґПґЩ."));
SendRefineResultPacket(ch, DS_SUB_HEADER_REFINE_FAIL_MAX_REFINE, TItemPos(pDragonSoul->GetWindow(), pDragonSoul->GetCell()));
return false;
}
}
float fProb;
if (!m_pTable->GetRefineStrengthValues(bType, pRefineStone->GetSubType(), bStrength, fee, fProb))
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°ИЗТ јц ѕшґВ їлИҐј®АФґПґЩ."));
SendRefineResultPacket(ch, DS_SUB_HEADER_REFINE_FAIL_INVALID_MATERIAL, TItemPos(pDragonSoul->GetWindow(), pDragonSoul->GetCell()));
return false;
}
if (ch->GetGold() < fee)
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°і·®А» ЗП±в А§ЗС µ·АМ єОБ·ЗХґПґЩ."));
SendRefineResultPacket(ch, DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MONEY, NPOS);
return false;
}
ch->PointChange(POINT_GOLD, -fee);
LPITEM pResult = NULL;
BYTE bSubHeader;
if (fnumber(0.f, 100.f) <= fProb)
{
pResult = ITEM_MANAGER::instance().CreateItem(MakeDragonSoulVnum(bType, bGrade, bStep, bStrength + 1));
if (NULL == pResult)
{
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength + 1));
return false;
}
pDragonSoul->RemoveFromCharacter();
pDragonSoul->CopyAttributeTo(pResult);
RefreshItemAttributes(pResult);
pDragonSoul->SetCount(pDragonSoul->GetCount() - 1);
pRefineStone->SetCount(pRefineStone->GetCount() - 1);
char buf[128];
sprintf(buf, "STRENGTH : %d -> %d", bStrength, bStrength + 1);
LogManager::instance().ItemLog(ch, pDragonSoul, "DS_STRENGTH_REFINE_SUCCESS", buf);
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°ИїЎ јє°шЗЯЅАґПґЩ."));
ch->AutoGiveItem(pResult, true);
bSubHeader = DS_SUB_HEADER_REFINE_SUCCEED;
}
else
{
if (bStrength != 0)
{
pResult = ITEM_MANAGER::instance().CreateItem(MakeDragonSoulVnum(bType, bGrade, bStep, bStrength - 1));
if (NULL == pResult)
{
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength - 1));
return false;
}
pDragonSoul->CopyAttributeTo(pResult);
RefreshItemAttributes(pResult);
}
bSubHeader = DS_SUB_HEADER_REFINE_FAIL;
char buf[128];
sprintf(buf, "STRENGTH : %d -> %d", bStrength, bStrength - 1);
// strength°ИґВ ЅЗЖРЅГ ±ъБъ јцµµ АЦѕо, їшє» ѕЖАМЕЫА» №ЩЕБАё·О ·О±Чё¦ іІ±и.
LogManager::instance().ItemLog(ch, pDragonSoul, "DS_STRENGTH_REFINE_FAIL", buf);
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("°ИїЎ ЅЗЖРЗЯЅАґПґЩ."));
pDragonSoul->SetCount(pDragonSoul->GetCount() - 1);
pRefineStone->SetCount(pRefineStone->GetCount() - 1);
if (NULL != pResult)
ch->AutoGiveItem(pResult, true);
}
SendRefineResultPacket(ch, bSubHeader, NULL == pResult? NPOS : TItemPos (pResult->GetWindow(), pResult->GetCell()));
return true;
}