Item that refreshes

Status
Not open for further replies.
Refreshes? You mean restore level back to a previous level or something? Use the set unit level action. Create data structures of all abilities on a certain hero type and the level they should be restored to.

If you mean refresh as in cooldown the ability then this is not possible in WC3 with hero abilities. With normal abilities (not hero abilities) you can do so by removing them and adding them again (this is why it does not work on hero abilities). You may wish to migrate to SC2 where this is possible for all abilities, behaviours and even weapons.
 
Well, I have found a way refreshing everything but the "Refresher":
JASS:
scope ItemCheese initializer Init

globals
    private constant string CheeseSpellOrder = "web"
    private constant integer CheeseSpellID = 'A01K'
    private boolean justUsed = false
endglobals

private function Conditions takes nothing returns boolean
     return ( GetSpellAbilityId() == CheeseSpellID )
endfunction

private function Actions takes nothing returns nothing
    
    if (justUsed == false) then
        call UnitResetCooldown(GetTriggerUnit())
        set justUsed = true
        call IssueImmediateOrder(GetTriggerUnit(), CheeseSpellOrder)
    else
        set justUsed = false
    endif
endfunction

private function Init takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( t, Condition( function Conditions ) )
    call TriggerAddAction( t, function Actions )
    set t = null
endfunction

endscope // ItemCheese

I have tested it and it works. Hopefully there wont be anymore complications.
When I started creating this item, I thought it would be quite simple, but as it turns around, I had to do pretty much :grin:
 
Lol man trust me and just do this.:thumbs_up:

  • Refresher
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Refresher
    • Actions
      • Unit - Reset ability cooldowns for (Triggering unit)
This won't reset the "Refresher" ability cooldown.Because Blizzard is boss.
 
Status
Not open for further replies.
Back
Top