本文整理汇总了C++中Item::GetItemParam方法的典型用法代码示例。如果您正苦于以下问题:C++ Item::GetItemParam方法的具体用法?C++ Item::GetItemParam怎么用?C++ Item::GetItemParam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::GetItemParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
pBagContainer = HumanItemLogic::GetBagContainer(pHuman, iRefiningItem);
if (pBagContainer == NULL)
{
g_pLog->FastSaveLog( LOG_FILE_1, "CGSouXiaRefining refiningItem BagIndex is invalid, BagIndex = %d", iRefiningItem) ;
return PACKET_EXE_ERROR;
}
Item* pRefiningItem = pBagContainer->GetItem(pBagContainer->BagIndex2ConIndex(iRefiningItem));
if(pRefiningItem->GetItemClass() != ICLASS_COMITEM || COMITEM_SOUXIA != pRefiningItem->GetItemType())
{
g_pLog->FastSaveLog( LOG_FILE_1, "CGSouXiaRefining refiningItem type is invalid, BagIndex = %d", iRefiningSouXiaItem2) ;
refiningMsg.SetResult(GET_ITEM_ERROR);
pGamePlayer->SendPacket(&refiningMsg);
return PACKET_EXE_ERROR;
}
SOUXIA_INFO_TB* pGet = g_ItemTable.GetSouXiaTB(pRefiningItem->GetItemTableIndex());
if (NULL != pGet && ITEM_REFINING == pGet->m_nUseType)
{
if(pGet->m_nNeedLevel > pHuman->GetLevel()) // 使用道具没有达到限制等级
{
refiningMsg.SetResult(HUMAN_LEVEL_NOT_ENOUGH);
Player* pPlayer = pHuman->GetPlayer();
if( pPlayer != NULL )
{
pPlayer->SendPacket( &refiningMsg );
}
return PACKET_EXE_CONTINUE;
}
}
// 炼化逻辑
ItemParamValue ipv = (ItemParamValue)IPV_INT;
INT iParamSouXiaID = pRefiningSouXiaItem->GetItemParam(0,ipv);
INT iParamSouXiaPos = pRefiningSouXiaItem->GetItemParam(4,ipv);
INT iParamSouXiaID2 = pRefiningSouXiaItem2->GetItemParam(0,ipv);
INT iParamSouXiaPos2 = pRefiningSouXiaItem2->GetItemParam(4,ipv);
//两本捜侠录都为空
if ( (iParamSouXiaID == 0 && iParamSouXiaPos <= 0 ) && (iParamSouXiaID2 == 0 && iParamSouXiaPos2 <= 0 ))
{
refiningMsg.SetResult(SOUXIA_EMPTY);
Player* pPlayer = pHuman->GetPlayer();
if( pPlayer != NULL )
{
pPlayer->SendPacket( &refiningMsg );
}
return PACKET_EXE_CONTINUE;
}
BOOL bRefiningResult = FALSE;
BYTE refiningType = 0;
BYTE refiningRule = 0;
SHORT refiningRate = -1;
BYTE randNum = pScene->GetRand100();
SOUXIA_DATA randSouXiaData;//炼化随机后取得的新数据
if (pGet->m_nRefiningRule[0][0] > 0)//炼化技能道具
{
refiningRule = pGet->m_nRefiningRule[0][0];
refiningRate = pGet->m_nRefiningRule[0][1];
if (randNum < refiningRate)
{
bRefiningResult = SouXiaLogic::RefiningSouXia(pHuman, pRefiningSouXiaItem, pRefiningSouXiaItem2, refiningRule, randSouXiaData, ITEM_SOUXIASKILL);
refiningType = ITEM_SOUXIASKILL;
}