11-03-2022, 12:53 PM
Hello.
This script will cast the specific spell according to the monster you are killing and its health. So you can setup multiple spells for same monster according its health.
Targeting can do the same and it's better because it has more conditions, but i decided to create this simple script to show you guys you can do the same using LUA Scripts.
Alternatively, if you don't care about creatures health then you can use the script below:
This script will cast the specific spell according to the monster you are killing and its health. So you can setup multiple spells for same monster according its health.
Targeting can do the same and it's better because it has more conditions, but i decided to create this simple script to show you guys you can do the same using LUA Scripts.
local MIN_HEALTH = 80 -- Min. health pc to cast spells. Only cast spells if your characters hp% is higher than this value.
local Monsters = {
{ Name = 'Orc Warrior', HpMin = 1, HpMax = 100, Spell = 'exori flam' }, -- Monster name, Hp min and max to cast spell and which spell.
{ Name = 'Orc', HpMin = 20, HpMax = 100, Spell = 'exori flam' }, -- On this case, it will only cast spells when orc has hp% between 20 and 100%.
}
local attacked_creature = attacked()
if attacked_creature.id > 0 and hppc() >= MIN_HEALTH and cancast() then
for _, monster in ipairs(Monsters) do
if monster.Name:lower() == attacked_creature.name:lower() and attacked_creature.hppc >= monster.HpMin and attacked_creature.hppc <= monster.HpMax then
cast(monster.Spell)
wait(1000, 1300)
break
end
end
end
Alternatively, if you don't care about creatures health then you can use the script below:
local MIN_HEALTH = 80 -- Min. health pc to cast spells. Only cast spells if your characters hp% is higher than this value.
local Monsters = {
{ Name = 'Orc Warrior', Spell = 'exori flam' }, -- Monster name and which spell to cast.
{ Name = 'Orc', Spell = 'exori flam' }, -- On this case, it will cast exori flam on a Orc.
}
local attacked_creature = attacked()
if attacked_creature.id > 0 and hppc() >= MIN_HEALTH and cancast() then
for _, monster in ipairs(Monsters) do
if monster.Name:lower() == attacked_creature.name:lower() then
cast(monster.Spell)
wait(1000, 1300)
break
end
end
end