mirror of
https://github.com/EQEmu/Server.git
synced 2026-08-28 20:07:56 +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:
@@ -1718,3 +1718,17 @@ int16 EQ::InventoryProfile::_HasItemByLoreGroup(ItemInstQueue& iqueue, uint32 lo
|
||||
|
||||
return EQ::invslot::SLOT_INVALID;
|
||||
}
|
||||
|
||||
std::vector<uint32> EQ::InventoryProfile::GetAugmentIDsBySlotID(int16 slot_id)
|
||||
{
|
||||
std::vector<uint32> augments;
|
||||
const auto* item = GetItem(slot_id);
|
||||
|
||||
if (item) {
|
||||
for (uint8 i = invaug::SOCKET_BEGIN; i <= invaug::SOCKET_END; i++) {
|
||||
augments.push_back(item->GetAugment(i) ? item->GetAugmentItemID(i) : 0);
|
||||
}
|
||||
}
|
||||
|
||||
return augments;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user