Code:
local config = {
['Frost Dragon'] = {strikes = {"exori max vis", "exori gran vis", "exori vis"}, hppc = {10, 2}, dist = 3}
}
while (true) do
local targ = Creature.GetByID(Self.TargetID())
for name, var in pairs(config) do
if targ:Name() == name and targ:isAlive() and targ:DistanceFromSelf() <= var.dist then
for i=1, #var.strikes do
if (Self.CanCastSpell(var.strikes[i]) and targ:HealthPercent() >= var.hppc[1]) then
Self.Say(var.strikes[i])
elseif (targ:HealthPercent() >= var.hppc[2] and targ:HealthPercent() <= var.hppc[1] and Self.CanCastSpell(var.strikes[#var.strikes])) then
Self.Say(var.strikes[#var.strikes])
end
end
end
end
end