Módulo:Rotação/Mercador
Ir para navegação
Ir para pesquisar
Documentação do módulo
Esta documentação é transcluída de Módulo:Rotação/Mercador/doc. [editar] [atualizar]
Módulo:Rotação/Mercador's a função nextItem é invocada por Predefinição:Datas de objetos do Mercador Viajante.
Módulo:Rotação/Mercador requer Módulo:Moeda.
Módulo:Rotação/Mercador requer Módulo:Purge.
Módulo:Rotação/Mercador requer Módulo:Rotação.
--[=[
-- Rotation of the [[Travelling Merchant's Shop]]
-- See [[Talk:Travelling Merchant's Shop#History and pattern]] for more info
-- will work up until and including 11th February 2023
-- after which it will start predicting the entire day's stock wrong on roughly 9% of days.
--]=]
local p = {}
local rotations = require('Módulo:Rotação')
local coins = require('Módulo:Moeda')._amount
local lang = mw.getContentLanguage()
local purge = require('Módulo:Purge')._purge
local items = {
['Mapa da ilha inexplorada (Pesca em Alto Mar)'] = {
name = '[[Mapa da ilha inexplorada (Pesca em Alto Mar)|Mapa da ilha inexplorada]]',
_name = 'mapa da ilha inexplorada',
cost = 800000,
quantity = 1,
use = 'Permite viajar para uma ilha inexplorada, com chance de 3 - 6 recursos especiais, sem gastar suprimentos.<br />Ao comprar o mapa da ilha inexplorada, o jogador tem uma rara chance de receber o [[Mapa da ilha inexplorada ( Vermelho )]].'
},
['Barril de isca'] = {
cost = 50000,
quantity = 1,
use = '10% de chance de ganhar uma captura adicional durante 3 minutos.'
},
['Aquário Emaranhado'] = {
cost = 50000,
quantity = 1,
use = '5% Aumento na experiência em Pesca durante 3 minutos.'
},
['Vara de pescar quebrada'] = {
cost = 50000,
quantity = 1,
use = '5 a 10% de bônus para captura durante 3 a 30 minutos.'
},
['Talismã funerário goebie pq.'] = {
cost = 50000,
quantity = 1,
use = '50 de [[Reputação_(Mazcab)|reputação com os Goebies]] ou 50 [[teci]].'
},
['Talismã funerário goebie'] = {
cost = 100000,
quantity = 1,
use = '100 de [[Reputação_(Mazcab)|reputação com os Goebies]] ou 100 [[teci]]'
},
['Presente menaphita (P)'] = {
_name='presente Menaphita pequeno',
cost = 100000,
quantity = 1,
use = 'Diversas recompensas, veja a página.'
},
['Presente menaphita (M)'] = {
_name='presente Menaphita médio',
cost = 300000,
quantity = 1,
use = 'Diversas recompensas, veja a página.'
},
['Runa do ar instável'] = {
cost = 250000,
quantity = 1,
use = '5,000 [[Runiverso#Pontos do Runiverso|Pontos do Runiverso]].'
},
['Cristal de Anima'] = {
cost = 150000,
quantity = 1,
use = '500 [[Reputação (Coração de Guilenor)|reputação de facção]].'
},
['Cupom VIP de Extermínio'] = {
_name='Cupom VIP de Extermínio',
cost = 200000,
quantity = 1,
use = 'Usado para resgatar de 1 a 7 [[Ficha VIP de Extermínio|fichas VIP de Extermínio]].'
},
['Ficha de D&D (diária)'] = {
_name='Ficha de D&D (diária)',
cost = 250000,
quantity = 1,
use = 'Uso único para redefinir um [[D&D]] diário.'
},
['Melhorador dano não sintoniz.'] = {
cost = 500000,
quantity = 1,
use = 'Permite a escolha de qualquer intensificador de dano ao custo de taxas mais baixas.'
},
['Argila sagrada (Pesca em Alto Mar)'] = {
_name='argila sagrada',
name = '[[Argila sagrada (Pesca em Alto Mar)|Argila Sagrada]].',
cost = 600000,
quantity = 1,
use = '50-100 pontos de [[Criações Profanas]]'
},
['Anima Fragmentada'] = {
cost = 750000,
quantity = '500,000-2,000,000',
use = 'Veja a loja [[Mundos_Fragmentados#Recompensas|aqui]].'
},
['Núcleo de pulsação avançada'] = {
cost = 800000,
quantity = '1-3',
use = ' 50% de experiência extra que não se acumula com outras fontes de experiência bônus, até o equivalente a uma lâmpada prismática Média.'
},
['Planta Vil (Pesca em Alto Mar)'] = {
_name='planta vil',
name = '[[Planta Vil (Pesca em Alto Mar)|Planta Vil]]',
cost = 1000000,
quantity = 1,
use = '10,000 a 40,000 [[pontos de produção]].'
},
['Presente do Ceifador'] = {
_name='presente do ceifador',
cost = 1250000,
quantity = 1,
use = '20 [[Pontos do Ceifador]].'
},
['Plumas de Falcão de Prata'] = {
cost = 1500000,
quantity = '50-100',
use = 'Experiência em {{hab|Agilidade}}.'
},
['Talismã Funerário Goebie (Grande)'] = {
cost = 150000,
quantity = 1,
use = '150 de [[Reputação_(Mazcab)|reputação com os Goebies]] ou 150 [[teci]].'
},
['Mensagem na garrafa (Pesca em Alto Mar)'] = {
_name='message in a bottle',
name = '[[Mensagem na garrafa (Pesca em Alto Mar)|Mensagem na garrafa]]',
cost = 200000,
quantity = 1,
use = 'Escolha única entre três reforços de [[Pesca em Alto Mar]].'
},
['Lâmpada de Dragonkin'] = {
cost = 250000,
quantity = 1,
use = 'Recompensa uma quantidade definida de experiência e uma chance de 1/100 de obter [[Effy]].'
},
['Carta Curinga de Dungeon'] = {
_name='Carta Curinga de Dungeon',
cost = 400000,
quantity = '1-3',
use = 'Consumir o cartão dentro de [[Kalaboss]] recompensa 50% de experiência e fichas extras.'
},
['Presente menaphita (G)'] = {
_name='presente Menaphita grande',
cost = 500000,
quantity = 1,
use = 'Variedade de recompensas, consulte a página.'
},
['Taijitu'] = {
cost = 800000,
quantity = '3-5',
use = 'Moeda secundária usada na loja de recompensas de Waiko.'
},
['Ficha de D&D (semanal)'] = {
_name='Ficha D&D (semanal)',
cost = 400000,
quantity = 1,
use = 'Uso único para redefinir um [[D&D]] semanal.'
},
['Ficha de D&D (mensal)'] = {
_name='Ficha D&D (mensal)',
cost = 1000000,
quantity = 1,
use = 'Uso único para redefinir um [[D&D]] mensal.'
},
['Antiga efígie faminta'] = {
cost = 1000000,
quantity = 1,
use = 'Recompensa uma quantidade definida de experiência e uma chance de 1/100 de obter [[Effy]].'
},
['Poeira harmônica'] = {
cost = 2000000,
quantity = '500-1000',
use = 'Usado para fazer equipamentos de cristal.'
},
['Tríscele de Cristal'] = {
cost = 2000000,
quantity = 1,
use = 'Depositado em um penhasco ao sul de [[Rellekka]] para obter um [[Pergaminho de dicas (elite)]] e uma variedade de outras recompensas.'
},
['Dardo mata-tudo'] = {
cost = 5000000,
quantity = 1,
use = 'Usado a fim de causar morte instantânea na maioria dos NPCs.'
},
['Melhorador recompensa não sintoniz.'] = {
cost = 10000000,
quantity = 1,
use = 'Permite a escolha de qualquer aprimorador de recompensa ao custo de tarifas mais baixas.'
}
}
-- should really make the above table into an array and use those as IDs but whatever
-- DO NOT MOVE THESE AROUND
local itemIDs = {
'Barril de isca', 'Aquário Emaranhado', 'Vara de pescar quebrada', 'Mensagem na garrafa (Pesca em Alto Mar)', -- 4
'Talismã funerário goebie pq.', 'Talismã funerário goebie', 'Talismã Funerário Goebie (Grande)', -- 7
'Presente menaphita (P)', 'Presente menaphita (M)', 'Presente menaphita (G)', -- 10
'Ficha de D&D (diária)', 'Ficha de D&D (semanal)', 'Ficha de D&D (mensal)', -- 13
'Runa do ar instável', 'Cristal de Anima', 'Taijitu', 'Presente do Ceifador', 'Cupom VIP de Extermínio', -- 18
'Anima Fragmentada', 'Planta Vil (Pesca em Alto Mar)', 'Argila sagrada (Pesca em Alto Mar)', -- 21
'Melhorador dano não sintoniz.', 'Melhorador recompensa não sintoniz.', -- 23
'Plumas de Falcão de Prata', 'Núcleo de pulsação avançada', 'Carta Curinga de Dungeon', -- 26
'Lâmpada de Dragonkin', 'Antiga efígie faminta', 'Poeira harmônica', -- 29
'Tríscele de Cristal', 'Dardo mata-tudo' -- 31
}
-- DO NOT MOVE THESE AROUND
local slotA_rotation = {
18, 22, 17, 2, 15, 8, 1, 9, 8, 5, 11, 18, 21, 25, 2, 14, 25, 17, 14, 3,
8, 5, 9, 21, 5, 11, 21, 19, 25, 17, 14, 3, 17, 2, 3, 5, 1, 9, 21, 19,
11, 18, 19, 24, 2, 14, 22, 1, 14, 3, 5, 1, 9, 21, 8, 20, 21, 19, 20, 14,
14, 3, 1, 17, 3, 5, 17, 6, 21, 19, 20, 14, 19, 24, 14, 18, 22, 1, 17, 6,
5, 1, 6, 19, 8, 20, 18, 21, 20, 14, 18, 22, 1, 17, 15, 8, 17, 6, 8, 5,
20, 14, 21, 25, 14, 18, 25, 17, 17, 6, 8, 5, 6, 19, 5, 11, 18, 21, 25, 17
}
-- DO NOT MOVE THESE AROUND
local slotB_rotation = {
18, 22, 17, 8, 14, 3, 15, 19, 19, 24, 2, 5, 18, 22, 3, 8, 8, 20, 18, 17,
21, 25, 22, 5, 5, 11, 21, 2, 19, 24, 25, 1, 1, 9, 19, 14, 5, 11, 24, 17,
17, 6, 8, 18, 1, 9, 11, 14, 14, 3, 5, 21, 17, 6, 9, 18, 18, 22, 17, 8,
2, 15, 6, 21, 21, 25, 2, 5, 14, 3, 15, 19, 19, 24, 14, 1, 21, 25, 3, 8,
8, 20, 18, 17, 19, 24, 25, 1, 1, 9, 21, 2, 8, 20, 24, 17, 17, 6, 8, 18,
5, 11, 20, 2, 2, 15, 5, 21, 1, 9, 11, 14, 14, 3, 1, 19, 2, 15, 9, 18
}
-- DO NOT MOVE THESE AROUND
local slotC_rotation = {
1, 1, 2, 1, 3, 4, 9, 1, 8, 6, 6, 6, 5, 7, 8, 5, 7, 9, 7, 2,
4, 4, 1, 4, 6, 10, 4, 11, 7, 2, 5, 5, 9, 12, 2, 9, 3, 12, 4, 12
}
-- DO NOT MOVE THESE AROUND
local slotC_itemMap = {
'Lâmpada de Dragonkin', 'Ficha de D&D (semanal)', 'Dardo mata-tudo',
'Presente menaphita (G)', 'Antiga efígie faminta', 'Talismã Funerário Goebie (Grande)',
'Tríscele de Cristal', 'Taijitu', 'Mensagem na garrafa (Pesca em Alto Mar)',
'Melhorador recompensa não sintoniz.', 'Carta Curinga de Dungeon', 'Poeira harmônica',
'Ficha de D&D (mensal)'
}
-- DO NOT MOVE THESE AROUND
local slotC_initial = {
1, 8, 3, 7, 4, 11, 10, 13, 12, 2, 9, 5, 6
}
function slotAB(rot, offsetFromNow)
local rotation = rotations.rotation_days(1, #rot, 39+(offsetFromNow or 0))
local name = itemIDs[rot[rotation]]
local item = items[name]
return name, item
end
function p.slotA(offsetFromNow)
return slotAB(slotA_rotation, offsetFromNow)
end
function p.slotB(offsetFromNow)
return slotAB(slotB_rotation, offsetFromNow)
end
function p.slotC(offsetFromNow)
local rotation = rotations.rotation_days(1, #slotC_rotation, -1+(offsetFromNow or 0))
local current = rotations.rotation_days(40, 13, -1+(offsetFromNow or 0))
local currentItemId = slotC_rotation[rotation]
local outputItemId = ((slotC_initial[currentItemId] + current) % #slotC_itemMap) + 1
local itemName = slotC_itemMap[outputItemId]
local itemDetails = items[itemName]
return itemName, itemDetails
end
function p.api(frame)
local args = frame:getParent().args
return p._api(args.offset, args.format)
end
function p._api(offset, format)
offset = tonumber(offset or 0) or 0
local a, a_d = p.slotA(offset)
local b, b_d = p.slotB(offset)
local c, c_d = p.slotC(offset)
if format == 'simple' then
return string.format('@%s¦%s¦%[email protected]', a, b ,c)
end
if format == 'json' then
local jsonret = {}
jsonret['timestamp'] = os.time()
jsonret['items'] = {
{ name = a, cost = a_d.cost, quantity = a_d.quantity, use = mw.text.encode(a_d.use, '%[%]') },
{ name = b, cost = b_d.cost, quantity = b_d.quantity, use = mw.text.encode(b_d.use, '%[%]') },
{ name = c, cost = c_d.cost, quantity = c_d.quantity, use = mw.text.encode(c_d.use, '%[%]') }
}
return mw.text.jsonEncode(jsonret)
end
local ret = mw.html.create('div')
ret :tag('span')
:addClass('slotA')
:tag('span'):addClass('name'):wikitext(a):done()
:tag('span'):addClass('cost'):wikitext(a_d.cost):done()
:tag('span'):addClass('quantity'):wikitext(a_d.quantity):done()
:tag('span'):addClass('use'):wikitext(a_d.use):done()
:done()
:addClass('slotB')
:tag('span'):addClass('name'):wikitext(b):done()
:tag('span'):addClass('cost'):wikitext(b_d.cost):done()
:tag('span'):addClass('quantity'):wikitext(b_d.quantity):done()
:tag('span'):addClass('use'):wikitext(b_d.use):done()
:done()
:addClass('slotC')
:tag('span'):addClass('name'):wikitext(c):done()
:tag('span'):addClass('cost'):wikitext(c_d.cost):done()
:tag('span'):addClass('quantity'):wikitext(c_d.quantity):done()
:tag('span'):addClass('use'):wikitext(c_d.use):done()
:done()
return ret
end
function makeFullRow(name, details)
local tr = mw.html.create('tr')
local page = details.name or string.format('[[%s]]', name)
tr :tag('td')
:wikitext(string.format('[[Arquivo:%s.png|link=%s]]', name, name))
:addClass('inventory-image')
:done()
:tag('td')
:wikitext(page)
:done()
:tag('td')
:wikitext(coins(details.cost, 'moedas'))
:done()
:tag('td')
:wikitext(details.quantity)
:done()
:tag('td')
:wikitext(details.use)
:done()
return tr
end
function p.today()
local slotA = {p.slotA(0)}
local slotB = {p.slotB(0)}
local slotC = {p.slotC(0)}
return p._today(slotA, slotB, slotC)
end
function p.todayManual(frame)
local args = frame:getParent().args
-- if date is specified, only show manual stock for that date
if args.date == nil or lang:formatDate('F d Y', args.date) == lang:formatDate('F d Y') then
local slotA = args.A or args.a or args[1]
slotA = {slotA, items[slotA]}
local slotB = args.B or args.b or args[2]
slotB = {slotB, items[slotB]}
local slotC = args.C or args.c or args[3]
slotC = {slotC, items[slotC]}
return p._today(slotA, slotB, slotC)
end
return p.today()
end
function p._today(slotA, slotB, slotC)
local t = mw.html.create('table')
t :addClass('wikitable align-center-1 align-center-4')
:tag('tr')
:tag('th')
:wikitext('Objeto')
:attr('colspan', 2)
:done()
:tag('th')
:wikitext('Custo')
:done()
:tag('th')
:wikitext('Quantidade')
:done()
:tag('th')
:wikitext('Uso')
:done()
t :node(makeFullRow('Mapa da ilha inexplorada (Pesca em Alto Mar)', items['Mapa da ilha inexplorada (Pesca em Alto Mar)']))
:node(makeFullRow(slotA[1], slotA[2]))
:node(makeFullRow(slotB[1], slotB[2]))
:node(makeFullRow(slotC[1], slotC[2]))
local cd = mw.html.create('span')
cd :addClass('countdown')
:attr('data-end', 'stop')
:tag('span')
:addClass('countdowndate')
:wikitext(lang:formatDate('F d Y') .. ' 23:59 UTC')
return string.format("''Este é o estoque para %s.'' <sup>%s</sup><br />Válido por %s\n%s", lang:formatDate('[[j F]] [[Y]]'), tostring(purge()), tostring(cd), tostring(t))
end
function makeShortRow(offset, onlyitem)
function plink(img, page)
local link = page or string.format('[[%s]]', img)
return string.format('[[Arquivo:%s.png|link=%s]] %s', img, img, link)
end
local a_n, a_d = p.slotA(offset)
local b_n, b_d = p.slotB(offset)
local c_n, c_d = p.slotC(offset)
local classA, classB, classC = nil,nil,nil
if onlyitem then
local foundonlyitem = false
local highlightclass = 'table-bg-green'
if a_n == onlyitem then
classA = highlightclass
foundonlyitem = true
end
if b_n == onlyitem then
classB = highlightclass
foundonlyitem = true
end
if c_n == onlyitem then
classC = highlightclass
foundonlyitem = true
end
if not foundonlyitem then
return nil
end
end
local tr = mw.html.create('tr')
tr :tag('td')
:wikitext(lang:formatDate('j F Y', string.format('+%s day', offset)))
:done()
:tag('td')
:wikitext(plink(a_n, a_d.name))
:addClass(classA)
:addClass('inventory-image')
:done()
:tag('td')
:wikitext(plink(b_n, b_d.name))
:addClass(classB)
:addClass('inventory-image')
:done()
:tag('td')
:wikitext(plink(c_n, c_d.name))
:addClass(classC)
:addClass('inventory-image')
:done()
return tr
end
function p.future(frame)
local args = frame:getParent().args
local s = args.start or args[1] or 0
local e = args['end'] or args[2] or 5
return p._future(s,e)
end
function p._future(startOffset, endOffset)
-- enforce numbers
startOffset = tonumber(startOffset or 0) or 0
endOffset = tonumber(endOffset or 5) or 5
-- switch around if start/end mixed
if startOffset > endOffset then
startOffset, endOffset = endOffset, startOffset
end
function parseOffsetsToString()
local start_s = math.abs(startOffset) > 1 and 's' or ''
local end_s = math.abs(endOffset) > 1 and 's' or ''
if startOffset == endOffset then
if startOffset > 0 then return string.format('%s dia%s depois de hoje', startOffset, start_s)
elseif startOffset < 0 then return string.format('%s dia%s antes de hoje', startOffset*-1, start_s)
elseif startOffset == 0 then return 'today' end
else
local s = ''
if startOffset > 0 then s = string.format('%s%s dia%s depois de hoje', s, startOffset, start_s)
elseif startOffset < 0 then s = string.format('%s%s dia%s antes de hoje', s, startOffset*-1, start_s)
elseif startOffset == 0 then s = string.format('%shoje', s) end
s = string.format('%s to ', s)
if endOffset > 0 then s = string.format('%s%s dia%s depois de hoje', s, endOffset, end_s)
elseif endOffset < 0 then s = string.format('%s%s dia%s antes de hoje', s, endOffset*-1, end_s)
elseif endOffset == 0 then s = string.format('%shoje', s) end
return s
end
return '(error: start and/or end not numbers)'
end
local t = mw.html.create('table')
t :addClass('wikitable sticky-header')
:tag('tr')
:tag('th')
:wikitext('Data')
:done()
:tag('th')
:wikitext('Espaço A')
:done()
:tag('th')
:wikitext('Espaço B')
:done()
:tag('th')
:wikitext('Espaço C')
:done()
for i=startOffset,endOffset,1 do
t:node(makeShortRow(i))
end
return string.format("Esta tabela é o estoque para %s (%s)<sup>%s</sup>\n%s", parseOffsetsToString(), lang:formatDate('j F Y'), purge(), tostring(t))
end
function p.orderAB()
local t = mw.html.create('table')
t :addClass('wikitable sticky-header mw-collapsible mw-collapsed align-center-1 align-center-4 align-center-7')
:tag('tr')
:tag('th')
:attr('colspan', 11)
:wikitext('Cliclos dos Espaços A e B')
:done()
:done()
:tag('tr')
:tag('th'):wikitext('Day'):done()
:tag('th'):wikitext('Espaço A'):done()
:tag('th'):wikitext('Espaço B'):done()
:tag('th'):attr('rowspan', 41):wikitext(' '):done()
:tag('th'):wikitext('Day'):done()
:tag('th'):wikitext('Espaço A'):done()
:tag('th'):wikitext('Espaço B'):done()
:tag('th'):attr('rowspan', 41):wikitext(' '):done()
:tag('th'):wikitext('Day'):done()
:tag('th'):wikitext('Espaço A'):done()
:tag('th'):wikitext('Espaço B'):done()
for i=1,40,1 do
t :tag('tr')
:tag('td'):wikitext(i):done()
:tag('td'):wikitext(itemIDs[slotA_rotation[i]]):done()
:tag('td'):wikitext(itemIDs[slotB_rotation[i]]):done()
:tag('td'):wikitext(i+40):done()
:tag('td'):wikitext(itemIDs[slotA_rotation[i+40]]):done()
:tag('td'):wikitext(itemIDs[slotB_rotation[i+40]]):done()
:tag('td'):wikitext(i+80):done()
:tag('td'):wikitext(itemIDs[slotA_rotation[i+80]]):done()
:tag('td'):wikitext(itemIDs[slotB_rotation[i+80]]):done()
end
return t
end
function p.orderC()
local t = mw.html.create('table')
t :addClass('wikitable mw-collapsible align-center-1 align-center-2 align-center-3 align-center-4')
:tag('tr')
:tag('th'):attr('colspan', 5):wikitext('Item order (IDs)'):done()
:done()
:tag('tr')
:tag('th'):wikitext('Day'):done()
:tag('th'):wikitext('Item order ID'):done()
:tag('th'):attr('rowspan', 21):wikitext(' '):done()
:tag('th'):wikitext('Day'):done()
:tag('th'):wikitext('Item order ID'):done()
for i=1,20,1 do
t :tag('tr')
:tag('td'):wikitext(i):done()
:tag('td'):wikitext(slotC_rotation[i]):done()
:tag('td'):wikitext(i+20):done()
:tag('td'):wikitext(slotC_rotation[i+20]):done()
end
return t
end
function p.itemsC()
local t = mw.html.create('table')
t :addClass('wikitable mw-collapsible align-center-1')
:tag('tr')
:tag('th'):attr('colspan', 2):wikitext('Item map'):done()
:done()
:tag('tr')
:tag('th'):wikitext('Item map ID'):done()
:tag('th'):wikitext('Item'):done()
for i=1,#slotC_itemMap,1 do
t :tag('tr')
:tag('td'):wikitext(i):done()
:tag('td'):wikitext(slotC_itemMap[i]):done()
end
return t
end
function p.initialC()
local t = mw.html.create('table')
t :addClass('wikitable mw-collapsible align-center-1 align-center-2')
:tag('tr')
:tag('th'):attr('colspan', 3):wikitext('Item initial order'):done()
:done()
:tag('tr')
:tag('th'):wikitext('Item order ID'):done()
:tag('th'):wikitext('Item map ID'):done()
:tag('th'):wikitext('Item map name'):done()
for i=1,#slotC_itemMap,1 do
t :tag('tr')
:tag('td'):wikitext(i):done()
:tag('td'):wikitext(slotC_initial[i]):done()
:tag('td'):wikitext(slotC_itemMap[slotC_initial[i]]):done()
end
return t
end
function p.currentC()
local current = rotations.rotation_days(40, 13, -1)
local t = mw.html.create('table')
t :addClass('wikitable mw-collapsible align-center-1 align-center-2')
:tag('tr')
:tag('th'):attr('colspan', 3):wikitext('Item current order'):done()
:done()
:tag('tr')
:tag('th'):wikitext('Item order ID'):done()
:tag('th'):wikitext('Item map ID'):done()
:tag('th'):wikitext('Item map name'):done()
for i=1,#slotC_itemMap,1 do
local j = ((slotC_initial[i] + current) % 13) + 1
t :tag('tr')
:tag('td'):wikitext(i):done()
:tag('td'):wikitext(j):done()
:tag('td'):wikitext(slotC_itemMap[j]):done()
end
return tostring(t)
end
function p.listItems()
local slotAB_list = {
'Barril de isca', 'Aquário Emaranhado', 'Vara de pescar quebrada',
'Talismã funerário goebie pq.', 'Talismã funerário goebie', 'Presente menaphita (P)',
'Presente menaphita (M)', 'Runa do ar instável', 'Cristal de Anima',
'Cupom VIP de Extermínio', 'Ficha de D&D (diária)', 'Melhorador dano não sintoniz.',
'Argila sagrada (Pesca em Alto Mar)', 'Anima Fragmentada', 'Núcleo de pulsação avançada',
'Planta Vil (Pesca em Alto Mar)', 'Presente do Ceifador', 'Plumas de Falcão de Prata'
}
local slotC_list = {
'Talismã Funerário Goebie (Grande)', 'Mensagem na garrafa (Pesca em Alto Mar)', 'Lâmpada de Dragonkin',
'Carta Curinga de Dungeon', 'Presente menaphita (G)', 'Taijitu',
'Ficha de D&D (semanal)', 'Ficha de D&D (mensal)', 'Antiga efígie faminta',
'Poeira harmônica', 'Tríscele de Cristal', 'Dardo mata-tudo',
'Melhorador recompensa não sintoniz.'
}
local t = mw.html.create('table')
t :addClass('wikitable align-center-1 align-center-4')
:tag('tr')
:tag('th'):attr('colspan', 5):wikitext('Espaço 1 (sempre)'):done()
:done()
:tag('tr')
:tag('th'):attr('colspan', 2):wikitext('Objeto'):done()
:tag('th'):wikitext('Custo'):done()
:tag('th'):wikitext('Quantidade'):done()
:tag('th'):wikitext('Uso'):done()
:done()
:node(makeFullRow('Mapa da ilha inexplorada (Pesca em Alto Mar)', items['Mapa da ilha inexplorada (Pesca em Alto Mar)']))
:tag('tr')
:tag('th'):attr('colspan', 5):wikitext('Espaços 2 e 3'):done()
:done()
:tag('tr')
:tag('th'):attr('colspan', 2):wikitext('Objeto'):done()
:tag('th'):wikitext('Custo'):done()
:tag('th'):wikitext('Quantidade'):done()
:tag('th'):wikitext('Uso'):done()
:done()
for i,v in ipairs(slotAB_list) do
t:node(makeFullRow(v, items[v]))
end
t :tag('tr')
:tag('th'):attr('colspan', 5):wikitext('Espaço 4'):done()
:done()
:tag('tr')
:tag('th'):attr('colspan', 2):wikitext('Objeto'):done()
:tag('th'):wikitext('Custo'):done()
:tag('th'):wikitext('Quantidade'):done()
:tag('th'):wikitext('Uso'):done()
:done()
for i,v in ipairs(slotC_list) do
t:node(makeFullRow(v, items[v]))
end
return t
end
function p.nextItem(frame)
local args = frame:getParent().args
local item = args.item
if not item then
item = mw.title.getCurrentTitle().text
end
return p._nextItem(item, tonumber(args.number), tonumber(args.limit))
end
function p._nextItem(item, n, dayslimit)
local list = {
['Barril de isca'] = 'ab',
['Aquário Emaranhado'] = 'ab',
['Vara de pescar quebrada'] = 'ab',
['Talismã funerário goebie pq.'] = 'ab',
['Talismã funerário goebie'] = 'ab',
['Presente menaphita (P)'] = 'ab',
['Presente menaphita (M)'] = 'ab',
['Runa do ar instável'] = 'ab',
['Cristal de Anima'] = 'ab',
['Cupom VIP de Extermínio'] = 'ab',
['Ficha de D&D (diária)'] = 'ab',
['Melhorador dano não sintoniz.'] = 'ab',
['Argila sagrada (Pesca em Alto Mar)'] = 'ab',
['Anima Fragmentada'] = 'ab',
['Núcleo de pulsação avançada'] = 'ab',
['Planta Vil (Pesca em Alto Mar)'] = 'ab',
['Presente do Ceifador'] = 'ab',
['Plumas de Falcão de Prata'] = 'ab',
['Talismã Funerário Goebie (Grande)'] = 'c',
['Mensagem na garrafa (Pesca em Alto Mar)'] = 'c',
['Lâmpada de Dragonkin'] = 'c',
['Carta Curinga de Dungeon'] = 'c',
['Presente menaphita (G)'] = 'c',
['Taijitu'] = 'c',
['Ficha de D&D (semanal)'] = 'c',
['Ficha de D&D (mensal)'] = 'c',
['Antiga efígie faminta'] = 'c',
['Poeira harmônica'] = 'c',
['Tríscele de Cristal'] = 'c',
['Dardo mata-tudo'] = 'c',
['Melhorador recompensa não sintoniz.'] = 'c'
}
if not list[item] then
return "Objeto não reconhecido ''"..item.."''.Por favor, insira exatamente o nome do objeto."
end
if not n then
n = 5
end
if not dayslimit then
dayslimit = 200
end
local t = mw.html.create('table')
t :addClass('wikitable sticky-header')
:tag('tr')
:tag('th')
:wikitext('Date')
:done()
:tag('th')
:wikitext('Espaço A')
:done()
:tag('th')
:wikitext('Espaço B')
:done()
:tag('th')
:wikitext('Espaço C')
:done()
local d = 0
local count = 0
while count < n and d < dayslimit do
local r = makeShortRow(d, item)
if r then
t:node(r)
count = count + 1
end
d = d + 1
end
local simpleitem = item:lower()
local iteminfo = items[item]
if iteminfo._name then
simpleitem = iteminfo._name
end
local intro = string.format('Esta tabela mostra as próximas %s datas<sup>%s</sup> nas quais %s estará disponível na [[Loja do Mercador Viajante]], onde poderá ser comprado por %s.', count, tostring(purge()), simpleitem, coins(iteminfo.cost, 'nocoinsc'))
return intro .. '\n' .. tostring(t)
end
function makeIconRow(slotAname, slotBname, slotCname)
local m_n = 'Mapa da ilha inexplorada (Pesca em Alto Mar)'
local tr = mw.html.create('tr')
tr :tag('td')
:wikitext(string.format('[[Arquivo:%s.png|link=%s]]', m_n, m_n))
:addClass('inventory-image')
:done()
:tag('td')
:wikitext(string.format('[[Arquivo:%s.png|link=%s]]', slotAname, slotAname))
:addClass('inventory-image')
:done()
:tag('td')
:wikitext(string.format('[[Arquivo:%s.png|link=%s]]', slotBname, slotBname))
:addClass('inventory-image')
:done()
:tag('td')
:wikitext(string.format('[[Arquivo:%s.png|link=%s]]', slotCname, slotCname))
:addClass('inventory-image')
:done()
return tr
end
function p.todayIcons()
local slotA, _ = p.slotA(0)
local slotB, _ = p.slotB(0)
local slotC, _ = p.slotC(0)
return p._todayIcons(slotA, slotB, slotC)
end
function p.todayIconsManual(frame)
local args = frame:getParent().args
-- if date is specified, only show manual icons for that date
if args.date == nil or lang:formatDate('F d Y', args.date) == lang:formatDate('F d Y') then
local slotA = args.A or args.a or args[1]
local slotB = args.B or args.b or args[2]
local slotC = args.C or args.c or args[3]
return p._todayIcons(slotA, slotB, slotC)
end
return p.todayIcons()
end
function p._todayIcons(slotAname, slotBname, slotCname)
local t = mw.html.create('table')
t :addClass('wikitable align-center-1 align-center-4')
:tag('tr')
:tag('th')
:wikitext(string.format('Estoque para %s', lang:formatDate('[[j F]] [[Y]]')))
:attr('colspan', 4)
:done()
t :node(makeIconRow(slotAname, slotBname, slotCname))
return t
end
return p