• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Spellbook ability cooldown

Status
Not open for further replies.
Level 2
Joined
Dec 15, 2017
Messages
12
Hello guys, this is what I'm trying to achieve:

I have a spellbook. In this spellbook there are 3 abilities. Each of them has a cost in gold, in order to be cast.

If I have enough gold, it goes in cooldown as soon as i click it.

If i don't have enough gold it should say:"Not enough gold!"; while not going in cooldown.

How do i do this?
 
Level 11
Joined
Oct 16, 2013
Messages
246
You might want to put three dummy skills (preferably based on Channel spell) in your spellbook and make a single dummy unit which casts the 'real' skills to do so.

If gold condition is met = gold subtraction, create dummy, order it to cast the corresponding spell and remove it.
If not = remove and add the spell book from the unit refreshing its cooldown and show 'Not enough gold!' text message.
 
Level 2
Joined
Dec 15, 2017
Messages
12
If not = remove and add the spell book from the unit refreshing its cooldown and show 'Not enough gold!' text message.

But if I remove and add the spellbook I think other spells that are already in cooldown will get refreshed as well.
 
Status
Not open for further replies.
Top