Cass
New Member
- Joined
- Jan 24, 2014
- Messages
- 98
Hello everybody
I was trying to use the function GetSpellCooldown contained on spell.cs but it wasnt possible to compile.
As per sugestion of Ama on other thread i included
on the beginning of the file and the function started to work as intended.
Then i realized the the function returns the total cooldown of a spell and not the current cooldown.
Im trying to create a new function so that it could be used as conditional to deal with some CGD issues on my rotation.
So far none of my trys worked since i have almost no programming experience.
Could someone help me with the logic of the code below?
Thanks a lot for any help
I was trying to use the function GetSpellCooldown contained on spell.cs but it wasnt possible to compile.
As per sugestion of Ama on other thread i included
PHP:
using Buddy.Swtor.Objects;
on the beginning of the file and the function started to work as intended.
Then i realized the the function returns the total cooldown of a spell and not the current cooldown.
Im trying to create a new function so that it could be used as conditional to deal with some CGD issues on my rotation.
So far none of my trys worked since i have almost no programming experience.
Could someone help me with the logic of the code below?
PHP:
public static float GetCCD(string spell)
{
float time = 0;
var v = AbilityManager.KnownAbilities.FirstOrDefault(a => a.Name.Contains(spell)).CooldownTime;
time += v;
float ccd;
if ( AbilityManager.CanCast(spell, onUnit(ret)))
{
ccd = 0;
}
if ( !AbilityManager.CanCast(spell, onUnit(ret)))
{
ccd = time;
}
ccd -= Time.Time;
Logger.Write(">> CD << " + ccd);
return ccd;
}
Thanks a lot for any help
