REO-EE/_module/nss/dcy_mod_equip.nss
Jaysyn904 f82740bbbd Initial commit
Initial commit
2024-02-22 13:22:03 -05:00

21 lines
645 B
Plaintext

#include "x2_inc_switches"
#include "dcy_include"
void main()
{
if(GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_EQUIP || GetLocalInt(GetModule(), DEBUG_MODE)) return;
object oPC = GetPCItemLastEquippedBy();
object oItem = GetPCItemLastEquipped();
int iDurability = DCY_GetItemDurability(oItem);
// Can't equip a broken item
if(iDurability == 0)
{
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionUnequipItem(oItem));
FloatingTextStringOnCreature(ColorTokenRed() + "That item is broken and must be repaired before you can use it." + ColorTokenEnd(), oPC, FALSE);
}
}