Repository navigation
Expand file tree
/
Copy pathData.lua
More file actions
151 lines (137 loc) · 5.66 KB
/
Copy pathData.lua
File metadata and controls
151 lines (137 loc) · 5.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---@class Whetstone
local ns = select(2, ...)
ns.MAX_RANK = 300
---@alias SkillKindName "primary"|"secondary"|"weapon"
---@class SkillKind
---@field label string
---@field cappedUntil string
---@field visibilitySetting string?
---@type SkillKindName[]
ns.KIND_ORDER = { "primary", "secondary", "weapon" }
---@type table<SkillKindName, SkillKind>
ns.KINDS = {
primary = { label = "Professions", cappedUntil = "you train the next rank" },
secondary = {
label = "Secondary skills",
cappedUntil = "you learn the next rank",
visibilitySetting = "showSecondary",
},
weapon = { label = "Weapon skills", cappedUntil = "you level up", visibilitySetting = "showWeapons" },
}
---@class NextRank
---@field name string
---@field requiredSkill number
---@field requiredLevel number
---@field cap number
---@field hint string
---@type table<number, NextRank>
local NEXT_RANK_BY_CAP = {
[75] = {
name = "Journeyman",
requiredSkill = 50,
requiredLevel = 10,
cap = 150,
hint = "Train at a profession trainer.",
},
[150] = {
name = "Expert",
requiredSkill = 125,
requiredLevel = 20,
cap = 225,
hint = "Train at an Expert trainer.",
},
[225] = {
name = "Artisan",
requiredSkill = 200,
requiredLevel = 35,
cap = 300,
hint = "Train at an Artisan trainer.",
},
}
ns.RANK_NAMES = { [75] = "Apprentice" }
for _, rank in pairs(NEXT_RANK_BY_CAP) do
ns.RANK_NAMES[rank.cap] = rank.name
end
---@param overrides table<number, table>
---@return table<number, NextRank>
local function OverrideRanks(overrides)
for cap, rank in pairs(overrides) do
setmetatable(rank, { __index = NEXT_RANK_BY_CAP[cap] })
end
return setmetatable(overrides, { __index = NEXT_RANK_BY_CAP })
end
---@class Skill
---@field name string
---@field id number
---@field kind SkillKindName
---@field iconSpell number
---@field ranks table<number, NextRank>?
---@field weapon Enum.ItemWeaponSubclass?
---@field emptyHanded boolean?
---@field shapeshifted boolean?
---@field alwaysShown boolean?
---@type Skill[]
ns.SKILLS = {
{ name = "Alchemy", id = 171, kind = "primary", iconSpell = 2259, ranks = NEXT_RANK_BY_CAP },
{ name = "Blacksmithing", id = 164, kind = "primary", iconSpell = 2018, ranks = NEXT_RANK_BY_CAP },
{ name = "Enchanting", id = 333, kind = "primary", iconSpell = 7411, ranks = NEXT_RANK_BY_CAP },
{ name = "Engineering", id = 202, kind = "primary", iconSpell = 4036, ranks = NEXT_RANK_BY_CAP },
{ name = "Herbalism", id = 182, kind = "primary", iconSpell = 2366, ranks = NEXT_RANK_BY_CAP },
{ name = "Leatherworking", id = 165, kind = "primary", iconSpell = 2108, ranks = NEXT_RANK_BY_CAP },
{ name = "Mining", id = 186, kind = "primary", iconSpell = 2575, ranks = NEXT_RANK_BY_CAP },
{ name = "Skinning", id = 393, kind = "primary", iconSpell = 8613, ranks = NEXT_RANK_BY_CAP },
{ name = "Tailoring", id = 197, kind = "primary", iconSpell = 3908, ranks = NEXT_RANK_BY_CAP },
{
name = "Cooking",
id = 185,
kind = "secondary",
iconSpell = 2550,
ranks = OverrideRanks({
[150] = { hint = "Expert Cookbook, sold by vendors." },
[225] = { requiredSkill = 225, hint = "Quest from Dirge Quikcleave in Gadgetzan." },
}),
},
{
name = "First Aid",
id = 129,
kind = "secondary",
iconSpell = 3273,
ranks = OverrideRanks({
[150] = { hint = "Expert First Aid - Under Wraps, sold by vendors." },
[225] = { requiredSkill = 225, hint = 'Quest "Triage" in Theramore or Hammerfall.' },
}),
},
{
name = "Fishing",
id = 356,
kind = "secondary",
iconSpell = 7620,
ranks = OverrideRanks({
[150] = { hint = "Expert Fishing - The Bass and You, sold by Old Man Heming in Booty Bay." },
[225] = { requiredSkill = 225, hint = "Quest from Nat Pagle in Dustwallow Marsh." },
}),
},
{ name = "Defense", id = 95, kind = "weapon", iconSpell = 204, alwaysShown = true },
{ name = "Unarmed", id = 162, kind = "weapon", iconSpell = 203, emptyHanded = true },
{ name = "Daggers", id = 173, kind = "weapon", iconSpell = 1180, weapon = Enum.ItemWeaponSubclass.Dagger },
{ name = "Fist Weapons", id = 473, kind = "weapon", iconSpell = 15590, weapon = Enum.ItemWeaponSubclass.Unarmed },
{ name = "Swords", id = 43, kind = "weapon", iconSpell = 201, weapon = Enum.ItemWeaponSubclass.Sword1H },
{ name = "Two-Handed Swords", id = 55, kind = "weapon", iconSpell = 202, weapon = Enum.ItemWeaponSubclass.Sword2H },
{ name = "Axes", id = 44, kind = "weapon", iconSpell = 196, weapon = Enum.ItemWeaponSubclass.Axe1H },
{ name = "Two-Handed Axes", id = 172, kind = "weapon", iconSpell = 197, weapon = Enum.ItemWeaponSubclass.Axe2H },
{ name = "Maces", id = 54, kind = "weapon", iconSpell = 198, weapon = Enum.ItemWeaponSubclass.Mace1H },
{ name = "Two-Handed Maces", id = 160, kind = "weapon", iconSpell = 199, weapon = Enum.ItemWeaponSubclass.Mace2H },
{ name = "Polearms", id = 229, kind = "weapon", iconSpell = 200, weapon = Enum.ItemWeaponSubclass.Polearm },
{ name = "Staves", id = 136, kind = "weapon", iconSpell = 227, weapon = Enum.ItemWeaponSubclass.Staff },
{ name = "Bows", id = 45, kind = "weapon", iconSpell = 264, weapon = Enum.ItemWeaponSubclass.Bows },
{ name = "Guns", id = 46, kind = "weapon", iconSpell = 266, weapon = Enum.ItemWeaponSubclass.Guns },
{ name = "Crossbows", id = 226, kind = "weapon", iconSpell = 5011, weapon = Enum.ItemWeaponSubclass.Crossbow },
{ name = "Thrown", id = 176, kind = "weapon", iconSpell = 2567, weapon = Enum.ItemWeaponSubclass.Thrown },
{ name = "Wands", id = 228, kind = "weapon", iconSpell = 5009, weapon = Enum.ItemWeaponSubclass.Wand },
{ name = "Feral Combat", id = 3014, kind = "weapon", iconSpell = 5487, shapeshifted = true },
}
---@type table<string, Skill>
ns.SKILL_BY_ENUS_NAME = {}
for _, skill in ipairs(ns.SKILLS) do
ns.SKILL_BY_ENUS_NAME[skill.name] = skill
end