Mercurial > wow > skeencore3beastmasteryhunter
comparison SkeenCoreLib.lua @ 3:629e6e84fd18 v1.2.0
Ready 4 multi lang
| author | Emil Madsen <skeen@cs.au.dk> |
|---|---|
| date | Fri, 08 Jul 2011 00:02:44 +0200 |
| parents | 4dbfbe163c49 |
| children |
comparison
equal
deleted
inserted
replaced
| 2:1350c4dc9631 | 3:629e6e84fd18 |
|---|---|
| 1 function GetDebuffDuration(name) | 1 function GetDebuffDuration(id) |
| 2 local name, rank, icon, count, debuffType, duration, expirationTime, isMine, isStealable = UnitDebuff("target", name) | 2 local spell_name = GetSpellInfo(id) |
| 3 local name, rank, icon, count, debuffType, duration, expirationTime, isMine, isStealable = UnitDebuff("target", spell_name) | |
| 3 | 4 |
| 4 if name ~= nil and isMine == "player" then | 5 if name ~= nil and isMine == "player" then |
| 5 return (expirationTime - GetTime()) | 6 return (expirationTime - GetTime()) |
| 6 else | 7 else |
| 7 return 0 | 8 return 0 |
| 8 end | 9 end |
| 9 end | 10 end |
| 10 | 11 |
| 11 function GetBuffDuration(name) | 12 function GetBuffDuration(id) |
| 12 local name, rank, icon, count, debuffType, duration, expirationTime, isMine, isStealable = UnitBuff("player", name) | 13 local spell_name = GetSpellInfo(id) |
| 14 local name, rank, icon, count, debuffType, duration, expirationTime, isMine, isStealable = UnitBuff("player", spell_name) | |
| 13 | 15 |
| 14 if name ~= nil then | 16 if name ~= nil then |
| 15 return (expirationTime - GetTime()) | 17 return (expirationTime - GetTime()) |
| 16 else | 18 else |
| 17 return 0 | 19 return 0 |
| 18 end | 20 end |
| 19 end | 21 end |
| 20 | 22 |
| 21 function GetCooldown(name) | 23 function GetCooldown(id) |
| 22 local start, duration, enabled = GetSpellCooldown(name); | 24 local start, duration, enabled = GetSpellCooldown(id); |
| 23 if duration ~= nil then | 25 if duration ~= nil then |
| 24 return (duration + start - GetTime()) | 26 return (duration + start - GetTime()) |
| 25 else | 27 else |
| 26 return 60 | 28 return 60 |
| 27 end | 29 end |
