Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - Advanced Shooter for Mages
- -- Version 1.0.1 - By Heronas
- -- Credits for playercheck go to Leonardo
- init start
- -- Set monsters to consider when using spells/area runes
- local creatureNames = Monsters
- local FlamMonsters = {"Hydra","Earth Elemental","Slime"}
- local VisMonsters = {"Hydra","Slime"}
- local SdMonsters = {"Hydra"}
- local gfbMonsters = {"Hydra","Earth Elemental","Slime"}
- function has_value (tab, val)
- for index, value in ipairs (tab) do
- if value == val then
- return true
- end
- end
- return false
- end
- -- Spells such as beams/waves/UEs and even knight/paladin spells can be set here
- -- Example: {name = "exevo vis hur", amount = 3, monsters = {'Hydra'}},
- -- name = spell name or words, amount = monster amount, monsters = monsters to consider
- local spells = {
- {name = "exevo gran mas flam", amount = 4, monsters = FlamMonsters},
- {name = "exevo gran mas vis", amount = 3, monsters = VisMonsters},
- }
- -- Area runes such as thunderstorms can be set here
- -- Example: {name = "thunderstorm rune", amount = 3, monsters = {'Crystal Spider'}},
- -- name = rune name, amount = monster amount, monsters = monsters to consider
- local areaRunes = {
- {name = "great fireball rune", amount = 2, monsters = gfbMonsters},
- }
- -- Target runes such as SDs can be set here, for now only supports 1 targetrune
- -- Example: {name = "sudden death rune", amount = 3, monsters = {'Demon'}},
- -- name = rune name, amount = monster amount, monsters = monsters to consider
- local targetRunes = {
- {name = "sudden death rune", amount = 1, monsters = SdMonsters},
- }
- -- Check for players, taken from Leonardo's scripts
- local players = {
- consider = getuseroption("pvp"),
- distance = 8,
- safeList = {"Bubble", "Eternal Oblivion"},
- floorDifference = 1
- }
- -- Set to true to use strong strikes
- local strongStrike = true
- local maxStrike = true
- -- DON'T EDIT BELOW THIS LINE IF YOU DON'T KNOW WHAT YOU'RE DOING --
- --------------------------------------------------------------------
- -- Directions to check
- local shootDir = {'n', 'w', 's', 'e'}
- -- Initial values for loop iteration
- local quitLoop = 0
- local exhaustTime = 0
- local countTries = 0
- local areaCountLow = 10
- local spellCountLow = 10
- for i,j in pairs(spells) do
- if spellCountLow > spells[i].amount then
- spellCountLow = spells[i].amount
- end
- spells[i].monsters = spells[i].monsters or creatureNames
- end
- for i,j in pairs(areaRunes) do
- if areaCountLow > areaRunes[i].amount then
- areaCountLow = areaRunes[i].amount
- end
- areaRunes[i].monsters = areaRunes[i].monsters or creatureNames
- end
- for i,j in pairs(targetRunes) do
- targetRunes[i].monsters = targetRunes[i].monsters or creatureNames
- end
- -- Prints
- init end
- auto(50, 100)
- quitLoop = 0
- -- Reset exhaust time if a new projectile is fired from your position to your target's position
- if $lastprojectile.tox == $attacked.posx and $lastprojectile.toy == $attacked.posy and $lastprojectile.fromx == $posx and $lastprojectile.fromy == $posy then
- exhaustTime = $timems
- end
- if $timems >= exhaustTime then
- if not players.consider or paroundfloorignore(players.distance, players.floorDifference, unpack(players.safeList)) == 0 then
- -- Spells
- if maround(8) >= spellCountLow and spells[1] ~= nil and getsetting('Targeting/Creatures/Hydra/Setting1/OnlyIfTrapped') == "no" then
- for i=1,table.getn(spells) do
- if cancast(spells[i].name) then
- for j,_ in pairs(shootDir) do
- if maroundspell(spells[i].name, shootDir[j], unpack(spells[i].monsters)) >= spells[i].amount then
- cast(spells[i].name)
- quitLoop = 1
- end
- end
- end
- end
- end
- -- Area Runes
- if maround(8) >= areaCountLow and areaRunes[1] ~= nil and quitLoop ~= 1 then
- for i=1,table.getn(areaRunes) do
- runeArea = getarearunetile(false, unpack(areaRunes[i].monsters))
- if $mppc > 30 and runeArea.amount >= areaRunes[i].amount and itemcount(areaRunes[i].name) ~= 0 then
- countTries = 0
- pausewalking(400)
- shootarearune(areaRunes[i].name, 2, true)
- wait(500)
- countTries = 1
- if $lastprojectile.time <= exhaustTime then
- countTries = 2
- end
- quitLoop = 1
- end
- end
- end
- end
- -- Targetrunes and strikes
- if $attacked.id ~=0 and quitLoop == 0 then
- if maround(7, unpack(targetRunes[1].monsters)) >= targetRunes[1].amount and maround(7,unpack(creatureNames)) == 1 then
- useoncreature(targetRunes[1].name, $target)
- elseif (cancast("Exori max vis") and has_value(VisMonsters,$attacked.name) or has_value(FlamMonsters,$attacked.name) and cancast("Exori max flam")) and maxStrike and $attacked.dist <= 3 and math.ceil(creatureinfo($attacked.name).hp * math.min($attacked.hppc + 0.5, 100) / 100) > spellinfo("exori gran vis").mindmg then
- if maround(7, unpack(creatureNames)) == 1 and cancast("Exori max vis") and has_value(VisMonsters,$attacked.name) then
- cast("exori max vis")
- elseif maround(7, unpack(creatureNames)) == 1 and cancast("Exori max flam") and has_value(FlamMonsters,$attacked.name) then
- cast("exori max flam")
- end
- elseif (cancast("Exori gran vis") or cancast("Exori gran flam")) and strongStrike and $attacked.dist <= 3 then
- if maround(7, unpack(creatureNames)) == 1 and cancast("exori gran vis") and has_value(VisMonsters,$attacked.name) then
- cast("exori gran vis")
- elseif maround(7, unpack(creatureNames)) == 1 and cancast("exori gran flam") and has_value(FlamMonsters,$attacked.name) then
- cast("exori gran flam")
- end
- elseif $attacked.dist <= 3 then
- caststrike(0)
- end
- end
- -- Add exhaust time, takes into account if you missfire an area rune
- exhaustTime = $timems + 1000 - countTries*500
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement