Dear developers, i want help with script.
Please what can i check if player has equipped dagger?
Thanks,
Dear developers, i want help with script.
Please what can i check if player has equipped dagger?
Thanks,
Check for main hand
Item* pItem = player->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
if (pItem && pItem->GetTemplate()->Class == ITEM_CLASS_WEAPON && pItem->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER)
{
// Do some stuff
}
+1 Thank you!
Wouldn’t it suffice to only check that the subclass is a dagger instead of also checking if it’s a weapon?
No because ITEM_SUBCLASS_WEAPON_ENCHANTMENT = 15 and ITEM_SUBCLASS_WEAPON_DAGGER is also 15