# Set Unit Behavior Duration

Grammar — Set behavior duration to duration on unit unit
FlagsNative | Action

Sets a behavior duration on a unit.

# Arguments

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

Returns — void

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

Category: Behavior / Basic

# Examples

# campaigns/liberty.sc2campaign

MapScript.galaxy

// L1296
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1396
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1506
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1620
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1727
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1710
UnitBehaviorSetDuration(lv_harvestingSCV, "ProgressBar", 60)
// L1714
UnitBehaviorSetDuration(lv_harvestingSCV, "ProgressBar", 10)
// L2520
UnitBehaviorSetDuration(gv_uNIT_KERRIGAN, "ProgressBar", FixedToInt(TimerGetRemaining(gv_kerriganSearchTimer)))
// L1296
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1396
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1506
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1620
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1727
UnitBehaviorSetDuration(gv_purifier, "ProgressBar", FixedToInt(TimerGetRemaining(gv_poweringUpTime)))
// L1710
UnitBehaviorSetDuration(lv_harvestingSCV, "ProgressBar", 60)
// L1714
UnitBehaviorSetDuration(lv_harvestingSCV, "ProgressBar", 10)
// L2520
UnitBehaviorSetDuration(gv_uNIT_KERRIGAN, "ProgressBar", FixedToInt(TimerGetRemaining(gv_kerriganSearchTimer)))
// L506
UnitBehaviorSetDuration(lp_eggToCorrupt, "TerrazineCountdownDummyBar", FixedToInt(gv_zagaraEggCorruptionTime))
// L506
UnitBehaviorSetDuration(lp_eggToCorrupt, "TerrazineCountdownDummyBar", FixedToInt(gv_zagaraEggCorruptionTime))

# campaigns/voidstory.sc2campaign

VoidCampaignMissionLib.galaxy

// L4649
UnitBehaviorSetDuration(libVCMI_gv_pM_SoATargetingUnit[libVCMI_gv_pM_SoATargetingChargesSpent], "SOAThermalLanceStun", (0.125 * libVCMI_gv_pM_SoATargetingChargesSpent))

# mods/heroes.stormmod

MapScript.galaxy

// L1618
UnitBehaviorSetDuration(lv_itUnit, "RavenLordsCurseStructures", libMapM_gv_mMRavenCurseDuration_C)
// L1620
UnitBehaviorSetDuration(lv_itUnit, "RavenLordsCurseStructuresWarning", (libMapM_gv_mMRavenCurseDuration_C - 5.0))
// L9917
UnitBehaviorSetDuration(gv__2C_UltimateEvolutionClone, "UltimateEvolutionTimedLife", 60.0)
// L1618
UnitBehaviorSetDuration(lv_itUnit, "RavenLordsCurseStructures", libMapM_gv_mMRavenCurseDuration_C)
// L1620
UnitBehaviorSetDuration(lv_itUnit, "RavenLordsCurseStructuresWarning", (libMapM_gv_mMRavenCurseDuration_C - 5.0))
// L9917
UnitBehaviorSetDuration(gv__2C_UltimateEvolutionClone, "UltimateEvolutionTimedLife", 60.0)

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

LibPEB1.galaxy

// L9999
UnitBehaviorSetDuration(lv_heroUnit, "TyraelArchangelsWrathDeathActiveBuff", 99.0)
// L10004
UnitBehaviorSetDuration(lv_heroUnit, "SpiritOfRedemptionSpiritFormBuff", 99.0)

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

LibPVEB.galaxy

// L2119
UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration)
// L2129
UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration)
// L2140
UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration)
// L2149
UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration)
// L2158
UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration)
// L2170
UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration)
// L2185
UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration)
// L2193
UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration)
// L2221
UnitBehaviorSetDuration(libPVEB_gv_pvEResurrectSpirit[lv_deadPlayer], "PVEResurrectRezzable", lv_resurrectTimerDuration)

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

LibPVEM.galaxy

