WoWInterface SVN NaturCombatTimers

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 24 to Rev 25
    Reverse comparison

Rev 24 → Rev 25

trunk/NaturCombat/addon/parser.lua
1,5 → 1,6
local addon = LibStub("NaturCombat"); -- Get our library
LibStub("LibWombat"):NewParser(addon); -- Set addon as our parser for Wombat
local CPAura = false;
----------------------------------------------------------------------------------------------------
-- START PARSING
----------------------------------------------------------------------------------------------------
66,6 → 67,10
duration = spell.duration;
end
-- TODO: Diminishing Returns
if (dstGUID == UnitGUID("target") and spell.diminish and NaturDB.Diminishing) then
addon:ApplyDiminish(spell.id, dstName, dstGUID);
duration = duration * addon.multiplier;
end
--Combo point ability?
if (spell.combo) then CPAura = true; end
local barID = dstGUID .. spell.id;
155,6 → 160,11
local spell = addon:GetSpellData(...);
if (spell and spell.duration) then
if (spell.combo) then CPAura = false; end
if (spell.diminish) then
if (addon.dims[dstGUID .. spell.id .. spell.diminish .. "DR"]) then
addon:RemoveDiminish(spell.id, dstName, dstGUID);
end
end
for k, v in pairs(addon.groups) do
addon.groups[k]:UnregisterBar(dstGUID .. spell.id);
end
251,6 → 261,9
addon:StartParsing("UNIT_DIED", function(when, what, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, ...)
if (dstGUID == UnitGUID("player")) then return; end
for k, v in pairs(addon.spelldata) do
if (v.diminish) then
addon.groups["COOLDOWNS"]:UnregisterBar(dstGUID .. k .. v.diminish .. "DR");
end
for a, b in pairs(addon.groups) do
addon.groups[a]:UnregisterBar(dstGUID..k);
addon.groups[a]:UnregisterBar(dstGUID..k.."CD");
461,4 → 474,46
if (NaturDB.Casting and unitid ~= "target" and unitid ~= "focus") then return; end
addon.groups["FRIENDLYCAST"]:UnregisterBar(UnitGUID(unitid).."Channel");
addon.groups["HOSTILECAST"]:UnregisterBar(UnitGUID(unitid).."Channel");
end);
\ No newline at end of file +end); +---------------------------------------------------------------------------------------------------- +-- APPLY DIMINISHING RETURN +---------------------------------------------------------------------------------------------------- +local expTimer = {}; +function addon:ApplyDiminish(spellID, dstName, dstGUID) + local spell = addon:GetSpellData(spellID); + local barID = dstGUID .. spell.id .. spell.diminish .. "DR"; + local time = GetTime(); + local multiplier = 100; + if (expTimer[barID] and expTimer[barID] >= time) then + multiplier = self:GetDR(addon.dims[barID]); + addon.dims[barID] = multiplier; + expTimer[barID] = GetTime() + 15; + addon.groups["COOLDOWNS"]:UnregisterBar(barID); + elseif (not expTimer[barID] or expTimer[barID] <= time) then + addon.dims[barID] = multiplier; + addon.multiplier = 1; + expTimer[barID] = GetTime() + 15; + end +end; +---------------------------------------------------------------------------------------------------- +-- REMOVE DIMINISHING RETURN +---------------------------------------------------------------------------------------------------- +function addon:RemoveDiminish(spellID, dstName, dstGUID) + local spell = addon:GetSpellData(spellID); + local barID = dstGUID .. spell.id .. spell.diminish .. "DR"; + if (addon.dims[barID]) then + local text = spell.name .. " DR ["..spell.diminish.." |cffff2020"..select(2, self:GetDR(addon.dims[barID])).."/3|r] - " .. addon:StripName(dstName); + local color = NaturDB.Colors["COOLDOWN"]; + addon.groups["COOLDOWNS"]:RegisterBar(barID, text, 15, nil, spell.icon, nil, color.r, color.g, color.b); + end + expTimer[barID] = GetTime() + 15; +end; +function addon:GetDR(dr) + if (dr == 100) then + return 50, 1, 0.5; + elseif (dr == 50) then + return 25, 2, 0.25; + elseif (dr == 25) then + return 0, "Immune! 3", 0; + end +end; \ No newline at end of file
trunk/NaturCombat/addon/spells.lua
62,10 → 62,10
spells[27009] = {duration = 45, cooldown = 60}; -- NG
spells[33763] = {duration = 7, stacks = true}; -- Lifebloom
spells[17116] = {cooldown = 180}; -- NS
spells[33786] = {duration = 6}; -- Cyclone
spells[26989] = {duration = 15, pvpdur = 10}; -- Ent. Root
spells[33786] = {duration = 6, diminish="cyclone"}; -- Cyclone
spells[26989] = {duration = 15, pvpdur = 10, diminish="root"}; -- Ent. Root
spells[27013] = {duration = 12, dot = true}; -- Ins. Swarm
spells[18658] = {duration = 40, pvpdur = 10}; -- Hiber.
spells[18658] = {duration = 40, pvpdur = 10, diminish="sleep"}; -- Hiber.
spells[26993] = {duration = 40}; -- FF
spells[17392] = {duration = 40}; -- FF (F)
spells[9898] = {duration = 30}; -- Demo. Roar
76,10 → 76,10
spells[26988] = {duration = 12, dot = true}; -- MF
spells[27008] = {duration = 12, dot = true}; -- Rip
spells[1823] = {duration = 9, dot = true}; -- Rake
spells[27006] = {duration = 4, stun = true, combo = true, talent = {2, 4, 4, 0.5, "DRUID"}}; -- Pounce
spells[27006] = {duration = 4, stun = true, combo = true, talent = {2, 4, 4, 0.5, "DRUID"}, diminish="stun"}; -- Pounce
spells[27007] = {duration = 18, dot = true}; -- Pounce bleed
spells[22570] = {duration = 7, stun = true, combo = true}; -- Maim
spells[6798] = {duration = 5, cooldown = 60, stun = true, talent = {2, 4, 5, 0.5, "DRUID"}}; -- Bash
spells[22570] = {duration = 7, stun = true, combo = true, diminish="incap"}; -- Maim
spells[6798] = {duration = 5, cooldown = 60, stun = true, talent = {2, 4, 5, 0.5, "DRUID"}, diminish="stun"}; -- Bash
-- ROGUE
spells[11305] = {duration = 15, cooldown = 300}; -- Sprint
spells[26669] = {duration = 15, cooldown = 300}; -- Evasion
89,15 → 89,15
spells[31224] = {duration = 4, cooldown = 60}; -- Cloak of Shadows
spells[36554] = {duration = 10, cooldown = 30}; -- Shadowstep
spells[26679] = {duration = 5}; -- Deadly Throw
spells[2094] = {duration = 10, cooldown = 180}; -- Blind
spells[8629] = {duration = 4, talent = {2, 1, 4, 0.5, "ROGUE"}, stun = true}; -- Gouge
spells[8643] = {duration = 6, combo = true, stun = true}; -- Kidney Shot
spells[1833] = {duration = 4, stun = true}; -- Cheap Shot
spells[2094] = {duration = 10, cooldown = 180, diminish="cyclone"}; -- Blind
spells[8629] = {duration = 4, talent = {2, 1, 4, 0.5, "ROGUE"}, stun = true, diminish="incap"}; -- Gouge
spells[8643] = {duration = 6, combo = true, stun = true, diminish="kidney"}; -- Kidney Shot
spells[1833] = {duration = 4, stun = true, diminish="stun"}; -- Cheap Shot
spells[26867] = {duration = 16, combo = true, dot = true}; -- Rupture
spells[8632] = {duration = 18, dot = true}; -- Garrote
spells[1330] = {duration = 3, dot = true}; -- Garrote silence
spells[38768] = {duration = 5, interrupt = true}; -- Kick
spells[2070] = {duration = 45, pvpdur = 10, stun = true}; -- Sap
spells[2070] = {duration = 45, pvpdur = 10, stun = true, diminish="incap"}; -- Sap
spells[26866] = {duration = 30}; -- Expose Armor
spells[3420] = {duration = 12}; -- Crip
spells[3421] = {duration = 12}; -- Crip II
134,15 → 134,15
spells[28594] = {duration = 15, stacks = true}; -- Winter's Chill
spells[22959] = {duration = 30, stacks = true}; -- Fire Vuln.
spells[12359] = {duration = 2, stun = true}; -- Impact
spells[12825] = {duration = 50, pvpdur = 10}; -- Poly
spells[28271] = {duration = 50, pvpdur = 10}; -- Poly
spells[28272] = {duration = 50, pvpdur = 10}; -- Poly
spells[12825] = {duration = 50, pvpdur = 10, diminish="incap"}; -- Poly
spells[28271] = {duration = 50, pvpdur = 10, diminish="incap"}; -- Poly
spells[28272] = {duration = 50, pvpdur = 10, diminish="incap"}; -- Poly
spells[30942] = {duration = 9}; -- Frostbolt
spells[1953] = {cooldown = 15}; -- Blink
spells[31687] = {duration = 45, cooldown = 180, special = true}; -- Water Elemental
spells[11985] = {cooldown = 600}; -- Cold Snap
spells[2139] = {duration = 8, cooldown = 24, interrupt = true};
spells[18469] = {duration = 4, cooldown = 24};
spells[2139] = {duration = 8, cooldown = 24, interrupt = true}; -- CS
spells[18469] = {duration = 4, cooldown = 24}; -- Imp CS
-- HUNTER
spells[14327] = {cooldown = 30}; -- Scare Beast
spells[3054] = {duration = 15, cooldown = 300}; -- Rapid fire
trunk/NaturCombat/addon/generator.lua
18,7 → 18,7
["GREY"] = { r = 0.8, g = 0.8, b = 0.8},
},};
NaturDB = NaturDB or addon.default;
addon.killcounter, addon.killtimer, addon.timers = 0, nil, {};
addon.killcounter, addon.killtimer, addon.timers, addon.dims, addon.multiplier = 0, nil, {}, {}, 1;
----------------------------------------------------------------------------------------------------
-- BAR GROUPS
----------------------------------------------------------------------------------------------------