Attacks monsters with areas, waves, beams or support spells.
Configuration
Add monsters names on the Monsters variable to consider those monsters on the spells areas, an empty list will use on any monster.
Set Players.Consider to true if you are playing on PvP worlds, this option will avoid using spells when there are players near, set false to ignore this option.
If you have set Players.Consider to true, edit the minimum distance to consider them by changing the Distance parameter. To consider floors up and down use the FloorDifference parameter. Optionally you can add friends on the SafeList so the attacker will ignore them.
For each spell entry you can input the Name. Set Amount if you want to cast on a specific amount of creatures around the spell or Hppc, if you want to shoot on a specific target until it have less than the health percent previously set.
For the SpecialAreas you can input areas where you don't want to cast spell, such as near stairs, holes. The default entry is x-axis¹, x-axis², y-axis¹, y-axis² and z-axis.
If you want to use this script only when Targeting engine is enabled then set UseTargetState to true, if you want to use it all the time set it to false.
if $posz ~= LastFloor then
LastFloor, Exhaust = $posz, $timems + 2000
return
end
if $timems >= Exhaust and ($targeting or not UseTargetState) then
for _, Spell in ipairs(Spells) do
if cancast(Spell.Info) and not isinsidearea(SpecialAreas) then
if Spell.Amount and (not Players.Consider or paroundfloorignore(Players.Distance, Players.FloorDifference, unpack(Players.SafeList)) == 0) then
local BestAmount, BestDir = 0, $self.dir
if Spell.NeedDirection then
for Dir, Amount in pairs({n = 0, e = 0, s = 0, w = 0}) do
Amount = maroundspell(Spell.Name, Dir, unpack(Spell.Monsters))
if Amount > BestAmount or (Amount >= BestAmount and Dir == $self.dir) then
BestAmount, BestDir = Amount, Dir
end
end
else
BestAmount = not Spell.AttackSupport and maroundspell(Spell.Name, BestDir, unpack(Spell.Monsters)) or maround(1, false, unpack(Spell.Monsters))
end
if BestAmount >= math.max(Spell.Amount, 1) then
while $self.dir ~= BestDir do
turn(BestDir) waitping()
end
cast(Spell.Name) waitping()
end
elseif Spell.Hppc and $attacked.hppc >= math.max(Spell.Hppc, 1) and table.find(Spell.Monsters, $attacked.name:lower()) and cancast(Spell.Info, $attacked) then
cast(Spell.Name) waitping()
end
end
end
end
That's for sure something i'm gonna use ALOT in my scripts. I love doing hardcore mage scripts with Several attacks.
12-13-2013, 08:09 AM
Dworak
Its works Great, but would be good if you can setup Exori Ico/Hur when how many monsters cuz i setup HPPC to 100% and its not attacking with this spell idk why ;>, and if i will make in Targeting to shoot exori ico and hur then it spam it instead exori etc
Also he is not shooting Utito Tempo i setup it for One and it don't shoot it
12-13-2013, 11:27 AM
Leonardo
Quote:
Originally Posted by Dworak
Its works Great, but would be good if you can setup Exori Ico/Hur when how many monsters cuz i setup HPPC to 100% and its not attacking with this spell idk why ;>, and if i will make in Targeting to shoot exori ico and hur then it spam it instead exori etc
Also he is not shooting Utito Tempo i setup it for One and it don't shoot it
Hmm, I'll check this thanks. You are using wrong, it'll cast spells on Hppc mode if monsters have more than X health, no monster have 101% of health. The default 10 will attack monster from 100 to 10 percent with exori ico for example.
12-13-2013, 11:42 AM
Dworak
it wasn't working anyway and if i want shoot exori ico/hur i can' because it will spell even if there is 1 monster
Regards and thanks ;)
12-13-2013, 12:15 PM
rtr0x
thank you! :cool:
12-13-2013, 06:36 PM
Leonardo
Fixed bugs with Hppc settings and utito tempo, now you can add a third parameter Monsters inside each spell entry, for example:
Will set this spell to attack this list of monsters instead of the primary list. Very usefull if you want to attack different monsters with different spells.
12-13-2013, 08:10 PM
Dworak
okey Thanks a lot !
12-20-2013, 12:10 AM
joraanpe
Hey mate, how can we set this up to work withh spells on certain amount of monsters but in a higher amount use area rune?
12-20-2013, 01:05 AM
L!p3
Quote:
Originally Posted by Leonardo
Fixed bugs with Hppc settings and utito tempo, now you can add a third parameter Monsters inside each spell entry, for example:
Will set this spell to attack this list of monsters instead of the primary list. Very usefull if you want to attack different monsters with different spells.
Mate, it's not working when you specify the list of monsters. It simply stop casting the spell on any monster.
12-20-2013, 01:34 AM
Leonardo
Quote:
Originally Posted by L!p3
Mate, it's not working when you specify the list of monsters. It simply stop casting the spell on any monster.
Will check this whenever is possible.
Quote:
Originally Posted by joraanpe
Hey mate, how can we set this up to work withh spells on certain amount of monsters but in a higher amount use area rune?
Actually it's not possible for runes, only spells.
This will atuomatically set option to true if you are in a pvp world.
Yes i know i could do that, but the problem is that on some pvp worlds people won the servers and they can hunt with Exori even if player is on screen with Green mode and not skulleds, its why i want to TRUE/FALSE that, its possible to do it in any way which i show ?
12-24-2013, 08:45 AM
User Not Found
Quote:
Originally Posted by Dworak
Yes i know i could do that, but the problem is that on some pvp worlds people won the servers and they can hunt with Exori even if player is on screen with Green mode and not skulleds, its why i want to TRUE/FALSE that, its possible to do it in any way which i show ?
while #Config.Spells >= i do
local info = spellinfo(Config.Spells[i].Name)
Config.Spells[i].Area = AreaConv[info.castarea] or info.castarea:lower()
Config.Spells[i].Attack = info.castmode:match("Target") ~= nil
if #info.words == 0 then
table.remove(Config.Spells, i)
else
if #Config.Spells[i].Area > 0 and table.find({"smallwave", "bigwave", "smallbeam", "bigbeam", "front"}, Config.Spells[i].Area) then
Config.Spells[i].NeedDirection = true
else
Config.Spells[i].NeedDirection = false
end
i = i + 1
end
end
function cancast(spell)
local info = spellinfo(spell)
if info.specialeffect:match("Strength") then
return not $strenghtened and cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
end
return cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
end
function findcreature(c)
local c = type(c) == 'userdata' and getcreaturebyid(c.id) or getcreaturebyname(c)
return c
end
init end
auto(200, 400)
if $posz ~= LastFloor then
LastFloor, Exhaust = $posz, $timems + 2000
return
end
if $timems > Exhaust then
for _, Spell in ipairs(Config.Spells) do
if cancast(Spell.Name) then
if Spell.Amount and (not Config.Players.Consider or paroundfloorignore(Config.Players.Distance, Config.Players.FloorDifference, unpack(Config.Players.SafeList)) == 0) then
local BestAmount, BestDir = 0, $self.dir
if Spell.NeedDirection then
for Dir, Amount in pairs({["n"] = 0, ["e"] = 0, ["s"] = 0, ["w"] = 0}) do
Amount = maroundspell(Spell.Area, Dir, unpack(Spell.Monsters or Config.Monsters))
if Amount > BestAmount or (Amount >= BestAmount and Dir == $self.dir) then
BestAmount, BestDir = Amount, Dir
end
end
else
BestAmount = Spell.Attack and maroundspell(Spell.Area, BestDir, unpack(Spell.Monsters or Config.Monsters)) or maround(1, unpack(Spell.Monsters or Config.Monsters))
end
if BestAmount >= Spell.Amount then
while $self.dir ~= BestDir do
turn(BestDir)
waitping()
end
cast(Spell.Name) waitping()
end
elseif Spell.Hppc and $attacked.dist <= (tonumber(Spell.Area) or -2) and table.find(Spell.Monsters or Config.Monsters, $attacked.name:lower()) and Spell.Hppc <= $attacked.hppc and $attacked.isshootable then
cast(Spell.Name)
waitping()
end
end
end
end
else
init start
local Config = {
Monsters = {"Tarantula", "Giant Spider", "Mutated Bat"},
while #Config.Spells >= i do
local info = spellinfo(Config.Spells[i].Name)
Config.Spells[i].Area = AreaConv[info.castarea] or info.castarea:lower()
Config.Spells[i].Attack = info.castmode:match("Target") ~= nil
if #info.words == 0 then
table.remove(Config.Spells, i)
else
if #Config.Spells[i].Area > 0 and table.find({"smallwave", "bigwave", "smallbeam", "bigbeam", "front"}, Config.Spells[i].Area) then
Config.Spells[i].NeedDirection = true
else
Config.Spells[i].NeedDirection = false
end
i = i + 1
end
end
function cancast(spell)
local info = spellinfo(spell)
if info.specialeffect:match("Strength") then
return not $strenghtened and cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
end
return cooldown(info.words) == 0 and $mp >= info.mp and $level >= info.level and $soul >= info.soul and $mlevel >= info.mlevel
end
function findcreature(c)
local c = type(c) == 'userdata' and getcreaturebyid(c.id) or getcreaturebyname(c)
return c
end
init end
auto(200, 400)
if $posz ~= LastFloor then
LastFloor, Exhaust = $posz, $timems + 2000
return
end
if $timems > Exhaust then
for _, Spell in ipairs(Config.Spells) do
if cancast(Spell.Name) then
if Spell.Amount and (not Config.Players.Consider or paroundfloorignore(Config.Players.Distance, Config.Players.FloorDifference, unpack(Config.Players.SafeList)) == 0) then
local BestAmount, BestDir = 0, $self.dir
if Spell.NeedDirection then
for Dir, Amount in pairs({["n"] = 0, ["e"] = 0, ["s"] = 0, ["w"] = 0}) do
Amount = maroundspell(Spell.Area, Dir, unpack(Spell.Monsters or Config.Monsters))
if Amount > BestAmount or (Amount >= BestAmount and Dir == $self.dir) then
BestAmount, BestDir = Amount, Dir
end
end
else
BestAmount = Spell.Attack and maroundspell(Spell.Area, BestDir, unpack(Spell.Monsters or Config.Monsters)) or maround(1, unpack(Spell.Monsters or Config.Monsters))
end
if BestAmount >= Spell.Amount then
while $self.dir ~= BestDir do
turn(BestDir)
waitping()
end
cast(Spell.Name) waitping()
end
elseif Spell.Hppc and $attacked.dist <= (tonumber(Spell.Area) or -2) and table.find(Spell.Monsters or Config.Monsters, $attacked.name:lower()) and Spell.Hppc <= $attacked.hppc and $attacked.isshootable then
cast(Spell.Name)
waitping()
end
end
end
end
end
but its showing error
error in Persistent script NewPersistentScript:
["end"]:NewPersistentScript:96: '<eof>' expected near 'end'
is way to fix that ?
12-24-2013, 12:29 PM
Leonardo
Quote:
Originally Posted by Dworak
i was trying with that
-- code
but its showing error
error in Persistent script NewPersistentScript:
["end"]:NewPersistentScript:96: '<eof>' expected near 'end'
is way to fix that ?
Just add a line on the script like UNF said. (Line 61)
-- script removed due to new version
12-24-2013, 12:40 PM
Dworak
Great One !!
Thanks for you , Pro !
12-24-2013, 01:09 PM
mistgun
just try
local pvpworld = getuseroption('pvpworld')
consider = pvpworld
12-24-2013, 02:37 PM
supreme killer
good work but it doesnt rlly work good
12-24-2013, 02:46 PM
mistgun
Quote:
Originally Posted by supreme killer
good work but it doesnt rlly work good
Huh what do you mean? :P
12-24-2013, 05:17 PM
Leonardo
There are some stuff that needs to be fixed, will come after the holidays.
01-05-2014, 07:41 PM
Leonardo
Script updated.
Fixed the problem with secondary monster list.
Improved the exhaust for each spell.
Added special areas, it'll avoid casting if you are inside a special area, just add the positions to the SpecialAreas section or let it empty if you don't want to use this feature.
I didn't added compat with runes because there is more stuff like shooting at target/self/crosshair and it would make the code a little harder to configure, so I'll just do another script for that.
01-05-2014, 07:59 PM
mistgun
Thank you for listening my request for special areas :D Its great !
while Spells[i] do
local info = spellinfo(Spells[i].Name)
if #info.words == 0 then
table.remove(Spells, i)
else
Spells[i].NeedDirection = table.find({"WaveSmall", "WaveVerySmall", "WaveBig", "BeamSmall", "BeamBig", "Front", "Strike"}, info.castarea) ~= nil
Spells[i].Monsters = Spells[i].Monsters or Monsters
table.lower(Spells[i].Monsters)
Spells[i].Duration = (SpellDurations[info.name:lower()] or 1) * 1000
Spells[i].Exhaust = $timems
Spells[i].Attack = info.castmode:match("Target") ~= nil
Spells[i].object = info
i = i + 1
end
end
init end
auto(200, 400)
if $posz ~= LastFloor then
LastFloor, Exhaust = $posz, $timems + 2000
return
else
for _, area in ipairs(SpecialAreas) do
local a,b,c,d,e = unpack(area)
if $posx <= b and $posx >= a and $posy <= d and $posy >= c and $posz == e then
return
end
end
end
if $timems >= Exhaust then
for i, Spell in ipairs(Spells) do
if $timems >= Spell.Exhaust and cancastspell(Spell.object) then
if Spell.Amount and (not Players.Consider or paroundfloorignore(Players.Distance, Players.FloorDifference, unpack(Players.SafeList)) == 0) then
local BestAmount, BestDir = 0, $self.dir
if Spell.NeedDirection then
for Dir, Amount in pairs({n = 0, e = 0, s = 0, w = 0}) do
Amount = maroundspell(Spell.Name, Dir, unpack(Spell.Monsters))
if Amount > BestAmount or (Amount >= BestAmount and Dir == $self.dir) then
BestAmount, BestDir = Amount, Dir
end
end
else
BestAmount = Spell.Attack and maroundspell(Spell.Name, BestDir, unpack(Spell.Monsters)) or maround(1, false, unpack(Spell.Monsters))
end
if BestAmount >= Spell.Amount then
while $self.dir ~= BestDir do
turn(BestDir)
waitping()
end
cast(Spell.Name) waitping()
Spell.Exhaust = $timems + Spell.Duration
end
elseif Spell.Hppc and $attacked.hppc >= Spell.Hppc and table.find(Spell.Monsters, $attacked.name:lower()) and $attacked.isshootable and cancastspell(Spell.object, $attacked) then
cast(Spell.Name) waitping()
Spell.Exhaust = $timems + Spell.Duration
end
end
end
end
sorry but maybe i am noob with hotkeys :D
01-06-2014, 01:18 PM
Leonardo
Quote:
Originally Posted by Dworak
so it should looks like that ?
sorry but maybe i am noob with hotkeys :D
No, and please don't copy the whole code. I'll post only the stuff you need to change.
init start
local Monsters = {"Nightmare", "Nightmare Scion"}
Ye, but if you are going to put the same monsters for 2-3 spells, it's easier to put them on the main list and change only a few spells to other monsters.
01-06-2014, 03:14 PM
Dworak
ye but it was only the Showcase, to show if its ok, ofc i will put other monsters for spell :P
can you tell me why he shoot exori,exori gran,utito tempo even if he see [ 21:41 You see a swarmer. ] and this monster isn't on the list?
Regards
01-06-2014, 09:09 PM
Leonardo
It could be a problem with maround, actually utito is not an attack spell, so I did a workaround to support spells like it. But the others shouldn't be casted randomly as you said, I'm not sure what it's but I'll look forward on it for the new versions.
01-06-2014, 09:59 PM
Dworak
not really, it was shooting exori, exori gran with monsters around even if they wasn't on the list it was checking only the amount ;>
Thanks for checking that