Is there anyway to check an ability is cooldown or not ?
I need to make an auto-cast system that will do this thing :
Example i have an hero with 4 ability
-Ability A don't have cooldown.
-Ability B have 1 second cooldown.
-Ability C have 5 second cooldown.
-Ability D have 20 second cooldown.
Then when a hero attack,he will use ability which have the biggest cooldown that isn't in cooldown time instead of normal attack.
Example the hero have 0.5s cooldown between each attack(0,5s each attack)
0s : He use ability D
0.5s later : Ability D is in cooldown,He use ability C
1s later : Ability D + C is in cooldown,He use ability B
1.5s later : Ability D + C +B is in cooldown,He use ability A
2s later: Ability D+C is in cooldown,Ability B is finish cooldown,He use ability B
2.5s later : Ability D + C +B is in cooldown,He use ability A
...
5s later : He use ability B
5.5s later : Ability C is finish cooldown,He use ability C
...
20s later : Ability D is finish cooldown,he use ability D
Sorry if i don't describle my idea clearly,but i wish u could understand it.So are there anyway to do this?
(I can use 4 timer to set 4 field in hashtable of the hero for each skill,but i want to find an easier way)
I need to make an auto-cast system that will do this thing :
Example i have an hero with 4 ability
-Ability A don't have cooldown.
-Ability B have 1 second cooldown.
-Ability C have 5 second cooldown.
-Ability D have 20 second cooldown.
Then when a hero attack,he will use ability which have the biggest cooldown that isn't in cooldown time instead of normal attack.
Example the hero have 0.5s cooldown between each attack(0,5s each attack)
0s : He use ability D
0.5s later : Ability D is in cooldown,He use ability C
1s later : Ability D + C is in cooldown,He use ability B
1.5s later : Ability D + C +B is in cooldown,He use ability A
2s later: Ability D+C is in cooldown,Ability B is finish cooldown,He use ability B
2.5s later : Ability D + C +B is in cooldown,He use ability A
...
5s later : He use ability B
5.5s later : Ability C is finish cooldown,He use ability C
...
20s later : Ability D is finish cooldown,he use ability D
Sorry if i don't describle my idea clearly,but i wish u could understand it.So are there anyway to do this?
(I can use 4 timer to set 4 field in hashtable of the hero for each skill,but i want to find an easier way)