# Set Unit Behavior Duration Remaining

Grammar — Set behavior remaining duration to durationRemaining|Duration on unit unit
FlagsNative | Action

Sets a behavior remaining duration on a unit.

# Arguments

  • unit — Unit
  • string [ gamelink::Behavior ] — Behavior
  • fixed — Duration Remaining

Returns — void

native void UnitBehaviorSetDurationRemaining(
	unit inUnit,
	string inBehavior,
	fixed inDuration,
);

Category: Behavior / Basic

# Examples

# campaigns/swarm.sc2campaign

MapScript.galaxy

// L4355
UnitBehaviorSetDurationRemaining(UnitFromId(8), "QueenSpawnLarvaTimer", 0.5)
// L4357
UnitBehaviorSetDurationRemaining(UnitFromId(157), "QueenSpawnLarvaTimer", 0.5)
// L4355
UnitBehaviorSetDurationRemaining(UnitFromId(8), "QueenSpawnLarvaTimer", 0.5)
// L4357
UnitBehaviorSetDurationRemaining(UnitFromId(157), "QueenSpawnLarvaTimer", 0.5)

# mods/heroesbrawlmods/arenamodemods/punisherarena.stormmod

LibAMPU.galaxy

// L2002
UnitBehaviorSetDurationRemaining(libAMPU_gv_aRMPunisherPunishers[lv_itTeam].lv_unit, "MercPunisherLanerFixate", TimerGetRemaining(libAMPU_gv_aRMPunisherTimerEngraged))

# mods/heroesbrawlmods/brawlmapmods/coop/deadmansstand.stormmod

LibPEB1.galaxy

// L3754
UnitBehaviorSetDurationRemaining(UnitLastCreated(), "JungleMercDefenderBirthInvulnerability", (UnitBehaviorDuration(UnitLastCreated(), "JungleMercDefenderBirthInvulnerability") - lv_StaggeredBirth))
// L10000
UnitBehaviorSetDurationRemaining(lv_heroUnit, "TyraelArchangelsWrathDeathActiveBuff", 99.0)
// L10005
UnitBehaviorSetDurationRemaining(lv_heroUnit, "SpiritOfRedemptionSpiritFormBuff", 99.0)

# mods/heroesbrawlmods/brawlmapmods/coop/pvebrawlmod.stormmod

LibPVEB.galaxy

// L2478
UnitBehaviorSetDurationRemaining(libGame_gv_players[lv_targetPlayer].lv_heroUnit, "PVEResurrectIcon", lv_newBehaviorTime)

# mods/heroesbrawlmods/brawlmapmods/coop/pvemod.stormmod

LibPVEM.galaxy

// L2035
UnitBehaviorSetDurationRemaining(libGame_gv_players[lv_targetPlayer].lv_heroUnit, "DeadHeroResurrectIconBehavior", lv_newBehaviorTime)

# mods/heroesdata.stormmod

GameDataHelperLib.galaxy

// L5765
UnitBehaviorSetDurationRemaining(libGame_gv_players[lv_abathurPlayer].lv_heroUnit, "AbathurEvolveMonstrosityAbathurStack", UnitBehaviorDuration(auto7E23C28A_var, "AbathurEvolveMonstrosity"))
// L5766
UnitBehaviorSetDurationRemaining(lv_symbiote, "AbathurEvolveMonstrosityAbathurStack", UnitBehaviorDuration(auto7E23C28A_var, "AbathurEvolveMonstrosity"))
// L6258
UnitBehaviorSetDurationRemaining(lv_target, "ArtanisSpearofAdunPurifierBeamTargeting", lv_timeRemaining)
// L6259
UnitBehaviorSetDurationRemaining(lv_target, "ArtanisSpearofAdunPurifierBeamRevealer", lv_timeRemaining)
// L7405
UnitBehaviorSetDurationRemaining(lv_unit, "BarbarianWrathoftheBerserkerBase", (lv_currentDuration + (lv_regenAmount / 10.0)))
// L9431
UnitBehaviorSetDurationRemaining(lv_target, "DryadNaturesToxinVisual2", lv_timeDifferenceToNextThreshold)
// L9436
UnitBehaviorSetDurationRemaining(lv_target, "DryadNaturesToxinVisual2", 6.0)
// L9437
UnitBehaviorSetDurationRemaining(lv_target, "DryadNaturesToxinVisual3", lv_timeDifferenceToNextThreshold)
// L9442
UnitBehaviorSetDurationRemaining(lv_target, lv_triggeringPoison, 9.0)
// L9443
UnitBehaviorSetDurationRemaining(lv_target, "DryadNaturesToxinVisual3", 3.0)

# mods/heroesdata.stormmod

GameLib.galaxy

// L1482
UnitBehaviorSetDurationRemaining(lp_unit, lp_cCBehavior, lv_reducedDuration)
// L6800
UnitBehaviorSetDurationRemaining(libGame_gv_players[lp_respawningPlayer].lv_heroUnit, "Dead", lp_newRespawnTimerDuration)

# mods/heroesdata.stormmod

MapMechanicsLib.galaxy

// L1248
UnitBehaviorSetDurationRemaining(lv_newUnit, "JungleMercDefenderBirthInvulnerability", (UnitBehaviorDuration(lv_newUnit, "JungleMercDefenderBirthInvulnerability") - lv_StaggeredBirth))
// L6220
UnitBehaviorSetDurationRemaining(UnitLastCreated(), "MapMechanicCoolUp", (libMapM_gv_mMRavenSpawnWarningTimerTime_C+.5))
// L7477
UnitBehaviorSetDurationRemaining(libMapM_gv_mMGardensDragonStatue, "VehicleDragonTimedLife", lv_duration)

