# Triggering Behavior Change

Grammar — Triggering Behavior Change
FlagsNative | Function

Returns — int<preset::BehaviorChange>

native int EventUnitBehaviorChange();

# Supported triggers

Category: Behavior / Basic

# Examples

mods/heroesbrawlmods/brawlmapmods/coop/escapefrombraxis.stormmodbase.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.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:4465

        }

        if (!((EventUnitBehaviorChange() != c_unitBehaviorChangeCreate))) {
            return false;
        }

mods/heroesdata.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:4469

        }

        if (!((EventUnitBehaviorChange() != c_unitBehaviorChangeDestroy))) {
            return false;
        }

mods/heroesdata.stormmodbase.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.stormmodbase.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.stormmodbase.stormdata/TriggerLibs/GameDataHelperLib.galaxy:6784

    // Variable Initialization
    lv_webbedPlayer = UnitGetOwner(EventUnit());
    lv_behaviorChange = EventUnitBehaviorChange();

    // Actions

mods/heroesdata.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.stormdata/LibHCHO.galaxy:2424

    }

    if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDestroy)) {
        UnitBehaviorRemove(libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallUnit, "GallForwardedStasis", 1);
    }

mods/heromods/chogall.stormmodbase.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.stormmodbase.stormdata/LibHCHO.galaxy:2471

    }

    if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDestroy)) {
        UnitBehaviorRemove(libGDHL_gv_chogallPairs[lv_choGallPairsTeam].lv_gallUnit, "GallMoltenBlockStasis", 1);
    }

mods/heromods/dva.stormmodbase.stormdata/LibHDVA.galaxy:974

    }

    if ((EventUnitBehaviorChange() == c_unitBehaviorChangeIncrease)) {
    }
    else {

mods/heromods/medivh.stormmodbase.stormdata/LibHMDV.galaxy:691

    }

    if ((EventUnitBehaviorChange() == c_unitBehaviorChangeIncrease)) {
        lv_shieldedUnit = lv_unit;
        lv_ownerofShieldedUnit = UnitGetOwner(lv_shieldedUnit);

mods/heromods/medivh.stormmodbase.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.stormmodbase.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.stormmodbase.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.stormmodbase.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.sc2modbase.sc2data/LibCOMI.galaxy:14651


    DialogControlHookupUnitStatus(c_triggerControlTypeImage, "HeroUnitBackgroundImage", lv_loneWolfUnit);
    if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
        DialogControlSetAnimationState(DialogControlLastCreated(), PlayerGroupAll(), "PrestigeLoneWolf", "On");
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:26920

    }

    if ((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate)) {
        lv_event = "ZeratulEvent_VisionReady";
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:28620

        }

        if (!(((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate) || (EventUnitBehaviorChange() == c_unitBehaviorChangeDeactivate)))) {
            return false;
        }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOMI.galaxy:28620

        }

        if (!(((EventUnitBehaviorChange() == c_unitBehaviorChangeActivate) || (EventUnitBehaviorChange() == c_unitBehaviorChangeDeactivate)))) {
            return false;
        }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOOC.galaxy:6613

    }

    if ((EventUnitBehaviorChange() == c_unitBehaviorChangeCreate)) {
        UnitGroupAdd(libCOOC_gv_cC_ScoreVorazunBHGroup, EventUnit());
    }

mods/starcoop/starcoop.sc2modbase.sc2data/LibCOOC.galaxy:6616

        UnitGroupAdd(libCOOC_gv_cC_ScoreVorazunBHGroup, EventUnit());
    }
    else if ((EventUnitBehaviorChange() == c_unitBehaviorChangeDestroy)) {
        UnitGroupRemove(libCOOC_gv_cC_ScoreVorazunBHGroup, EventUnit());
    }