• 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.

[General] Start ability CD for multiple items

Level 3
Joined
Jul 5, 2024
Messages
13
The hero carries multiple different items but all have the same ability. I am replacing the hero and then would like to start the CD of some of the items that the hero carries:

Unit - For Unit (Last replaced unit), start cooldown of ability Foo " over "(Ability Cooldown Remaining of (Triggering unit) for ability Foo ..) seconds.

This will only reset the cooldown of the item that has the highest slot number in the inventory. This seems like a limitation of GUI but maybe I am missing something. There are some hack workarounds that come to my mind, like dropping all items and adding them back one by one, reseting the CD for each individually but maybe there is a more elegant solution?

I am not familar with JASS so maybe with a custom script this could be solved?

Thanks in advance
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
I think the hack is the only thing you can really do. It's not a limitation of GUI, but one of the many limitations that comes with stacking multiple abilities of the same type.
  • Actions
    • Trigger - Turn off (any item event triggers that you don't want to run)
    • For each integer (X) from 1 to 6 do Actions
      • Loop - Actions
        • Unit - Start cooldown of YourAbility for YourHero
        • Set Variable Item[X] = (Item carried by YourHero in slot X)
        • Hero - Drop Item[X] from YourHero
    • For each integer (X) from 1 to 6 do Actions
      • Loop - Actions
        • Hero - Give Item[X] to YourHero
    • Trigger - Turn on (any item event triggers that you turned off)
Situations like these are why having an efficient and elegant design for your triggers, such as a single "A unit Acquires an Item" Event that handles everything item related, prove to be so useful. I imagine you may have a lot of triggers that need to be Turned Off/On.
 
Last edited:
Top