OnPlayerUnEquipItem

Fires whenever a PC unequips an item. Can be useful for creating truly cursed items that can't even be unequipped.


Trigger

PC unequips an item (prior to the item actually being unequipped).


Function(s)

GetPCItemLastUnequipped() Returns the unequipped item
GetPCItemLastUnequippedBy() Returns the PC unequipping the item


Remarks

With Hordes of the Underdark, BioWare has introduced a generic tag based system covering all of the module related item events. View the scripts x2_mod_def_equ, x2_mod_def_unequ, x2_mod_def_unaqu, x2_mod_def_aqu, x2_mod_def_act, and IN PARTICULAR, x2_it_example for more information if you wish to use the BioWare way of doing it. It is unknown by the Lexicon's authors, at this time, if the system is available on non-Hordes of the Underdark installations.


Example

//PC can't take off this amulet. Ever *evil grin*
void main()
{
object oPC=GetPCItemLastUnequippedBy();

object oItem=GetPCItemLastUnequipped();

if (GetTag(oItem)=="cursed_amulet")
   {
   AssignCommand(oPC, ActionEquipItem(oItem, INVENTORY_SLOT_NECK));
   }
}

See Also

Objects with Events | Module
functions: GetPCItemLastUnequipped | GetPCItemLastUnequippedBy


 Send comments on this topic.