This is a table (moebius92.SkillData.shortcut) that takes the shortcut data of a skill shortcut as a key and returns the client language (English, German, or French) name of the skill as returned by SkillInfo:GetName().
How to use:
Code:
import "moebius92.SkillData";
-- Assume we have a shortcut s
if s:GetType() == Turbine.UI.Lotro.ShortcutType.Skill then
local name = moebius92.SkillData.shortcut[s:GetData()];
local askills = Turbine.Gameplay.LocalPlayer:GetInstance():GetTrainedSkills();
for i = 1, askills:GetCount(), 1 do
if askill:GetItem(i):GetSkillInfo():GetName() == name then
Turbine.Shell.WriteLine("Shortcut is skill: " .. name .. "(" .. i .. ")");
break;
end
end
end
Additionally, this adds a function GetShortcutData() to Turbine.Gameplay.SkillInfo, that returns the shortcut data of a skill. Again, there isn't full coverage of all of the skills, so it may return nil.
For example:
Code:
import "moebius92.SkillData";
-- Assume we have a quickslot qs, and a skill s, this will change the shortcut in qs to s
if s:GetShortcutData() ~= nil then
qs:SetShortcut(Turbine.UI.Lotro.Shortcut(Turbine.UI.Lotro.ShortcutType.Skill, s:GetShortcutData()));
end
Additionally, adds the ActiveSkills library (see moebius92/ActiveSkills/readme.txt for documentation).
The basic idea of this library is that a plugin author should be able to simply select a skill to work with, and then be able to immediately start querying the state of the skill and setting up event handlers. Furthermore, we would like the author's interactions with the skill to be isolated from any other interactions with the skill. That is, anything the author does to the skill should not be dependent on someone else having done or not done something to the skill.
For example, let's say we want to watch for changes in the reset time of the LM skill "Warding Knowledge" (shortcut "0x7000B625"). We would use the following code:
Code:
import "moebius92.ActiveSkills";
-- Create an ActiveSkill object for the skill we're interested in
askill = moebius92.ActiveSkills.ActiveSkill("0x7000B625");
-- Set up an event handler for when the reset time changes
askill.ResetTimeChanged = function(self, reset)
Turbine.Shell.WriteLine("Reset time is now: " .. reset);
end;
We first get an object for the skill by simply indicating the shortcut data of the skill we are interested in. We then use that object to set up an event handler that is called any time the skill's reset time is changed. Since the event handler is attached to an object we just created, we do not have to worry about overwriting someone else's event handler or vice versa. We can simply set the event handler on the object without worry.
(For examples of the ActiveSkills library being used, see
CC Timer and
Response Timer.)
Shortcut.lua.bak holds version 0.4.2 of Shortcut.lua (which includes the obsolete shortcuts removed with version 0.5).
Induction.lua holds the unmodified induction times of a number of skills.
Known Issues:
- GetShortcutData will probably not return the correct shortcut for the "Dash" skill. It's possible to sometimes differentiate between the light, medium, and heavy version of the skill, but not reliably. And I didn't even bother trying.
- Missing shortcuts for the Reaver skills "Gut Punch", "Improved Gut Punch", "Improved Sudden Strikes." These skills are not buyable, and I don't actually have creeps.
- Missing shortcuts for the Black Arrow skills "Improved Punctured Target" and "Improved Vital Target". These skills are also not buyable.
- The Vanguard skill "Incite Foes" is actually called "Incite Foe" in TrainedSkills. The Stalker skill "Shadow" is actually called "Shadow " (with a space at the end) in Trained Skills.
- The Beorning skill "Bear Up" does not currently have a German or French language translation.
History:
0.7 - Added Beorning skill "Bear Up". Also added ActiveSkills library.
0.6 - Added Beorning (class and race) skill shortcuts and several missing warsteed skill shortcuts. Added support for German and French clients. Moved the general shortcuts into generalShortcut, and now generates shortcut on initialization.
0.5 - Removed obsolete shortcuts. Added classShortcut and raceShortcut to hold class and race specific skills. shortcut still contains all of the skills. Added the Turbine.Gameplay.SkillInfo.GetShortcutData function - will return nil if the skill is not recognized.
0.4.2 - Fixed typo in "Our Fate's Entwined" (should have been "Our Fates Entwined")
0.4.1 - Forgot to upload the 0.4 version.
0.4 - Added remaining monster skills.
0.3 - Added Big Battle skills and rank 0 monster skills.
0.2 - Updated for Helm's Deep
0.1 - Initial data file.