Ir para conteúdo
  • 0

Alguém me ajuda nessse bug que tem nas minhas spells


jonathasbizerril

Pergunta

Alguém me diz como conserta istó?

 

Erro;

 

[06/03/2014 01:48:47] In a timer event called from:

[06/03/2014 01:48:47] data/spells/scripts/attack/exori gran tera.lua:onCastSpell
[06/03/2014 01:48:47] Description:
[06/03/2014 01:48:47] (luaDoPlayerSendTextMessage) Player not found

 

Script;

 

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(cid, MESSAGE_STATUS_WARNING, "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

 

Eu acho que o erro é nessa parte

 

 

local cooldown = 10

function onCastSpell6(cid)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.")
end

 

+REPP AJUDEM AI POR FAVOR

Link para o comentário
Compartilhar em outros sites

7 respostass a esta questão

Posts Recomendados

  • 0

 

 

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

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

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
Link para o comentário
Compartilhar em outros sites

  • 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 por Geraldoida
Link para o comentário
Compartilhar em outros sites

  • 0

Troque:

function onCastSpell6(cid)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.")
end
Por:

function onCastSpell6(cid)
    if isPlayer(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.")
    end
end
Editado por zipter98
Link para o comentário
Compartilhar em outros sites

  • 0

Troque:

function onCastSpell6(cid)
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.")
end
Por:

function onCastSpell6(cid)
    if isPlayer(cid) then
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "CD: Exori Gran Tera.")
    end
end

Resolveu meu problema obrigado! +repp

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...