// Created by Zunath #include "x2_inc_switches" #include "adv_include" void main() { // Does not fire if debug mode is on, or if the item was not equipped if(GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_EQUIP || GetLocalInt(GetModule(), "DEBUG") == 1) return; object oPC = GetPCItemLastEquippedBy(); if(!GetIsPC(oPC) || GetIsDM(oPC)) return; object oItem = GetPCItemLastEquipped(); string sResref = GetResRef(oItem); string sName = GetName(oItem); // Prevents PC properties item from not being equipped if(sName == "PC Properties" || !GetIsObjectValid(oItem)){return;} int iCanWear = ADV_CanItemBeEquipped(oPC, oItem); // Can't wear the item, unequip it. if(iCanWear == FALSE) { AssignCommand(oPC, ClearAllActions()); AssignCommand(oPC, ActionUnequipItem(oItem)); } }