# Set Charge Remaining
Grammar — Set Charge Remaining of item inItem to inVal
Flags —Native
|Action
Set charge remaining count for the specified item.
# Arguments
unit
— Itemfixed
— Value
Returns — void
native void ItemSetChargeCount(unit inItem, fixed inVal);
# Related
Category: Item / Basic
- Set Charge Remaining —
void
— ItemSetChargeCount - Charge Count —
fixed
— ItemGetChargeCount
# Examples
mods/warcoop/warclassicsystem.sc2mod — base.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.sc2mod — base.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);