View Single Post
Old 06/20/07, 12:53 PM   #68
tedv
Bald Bull
 
tedv's Avatar
 
Orc Death Knight
 
Mal'Ganis
I looked at the code because I wanted to add support for Judgment of Wisdom. It seems pretty straightforward, but I think I detected a bug in the support for demo shout/roar/weakness. I'm at work now so I can't test this but... Here's the array setup:

local optDebuffs = {
	[BS["Faerie Fire"]] = BS["Faerie Fire (Feral)"],
	[BS["Demoralizing Shout"]] = BS["Curse of Weakness"],
	[BS["Demoralizing Shout"]] = BS["Demoralizing Roar"],
}
This essentially tries to setup an array with two entries for the same key (but different values). I'm not sure what lua will do in this case-- if it takes the first or the last entry-- but you definitely won't get two entries. Otherwise this block of code wouldn't work:

optdebuff = optDebuffs[debuff]
self:UpdateDebuff("target", debuff, optdebuff)
self:UpdateDebuff("focus", debuff, optdebuff)
The function takes in a single argument, so the array access must only have one value as well, so it can't be both curse of weakness and demoralizing roar.

If the code needs to handle multiple level of optional debuffs, the easiest way to structure it would be replacing each debuff with a list, and then you write code to successively check each list entry. For example, your debuff lists might be...

(Curse of Elements)
(Curse of Shadows)
(Thunder Clap)
(Sunder Armor)
(Demoralizing Shout, Curse of Weakness, Demoralizing Roar)
(Faerie Fire, Faerie Fire (Feral))
...
Most entries would be coded as a list with just one item in them.

At any rate, thanks for the mod. It's extremely useful.
 
User is offline.
Reply With Quote