07-04-2019, 01:17 PM
Hello.
This script will cast 'Utevo Lux' and wait 370 seconds to cast again, because it lasts for 370 seconds. So your character will not waste mana and will have a light.
Also will cast if your MANA % is 99% or higher.
You can change to 'Utevo Gran Lux', but it will last for more time and i don't know it's exactly duration.
This script will cast 'Utevo Lux' and wait 370 seconds to cast again, because it lasts for 370 seconds. So your character will not waste mana and will have a light.
Also will cast if your MANA % is 99% or higher.
You can change to 'Utevo Gran Lux', but it will last for more time and i don't know it's exactly duration.
local CONFIG =
{
Spell = 'Utevo Lux', -- Spell
Duration = { Min = 350, Max = 370 }, -- Spell duration in SECONDS. Light lasts 370 / Great Light lasts 695.
MinMp = 20, -- Min. mp EXACTY value to cast. If lower, don't cast.
MaxMp = 99, -- If Mp% higher or equal, it will cast (avoiding full mana).
}
RANDOM_DURATION = RANDOM_DURATION or 0
LAST_CAST = LAST_CAST or 0
local CastSpell = false
if mp() >= CONFIG.MinMp then
if LAST_CAST > 0 and RANDOM_DURATION > 0 then
if runningtime() >= (LAST_CAST + RANDOM_DURATION) then
CastSpell = true
elseif mppc() >= CONFIG.MaxMp then
CastSpell = true
end
else
CastSpell = true
end
if CastSpell and cancast() then
cast(CONFIG.Spell)
LAST_CAST = runningtime()
RANDOM_DURATION = random(CONFIG.Duration.Min, CONFIG.Duration.Max)
wait(800)
end
end