# Triggering Behavior Change
Grammar — Triggering Behavior Change
Flags —Native
|Function
Returns — int
<preset::BehaviorChange>
native int EventUnitBehaviorChange();
# Supported triggers
- Unit Behavior Changes — TriggerAddEventUnitBehaviorChange
# Related
Category: Behavior / Basic
- Remove Behaviors By Category —
void
— UnitBehaviorRemoveCategory - Remove Behavior (Player) —
void
— UnitBehaviorRemovePlayer - Remove Behavior —
void
— UnitBehaviorRemove - Add Behavior (Player) —
void
— UnitBehaviorAddPlayer - Add Behavior —
void
— UnitBehaviorAdd - Set Behavior Count —
void
— libNtve_gf_SetBehaviorCount - Number Of Behaviors On Unit —
int
— UnitBehaviorCountAll - Unit Behavior —
string
<gamelink::Behavior> — UnitBehaviorGet - Unit Has Behavior —
bool
— UnitHasBehavior2 - Unit Has Behavior (Enabled) —
bool
— UnitHasBehavior - Unit Behavior Enabled —
bool
— UnitBehaviorEnabled - Stack Count Of Behavior On Unit —
int
— UnitBehaviorCount - Behavior Has Flag —
bool
— UnitBehaviorHasFlag - Transfer Behavior —
void
— UnitBehaviorTransfer - Set Unit Behavior Duration —
void
— UnitBehaviorSetDuration - Set Unit Behavior Duration Remaining —
void
— UnitBehaviorSetDurationRemaining - Duration Remaining Of Behavior On Unit —
fixed
— UnitBehaviorDuration - Duration Of Behavior On Unit —
fixed
— UnitBehaviorDurationTotal - Set Unit Behavior Spawn Count —
void
— UnitBehaviorSpawn - Unit Behavior Effect Player —
int
— UnitBehaviorEffectPlayer - Unit Behavior Effect Unit —
unit
— UnitBehaviorEffectUnit - Set Unit Behavior User Data —
void
— UnitBehaviorEffectTreeSetUserData - User Data Of Behavior On Unit —
fixed
— UnitBehaviorEffectTreeUserData - User Data Of Behavior On Unit Exists —
bool
— UnitBehaviorEffectTreeUserDataExists - Unit Behavior Changes —
void
— TriggerAddEventUnitBehaviorChange - Unit Behavior Changes From Category —
void
— TriggerAddEventUnitBehaviorChangeFromCategory - Triggering Behavior —
string
<gamelink::Behavior> — EventUnitBehavior - Triggering Behavior Change —
int
<preset::BehaviorChange> — EventUnitBehaviorChange - Unit Behavior Damage Modify Remaining —
fixed
— UnitBehaviorDamageModifyRemaining - Unit Behavior Damage Modify Limit —
fixed
— UnitBehaviorDamageModifyLimit - For Each Behavior On Unit — macro
# Examples
mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmod — base.stormdata/LibPEB1.galaxy:7907
if ((PlayerGroupHasPlayer(libGame_gf_PlayersOnTeamHeroes(libGame_gv_teamOrderIndex_C, false), UnitGetOwner(EventUnit())) == true) && (EventUnit() == libGame_gv_players[UnitGetOwner(EventUnit())].lv_heroUnit)) {
autoD7497882_val = EventUnitBehaviorChange();
if (autoD7497882_val == c_unitBehaviorChangeActivate) {
libUIUI_gf_FullscreenOverlayAddItemForPlayer(UnitGetOwner(EventUnit()), libUIUI_ge_FullscreenOverlayPriorities_VoidPrison, "Cutscenes\\GameUI_PoisonOverlay.StormCutscene", "SlivanBossSlimeSpitDoT");
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:4465
}
if (!((EventUnitBehaviorChange() != c_unitBehaviorChangeCreate))) {
return false;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:4469
}
if (!((EventUnitBehaviorChange() != c_unitBehaviorChangeDestroy))) {
return false;
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:4584
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
libUIUI_gf_FullscreenOverlayAddItemForPlayer(lv_player, libUIUI_ge_FullscreenOverlayPriorities_Stasis, "Cutscenes\\GameUI_SuperCloakOverlay.StormCutscene", EventUnitBehavior());
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:5045
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
DialogControlFadeTransparency(libUIUI_gv_fullscreenOverlaysPanel.lv_abathurSymbioteOverlay, PlayerGroupSingle(lv_player), 0.5, 0.0);
UISetSelectionTypeEnabled(PlayerGroupSingle(lv_player), c_localSelectionTypeWorldPanelHero, false);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:6784
// Variable Initialization
lv_webbedPlayer = UnitGetOwner(EventUnit());
lv_behaviorChange = EventUnitBehaviorChange();
// Actions
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:11515
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeCreate)) {
UnitBehaviorAdd(lv_stunnedUnit, "L90ETCMoshPitDisplayBehavior", lv_stunnedUnit, 1);
UnitBehaviorSetDuration(lv_stunnedUnit, "L90ETCMoshPitDisplayBehavior", UnitBehaviorDurationTotal(lv_eTC, "L90ETCMoshPitChannel"));
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14571
lv_cairn = EventUnit();
lv_itPlayer = UnitGetOwner(lv_cairn);
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate) && (TimerIsPaused(libGDHL_gv_lostVikingsPlayer[lv_itPlayer].lv_checkpointReachedCarinRespawnTimer) == false)) {
TimerPause(libGDHL_gv_lostVikingsPlayer[lv_itPlayer].lv_checkpointReachedCarinRespawnTimer, true);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:14575
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDeactivate) && (TimerIsPaused(libGDHL_gv_lostVikingsPlayer[lv_itPlayer].lv_checkpointReachedCarinRespawnTimer) == true)) {
TimerPause(libGDHL_gv_lostVikingsPlayer[lv_itPlayer].lv_checkpointReachedCarinRespawnTimer, false);
}
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:17753
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
lv_caster = UnitBehaviorEffectUnit(lv_target, "NecromancerSpectralScytheMasteryMortalWoundDebuff", c_effectUnitCaster, 0);
libGDHL_gv_heroNecromancerMortalWoundsCasterOwner[lv_ownerofTarget] = UnitGetOwner(lv_caster);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameDataHelperLib.galaxy:17757
libGDHL_gv_heroNecromancerMortalWoundsCasterOwner[lv_ownerofTarget] = UnitGetOwner(lv_caster);
}
else if ((EventUnitBehaviorChange() == c_unitBehaviorChangeRefresh)) {
lv_caster = UnitBehaviorEffectUnit(lv_target, "NecromancerSpectralScytheMasteryMortalWoundDebuff", c_effectUnitCaster, 0);
libGDHL_gv_heroNecromancerMortalWoundsCasterOwner[lv_ownerofTarget] = UnitGetOwner(lv_caster);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:18394
UIFlyerHelperOverride(PlayerGroupAll(), libNtve_ge_FlyerHelperDisplay_c_flyerDisplayNone);
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
libGame_gv_moonwellMoonwellonCooldown[UnitGetOwner(EventUnit())] = true;
UIFlyerHelperOverride(PlayerGroupSingle(UnitGetOwner(EventUnit())), libNtve_ge_FlyerHelperDisplay_c_flyerDisplayAll);
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/GameLib.galaxy:18422
}
else {
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDeactivate)) {
libGame_gv_moonwellMoonwellonCooldown[UnitGetOwner(EventUnit())] = false;
UIFlyerHelperOverride(PlayerGroupSingle(UnitGetOwner(EventUnit())), libNtve_ge_FlyerHelperDisplay_c_flyerDisplayAll);
mods/heromods/alarak.stormmod — base.stormdata/LibHALA.galaxy:436
lv_player = UnitGetOwner(EventUnit());
lv_index = libUIUI_gf_UIUnitStatusFramesGetUnitIndex(lv_player, EventUnit());
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
DialogControlSendAnimationEvent(libUIUI_gv_uIHeroStatusFrames[lv_player].lv_unitHealthBarInvincible[lv_index], PlayerGroupAll(), "InvincibleOn");
libUIUI_gv_uIHeroBehaviorStates[lv_player].lv_invincibleActive[lv_index] = true;
mods/heromods/chogall.stormmod — base.stormdata/LibHCHO.galaxy:2420
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeCreate)) {
UnitBehaviorAdd(libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallUnit, "GallForwardedStasis", UnitBehaviorEffectUnit(libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_choUnit, EventUnitBehavior(), c_effectUnitCaster, 0), 1);
}
mods/heromods/chogall.stormmod — base.stormdata/LibHCHO.galaxy:2424
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDestroy)) {
UnitBehaviorRemove(libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallUnit, "GallForwardedStasis", 1);
}
mods/heromods/chogall.stormmod — base.stormdata/LibHCHO.galaxy:2467
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeCreate)) {
UnitBehaviorAdd(libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallUnit, "GallMoltenBlockStasis", libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_choUnit, 1);
}
mods/heromods/chogall.stormmod — base.stormdata/LibHCHO.galaxy:2471
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDestroy)) {
UnitBehaviorRemove(libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallUnit, "GallMoltenBlockStasis", 1);
}
mods/heromods/dva.stormmod — base.stormdata/LibHDVA.galaxy:974
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeIncrease)) {
}
else {
mods/heromods/medivh.stormmod — base.stormdata/LibHMDV.galaxy:691
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeIncrease)) {
lv_shieldedUnit = lv_unit;
lv_ownerofShieldedUnit = UnitGetOwner(lv_shieldedUnit);
mods/heromods/medivh.stormmod — base.stormdata/LibHMDV.galaxy:700
PlayerGroupAdd(libHMDV_gv_medivhForceofWillPlayerGroup[lv_ownerofShieldedUnit], UnitGetOwner(lv_caster));
}
else if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDecrease)) {
lv_shieldedUnit = lv_unit;
lv_ownerofShieldedUnit = UnitGetOwner(lv_shieldedUnit);
mods/heromods/zarya.stormmod — base.stormdata/LibHZAR.galaxy:383
lv_shieldedUnit = EventUnit();
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
lv_caster = UnitBehaviorEffectUnit(lv_shieldedUnit, EventUnitBehavior(), c_effectUnitCaster, 0);
libHZAR_gv_heroZaryaShieldCasterOwner[UnitGetOwner(lv_shieldedUnit)] = UnitGetOwner(lv_caster);
mods/heromods/zarya.stormmod — base.stormdata/LibHZAR.galaxy:387
libHZAR_gv_heroZaryaShieldCasterOwner[UnitGetOwner(lv_shieldedUnit)] = UnitGetOwner(lv_caster);
}
else if ((EventUnitBehaviorChange() == c_unitBehaviorChangeRefresh)) {
lv_caster = UnitBehaviorEffectUnit(lv_shieldedUnit, EventUnitBehavior(), c_effectUnitCaster, 0);
lv_ownerofShielded = UnitGetOwner(lv_shieldedUnit);
mods/heromods/zarya.stormmod — base.stormdata/LibHZAR.galaxy:394
libHZAR_gv_heroZaryaShieldNumbers[lv_ownerofShielded] = 0.0;
}
else if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDeactivate)) {
lv_ownerofShielded = UnitGetOwner(lv_shieldedUnit);
libHZAR_gf_HeroZaryaCustomFCT(lv_shieldedUnit, lv_ownerofShielded, libHZAR_gv_heroZaryaShieldNumbers[lv_ownerofShielded], true);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:14651
DialogControlHookupUnitStatus(c_triggerControlTypeImage, "HeroUnitBackgroundImage", lv_loneWolfUnit);
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
DialogControlSetAnimationState(DialogControlLastCreated(), PlayerGroupAll(), "PrestigeLoneWolf", "On");
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:26920
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
lv_event = "ZeratulEvent_VisionReady";
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:28620
}
if (!(((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate) || (EventUnitBehaviorChange() == c_unitBehaviorChangeDeactivate)))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:28620
}
if (!(((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate) || (EventUnitBehaviorChange() == c_unitBehaviorChangeDeactivate)))) {
return false;
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:6613
}
if ((EventUnitBehaviorChange() == c_unitBehaviorChangeCreate)) {
UnitGroupAdd(libCOOC_gv_cC_ScoreVorazunBHGroup, EventUnit());
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOOC.galaxy:6616
UnitGroupAdd(libCOOC_gv_cC_ScoreVorazunBHGroup, EventUnit());
}
else if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDestroy)) {
UnitGroupRemove(libCOOC_gv_cC_ScoreVorazunBHGroup, EventUnit());
}