Hey Phanx,
Thanks for the reply.
What I am trying to accomplish is to have two tables of relevant buffs and debuffs, and their respective modification to healing. An example would be:
Lua Code:
-- ["Spell ID"] = percent
local generalHealingIncreases = {
[47788] = 60, -- Guardian Spirit
[55233] = 25 -- Vampiric Blood; needs to be adjusted for glyph.
}
The way healing modifications are handled is multiplicative, from highest to lowest value. What I aim to do is sort the table from highest to lowest by hand, and by having my loop iterate over it in descending order, I can ensure the appropriate buff is calculated first.
That being said, I need to be able to modify the values through a look-up of the keys (to reflect glyphs); and the table would then need to be re-sorted to reflect the new values.
I am not sure that I like the idea of two tables. Is this a situation where metatables would be useful? I was poking around some Lua websites and there was a method utilizing metatables to emulate the next() function, but I wasn't too sure it was what I was looking for.
Thanks for your time and help (as usual
).