Jump to content

Remove equipped items from player


Guest warrior
 Share

Recommended Posts

Hello,

sometimes it is needed that a player wears a specific item to trigger a requested action. For special cases here this item is removed from player when activating this action.

Unfortunatly i cannot find any proper method in Class Player to do that. For example Player->DestroyItemCount also searches the inventory. Is there a prefered way to do that?

Regards warrior

Link to comment
Share on other sites

Hello Mangos devs,

i have replaced

pPlayer->DestroyItemCount(item,1,true,true);

which first checked inventory then equippment replaced with

pItem = pPlayer->GetItemByPos( INVENTORY_SLOT_BAG_0, slot);
if(pItem && pItem->GetEntry() == item)
   pPlayer->DestroyItem(INVENTORY_SLOT_BAG_0, slot, false);

Is there shorter way to do that?

Regards warrior

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use