[Quest API] Add corpse->RemoveItemByID(item_id, quantity) to Perl and Lua. (#1535)

* [Quest API] Add corpse->RemoveItemByID(item_id, quantity) to Perl and Lua.
- Add $corpse->RemoveItemByID(item_id, quantity) to Perl.
- Add corpse:RemoveItemByID(item_id, quantity) to Lua.

* Formatting.
This commit is contained in:
Kinglykrab
2021-09-13 15:42:04 -04:00
committed by GitHub
parent 6e76f89ca2
commit fa8d8eccc2
5 changed files with 73 additions and 0 deletions
+12
View File
@@ -177,6 +177,16 @@ uint16 Lua_Corpse::GetFirstSlotByItemID(uint32 item_id) {
return self->GetFirstSlotByItemID(item_id);
}
void Lua_Corpse::RemoveItemByID(uint32 item_id) {
Lua_Safe_Call_Void();
self->RemoveItemByID(item_id);
}
void Lua_Corpse::RemoveItemByID(uint32 item_id, int quantity) {
Lua_Safe_Call_Void();
self->RemoveItemByID(item_id, quantity);
}
Lua_Corpse_Loot_List Lua_Corpse::GetLootList(lua_State* L) {
Lua_Safe_Call_Class(Lua_Corpse_Loot_List);
Lua_Corpse_Loot_List ret;
@@ -227,6 +237,8 @@ luabind::scope lua_register_corpse() {
.def("CountItem", (uint16(Lua_Corpse::*)(uint32))&Lua_Corpse::CountItem)
.def("GetItemIDBySlot", (uint32(Lua_Corpse::*)(uint16))&Lua_Corpse::GetItemIDBySlot)
.def("GetFirstSlotByItemID", (uint16(Lua_Corpse::*)(uint32))&Lua_Corpse::GetFirstSlotByItemID)
.def("RemoveItemByID", (void(Lua_Corpse::*)(uint32))&Lua_Corpse::RemoveItemByID)
.def("RemoveItemByID", (void(Lua_Corpse::*)(uint32,int))&Lua_Corpse::RemoveItemByID)
.def("GetLootList", (Lua_Corpse_Loot_List(Lua_Corpse::*)(lua_State* L))&Lua_Corpse::GetLootList);
}