As you can see, Effect.Type 19 and 20 only exist because 12 and 14 ignore this flag in the game.
I've implemented this logic as a pair of functions. The first mutates the effect with the correct flags value when first processing the spell effect info, and second returns a new effect with the correct effect.type and effect.points values whenever it is cast:
{
[2^0]={ -- USE_ATTACK_FOR_POINTS
info=function (spell,effect)
if effect.type == 12 or effect.type == 14 then
effect.flags = bit.band(effect.flags,bit.bnot(2^0)) -- Flag is never used
if effect.flags = 0 then effect.flags = nil end
end
end,
cast=function (spell,effect,source,target)
e = {}
for k, v in pairs(effect)
e[k] = v
end
if e.type == 1 or e.type == 2 or e.type == 5 or e.type == 11 or e.type == 13 e.type == 6 or e.type == 15 then
e.points = source.attack -- Points is the source's attack
else
e.points = e.points*source.attack -- Points is modified by the source's attack
end
return e
end,
},
-- ...
}
Effect.Types and Effect.Flags can change the behaviour of Effect.Points as described below.
When Effect.Flags doesn't have
2^0 -- USE_ATTACK_FOR_POINTS
:When Effect.Flags has
2^0 -- USE_ATTACK_FOR_POINTS
:As you can see, Effect.Type 19 and 20 only exist because 12 and 14 ignore this flag in the game.
I've implemented this logic as a pair of functions. The first mutates the effect with the correct flags value when first processing the spell effect info, and second returns a new effect with the correct effect.type and effect.points values whenever it is cast: