本文整理汇总了C++中P_ITEM::DeleteAmount方法的典型用法代码示例。如果您正苦于以下问题:C++ P_ITEM::DeleteAmount方法的具体用法?C++ P_ITEM::DeleteAmount怎么用?C++ P_ITEM::DeleteAmount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P_ITEM
的用法示例。
在下文中一共展示了P_ITEM::DeleteAmount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: takeGold
UINT32 cNPC::takeGold( UINT32 amount, bool useBank )
{
P_ITEM pPack = getBackpack();
UINT32 dAmount = 0;
if( pPack )
dAmount = pPack->DeleteAmount( amount, 0xEED, 0 );
return dAmount;
}
示例2: RemoveShields
static void RemoveShields(P_CHAR pc)
{
cwmWorldState->RemoveItemsFromCharBody(pc->serial,0x1B, 0xC3);
cwmWorldState->RemoveItemsFromCharBody(pc->serial,0x1B, 0xC4);
P_ITEM pPack = Packitem(pc);
if (pPack)
{
pPack->DeleteAmount(666,0x1BC3); // hope they don't have more than 666 shields ;-) (Duke)
pPack->DeleteAmount(666,0x1BC4);
}
}
示例3: BountyWithdrawGold
bool cBounty::BountyWithdrawGold( P_CHAR pVictim, int nAmount )
{
int has = pVictim->CountBankGold();
if (has < nAmount)
return false;
P_ITEM pBox = pVictim->GetBankBox();
if (!pBox)
return false; // shouldn't happen coz it's needed in CountBankGold...
pBox->DeleteAmount(nAmount,0x0EED);
return true;
}