biaggio12
09-10-2012, 04:32 PM
its really annyoing that i can use only exori ico not both ico and hur : < please add it : <
Spell 1
Spell 2
etc.
Bushu
09-10-2012, 06:18 PM
its really annyoing that i can use only exori ico not both ico and hur : < please add it : <
Spell 1
Spell 2
etc.
Use Syntax's combat helper.
function combatHelper(pos, radius, creatureName, amountofCreature)
local n = 0
local noPlayer = true
local pos = Self.Position()
for i = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(i)
local name = creature:Name()
if (checkPlayer and creature:isPlayer() and (getDistanceBetween(creature:Position(), pos) <= radius)) then
noPlayer = false
break
elseif (creature:isValid()) and creature:ID() ~= Self.ID() then
for j = 1, table.getn(creatureName) do
if (name == creatureName[j]) then
if (creature:isOnScreen() and creature:isVisible() and creature:isAlive()) then
if(getDistanceBetween(creature:Position(), pos) <= radius)then
n = n + 1
end
end
end
end
end
end
if (n >= 1) and (pos.y >= 31258) then
setTargetingEnabled(true)
elseif (n == 0) then
setTargetingEnabled(false)
elseif (n >= 1) and (pos.y <= 31258) then
setTargetingEnabled(false)
end
end
function SpellCast(spell)
local Monster1 = "Crystal Spider"
local Monster2 = "Ice Golem"
local TargetID = Self.TargetID()
local Target = Creature.GetByID(TargetID)
local pos = Self.Position()
if (Self.CanCastSpell(spell)) and (Target:Name() == Monster1) and (getDistanceBetween(Target:Position(), pos) <= 3) then
Self.Say(spell)
elseif (Self.CanCastSpell(spell)) and (Target:Name() == Monster2) and (getDistanceBetween(Target:Position(), pos) <= 3) then
Self.Say(spell)
elseif (not Self.MeetsSpellRequirements(spell)) then
print("%s can not be cast. You either lack the mana or required level!", spell)
end
end
function SpellCastDlsMax(spell)
local Monster1 = "Dragon Lord"
local TargetID = Self.TargetID()
local Target = Creature.GetByID(TargetID)
local pos = Self.Position()
if (Self.CanCastSpell(spell)) and (Target:Name() == Monster1) and (Target:HealthPercent() <= 35) and (Target:HealthPercent() >= 20) and (getDistanceBetween(Target:Position(), pos) <= 3) then
Self.Say(spell)
elseif (not Self.MeetsSpellRequirements(spell)) then
print("%s can not be cast. You either lack the mana or required level!", spell)
end
end
while (true) do
SpellCast("exori amp vis")
SpellCast("exori vis")
end
Crown Royal
09-10-2012, 06:18 PM
Try this..
dofile("SyntaxLuaLib.lua")
local config = {
attacks = {
--[[
spells should be prioritized from top to bottom, eg: exori gran will be attempted before exori or exori mas.
players:
true = the area will include players in the threshold
false = the area will only count the monsters in the area
aggressive:
0 = attack triggers when no players are in the area.
1 = attack triggers when only war enemies and skulled players, noone else.
2 = attack triggers when innocents are in the area but not when friendlies are.
3 = attack triggers when friendlies are in the area but not when innocents are.
4 = attack triggers without any regards to players in the area.
threshold:
amount of monsters to consider withing 'radius' before spell tries.
]]
--{words="exori gran", threshold=5, mana=150, radius=1, aggressive=4, players=false},
{words="exori hur", threshold=2, mana=40, radius=3, aggressive=4, players=false},
{words="exori ico", threshold=2, mana=40, radius=1, aggressive=4, players=false}
}
}
local function think()
for _, info in ipairs(config.attacks)do
local amount = areaTargetAmount(info.radius, info.aggressive, info.players)
if(amount)then
if(amount >= info.threshold)then
cast(info.words, info.mana)
end
end
end
end
while (true) do
think()
wait(500)
end
OR this.
local spells = {-- {"spell", mana, range}
{"exori ico", 40, 1},
{"exori hur", 40, 5},
}
local monsters = {--{"Name", {hpFrom, hpTo}, count}
{"Bog Raider", {15, 100}, 1}, -- THIS IS WHAT YOU WANT. WONT ATTACK FROM 'X' AMOUNT OF HP, IN THIS CASE, 15%
}
-- Do not change below --
dofile("Forgee.lua")
local names = {}
for i = 1, #monsters do
table.insert(names, monsters[i][1])
end
function spellAttack()
local target = Creature.GetByID(Self.TargetID())
for i = 1, #monsters do
if target:Name() == monsters[i][1] then
while target:isAlive() do
if target:HealthPercent() >= monsters[i][2][1] and target:HealthPercent() <= monsters[i][2][2] and (monstersAround(7, monsters[i][1]) >= monsters[i][3]) then
for s = 1, #spells do
if Self.CanCastSpell(spells[s][1]) then
Self.Cast(spells[s][1], spells[s][2])
wait(1200, 1300)
end
end
end
end
break
end
end
end
while true do
spellAttack()
wait(400, 500)
end
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.