# Unit Behavior
Grammar — unit behavior index
Flags —Native
|Function
Returns the behavior at the specified index on the specified unit.
# Arguments
unit
— Unitint
— Index
Returns — string
[ gamelink::Behavior ]
native string UnitBehaviorGet(unit inUnit, int inIndex);
# Related
Category: Behavior / Basic
- [F] —
void
— Remove Behaviors By Category — ( UnitBehaviorRemoveCategory ) - [F] —
void
— Remove Behavior (Player) — ( UnitBehaviorRemovePlayer ) - [F] —
void
— Remove Behavior — ( UnitBehaviorRemove ) - [F] —
void
— Add Behavior (Player) — ( UnitBehaviorAddPlayer ) - [F] —
void
— Add Behavior — ( UnitBehaviorAdd ) - [F] —
void
— Set Behavior Count — ( libNtve_gf_SetBehaviorCount ) - [F] —
int
— Number Of Behaviors On Unit — ( UnitBehaviorCountAll ) - [F] —
string
[ gamelink::Behavior ] — Unit Behavior — ( UnitBehaviorGet ) - [F] —
bool
— Unit Has Behavior — ( UnitHasBehavior2 ) - [F] —
bool
— Unit Has Behavior (Enabled) — ( UnitHasBehavior ) - [F] —
bool
— Unit Behavior Enabled — ( UnitBehaviorEnabled ) - [F] —
int
— Stack Count Of Behavior On Unit — ( UnitBehaviorCount ) - [F] —
bool
— Behavior Has Flag — ( UnitBehaviorHasFlag ) - [F] —
void
— Transfer Behavior — ( UnitBehaviorTransfer ) - [F] —
void
— Set Unit Behavior Duration — ( UnitBehaviorSetDuration ) - [F] —
void
— Set Unit Behavior Duration Remaining — ( UnitBehaviorSetDurationRemaining ) - [F] —
fixed
— Duration Remaining Of Behavior On Unit — ( UnitBehaviorDuration ) - [F] —
fixed
— Duration Of Behavior On Unit — ( UnitBehaviorDurationTotal ) - [F] —
void
— Set Unit Behavior Spawn Count — ( UnitBehaviorSpawn ) - [F] —
int
— Unit Behavior Effect Player — ( UnitBehaviorEffectPlayer ) - [F] —
unit
— Unit Behavior Effect Unit — ( UnitBehaviorEffectUnit ) - [F] —
void
— Set Unit Behavior User Data — ( UnitBehaviorEffectTreeSetUserData ) - [F] —
fixed
— User Data Of Behavior On Unit — ( UnitBehaviorEffectTreeUserData ) - [F] —
bool
— User Data Of Behavior On Unit Exists — ( UnitBehaviorEffectTreeUserDataExists ) - [F] —
void
— Unit Behavior Changes — ( TriggerAddEventUnitBehaviorChange ) - [F] —
void
— Unit Behavior Changes From Category — ( TriggerAddEventUnitBehaviorChangeFromCategory ) - [F] —
string
[ gamelink::Behavior ] — Triggering Behavior — ( EventUnitBehavior ) - [F] —
int
[ preset::BehaviorChange ] — Triggering Behavior Change — ( EventUnitBehaviorChange ) - [F] —
fixed
— Unit Behavior Damage Modify Remaining — ( UnitBehaviorDamageModifyRemaining ) - [F] —
fixed
— Unit Behavior Damage Modify Limit — ( UnitBehaviorDamageModifyLimit ) - [F] —
void
— For Each Behavior On Unit — ( )
# Examples
# mods/heroesdata.stormmod
// L11730
UnitBehaviorGet(lv_itHeroUnit, lv_itBehavior)
// L11731
UnitBehaviorGet(lv_itHeroUnit, lv_itBehavior)
# mods/heroesdata.stormmod
// L2953
UnitBehaviorGet(lp_targetUnit, lv_itBehavior)
# mods/heroesdata.stormmod
// L1711
UnitBehaviorGet(lv_itSelectedUnit, lv_itBehavior)
# mods/starcoop/starcoop.sc2mod
// L3535
UnitBehaviorGet(autoE98657EB_u, autoE98657EB_i)
// L3536
UnitBehaviorGet(autoE98657EB_u, autoE98657EB_i)
# mods/starcoop/starcoop.sc2mod
// L1667
UnitBehaviorGet(lp_killer, lv_behaviorIndex)
// L1667
UnitBehaviorGet(lp_killer, lv_behaviorIndex)
// L1671
UnitBehaviorGet(lp_killer, lv_behaviorIndex)
// L1691
UnitBehaviorGet(lp_killer, lv_behaviorIndex)
# mods/warcoop/warclassicsystem.sc2mod
// L494
UnitBehaviorGet(lv_caster, lv_i)
// L502
UnitBehaviorGet(lv_caster, lv_i)
// L1349
UnitBehaviorGet(auto37CC6DB9_u, auto37CC6DB9_i)
// L1350
UnitBehaviorGet(auto37CC6DB9_u, auto37CC6DB9_i)