lotrointerface.com
Search Downloads

LoTROInterface SVN SequenceBars

[/] [trunk/] [Thurallor/] [Common/] [SkillData/] [SkillData.lua] - Rev 198

Compare with Previous | Blame | View Log

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

Compare with Previous | Blame


All times are GMT -5. The time now is 09:51 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui