comparison Export.lua @ 197:23b740b4c93a v96

Added Great Vault export.
author Yellowfive
date Thu, 17 Dec 2020 11:57:06 -0600
parents cb7eb9b9cc24
children
comparison
equal deleted inserted replaced
196:b4f74de03b43 197:23b740b4c93a
264 Amr.db.char.VoidItems = voidItems 264 Amr.db.char.VoidItems = voidItems
265 end 265 end
266 266
267 end 267 end
268 ]] 268 ]]
269
270 local function scanGreatVault()
271
272 Amr.db.char.GreatVaultItems = {}
273
274 if not C_WeeklyRewards then return end
275
276 local vaultItems = {}
277 local activities = C_WeeklyRewards.GetActivities()
278 for i, activityInfo in ipairs(activities) do
279 if activityInfo and activityInfo.rewards then
280 for i, rewardInfo in ipairs(activityInfo.rewards) do
281 if rewardInfo.type == Enum.CachedRewardType.Item and not C_Item.IsItemKeystoneByID(rewardInfo.id) then
282 local itemLink = C_WeeklyRewards.GetItemHyperlink(rewardInfo.itemDBID)
283 if itemLink then
284 local itemData = Amr.Serializer.ParseItemLink(itemLink)
285 if itemData ~= nil then
286 table.insert(vaultItems, itemData)
287 end
288 end
289 end
290 end
291 end
292 end
293 Amr.db.char.GreatVaultItems = vaultItems
294 end
269 295
270 local function scanSoulbinds() 296 local function scanSoulbinds()
271 if not C_Soulbinds then return end 297 if not C_Soulbinds then return end
272 298
273 -- read which conduits this player has unlocked 299 -- read which conduits this player has unlocked
414 scanSoulbinds() 440 scanSoulbinds()
415 441
416 -- scan current spec's essences just before exporting 442 -- scan current spec's essences just before exporting
417 --scanEssences() 443 --scanEssences()
418 444
445 -- scan the great vault for potential rewards this week
446 scanGreatVault()
447
419 data.Talents = Amr.db.char.Talents 448 data.Talents = Amr.db.char.Talents
420 data.UnlockedConduits = Amr.db.char.UnlockedConduits 449 data.UnlockedConduits = Amr.db.char.UnlockedConduits
421 data.ActiveSoulbinds = Amr.db.char.ActiveSoulbinds 450 data.ActiveSoulbinds = Amr.db.char.ActiveSoulbinds
422 data.Soulbinds = Amr.db.char.Soulbinds 451 data.Soulbinds = Amr.db.char.Soulbinds
423 --data.UnlockedEssences = Amr.db.char.UnlockedEssences 452 --data.UnlockedEssences = Amr.db.char.UnlockedEssences
424 --data.Essences = Amr.db.char.Essences 453 --data.Essences = Amr.db.char.Essences
425 data.Equipped = Amr.db.char.Equipped 454 data.Equipped = Amr.db.char.Equipped
426 data.BagItems = Amr.db.char.BagItems 455 data.BagItems = Amr.db.char.BagItems
456 data.GreatVaultItems = Amr.db.char.GreatVaultItems
427 457
428 -- flatten bank data (which is stored by bag for more efficient updating) 458 -- flatten bank data (which is stored by bag for more efficient updating)
429 data.BankItems = {} 459 data.BankItems = {}
430 for k,v in pairs(Amr.db.char.BankItems) do 460 for k,v in pairs(Amr.db.char.BankItems) do
431 for i,v2 in ipairs(v) do 461 for i,v2 in ipairs(v) do