Manda tag tb!
Alguém me ajuda nessse bug que tem nas minhas spells
Por jonathasbizerril, 06 de mar. de 2014 em Scripts
Editado Março 6 por Creatserv
info
Grupo: Conde
Registrado: 18/01/12
Posts: 988
Reputação: +327
Gênero: Masculino
Char no Tibia: Xerife Woody

local function doPullCreature(target, cid)
if target > 0 then
if not isNpc(target) then
local position = getThingPosition(cid)
local fromPosition = getThingPosition(target)
local x = ((fromPosition.x - position.x) < 0 and 1 or ((fromPosition.x - position.x) == 0 and 0 or -1))
local y = ((fromPosition.y - position.y) < 0 and 1 or ((fromPosition.y - position.y) == 0 and 0 or -1))
local toPosition = {x = fromPosition.x + x, y = fromPosition.y + y, z = fromPosition.z}
if doTileQueryAdd(target, toPosition) == 1 and getTileInfo(toPosition).house == false then
doTeleportThing(target, toPosition, true)
end
end
end
end
local spell = {}
spell.config = {
[3] = {
damageType = 1,
areaEffect = 31,
area = {
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 3, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0}
}
},
[2] = {
damageType = 1,
areaEffect = 31,
area = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 1, 1, 3, 1, 1, 0},
{0, 1, 1, 1, 1, 1, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}
},
[1] = {
damageType = 1,
areaEffect = 31,
area = {
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 1, 3, 1, 0, 0},
{0, 0, 1, 1, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
}
}
}
spell.combats = {}
for _, config in ipairs(spell.config) do
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, config.damageType)
setCombatParam(combat, COMBAT_PARAM_EFFECT, config.areaEffect)
setCombatParam(combat, COMBAT_PARAM_HITCOLOR, COLOR_YELLOW)
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0.8, -220, 1.2, -200)
function onTargetCreature(cid, target)
doPullCreature(target, cid)
end
local stun = createConditionObject(CONDITION_PHYSICAL)
setConditionParam(stun, CONDITION_PARAM_DELAYED, 31)
addDamageCondition(stun, 400, 6, -3000)
setCombatCondition(combat, stun)
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")
setCombatArea(combat, createCombatArea(config.area))
table.insert(spell.combats, combat)
end
local cooldown = 10
function onCastSpell6(cid)
doPlayerSendTextMessage(getCreaturePosition(cid), 22, "CD: Exori Gran Tera.")
end
function onCastSpell(cid, var)
if getPlayerStorageValue(cid, 10569) == 1 then
doSendAnimatedText((getCreaturePosition(cid)), "Socorro!", 255)
doSendMagicEffect(getCreaturePosition(cid), 19)
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return false
end
if exhaustion.check(cid, 23006) == false then
exhaustion.set(cid, 23006, cooldown)
addEvent(onCastSpell6, cooldown*1000, cid)
else
doSendMagicEffect(getCreaturePosition(cid), 2)
doPlayerSendCancel(cid, "Golpe em cooldown por " ..exhaustion.get(cid, 23006).." segundos")
return false
end
doCreatureSay(cid, "Exori Gran Tera", TALKTYPE_MONSTER)
for n = 1, #spell.combats do
addEvent(doCombat, (n * 150) - 150, cid, spell.combats[n], var)
end
end
info
Grupo: Campones
Registrado: 21/02/08
Posts: 57
Reputação: 0
Char no Tibia: The Rev

está dando o mesmo erro
[07/03/2014 00:12:11] [Error - Spell Interface]
[07/03/2014 00:12:11] In a timer event called from:[07/03/2014 00:12:11] data/spells/scripts/attack/exori gran tera.lua:onCastSpell[07/03/2014 00:12:11] Description:[07/03/2014 00:12:11] (luaDoPlayerSendTextMessage) Player not found
info
Grupo: Campones
Registrado: 22/11/13
Posts: 25
Reputação: 0

No lugar de
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.")
Coloque
addEvent(doPlayerSendTextMessage,6000,cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera")"
Pelo erro, a solução vai ser algo assim. Não testei.
Editado Março 7 por Geraldoida
Troque:
function onCastSpell6(cid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.")
endPor:
function onCastSpell6(cid)
if isPlayer(cid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.")
end
end
Editado Março 7 por zipter98
info
Grupo: Campones
Registrado: 21/02/08
Posts: 57
Reputação: 0
Char no Tibia: The Rev

Troque:
function onCastSpell6(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.") endPor:function onCastSpell6(cid) if isPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.") end end
Resolveu meu problema obrigado! +repp





info
Grupo: Campones
Registrado: 21/02/08
Posts: 57
Reputação: 0
Char no Tibia: The Rev
Alguém me diz como conserta istó?
Erro;
Script;
Eu acho que o erro é nessa parte
+REPP AJUDEM AI POR FAVOR