Quantcast

Manually parse most proc and other otherwise unparseable enchants

Kevin Lyles [06-03-11 - 01:07]
Manually parse most proc and other otherwise unparseable enchants
Filename
EnchantIDs.lua
Locales/enUS/enUS.xml
Locales/enUS/patterns-enchant-items.lua
Locales/enUS/patterns.lua
Locales/enUS/stats.lua
Regexps.lua
defaults.lua
diff --git a/EnchantIDs.lua b/EnchantIDs.lua
index 4c06c75..77cd2e5 100644
--- a/EnchantIDs.lua
+++ b/EnchantIDs.lua
@@ -106,7 +106,7 @@ local EnchantIDs = {
 			weapon = "Fiery Blaze Enchantment",
 		},
 		stats = {
-			["enchant: fiery blaze"] = 1,
+			["fiery blaze"] = 1,
 		},
 	},
 	[37] = {
@@ -4142,7 +4142,7 @@ local EnchantIDs = {
 		},
 		spellID = { 74195 },
 		stats = {
-			["sometimes heal you when you deal damage"] = 1,
+			mending = 1,
 		},
 	},
 	[4067] = {
@@ -4222,7 +4222,7 @@ local EnchantIDs = {
 		},
 		spellID = { 74211 },
 		stats = {
-			["Elemental Slayer"] = 1,
+			["elemental slayer"] = 1,
 		},
 	},
 	[4075] = {
@@ -4449,7 +4449,7 @@ local EnchantIDs = {
 		},
 		spellID = { 74242 },
 		stats = {
-			["Power Torrent"] = 1,
+			["power torrent"] = 1,
 		},
 	},
 	[4098] = {
@@ -4953,7 +4953,8 @@ local EnchantIDs = {
 			["off hand"] = "Elementium Shield Spike",
 		},
 		stats = {
-			["elementium shield spike"] = 1,
+			["maximum damage dealt on block"] = 133,
+			["minimum damage dealt on block"] = 90,
 		},
 	},
 	[4216] = {
@@ -4962,7 +4963,8 @@ local EnchantIDs = {
 			["off hand"] = "Pyrium Shield Spike",
 		},
 		stats = {
-			["pyrium shield spike"] = 1,
+			["maximum damage dealt on block"] = 350,
+			["minimum damage dealt on block"] = 210,
 		},
 	},
 	[4217] = {
diff --git a/Locales/enUS/enUS.xml b/Locales/enUS/enUS.xml
index f0c80d7..3af9daa 100644
--- a/Locales/enUS/enUS.xml
+++ b/Locales/enUS/enUS.xml
@@ -12,6 +12,7 @@
 	<Script file="patterns-elixirs.lua"/>
 	<Script file="patterns-food.lua"/>
 	<Script file="patterns-enchants.lua"/>
+	<Script file="patterns-enchant-items.lua"/>
 	<Script file="patterns-fishing.lua"/>
 	<Script file="patterns-use-effects.lua"/>
 	<Script file="patterns-cooldown-use-effects.lua"/>
diff --git a/Locales/enUS/patterns-enchant-items.lua b/Locales/enUS/patterns-enchant-items.lua
new file mode 100644
index 0000000..8d55593
--- /dev/null
+++ b/Locales/enUS/patterns-enchant-items.lua
@@ -0,0 +1,46 @@
+if GetLocale() ~= "enUS" then
+	return
+end
+
+local PreprocessLines = {
+	{" +%(1 sec cooldown%)$", ""},
+	{"^use: enchants a weapon to have a 15%% chance to inflict 9 to 13 fire damage to all enemies within 3 yards%.$", "fiery blaze"},
+	{"^use: permanently enchant a melee weapon to often strike for 40 additional fire damage%.$", "fiery weapon"},
+	{"^use: permanently enchant a melee weapon to have a chance of stunning and doing additional damage against demons%.$", "demonslaying"},
+	{"^use: permanently enchant a melee weapon to often chill the target, reducing their movement and attack speed%.  has a reduced effect for players above level 60%.$", "icy chill"},
+	{"^use: permanently enchant a melee weapon to often steal life from the enemy and give it to the wielder%.  has a reduced effect for players above level 60%.$", "lifestealing"},
+	{"^use: permanently enchant a melee weapon to often inflict a curse on the target, inflicting shadow damage and reducing their melee damage%.$", "unholy weapon"},
+	{"^use: permanently enchant a melee weapon to often heal for 75 to 125 and increase strength by 100 for 15 sec%. when attacking in melee%. has a reduced effect for players above level 60%.$", "crusader"},
+	{"^use: permanently enchant a melee weapon to occasionally increase agility by 120 and attack speed slightly%.  requires a level 35 or higher item%.$", "mongoose"},
+	{"^use: permanently enchant a melee weapon to make your spells sometimes restore 100 mana to nearby party members%.  requires a level 35 or higher item%.$", "spellsurge"},
+	{"^use: permanently enchant a melee weapon to occasionally heal nearby party members for 180 to 300 when attacking in melee%.  requires a level 35 or higher item%.$", "battlemaster"},
+	{"^use: permanently enchant a melee weapon to occasionally grant you 120 critical strike rating%.  only one instance of this effect can be active at a time%.  requires a level 60 or higher item%.$", "executioner"},
+	{"^use: permanently enchant a melee weapon to sometimes inflict fire damage%.  requires a level 60 or higher item%.$", "icebreaker"},
+	{"^use: permanently enchant a melee weapon to sometimes heal the wielder when striking in melee%.  requires a level 60 or higher item%.$", "lifeward"},
+	{"^use: permanently enchant a melee weapon to have a chance of reducing movement speed and doing additional damage against giants%.  requires a level 60 or higher item%.$", "giant slayer"},
+	{"^use: permanently enchant a melee weapon to cause your damaging spells and melee weapon hits to occasionally inflict additional frost damage and slow the target%.  requires a level 60 or higher item%.\r\n\r\nslow effect does not work on targets 73 or higher%.$", "deathfrost"},
+	{"^use: permanently enchant a melee weapon to sometimes increase your attack power by 400, but at the cost of reduced armor%.  requires a level 60 or higher item%.$", "berserking"},
+	{"^use: permanently enchant a melee weapon to cause your harmful spells to sometimes increase haste rating by 250%.  requires a level 60 or higher item%.$", "black magic"},
+	{"^use: permanently enchants a weapon to sometimes grant blade warding when striking an enemy%.  blade warding increases your parry rating by 200 and inflicts 600 to 800 damage on your next parry%.  lasts 10 sec%.\r\n\r\nthis enchantment requires the wielder is at least level 75%.$", "blade ward"},
+	{"^use: permanently enchants your weapon to sometimes grant blood reserve when striking an enemy or inflicting damage with bleed attacks%.  when you fall below 35%% health, blood reserve restores 360 to 440 health%.  lasts 20 sec and stacks up to 5 times%.\r\n\r\nthis enchantment requires the wielder is at least level 75%.$", "blood draining"},
+	{"^use: permanently enchant a weapon to sometimes heal you when damaging an enemy with spells and melee attacks%.  requires a level 300 or higher item.", "mending"},
+	{"^use: permanently enchant a weapon to often deal 532 to 618 nature damage to an enemy damaged by your spells or struck by your melee attacks%.  requires a level 300 or higher item%.$", "avalanche"},
+	{"^use: permanently enchant a melee weapon to sometimes disrupt elementals when struck by your melee attacks, dealing arcane damage and silencing them for 5 sec%.  requires a level 300 or higher item%.$", "elemental slayer"},
+	{"^use: permanently enchant a melee weapon to sometimes increase haste rating by 450 for 12 sec when healing or dealing spell or melee damage%.  requires a level 300 or higher item%.$", "hurricane"},
+	{"^use: permanently enchant a weapon to sometimes increase spirit by 200 for 15 sec when healing or dealing damage with spells%.  requires a level 300 or higher item%.$", "heartsong"},
+	{"^use: permanently enchant a weapon to sometimes increase intellect by 500 for 12 sec when dealing damage or healing with spells%.  requires a level 300 or higher item%.$", "power torrent"},
+	{"^use: permanently enchant a weapon to sometimes increase dodge rating by 600 and movement speed by 15%% for 10 sec when striking in melee%.  requires a level 300 or higher item%.$", "windwalk"},
+	{"^use: permanently enchant a weapon to sometimes increase attack power by 1000 for 12 sec when striking in melee%.  requires a level 300 or higher item%.$", "landslide"},
+	{"^use: attaches a permanent scope to a bow or gun that sometimes increases ranged attack power by 800 for 10 sec when dealing damage with ranged attacks%.\r\n\r\nattaching this scope to a ranged weapon causes it to become soulbound%.$", "gnomish x-ray scope"},
+}
+
+local MatchLines = {}
+for i = 2, #(PreprocessLines) do
+	table.insert(MatchLines, PreprocessLines[i][1]:sub(1, -2))
+end
+
+local function oneOf(stat)
+	return {stats = WeightsWatcher.newStatTable({[stat] = 1})}
+end
+
+ww_enchant_items = {MatchLines, {}, {}, PreprocessLines, {}, oneOf, "enchantItem"}
diff --git a/Locales/enUS/patterns.lua b/Locales/enUS/patterns.lua
index be37061..9dc2904 100644
--- a/Locales/enUS/patterns.lua
+++ b/Locales/enUS/patterns.lua
@@ -8,6 +8,7 @@ ww_EffectHandlers = {
 	ww_generic,
 	ww_socketBonuses,
 	ww_food,
+	ww_enchant_items,
 	ww_enchants,
 	ww_elixirs,
 	ww_fishing,
diff --git a/Locales/enUS/stats.lua b/Locales/enUS/stats.lua
index cd56a95..19ba6f2 100644
--- a/Locales/enUS/stats.lua
+++ b/Locales/enUS/stats.lua
@@ -13,11 +13,17 @@ ww_localizedStats = {
 	["armor from items (percent)"] = "armor from items (percent)",
 -- 	["armor penetration rating"] = "armor penetration rating",
 	["attack power"] = "attack power",
+	["avalanche"] = "avalanche",
 	["average melee weapon damage"] = "average melee weapon damage",
 	["average ranged weapon damage"] = "average ranged weapon damage",
+	["battlemaster"] = "battlemaster",
+	["berserking"] = "berserking",
+	["black magic"] = "black magic",
+	["blade ward"] = "blade ward",
 	["block rating"] = "block rating",
 -- 	["block value"] = "block value",
 	["block value (percent)"] = "block value (percent)",
+	["blood draining"] = "blood draining",
 	["chance to increase physical haste"] = "chance to increase physical haste",
 	["chance to increase spell haste"] = "chance to increase spell haste",
 	["chance to restore health on hit"] = "chance to restore health on hit",
@@ -26,30 +32,46 @@ ww_localizedStats = {
 	["critical damage (percent)"] = "critical damage (percent)",
 	["critical healing (percent)"] = "critical healing (percent)",
 	["critical strike rating"] = "critical strike rating",
+	["crusader"] = "crusader",
+	["deathfrost"] = "deathfrost",
 -- 	["defense rating"] = "defense rating",
+	["demonslaying"] = "demonslaying",
 	["disarm duration reduction (percent)"] = "disarm duration reduction (percent)",
 	["dodge rating"] = "dodge rating",
+	["elemental slayer"] = "elemental slayer",
+	["executioner"] = "executioner",
 	["expertise rating"] = "expertise rating",
 	["disorient resist chance (percent)"] = "disorient resist chance (percent)",
 	["fear duration reduction (percent)"] = "fear duration reduction (percent)",
 	["fear resist chance (percent)"] = "fear resist chance (percent)",
 -- 	["feral attack power"] = "feral attack power",
+	["fiery blaze"] = "fiery blaze",
+	["fiery weapon"] = "fiery weapon",
 	["fire resistance"] = "fire resistance",
 	["fire spell damage"] = "fire spell damage",
 	["fishing"] = "fishing",
 	["frost resistance"] = "frost resistance",
 	["frost spell damage"] = "frost spell damage",
+	["giant slayer"] = "giant slayer",
+	["gnomish x-ray scope"] = "gnomish x-ray scope",
 	["haste rating"] = "haste rating",
 	["health"] = "health",
+	["heartsong"] = "heartsong",
 	["herbalism"] = "herbalism",
 	["hit rating"] = "hit rating",
 -- 	["holy resistance"] = "holy resistance",
 	["holy spell damage"] = "holy spell damage",
 	["hp5"] = "hp5",
+	["hurricane"] = "hurricane",
+	["icebreaker"] = "icebreaker",
+	["icy chill"] = "icy chill",
 	["increased stealth"] = "increased stealth",
 	["intellect"] = "intellect",
 -- 	["intellect (percent)"] = "intellect (percent)",
 	["item level"] = "item level",
+	["landslide"] = "landslide",
+	["lifestealing"] = "lifestealing",
+	["lifeward"] = "lifeward",
 	["mana"] = "mana",
 	["mana (percent)"] = "mana (percent)",
 	["mastery rating"] = "mastery rating",
@@ -58,13 +80,16 @@ ww_localizedStats = {
 	["melee critical strike rating"] = "melee critical strike rating",
 	["melee dps"] = "melee dps",
 	["melee weapon speed"] = "melee weapon speed",
+	["mending"] = "mending",
 	["mining"] = "mining",
 	["minor run speed"] = "minor run speed",
+	["mongoose"] = "mongoose",
 	["mount speed (percent)"] = "mount speed (percent)",
 	["mp5"] = "mp5",
 	["nature resistance"] = "nature resistance",
 	["nature spell damage"] = "nature spell damage",
 	["parry rating"] = "parry rating",
+	["power torrent"] = "power torrent",
 	["prismatic socket"] = "prismatic socket",
 	["ranged attack power"] = "ranged attack power",
 	["ranged critical strike rating"] = "ranged critical strike rating",
@@ -86,6 +111,7 @@ ww_localizedStats = {
 	["spell penetration"] = "spell penetration",
 	["spell power"] = "spell power",
 	["spell reflect (percent)"] = "spell reflect (percent)",
+	["spellsurge"] = "spellsurge",
 	["spirit"] = "spirit",
 	["stamina"] = "stamina",
 	["strength"] = "strength",
@@ -93,6 +119,8 @@ ww_localizedStats = {
 	["stun resist chance (percent)"] = "stun resist chance (percent)",
 	["threat (percent)"] = "threat (percent)",
 	["threat reduction (percent)"] = "threat reduction (percent)",
+	["unholy weapon"] = "unholy weapon",
+	["windwalk"] = "windwalk",
 }

 ww_englishStats = {}
@@ -111,11 +139,17 @@ ww_statDisplayNames = {
 	[ww_localizedStats["armor from items (percent)"]] = "Armor from Items (Percent)",
 -- 	[ww_localizedStats["armor penetration rating"]] = "Armor Penetration Rating",
 	[ww_localizedStats["attack power"]] = "Attack Power",
+	[ww_localizedStats["avalanche"]] = "Avalanche",
 	[ww_localizedStats["average melee weapon damage"]] = "Average Melee Weapon Damage",
 	[ww_localizedStats["average ranged weapon damage"]] = "Average Ranged Weapon Damage",
+	[ww_localizedStats["battlemaster"]] = "Battlemaster",
+	[ww_localizedStats["berserking"]] = "Berserking",
+	[ww_localizedStats["black magic"]] = "Black Magic",
+	[ww_localizedStats["blade ward"]] = "Blade Ward",
 	[ww_localizedStats["block rating"]] = "Block Rating",
 -- 	[ww_localizedStats["block value"]] = "Block Value",
 	[ww_localizedStats["block value (percent)"]] = "Block Value (Percent)",
+	[ww_localizedStats["blood draining"]] = "Blood Draining",
 	[ww_localizedStats["chance to increase physical haste"]] = "Chance to Increase Physical Haste",
 	[ww_localizedStats["chance to increase spell haste"]] = "Chance to Increase Spell Haste",
 	[ww_localizedStats["chance to restore health on hit"]] = "Chance to Restore Health on Hit",
@@ -124,30 +158,46 @@ ww_statDisplayNames = {
 	[ww_localizedStats["critical damage (percent)"]] = "Critical Damage (Percent)",
 	[ww_localizedStats["critical healing (percent)"]] = "Critical Healing (Percent)",
 	[ww_localizedStats["critical strike rating"]] = "Critical Strike Rating",
+	[ww_localizedStats["crusader"]] = "Crusader",
+	[ww_localizedStats["deathfrost"]] = "Deathfrost",
 -- 	[ww_localizedStats["defense rating"]] = "Defense Rating",
+	[ww_localizedStats["demonslaying"]] = "Demonslaying",
 	[ww_localizedStats["disarm duration reduction (percent)"]] = "Disarm Duration Reduction (Percent)",
 	[ww_localizedStats["dodge rating"]] = "Dodge Rating",
 	[ww_localizedStats["expertise rating"]] = "Expertise Rating",
 	[ww_localizedStats["disorient resist chance (percent)"]] = "Disorient Resist Chance (Percent)",
+	[ww_localizedStats["elemental slayer"]] = "Elemental Slayer",
+	[ww_localizedStats["executioner"]] = "Executioner",
 	[ww_localizedStats["fear duration reduction (percent)"]] = "Fear Duration Reduction (Percent)",
 	[ww_localizedStats["fear resist chance (percent)"]] = "Fear Resist Chance (Percent)",
 -- 	[ww_localizedStats["feral attack power"]] = "Feral Attack Power",
+	[ww_localizedStats["fiery blaze"]] = "Fiery Blaze",
+	[ww_localizedStats["fiery weapon"]] = "Fiery Weapon",
 	[ww_localizedStats["fire resistance"]] = "Fire Resistance",
 	[ww_localizedStats["fire spell damage"]] = "Fire Spell Damage",
 	[ww_localizedStats["fishing"]] = "Fishing",
 	[ww_localizedStats["frost resistance"]] = "Frost Resistance",
 	[ww_localizedStats["frost spell damage"]] = "Frost Spell Damage",
+	[ww_localizedStats["giant slayer"]] = "Giant Slayer",
+	[ww_localizedStats["gnomish x-ray scope"]] = "Gnomish X-Ray Scope",
 	[ww_localizedStats["haste rating"]] = "Haste Rating",
 	[ww_localizedStats["health"]] = "Health",
+	[ww_localizedStats["heartsong"]] = "Heartsong",
 	[ww_localizedStats["herbalism"]] = "Herbalism",
 	[ww_localizedStats["hit rating"]] = "Hit Rating",
 -- 	[ww_localizedStats["holy resistance"]] = "Holy Resistance",
 	[ww_localizedStats["holy spell damage"]] = "Holy Spell Damage",
 	[ww_localizedStats["hp5"]] = "HP5",
+	[ww_localizedStats["hurricane"]] = "Hurricane",
+	[ww_localizedStats["icebreaker"]] = "Icebreaker",
+	[ww_localizedStats["icy chill"]] = "Icy Chill",
 	[ww_localizedStats["increased stealth"]] = "Increased Stealth",
 	[ww_localizedStats["intellect"]] = "Intellect",
 -- 	[ww_localizedStats["intellect (percent)"]] = "Intellect (Percent)",
 	[ww_localizedStats["item level"]] = "Item Level",
+	[ww_localizedStats["landslide"]] = "Landslide",
+	[ww_localizedStats["lifestealing"]] = "Lifestealing",
+	[ww_localizedStats["lifeward"]] = "Lifeward",
 	[ww_localizedStats["mana"]] = "Mana",
 	[ww_localizedStats["mana (percent)"]] = "Mana (Percent)",
 	[ww_localizedStats["mastery rating"]] = "Mastery Rating",
@@ -156,13 +206,16 @@ ww_statDisplayNames = {
 	[ww_localizedStats["melee critical strike rating"]] = "Melee Critical Strike Rating",
 	[ww_localizedStats["melee dps"]] = "Melee DPS",
 	[ww_localizedStats["melee weapon speed"]] = "Melee Weapon Speed",
+	[ww_localizedStats["mending"]] = "Mending",
 	[ww_localizedStats["mining"]] = "Mining",
 	[ww_localizedStats["minor run speed"]] = "Minor Run Speed",
+	[ww_localizedStats["mongoose"]] = "Mongoose",
 	[ww_localizedStats["mount speed (percent)"]] = "Mount Speed (Percent)",
 	[ww_localizedStats["mp5"]] = "MP5",
 	[ww_localizedStats["nature resistance"]] = "Nature Resistance",
 	[ww_localizedStats["nature spell damage"]] = "Nature Spell Damage",
 	[ww_localizedStats["parry rating"]] = "Parry Rating",
+	[ww_localizedStats["power torrent"]] = "Power Torrent",
 	[ww_localizedStats["prismatic socket"]] = "Prismatic Socket",
 	[ww_localizedStats["ranged attack power"]] = "Ranged Attack Power",
 	[ww_localizedStats["ranged critical strike rating"]] = "Ranged Critical Strike Rating",
@@ -184,6 +237,7 @@ ww_statDisplayNames = {
 	[ww_localizedStats["spell penetration"]] = "Spell Penetration",
 	[ww_localizedStats["spell power"]] = "Spell Power",
 	[ww_localizedStats["spell reflect (percent)"]] = "Spell Reflect (Percent)",
+	[ww_localizedStats["spellsurge"]] = "Spellsurge",
 	[ww_localizedStats["spirit"]] = "Spirit",
 	[ww_localizedStats["stamina"]] = "Stamina",
 	[ww_localizedStats["strength"]] = "Strength",
@@ -191,6 +245,8 @@ ww_statDisplayNames = {
 	[ww_localizedStats["stun resist chance (percent)"]] = "Stun Resist Chance (Percent)",
 	[ww_localizedStats["threat (percent)"]] = "Threat (Percent)",
 	[ww_localizedStats["threat reduction (percent)"]] = "Threat Reduction (Percent)",
+	[ww_localizedStats["unholy weapon"]] = "Unholy Weapon",
+	[ww_localizedStats["windwalk"]] = "Windwalk",
 }

 ww_statCategories = {
@@ -209,4 +265,5 @@ ww_statCategories = {
 	["Professions"] = "Professions",
 	["Miscellaneous"] = "Miscellaneous",
 	["Enchant/Meta Gem Effects"] = "Enchant/Meta Gem Effects",
+	["Individual Enchants"] = "Individual Enchants",
 }
diff --git a/Regexps.lua b/Regexps.lua
index 107b79d..632cad4 100644
--- a/Regexps.lua
+++ b/Regexps.lua
@@ -1,6 +1,7 @@
 local patternCategories = {
 	"elixir",
 	"enchant",
+	"enchantItem",
 	"equipEffect",
 	"fishing",
 	"food",
diff --git a/defaults.lua b/defaults.lua
index db06cc9..0106290 100644
--- a/defaults.lua
+++ b/defaults.lua
@@ -7,6 +7,7 @@ ww_trackedStats = {
 	ww_statCategories["Caster"],
 	ww_statCategories["PVP"],
 	ww_statCategories["Miscellaneous"],
+	ww_statCategories["Individual Enchants"],
 	[ww_statCategories["General"]] = {
 		"critical strike rating",
 		"haste rating",
@@ -150,6 +151,36 @@ ww_trackedStats = {
 			"skinning",
 		},
 	},
+	[ww_statCategories["Individual Enchants"]] = {
+		"avalanche",
+		"battlemaster",
+		"berserking",
+		"black magic",
+		"blade ward",
+		"blood draining",
+		"crusader",
+		"deathfrost",
+		"demonslaying",
+		"elemental slayer",
+		"executioner",
+		"fiery blaze",
+		"fiery weapon",
+		"giant slayer",
+		"gnomish x-ray scope",
+		"heartsong",
+		"hurricane",
+		"icebreaker",
+		"icy chill",
+		"landslide",
+		"lifestealing",
+		"lifeward",
+		"mending",
+		"mongoose",
+		"power torrent",
+		"spellsurge",
+		"unholy weapon",
+		"windwalk",
+	},
 }

 if ww_stackingEquipEffects then