# Weapon Speed Multiplier
Grammar — Speed Multiplier of unit weapon index
Flags —Native
|Function
# Arguments
unit
— Unitint
— Index
Returns — fixed
native fixed UnitWeaponSpeedMultiplier(
unit inUnit,
int inIndex,
);
# Related
Category: Unit / Weapons
- Remove Weapon From Unit —
void
— UnitWeaponRemove - Add Weapon To Unit —
void
— UnitWeaponAdd - Number Of Weapons On Unit —
int
— UnitWeaponCount - Unit Weapon —
string
<gamelink::Weapon> — UnitWeaponGet - Weapon Is Enabled —
bool
— UnitWeaponIsEnabled - Weapon Target Check —
bool
— UnitWeaponCheck - Weapon Cooldown —
fixed
— UnitWeaponPeriod - Weapon Range —
fixed
— UnitWeaponRange - Weapon Cooldown Remaining —
fixed
— UnitWeaponPeriodRemaining - Add Ammo To Magazine —
void
— UnitMagazineArm - Last Created Magazine Ammo Unit —
unit
— UnitMagazineLastCreated - Last Created Magazine Ammo Units —
unitgroup
— UnitMagazineLastCreatedGroup - Magazine Count Of Unit —
int
— UnitMagazineCount - Magazine Owner Of Unit —
unit
— UnitGetMagazine - Unit Can Attack Unit Old —
bool
— libNtve_gf_UnitCanAttackUnit - Unit Can Attack Unit Type —
bool
— UnitCanAttackTarget - Unit In Range And Able To Attack Target —
bool
— UnitInRangeAndAbleToAttackTarget - Weapon Damage —
fixed
— UnitWeaponDamage - Weapon Speed Multiplier —
fixed
— UnitWeaponSpeedMultiplier - Set Weapon Cooldown Remaining —
void
— UnitWeaponSetPeriodRemaining
# Examples
mods/heroesdata.stormmod — base.stormdata/TriggerLibs/HeroesLib.galaxy:2561
for ( ; ( (auto3CC89007_ai >= 0 && lv_itWeapon <= auto3CC89007_ae) || (auto3CC89007_ai < 0 && lv_itWeapon >= auto3CC89007_ae) ) ; lv_itWeapon += auto3CC89007_ai ) {
if ((UnitWeaponGet(lp_unit, lv_itWeapon) != null) && (UnitWeaponIsEnabled(lp_unit, lv_itWeapon) == true)) {
return UnitWeaponSpeedMultiplier(lp_unit, lv_itWeapon);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:13855
if ((UnitAbilityExists(lv_unit, "BroodLordHangar") == true)) {
libCOMI_gf_SetUnitBuffMultiplier(lv_unit, (1.0 / UnitWeaponSpeedMultiplier(lv_unit, 1)), "TriggerQueueableRate", 1.01, libCOMI_ge_UnitBuffMultiplierMethod_Exponential);
}
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15746
lv_cooldown = UnitWeaponPeriod(EventPlayerEffectUsedUnit(c_effectUnitCaster), 1);
lv_multiplier = UnitWeaponSpeedMultiplier(EventPlayerEffectUsedUnit(c_effectUnitCaster), 1);
UnitAbilityReset(EventPlayerEffectUsedUnit(c_effectUnitCaster), AbilityCommand("LocustLaunch", 0), c_spendLocationUnit);
UnitModifyCooldown(EventPlayerEffectUsedUnit(c_effectUnitCaster), "Abil/LocustLaunch", ((lv_cooldown * lv_multiplier) / 16.0), c_cooldownOperationSet);
mods/starcoop/starcoop.sc2mod — base.sc2data/LibCOMI.galaxy:15787
lv_cooldown = UnitAbilityGetCooldown(lv_unit, "RavagerAbathurCorrosiveBile", "Abil/RavagerAbathurCorrosiveBile");
lv_multiplier = UnitWeaponSpeedMultiplier(lv_unit, 1);
UnitAbilityReset(lv_unit, AbilityCommand("RavagerAbathurCorrosiveBile", 0), c_spendLocationAll);
UnitAbilityAddCooldown(lv_unit, "RavagerAbathurCorrosiveBile", "Abil/RavagerAbathurCorrosiveBile", (lv_cooldown*lv_multiplier));