Reset instance lockout if necessary.
This commit is contained in:
parent
917b7a81fc
commit
5c98139097
1 changed files with 15 additions and 5 deletions
|
@ -26,21 +26,31 @@ function core:OnEnable()
|
|||
self.db.profile.lockouts[name] = {}
|
||||
end
|
||||
|
||||
self:RegisterEvent('UPDATE_INSTANCE_INFO','StoreChores')
|
||||
self:RegisterEvent('UPDATE_INSTANCE_INFO','UpdateChores')
|
||||
end
|
||||
|
||||
function core:StoreChores()
|
||||
local _,_,_,earnedThisWeek = GetCurrencyInfo(396)
|
||||
local name = UnitName('player')
|
||||
function core:UpdateChores()
|
||||
local level = UnitLevel('player')
|
||||
|
||||
if(level == 85) then
|
||||
local _,_,_,earnedThisWeek = GetCurrencyInfo(396)
|
||||
local name = UnitName('player')
|
||||
|
||||
--reset data if necessary
|
||||
for k,v in pairs(self.db.profile.lockouts) do
|
||||
for x,y in pairs(self.db.profile.lockouts[k]) do
|
||||
if y.resetTime > time() then
|
||||
self.db.profile.lockouts[k][x] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--store Valor Points
|
||||
self.db.profile.valorPoints[name] = earnedThisWeek
|
||||
|
||||
--store Saved Instances
|
||||
local savedInstances = GetNumSavedInstances()
|
||||
for i = 0, savedInstances do
|
||||
for i = 1, savedInstances do
|
||||
local instanceName,_,instanceReset,_,_,_,_,_,_,_,_,defeatedBosses = GetSavedInstanceInfo(i)
|
||||
|
||||
if trackedInstances[instanceName] == true then
|
||||
|
|
Loading…
Reference in a new issue