Warframe вики
Warframe вики
5861
страница
мНет описания правки
мНет описания правки
(не показаны 4 промежуточные версии этого же участника)
Строка 1: Строка 1:
 
--WARFRAME Wiki Таблица Реликвий
 
--WARFRAME Wiki Таблица Реликвий
--http://warframe.wikia.com/
+
--http://warframe.fandom.com/ru
--Written by User:ChickenBar from EN wiki
+
--Написано пользователем:ChickenBar с EN wiki (Written by User:ChickenBar from EN wiki)
--Rus localization by User:Max.Archy
+
--Локализовано на русский User:Max.Archy (Rus localization by User:Max.Archy)
   
  +
--Из-за особенностей языка применение русских символов в переменных функций не допускается
local p = {}
 
   
 
local p = {}
local VoidData = mw.loadData( 'Module:Void/data' )
 
  +
--здесь и далее пометки об исходных именах
local Icon = require( "Module:Icon" )
 
 
local VoidData = mw.loadData( 'Модуль:Бездна/Данные' ) --Void/data
local Shared = require( "Module:Shared" )
 
  +
local Icon = require( "Модуль:Иконки" ) --Module:Icon
  +
local Shared = require( "Модуль:БазаФункций" ) --Module:Shared
   
 
local TxtColors = {Common = '#9C7344', Uncommon = '#D3D3D3', Rare = '#D1B962'}
 
local TxtColors = {Common = '#9C7344', Uncommon = '#D3D3D3', Rare = '#D1B962'}
   
local tooltipStart = "<span class=\"relic-tooltip\" data-param=\""
+
local tooltipStart = "<span class=\"relic-tooltip\" data-param=\"" --<<<<<<<<<<<<<
 
local tooltipCenter = "\">"
 
local tooltipCenter = "\">"
 
local tooltipEnd = "</span>"
 
local tooltipEnd = "</span>"
   
  +
-- Дополняет название окончанием "Прайм" за исключением Формы
-- Преобразует название в необходимое
 
  +
-- Позволяет базу данных заполнять без этой приписки >>>>>>>>>а надо ли?
 
-- Например, "Латрон" преобразует в "Латрон Прайм"
 
-- Например, "Латрон" преобразует в "Латрон Прайм"
 
function p.getItemName(itemStr)
 
function p.getItemName(itemStr)
 
caseItem = string.gsub(itemStr, "(%a)([%w_']*)", Shared.titleCase)
 
caseItem = string.gsub(itemStr, "(%a)([%w_']*)", Shared.titleCase)
if(itemStr ~= "FORMA") then
+
if(itemStr ~= "ФОРМА") then
caseItem = caseItem.." Prime"
+
caseItem = caseItem.." Прайм"
 
end
 
end
 
return caseItem
 
return caseItem
Строка 51: Строка 54:
   
 
--На текущий момент все реликвии совпадают на всех платформах
 
--На текущий момент все реликвии совпадают на всех платформах
--Задел на будущее, если появятся расхождения
+
--Задел на будущее, если появятся расхождения в Реликвиях по разным платформам
 
function p.isRelicOnPlatform(Relic, Platform)
 
function p.isRelicOnPlatform(Relic, Platform)
 
local Platforms = Relic.Platforms
 
local Platforms = Relic.Platforms
Строка 67: Строка 70:
 
end
 
end
   
  +
--Возвращает Категорию редкости выпадения элемента списка выпадения реликвии,
--Returns the rarity if a relic drops a part
 
  +
--если это часть или чертеж, иначе возвращает "пусто"
--Otherwise, returns nil
 
 
function p.getRelicDropRarity(Relic, item, part)
 
function p.getRelicDropRarity(Relic, item, part)
 
for i, drop in pairs(Relic.Drops) do
 
for i, drop in pairs(Relic.Drops) do
Строка 79: Строка 82:
 
end
 
end
   
  +
--Возвращает иконку элемента
--Returns the part icon for a drop
 
  +
--(например, при входных данных Брэйтон Прайм Ствол вернет Прайм_Ствол_иконка)
--(IE Braton Prime Barrel returns the Prime Barrel icon)
 
 
function p.getPartIconForDrop(drop)
 
function p.getPartIconForDrop(drop)
 
local iName = p.getItemName(drop.Item)
 
local iName = p.getItemName(drop.Item)
 
local pName = p.getPartName(drop.Part)
 
local pName = p.getPartName(drop.Part)
local iconSize =''
+
local iconSize ='50'
local primeToggle = 'Prime '
+
local primeToggle = '_Прайм'
  +
if iName == 'Forma' then
+
if iName == 'Одоната Прайм' then
iconSize = '43'
 
 
if pName == 'Упряж' or pName == 'Система' or pName == 'Крылья' then
else
 
 
primeToggle = '_Арчвинг' --'Archwing '
iconSize = '54'
 
end
 
 
if iName == 'Odonata Prime' then
 
if pName == 'Harness Blueprint' or pName == 'Systems Blueprint' or pName == 'Wings Blueprint' then
 
primeToggle = 'Archwing '
 
 
end
 
end
elseif pName == 'Carapace' or pName == 'Cerebrum' or pName == 'Systems' then
+
-- elseif pName == 'Carapace' or pName == 'Cerebrum' or pName == 'Systems' then
primeToggle = ''
+
-- primeToggle = ''
 
end
 
end
 
 
 
local icon =''
 
local icon =''
if(pName == 'Blueprint') then
+
if(pName == 'Чертеж') then --'Blueprint'
 
icon = Icon._Prime(Shared.titleCase(drop.Item), nil,iconSize)
 
icon = Icon._Prime(Shared.titleCase(drop.Item), nil,iconSize)
elseif iName == 'Kavasa Prime' then
+
elseif iName == 'Каваса Прайм' then --'Kavasa Prime'
icon = Icon._Prime('Kavasa', nil,iconSize)
+
icon = Icon._Prime('Каваса Прайм', nil,iconSize) --'Kavasa'
 
else
 
else
icon = Icon._Item(primeToggle..pName,"",iconSize)
+
icon = Icon._Item(pName..primeToggle,"",iconSize)
 
end
 
end
 
 
Строка 112: Строка 110:
 
end
 
end
   
  +
--Возвращает наименование для иконки Оружия, Варфрейма и т.д.
--Returns the item icon for a drop
 
  +
--(например, при входных данных Брэйтон Прайм Ствол вернет Брэйтон_Прайм)
--(IE Braton Prime Barrel returns the Braton Prime icon)
 
 
function p.getItemIconForDrop(drop)
 
function p.getItemIconForDrop(drop)
 
local iName = p.getItemName(drop.Item)
 
local iName = p.getItemName(drop.Item)
 
local pName = p.getPartName(drop.Part)
 
local pName = p.getPartName(drop.Part)
local iconSize =''
+
local iconSize ='40'
  +
if iName == 'Forma' then
 
iconSize = '38'
 
else
 
iconSize = '38'
 
end
 
 
 
local icon =''
 
local icon =''
 
icon = Icon._Prime(Shared.titleCase(drop.Item), nil, iconSize)
 
icon = Icon._Prime(Shared.titleCase(drop.Item), nil, iconSize)
Строка 138: Строка 131:
 
return p._item(item_type,item_part,relic_tier,platform)
 
return p._item(item_type,item_part,relic_tier,platform)
 
end
 
end
  +
----------------------------------------------------------
 
  +
--ПРОПИСАТЬ ПЕРЕНАЗНАЧЕНИЕ ДЛЯ ПРОЧИХ ЭЛЕМЕНТОВ ЧАСТЕЙ!!!!
  +
--Ж--Ж-ЖЖЖ----ЖЖ---Ж--ЖЖЖ-Ж---Ж-ЖЖЖЖЖ-Ж----Ж-Ж-Ж
  +
--Ж--*-Ж-----Ж--Ж-Ж-Ж-Ж---Ж---Ж---Ж---Ж----Ж-Ж-Ж
  +
--ЖЖЖЖ-ЖЖЖ-----Ж--ЖЖЖ-ЖЖЖ-ЖЖЖ-Ж---Ж---ЖЖЖ--Ж-Ж-Ж
  +
--Ж--Ж-Ж-----Ж--Ж-Ж-Ж-Ж-Ж-Ж-Ж-Ж---Ж---Ж-Ж-------
  +
--Ж--Ж-ЖЖЖ----ЖЖ--Ж-Ж-ЖЖЖ-ЖЖЖ-Ж---Ж---ЖЖЖ--Ж-Ж-Ж
  +
----------------------------------------------------------
 
function p._item(item_type,item_part,relic_tier,platform)
 
function p._item(item_type,item_part,relic_tier,platform)
 
item_type = string.upper(item_type)
 
item_type = string.upper(item_type)
 
item_part = string.upper(item_part)
 
item_part = string.upper(item_part)
if (item_part == "HELMET BLUEPRINT") then
+
--- if (item_part == "HELMET BLUEPRINT") then
item_part = "NEUROPTICS BLUEPRINT"
+
--- item_part = "NEUROPTICS BLUEPRINT"
end
+
--- end
  +
--пока что уберу, так как наименования Шлем не должно быть
 
local locations = {}
 
local locations = {}
 
local vaultLocations = {}
 
local vaultLocations = {}
 
local i
 
local i
for i, relic in pairs(VoidData["Relics"]) do
+
for i, relic in pairs(VoidData["Relics"]) do --Русификация???? <<<<<<<<<<<<<<<
 
if(p.isRelicOnPlatform(relic, platform) and (relic_tier == nil or relic.Tier == relic_tier)) then
 
if(p.isRelicOnPlatform(relic, platform) and (relic_tier == nil or relic.Tier == relic_tier)) then
 
local dropRarity = p.getRelicDropRarity(relic, item_type, item_part)
 
local dropRarity = p.getRelicDropRarity(relic, item_type, item_part)
Строка 155: Строка 156:
 
local relicString = tooltipStart..relicText..tooltipCenter.."[["..relicText.."]]"..tooltipEnd.." "..dropRarity
 
local relicString = tooltipStart..relicText..tooltipCenter.."[["..relicText.."]]"..tooltipEnd.." "..dropRarity
 
if(relic.IsVaulted == 1) then
 
if(relic.IsVaulted == 1) then
relicString = relicString.." ([[Prime Vault|V]])"
+
relicString = relicString.." ([[Прайм Хранилище|Пр.хр.]])" --Prime Vault|V
 
table.insert(vaultLocations, relicString)
 
table.insert(vaultLocations, relicString)
 
else
 
else
 
if(relic.IsBaro == 1) then
 
if(relic.IsBaro == 1) then
relicString = relicString.." ([[Baro Ki%27Teer|B]])"
+
relicString = relicString.." ([[Баро Ки%27Тир|Баро]])" --Baro Ki%27Teer|B
 
end
 
end
 
table.insert(locations, relicString)
 
table.insert(locations, relicString)
Строка 184: Строка 185:
 
 
 
local theRelic = p.getRelic(Tier, RName)
 
local theRelic = p.getRelic(Tier, RName)
if(theRelic == nil) then return 'ERROR: No relic found' end
+
if(theRelic == nil) then return 'ОШИБКА: Данная реликвия не найдена' end
 
-- if(not p.isRelicOnPlatform(theRelic, Platform)) then return "ERROR: That relic isn't on that platform" end
 
-- if(not p.isRelicOnPlatform(theRelic, Platform)) then return "ERROR: That relic isn't on that platform" end
if(not p.isRelicOnPlatform(theRelic, Platform)) then return "ERROR: Эта реликвия не найдена для данной платформы" end
+
if(not p.isRelicOnPlatform(theRelic, Platform)) then return "ОШИБКА: Эта реликвия не найдена для данной платформы" end
 
 
 
local result = '{|'
 
local result = '{|'
Строка 223: Строка 224:
 
local number = frame.args ~= nil and frame.args[3] or nil
 
local number = frame.args ~= nil and frame.args[3] or nil
 
if number == nil then
 
if number == nil then
  +
--\количество по умолчанию 1, если не указано
--The number of the drop defaults to 1 if not set
 
 
number = 1
 
number = 1
 
elseif type(number) == 'string' then
 
elseif type(number) == 'string' then
  +
--Принудительное преобразование типа "строка" в "числовое"
--If the argument is a string, force it into being a number
 
 
number = tonumber(number)
 
number = tonumber(number)
 
end
 
end
 
 
  +
--Платформа как отдельный аргумент. По умолчанию для PC не указывается
--Platform comes from a special argument. Defaults to PC if not set
 
 
local platform = frame.args ~= nil and frame.args.platform or nil
 
local platform = frame.args ~= nil and frame.args.platform or nil
 
if platform == nil then platform = 'PC' end
 
if platform == nil then platform = 'PC' end
 
 
  +
--Возвращает ошибку при отсутствии любой требуемой переменной
--Return an error if any arguments are missing
 
 
if relicName == nil or relicName == '' then
 
if relicName == nil or relicName == '' then
  +
return "ОШИБКА: Не задана переменная 'Название реликвии'" --Relic Name
return "ERROR: Missing argument 'Relic Name'"
 
 
elseif rarity == nil or rarity == '' then
 
elseif rarity == nil or rarity == '' then
  +
return "ОШИБКА: Не задана переменная 'Категория редкости'" --Rarity
return "ERROR: Missing argument 'Rarity'"
 
 
end
 
end
 
 
Строка 247: Строка 248:
 
local theRelic = p.getRelic(Tier, RName)
 
local theRelic = p.getRelic(Tier, RName)
 
 
  +
--Возвращает ошибку если имя реликвии некорректно
--Return an error if the relic wasn't found
 
 
if theRelic == nil then
 
if theRelic == nil then
return "ERROR: Invalid relic '"..relicName.."'"
+
return "ОШИБКА: Некорректное название реликвии '"..relicName.."'"
 
end
 
end
 
 
 
local count = 0
 
local count = 0
 
for i, drop in pairs(theRelic.Drops) do
 
for i, drop in pairs(theRelic.Drops) do
  +
--Цикл по базе реликвий для поиска Части, Чертежа в соответствии
--Loop through the drops to find drops of the chosen rarity
 
  +
--с заданной категорией редкости
 
if drop.Rarity == rarity then
 
if drop.Rarity == rarity then
 
count = count + 1
 
count = count + 1
  +
--В случае достижения необходимого количества возвращает Иконку + Название предмета
--Once enough drops of the right kind have been found, return the icon + the item name
 
 
if count == number then
 
if count == number then
 
local iName = p.getItemName(drop.Item)
 
local iName = p.getItemName(drop.Item)
Строка 268: Строка 270:
 
end
 
end
   
  +
--Если добрались до данной строки кода, значит найдено
--If we got to here, there weren't enough drops of that rarity for this relic.
 
  +
--недостаточное количество предметов заданной категории редкости
return "ERROR: Only found "..count.." drops of "..rarity.." rarity for "..relicName
 
  +
return "ОШИБКА: Найдено только "..count.." предметов категории редкости "..rarity.." для реликвии "..relicName
 
end
 
end
   
Строка 275: Строка 278:
 
local total = 0
 
local total = 0
 
 
if(Shared.contains(frame.args, "unvaulted")) then
+
if(Shared.contains(frame.args, "unvaulted")) then --русификация?
 
for _,relic in pairs(VoidData["Relics"]) do
 
for _,relic in pairs(VoidData["Relics"]) do
 
if(relic.IsVaulted == 0) then
 
if(relic.IsVaulted == 0) then
Строка 282: Строка 285:
 
end
 
end
 
end
 
end
if(Shared.contains(frame.args, "vaulted")) then
+
if(Shared.contains(frame.args, "vaulted")) then --русификация?
 
for _,relic in pairs(VoidData["Relics"]) do
 
for _,relic in pairs(VoidData["Relics"]) do
 
if(relic.IsVaulted == 1) then
 
if(relic.IsVaulted == 1) then
Строка 289: Строка 292:
 
end
 
end
 
end
 
end
if(Shared.contains(frame.args, "baro")) then
+
if(Shared.contains(frame.args, "baro")) then --русификация?
 
for _,relic in pairs(VoidData["Relics"]) do
 
for _,relic in pairs(VoidData["Relics"]) do
 
if(relic.IsBaro == 1) then
 
if(relic.IsBaro == 1) then
Строка 304: Строка 307:
   
 
local function relicData()
 
local function relicData()
--This is snatched from m:VoidByReward p.byReward
+
--Поиск в базе Бездны m:VoidByReward p.byReward
 
local data = {}
 
local data = {}
 
 
 
for _, relic in pairs(VoidData["Relics"]) do
 
for _, relic in pairs(VoidData["Relics"]) do
for i, drop in pairs(relic.Drops) do
+
for i, drop in pairs(Relic.Drops) do
 
local newObj = {Tier = relic.Tier, Name = relic.Name, Rarity = drop.Rarity, IsVaulted = relic.IsVaulted == 1, IsBaro = relic.IsBaro == 1}
 
local newObj = {Tier = relic.Tier, Name = relic.Name, Rarity = drop.Rarity, IsVaulted = relic.IsVaulted == 1, IsBaro = relic.IsBaro == 1}
 
if (data[drop.Item] == nil) then
 
if (data[drop.Item] == nil) then
Строка 356: Строка 359:
 
 
 
if itemName == nil or itemName == '' then
 
if itemName == nil or itemName == '' then
return 'Item name missing'
+
return 'Имя предмета не найдено'
 
elseif partName == nil or partName == '' then
 
elseif partName == nil or partName == '' then
return 'Part name missing'
+
return 'Имя части не найдено'
 
end
 
end
 
return p._getDucatValue(itemName, partName)
 
return p._getDucatValue(itemName, partName)
Строка 364: Строка 367:
   
 
function p._getDucatValue(itemName, partName, data)
 
function p._getDucatValue(itemName, partName, data)
  +
--Подсчитывает стоимость в дукатах. Некоторые не подчиняются правилу (Обычные=15, Обычные+Необычные=25, Необычные=45, Необычные+Редкие=65 и Редкие=100) поэтому их стоимость определяют вручную до вызова функции "getItemRarities" для аовышения эффективности.
--Calculating the ducat value of an item. A few don't follow the rule of (common=15, uncommon=45, rare=100, common+uncommon=25, uncommon+rare=65) so they are handled before calling "getItemRarities" for a slight efficiency gain.
 
 
--A small local function for checking if the two strings match.
 
--A small local function for checking if the two strings match.
 
local function uCheck(name, expected)
 
local function uCheck(name, expected)
Строка 372: Строка 375:
 
return false
 
return false
 
end
 
end
  +
-->>>>отрихтовать<<<<<<<<
 
if uCheck(itemName, 'Soma') and uCheck(partName, 'Blueprint') then
+
if uCheck(itemName, 'Сома') and uCheck(partName, 'Чертеж') then
 
return 15
 
return 15
elseif uCheck(itemName, 'Braton') and uCheck(partName, 'Stock') then
+
elseif uCheck(itemName, 'Брэйтон') and uCheck(partName, 'Ствол') then --Stock
 
return 15
 
return 15
elseif uCheck(itemName, 'Akstiletto') and uCheck(partName, 'Receiver') then
+
elseif uCheck(itemName, 'Акстилетто') and uCheck(partName, 'Приёмник') then
 
return 45
 
return 45
elseif uCheck(itemName, 'Rubico') and uCheck(partName, 'Stock') then
+
elseif uCheck(itemName, 'Рубико') and uCheck(partName, 'Ствол') then
 
return 45
 
return 45
elseif uCheck(itemName, 'Saryn') and uCheck(partName, 'Neuroptics Blueprint') then
+
elseif uCheck(itemName, 'Сарина') and uCheck(partName, 'Нейрооптика Чертеж') then
 
return 45
 
return 45
elseif uCheck(itemName, 'Ankyros') and uCheck(partName, 'Blade') then
+
elseif uCheck(itemName, 'Анкирос') and uCheck(partName, 'Лезвие') then
 
return 65
 
return 65
elseif uCheck(itemName, 'Rhino') and uCheck(partName, 'Chassis Blueprint') then
+
elseif uCheck(itemName, 'Рино') and uCheck(partName, 'Каркас Чертеж') then
 
return 65
 
return 65
elseif uCheck(itemName, 'Valkyr') and uCheck(partName, 'Systems Blueprint') then
+
elseif uCheck(itemName, 'Валькирия') and uCheck(partName, 'Система Чертеж') then
 
return 100
 
return 100
 
end
 
end
Строка 397: Строка 400:
 
local lenght = Shared.tableCount(rarities)
 
local lenght = Shared.tableCount(rarities)
 
 
  +
--Проверка подпадает ли под обозначенную Редкость
 
--For checking whether the table contains a dictionary of the particular rarity.
 
--For checking whether the table contains a dictionary of the particular rarity.
 
local function tableContains(table, rarity)
 
local function tableContains(table, rarity)
Строка 407: Строка 411:
 
end
 
end
 
 
  +
--Проверка к какой Редкости принадлежит для определения корректной стоимости в Дукатах
 
--Checking whether the lenght of table "rarities" is 1 or 2 and accordingly perform more checks to assing the correct ducat value.
 
--Checking whether the lenght of table "rarities" is 1 or 2 and accordingly perform more checks to assing the correct ducat value.
 
if lenght == 1 then
 
if lenght == 1 then
Строка 429: Строка 434:
 
end
 
end
   
  +
--Подсчет общей стоимости в Дукатах
 
function p.getTotalDucats(frame)
 
function p.getTotalDucats(frame)
 
local tierName = frame.args ~= nil and frame.args[1]
 
local tierName = frame.args ~= nil and frame.args[1]
 
local data = relicData()
 
local data = relicData()
local totalItemCount = 0 --counting all items
+
local totalItemCount = 0 --все предметы
local withoutFormaCount = 0 --counting all items excluding forma
+
local withoutFormaCount = 0 --все предметы, за исключением Формы
local totalDucats = 0 --all, including duplicates, itemDucats
+
local totalDucats = 0 --всего в Дукатах
local availableDucats = 0 --total ducats for items from available relics
+
local availableDucats = 0 --всего в Дукатах для всех доступных предметов
local availableItems = 0 --available items
+
local availableItems = 0 --доступные предметы
local availableItemsEF = 0 --available items excluding forma
+
local availableItemsEF = 0 --доступные предметы, за исключением Формы
local vaultedDucats = 0 --total ducats for items from vaulted relics
+
local vaultedDucats = 0 --всего в Дукатах для предметов из Реликвий в Хранилище
local vaultedItems = 0 --vaulted items
+
local vaultedItems = 0 --предметы из Реликвий в Хранилище
local vaultedItemsEF = 0 --vaulted items excluding forma
+
local vaultedItemsEF = 0 --предметы из Реликвий в Хранилище, за исключением Формы
 
local result = ''
 
local result = ''
 
 
Строка 454: Строка 460:
 
 
 
totalItemCount = totalItemCount + 1
 
totalItemCount = totalItemCount + 1
if item ~= 'FORMA' then
+
if item ~= 'Форма' then
 
local tempDucat =p._getDucatValue(item, part, data)
 
local tempDucat =p._getDucatValue(item, part, data)
 
totalDucats = totalDucats + tempDucat
 
totalDucats = totalDucats + tempDucat
Строка 472: Строка 478:
 
 
 
if tierName then
 
if tierName then
result = "'''Average Ducats Value'''&#58; "..Icon._Item('Ducats').."'''"..Shared.round((totalDucats / totalItemCount),2).."''' ("..totalItemCount..' rewards with '..withoutFormaCount..' parts)'
+
result = "'''Средняя стоимость составляет'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.round((totalDucats / totalItemCount),2).."''' ("..totalItemCount..' наград с '..withoutFormaCount..' частями)'
result = result.."<br>'''Available'''&#58; "..Icon._Item('Ducats').."'''"..Shared.round((availableDucats/availableItems),2).."''' ("..availableItems..' rewards with '..availableItemsEF..' parts)'
+
result = result.."<br>'''Стоимость доступных составляет'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.round((availableDucats/availableItems),2).."''' ("..availableItems..' наград с '..availableItemsEF..' частей)'
result = result.." | '''Vaulted'''&#58; "..Icon._Item('Ducats').."'''"..Shared.round((vaultedDucats/vaultedItems),2).."''' ("..vaultedItems..' rewards with '..vaultedItemsEF..' parts)'
+
result = result.." | '''Запечато в Хранилище'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.round((vaultedDucats/vaultedItems),2).."''' ("..vaultedItems..' наград с '..vaultedItemsEF..' частей)' --<<<<<<<<<<<<<ЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖ
 
else
 
else
result = "'''Total Ducats Value'''&#58; "..Icon._Item('Ducats').."'''"..Shared.formatnum(totalDucats).."''' ("..totalItemCount..' rewards with '..withoutFormaCount..' parts)'
+
result = "'''Общач стоимость составляет'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.formatnum(totalDucats).."''' ("..totalItemCount..' наград с '..withoutFormaCount..' частей)'
result = result.."<br>'''Available'''&#58; "..Icon._Item('Ducats').."'''"..Shared.formatnum(availableDucats).."''' ("..availableItems..' rewards with '..availableItemsEF..' parts)'
+
result = result.."<br>'''Доступно'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.formatnum(availableDucats).."''' ("..availableItems..' наград с '..availableItemsEF..' частей)'
result = result.." | '''Vaulted'''&#58; "..Icon._Item('Ducats').."'''"..Shared.formatnum(vaultedDucats).."''' ("..vaultedItems..' rewards with '..vaultedItemsEF..' parts)'
+
result = result.." | '''Запечато в Хранилище'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.formatnum(vaultedDucats).."''' ("..vaultedItems..' наград с '..vaultedItemsEF..' частей)'
 
end
 
end
 
 
Строка 501: Строка 507:
 
local relicString = tooltipStart..relicText..tooltipCenter.."[["..relicText.."]]"..tooltipEnd.." "..dropRarity
 
local relicString = tooltipStart..relicText..tooltipCenter.."[["..relicText.."]]"..tooltipEnd.." "..dropRarity
 
if drop.IsVaulted then
 
if drop.IsVaulted then
relicString = relicString.." ([[Prime Vault|V]])"
+
relicString = relicString.." ([[Прайм хранилище|Пр.хр.]])"
 
table.insert(vaultLocations, relicString)
 
table.insert(vaultLocations, relicString)
 
else
 
else
 
if drop.IsBaro then
 
if drop.IsBaro then
relicString = relicString.." ([[Baro Ki%27Teer|B]])"
+
relicString = relicString.." ([[Баро Ки%27Тиир|Баро]])"
 
end
 
end
 
table.insert(locations, relicString)
 
table.insert(locations, relicString)
Строка 522: Строка 528:
   
 
if itemName == nil or itemName == '' or partName == nil or partName == '' then
 
if itemName == nil or itemName == '' or partName == nil or partName == '' then
return 'Please enter item and part names'
+
return 'Пожалуйста введите название предметов и частей'
 
end
 
end
 
 
 
--first cell
 
--first cell
if partName == 'Blueprint' then
+
if partName == 'Чертеж' then
 
sortValue = itemName..' _'..partName
 
sortValue = itemName..' _'..partName
 
else
 
else
Строка 533: Строка 539:
 
local cell1 = '\n|data-sort-value="'..sortValue..'"|'..Icon._Prime(itemName,partName)
 
local cell1 = '\n|data-sort-value="'..sortValue..'"|'..Icon._Prime(itemName,partName)
 
local cell2 = '\n|'..createRelicText(itemName, partName, tierName, data)
 
local cell2 = '\n|'..createRelicText(itemName, partName, tierName, data)
local cell3 = '\n|data-sort-value="'..ducatValue..'"|'..Icon._Item('Ducats').."'''"..ducatValue.."'''\n|-"
+
local cell3 = '\n|data-sort-value="'..ducatValue..'"|'..Icon._Item('Дукаты').."'''"..ducatValue.."'''\n|-"
 
 
 
return cell1..cell2..cell3
 
return cell1..cell2..cell3
Строка 548: Строка 554:
 
 
 
for item, parts in Shared.skpairs(data) do
 
for item, parts in Shared.skpairs(data) do
if item ~= 'FORMA' then
+
if item ~= 'Форма' then
 
for part, drops in Shared.skpairs(parts) do
 
for part, drops in Shared.skpairs(parts) do
 
for i, drop in pairs(drops) do
 
for i, drop in pairs(drops) do
 
if drop.Tier == tierName or tierName == nil then
 
if drop.Tier == tierName or tierName == nil then
 
local tempName = ''
 
local tempName = ''
if part == 'BLUEPRINT' then
+
if part == 'Чертеж' then
 
tempName = Shared.titleCase(item..'<> '..part)
 
tempName = Shared.titleCase(item..'<> '..part)
 
else
 
else
Строка 559: Строка 565:
 
end
 
end
 
if not Shared.contains(itemList, tempName) then
 
if not Shared.contains(itemList, tempName) then
if listMode == 'VAULTED' then
+
if listMode == 'Недоступно' then
 
if drop.isBaro or drop.IsVaulted then
 
if drop.isBaro or drop.IsVaulted then
 
table.insert(itemList, tempName)
 
table.insert(itemList, tempName)
 
end
 
end
elseif listMode == 'UNVAULTED' then
+
elseif listMode == 'Доступно' then
 
if not drop.IsBaro and not drop.IsVaulted then
 
if not drop.IsBaro and not drop.IsVaulted then
 
table.insert(itemList, tempName)
 
table.insert(itemList, tempName)

Версия от 16:09, 16 февраля 2020

Модуль:Реликвия
Возрождение
Данные

Таблица Реликвий. Аналог Module:Void с англовики. Использует базу данных Модуль:Реликвия/Данные
Написано пользователями User:ChickenBar & Участник:Zero_Leaf
Локализовано пользователем User:Max.archy (Localized by User:Max.archy )

Список функций

Для внешнего вызова:

basicDucatsTable
drawLegacyBox
drawModernBox
getAcquisitionText
getAllParts
getRelicTotal
printEra
relicList
templateIconIntegration
translitAttempt

(Модуль:Реликвия/doc)


--WARFRAME Wiki Таблица Реликвий
--http://warframe.fandom.com/ru
--Написано пользователем:ChickenBar с EN wiki (Written by User:ChickenBar from EN wiki)
--Локализовано на русский User:Max.Archy (Rus localization by User:Max.Archy)

--Из-за особенностей языка применение русских символов в переменных функций не допускается

local p = {}
                                                        --здесь и далее пометки об исходных именах
local VoidData = mw.loadData( 'Модуль:Бездна/Данные' )  --Void/data
local Icon = require( "Модуль:Иконки" )                 --Module:Icon
local Shared = require( "Модуль:БазаФункций" )          --Module:Shared

local TxtColors = {Common = '#9C7344', Uncommon = '#D3D3D3', Rare = '#D1B962'}

local tooltipStart = "<span class=\"relic-tooltip\" data-param=\"" --<<<<<<<<<<<<<
local tooltipCenter = "\">"
local tooltipEnd = "</span>"

-- Дополняет название окончанием "Прайм" за исключением Формы
-- Позволяет базу данных заполнять без этой приписки >>>>>>>>>а надо ли?
-- Например, "Латрон" преобразует в "Латрон Прайм"
function p.getItemName(itemStr)
    caseItem = string.gsub(itemStr, "(%a)([%w_']*)", Shared.titleCase)
    if(itemStr ~= "ФОРМА") then
        caseItem = caseItem.." Прайм"
    end
    return caseItem
end
 
-- Преобразует название части (Converts part names in data to proper casing)
function p.getPartName(partStr, keepBlueprint)
    --Дополнение пользователя:
    --User:Falterfire 6/19/2018:
    --      New parameter to remove ' Blueprint' if wanted
    --      IE returns 'Neuroptics' instead of 'Neuroptics Blueprint'
    if keepBlueprint == nil then keepBlueprint = true end
    local result = string.gsub(partStr, "(%a)([%w_']*)", Shared.titleCase)
    if not keepBlueprint and Shared.contains(result, ' Blueprint') then
        result = string.gsub(result, ' Blueprint', '')
    end
    return result
end

--Получение Реликвии с определенным названием в базе "Бездна/Данные"
function p.getRelic(Tier, Name)
    for i, relic in pairs(VoidData["Relics"]) do
        if (relic.Tier == Tier and relic.Name == Name) then
            return relic
        end
    end
    return nil
end

--На текущий момент все реликвии совпадают на всех платформах
--Задел на будущее, если появятся расхождения в Реликвиях по разным платформам
function p.isRelicOnPlatform(Relic, Platform)
    local Platforms = Relic.Platforms
    if(Platforms == nil) then
        return true
    else
        local foundIt = false
        for i, plat in pairs(Platforms) do
            if (plat == Platform) then
                foundIt = true
            end
        end
        return foundIt
    end
end

--Возвращает Категорию редкости выпадения элемента списка выпадения реликвии,
--если это часть или чертеж, иначе возвращает "пусто"
function p.getRelicDropRarity(Relic, item, part)
    for i, drop in pairs(Relic.Drops) do
        if ( drop.Item == item and drop.Part == part) then
            return drop.Rarity
        end
    end
    
    return nil
end

--Возвращает иконку элемента
--(например, при входных данных Брэйтон Прайм Ствол вернет Прайм_Ствол_иконка)
function p.getPartIconForDrop(drop)
    local iName = p.getItemName(drop.Item)
    local pName = p.getPartName(drop.Part)
    local iconSize ='50'
    local primeToggle = '_Прайм'

    if iName == 'Одоната Прайм' then
        if pName == 'Упряж' or pName == 'Система' or pName == 'Крылья' then
            primeToggle = '_Арчвинг'                                --'Archwing '
        end
--    elseif pName == 'Carapace' or pName == 'Cerebrum' or pName == 'Systems' then
--        primeToggle = ''
    end
    
    local icon =''
    if(pName == 'Чертеж') then                                      --'Blueprint'
        icon = Icon._Prime(Shared.titleCase(drop.Item), nil,iconSize)
    elseif iName == 'Каваса Прайм' then                             --'Kavasa Prime'
        icon = Icon._Prime('Каваса Прайм', nil,iconSize)                  --'Kavasa'
    else
        icon = Icon._Item(pName..primeToggle,"",iconSize)
    end
    
    return icon
end

--Возвращает наименование для иконки Оружия, Варфрейма и т.д.
--(например, при входных данных Брэйтон Прайм Ствол вернет Брэйтон_Прайм)
function p.getItemIconForDrop(drop)
    local iName = p.getItemName(drop.Item)
    local pName = p.getPartName(drop.Part)
    local iconSize ='40'

    local icon =''
    icon = Icon._Prime(Shared.titleCase(drop.Item), nil, iconSize)
    
    return icon
end

function p.item(frame)
    local platform = frame.args[1]
    local item_type = frame.args[2]
    local item_part = frame.args[3]
    local relic_tier = frame.args[4]
    
    return p._item(item_type,item_part,relic_tier,platform)
end
----------------------------------------------------------
--ПРОПИСАТЬ ПЕРЕНАЗНАЧЕНИЕ ДЛЯ ПРОЧИХ ЭЛЕМЕНТОВ ЧАСТЕЙ!!!!
--Ж--Ж-ЖЖЖ----ЖЖ---Ж--ЖЖЖ-Ж---Ж-ЖЖЖЖЖ-Ж----Ж-Ж-Ж
--Ж--*-Ж-----Ж--Ж-Ж-Ж-Ж---Ж---Ж---Ж---Ж----Ж-Ж-Ж
--ЖЖЖЖ-ЖЖЖ-----Ж--ЖЖЖ-ЖЖЖ-ЖЖЖ-Ж---Ж---ЖЖЖ--Ж-Ж-Ж
--Ж--Ж-Ж-----Ж--Ж-Ж-Ж-Ж-Ж-Ж-Ж-Ж---Ж---Ж-Ж-------
--Ж--Ж-ЖЖЖ----ЖЖ--Ж-Ж-ЖЖЖ-ЖЖЖ-Ж---Ж---ЖЖЖ--Ж-Ж-Ж
----------------------------------------------------------
function p._item(item_type,item_part,relic_tier,platform)
    item_type = string.upper(item_type)
    item_part = string.upper(item_part)
---    if (item_part == "HELMET BLUEPRINT") then
---        item_part = "NEUROPTICS BLUEPRINT"
---    end
--пока что уберу, так как наименования Шлем не должно быть
    local locations = {}
    local vaultLocations = {}
    local i
    for i, relic in pairs(VoidData["Relics"]) do  --Русификация???? <<<<<<<<<<<<<<<
        if(p.isRelicOnPlatform(relic, platform) and (relic_tier == nil or relic.Tier == relic_tier)) then
            local dropRarity = p.getRelicDropRarity(relic, item_type, item_part)
            if(dropRarity ~= nil) then
                local relicText = relic.Tier.." "..relic.Name
                local relicString = tooltipStart..relicText..tooltipCenter.."[["..relicText.."]]"..tooltipEnd.." "..dropRarity
                if(relic.IsVaulted == 1) then
                    relicString = relicString.." ([[Прайм Хранилище|Пр.хр.]])"  --Prime Vault|V
                    table.insert(vaultLocations, relicString)
                else
                    if(relic.IsBaro == 1) then
                        relicString = relicString.." ([[Баро Ки%27Тир|Баро]])"    --Baro Ki%27Teer|B
                    end
                    table.insert(locations, relicString)
                end
            end
        end
    end
    
    for _, i in pairs(vaultLocations) do
        table.insert(locations, i)
    end
    return table.concat(locations, "<br/>")
end

function p.relicTooltip(frame)
    local relicName = frame.args ~= nil and frame.args[1] or frame
    local platform = frame.args ~= nil and frame.args[2]
    if(platform == nil) then platform = 'PC' end
    if(relicName == nil) then return nil end
    
    local bits = Shared.splitString(relicName, ' ')
    local Tier = bits[1]
    local RName = bits[2]
    
    local theRelic = p.getRelic(Tier, RName)
    if(theRelic == nil) then return 'ОШИБКА: Данная реликвия не найдена' end
 --   if(not p.isRelicOnPlatform(theRelic, Platform)) then return "ERROR: That relic isn't on that platform" end
    if(not p.isRelicOnPlatform(theRelic, Platform)) then return "ОШИБКА: Эта реликвия не найдена для данной платформы" end
    
    local result = '{|'
    
    local rareTxt = {Common = '', Uncommon = '', Rare = ''}
    
    for i, drop in pairs(theRelic.Drops) do
        local rarity = drop.Rarity
        if(rarity ~= nil) then
            if(rareTxt[rarity] ~= '') then rareTxt[rarity] = rareTxt[rarity]..'\n' end
            if(i > 1) then rareTxt[rarity] = rareTxt[rarity]..'|-' end
            
            local iName = p.getItemName(drop.Item)
            local pName = p.getPartName(drop.Part)
            
            local icon = p.getPartIconForDrop(drop)
            
            rareTxt[rarity] = rareTxt[rarity]..'\n| rowspan=2 class=\"Image\" | '..icon
            
            rareTxt[rarity] = rareTxt[rarity]..'\n| class = "gradientText" style = "vertical-align:bottom; color:'..TxtColors[rarity]..';" | '..iName
            rareTxt[rarity] = rareTxt[rarity]..'\n|-\n| class = "gradientText" style = "vertical-align:top; color:'..TxtColors[rarity]..';" | '..pName
        end
    end

    
    result = result..rareTxt['Common']..'\n'..rareTxt['Uncommon']
    result = result..'\n'..rareTxt['Rare']
    result = result..'\n|}'
    
    return result
end

function p.getRelicDrop(frame)
    local relicName = frame.args ~= nil and frame.args[1] or nil
    local rarity = frame.args ~= nil and frame.args[2] or nil
    local number = frame.args ~= nil and frame.args[3] or nil
    if number == nil then 
        --\количество по умолчанию 1, если не указано
        number = 1 
    elseif type(number) == 'string' then
        --Принудительное преобразование типа "строка" в "числовое"
        number = tonumber(number)
    end
    
    --Платформа как отдельный аргумент. По умолчанию для PC не указывается
    local platform = frame.args ~= nil and frame.args.platform or nil
    if platform == nil then platform = 'PC' end
    
    --Возвращает ошибку при отсутствии любой требуемой переменной
    if relicName == nil or relicName == '' then
        return "ОШИБКА: Не задана переменная 'Название реликвии'"           --Relic Name
    elseif rarity == nil or rarity == '' then
        return "ОШИБКА: Не задана переменная 'Категория редкости'"          --Rarity
    end
    
    local bits = Shared.splitString(relicName, ' ')
    local Tier = bits[1]
    local RName = bits[2]
    
    local theRelic = p.getRelic(Tier, RName)
    
    --Возвращает ошибку если имя реликвии некорректно
    if theRelic == nil then
        return "ОШИБКА: Некорректное название реликвии '"..relicName.."'"
    end
    
    local count = 0
    for i, drop in pairs(theRelic.Drops) do
        --Цикл по базе реликвий для поиска Части, Чертежа в соответствии 
        --с заданной категорией редкости
        if drop.Rarity == rarity then
            count = count + 1
            --В случае достижения необходимого количества возвращает Иконку + Название предмета
            if count == number then
                local iName = p.getItemName(drop.Item)
                local pName = p.getPartName(drop.Part, false)
                local icon = p.getItemIconForDrop(drop)
                
                return icon..' [['..iName..'|'..iName..' '..pName..']]'
            end
        end
    end

    --Если добрались до данной строки кода, значит найдено
    --недостаточное количество предметов заданной категории редкости
    return "ОШИБКА: Найдено только "..count.." предметов категории редкости "..rarity.." для реликвии "..relicName
end

function p.getRelicTotal(frame)
    local total = 0
 
    if(Shared.contains(frame.args, "unvaulted")) then   --русификация?
        for _,relic in pairs(VoidData["Relics"]) do
            if(relic.IsVaulted == 0) then
                total = total + 1
            end
        end
    end
    if(Shared.contains(frame.args, "vaulted")) then     --русификация?
        for _,relic in pairs(VoidData["Relics"]) do
            if(relic.IsVaulted == 1) then
                total = total + 1
            end
        end
    end
    if(Shared.contains(frame.args, "baro")) then        --русификация?
        for _,relic in pairs(VoidData["Relics"]) do
            if(relic.IsBaro == 1) then
                total = total + 1
            end
        end
    end
    if(frame.args[1] == nil) then
        total = Shared.tableCount(VoidData["Relics"])
    end
 
    return total
end

local function relicData()
    --Поиск в базе Бездны m:VoidByReward p.byReward
    local data = {}
 
    for _, relic in pairs(VoidData["Relics"]) do
        for i, drop in pairs(Relic.Drops) do
            local newObj = {Tier = relic.Tier, Name = relic.Name, Rarity = drop.Rarity, IsVaulted = relic.IsVaulted == 1, IsBaro = relic.IsBaro == 1}
            if (data[drop.Item] == nil) then
                data[drop.Item] = {}
            end
            if(data[drop.Item][drop.Part] == nil) then
                data[drop.Item][drop.Part] = {}
            end
            table.insert(data[drop.Item][drop.Part], newObj)
        end
    end
 
    return data
end

local function checkData(data)
    if data == nil or type(data) ~= 'table' then
        local data = relicData()
        return data
    elseif type(data) == 'table' then
        return data
    end
end

local function getItemRarities(itemName, partName, data)
    local data = checkData(data)
    
    local rarities ={}
    itemName = string.upper(itemName)
    partName = string.upper(partName)
    
    for n, drop in Shared.skpairs(data[itemName][partName]) do
        rarities[drop.Rarity] = true
    end
    
    --[[for rar, n in pairs(rarities) do
        mw.log(rar)
    end--]]
    
    return rarities
end

function p.getDucatValue(frame)
    --This is just for invoking p._getDucatValue on article pages.
    local itemName = frame.args ~= nil and frame.args[1] or nil
    local partName = frame.args ~= nil and frame.args[2] or nil
    
    if itemName == nil or itemName == '' then
        return 'Имя предмета не найдено'
    elseif partName == nil or partName == '' then
        return 'Имя части не найдено'
    end
    return p._getDucatValue(itemName, partName)
end

function p._getDucatValue(itemName, partName, data)
    --Подсчитывает стоимость в дукатах. Некоторые не подчиняются правилу                        (Обычные=15, Обычные+Необычные=25, Необычные=45, Необычные+Редкие=65 и Редкие=100) поэтому их стоимость определяют вручную до вызова функции "getItemRarities" для аовышения эффективности.
    --A small local function for checking if the two strings match.
    local function uCheck(name, expected)
        if string.upper(name) == string.upper(expected) then
            return true
        end
        return false
    end
    -->>>>отрихтовать<<<<<<<<
    if uCheck(itemName, 'Сома') and uCheck(partName, 'Чертеж') then
        return 15
    elseif uCheck(itemName, 'Брэйтон') and uCheck(partName, 'Ствол') then   --Stock
        return 15
    elseif uCheck(itemName, 'Акстилетто') and uCheck(partName, 'Приёмник') then
        return 45
    elseif uCheck(itemName, 'Рубико') and uCheck(partName, 'Ствол') then
        return 45
    elseif uCheck(itemName, 'Сарина') and uCheck(partName, 'Нейрооптика Чертеж') then
        return 45
    elseif uCheck(itemName, 'Анкирос') and uCheck(partName, 'Лезвие') then
        return 65
    elseif uCheck(itemName, 'Рино') and uCheck(partName, 'Каркас Чертеж') then
        return 65
    elseif uCheck(itemName, 'Валькирия') and uCheck(partName, 'Система Чертеж') then
        return 100
    end

    local data = checkData(data)
    
    local rarities = getItemRarities(itemName, partName, data)
    local ducatValue = 0
    local lenght = Shared.tableCount(rarities)
    
    --Проверка подпадает ли под обозначенную Редкость
    --For checking whether the table contains a dictionary of the particular rarity.
    local function tableContains(table, rarity)
        for rar, value in pairs(table) do
            if rar == rarity then
                return true
            end
        end
        return false
    end
    
    --Проверка к какой Редкости принадлежит для определения корректной стоимости в Дукатах
    --Checking whether the lenght of table "rarities" is 1 or 2 and accordingly perform more checks to assing the correct ducat value.
    if lenght == 1 then
        if rarities['Common'] then
            return 15
        elseif rarities['Uncommon'] then
            return 45
        elseif rarities['Rare'] then
            return 100
        end
    elseif lenght == 2 then
        if tableContains(rarities, 'Common') then
            return 25
        elseif tableContains(rarities, 'Rare') then
            return 65
        end
    elseif lenght == 3 then
        return 25
    end
    
    return ducatValue
end

--Подсчет общей стоимости в Дукатах
function p.getTotalDucats(frame)
    local tierName = frame.args ~= nil and frame.args[1]
    local data = relicData()
    local totalItemCount = 0    --все предметы
    local withoutFormaCount = 0 --все предметы, за исключением Формы
    local totalDucats = 0       --всего в Дукатах
    local availableDucats = 0   --всего в Дукатах для всех доступных предметов
    local availableItems = 0    --доступные предметы
    local availableItemsEF = 0  --доступные предметы, за исключением Формы
    local vaultedDucats = 0     --всего в Дукатах для предметов из Реликвий в Хранилище
    local vaultedItems = 0      --предметы из Реликвий в Хранилище
    local vaultedItemsEF = 0    --предметы из Реликвий в Хранилище, за исключением Формы
    local result = ''
    
    for item, parts in Shared.skpairs(data) do
        for part, drops in Shared.skpairs(parts) do
            for n, drop in Shared.skpairs(drops) do
                if tierName == drop.Tier or tierName == nil then
                    if drop.IsVaulted then
                        vaultedItems = vaultedItems + 1
                    else
                        availableItems = availableItems + 1
                    end
                    
                    totalItemCount = totalItemCount + 1
                    if item ~= 'Форма' then
                        local tempDucat =p._getDucatValue(item, part, data)
                        totalDucats = totalDucats + tempDucat
                        withoutFormaCount = withoutFormaCount + 1
                        if drop.IsVaulted then
                            vaultedDucats = vaultedDucats + tempDucat
                            vaultedItemsEF = vaultedItemsEF + 1
                        else
                            availableDucats = availableDucats + tempDucat
                            availableItemsEF = availableItemsEF + 1
                        end
                    end
                end
            end
        end
    end
    
    if tierName then
        result = "'''Средняя стоимость составляет'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.round((totalDucats / totalItemCount),2).."''' ("..totalItemCount..' наград с '..withoutFormaCount..' частями)'
        result = result.."<br>'''Стоимость доступных составляет'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.round((availableDucats/availableItems),2).."''' ("..availableItems..' наград с '..availableItemsEF..' частей)'
        result = result.." | '''Запечато в Хранилище'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.round((vaultedDucats/vaultedItems),2).."''' ("..vaultedItems..' наград с '..vaultedItemsEF..' частей)' --<<<<<<<<<<<<<ЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖЖ
    else
        result = "'''Общач стоимость составляет'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.formatnum(totalDucats).."''' ("..totalItemCount..' наград с '..withoutFormaCount..' частей)'
        result = result.."<br>'''Доступно'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.formatnum(availableDucats).."''' ("..availableItems..' наград с '..availableItemsEF..' частей)'
        result = result.." | '''Запечато в Хранилище'''&#58; "..Icon._Item('Дукаты').."'''"..Shared.formatnum(vaultedDucats).."''' ("..vaultedItems..' наград с '..vaultedItemsEF..' частей)'
    end
    
    return result
end

local function ducatPriceRow(itemName, partName, tierName, data)
    local ducatValue = p._getDucatValue(itemName, partName, data)
    local sortValue = ''
    
    local function createRelicText(itemName, partName, tierName, data)
        itemName = string.upper(itemName)
        partName = string.upper(partName)
        
        local locations = {}
        local vaultLocations = {}
        for n, drop in Shared.skpairs(data[itemName][partName]) do
            if drop.Tier == tierName or tierName == nil then
                local dropRarity = drop.Rarity
                if dropRarity ~= nil then
                    local relicText = drop.Tier.." "..drop.Name
                    local relicString = tooltipStart..relicText..tooltipCenter.."[["..relicText.."]]"..tooltipEnd.." "..dropRarity
                    if drop.IsVaulted then
                        relicString = relicString.." ([[Прайм хранилище|Пр.хр.]])"
                        table.insert(vaultLocations, relicString)
                    else
                        if drop.IsBaro then
                            relicString = relicString.." ([[Баро Ки%27Тиир|Баро]])"
                        end
                        table.insert(locations, relicString)
                    end
                end
            end
        end
        
        for _, i in pairs(vaultLocations) do
            table.insert(locations, i)
        end
        
        return table.concat(locations, "<br/>")
    end
        

    if itemName == nil or itemName == '' or partName == nil or partName == '' then
        return 'Пожалуйста введите название предметов и частей'
    end
    
    --first cell
    if partName == 'Чертеж' then
        sortValue = itemName..' _'..partName
    else
        sortValue = itemName..' '..partName
    end
    local cell1 = '\n|data-sort-value="'..sortValue..'"|'..Icon._Prime(itemName,partName)
    local cell2 = '\n|'..createRelicText(itemName, partName, tierName, data)
    local cell3 = '\n|data-sort-value="'..ducatValue..'"|'..Icon._Item('Дукаты').."'''"..ducatValue.."'''\n|-"
    
    return cell1..cell2..cell3
end

function p.ducatRelicList(frame)
    local data = relicData()
    local tierName = frame.args ~= nil and frame.args[1] or nil
    --Adding switch to choose only vaulted or unvaulted items to show
    local listMode = frame.args ~= nil and frame.args[2] or 'ALL'
    listMode = string.upper(listMode)
    local itemList = {}
    local result = {}
    
    for item, parts in Shared.skpairs(data) do
        if item ~= 'Форма' then
            for part, drops in Shared.skpairs(parts) do
                for i, drop in pairs(drops) do
                    if drop.Tier == tierName or tierName == nil then
                        local tempName = ''
                        if part == 'Чертеж' then
                            tempName = Shared.titleCase(item..'<> '..part)
                        else
                            tempName = Shared.titleCase(item..'<>'..part)
                        end
                        if not Shared.contains(itemList, tempName) then
                            if listMode == 'Недоступно' then
                                if drop.isBaro or drop.IsVaulted then
                                    table.insert(itemList, tempName)
                                end
                            elseif listMode == 'Доступно' then
                                if not drop.IsBaro and not drop.IsVaulted then
                                    table.insert(itemList, tempName)
                                end
                            else
                                table.insert(itemList, tempName)
                            end
                        end
                    end
                end
            end
        end
    end
    table.sort(itemList)
    
    for num, itm in pairs(itemList) do
        local item = Shared.splitString(itm, '<>')
        item[1] = Shared.trim(item[1])
        item[2] = Shared.trim(item[2])
        table.insert(result, (ducatPriceRow(item[1], item[2], tierName, data)))
    end
    return table.concat(result)
end

return p