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

Spell Cooldown problem

Status
Not open for further replies.
Level 11
Joined
Jul 28, 2007
Messages
920
Does anyone know how can i set some variable to 1, when unit is casting ability, and then after few seconds set it again to 0,
or is there any way to detect when cooldown of some spell is done ?

This doesnt works.

When unit casts ability
set (variable),player number of casting unit, to 1
wait 10 sec (time until specific spell gets cooldowned)
set (variable),player number of casting unit, to 0
 
Level 14
Joined
Jul 1, 2008
Messages
1,314
U need local variables for that, because Casting Unit is an Event-reaction wich probally doesnt match after 10 seconds.

Try this, im using a bolean_variable_array, but u can use your integer_array exactly in the same way ;)
  • Spell
    • Events
      • Unit - A unit Beginns casting an ability
    • Conditions
    • Actions
      • Custom script: local unit u=GetSpellAbilityUnit()
      • Custom script: set udg_Bolean[GetPlayerId(GetOwningPlayer(u))+1]=true
      • Wait 10.00 seconds
      • Custom script: set udg_Bolean[GetPlayerId(GetOwningPlayer(u))+1]=false
Many Custom Scripts ;), but like this it will work. I thought u might want boleans as your using 0 and 1 like true and false ;)

Greets Emm-A-
 
Status
Not open for further replies.
Top