本文整理汇总了C++中CInventoryOwner::object_id方法的典型用法代码示例。如果您正苦于以下问题:C++ CInventoryOwner::object_id方法的具体用法?C++ CInventoryOwner::object_id怎么用?C++ CInventoryOwner::object_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CInventoryOwner
的用法示例。
在下文中一共展示了CInventoryOwner::object_id方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ChangeGoodwill
void CScriptGameObject::ChangeGoodwill(int delta_goodwill, CScriptGameObject* pWhoToSet)
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!pInventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"ChangeGoodwill available only for InventoryOwner");
return ;
}
RELATION_REGISTRY().ChangeGoodwill(pInventoryOwner->object_id(), pWhoToSet->object().ID(), delta_goodwill);
}
示例2: RELATION_REGISTRY
int CScriptGameObject::GetGoodwill(CScriptGameObject* pToWho)
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!pInventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"GetGoodwill available only for InventoryOwner");
return 0;
}
return RELATION_REGISTRY().GetGoodwill(pInventoryOwner->object_id(), pToWho->object().ID());
}
示例3: SetCommunityGoodwill_obj
void CScriptGameObject::SetCommunityGoodwill_obj( LPCSTR community, int goodwill )
{
CInventoryOwner* pInventoryOwner = smart_cast<CInventoryOwner*>(&object());
if (!pInventoryOwner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"SetCommunityGoodwill available only for InventoryOwner");
return;
}
CHARACTER_COMMUNITY c;
c.set( community );
RELATION_REGISTRY().SetCommunityGoodwill( c.index(), pInventoryOwner->object_id(), goodwill );
}
示例4: MakeItemActive
void CScriptGameObject::MakeItemActive(CScriptGameObject* pItem)
{
CInventoryOwner* owner = smart_cast<CInventoryOwner*>(&object());
CInventoryItem* item = smart_cast<CInventoryItem*>(&pItem->object());
u32 slot = item->GetSlot();
CInventoryItem* item_in_slot = owner->inventory().ItemFromSlot(slot);
NET_Packet P;
if(item_in_slot)
{
CGameObject::u_EventGen (P, GEG_PLAYER_ITEM2RUCK, owner->object_id());
P.w_u16 (item_in_slot->object().ID());
CGameObject::u_EventSend (P);
}
CGameObject::u_EventGen (P, GEG_PLAYER_ITEM2SLOT, owner->object_id());
P.w_u16 (item->object().ID());
CGameObject::u_EventSend (P);
CGameObject::u_EventGen (P, GEG_PLAYER_ACTIVATE_SLOT, owner->object_id());
P.w_u32 (slot);
CGameObject::u_EventSend (P);
}