本文整理汇总了C++中Item::GetEquipAttr方法的典型用法代码示例。如果您正苦于以下问题:C++ Item::GetEquipAttr方法的具体用法?C++ Item::GetEquipAttr怎么用?C++ Item::GetEquipAttr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::GetEquipAttr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
pGamePlayer->SendPacket(&msg);
return PACKET_EXE_CONTINUE;
}
//逻辑处理
COMMITEM_INFO_TB* pGet = g_ItemTable.GetCommItemInfoTB(pRefiningItem->GetItemTableIndex());
Assert(NULL != pGet);
if ((pEquipment->GetRequireLevel()-1)/10+1 != pGet->m_nLevel)//验证等级
{
msg.SetResult(EQUIPREFINING_NOT_SUCH_ITEM);
pGamePlayer->SendPacket(&msg);
return PACKET_EXE_CONTINUE;
}
if ( 0 == pEquipment->GetAttrCount())// && pEquipment->GetLevel()
{
msg.SetResult(EQUIPREFINING_NOT_HAVE_ATTR);
pGamePlayer->SendPacket(&msg);
return PACKET_EXE_CONTINUE;
}
//EQUIP_TB* pGet = g_ItemTable.GetEquipTB(pEquipment->GetItemTableIndex());
//Assert(NULL != pGet);
//删除装备和炼化神符道具
UINT iPrice = pEquipment->GetSellPrice();//保留将要删除的装备属性给后面用
BYTE iRequireLevel = pEquipment->GetRequireLevel();
BYTE curEquipPoint = pEquipment->GetEquipPoint();
BYTE attrCount = 0;
_ITEM_ATTR tmpItemAttr[MAX_ITEM_ATTR];
for (BYTE index=0; index<pEquipment->GetAttrCount(); ++index)
{
tmpItemAttr[index] = pEquipment->GetEquipAttr(index);
if (tmpItemAttr[index].m_AttrType > 0)
{
attrCount++;
}
}
Assert(attrCount == pEquipment->GetAttrCount());
//开始删除装备和扣除金钱
BOOL bRet = FALSE;
ITEM_LOG_PARAM ItemLogParam;
ItemLogParam.OpType = ITEM_EQUIP_REFINING;
bRet = HumanItemLogic::EraseBagItem(&ItemLogParam,pHuman, pBagContainer->BagIndex2ConIndex(iEquipItemPos));
if(bRet)
{
SaveItemLog(&ItemLogParam);
}
else
{
msg.SetResult(EQUIPREFINING_ERASE_ITEM_FAIL);
pGamePlayer->SendPacket(&msg);
return PACKET_EXE_CONTINUE;
}
//删除炼化道具
bRet = HumanItemLogic::EraseBagItem(&ItemLogParam,pHuman, pBagContainer->BagIndex2ConIndex(iRefiningItemPos));
if(bRet)
{
SaveItemLog(&ItemLogParam);
}
else
{
msg.SetResult(EQUIPREFINING_ERASE_ITEM_FAIL);
pGamePlayer->SendPacket(&msg);