Fala galera do TK, trago hoje a vocês uma magia que pode ser usada tanto em servidores normais como derivados!
Não vou ficar falando muito pois fiz um vídeo rápido demonstrativo de como funciona esta magia.
Vídeo:
https://www.youtube.com/watch?v=nuHvbo9THaM&feature=youtu.be
Este vídeo diz mais que mil palavras, entenderam?
Com o ctrl do seu mouse você irá controlar o TRAP no player, player's ou monsters, seja onde usar.
Observação:
Os traps não entram em área pz ou no-pvp
Caso ande um sqm com seu char, a magia stopa.
Não saia da "tela" com a magia, a mesma irá parar.
Pós 30 segundos os traps sumiram do mapa.
Sem blábláblá vamos a fácil instalação:
Em data/spell/scripts crie um arquivo com o nome de exevoflorest.lua e dentro adicione:
--<Script by Jhon992, XWhiteWolf and Absolute>--
local stonesId = {2700,2767,2708,2712}
local timeRemove = 30
function createObject(cid, position, stonesPosition)
if (isPlayer(cid)) then
if getPlayerLookDir(cid) == 0 then
positions = {x=position.x, y=position.y-1, z=position.z}
elseif getPlayerLookDir(cid) == 1 then
positions = {x=position.x+1, y=position.y, z=position.z}
elseif getPlayerLookDir(cid) == 2 then
positions = {x=position.x, y=position.y+1, z=position.z}
elseif getPlayerLookDir(cid) == 3 then
positions = {x=position.x-1, y=position.y, z=position.z}
end
if canWalk(positions) then
createStone(stonesPosition, positions, stonesId[math.random(1,#stonesId)], cid)
addEvent(createObject, 500, cid, positions, stonesPosition)
else
addEvent(removeStones, timeRemove*1000, stonesPosition)
end
end
end
function createStone(stonesPosition, positions, stone, cid)
doCreateItem(stone, 1, positions)
stonesPosition[(#stonesPosition)+1] = {x=positions.x, y=positions.y, z=positions.z, stackpos=1}
end
function removeStones(stonesPosition)
for i=1, #stonesPosition do
for o=1, 2 do
stonesPosition[i] = {x=stonesPosition[i].x, y=stonesPosition[i].y, z=stonesPosition[i].z, stackpos=o}
if isInArray(stonesId, getThingfromPos(stonesPosition[i]).itemid) then
doRemoveItem(getThingfromPos(stonesPosition[i]).uid)
end
end
end
end
function canWalk(pos, creature, pz, proj) -- nord
if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
local creature = getTopCreature(pos)
if creature.type > 0 then return false end
if getTilePzInfo(pos) and not pz then return false end
local n = not proj and 3 or 2
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end
function onCastSpell(cid, var)
local stonesPosition = {}
local position = getPlayerPosition(cid)
createObject(cid, position, stonesPosition)
return true
end
Em data/spells/spells.xml adicione a seguinte tag:
<instant name="Florest Wall" words="exevo florest" lvl="45" mana="600" prem="1" blockwalls="1" exhaustion="3000" groups="3,2000" icon="127" needlearn="0" event="script" value="exevoflorest.lua">
<vocation id="1"/>
<vocation id="2"/>
<vocation id="3"/>
<vocation id="4"/>
<vocation id="5"/>
<vocation id="6"/>
<vocation id="7"/>
<vocation id="8"/>
</instant>
Configurando:
local stonesId = {2700,2767,2708,2712} = ID RANDOM DAS ÁRVORES QUE IRÃO SER "SUMONADAS" PARA A TRAP
local timeRemove = 30 = TEMPO EM SEGUNDOS PARA REMOVER AS TRAPS
Bom, é isso aí galera, espero que tenham gostado.
Qualquer dúvida, sugestão, crítica construtiva poste aqui no tópico que irei ajuda-lo.
Não tenha vergonha ninguém nasceu sabendo, estamos aqui pra isto
Créditos:
Jhon
XWhiteWolf
Absolute
Até a próxima galera!
Absolute.