local PvPSafe = false
local Attacks = {}
--[[
Options:
words - words of spell to cast
creatures - table of creatures to consider, if you disclude this it will consider all
count - amount of creatures in order to cast
range - distance from self to consider creatures
padding - for pvpsafe, if enabled each spell must have a padding setting, distance from self players must be in order to cast
needTarget - for spells that require a target, no need for a count or padding if this is enabled
]]--
Attacks[1] = { words = 'exori min', creatures = {'Swarmer','Insectoid Worker','Waspoid','Spitter','Spidris','Kollos','Cr awler'}, count = 8, range = 1 }
Attacks[2] = { words = 'exori gran', creatures = {'Swarmer','Insectoid Worker','Waspoid','Spitter','Spidris','Kollos','Cr awler'}, count = 5, range = 1 }
Attacks[3] = { words = 'exori', creatures = {'Swarmer','Insectoid Worker','Waspoid','Spitter','Spidris','Kollos','Cr awler','Lesser Swarmer'}, count = 3, range = 1 }
Attacks[4] = { words = 'exori hur', creatures = {'Swarmer','Insectoid Worker','Waspoid','Spitter','Spidris','Kollos','Cr awler'}, count = 1, range = 5, needTarget = 1 }
Attacks[5] = { words = 'exori ico', creatures = {'Swarmer','Insectoid Worker','Waspoid','Spitter','Spidris','Kollos','Cr awler'}, count = 1, range = 1, needTarget = 1 }
Module.New('auto_attack', function()
for _, data in ipairs(Attacks) do
if (not PvPSafe) or (Self.isAreaPvPSafe(data.padding, true)) then
if data.needTarget then
local target = Creature.New(Self.TargetID())
if (data.creatures and table.find(data.creatures, target:Name(), false)) or (not data.creatures) then
if targetistanceFromSelf() <= data.range and Self.CanCastSpell(data.words) then
Self.Cast(data.words)
end
end
else
local count, mob = 0, Self.GetTargets(data.range)
if data.creatures then
for i = 1, #mob do
if mob[i]:isOnScreen() and table.find(data.creatures, mob[i]:Name(), false) then
count = count + 1
end
end
else
count = #mob
end
if count >= data.count and Self.CanCastSpell(data.words) then
Self.Cast(data.words)
end
end
end
end
end)
Zakładki