[Quest API] Add multiple augment related methods to Perl/Lua. (#1930)

* [Quest API] Add multiple augment related methods to Perl/Lua.
- Add $inventory->CountAugmentEquippedByID(item_id) to Perl.
- Add $inventory->HasAugmentEquippedByID(item_id) to Perl.
- Add $item->ContainsAugmentByID(item_id) to Perl.
- Add $item->CountAugmentByID(item_id) to Perl.
- Add inventory:CountAugmentEquippedByID(item_id) to Perl.
- Add inventory:HasAugmentEquippedByID(item_id) to Perl.
- Add item:ContainsAugmentByID(item_id) to Perl.
- Add item:CountAugmentByID(item_id) to Perl.

* Update inventory_profile.cpp
This commit is contained in:
Kinglykrab
2022-01-16 18:04:51 -05:00
committed by GitHub
parent 5ebbbf647b
commit 3a94132749
10 changed files with 160 additions and 0 deletions
+12
View File
@@ -164,6 +164,16 @@ int Lua_Inventory::GetSlotByItemInst(Lua_ItemInst inst) {
return self->GetSlotByItemInst(inst);
}
int Lua_Inventory::CountAugmentEquippedByID(uint32 item_id) {
Lua_Safe_Call_Int();
return self->CountAugmentEquippedByID(item_id);
}
bool Lua_Inventory::HasAugmentEquippedByID(uint32 item_id) {
Lua_Safe_Call_Bool();
return self->HasAugmentEquippedByID(item_id);
}
luabind::scope lua_register_inventory() {
return luabind::class_<Lua_Inventory>("Inventory")
.def(luabind::constructor<>())
@@ -174,6 +184,7 @@ luabind::scope lua_register_inventory() {
.def("CalcSlotId", (int(Lua_Inventory::*)(int,int))&Lua_Inventory::CalcSlotId)
.def("CanItemFitInContainer", (bool(Lua_Inventory::*)(Lua_Item,Lua_Item))&Lua_Inventory::CanItemFitInContainer)
.def("CheckNoDrop", (bool(Lua_Inventory::*)(int))&Lua_Inventory::CheckNoDrop)
.def("CountAugmentEquippedByID", (int(Lua_Inventory::*)(uint32))&Lua_Inventory::CountAugmentEquippedByID)
.def("DeleteItem", (bool(Lua_Inventory::*)(int))&Lua_Inventory::DeleteItem)
.def("DeleteItem", (bool(Lua_Inventory::*)(int,int))&Lua_Inventory::DeleteItem)
.def("FindFreeSlot", (int(Lua_Inventory::*)(bool,bool))&Lua_Inventory::FindFreeSlot)
@@ -182,6 +193,7 @@ luabind::scope lua_register_inventory() {
.def("GetItem", (Lua_ItemInst(Lua_Inventory::*)(int))&Lua_Inventory::GetItem)
.def("GetItem", (Lua_ItemInst(Lua_Inventory::*)(int,int))&Lua_Inventory::GetItem)
.def("GetSlotByItemInst", (int(Lua_Inventory::*)(Lua_ItemInst))&Lua_Inventory::GetSlotByItemInst)
.def("HasAugmentEquippedByID", (bool(Lua_Inventory::*)(uint32))&Lua_Inventory::HasAugmentEquippedByID)
.def("HasItem", (int(Lua_Inventory::*)(int))&Lua_Inventory::HasItem)
.def("HasItem", (int(Lua_Inventory::*)(int,int))&Lua_Inventory::HasItem)
.def("HasItem", (int(Lua_Inventory::*)(int,int,int))&Lua_Inventory::HasItem)