# Set Charge Remaining

Grammar — Set Charge Remaining of item inItem to inVal
FlagsNative | Action

Set charge remaining count for the specified item.

# Arguments

  • unit — Item
  • fixed — Value

Returns — void

native void ItemSetChargeCount(unit inItem, fixed inVal);

Category: Item / Basic

# Examples

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:474

        lv_itemCopy = UnitInventoryLastCreated();
        UnitInventoryMove(lv_itemCopy, lv_container, lv_slot);
        ItemSetChargeCount(lv_itemCopy, lv_itItemStack);
    }
    UnitSetPropertyFixed(lv_target, c_unitPropXP, UnitGetPropertyFixed(lv_caster, c_unitPropXP, c_unitPropCurrent));

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicSystem.galaxy:1404

        if (lv_itItem == null) { break; }
        if ((UnitGetType(lv_itItem) == lv_itemType)) {
            ItemSetChargeCount(lv_itItem, (ItemGetChargeCount(lv_itItem, false)-1));
            if ((ItemGetChargeCount(lv_itItem, false) <= 0.0)) {
                UnitInventoryRemove(lv_itItem);