mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[9507] Implement SPELL_EFFECT_RESTORE_ITEM_CHARGES
Also it application in special case of item 5513 and similar.
This commit is contained in:
parent
d775eea9a4
commit
4c4629e861
11 changed files with 105 additions and 3 deletions
|
|
@ -8622,6 +8622,26 @@ uint32 Player::GetItemCountWithLimitCategory( uint32 limitCategory ) const
|
|||
return count;
|
||||
}
|
||||
|
||||
Item* Player::GetItemByEntry( uint32 item ) const
|
||||
{
|
||||
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
|
||||
if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||
if (pItem->GetEntry() == item)
|
||||
return pItem;
|
||||
|
||||
for(int i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i)
|
||||
if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i))
|
||||
if (pItem->GetEntry() == item)
|
||||
return pItem;
|
||||
|
||||
for(int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
if (Bag* pBag = (Bag*)GetItemByPos( INVENTORY_SLOT_BAG_0, i))
|
||||
if (Item* itemPtr = pBag->GetItemByEntry(item))
|
||||
return itemPtr;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Item* Player::GetItemByGuid( uint64 guid ) const
|
||||
{
|
||||
for(int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue