Hello, this script is made to a request http://otland.net/f132/anti-lure-script-170873/
Simple script but pure otswe style
You write Monster Name and Back Posistion when it step into the tile, this will prevent that players lure a monster to far and it get teleport with the amout of health it had, instead of getting removed.
Go to movements/movements.xml and paste this line below:
Then goto movements/scripts and create new lua and name it "antilure.lua" and paste this script below:
Scarlet Ayleid:
Source Edit By Ninja:
Enjoy
Simple script but pure otswe style
You write Monster Name and Back Posistion when it step into the tile, this will prevent that players lure a monster to far and it get teleport with the amout of health it had, instead of getting removed.
Go to movements/movements.xml and paste this line below:
<movevent type="StepIn" actionid="1000" event="script" value="antilure.lua"/>
Then goto movements/scripts and create new lua and name it "antilure.lua" and paste this script below:
Lua:
local everyone_love_otswe = true
local otswe = {
monsters = { -- Monster Name, Teleport Back Posistion
["Orshabaal"] = { { x = 1070, y = 1051, z = 7 , stackpos = 1 } },
["Morgaroth"] = { { x = 1000, y = 1011, z = 7 , stackpos = 1 } },
}
}
function onStepIn(cid, item, pos, fromPos)
if isMonster(cid) and everyone_love_otswe == true then
for otswe, pos in pairs(otswe.monsters) do
if otswe == getCreatureName(cid) then
doTeleportThing(cid, pos[1])
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doSendMagicEffect(fromPos, CONST_ME_TELEPORT)
end
end
end
if everyone_love_otswe == false then
doCreatureSay(cid,"LOVE OTSWE, OR I WONT TELEPORT BACK!",TALKTYPE_MONSTER)
end
return TRUE
end
Scarlet Ayleid:
Lua:
local t = {
["Orshabaal"] = {pos = { x = 1070, y = 1051, z = 7 , stackpos = 1 }, range = 50},
["Morgaroth"] = {pos = { x = 1000, y = 1011, z = 7 , stackpos = 1 }, range = 50}
}
function distanceBetweenPos(pos1, pos2)
return math.abs(pos1.x - pos2.x) + math.abs(pos1.y - pos2.y)
end
function onThink(cid)
local cidName = getCreatureName(cid)
if(distanceBetweenPos(getCreaturePosition(cid), t[cidName].pos) >= t[cidName].range) then
doTeleportThing(cid, t[cidName].pos)
end
return true
end
Source Edit By Ninja:
Code:
if(g_config.getBool(ConfigManager::MONSTER_SPAWN_WALKBACK))
g_game.internalTeleport(this, getMasterPosition(), false);
Enjoy
Last edited: