vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 if AceLibrary:HasInstance("ItemBonusLib-1.0") then return end
2  
3 local L = AceLibrary("AceLocale-2.2"):new("ItemBonusLib")
4  
5 L:RegisterTranslations("enUS", function () return {
6 CHAT_COMMANDS = { "/abonus" },
7 ["An addon to get information about bonus from equipped items"] = true,
8 ["show"] = true,
9 ["Show all bonuses from the current equipment"] = true,
10 ["Current equipment bonuses:"] = true,
11 ["details"] = true,
12 ["Shows bonuses with slot distribution"] = true,
13 ["Current equipment bonus details:"] = true,
14 ["item"] = true,
15 ["show bonuses of given itemlink"] = true,
16 ["<itemlink>"] = true,
17 ["Bonuses for %s:"] = true,
18 ["Item is part of set [%s]"] = true,
19 [" %sBonus for %d pieces :"] = true,
20 ["slot"] = true,
21 ["show bonuses of given slot"] = true,
22 ["<slotname>"] = true,
23 ["Bonuses of slot %s:"] = true,
24  
25 -- bonus names
26 NAMES = {
27 STR = "Strength",
28 AGI = "Agility",
29 STA = "Stamina",
30 INT = "Intellect",
31 SPI = "Spirit",
32 ARMOR = "Reinforced Armor",
33  
34 ARCANERES = "Arcane Resistance",
35 FIRERES = "Fire Resistance",
36 NATURERES = "Nature Resistance",
37 FROSTRES = "Frost Resistance",
38 SHADOWRES = "Shadow Resistance",
39  
40 FISHING = "Fishing",
41 MINING = "Mining",
42 HERBALISM = "Herbalism",
43 SKINNING = "Skinning",
44 DEFENSE = "Defense",
45  
46 BLOCK = "Chance to Block",
47 BLOCKVALUE = "Block value",
48 DODGE = "Dodge",
49 PARRY = "Parry",
50 ATTACKPOWER = "Attack Power",
51 ATTACKPOWERUNDEAD = "Attack Power against Undead",
52 ATTACKPOWERFERAL = "Attack Power in feral form",
53 CRIT = "Crit. hits",
54 RANGEDATTACKPOWER = "Ranged Attack Power",
55 RANGEDCRIT = "Crit. Shots",
56 TOHIT = "Chance to Hit",
57  
58 DMG = "Spell Damage",
59 DMGUNDEAD = "Spell Damage against Undead",
60 ARCANEDMG = "Arcane Damage",
61 FIREDMG = "Fire Damage",
62 FROSTDMG = "Frost Damage",
63 HOLYDMG = "Holy Damage",
64 NATUREDMG = "Nature Damage",
65 SHADOWDMG = "Shadow Damage",
66 SPELLCRIT = "Crit. Spell",
67 SPELLTOHIT = "Chance to Hit with spells",
68 SPELLPEN = "Spell Penetration",
69 HEAL = "Healing",
70 HOLYCRIT = "Crit. Holy Spell",
71  
72 HEALTHREG = "Life Regeneration",
73 MANAREG = "Mana Regeneration",
74 HEALTH = "Life Points",
75 MANA = "Mana Points"
76 };
77  
78  
79 -- passive bonus patterns. checked against lines which start with above prefixes
80 PATTERNS_PASSIVE = {
81 { pattern = "+(%d+) ranged Attack Power%.", effect = "RANGEDATTACKPOWER" },
82 { pattern = "Increases your chance to block attacks with a shield by (%d+)%%%.", effect = "BLOCK" },
83 { pattern = "Increases the block value of your shield by (%d+)%.", effect = "BLOCKVALUE" },
84 { pattern = "Increases your chance to dodge an attack by (%d+)%%%.", effect = "DODGE" },
85 { pattern = "Increases your chance to parry an attack by (%d+)%%%.", effect = "PARRY" },
86 { pattern = "Improves your chance to get a critical strike with spells by (%d+)%%%.", effect = "SPELLCRIT" },
87 { pattern = "Improves your chance to get a critical strike with Holy spells by (%d+)%%%.", effect = "HOLYCRIT" },
88 { pattern = "Increases the critical effect chance of your Holy spells by (%d+)%%%.", effect = "HOLYCRIT" },
89 { pattern = "Improves your chance to get a critical strike by (%d+)%%%.", effect = "CRIT" },
90 { pattern = "Improves your chance to get a critical strike with missile weapons by (%d+)%%%.", effect = "RANGEDCRIT" },
91 { pattern = "Increases damage done by Arcane spells and effects by up to (%d+)%.", effect = "ARCANEDMG" },
92 { pattern = "Increases damage done by Fire spells and effects by up to (%d+)%.", effect = "FIREDMG" },
93 { pattern = "Increases damage done by Frost spells and effects by up to (%d+)%.", effect = "FROSTDMG" },
94 { pattern = "Increases damage done by Holy spells and effects by up to (%d+)%.", effect = "HOLYDMG" },
95 { pattern = "Increases damage done by Nature spells and effects by up to (%d+)%.", effect = "NATUREDMG" },
96 { pattern = "Increases damage done by Shadow spells and effects by up to (%d+)%.", effect = "SHADOWDMG" },
97 { pattern = "Increases healing done by spells and effects by up to (%d+)%.", effect = "HEAL" },
98 { pattern = "Increases damage and healing done by magical spells and effects by up to (%d+)%.", effect = {"HEAL", "DMG"} },
99 { pattern = "Increases damage done to Undead by magical spells and effects by up to (%d+)", effect = "DMGUNDEAD" },
100 { pattern = "+(%d+) Attack Power when fighting Undead.", effect = "ATTACKPOWERUNDEAD" },
101 { pattern = "Restores (%d+) health per 5 sec%.", effect = "HEALTHREG" },
102 { pattern = "Restores (%d+) health every 5 sec%.", effect = "HEALTHREG" }, -- both versions ('per' and 'every') seem to be used
103 { pattern = "Restores (%d+) mana per 5 sec%.", effect = "MANAREG" },
104 { pattern = "Restores (%d+) mana every 5 sec%.", effect = "MANAREG" },
105 { pattern = "Improves your chance to hit by (%d+)%%%.", effect = "TOHIT" },
106 { pattern = "Improves your chance to hit with spells by (%d+)%%%.", effect = "SPELLTOHIT" },
107 { pattern = "Decreases the magical resistances of your spell targets by (%d+).", effect = "SPELLPEN" },
108  
109 -- Added for HealPoints
110 { pattern = "Allows (%d+)%% of your Mana regeneration to continue while casting%.", effect = "CASTINGREG"},
111 { pattern = "Improves your chance to get a critical strike with Nature spells by (%d+)%%%.", effect = "NATURECRIT"},
112 { pattern = "Reduces the casting time of your Regrowth spell by 0%.(%d+) sec%.", effect = "CASTINGREGROWTH"},
113 { pattern = "Reduces the casting time of your Holy Light spell by 0%.(%d+) sec%.", effect = "CASTINGHOLYLIGHT"},
114 { pattern = "Reduces the casting time of your Healing Touch spell by 0%.(%d+) sec%.", effect = "CASTINGHEALINGTOUCH"},
115 { pattern = "%-0%.(%d+) sec to the casting time of your Flash Heal spell%.", effect = "CASTINGFLASHHEAL"},
116 { pattern = "%-0%.(%d+) seconds on the casting time of your Chain Heal spell%.", effect = "CASTINGCHAINHEAL"},
117 { pattern = "Increases the duration of your Rejuvenation spell by (%d+) sec%.", effect = "DURATIONREJUV"},
118 { pattern = "Increases the duration of your Renew spell by (%d+) sec%.", effect = "DURATIONRENEW"},
119 { pattern = "Increases your normal health and mana regeneration by (%d+)%.", effect = "MANAREGNORMAL"},
120 { pattern = "Increases the amount healed by Chain Heal to targets beyond the first by (%d+)%%%.", effect = "IMPCHAINHEAL"},
121 { pattern = "Increases healing done by Rejuvenation by up to (%d+)%.", effect = "IMPREJUVENATION"},
122 { pattern = "Increases healing done by Lesser Healing Wave by up to (%d+)%.", effect = "IMPLESSERHEALINGWAVE"},
123 { pattern = "Increases healing done by Flash of Light by up to (%d+)%.", effect = "IMPFLASHOFLIGHT"},
124 { pattern = "After casting your Healing Wave or Lesser Healing Wave spell%, gives you a 25%% chance to gain Mana equal to (%d+)%% of the base cost of the spell%.", effect = "REFUNDHEALINGWAVE"},
125 { pattern = "Your Healing Wave will now jump to additional nearby targets%. Each jump reduces the effectiveness of the heal by (%d+)%%%, and the spell will jump to up to two additional targets%.", effect = "JUMPHEALINGWAVE"},
126 { pattern = "Reduces the mana cost of your Healing Touch%, Regrowth%, Rejuvenation and Tranquility spells by (%d+)%%%.", effect = "CHEAPERDRUID"},
127 { pattern = "On Healing Touch critical hits%, you regain (%d+)%% of the mana cost of the spell%.", effect = "REFUNDHTCRIT"},
128 { pattern = "Reduces the mana cost of your Renew spell by (%d+)%%%.", effect = "CHEAPERRENEW"},
129 };
130  
131 -- generic patterns have the form "+xx bonus" or "bonus +xx" with an optional % sign after the value.
132  
133 -- first the generic bonus string is looked up in the following table
134 PATTERNS_GENERIC_LOOKUP = {
135 ["All Stats"] = {"STR", "AGI", "STA", "INT", "SPI"},
136 ["Strength"] = "STR",
137 ["Agility"] = "AGI",
138 ["Stamina"] = "STA",
139 ["Intellect"] = "INT",
140 ["Spirit"] = "SPI",
141  
142 ["All Resistances"] = { "ARCANERES", "FIRERES", "FROSTRES", "NATURERES", "SHADOWRES"},
143  
144 ["Fishing"] = "FISHING",
145 ["Fishing Lure"] = "FISHING",
146 ["Increased Fishing"] = "FISHING",
147 ["Mining"] = "MINING",
148 ["Herbalism"] = "HERBALISM",
149 ["Skinning"] = "SKINNING",
150 ["Defense"] = "DEFENSE",
151 ["Increased Defense"] = "DEFENSE",
152  
153 ["Attack Power"] = "ATTACKPOWER",
154 ["Attack Power when fighting Undead"] = "ATTACKPOWERUNDEAD",
155 ["Attack Power in Cat, Bear, and Dire Bear forms only"] = "ATTACKPOWERFERAL",
156  
157 ["Dodge"] = "DODGE",
158 ["Block"] = "BLOCK",
159 ["Block Value"] = "BLOCKVALUE",
160 ["Hit"] = "TOHIT",
161 ["Spell Hit"] = "SPELLTOHIT",
162 ["Blocking"] = "BLOCK",
163 ["Ranged Attack Power"] = "RANGEDATTACKPOWER",
164 ["health every 5 sec"] = "HEALTHREG",
165 ["Healing Spells"] = "HEAL",
166 ["Increases Healing"] = "HEAL",
167 ["Healing and Spell Damage"] = {"HEAL", "DMG"},
168 ["Damage and Healing Spells"] = {"HEAL", "DMG"},
169 ["Spell Damage and Healing"] = {"HEAL", "DMG"},
170 ["mana every 5 sec"] = "MANAREG",
171 ["Mana Regen"] = "MANAREG",
172 ["Spell Damage"] = {"HEAL", "DMG"},
173 ["Critical"] = "CRIT",
174 ["Critical Hit"] = "CRIT",
175 ["Damage"] = "DMG",
176 ["Health"] = "HEALTH",
177 ["HP"] = "HEALTH",
178 ["Mana"] = "MANA",
179 ["Armor"] = "ARMOR",
180 ["Reinforced Armor"] = "ARMOR",
181 };
182  
183 -- next we try to match against one pattern of stage 1 and one pattern of stage 2 and concatenate the effect strings
184 PATTERNS_GENERIC_STAGE1 = {
185 { pattern = "Arcane", effect = "ARCANE" },
186 { pattern = "Fire", effect = "FIRE" },
187 { pattern = "Frost", effect = "FROST" },
188 { pattern = "Holy", effect = "HOLY" },
189 { pattern = "Shadow", effect = "SHADOW" },
190 { pattern = "Nature", effect = "NATURE" }
191 };
192  
193 PATTERNS_GENERIC_STAGE2 = {
194 { pattern = "Resist", effect = "RES" },
195 { pattern = "Damage", effect = "DMG" },
196 { pattern = "Effects", effect = "DMG" },
197 };
198  
199 -- finally if we got no match, we match against some special enchantment patterns.
200 PATTERNS_OTHER = {
201 { pattern = "Mana Regen (%d+) per 5 sec%.", effect = "MANAREG" },
202  
203 { pattern = "Minor Wizard Oil", effect = {"DMG", "HEAL"}, value = 8 },
204 { pattern = "Lesser Wizard Oil", effect = {"DMG", "HEAL"}, value = 16 },
205 { pattern = "Wizard Oil", effect = {"DMG", "HEAL"}, value = 24 },
206 { pattern = "Brilliant Wizard Oil", effect = {"DMG", "HEAL", "SPELLCRIT"}, value = {36, 36, 1} },
207  
208 { pattern = "Minor Mana Oil", effect = "MANAREG", value = 4 },
209 { pattern = "Lesser Mana Oil", effect = "MANAREG", value = 8 },
210 { pattern = "Brilliant Mana Oil", effect = { "MANAREG", "HEAL"}, value = {12, 25} },
211  
212 { pattern = "Eternium Line", effect = "FISHING", value = 5 },
213  
214 { pattern = "Healing %+31 and 5 mana per 5 sec%.", effect = { "MANAREG", "HEAL"}, value = {5, 31} },
215 { pattern = "Stamina %+16 and Armor %+100", effect = { "STA", "ARMOR"}, value = {16, 100} },
216 { pattern = "Attack Power %+26 and %+1%% Critical Strike", effect = { "ATTACKPOWER", "CRIT"}, value = {26, 1} },
217 { pattern = "Spell Damage %+15 and %+1%% Spell Critical Strike", effect = { "DMG", "HEAL", "SPELLCRIT"}, value = {15, 15, 1} },
218  
219 }
220 } end)