View Single Post
12/06/15, 04:33 AM   #1
Zerowalker
Join Date: Nov 2015
Posts: 20
Get Ability/Skill name from "EVENT_SKILL_RANK_UPDATE"?

Hi,

I am wondering if it's possible to retrieve the actual skill/ability name from the event which is fired when it levels up.

I think you can manually get it by outputing the info when you level up and write it down etc,
but i am assuming there must be some logic behind it.

The event gives 2 numbers that coordinate this, the "type" and "index".
EVENT_SKILL_RANK_UPDATE, function(eventCode, skillType, skillIndex, rank)

From my current assumption, on a Termplar at least, i think it's something like this for some skills.

//Copy pasting my code as i am lazy to rewrite, but should be clear enough.
//EDITED later on when i figured out how the Type/Indexing worked, probably*
Code:
if skillType == 1 and skillIndex == 1 then
type = "Aedric Spear"
elseif skillType == 1 and skillIndex == 2 then
type = "Dawn's Wrath"
elseif skillType == 1 and skillIndex == 3 then
type = "Restoration Light"
elseif skillType == 2 and skillIndex == 1 then
type = "Two Handed"
elseif skillType == 2 and skillIndex == 2 then
type = "One Hand and Shield"
elseif skillType == 2 and skillIndex == 3 then
type = "Dual Wield"
elseif skillType == 2 and skillIndex == 4 then
type = "Bow"
elseif skillType == 2 and skillIndex == 5 then
type = "Destruction Staff"
elseif skillType == 2 and skillIndex == 6 then
type = "Restoration Staff"
elseif skillType == 3 and skillIndex == 1 then
type = "Light Armor"
elseif skillType == 3 and skillIndex == 2 then
type = "Medium Armor"
elseif skillType == 3 and skillIndex == 3 then
type = "Heavy Armor"
elseif skillType == 4 and skillIndex == 1 then
type = "Legerdemain"
elseif skillType == 4 and skillIndex == 2 then
type = "Soul Magic"
end
This is just from me outputting the text when i level up and then assuming it stays that way.
Meaning, if i level up in restoration staff it would output "skillType 2 and skillIndex 6",
that way i can assume that those two number combined is Restoration Staff.

If there is a way to actually know this without doing it that way it would be nice though,
as it's kinda a pain;p

*EDIT:

After looking into it, it seems quite logical.

Type is the "Category", so Class is 1, Weapons is 2, Armor is 3.
Index is, well index in that Category.

I looked up the variables, and "SKILL_TYPE_ARMOR" has the value of 3, which is correct.
Now, if only one could reverse it, so knowing the numbers could retrieve the name of the skill.
Most of the skills i am sure remain constant, but Classes don't for example.

Last edited by Zerowalker : 12/06/15 at 05:17 AM.
  Reply With Quote