- Joined
- Feb 27, 2019
- Messages
- 404
Hello,
I read that with patch 1.31 normally all "natives" are now 0-indexed. However I have the following trigger that seems to proove it wrong.
The trigger is done to reduce all cooldowns by 20% when a unit carries an given item (In short, everytime a spell is cast, I compare the ability CD, the unit ability CD and the presence of the item, and reduce or restore the unit ability CD if numbers don't match).
When I test it, it seems to reduce the cooldown of the level+1 of the ability... That was unexpected!
Translated in JASS, it seems that:
- function GetUnitAbilityLevelSwapped: ability level is 1-indexed.
- functions BlzGetAbilityCooldown, BlzGetUnitAbilityCooldown, BlzSetUnitAbilityCooldown: ability level is 0-indexed.
Is it normal ?
Does "Natives" only mean "Blz..." functions ?
Or did I miss something in patch 1.31 update & bug logs ?
I read that with patch 1.31 normally all "natives" are now 0-indexed. However I have the following trigger that seems to proove it wrong.
The trigger is done to reduce all cooldowns by 20% when a unit carries an given item (In short, everytime a spell is cast, I compare the ability CD, the unit ability CD and the presence of the item, and reduce or restore the unit ability CD if numbers don't match).
When I test it, it seems to reduce the cooldown of the level+1 of the ability... That was unexpected!
Translated in JASS, it seems that:
- function GetUnitAbilityLevelSwapped: ability level is 1-indexed.
- functions BlzGetAbilityCooldown, BlzGetUnitAbilityCooldown, BlzSetUnitAbilityCooldown: ability level is 0-indexed.
Is it normal ?
Does "Natives" only mean "Blz..." functions ?
Or did I miss something in patch 1.31 update & bug logs ?
-
CooldownsReduction
-

Events
-


Unit - A unit Starts the effect of an ability
-
-

Conditions
-


((Triggering unit) is A Hero) Equal to True
-
-

Actions
-


-------- Upon each cast, we check if cooldown should be reduced or restored --------
-


Set GlobalTempAbilityCode = (Ability being cast)
-


Set GlobalTempInteger = (Level of GlobalTempAbilityCode for (Triggering unit))
-


Set GlobalTempReal = (Cooldown of GlobalTempAbilityCode, Level: GlobalTempInteger)
-


Set GlobalTempReal1 = (Ability Cooldown of (Triggering unit) for ability GlobalTempAbilityCode, Level: GlobalTempInteger)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




(Item carried by (Triggering unit) of type Gloves of Spell Mastery) Not equal to No item
-
-



Then - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






GlobalTempReal Equal to GlobalTempReal1
-
-





Then - Actions
-






-------- Reduce cooldown of 20% --------
-






Game - Display to (All players) the text: Reduce
-






Unit - For Unit (Triggering unit), Set cooldown of ability GlobalTempAbilityCode, Level: GlobalTempInteger to (0.80 x GlobalTempReal)
-
-





Else - Actions
-
-
-



Else - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






GlobalTempReal Greater than GlobalTempReal1
-
-





Then - Actions
-






-------- Restore normal cooldown --------
-






Game - Display to (All players) the text: Restore
-






Unit - For Unit (Triggering unit), Set cooldown of ability GlobalTempAbilityCode, Level: GlobalTempInteger to GlobalTempReal
-
-





Else - Actions
-
-
-
-
-
