-Added an option to set the DR time.

-The default DR time is now 15 seconds, because my tests show that servers use flat 15 seconds.
This commit is contained in:
Relintai 2016-05-11 12:03:03 +02:00
parent 6423c69476
commit b2cf208b1a
4 changed files with 30 additions and 7 deletions

View File

@ -43,6 +43,7 @@ Rekt.defaults = {
selfIBCDRegister = false,
specdetection = true,
petcdguessing = true,
drtime = 15,
target = {
enabled = true,
size = 27,

View File

@ -21,7 +21,7 @@ function Rekt:DRDebuffGained(spellID, dstGUID, isPlayer)
Rekt:UpdateDRs(dstGUID);
if not Rekt.drs[dstGUID][drCat] then
local cd = 18;
local cd = Rekt:getDRTime();
local currentTime = GetTime();
local endTime = currentTime + cd;
local diminished = 1;
@ -45,7 +45,7 @@ function Rekt:DRDebuffGained(spellID, dstGUID, isPlayer)
return;
end
local cd = 18;
local cd = Rekt:getDRTime();
local currentTime = GetTime();
local endTime = currentTime + cd;
Rekt.drs[dstGUID][drCat][1] = currentTime;
@ -56,7 +56,7 @@ function Rekt:DRDebuffGained(spellID, dstGUID, isPlayer)
Rekt.drs[dstGUID][drCat][7] = false;
Rekt.drs[dstGUID][drCat][9] = GetTime();
--reset it back to 1, x > 3 means, the server updated the dr in less than 18 sec.
--reset it back to 1, x > 3 means, the server updated the dr in less than Rekt:getDRTime() sec.
if Rekt.drs[dstGUID][drCat][6] > 3 then
Rekt.drs[dstGUID][drCat][6] = 1;
end
@ -94,7 +94,7 @@ function Rekt:DRDebuffFaded(spellID, dstGUID, isPlayer)
--means we didn't see it applied
Rekt:DRDebuffGained(spellID, dstGUID, isPlayer);
else
local cd = 18;
local cd = Rekt:getDRTime();
local currentTime = GetTime();
local endTime = currentTime + cd;
Rekt.drs[dstGUID][drCat][1] = currentTime;
@ -137,7 +137,7 @@ function Rekt:DRDebuffRefreshed(spellID, dstGUID, isPlayer)
Rekt:DRDebuffGained(spellID, dstGUID, isPlayer);
return;
else
local cd = 18;
local cd = Rekt:getDRTime();
local currentTime = GetTime();
local endTime = currentTime + cd;
Rekt.drs[dstGUID][drCat][1] = currentTime;
@ -148,7 +148,7 @@ function Rekt:DRDebuffRefreshed(spellID, dstGUID, isPlayer)
Rekt.drs[dstGUID][drCat][7] = false;
Rekt.drs[dstGUID][drCat][9] = GetTime();
--reset it back to 1, x > 3 means, the server updated the dr in less than 18 sec.
--reset it back to 1, x > 3 means, the server updated the dr in less than Rekt:getDRTime() sec.
if Rekt.drs[dstGUID][drCat][6] > 3 then
Rekt.drs[dstGUID][drCat][6] = 1;
end

View File

@ -446,3 +446,13 @@ function Rekt:setIBSelfCDRegister(v)
local db = Rekt.db.profile;
db["selfIBCDRegister"] = v;
end
function Rekt:getDRTime()
local db = Rekt.db.profile;
return db["drtime"];
end
function Rekt:setDRTime(v)
local db = Rekt.db.profile;
db["drtime"] = v;
end

View File

@ -707,6 +707,18 @@ function Rekt:getGlobalOptions()
Rekt:setColor("uncategorized", r, g, b, a);
end
},
--70+
globalotherHeader = {
type = "header", name = "Other settings", order = 70
},
drtimerange = {
type = "range", name = "Diminishing Return time", order = 71, min = 1, max = 25, step = 1,
get = function() return Rekt:getDRTime() end,
set = function(_, v)
Rekt:setDRTime(v);
end
},
}
return args;
end