• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

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