mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-29 12:47:54 +00:00
[Quest API] Add GetAugmentIDsBySlotID() to Perl/Lua. (#2673)
* [Quest API] Add GetAugmentIDsBySlotID() to Perl/Lua. # Perl - Add `$client->GetAugmentIDsBySlotID(slot_id)`. - Add `$inventory->GetAugmentIDsBySlotID(slot_id)`. # Lua - Add `client:GetAugmentIDsBySlotID(slot_id)`. - Add `inventory:GetAugmentIDsBySlotID(slot_id)`. # Notes - Allows operators to get a list of augments from a specific slot instead of having to build a plugin or something to do it. - Fix issue with Lua tables starting at index `1` versus index `0`, so you lost the first value of the table due to this. * Update inventory_profile.cpp
This commit is contained in:
@@ -166,6 +166,18 @@ int Perl_Inventory_CountItemEquippedByID(EQ::InventoryProfile* self, uint32_t it
|
||||
return self->CountItemEquippedByID(item_id);
|
||||
}
|
||||
|
||||
perl::array Perl_Inventory_GetAugmentIDsBySlotID(EQ::InventoryProfile* self, int16 slot_id)
|
||||
{
|
||||
perl::array result;
|
||||
auto augments = self->GetAugmentIDsBySlotID(slot_id);
|
||||
|
||||
for (int i = 0; i < augments.size(); ++i) {
|
||||
result.push_back(augments[i]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void perl_register_inventory()
|
||||
{
|
||||
perl::interpreter perl(PERL_GET_THX);
|
||||
@@ -180,6 +192,7 @@ void perl_register_inventory()
|
||||
package.add("FindFreeSlot", (int(*)(EQ::InventoryProfile*, bool, bool))&Perl_Inventory_FindFreeSlot);
|
||||
package.add("FindFreeSlot", (int(*)(EQ::InventoryProfile*, bool, bool, uint8_t))&Perl_Inventory_FindFreeSlot);
|
||||
package.add("FindFreeSlot", (int(*)(EQ::InventoryProfile*, bool, bool, uint8_t, bool))&Perl_Inventory_FindFreeSlot);
|
||||
package.add("GetAugmentIDsBySlotID", &Perl_Inventory_GetAugmentIDsBySlotID);
|
||||
package.add("GetBagIndex", &Perl_Inventory_GetBagIndex);
|
||||
package.add("GetItem", &Perl_Inventory_GetItem);
|
||||
package.add("GetMaterialFromSlot", &Perl_Inventory_GetMaterialFromSlot);
|
||||
|
||||
Reference in New Issue
Block a user