@up
info
Grupo: Conde
Registrado: 09/09/09
Posts: 528
Reputação: +424
Char no Tibia: Emekalo Makalo

O que voce quiz dizer com "encostar"? Ficar do lado do player?
Se for isso soh editando a source pra adicionar funçao onWalk, ou fazer uma gambiarra pra ficar dando check de tanto em tanto tempo no player pra ve se tem alguem do lado dele o que pode acabar lagando, posso fazer mas avisei .
Segunda spell:
Bem deve funcionar:
data\spells\scripts\hook.lua:
local range = 7
local interval = 50 -- velocidade do projetil em ms. ex: 1 sqm em 50 ms
local stepsinterval = 50 -- velocidade de cada passo que a criatura vai dar ate chegar ao player
local mindmg, maxdmg = 50, 100 -- min e max dmg em PLAYER, o dobro em monstros
local dirs = {
[0] = {0, -1},
[1] = {1, 0},
[2] = {0, 1},
[3] = {-1, 0}
}
function testTimes(pos, range, dir, interval)
for i = 1, range do
addEvent(doSendAnimatedText, interval*i, {x=pos.x+dirs[dir][1]*i, y=pos.y+dirs[dir][2]*i, z=pos.z}, i, 180)
end
end
function forceWalk(cid, dir, distance, interval)
local pos = getCreaturePosition(cid)
local function teleportCreatureEvent(cid, topos)
if isCreature(cid) then
doTeleportThing(cid, topos, true)
end
end
if interval > 0 then
for i = 1, distance do
addEvent(teleportCreatureEvent, i*interval, cid, {x=pos.x+dirs[dir][1]*i, y=pos.y+dirs[dir][2]*i, z=pos.z})
end
else
doTeleportThing(cid, {x=pos.x+dirs[dir][1]*distance, y=pos.y+dirs[dir][2]*distance, z=pos.z})
end
return true
end
function isWalkable(pos)
pos.stackpos = 1
local tile = getThingFromPos(pos)
if not getTileInfo(pos).protection and (tile.itemid == 0 or (not isCreature(tile.uid) and not hasProperty(tile.uid, 0) and not hasProperty(tile.uid, 2) and not hasProperty(tile.uid, 3))) then
return true
end
return false
end
function onCastSpell(cid, var)
local playerpos = getPlayerPosition(cid)
local dir = getPlayerLookDir(cid)
local distance, target
for d = 1, range do
local uid = getThingFromPos({x=playerpos.x+dirs[dir][1]*d, y=playerpos.y+dirs[dir][2]*d, z=playerpos.z, stackpos=255}).uid
if isCreature(uid) and not getTileInfo({x=playerpos.x+dirs[dir][1]*d, y=playerpos.y+dirs[dir][2]*d, z=playerpos.z}).protection then
distance = d
target = uid
break
end
if not isWalkable({x=playerpos.x+dirs[dir][1]*d, y=playerpos.y+dirs[dir][2]*d, z=playerpos.z}) then
distance = d
break
end
end
if distance then
doSendDistanceShoot(playerpos, {x=playerpos.x+dirs[dir][1]*distance, y=playerpos.y+dirs[dir][2]*distance, z=playerpos.z}, 2)
if target then
addEvent(forceWalk, interval*distance, target, (dir+2)%4, distance-1, stepsinterval)
addEvent(doTargetCombatHealth, interval*distance, cid, target, COMBAT_PHYSICALDAMAGE, -mindmg*2, -maxdmg*2, nil)
end
else
doSendDistanceShoot(playerpos, {x=playerpos.x+dirs[dir][1]*range, y=playerpos.y+dirs[dir][2]*range, z=playerpos.z}, 2)
end
--testTimes(playerpos, range, dir, interval)
return true
end
tag:
<instant name="Hook" words="fresh meat" lvl="8" mana="1" exhaustion="2000" needlearn="0" event="script" value="hook.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>
Como voce nao deixou claro se a criatura atingida pela "arrow" seria "arrastada" ou simplesmente dar teleport eu botei os dois, soh botar o stepsinterval = 0 pra dar teleport
O problema eh que nao tem como eu fazer uma funçao pra desativar os movimentos do player enquanto ele esta sendo arrastado, isso pode acabar dando bugs, se for o caso voce vai ter que deixar o stepsinterval = 0 e o player nao vai ser arrastado
Editado Novembro 26 por MatheusMkalo



info
Grupo: Campones
Registrado: 06/06/08
Posts: 29
Reputação: +3
Boooa tarde xtibianos, venho por meio desse topico fazer 1 ilustre pedido de spells, que pode ser bem inovador tanto pra mim como pra outros membros que busca spells novas.
Bom meu pedido se resume em 2 spells.
1 - Uma spell de target que solta-se 1 ataque elétrico, esse ataque da 1 dano regular e que o target fica-se eletrocutado durante 10 segundos levando hit de 50, e caso algum monstro ou jogador encoste nesse target, tb seja eletrocutado durante 10 segundos.
2 - Segunda spell, gostaria de uma spell para paladin onde eu solta-se uma flexa na direção reta de 7 sqm, se a flecha bater em algo o jogador q soltou a magia da flecha seja puxado até o alvo onde a flexa bateu e de 1 hit regular.