Quantcast

Fixed a lot of cata item parsing

Kevin Lyles [09-10-10 - 00:46]
Fixed a lot of cata item parsing
Filename
Locales/enUS/patterns-cooldown-use-effects.lua
Locales/enUS/patterns-elixirs.lua
Locales/enUS/patterns-enchants.lua
Locales/enUS/patterns-generic.lua
Locales/enUS/patterns-stacking-equip-effects.lua
Locales/enUS/patterns-use-effects.lua
Locales/enUS/patterns.lua
diff --git a/Locales/enUS/patterns-cooldown-use-effects.lua b/Locales/enUS/patterns-cooldown-use-effects.lua
index 6305cb1..2f22302 100644
--- a/Locales/enUS/patterns-cooldown-use-effects.lua
+++ b/Locales/enUS/patterns-cooldown-use-effects.lua
@@ -44,7 +44,8 @@ local CooldownUseAffixes = {
 	"^increases? +",
 	"^restores +",
 	"^your +",
-	"^the target's +",
+	"^the +",
+	"^target's +",
 	"^maximum +",
 	" +shares cooldown with o?t?h?e?r? ?battlemaster's trinkets%.",
 	-- item 12459
diff --git a/Locales/enUS/patterns-elixirs.lua b/Locales/enUS/patterns-elixirs.lua
index d52feb2..fb94b14 100644
--- a/Locales/enUS/patterns-elixirs.lua
+++ b/Locales/enUS/patterns-elixirs.lua
@@ -29,6 +29,8 @@ local ElixirAffixes = {
 	"^your size is increased and +",
 	"^your +",
 	"^the player's +",
+	"^the target's +",
+	"^maximum +",
 	"^mana regeneration by +",
 	"^regenerate +",
 	" +%(1 sec cooldown%)$",
@@ -42,6 +44,7 @@ local ElixirAffixes = {
 	" +counts as both a battle and guardian elixir%.$",
 	" +battle elixir%.$",
 	" +guardian elixir%.$",
+	" +this effect counts as a$",
 	" +%d+ ho?u?rs?%.$",
 	" +%d+ minu?t?e?s?%.$",
 	" +for$",
diff --git a/Locales/enUS/patterns-enchants.lua b/Locales/enUS/patterns-enchants.lua
index 1d8890d..a006b4f 100644
--- a/Locales/enUS/patterns-enchants.lua
+++ b/Locales/enUS/patterns-enchants.lua
@@ -19,6 +19,7 @@ local EnchantUnweightedLines = {
 }

 local EnchantPreprocessLines = {
+	{" increase movement speed slightly ", " minor run speed increase "},
 	{" socket ", " prismatic socket "},
 	{" and increase?i?n?g? ", " and "},
 	{" and your ", " and "},
@@ -27,7 +28,7 @@ local EnchantPreprocessLines = {
 	{" melee weapon to do (%d+) additional points? of damage", " %1 melee damage"},
 	{" armor value ", " armor "},
 	{" additional ", " "},
-	{" a slight movement speed increase", " a minor movement speed increase"},
+	{" a slight movement speed increase", " minor run speed increase"},
 	{"^use: attaches a permanent scope to a bow or gun that increases its damage by ", "increases ranged damage by "},
 	{" resistance to (%a+) by ", " %1 resistance by "},
 	{" resistance to all schools of magic by ", " all resistances by "},
@@ -72,7 +73,8 @@ local EnchantAffixes = {
 	"^gloves +",
 	"^shield +",
 	"^piece of +",
-	"^chest armor +",
+	"^chest +",
+	"^armor +",
 	"^two%-handed +",
 	"^melee weapon +",
 	"^weapon +",
@@ -111,9 +113,12 @@ local EnchantAffixes = {
 	" +requires a level %d+ or higher l?e?v?e?l? ?item%.$",
 	" +must be level %d+ or lower to gain this benefit%.$",
 	" +wearer must be level %d+ or higher%.$",
+	" +cannot be used on items level 300 or higher%.$",
 	"[\r\n]+%a+ing [%a ]+ causes [%a ]+ to become soulbound%.$",
 	"[\r\n]+can only be attached to [%a ]+ in your inventory%.$",
 	" +only the enchanter's rings can be enchanted,? and enchanting a ring will cause it to become soulbound%.$",
+	" +fur lining requires at least %d+ skill in leatherworking to remain active%.$",
+	"[\r\n]+can only be used on the leatherworker's bracers, and doing so will cause them to become soulbound%.$",
 	-- TODO: flag this somehow and handle it in scoring
 	" +does not stack with other similar effects%.",
 	" +does not stack with other enchantments for the selected equipment slot%.",
@@ -121,8 +126,8 @@ local EnchantAffixes = {
 	"^eternal belt buckle onto a belt, adding a +",
 	" +to the belt%.$",
 	" +to shoulder armor%.$",
-	" +t?of? an item worn on the %a[%a ,]+ or %a+",
-	" +to a %a[%a ,]+ slot item%.?$",
+	" +t?o[fn]? any? item worn on the %a[%a ,]+ or %a+",
+	" +t?on? a %a[%a ,]+ slot item%.?$",
 	" +on a pair of gloves",
 	"points of +",
 	"^mana regeneration by +",
diff --git a/Locales/enUS/patterns-generic.lua b/Locales/enUS/patterns-generic.lua
index 09912df..8b1d14d 100644
--- a/Locales/enUS/patterns-generic.lua
+++ b/Locales/enUS/patterns-generic.lua
@@ -20,6 +20,7 @@ local GenericPreprocessLines = {
 	{" to all ", " all "},
 	{" (%d+%%) stun resistance$", " chance to resist stun effects by %1"},
 	{" reduces snare/root duration by ", " snare/root duration reduced by "},
+	{" maximum mana$", " mana"},
 }

 local GenericAffixes = {
diff --git a/Locales/enUS/patterns-stacking-equip-effects.lua b/Locales/enUS/patterns-stacking-equip-effects.lua
index c00e594..f7957a2 100644
--- a/Locales/enUS/patterns-stacking-equip-effects.lua
+++ b/Locales/enUS/patterns-stacking-equip-effects.lua
@@ -22,11 +22,13 @@ local triggerGroups = {

 local StackingEquipMatchLines = {
 	"^equip: each .* stack",
+	"^equip: your spells grant .* stack",
 }

 local stackingEquipPreprocessLines = {
 	{"%. +each time you ", " SPLIT "},
 	{"%. +stacks ", ", stacking "},
+	{" your spells grant ", " each time you cast a spell you gain "},
 }

 local StackingEquipAffixes = {
diff --git a/Locales/enUS/patterns-use-effects.lua b/Locales/enUS/patterns-use-effects.lua
index b43c4fc..f0fc202 100644
--- a/Locales/enUS/patterns-use-effects.lua
+++ b/Locales/enUS/patterns-use-effects.lua
@@ -18,6 +18,14 @@ local UseEffectIgnoreLines = {
 	"^use: a strangely glowing alcoholic beverage",
 	"^use: instantly restores ",
 	"^use: reduces ",
+	"^use: combines? ",
+	"^use: inflicts? ",
+	"^use: increases the range ",
+	"^use: increases the radius ",
+	"^use: increases the duration ",
+	"^use: summons? ",
+	"^use: turns? ",
+	"^use: unlocks? ",
 }

 local UseEffectUnweightedLines = {
diff --git a/Locales/enUS/patterns.lua b/Locales/enUS/patterns.lua
index 3c674e7..85c2b71 100644
--- a/Locales/enUS/patterns.lua
+++ b/Locales/enUS/patterns.lua
@@ -11,8 +11,8 @@ ww_EffectHandlers = {
 	ww_enchants,
 	ww_elixirs,
 	ww_fishing,
-	ww_useEffects,
 	ww_cooldownUseEffects,
+	ww_useEffects,
 	ww_stackingEquipEffects,
 }

@@ -97,8 +97,12 @@ ww_IgnoredLines = {
 	"^use: right click to ",
 	"^this item begins a quest$",
 	"^already known$",
+	"^prime glyph$",
 	"^major glyph$",
 	"^minor glyph$",
+	"^<.*>$",
+	-- TODO: add these for ALL professions
+	"^prospectable$",
 	-- Zone names
 	"^alterac valley$",
 	"^black temple$",
@@ -108,6 +112,7 @@ ww_IgnoredLines = {
 	"^drak'tharon keep$",
 	"^grizzly hills$",
 	"^icecrown citadel$",
+	"^icecrown$",
 	"^isle of conquest$",
 	"^karazhan$",
 	"^shadowmoon valley",
@@ -120,6 +125,7 @@ ww_IgnoredLines = {
 	"^the escape from durnholde$",
 	"^the oculus$",
 	"^utgarde pinnacle$",
+	"^violet hold$",
 	"^wintergrasp$",
 	"^zul'aman$",
 	"^zul'drak$",
@@ -212,6 +218,21 @@ ww_MultipleStatLines = {
 		end,
 		{"enchant"},
 	},
+	{"^(%a+ )and (%a[%a ]+ )by( %d+)$",
+		function(text, pattern, section)
+			local start, _, stat1, stat2, value = string.find(text, pattern)
+			if start then
+				stat1 = WeightsWatcher.singleStat(stat1 .. "by" .. value, section)
+				stat2 = WeightsWatcher.singleStat(stat2 .. "by" .. value, section)
+				if stat1 and stat2 then
+					return stat1.stats + stat2.stats
+				else
+					ww_unparsed_lines[text][pattern].parsedTo = {stat1, stat2}
+				end
+			end
+		end,
+		{"enchant"},
+	},
 	{"^(%a[%a ]+ )and (%a[%a ]+ )rating by( %d+)$",
 		function(text, pattern, section)
 			local start, _, stat1, stat2, value = string.find(text, pattern)
@@ -227,6 +248,21 @@ ww_MultipleStatLines = {
 		end,
 		{"enchant"},
 	},
+	{"^(%a[%a ]+ )and (%a[%a ]+ )by( %d+)$",
+		function(text, pattern, section)
+			local start, _, stat1, stat2, value = string.find(text, pattern)
+			if start then
+				stat1 = WeightsWatcher.singleStat(stat1 .. "by" .. value, section)
+				stat2 = WeightsWatcher.singleStat(stat2 .. "by" .. value, section)
+				if stat1 and stat2 then
+					return stat1.stats + stat2.stats
+				else
+					ww_unparsed_lines[text][pattern].parsedTo = {stat1, stat2}
+				end
+			end
+		end,
+		{"elixir"},
+	},
 	{"^([+-]?%d+) health and mana every 5 seco?n?d?s?$",
 		function(text, pattern)
 			local start, _, value = string.find(text, pattern)
@@ -385,7 +421,7 @@ ww_SingleStatLines = {
 		end,
 		{"elixir", "enchant"},
 	},
-	{"^([+-]?%d+) (mana)$", WeightsWatcher.statNumFirst, {"enchant"}},
+	{"^([+-]?%d+) (mana)$", WeightsWatcher.statNumFirst, {"enchant", "elixir"}},
 	{"^([+-]?%d+) ranged damage$",
 		function(text, pattern)
 			return WeightsWatcher.singleStatValueOnly(text, pattern, "average ranged weapon damage") + WeightsWatcher.singleStatValueOnly(text, pattern, "maximum ranged weapon damage")