mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[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:
@@ -708,6 +708,26 @@ bool EQ::ItemInstance::ContainsAugmentByID(uint32 item_id)
|
||||
return false;
|
||||
}
|
||||
|
||||
int EQ::ItemInstance::CountAugmentByID(uint32 item_id)
|
||||
{
|
||||
int quantity = 0;
|
||||
if (!m_item || !m_item->IsClassCommon()) {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
if (!item_id) {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
for (uint8 augment_slot = invaug::SOCKET_BEGIN; augment_slot <= invaug::SOCKET_END; ++augment_slot) {
|
||||
if (GetAugmentItemID(augment_slot) == item_id) {
|
||||
quantity++;
|
||||
}
|
||||
}
|
||||
|
||||
return quantity;
|
||||
}
|
||||
|
||||
// Has attack/delay?
|
||||
bool EQ::ItemInstance::IsWeapon() const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user