1
0
Fork 0

Reset instance lockout if necessary.

This commit is contained in:
Andrew Tomaka 2011-08-21 14:10:05 -04:00
parent 917b7a81fc
commit 5c98139097

View file

@ -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