import "Turbine"
import "Turbine.Gameplay"
import "Turbine.UI"
import "Turbine.UI.Lotro"
local importPath = getfenv(1)._.Name:gsub("%.SkillData$", "");
--local TestSkillData = {}; -- uncomment this for testing
-- Import language-specific data
local language = Turbine.Engine.GetLanguage();
local locale;
for lang, val in pairs({
en = Turbine.Language.English;
de = Turbine.Language.German;
fr = Turbine.Language.French;
ru = Turbine.Language.Russian;
}) do
if ((language == val) or TestSkillData) then
locale = lang;
import (importPath .. ".SkillData_" .. lang);
if (TestSkillData) then
TestSkillData[lang] = SkillData;
end
end
end
-- Special characters that look like non-special ones
local nbsp = "\194\160"; -- non-breaking space, used in many French skill names
-- Skills which can have different names (but the same shortcut) depending on conditions such as stance, etc.
-- This table currently has to be manually maintained (can't be extracted from the client automatically).
local altNames = {};
local AlternateNameData = {
--Burglar
[0x7000FB73] = {
en = { "A Small Snag", "Quite a Snag" },
de = { "Ein kleiner Schnitt", "Ein ziemlicher Haken"},
fr = { "Petit accrochage", "Bel accroc"},
ru = { "ÐеболÑÑÐ°Ñ Ð¿Ð¾Ð¼ÐµÑ
а", "ÐиÑего Ñебе помеÑ
а" }
};
[0x7000FB71] = {
en = { "Feint Attack", "Improved Feint Attack" },
de = { "Scheinangriff", "Verbesserung: Scheinangriff" },
fr = { "Attaque feinte", "Attaque feinte améliorée" },
ru = { "ÐожнÑй вÑпад", "УлÑÑÑеннÑй ложнÑй вÑпад" }
};
[0x7000FD86] = {
en = { "Lucky Strike", "Gambler's Strike" },
de = { "Glückstreffer", "Treffer des Spielers"},
fr = { "Coup chanceux", "Coup de poker" },
ru = { "УдаÑнÑй ÑдаÑ", "Ð£Ð´Ð°Ñ Ð¸Ð³Ñока" }
};
--Hunter
[0x70003F33] = {
en = { "Barbed Arrow", "Burning Arrow", "Eldarin Arrow" },
de = { "Stachelpfeil", "Feuerpfeil", "Eldar-Pfeil" },
fr = { "Flèche barbelée", "Flèche brûlante", "Flèche eldarine" },
ru = { "ÐазÑбÑÐµÐ½Ð½Ð°Ñ ÑÑÑела", "ÐоÑÑÑÐ°Ñ ÑÑÑела", "СÑÑела ÑлÑдаÑ"}
};
[0x7002984F] = {
en = { "Improved Penetrating Shot", "Imp. Penetrating Shot: Burn Through", "Imp. Penetrating Shot: Pierce the Darkness" },
de = { "Verbesserter Durchdringender Schuss", "Verbesserter Durchdringender Schuss \"Verzehrendes Feuer\"", "Verbesserter Durchdringender Schuss: \"Dunkelheit stechen\"" },
fr = { "Tir pénétrant amélioré", "Tir pénétrant amélioré" .. nbsp .. ": Brûlure", "Tir pénétrant amélioré : Percée des ténèbres"},
ru = { "УлÑÑÑеннÑй пÑоникаÑÑий вÑÑÑÑел", "УлÑÑÑеннÑй пÑоникаÑÑий вÑÑÑÑел: ЯÑоÑÑное пламÑ", "УлÑÑÑеннÑй пÑоникаÑÑий вÑÑÑÑел: ÐÑонзаÑÑий ТÑмÑ" }
};
[0x70029856] = {
en = { "Improved Quick Shot", "Imp. Quick Shot: Flaming Arrow", "Imp. Quick Shot: Elvish Arrow" },
de = { "Verbesserter Schneller Schuss", "Verb.: Schneller Schuss: \"Flammenpfeil\"", "Verb.: Schneller Schuss \"Elbenpfeil\"" },
fr = { "Tir rapide amélioré", "Tir rapide amélioré : Flèche enflammée", "Tir rapide amélioré : Flèche elfique" },
ru = { "УлÑÑÑеннÑй бÑÑÑÑÑй вÑÑÑÑел", "УлÑÑÑеннÑй бÑÑÑÑÑй вÑÑÑÑел: ÐÐ³Ð½ÐµÐ½Ð½Ð°Ñ ÑÑÑела", "УлÑÑÑеннÑй бÑÑÑÑÑй вÑÑÑÑел: ÐлÑÑийÑÐºÐ°Ñ ÑÑÑела" }
};
[0x700153E2] = {
en = { "Improved Swift Bow", "Improved Swift Bow: Ablaze", "Improved Swift Bow: Star-light" },
de = { "Verbesserter Schneller Bogen", "Verbesserter Schneller Bogen: Flammenmeer", "Verbesserung: Schneller Bogen: Sternenlicht" },
fr = { "Arc rapide amélioré", "Arc rapide" .. nbsp .. ": flambée amélioré", "Arc rapide" .. nbsp .. ": lumière stellaire amélioré" },
ru = { "УлÑÑÑеннÑй бÑÑÑÑÑй лÑк", "УлÑÑÑеннÑй бÑÑÑÑÑй лÑк: ÐоÑпламенение", "УлÑÑÑеннÑй бÑÑÑÑÑй лÑк: ÐвезднÑй ÑвеÑ" }
};
[0x700292DC] = {
en = { "Split Shot", "Split Shot: Hail of Fire", "Split Shot: Shafts of Light" },
de = { "Spaltschuss", "Spaltschuss: Feuerhagel", "Spaltschuss: Lichtstrahlen" },
fr = { "Tir multiple", "Tir multiple : Grêle ardente", "Tir multiple : Tiges de lumière" },
ru = { "Ðалп ÑÑÑел", "Ðалп ÑÑÑел: ÐгненнÑй гÑад", "Ðалп ÑÑÑел: ÐÑÑи ÑвеÑа" }
};
--Minstrel
[0x700293C5] = {
en = { "Coda of Melody", "Coda of Resonance", "Coda of Fury" },
de = { "Coda der Melodie", "Coda der Resonanz", "Coda der Wut" },
fr = { "Coda de mélodie", "Coda de résonance", "Coda de fureur" },
ru = { "Ðода мелодии", "Ðода ÑезонанÑа", "Ðода диÑÑонанÑа" },
};
[0x7000B697] = {
en = { "The Melody of Battle", "Timeless Echoes of Battle", "Echoes of Battle" },
de = { "Melodie des Kampfes", "Zeitloser Widerhall des Kampfes", "Widerhall des Kampfes" },
fr = { "Mélodie de bataille", "Ãcho de bataille intemporel", "Ãcho de bataille" },
ru = { "ÐÐµÐ»Ð¾Ð´Ð¸Ñ Ð±Ð¸ÑвÑ", "ÐеÑмолÑнÑе оÑзвÑки биÑвÑ", "ÐÑзвÑки биÑвÑ" }
};
-- Warden
[0x7001509A] = {
en = { "Fist and Spear", "Fist and Javelin" },
de = { "Faust und Speer", "Faust und WurfspieÃ" },
fr = { "Poing et lance", "Poing et javeline" },
ru = { "ÐÑлак и копÑе", "ÐÑлак и меÑаÑелÑное копÑе" }
};
[0x7000E867] = {
en = { "Quick Thrust", "Prepare Spear", "Quick Toss", "Prepare Javelin" },
de = { "Schneller StoÃ", "Speer vorbereiten", "Schneller Wurf", "Wurfspieà vorbereiten" },
fr = { "Fente rapide", "Préparer la lance", "Lancer rapide", "Préparer javeline" },
ru = { "ÐÑÑÑÑÑй вÑпад", "ÐодгоÑовка копÑÑ", "ÐÑÑÑÑÑй бÑоÑок", "ÐодгоÑовка меÑаÑелÑного копÑÑ" }
};
[0x7001509D] = {
en = { "Shield and Spear", "Shield and Javelin" },
de = { "Schild und Speer", "Schild und WurfspieÃ" },
fr = { "Bouclier et lance", "Bouclier et javeline" },
ru = { "Ð©Ð¸Ñ Ð¸ копÑе", "Ð©Ð¸Ñ Ð¸ меÑаÑелÑное копÑе"}
};
[0x7000ED0E] = {
en = { "Shield-bash", "Prepare Shield", "Behind the Shield" },
de = { "Heftiger Schildschlag", "Schild vorbereiten", "Hinter dem Schild" },
fr = { "Violent coup de bouclier", "Préparer bouclier", "Derrière le bouclier" },
ru = { "Ð£Ð´Ð°Ñ ÑиÑом", "ÐодгоÑовка ÑиÑа", "Ðз-за ÑиÑа" }
};
[0x70015098] = {
en = { "Spear and Fist", "Javelin and Fist" },
de = { "Speer und Faust", "Wurfspieà und Faust" },
fr = { "Lance et poing", "Javeline et poing" },
ru = { "ÐопÑе и кÑлак", "ÐеÑаÑелÑное копÑе и кÑлак" }
};
[0x70015099] = {
en = { "Spear and Shield", "Javelin and Shield" },
de = { "Speer und Schild", "Wurfspieà und Schild" },
fr = { "Lance et bouclier", "Javeline et bouclier" },
ru = { "ÐопÑе и ÑиÑ", "ÐеÑаÑелÑное копÑе и ÑиÑ" }
};
[0x7002850A] = {
en = { "Spear and Spear", "Javelin and Javelin" },
de = { "Speer und Speer", "Wurfspieà und WurfspieÃ" },
fr = { "Lance et lance", "Javeline et javeline" },
ru = { "Ðвойное копÑе", "ÐопÑе, еÑе копÑе" }
};
[0x7000EECF] = {
en = { "Warden's Taunt", "Prepare Fist", "Warden's Aim" },
de = { "Hohn des Hüters", "Faust vorbereiten", "Absicht des Hüters" },
fr = { "Provocation de sentinelle", "Préparer poing", "Visée de la sentinelle" },
ru = { "ÐаÑмеÑка заÑиÑника", "ÐодгоÑовка кÑлаков", "ÐиÑÐµÐ½Ñ Ð·Ð°ÑиÑника" }
};
-- To do: When adding an item to this list, make sure to use the main ID and not an alias thereof.
};
-- Verify that alternate names haven't changed
local SkillNames = {};
if (TestSkillData) then
for _, lang in ipairs({"en", "de", "fr", "ru"}) do
SkillNames[lang] = {};
for id, data in pairs(TestSkillData[lang]) do
if (type(data) == "number") then
data = TestSkillData[lang][data];
end
SkillNames[lang][data.name] = id; -- may be overwritten, but don't care
end
end
for id, data in pairs(AlternateNameData) do
Puts("[0x" .. string.format("%8X", id) .. "]");
for _, lang in ipairs({"en", "de", "fr", "ru"}) do
local nameList = data[lang];
local foundOutdatedName = false;
if (nameList) then
--Puts(" " .. lang .. " = " .. Serialize(data[lang]) .. ",");
for _, name in ipairs(data[lang]) do
if (not SkillNames[lang][name]) then
foundOutdatedName = true;
Puts('"' .. name .. '" not found in SkillData_' .. lang);
end
end
end
if ((not nameList) or foundOutdatedName) then
local tr_nameList = {};
for _, en_name in ipairs(data.en) do
local id = SkillNames.en[en_name];
local tr_data = TestSkillData[lang][id];
if (type(tr_data) == "number") then
tr_data = TestSkillData[lang][tr_data];
end
local tr_name = tr_data.name;
table.insert(tr_nameList, tr_name);
end
Puts(" " .. lang .. " = " .. Serialize(tr_nameList) .. ",");
end
end
end
SkillData = TestSkillData[locale];
end
-- Create look-up table for GetAltNames()
for id, data in pairs(AlternateNameData) do
local name = data[locale];
SkillData[id].name = name;
for _, n1 in ipairs(name) do
altNames[n1] = altNames[n1] or {};
for _, n2 in ipairs(name) do
if (n1 ~= n2) then
table.insert(altNames[n1], n2);
end
end
altNames[n1] = table.concat(altNames[n1], " / ");
end
end
-- Handle aliases
for id, data in pairs(SkillData) do
if (type(data) == "number") then
SkillData[id] = SkillData[data];
end
end
-- Get the name of the skill associated with a shortcut
-- (returns a string or a list of strings)
function Turbine.UI.Lotro.Shortcut.GetSkillName(shortcut)
local id = tonumber(shortcut:GetData() or 0);
if (SkillData[id]) then
return SkillData[id].name;
end
end
-- Get the altername name(s) for a skill (e.g. "Improved", etc.)
function Turbine.Gameplay.Skill.GetAltNames(skillName)
return altNames[skillName];
end