View Single Post
01-06-11, 01:34 PM   #3
Cidan
A Cliff Giant
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 72
On number 3: I have actually made it possible to display cooldown timers through some custom scripting, however this will eventually not be needed as we flesh out cooldowns. Look at the following screenshot:



This is done by creating a custom variable inside of the design (Vars Scripted), and setting the variable to "TimerVar", at which point several features are exposed. I set the name of the Vars Scripted object to "spell" and used the following code:


Code:
local s, d = GetSpellCooldown("Holy Shock");

local spell_start = s;
local spell_duration = d;
local spell_timeleft = s + d - GetTime();
local spell_text = "Holy Shock ready in ";
local spell_bool = false;
if d <= 0 then
  spell_timeleft = 0;
  spell_text = "Holy Shock ready!";
  spell_bool = true;
end
Everything that begins with "spell" here MUST match what you name the Vars Scripted, so if you name the variable "123", the lines that say spell_start, etc, must be 123_start, etc. This does matter!

After this is done, you now have all the variables needed to use a text/bar/timer shader object like you would for casting bars, only it's for the cooldown of the spell in the script above. Eventually this will be a full feature on it's own down the line where you just pick a spell from a dropdown or some such.
  Reply With Quote