Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Affixes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ function e.AffixThree(weekOffSet)
local week = (e.Week + offSet) % 12
if week == 0 then week = 12 end
return AFFIXES[week][3]
end
end
10 changes: 4 additions & 6 deletions ArtifactKnowledge.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ AK_BONUS[54] = 4846001
AK_BONUS[55] = 6300001

-- Returns artifact bonus percent
-- @param akLevel integer value representing artifact level
function e.GetAKBonus()
return AK_BONUS[math.min(e.Week + 35, #AK_BONUS)]
--return AK_BONUS[tonumber(akLevel)]
end

--Gets Artifact Knowledge level
function e.ParseAKLevel()
return math.min(e.Week + 35, #AK_BONUS)
end
-- Returns next week's artifact bonus percent
function e.GetNextAKBonus()
return AK_BONUS[math.min(e.Week + 35 + 1, #AK_BONUS)]
end
71 changes: 47 additions & 24 deletions ArtifactPower.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ local WEEKLY_AP = {}
--[[
RUSSIAN
Upper Kara Верхний Каражан
Lowre Kara Нижний Каражан
Lower Kara Нижний Каражан
]]

DUNGEON_TABLE[197] = {}
--DUNGEON_TABLE[197]['enUS']
--DUNGEON_TABLE[197]['ptBR']
--DUNGEON_TABLE[197]['deDE']
--DUNGEON_TABLE[197]['enUS']
--DUNGEON_TABLE[197]['ptBR']
--DUNGEON_TABLE[197]['deDE']
--DUNGEON_TABLE[197]['frFR']
--DUNGEON_TABLE[197]['esMX']
--DUNGEON_TABLE[197]['ruRU']
Expand Down Expand Up @@ -43,7 +42,7 @@ DUNGEON_TABLE[234]['name'] = 'Return to Karazhan: Upper'
DUNGEON_TABLE[239] = {}
DUNGEON_TABLE[239]['name'] = 'Seat of the Triumvirate'

--[[
--[[
Times
-1440
> 1440
Expand Down Expand Up @@ -86,26 +85,29 @@ function e.BuildMapTable()
DUNGEON_TABLE[map].chestTimes[3] = c
DUNGEON_TABLE[map]['apTier'] = {}
if runTime == 1440 then
DUNGEON_TABLE[map].apTier[1] = 175 -- 2-3
DUNGEON_TABLE[map].apTier[2] = 290 -- 4-6
DUNGEON_TABLE[map].apTier[3] = 325 -- 7-9
DUNGEON_TABLE[map].apTier[4] = 465 -- 10-14
DUNGEON_TABLE[map].apTier[5] = 725 -- 15-19
DUNGEON_TABLE[map].apTier[6] = 1025 --20-25
DUNGEON_TABLE[map].apTier[1] = 175 -- 2-3
DUNGEON_TABLE[map].apTier[2] = 290 -- 4-6
DUNGEON_TABLE[map].apTier[3] = 325 -- 7-9
DUNGEON_TABLE[map].apTier[4] = 465 -- 10-14
DUNGEON_TABLE[map].apTier[5] = 725 -- 15-19
DUNGEON_TABLE[map].apTier[6] = 975 -- 20-25 (What you actually end up with is one T5 token (147719: Lesser Master's Symbol), plus one token equal to Bonus*5 (147814: Lesser Expert's Bounty))
DUNGEON_TABLE[map].apBonus = 50 -- 10+ (147808: Lesser Adept's Spoils)
elseif runTime > 1440 and runTime < 2700 then
DUNGEON_TABLE[map].apTier[1] = 300
DUNGEON_TABLE[map].apTier[1] = 300
DUNGEON_TABLE[map].apTier[2] = 475
DUNGEON_TABLE[map].apTier[3] = 540
DUNGEON_TABLE[map].apTier[4] = 775
DUNGEON_TABLE[map].apTier[5] = 1200
DUNGEON_TABLE[map].apTier[6] = 1700
DUNGEON_TABLE[map].apBonus = 100
elseif runTime == 2700 then
DUNGEON_TABLE[map].apTier[1] = 375
DUNGEON_TABLE[map].apTier[1] = 375
DUNGEON_TABLE[map].apTier[2] = 600
DUNGEON_TABLE[map].apTier[3] = 675
DUNGEON_TABLE[map].apTier[4] = 1000
DUNGEON_TABLE[map].apTier[5] = 1500
DUNGEON_TABLE[map].apTier[6] = 2125
DUNGEON_TABLE[map].apBonus = 125
end
end
end
Expand Down Expand Up @@ -136,18 +138,34 @@ local function GetKeyTier(keyLevel)
end
end

function e.GetMapAP(mapID, keyLevel)
local function GetKeyBonusTokens(keyLevel)
if keyLevel < 10 then
return 0
elseif keyLevel < 15 then
return (keyLevel % 10)
elseif keyLevel < 20 then
return (keyLevel % 15)
else
return (keyLevel % 20)
end
end

local function GetMapAP(mapID, keyLevel)
return DUNGEON_TABLE[tonumber(mapID)]['apTier'][GetKeyTier(tonumber(keyLevel))]
end

local function GetMapBonusAP(mapID)
return DUNGEON_TABLE[tonumber(mapID)].apBonus
end

WEEKLY_AP[2] = 1250
WEEKLY_AP[3] = 1250
WEEKLY_AP[4] = 1925
WEEKLY_AP[5] = 1925
WEEKLY_AP[6] = 1925
WEEKLY_AP[7] = 2150
WEEKLY_AP[8] = 2150
WEEKLY_AP[9] = 2150
WEEKLY_AP[9] = 2150
WEEKLY_AP[10] = 3125
WEEKLY_AP[11] = 3525
WEEKLY_AP[12] = 3925
Expand All @@ -161,6 +179,15 @@ WEEKLY_AP[19] = 6600
WEEKLY_AP[20] = 7000
WEEKLY_AP[21] = 7400
WEEKLY_AP[22] = 7800
-- Here be dragons!
WEEKLY_AP[23] = 8200
WEEKLY_AP[24] = 8600
WEEKLY_AP[25] = 9000
WEEKLY_AP[26] = 9400
WEEKLY_AP[27] = 9800
WEEKLY_AP[28] = 10200
WEEKLY_AP[29] = 10600
WEEKLY_AP[30] = 11000

function e.GetWeeklyAP(keyLevel)
if keyLevel == 0 then return 0 end
Expand All @@ -169,12 +196,8 @@ end

function e.MapApText(mapID, keyLevel)

local amount = e.GetMapAP(mapID, keyLevel) * e.GetAKBonus(e.ParseAKLevel())
local s = ''
local chest1 = e.ConvertToSI(amount/math.floor(GetMapTime(mapID, 1)/60))
local chest2 = e.ConvertToSI(amount/math.floor(GetMapTime(mapID, 2)/60))
local chest3 = e.ConvertToSI(amount/math.floor(GetMapTime(mapID, 3)/60))
local amount = GetMapAP(mapID, keyLevel) * e.GetAKBonus()
local bonusAmount = (GetMapBonusAP(mapID) * GetKeyBonusTokens(keyLevel)) * e.GetAKBonus()
return e.ConvertToSI(amount + bonusAmount) .. ' AP'

return e.ConvertToSI(amount) .. ' AP\n' .. '+1 ' .. chest1 .. '/m \n+2 ' .. chest2 .. '/m \n+3 ' .. chest3 .. '/m'

end
end
16 changes: 8 additions & 8 deletions AstralKeys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if not AstralKeys then AstralKeys = {} end
if not AstralCharacters then AstralCharacters = {} end
if not AstralFriends then AstralFriends = {} end

local initializeTime = {}
local initializeTime = {}
initializeTime[1]= 1500390000 -- US Tuesday at reset
initializeTime[2]= 1500447600 -- EU Wednesday at reset

Expand All @@ -30,13 +30,13 @@ function e.ConvertToSI(quantity)

while amount > 1000 do
power = power + 1
amount = amount /1000
amount = amount / 1000
end

if amount < 10 then
return string.format('%.2f', amount) .. ' ' .. IMP[power]
return string.format('%.2f', amount) .. ' ' .. SI[power]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EU here, so I tend to prefer SI over IMP ;p.

else
return math.floor(amount) .. ' ' .. IMP[power]
return string.format('%.1f', amount) .. ' ' .. SI[power]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems relevant with current amounts

end
end

Expand All @@ -58,7 +58,7 @@ AstralEvents:Register('PLAYER_LOGIN', function()
else
e.FACTION = 1
end

local region = GetCurrentRegion()
local currentTime = GetServerTime()
local d = date('*t', currentTime)
Expand Down Expand Up @@ -114,7 +114,7 @@ AstralEvents:Register('PLAYER_LOGIN', function()
end
self.elapsed = 0
end
end)
end)
elseif d.wday == 4 and d.hour < (7 + hourOffset + (d.isdst and 1 or 0)) and region == 3 then
local frame = CreateFrame('FRAME')
frame.elapsed = 0
Expand Down Expand Up @@ -145,7 +145,7 @@ AstralEvents:Register('PLAYER_LOGIN', function()
end
self.elapsed = 0
end
end)
end)
end

for i = 1, #AstralKeys do -- index guild units
Expand All @@ -155,7 +155,7 @@ AstralEvents:Register('PLAYER_LOGIN', function()

for i = 1, #AstralCharacters do -- index player's characters
e.SetCharacterID(AstralCharacters[i].unit, i)
end
end

for i = 1, #AstralFriends do
e.SetFriendID(AstralFriends[i][1], i)
Expand Down
2 changes: 1 addition & 1 deletion AstralKeys.toc
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ BNFriends.lua
Frame Functions.lua
Frame.lua
MinimapButton.lua
Options.lua
Options.lua
31 changes: 15 additions & 16 deletions BNFriends.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ function e.BNFriendUpdate(index)
end
end

if not BNFriendList[battleTag] then
if not BNFriendList[battleTag] then
BNFriendList[battleTag] = {toonName = toonName, client = client, gaID = gaID, usingAK = false}
else
BNFriendList[battleTag].client = client --Update client, did they log off WoW?
BNFriendList[battleTag].presID = presID or 0 -- If they have a presID force an update, else set to 0. Used for all API needing a pressence ID
BNFriendList[battleTag].gaID = gaID -- Might as well keep it up to date
end
end

end
AstralEvents:Register('BN_FRIEND_INFO_CHANGED', e.BNFriendUpdate, 'update_BNFriend')
Expand Down Expand Up @@ -139,7 +139,7 @@ local function UpdateNonBNetFriendList()
local guid = select(20, BNGetGameAccountInfo(gaID))
BNFriendList[battleTag] = {toonName = toonName, client = client, gaID = gaID, usingAK = false}
if client == 'WoW' then
local fullName = toonName .. '-' .. select(4, BNGetGameAccountInfo(gaID))
local fullName = toonName .. '-' .. select(4, BNGetGameAccountInfo(gaID))
if NonBNFriend_List[fullName] then
NonBNFriend_List[fullName].isBtag = true -- don't need to send people on WoW friend and bnet friend the same data.
end
Expand Down Expand Up @@ -183,7 +183,7 @@ local function RecieveKey(msg, sender)

e.AddUnitToTable(unit, class, faction, 'friend', dungeonID, keyLevel, nil, btag)

if e.FrameListShown() == 'friends' then
if e.FrameListShown() == 'friends' then
e.UpdateFrames()
end
end
Expand All @@ -192,8 +192,9 @@ AstralComs:RegisterPrefix('WHISPER', UPDATE_VERSION, RecieveKey)

local function SyncFriendUpdate(entry, sender)
if not AstralKeysSettings.options.friendSync then return end
local bnetID = select(17, BNGetGameAccountInfo(sender))
local btag
if type(sender) == 'number' then
if type(sender) == 'number' then
local bnetID = select(17, BNGetGameAccountInfo(sender))
btag = select(3, BNGetFriendInfo(BNGetFriendIndex(bnetID)))
end
Expand All @@ -207,7 +208,6 @@ local function SyncFriendUpdate(entry, sender)

local _pos = 0
while find(entry, '_', _pos) do

class, dungeonID, keyLevel, week, timeStamp, faction = entry:match(':(%a+):(%d+):(%d+):(%d+):(%d+):(%d+)', entry:find(':', _pos))
unit = entry:sub(_pos, entry:find(':', _pos) - 1)

Expand All @@ -218,8 +218,7 @@ local function SyncFriendUpdate(entry, sender)
week = tonumber(week)
timeStamp = tonumber(timeStamp)

if week >= e.Week then

if week >= e.Week then
local id = e.FriendID(unit)
if id then
if AstralFriends[id][7] < timeStamp then
Expand All @@ -236,8 +235,8 @@ local function SyncFriendUpdate(entry, sender)
e.AddUnitToTable(unit, class, faction, 'friend', dungeonID, keyLevel, nil, btag)
end
end
if e.FrameListShown() == 'friends' then
e.UpdateFrames()
if e.FrameListShown() == 'friends' then
e.UpdateFrames()
end
end
AstralComs:RegisterPrefix('BNET', SYNC_VERSION, SyncFriendUpdate)
Expand Down Expand Up @@ -332,7 +331,7 @@ local function PingFriendsForAstralKeys()
local guid = select(20, BNGetGameAccountInfo(gaID))
BNFriendList[battleTag] = {toonName = toonName, client = client, gaID = gaID, usingAK = false}
if client == 'WoW' then
local fullName = toonName .. '-' .. select(4, BNGetGameAccountInfo(gaID))
local fullName = toonName .. '-' .. select(4, BNGetGameAccountInfo(gaID))
if NonBNFriend_List[fullName] then
NonBNFriend_List[fullName].isBtag = true -- don't need to send people on WoW friend and bnet friend the same data.
end
Expand All @@ -343,7 +342,7 @@ local function PingFriendsForAstralKeys()
end
end
end
end
end

for _, player in pairs(BNFriendList) do
if player.client == 'WoW' then
Expand Down Expand Up @@ -439,13 +438,13 @@ e.AddListFilter('friend', FriendFilter)
local function FriendSort(A, v)
if v == 5 then v = 1 end
if v == 3 then
table.sort(A, function(a, b)
table.sort(A, function(a, b)
if AstralKeysSettings.frameOptions.orientation == 0 then
return e.GetMapName(a[v]) > e.GetMapName(b[v])
else
return e.GetMapName(b[v]) > e.GetMapName(a[v])
end
end)
end)
else
if v == 1 then
table.sort(A, function(a, b)
Expand All @@ -458,7 +457,7 @@ local function FriendSort(A, v)
end
end)
else
table.sort(A, function(a, b)
table.sort(A, function(a, b)
if AstralKeysSettings.frameOptions.orientation == 0 then
return a[v] > b[v]
else
Expand All @@ -469,4 +468,4 @@ local function FriendSort(A, v)
end
end

e.AddListSort('friend', FriendSort)
e.AddListSort('friend', FriendSort)
8 changes: 4 additions & 4 deletions Character Info.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ end
-- @return int mapID for the highest ran mythic+ for the week
-- @return int 0 implies no key run for the week
function e.GetCharacterBestMap(id)
return AstralCharacters[id].map
return AstralCharacters[id].map
end

-- Retrieves faction for character
Expand Down Expand Up @@ -100,10 +100,10 @@ function e.GetCharacterKey(unit)
if not unit then return '' end

local id = e.UnitID(unit)
if id then

if id then
return AstralKeys[id][4] .. ' ' .. C_ChallengeMode.GetMapInfo(AstralKeys[id][3]) -- 4:: key level 3:: mapID
else
return WrapTextInColorCode('No key found.', 'ff9d9d9d')
end
end
end
Loading