# Unit Attribute Point
Grammar — baseBonus attribute point count of attribute on unit
Flags —Native
|Function
Returns the point count of the an attribute behavior on a unit.
# Arguments
unit
— Unitstring
<gamelink::Behavior> — Attributebool
<preset::BaseBonusOptions> — Base/Bonus
Returns — int
native int UnitGetAttributePoint(
unit inUnit,
string attribute,
bool baseBonus,
);
# Related
Category: Behavior / Attribute
- Unit Attribute Point —
int
— UnitGetAttributePoint - Set Unit Attribute Point —
void
— UnitSetAttributePoint
# Examples
mods/warcoop/warclassicsystem.sc2mod — base.sc2data/TriggerLibs/WarClassicSystem.galaxy:504
lv_itBuff = UnitBehaviorGet(lv_caster, lv_i);
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: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;
}