# Set Unit Attribute Point
Grammar — Set attribute baseBonus attribute point to count on unit unit
Flags —Native
|Action
Sets attribute point on a unit.
# Arguments
unit
— Unitstring
<gamelink::Behavior> — Attributebool
<preset::BaseBonusOptions> — Base/Bonusint
— Count
Returns — void
native void UnitSetAttributePoint(
unit inUnit,
string attribute,
bool baseBonus,
int count,
);
# Related
Category: Behavior / Attribute
- Unit Attribute Point —
int
— UnitGetAttributePoint - Set Unit Attribute Point —
void
— UnitSetAttributePoint
# Examples
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:17699
UnitCreateEffectUnit(EventPlayerEffectUsedUnit(c_effectUnitCaster), "EssencePickupFullLM", EventPlayerEffectUsedUnit(c_effectUnitTarget));
CatalogFieldValueSet(c_gameCatalogEffect, "EssenceDehakaDummyStacks", "Amount", EventPlayerEffectUsedUnitOwner(c_effectPlayerTarget), FixedToString(libCOMI_gv_cM_Dehaka_TotalEssence[lv_player], c_fixedPrecisionAny));
UnitSetAttributePoint(lv_collectorUnit, libCOMI_gv_cM_Dehaka_EssenceAttribute, true, RoundI(UnitGetCustomValue(lv_collectorUnit, libCOMI_gv_cM_DehakaEssenceIndex)));
UnitXPAddXP(lv_collectorUnit, libCOMI_gv_cM_DehakaVeterencyBehavior[lv_player], lv_essenceCountStored);
libCOMI_gf_CM_Dehaka_LevelUp(lv_player, lv_collectorUnit);
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:505
if ((CatalogEntryScope(c_gameCatalogBehavior, lv_itBuff) == "CBehaviorAttribute")) {
lv_itStack = UnitGetAttributePoint(lp_source, lv_itBuff, true);
UnitSetAttributePoint(lv_target, lv_itBuff, true, lv_itStack);
}
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:981
libNtve_gf_SetBehaviorCount(lv_u, "SubgroupIncrease", lv_u, (10-libGAwX_gv_heroCreationCount));
UnitSetAttributePoint(lv_u, "SubgroupIncrease", true, libGAwX_gv_heroCreationCount);
libGAwX_gv_heroCreationCount += 1;
return true;
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:1656
lv_mana = EventUnitSpentVitalAmount();
UnitBehaviorAdd(lv_u, libGAwX_gv_manaFlareManaTokenLink, lv_u, 1);
UnitSetAttributePoint(lv_u, libGAwX_gv_manaFlareManaTokenLink, true, (FixedToInt(lv_mana) + UnitGetAttributePoint(lv_u, libGAwX_gv_manaFlareManaTokenLink, true)));
return true;
}