This script version is deprecated, if you have problems with it, use this solution.
Anti KS (Kill Steal)
Description
Avoid killing monsters that doesn't belong to your character while hunting.
Configuration
Change the MinimumDistance variable to specify the distance limit to kill monsters. For Knights set this option to 1 or 2, for other vocations put 3 - 6. You can add characters names you want to steal by putting their names on the SafeList table.
Code
init start
--local SCRIPT_VERSION = "2.0.0"
local MinimumDistance = 1
local SafeList = {"Bubble", "Eternal Oblivion"}
-- DO NOT EDIT BELOW --
MinimumDistance = math.max(MinimumDistance, 1)
table.lower(SafeList)
init end
auto(100, 200)
local players, monsters = {}, {}
foreach creature c 'xf' do
if c.id ~= $target.id then
if c.isplayer and not table.find(SafeList, c.name:lower()) then
table.insert(players, c)
elseif c.ismonster then
table.insert(monsters, c)
end
end
end
table.sort(monsters, function(a, b)
if a.dist == b.dist then
if a.speed == b.speed then
if a.hppc == b.hppc then
return a.id < b.id
else
return a.hppc < b.hppc
end
else
return a.speed < b.speed
end
else
return a.dist < b.dist
end
end)
for _, cre in ipairs(monsters) do
if #players == 0 or cre.lastattacked <= 10000 or cre.dist <= MinimumDistance then
ignorecreature(cre, true)
elseif (not tilereachable(cre.posx, cre.posy, cre.posz)) or #players > 0 or cre.dist > MinimumDistance then
ignorecreature(cre)
end
end
if $attacked.ignored then
keyevent(0x1B) waitping()
end
You must spread some Reputation around before giving it to Leonardo again.
Even though I'm not gonna use it (screw everyone on my spawns xD), this is fucking awesome o.o
01-11-2014, 10:29 PM
stmaster
Quote:
Originally Posted by RoxZin xD
You must spread some Reputation around before giving it to Leonardo again.
Even though I'm not gonna use it (screw everyone on my spawns xD), this is fucking awesome o.o
wtf? ewwwwwwwwww xD
01-12-2014, 12:13 AM
Fisen
i test it but my character keep attack others player monster :(
01-12-2014, 12:17 AM
Leonardo
Quote:
Originally Posted by Fisen
i test it but my character keep attack others player monster :(
If you are EK please put the distance to 1 or 2. For other vocations put it on 5 or more.
01-13-2014, 08:34 AM
Fisen
Quote:
Originally Posted by Leonardo
If you are EK please put the distance to 1 or 2. For other vocations put it on 5 or more.
i tried with 1, and 2, but it still attack others players monster, maybe i doing anything wrong? i put the action in presistent, and non pvp mode, help!
01-13-2014, 10:27 AM
Leonardo
Quote:
Originally Posted by Fisen
i tried with 1, and 2, but it still attack others players monster, maybe i doing anything wrong? i put the action in presistent, and non pvp mode, help!
It should work, please, check if nothing come wrong: open help > console > it'll pop up a window, check if there are errors relationed to the script, if you don't know how to check just copy here the last one. Wherever you put the code should work, persistent or cavebot. If you didn't, download and put Raphael's library on the libs folder.
01-28-2014, 02:49 PM
Leonardo
Please redownload. Script was bugged now it's working.