• 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] can you set cooldown of spell with trigger?

Status
Not open for further replies.
same, can you set the cooldown of spell with trigger or some code line?

Can you elaborate a bit?
Do you want the cooldown to be set to a specific %. (fx. a spell with 10 seconds cooldown. You set it to 60% = 6 seconds left).
Or do you want to change the cooldown length generally (fx. changing the default cooldown from 10 seconds to 8 seconds permanently).
 
I would say your best bet would be. making the cooldown for all skills 200 seconds or what ever you want the longest set to then.

When unit casts a skill equal to X

Set cooldown for ability x for unit y to z

As far as I know you can't set a cooldown to a specific time.
But you can create several of the same ability with different cooldown.
 
Level 2
Joined
Jun 1, 2014
Messages
18
Here's what you CAN do to set the cooldowns (lengthy way though):

Removing an ability and adding it back again such as
  • TestLanterns
    • Events
      • Player - Player 1 (Red) types a chat message containing a as An exact match
    • Conditions
    • Actions
      • Unit - Remove Grand Shatter from DummyCryomancer 0080 <gen>
      • Unit - Add Grand Shatter to DummyCryomancer 0080 <gen>
makes it reset its cooldown.

You could make a system all by yourself that detects when you want to remove the cooldown of the ability.

For example:

Create a hashtable
Create a real variable (cooldown reduction)
Set and save your variable to the units you want to reduce the cooldown of when needed. (ex: unit gains one level, set cooldown reduction to cooldown reduction + 1, save cooldown reduction as 1 of key Triggering unit in Cooldown Hashtable, this way ever time your hero gains a level he gains 1% cooldown reduction, just an example)
When units start casting abilities, youll have to create
1) a variable that you loop, checking for how much time has passed since the start of the ability (you will need to make a separate variable for each ability to differentiate them, or find other ways to better define the identity of your individual spells using less variables)
2) another variable to check the total cooldown of your spell, and therefore be able to manipulate current cooldown (our first variable) based on total cooldown (this variable right here).

In the example i am using right here, we would then load the value of our cooldown reduction var on every loop, and check If current_cd greater or equal to Total_cd * (1 - (0.01 * Cooldown_reduction)), then remove xx_ability from picked unit, add xx_ability to picked unit, remove picked unit from xx_ability_cooldown group.

I apologize if I was somewhat unclear, but this IS a VERY roundabout way of achieving what you're trying to do (im not even sure based on what you want to modify the cooldowns of your abilities). Also, with this method, the player will still see the cooldown visually on the icon as based on the base cooldown of the ability, until it simply pops from almost cooled to ready (not sure how to word this better).

Hope this gives you some sort of direction.
 
Status
Not open for further replies.
Top