[DiscordArchive] Are there any methods for ``unequip``?
[DiscordArchive] Are there any methods for ``unequip``?
Archived author: Qeme • Posted: 2024-02-19T19:02:42.177000+00:00
Original source
Are there any methods for ``unequip``?
I'm trying to do this:
```c++
void OnUnequip(Player* player, Item* item, uint8 slot, bool& unequip) override
{
if (slot == EQUIPMENT_SLOT_BODY) // Check if the item is unequipped from the shirt slot
{
uint32 spellId = 35395; // Crusader Strike -- spell ID to remove
// Check if the player has the spell
if (player->HasSpell(spellId))
{
player->removeSpell(spellId, false, false);
ChatHandler(player->GetSession()).PSendSysMessage("A spell has been removed due to unequipping an item.");
}
}
}
```
But no method similar to what you'd call ``OnUnequip`` seem to exist?