Não da entender seu script, arrume-o por favor e aproveite para explicar melhor.
info
Grupo: Campones
Registrado: 26/12/12
Posts: 68
Reputação: +1
Char no Tibia: Skailord

já arumei.
O efeito fica se repetindo em todas as spells que eu fasso com esta script, mesmo que eu mude continua o mesmo efeito em todas entendeu?
info
Grupo: Barão
Registrado: 05/10/12
Posts: 245
Reputação: +36

local config = {efeitoTele2 = 67, -- efeito q ira aparacer a cada teleport.
efeitoDamage = 25, -- efeito q ira aparecer ao hitar no alvo
hits = 5, -- quantos hits vai dar
delay = 200, -- intervalo de tempo a cada hit
min = 10000, -- dano minimo
max = 15000, -- dano maximo
damage = COMBAT_PHYSICALDAMAGE -- tipo do dano
}
function isWalkable(pos, creature, pz, proj) -- nord
if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
if getTopCreature(pos).uid > 0 and creature then return false end
if getTileInfo(pos).protection 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 getPosDirs(p, dir) -- mkalo
return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z}
end
function validPos(pos)
tb = {}
for i = 1, 8 do
newpos = getPosDirs(pos, i)
if isWalkable(newpos) then
table.insert(tb, newpos)
end
end
table.insert(tb, pos)
return tb
end
spell = {
start = function (cid, target, markpos, hits)
if not isCreature(cid) then return true end
if not isCreature(target) or hits < 1 then
doTeleportThing(cid, markpos)
doSendMagicEffect3(getThingPos(cid), config.efeitoTele2)
return true
end
posAv = validPos(getThingPos(target))
rand = #posAv == 1 and 1 or #posAv - 1
doSendMagicEffect3(getThingPos(cid), config.efeitoTele2)
doTeleportThing(cid, posAv[math.random(1, rand)])
doAreaCombatHealth(cid, config.damage, getThingPos(target), 0, -config.min, -config.max, config.efeitoDamage)
addEvent(spell.start, config.delay, cid, target, markpos, hits - 1)
end
}
function onCastSpell(cid)
target = getCreatureTarget(cid)
if target then
spell.start(cid, target, getThingPos(cid), config.hits)
end
return true
end
tenta ai rs
info
Grupo: Campones
Registrado: 26/12/12
Posts: 68
Reputação: +1
Char no Tibia: Skailord

Não precisa me da a script enteira eu só quero saber onder configuro quando for faser outra spell com a mesma script.
info
Grupo: Barão
Registrado: 05/10/12
Posts: 245
Reputação: +36

você tem sempre que mudar os locais "efeitoTele" não pode ser igual, se não entra em conflito rs




info
Grupo: Campones
Registrado: 26/12/12
Posts: 68
Reputação: +1
Char no Tibia: Skailord
Ola galera do xtibia hoje venho pedir a vocês que me ajudascem com essa script que quando eu fasso a spell com ela fica tudo normal mas quando eu crio mais com a mesma script o efeito fica o mesmo em todas as spell criadas pela mesma script, se não entenderam eu explico mais, por favor me ajudem to precisando, rep + pra quem me ajudar.
script:
local config = {
efeitoTele = 69, -- efeito q ira aparacer a cada teleport.
efeitoDamage = 25, -- efeito q ira aparecer ao hitar no alvo
hits = 5, -- quantos hits vai dar
delay = 200, -- intervalo de tempo a cada hit
min = 10000, -- dano minimo
max = 15000, -- dano maximo
damage = COMBAT_PHYSICALDAMAGE -- tipo do dano
}
function isWalkable(pos, creature, pz, proj) -- nord
if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end
if getTopCreature(pos).uid > 0 and creature then return false end
if getTileInfo(pos).protection 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 getPosDirs(p, dir) -- mkalo
return dir == 1 and {x=p.x-1, y=p.y, z=p.z} or dir == 2 and {x=p.x-1, y=p.y+1, z=p.z} or dir == 3 and {x=p.x, y=p.y+1, z=p.z} or dir == 4 and {x=p.x+1, y=p.y+1, z=p.z} or dir == 5 and {x=p.x+1, y=p.y, z=p.z} or dir == 6 and {x=p.x+1, y=p.y-1, z=p.z} or dir == 7 and {x=p.x, y=p.y-1, z=p.z} or dir == 8 and {x=p.x-1, y=p.y-1, z=p.z}
end
function validPos(pos)
tb = {}
for i = 1, 8 do
newpos = getPosDirs(pos, i)
if isWalkable(newpos) then
table.insert(tb, newpos)
end
end
table.insert(tb, pos)
return tb
end
spell = {
start = function (cid, target, markpos, hits)
if not isCreature(cid) then return true end
if not isCreature(target) or hits < 1 then
doTeleportThing(cid, markpos)
doSendMagicEffect3(getThingPos(cid), config.efeitoTele)
return true
end
posAv = validPos(getThingPos(target))
rand = #posAv == 1 and 1 or #posAv - 1
doSendMagicEffect3(getThingPos(cid), config.efeitoTele)
doTeleportThing(cid, posAv[math.random(1, rand)])
doAreaCombatHealth(cid, config.damage, getThingPos(target), 0, -config.min, -config.max, config.efeitoDamage)
addEvent(spell.start, config.delay, cid, target, markpos, hits - 1)
end
}
function onCastSpell(cid)
target = getCreatureTarget(cid)
if target then
spell.start(cid, target, getThingPos(cid), config.hits)
end
return true
end
Editado Dezembro 30 por Skailord