Module:Skills/Agility: Difference between revisions

Account for AP and ASC; Fix GP icon and GP text in abyssal agility table
No edit summary
(Account for AP and ASC; Fix GP icon and GP text in abyssal agility table)
 
Line 47: Line 47:
local gp =  Num.clamp((costReduction['GP'] or 0), 0, 100) / 100
local gp =  Num.clamp((costReduction['GP'] or 0), 0, 100) / 100
local sc =  Num.clamp((costReduction['SC'] or 0), 0, 100) / 100
local sc =  Num.clamp((costReduction['SC'] or 0), 0, 100) / 100
local ap =  Num.clamp((costReduction['AP'] or 0), 0, 100) / 100
local asc =  Num.clamp((costReduction['ASC'] or 0), 0, 100) / 100
local item = Num.clamp((costReduction['Item'] or 0), 0, 100) / 100
local item = Num.clamp((costReduction['Item'] or 0), 0, 100) / 100
Line 54: Line 56:
if sc > 0 and itemCosts['SC'] then
if sc > 0 and itemCosts['SC'] then
itemCosts['SC'] = math.ceil(itemCosts['SC'] * (1 - sc))
itemCosts['SC'] = math.ceil(itemCosts['SC'] * (1 - sc))
end
if ap > 0 and itemCosts['AP'] then
itemCosts['AP'] = math.ceil(itemCosts['AP'] * (1 - ap))
end
if asc > 0 and itemCosts['ASC'] then
itemCosts['ASC'] = math.ceil(itemCosts['ASC'] * (1 - asc))
end
end
Line 118: Line 126:
elseif currCost.id == 'melvorD:SlayerCoins' then
elseif currCost.id == 'melvorD:SlayerCoins' then
shortID = 'SC'
shortID = 'SC'
elseif currCost.id == 'melvorItA:AbyssalPieces' then
shortID = 'AP'
elseif currCost.id == 'melvorItA:AbyssalSlayerCoins' then
shortID = 'ASC'
end
end
if shortID ~= nil then
if shortID ~= nil then
Line 160: Line 172:
end
end
realmID = realm.id
realmID = realm.id
end
local currName = 'GP'
if realmID == 'melvorItA:Abyssal' then
currName = 'AP'
end
end
Line 166: Line 182:
result = '{| class="wikitable sortable stickyHeader"'
result = '{| class="wikitable sortable stickyHeader"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n|- class="headerRow-0"'
result = result..'\r\n!Slot!!Name!!XP!!GP!!Time!!XP/s!!GP/s!!Bonuses!!Requirements!!Cost'
result = result..'\r\n!Slot!!Name!!XP!!'..currName..'!!Time!!XP/s!!'..currName..'/s!!Bonuses!!Requirements!!Cost'


local catLog = {}
local catLog = {}
Line 218: Line 234:
-- Readded XP/Time and GP/Time (previously commented out)
-- Readded XP/Time and GP/Time (previously commented out)
result = result..'||'..Num.round(XP / Time, 2, 2)
result = result..'||'..Num.round(XP / Time, 2, 2)
result = result..'||data-sort-value="'..rewardVal/Time..'"|'.. Icons._Currency('GP', Num.round(rewardVal/Time, 2, 2))
result = result..'||data-sort-value="'..rewardVal/Time..'"|'.. Icons._Currency(currName, Num.round(rewardVal/Time, 2, 2))


local bonuses = {}
local bonuses = {}