Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Refresh Ability

Events


Unit - A unit Starts the effect of an ability

Conditions

Actions


Wait 0.00 seconds


Set Ability = (Ability being cast)


Set AbilityLevel = (Level of Ability for (Triggering unit))


Unit - Remove Ability from (Triggering unit)


Unit - Add Ability to (Triggering unit)


Unit - Set level of Ability for (Triggering unit) to AbilityLevel
function ResetCooldown takes unit whichUnit,integer whichAbility returns nothing
local integer level=GetUnitAbilityLevel(whichUnit,whichAbility)
if level>0 then
call UnitRemoveAbility(whichUnit,whichAbility)
call UnitAddAbility(whichUnit,whichAbility)
call SetUnitAbilityLevel(whichUnit,whichAbility,level)
endif
endfunction
Custom script: call ResetCooldown(GetTriggerUnit(),GetSpellAbilityId())
Custom script: call ResetCooldown(udg_MyGlobalVariable,udg_MyAbility)
Custom script: call ResetCooldown(udg_MyGlobalUnit,'A000')
defskull, have you tested that? Removing the wait should not bug it, as removing an ability after casting it is common practice for dummy abilities.
You sure JASS has function like that ? 'ResetCooldown' ?Custom script: call ResetCooldown(GetTriggerUnit(),GetSpellAbilityId())
Custom script: call ResetCooldown(udg_MyGlobalVariable,udg_MyAbility)
Custom script: call ResetCooldown(udg_MyGlobalUnit,'A000')
Melee Initialization

Events


Unit - A unit Starts the effect of an ability

Conditions

Actions


Custom script: set udg_AbilityID = GetSpellAbilityId()


Custom script: call ResetCooldown(GetTriggerUnit(), udg_AbilityID)
You have to self-adjust the event to "A unit Finishes casting an ability" if the spell such as Flame Strike (requires a cast delay time)
