PDA

View Full Version : shot sd on .lua



pain0816
08-11-2012, 05:16 PM
Hello ! i was looking on forum .lua what will shot multiple spells on target and all is ok. but also i wanted to shot sd's when there is 3 or more creatures on screen. i did something like this \/ and added shoting sd's on normal targeting but this is lagging mine char and he shot once vis once gran vis once sd's. how to insert sd's shoting on this .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.
]]
{words="exori gran vis", threshold=1, mana=40, radius=3, aggressive=4, players=false},
{words="exori vis", threshold=1, mana=40, radius=3, aggressive=4, players=false}
}
}

local function think()
local Monster = "Frost Dragon"
local TargetID = Self.TargetID()
local Target = Creature.GetByID(TargetID)
for _, info in ipairs(config.attacks)do
local amount = getTargetsInArea(Self.Position(), info.radius, info.aggressive, info.players)
if(amount)then
if(amount >= info.threshold) and (Target:Name() == Monster) then
Self.Cast(info.words, info.mana)
end
end
end
end

pain0816
08-11-2012, 07:26 PM
im not good at .luas :D could u mix it with this one ?

pain0816
08-12-2012, 01:32 PM
bump^^

pain0816
08-17-2012, 07:47 PM
bump :( guys i need lua what shot on one frost exori vis and 2+ sd. is it possible? what comman use? how to set number of creeps plx help :)

Infernal Bolt
08-17-2012, 08:09 PM
Modify this script and it should work just fine.
http://pastebin.com/6UDJXMWG

pain0816
08-17-2012, 09:11 PM
thanks man ;0 ill check it

pain0816
08-17-2012, 09:30 PM
So i modifty this a bit but now it shot sd on myself and if theres a monster what i dont target this shot vis in front :( whats wrong ?
rest is not midified so i paste this part


local config = {
delay = 500, -- delay time in between checks [default = 500ms]
attacks = {
['exori gran vis'] = {
min = 1,
max = 2, -- spell won't cast if more creatures are in the spellRadius than this (does not have to exist)
needTarget = true, -- for spells that require you to have a target (does not target for you)
spellRadius = 1,
checkRadius = 2,
countPlayers = false,
attackMode = 'none'
},
['exori vis'] = {
min = 1,
max = 2, -- spell won't cast if more creatures are in the spellRadius than this (does not have to exist)
needTarget = true, -- for spells that require you to have a target (does not target for you)
spellRadius = 1,
checkRadius = 2,
countPlayers = false,
attackMode = 'none'
},
-- Delete below if you don't intend on using runes
[3155] = { -- itemids can be used instead of spellwords (this is a great fireball rune)
min = 3,
needTarget = true,
spellRadius = 3,
checkRadius = 4,
countPlayers = false,
attackMode = 'none'
}
-- Delete all the way to here
}
}