Log in

View Full Version : Help with custom spellcaster



Gluben
03-25-2016, 08:46 AM
If I want a spellcaster to when I have ANY TARGET not just for a specific monster, how do I change this lua script?

local config = {
['Yeti'] = {strikes = {"Kura Flur", "Kura Min Flur"}, hppc = {1, 1}, dist = 1}
}

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
sleep(math.random(400,650))
end

Gluben
03-25-2016, 08:50 AM
I have also tried Anoyn's Spellcaster and it didnt work, just gave me errors. I have asked for help in his thread but getting this one to work would be very much appreciated!

maroxy
03-25-2016, 01:00 PM
Edited

playkrzychu2
04-06-2016, 08:04 AM
nice man ty