local quant_hit = 6 -- quantidade de hit's que ira dar no target
local timeHit = 0.5 -- segundos de diferença para cada hit
local quant_sqm = 2 -- sqms que ira empurrar o target
local sqmTime = 0.01 -- segundos para empurrar após hitar, exemplo de meio segundo.
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 60, 0, 1, 0)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_SPEED, 10)
setConditionFormula(condition, 0, 0, 0, 0)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if target > 0 then
local position_target = nil
local cont = 0
for i=-1, 1 do
for j=-1,1 do
position_target = {x=getCreaturePosition(target).x+i, y=getCreaturePosition(target).y+j, z=getCreaturePosition(target).z}
if isWalkable(position_target) then
cont = cont+1
break
end
end
if cont > 0 then
break
end
position_target = nil
end
local px = math.random(-1,1)
local py = 0
if px == -1 or px == 1 then
py = 0
elseif px == 0 then
local n = {1,-1}
py = n[math.random(1,#n)]
end
local poscentral = {x=getCreaturePosition(target).x+px, y=getCreaturePosition(target).y+py, z=getCreaturePosition(target).z}
if isWalkable(poscentral) then
position_target = poscentral
end
if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) == 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 hitTarget2(cid, target)
if isCreature(target) and isPlayer(cid) then
local effect2 = 1 -- efeito do hit na creatura.
doAddCondition(target, condition)
doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -getHit2(cid), -getHit2(cid), effect2)
end
end
function getHit2(cid)
local hit2 = getPlayerLevel(cid)*5 + getPlayerMagLevel(cid)*5 + math.random(20650,29750)
return hit2
end
function empurrarTarget(cid, target, tempo)
if isPlayer(cid) then
doRemoveCondition(cid, CONDITION_PARALYZE)
end
if isCreature(target) and isPlayer(cid) then
local positions = nil
doAddCondition(target, condition)
if getPlayerLookDir(cid) == 0 then
positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y-1, z=getCreaturePosition(target).z}
elseif getPlayerLookDir(cid) == 1 then
positions = {x=getCreaturePosition(target).x+1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z}
elseif getPlayerLookDir(cid) == 2 then
positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z}
elseif getPlayerLookDir(cid) == 3 then
positions = {x=getCreaturePosition(target).x-1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z}
end
if positions ~= nil and isWalkable(positions) then
doTeleportThing(target, positions)
end
local tp = sqmTime*1000*(quant_sqm-1)+quant_hit*timeHit*1000
if tempo == tp then
doRemoveCondition(target, CONDITION_PARALYZE)
end
end
end
function sendEffect2(cid, target)
local position1 = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
local position2 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
if isCreature(target) and isPlayer(cid) then
doSendMagicEffect(position1, 190)
doSendMagicEffect(position2, 197)
end
end
end
Pq o Erro (luaGetThingPosition) Thing not found Ná spell?
Por Mattziin, 29 de jan. de 2013 em Scripts
info
Grupo: Campones
Registrado: 24/07/12
Posts: 69
Reputação: +13
Char no Tibia: ADM Aritgo

info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

se o dele /\ n funcionar tenta assim...
local function hitTarget2(cid, target)
if isCreature(target) and isPlayer(cid) then
local effect2 = 1 -- efeito do hit na creatura.
doAddCondition(target, condition)
doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -getHit2(cid), -getHit2(cid), effect2)
end
end
local function getHit2(cid)
local hit2 = getPlayerLevel(cid)*5 + getPlayerMagLevel(cid)*5 + math.random(20650,29750)
return hit2
end
local function empurrarTarget(cid, target, tempo)
if isPlayer(cid) then
doRemoveCondition(cid, CONDITION_PARALYZE)
end
if isCreature(target) and isPlayer(cid) then
local positions = nil
doAddCondition(target, condition)
if getPlayerLookDir(cid) == 0 then
positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y-1, z=getCreaturePosition(target).z}
elseif getPlayerLookDir(cid) == 1 then
positions = {x=getCreaturePosition(target).x+1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z}
elseif getPlayerLookDir(cid) == 2 then
positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z}
elseif getPlayerLookDir(cid) == 3 then
positions = {x=getCreaturePosition(target).x-1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z}
end
if positions ~= nil and isWalkable(positions) then
doTeleportThing(target, positions)
end
local tp = sqmTime*1000*(quant_sqm-1)+quant_hit*timeHit*1000
if tempo == tp then
doRemoveCondition(target, CONDITION_PARALYZE)
end
end
end
local function sendEffect2(cid, target)
local position1 = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
local position2 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
if isCreature(target) and isPlayer(cid) then
doSendMagicEffect(position1, 190)
doSendMagicEffect(position2, 197)
end
end
local quant_hit = 6 -- quantidade de hit's que ira dar no target
local timeHit = 0.5 -- segundos de diferença para cada hit
local quant_sqm = 2 -- sqms que ira empurrar o target
local sqmTime = 0.01 -- segundos para empurrar após hitar, exemplo de meio segundo.
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 60, 0, 1, 0)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_SPEED, 10)
setConditionFormula(condition, 0, 0, 0, 0)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if isCreature(target) then
local position_target = nil
local cont = 0
for i=-1, 1 do
for j=-1,1 do
position_target = {x=getCreaturePosition(target).x+i, y=getCreaturePosition(target).y+j, z=getCreaturePosition(target).z}
if isWalkable(position_target) then
cont = cont+1
break
end
end
if cont > 0 then
break
end
position_target = nil
end
local px = math.random(-1,1)
local py = 0
if px == -1 or px == 1 then
py = 0
elseif px == 0 then
local n = {1,-1}
py = n[math.random(1,#n)]
end
local poscentral = {x=getCreaturePosition(target).x+px, y=getCreaturePosition(target).y+py, z=getCreaturePosition(target).z}
if isWalkable(poscentral) then
position_target = poscentral
end
if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) == 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
end
return true
end
olha o erro q dá agora.
[29/01/2013 14:54:06] [Error - Spell Interface] [29/01/2013 14:54:06] data/spells/scripts/sakura/taihoukyakunojutsu.lua:onCastSpell [29/01/2013 14:54:06] Description: [29/01/2013 14:54:07] attempt to index a nil value [29/01/2013 14:54:07] stack traceback: [29/01/2013 14:54:07] [C]: in function 'getTileInfo' [29/01/2013 14:54:07] data/lib/050-function.lua:327: in function 'getTilePzInfo' [29/01/2013 14:54:07] data/spells/scripts/sakura/taihoukyakunojutsu.lua:45: in function <data/spells/scripts/sakura/taihoukyakunojutsu.lua:14>
info
Grupo: Campones
Registrado: 24/07/12
Posts: 69
Reputação: +13
Char no Tibia: ADM Aritgo

Isto deu nos 2 ?
no meu e do dele ?
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

mano tirase 'isso' da onde? --' olhando melhor agora, esse script n faz o menor sentido ;x
eu usei o do "artigo" aparece o nome da spell e talz. mais nao sai effect e nem hita.
e o teu "Slicer" nao funciona e dá esse erro \/
[29/01/2013 15:27:39] [Error - Spell Interface] [29/01/2013 15:27:39] data/spells/scripts/sakura/taihoukyakunojutsu.lua:onCastSpell [29/01/2013 15:27:39] Description: [29/01/2013 15:27:39] attempt to index a nil value [29/01/2013 15:27:39] stack traceback: [29/01/2013 15:27:39] [C]: in function 'getTileInfo' [29/01/2013 15:27:39] data/lib/050-function.lua:327: in function 'getTilePzInfo' [29/01/2013 15:27:39] data/spells/scripts/sakura/taihoukyakunojutsu.lua:100: in function <data/spells/scripts/sakura/taihoukyakunojutsu.lua:67>
.
Slicer eu peguei isso da net, nem me lembro aonde q foi ..
~~~ ~~~~ ~EDITED ~~ ~~~ ~~~
Pode fechar, eu peguei outra spell e botei o effect dessa ... Vlw ai por tentarem me ajudar. DÚVIDA SANADA.
Editado Janeiro 29 por Mattziin





info
Grupo: Artesão
Registrado: 11/11/11
Posts: 115
Reputação: +12
Gostaria de saber pq a spell ta dando o erro. Eu olhei o script varias vezes e nao achei o erro :S , Alguém me ajuda ai.
script \/
local quant_hit = 6 -- quantidade de hit's que ira dar no target
local timeHit = 0.5 -- segundos de diferença para cada hit
local quant_sqm = 2 -- sqms que ira empurrar o target
local sqmTime = 0.01 -- segundos para empurrar após hitar, exemplo de meio segundo.
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 60, 0, 1, 0)
local condition = createConditionObject(CONDITION_PARALYZE)
setConditionParam(condition, CONDITION_PARAM_TICKS, -1)
setConditionParam(condition, CONDITION_PARAM_SPEED, 10)
setConditionFormula(condition, 0, 0, 0, 0)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
local target = getCreatureTarget(cid)
if target > 0 then
local position_target = nil
local cont = 0
for i=-1, 1 do
for j=-1,1 do
position_target = {x=getCreaturePosition(target).x+i, y=getCreaturePosition(target).y+j, z=getCreaturePosition(target).z}
if isWalkable(position_target) then
cont = cont+1
break
end
end
if cont > 0 then
break
end
position_target = nil
end
local px = math.random(-1,1)
local py = 0
if px == -1 or px == 1 then
py = 0
elseif px == 0 then
local n = {1,-1}
py = n[math.random(1,#n)]
end
local poscentral = {x=getCreaturePosition(target).x+px, y=getCreaturePosition(target).y+py, z=getCreaturePosition(target).z}
if isWalkable(poscentral) then
position_target = poscentral
end
if getDistanceBetween(getCreaturePosition(cid), getCreaturePosition(target)) 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 hitTarget2(cid, target)
if isCreature(target) and isPlayer(cid) then
local effect2 = 1 -- efeito do hit na creatura.
doAddCondition(target, condition)
doTargetCombatHealth(cid, target, COMBAT_PHYSICALDAMAGE, -getHit2(cid), -getHit2(cid), effect2)
end
end
function getHit2(cid)
local hit2 = getPlayerLevel(cid)*5 + getPlayerMagLevel(cid)*5 + math.random(20650,29750)
return hit2
end
function empurrarTarget(cid, target, tempo)
if isPlayer(cid) then
doRemoveCondition(cid, CONDITION_PARALYZE)
end
if isCreature(target) and isPlayer(cid) then
local positions = nil
doAddCondition(target, condition)
if getPlayerLookDir(cid) == 0 then
positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y-1, z=getCreaturePosition(target).z}
elseif getPlayerLookDir(cid) == 1 then
positions = {x=getCreaturePosition(target).x+1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z}
elseif getPlayerLookDir(cid) == 2 then
positions = {x=getCreaturePosition(target).x, y=getCreaturePosition(target).y+1, z=getCreaturePosition(target).z}
elseif getPlayerLookDir(cid) == 3 then
positions = {x=getCreaturePosition(target).x-1, y=getCreaturePosition(target).y, z=getCreaturePosition(target).z}
end
if positions ~= nil and isWalkable(positions) then
doTeleportThing(target, positions)
end
local tp = sqmTime*1000*(quant_sqm-1)+quant_hit*timeHit*1000
if tempo == tp then
doRemoveCondition(target, CONDITION_PARALYZE)
end
end
end
function sendEffect2(cid, target)
local position1 = {x=getCreaturePosition(cid).x, y=getCreaturePosition(cid).y, z=getCreaturePosition(cid).z}
local position2 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
if isCreature(target) and isPlayer(cid) then
doSendMagicEffect(position1, 190)
doSendMagicEffect(position2, 197)
end
end
Thank