# mods/heroesmapmods/battlegroundmapmods/battlefieldofeternity.stormmod

LibMLBD.galaxy

// L426
UnitBehaviorSetDurationRemaining(libMLBD_gv_mMBOEBosses[lv_itTeam], "BossDuelCastingBehavior", 2.0)
// L552
UnitBehaviorSetDurationRemaining(libMLBD_gv_mMBOEBosses[lv_itTeam], "BossDuelCastingBehavior", 1.5)

# mods/heroesmapmods/battlegroundmapmods/overwatchdata.stormmod

LibOVER.galaxy

// L386
UnitBehaviorSetDurationRemaining(lv_targetUnit, "OverwatchBossImprisonedBehavior", (lv_bossEatingDuration + 0.0625))

# mods/heroesmapmods/battlegroundmapmods/volskayadata.stormmod

LibVolV.galaxy

// L176
UnitBehaviorSetDurationRemaining(libMapM_gv_vehicle[lv_pilotIndex].lv_unit_Vehicle, "VehicleDragonTimedLife", (libVolV_gv_vehicleStartingDuration+libVolV_gv_vehicleDurationIncrementAmount*TimerGetElapsed(libGame_gv_gameTimer)/60))

# mods/heromods/alarak.stormmod

LibHALA.galaxy

// L603
UnitBehaviorSetDurationRemaining(lv_newTarget, "AlarakSadismRiteofRakShirTalentDebuff", lv_behaviorDuration)

# mods/heromods/auriel.stormmod

LibHAUR.galaxy

// L1354
UnitBehaviorSetDurationRemaining(libHAUR_gv_heroAurielResurrectSpirit[lv_iPlayer], "AurielResurrectRezzable", (TimerGetRemaining(libGame_gv_players[lv_iPlayer].lv_respawnTimer) - lv_unrezzableTimeDifference))

# mods/heromods/chogall.stormmod

LibHCHO.galaxy

// L213
UnitBehaviorSetDurationRemaining(libGDHL_gv_chogallPairs[lv_choGallPairsTeamID].lv_gallUnit, "GallRunicBlastOrbActive", UnitBehaviorDuration(lv_runeBomb, "ChoRuneBombTalentRollbackTimedLife"))
// L216
UnitBehaviorSetDurationRemaining(libGDHL_gv_chogallPairs[lv_choGallPairsTeamID].lv_gallUnit, "GallRunicBlastOrbActive", lv_timeToImpact)

# mods/heromods/genji.stormmod

LibHGen.galaxy

// L557
UnitBehaviorSetDurationRemaining(lv_genjiUnit, "GenjiDragonbladeActive", lv_duration)

# mods/heromods/lucio.stormmod

LibHLUC.galaxy

// L444
UnitBehaviorSetDurationRemaining(lv_lucioUnit, "LucioReverseAmp", (UnitBehaviorDuration(lv_lucioUnit, "LucioReverseAmp") + 0.0625))

# mods/heromods/probius.stormmod

LibHPRO.galaxy

// L215
UnitBehaviorSetDurationRemaining(lv_pylon, "ProbiusPylonOverchargeWeaponBehavior", UnitBehaviorDuration(lv_probius, "ProbiusPylonOverchargeDummyUIBehavior"))

# mods/heromods/thefirelords.stormmod

LibHMaj.galaxy

// L334
UnitBehaviorSetDurationRemaining(lv_bigRagnarosUnit, "RagnarosMoltenCoreDuration", ((UnitGetPropertyFixed(EventUnit(), c_unitPropLifeMax, c_unitPropCurrent) / AbsF(UnitGetPropertyFixed(EventUnit(), c_unitPropLifeRegen, c_unitPropCurrent))) * (UnitGetPropertyFixed(lv_bigRagnarosUnit, c_unitPropLifePercent, c_unitPropCurrent) / 100)))

# mods/heromods/zarya.stormmod

LibHZAR.galaxy

// L502
UnitBehaviorSetDurationRemaining(lv_stunnedUnit, "ZaryaGravitonSurgeTargetDuration", lv_durationRemaining)
// L504
UnitBehaviorSetDurationRemaining(lv_stunnedUnit, "ZaryaGravitonSurgePull", lv_durationRemaining)
// L506
UnitBehaviorSetDurationRemaining(lv_stunnedUnit, "ZaryaGravitonSurgePullInitial", lv_durationRemaining)
// L508
UnitBehaviorSetDurationRemaining(lv_stunnedUnit, "ZaryaGravitonSurgeGravityKillsTalentSilence", lv_durationRemaining)
// L544
UnitBehaviorSetDurationRemaining(lv_stunnedUnit, "ZaryaGravitonSurgeGravityKillsTalentSilence", lv_durationRemaining)

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L5108
UnitBehaviorSetDurationRemaining(libCOMI_gv_cM_GlobalCasterUnit[lp_player], "HHBomberPlatformAreaBombTopBarDummyTimer", lv_smallestCooldown)
// L15713
UnitBehaviorSetDurationRemaining(EventPlayerEffectUsedUnit(c_effectUnitCaster), "SwarmHostEggAnimation", ((lv_cooldown * lv_multiplier) / 16.0))
// L16672
UnitBehaviorSetDurationRemaining(lv_unit, "TimeStopImmune", 5.0)
// L17295
UnitBehaviorSetDurationRemaining(libCOMI_gv_cM_HeroReviver[EventPlayer()], "DehakaNormalReviveTimer", lv_reviveTimer)