Skip to content

Unequip Hero

Unequip Hero

Removes equipment from a hero's equipment slot and return it to the inventory.

Properties

System

Name Explanation Type
Equipment Slot The equipment slot to unequip. If not specified, all equipment slots are unequipped. Equipment Slot
Hero The hero whose equipment will be removed. Character
Ignore Constraints When enabled, equipment restrictions are bypassed when unequipping. Toggle
Result The switch to store whether the unequip operation succeeded. Switch or Value
Store Results When enabled, the success or failure of the unequip operation is stored in a switch. Toggle

Examples

Unequip Hero 0 from Equipment Slot 0

This removes the equipment in equipment slot 0 from hero 0 and returns it to the inventory.

unequip_item(hero(0), equip_slot(0));
{"Data":{"EquipmentSlot":{"ReferenceType":0,"Index":0,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"Hero":{"ReferenceType":0,"Index":0,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"0","VariableIndex":0,"Metadata":null},"Metadata":null},"IgnoreConstraints":false,"Result":{"IsGlobalSwitch":true,"IsLocalSwitch":false,"IsValue":false,"Value":false,"SwitchIndex":0,"Metadata":null},"StoreResults":false,"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Inventory.UnequipItemCommand"}

Unequip Hero 1 Ignoring Constraints and Store the Result

This removes equipment from equipment slot 2 on hero 1, bypassing restrictions, and stores whether the operation succeeded in Global Switch 0.

$gs[0] = unequip_item(hero(1), equip_slot(2), ignore_constraints);
{"Data":{"EquipmentSlot":{"ReferenceType":0,"Index":2,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"2","VariableIndex":0,"Metadata":null},"Metadata":null},"Hero":{"ReferenceType":0,"Index":1,"IsUniqueID":true,"Identifier":{"IsGlobalVariable":false,"IsLocalVariable":false,"IsValue":true,"Value":"1","VariableIndex":0,"Metadata":null},"Metadata":null},"IgnoreConstraints":true,"Result":{"IsGlobalSwitch":true,"IsLocalSwitch":false,"IsValue":false,"Value":false,"SwitchIndex":0,"Metadata":null},"StoreResults":true,"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Inventory.UnequipItemCommand"}