-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.lua
47 lines (40 loc) · 1.35 KB
/
main.lua
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
---@param base Entity[]
---@param diff Entity[]
---@return Entity[]
local function patch(base, diff)
---@type table<number, Entity>
local id_to_entity = {}
for _, entity in ipairs(base or {}) do
id_to_entity[entity.id] = entity
end
for _, entity in ipairs(diff) do
id_to_entity[entity.id] = entity
end
local result = {}
for _, entity in pairs(id_to_entity) do
tinsert(result, entity)
end
return result
end
TRADE_SKILLS_DATA["MIN_PATCH_LEVEL"] = TRADE_SKILLS_DATA_TURTLE["MIN_PATCH_LEVEL"]
TRADE_SKILLS_DATA["MAX_PATCH_LEVEL"] = TRADE_SKILLS_DATA_TURTLE["MAX_PATCH_LEVEL"]
TRADE_SKILLS_DATA["CURRENT_PATCH_LEVEL"] = TRADE_SKILLS_DATA_TURTLE["CURRENT_PATCH_LEVEL"]
local professions = {
"Alchemy",
"Blacksmithing",
"Cooking",
"Enchanting",
"Engineering",
"First Aid",
"Leatherworking",
"Mining",
"Tailoring",
}
for _, profession in pairs(professions) do
for _, category in pairs({"items", "skills"}) do
TRADE_SKILLS_DATA[category][profession] = patch(TRADE_SKILLS_DATA[category][profession], TRADE_SKILLS_DATA_TURTLE[category][profession])
end
end
for _, entity in pairs({"factions", "npcs", "quests", "zones"}) do
TRADE_SKILLS_DATA[entity] = patch(TRADE_SKILLS_DATA[entity], TRADE_SKILLS_DATA_TURTLE[entity])
end