// L1717
UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration)
// L1727
UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration)
// L1738
UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration)
// L1747
UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration)
// L1756
UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration)
// L1768
UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration)
// L1783
UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration)
// L1791
UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration)
// L1819
UnitBehaviorSetDuration(libPVEM_gv_pvEResurrectSpirit[lv_deadPlayer], "DeadHeroResurrectRezzable", lv_resurrectTimerDuration)

# mods/heroesbrawlmods/brawlmapmods/lunarfestival.stormmod

LibLNYF.galaxy

// L1409
UnitBehaviorSetDuration(EventUnit(), "LunarFestivalLunarBlessing", 10.0)
// L1412
UnitBehaviorSetDuration(EventUnit(), "LunarFestivalLunarBlessing", 8.0)

# mods/heroesbrawlmods/brawlmapmods/onelane/industrialdistrict.stormmod

LibINDD.galaxy

// L51
UnitBehaviorSetDuration(lv_generator, "GenerateRegenGlobe", libINDD_gv_regenGlobeCoolupTime_C)

# mods/heroesbrawlmods/brawlmapmods/onelane/onelanemapshared.stormmod

LibOLMS.galaxy

// L73
UnitBehaviorSetDuration(auto37472270_var, "GenerateRegenGlobe", libOLMS_gv_mMHO_RegenGlobeCoolupTime_C)
// L131
UnitBehaviorSetDuration(auto324920CE_var, "GenerateRegenGlobe", libOLMS_gv_mMHO_RegenGlobeCoolupTime_C)

# mods/heroesdata.stormmod

GameDataHelperLib.galaxy

// L7680
UnitBehaviorSetDuration(lv_target, "ButchersBrand", (lv_currentAmount + lv_increaseAmount))
// L11517
UnitBehaviorSetDuration(lv_stunnedUnit, "L90ETCMoshPitDisplayBehavior", UnitBehaviorDurationTotal(lv_eTC, "L90ETCMoshPitChannel"))
// L11525
UnitBehaviorSetDuration(lv_stunnedUnit, "L90ETCMoshPitDisplayBehavior", UnitBehaviorDurationTotal(lv_eTC, "L90ETCMoshPitChannel"))
// L12263
UnitBehaviorSetDuration(lv_leoric, "LeoricUndying", TimerGetRemaining(libGame_gv_players[lv_leoricPlayer].lv_respawnTimer))
// L12264
UnitBehaviorSetDuration(lv_leoric, "Dead", TimerGetRemaining(libGame_gv_players[lv_leoricPlayer].lv_respawnTimer))
// L12268
UnitBehaviorSetDuration(lv_leoric, "LeoricUndying", 0.0)
// L12269
UnitBehaviorSetDuration(lv_leoric, "Dead", 0.0)
// L13306
UnitBehaviorSetDuration(lv_deadUnit, "Dead", TimerGetRemaining(lv_vikingDeathTimer))
// L13309
UnitBehaviorSetDuration(lv_deadUnit, "Dead", 0.0)
// L24383
UnitBehaviorSetDuration(EventPlayerEffectUsedUnit(c_effectUnitCaster), "RavenousSoulsChannel", lv_ravenousSpiritDuration)

# mods/heroesdata.stormmod

GameLib.galaxy

// L6741
UnitBehaviorSetDuration(lv_heroUnit, "Dead", TimerGetRemaining(libGame_gv_players[lp_player].lv_respawnTimer))
// L6744
UnitBehaviorSetDuration(lv_heroUnit, "Dead", 0.0)
// L6797
UnitBehaviorSetDuration(libGame_gv_players[lp_respawningPlayer].lv_heroUnit, "Dead", lp_newRespawnTimerDuration)

# mods/heroesdata.stormmod

MapMechanicsLib.galaxy

// L3145
UnitBehaviorSetDuration(lv_structureUnit, "RavenLordsCurseStructures", libMapM_gv_mMRavenCurseDuration_C)
// L3147
UnitBehaviorSetDuration(lv_structureUnit, "RavenLordsCurseStructuresWarning", (libMapM_gv_mMRavenCurseDuration_C - 5.0))
// L6219
UnitBehaviorSetDuration(UnitLastCreated(), "MapMechanicCoolUp", (libMapM_gv_mMRavenSpawnWarningTimerTime_C+.5))
// L7476
UnitBehaviorSetDuration(libMapM_gv_mMGardensDragonStatue, "VehicleDragonTimedLife", lv_duration)
// L7840
UnitBehaviorSetDuration(libMapM_gv_mMGardensDragonStatue, "VehicleDragonTimedLife", -1.0)

# mods/heroesmapmods/battlegroundmapmods/braxisholdout.stormmod

LibSCHO.galaxy

// L2570
UnitBehaviorSetDuration(auto126029DC_var, "GenerateRegenGlobe", libSCHO_gv_mMHO_RegenGlobeCoolupTime_C)

# mods/heroesmapmods/battlegroundmapmods/volskayadata.stormmod

LibVolV.galaxy

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

# mods/heromods/auriel.stormmod

LibHAUR.galaxy

// L1014
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))
// L1029
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][1].lv_spiritUnit, "AurielResurrectRezzable", (TimerGetDuration(libGDHL_gv_lostVikingsPlayer[lv_deadPlayer].lv_baleogDeathTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))
// L1044
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))
// L1057
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))
// L1070
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectLostVikingsArray[lv_deadPlayer][2].lv_spiritUnit, "AurielResurrectRezzable", (TimerGetDuration(libGDHL_gv_lostVikingsPlayer[lv_deadPlayer].lv_erikDeathTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))
// L1086
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))
// L1094
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))
// L1105
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))
// L1118
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))
// L1138
UnitBehaviorSetDuration(libHAUR_gv_heroAurielResurrectSpirit[lv_deadPlayer], "AurielResurrectRezzable", (TimerGetDuration(libGame_gv_players[lv_deadPlayer].lv_respawnTimer) - libHAUR_gv_heroAurielResurrectTargetUnresurrectableTime))

# mods/heromods/chogall.stormmod

LibHCHO.galaxy

// L207
UnitBehaviorSetDuration(libGDHL_gv_chogallPairs[lv_choGallPairsTeamID].lv_gallUnit, "GallRunicBlastOrbActive", lv_timeToImpact)

# mods/heromods/guldan.stormmod

LibHGUL.galaxy

// L386
UnitBehaviorSetDuration(lv_deadUnit, "GuldanDarkBargainDuration", 15.0)
// L448
UnitBehaviorSetDuration(lv_deadUnit, "Dead", UnitBehaviorDuration(lv_deadUnit, "Dead"))

# mods/heromods/thefirelords.stormmod

LibHMaj.galaxy

// L332
UnitBehaviorSetDuration(lv_bigRagnarosUnit, "RagnarosMoltenCoreDuration", ((UnitGetPropertyFixed(EventUnit(), c_unitPropLifeMax, c_unitPropCurrent) / AbsF(UnitGetPropertyFixed(EventUnit(), c_unitPropLifeRegen, c_unitPropCurrent)))))

# mods/heromods/zarya.stormmod

LibHZAR.galaxy

// L501
UnitBehaviorSetDuration(lv_stunnedUnit, "ZaryaGravitonSurgeTargetDuration", lv_duration)
// L503
UnitBehaviorSetDuration(lv_stunnedUnit, "ZaryaGravitonSurgePull", lv_duration)
// L505
UnitBehaviorSetDuration(lv_stunnedUnit, "ZaryaGravitonSurgePullInitial", lv_duration)
// L507
UnitBehaviorSetDuration(lv_stunnedUnit, "ZaryaGravitonSurgeGravityKillsTalentSilence", lv_duration)
// L543
UnitBehaviorSetDuration(lv_stunnedUnit, "ZaryaGravitonSurgeGravityKillsTalentSilence", lv_duration)

# mods/heromods/zuljin.stormmod

LibHZUL.galaxy

// L711
UnitBehaviorSetDuration(lv_itUnit, "ZuljinLetTheKillingBeginStack", CatalogFieldValueGetAsInt(c_gameCatalogBehavior, "ZuljinLetTheKillingBeginStack", "Duration", EventPlayer()))

# mods/starcoop/starcoop.sc2mod

LibCOMI.galaxy

// L28597
UnitBehaviorSetDuration(EventUnit(), EventUnitBehavior(), RandomInt(1, 10))