Skip to content

Commit

Permalink
Update weapon enchant suggestion list and icon type for shadowlands (…
Browse files Browse the repository at this point in the history
…Shaman enchants are back! Oh boy! They were always so fun to deal with!)
  • Loading branch information
ascott18 committed Oct 18, 2020
1 parent 0cd9b2f commit 1900adc
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 176 deletions.
107 changes: 45 additions & 62 deletions Components/IconTypes/IconType_wpnenchant/Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,66 +61,49 @@ Module.ItemIDs = {
--43235, --Wound Poison
--43231, --Instant Poison

31535, --Bloodboil Poison

3829, --Frost Oil
3824, --Shadow Oil -- good

36899, --Exceptional Mana Oil
22521, --Superior Mana Oil -- good
20748, --Brilliant Mana Oil -- good
20747, --Lesser Mana Oil -- good
20745, --Minor Mana Oil -- good

22522, --Superior Wizard Oil -- good
20749, --Brilliant Wizard Oil -- good
20750, --Wizard Oil -- good
20746, --Lesser Wizard Oil -- good
20744, --Minor Wizard Oil -- good


34539, --Righteous Weapon Coating
34538, --Blessed Weapon Coating

--23123, --Blessed Wizard Oil

--23576, --Greater Ward of Shielding
--23575, --Lesser Ward of Shielding

--25521, --Greater Rune of Warding
--23559, --Lesser Rune of Warding

--7307, --Flesh Eating Worm

--46006, --Glow Worm
--6529, --Shiny Bauble
--6532, --Bright Baubles
--67404, --Glass Fishing Bobber
--69907, --Corpse Worm
--62673, --Feathered Lure
--34861, --Sharpened Fish Hook
--6533, --Aquadynamic Fish Attractor
--6530, --Nightcrawlers
--68049, --Heat-Treated Spinning Lure
--6811, --Aquadynamic Fish Lens

--12643, --Dense Weightstone
--3241, --Heavy Weightstone
--7965, --Solid Weightstone
--3240, --Coarse Weightstone
--28420, --Fel Weightstone
--28421, --Adamantite Weightstone
--3239, --Rough Weightstone

--23529, --Adamantite Sharpening Stone
--7964, --Solid Sharpening Stone
--23122, --Consecrated Sharpening Stone
--2871, --Heavy Sharpening Stone
--23528, --Fel Sharpening Stone
--2862, --Rough Sharpening Stone
--2863, --Coarse Sharpening Stone
--12404, --Dense Sharpening Stone
--18262, --Elemental Sharpening Stone
12404, -- Dense Sharpening Stone
12643, -- Dense Weightstone
171285, -- Shadowcore Oil
171286, -- Embalmer's Oil
171436, -- Porous Sharpening Stone
171437, -- Shaded Sharpening Stone
171438, -- Porous Weightstone
171439, -- Shaded Weightstone
172038, -- Grim Iron Shackles
18262, -- Elemental Sharpening Stone
20744, -- Minor Wizard Oil
20745, -- Minor Mana Oil
20746, -- Lesser Wizard Oil
20747, -- Lesser Mana Oil
20748, -- Brilliant Mana Oil
20749, -- Brilliant Wizard Oil
20750, -- Wizard Oil
22521, -- Superior Mana Oil
22522, -- Superior Wizard Oil
23122, -- Consecrated Sharpening Stone
23123, -- Blessed Wizard Oil
23528, -- Fel Sharpening Stone
23529, -- Adamantite Sharpening Stone
23559, -- Lesser Rune of Warding
23575, -- Lesser Ward of Shielding
23576, -- Greater Ward of Shielding
25521, -- Greater Rune of Warding
28420, -- Fel Weightstone
28421, -- Adamantite Weightstone
2862, -- Rough Sharpening Stone
2863, -- Coarse Sharpening Stone
2871, -- Heavy Sharpening Stone
31535, -- Bloodboil Poison
3239, -- Rough Weightstone
3240, -- Coarse Weightstone
3241, -- Heavy Weightstone
34538, -- Blessed Weapon Coating
34539, -- Righteous Weapon Coating
36899, -- Exceptional Mana Oil
3824, -- Shadow Oil
3829, -- Frost Oil
7964, -- Solid Sharpening Stone
7965, -- Solid Weightstone

-- ZHTW:
-- weightstone: ???
Expand All @@ -144,7 +127,7 @@ function Module:OnInitialize()
self:Etc_DoItemLookups()

for _, id in pairs(self.SpellIDs) do
local name = TMW_GetSpellInfo(id)
local name = GetSpellInfo(id)
for _, enchant in TMW:Vararg(strsplit("|", L["SUG_MATCH_WPNENCH_ENCH"])) do
local dobreak
enchant = name:match(enchant)
Expand Down Expand Up @@ -274,7 +257,7 @@ end
function Module:Etc_GetTexture(name)
local tex
if self.Spells[name] then
tex = SpellTextures[self.Spells[name]]
tex = TMW.GetSpellTexture(self.Spells[name])
elseif self.Items[name] then
tex = GetItemIcon(self.Items[name])
else
Expand Down
2 changes: 1 addition & 1 deletion Localization/StaticFormats.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ L["STACKALPHA_DESC"] = L["STACKALPHA_DESC"]:format(L["ICONMENU_SHOWWHEN"])

-- Wizard magic to make ICONMENU_CHOOSENAME_WPNENCH_DESC be locale-dynamic
do
local FlametongueWeapon = GetSpellInfo(8024)
local FlametongueWeapon = GetSpellInfo(318038)
local FlametongueWeaponEnchant
for i = 1, select("#", strsplit("|", L["SUG_MATCH_WPNENCH_ENCH"])) do
local enchant = select(i, strsplit("|", L["SUG_MATCH_WPNENCH_ENCH"]))
Expand Down
52 changes: 0 additions & 52 deletions Scripts/GetWeaponAugments.lua

This file was deleted.

61 changes: 0 additions & 61 deletions Scripts/WeaponAugments.lua

This file was deleted.

79 changes: 79 additions & 0 deletions build/GetWeaponAugments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import re
import json
import urllib.request
import multiprocessing
import itertools
import os

from slpp import slpp as lua

base_url = "https://www.wowhead.com"

max_retries = 1

name_blacklist = [
"armor",
"insoles",
"lure",
"worm",
"hook",
"fish",
"bauble",
"nightcrawler",
"Darkmoon Doughnut",
"Aquatic Enticer",
]

def try_scrape_url(url, regex, id, tries = 0):
print("getting " + str(id))

user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36'
headers = {'User-Agent': user_agent}
req = urllib.request.Request(url, [], headers)
response = urllib.request.urlopen(req)

content = response.read().decode()

match = re.search(regex, content)

if not match:
if tries < max_retries:
print("retrying " + str(id))
return try_scrape_url(url, regex, id, tries + 1)
else:
raise Exception("no match for " + str(id))

data = match.group(1)
data = re.sub(r"frommerge:1", r'"frommerge":1', data)
data = re.sub(r"popularity:", r'"popularity":', data)
data = re.sub(r"firstseenpatch:", r'"firstseenpatch":', data)
data = json.loads(data)

return data


def scrape_consumable_items():
data = try_scrape_url(
url = base_url + "/items/consumables/item-enhancements-temporary/quality:1:2:3:4:5:6:7",
regex = r"var listviewitems = (\[.*\]);",
id = "item-enhancements-temporary")

ids = {}
for spell in data:
id = spell["id"]
name = spell["name"]
if not any(sub.upper() in name.upper() for sub in name_blacklist):
ids[id] = name

return ids

if __name__ == '__main__':

items = scrape_consumable_items()
output = "{"
for key in sorted(items, key=lambda k: '%03d' % k if isinstance(k, (int)) else str(k) ):
output += "\t" + str(key) + ", -- " + items[key] + "\n"
output += "}"
open(os.path.join(os.path.dirname(__file__), 'WeaponAugments.lua'), 'w').write(output)

print("complete. written to WeaponAugments.lua.")
46 changes: 46 additions & 0 deletions build/WeaponAugments.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{ 12404, -- Dense Sharpening Stone
124674, -- Day-Old Darkmoon Doughnut
12643, -- Dense Weightstone
171285, -- Shadowcore Oil
171286, -- Embalmer's Oil
171436, -- Porous Sharpening Stone
171437, -- Shaded Sharpening Stone
171438, -- Porous Weightstone
171439, -- Shaded Weightstone
172038, -- Grim Iron Shackles
177036, -- Aquatic Enticer
18262, -- Elemental Sharpening Stone
20744, -- Minor Wizard Oil
20745, -- Minor Mana Oil
20746, -- Lesser Wizard Oil
20747, -- Lesser Mana Oil
20748, -- Brilliant Mana Oil
20749, -- Brilliant Wizard Oil
20750, -- Wizard Oil
22521, -- Superior Mana Oil
22522, -- Superior Wizard Oil
23122, -- Consecrated Sharpening Stone
23123, -- Blessed Wizard Oil
23528, -- Fel Sharpening Stone
23529, -- Adamantite Sharpening Stone
23559, -- Lesser Rune of Warding
23575, -- Lesser Ward of Shielding
23576, -- Greater Ward of Shielding
25521, -- Greater Rune of Warding
28420, -- Fel Weightstone
28421, -- Adamantite Weightstone
2862, -- Rough Sharpening Stone
2863, -- Coarse Sharpening Stone
2871, -- Heavy Sharpening Stone
31535, -- Bloodboil Poison
3239, -- Rough Weightstone
3240, -- Coarse Weightstone
3241, -- Heavy Weightstone
34538, -- Blessed Weapon Coating
34539, -- Righteous Weapon Coating
36899, -- Exceptional Mana Oil
3824, -- Shadow Oil
3829, -- Frost Oil
7964, -- Solid Sharpening Stone
7965, -- Solid Weightstone
}

0 comments on commit 1900adc

Please sign in to comment.