up
- Fórum
- xTibia - Notícias e Suporte
- Soluções
- Archived
- erro ao chamar pokemon de volta
erro ao chamar pokemon de volta
Por wevertonvrb, 14 de jan. de 2017 em Archived
info
Grupo: Visconde
Registrado: 21/05/13
Posts: 303
Reputação: +25

Isso está acontecendo pelo mal uso do AddEvent , poste a script da Spell para que possamos arruma-la.
info
Grupo: Visconde
Registrado: 21/05/13
Posts: 303
Reputação: +25

3 horas atrás, PedroHL disse:Isso está acontecendo pelo mal uso do AddEvent , poste a script da Spell para que possamos arruma-la.
não é o mau uso do add event, isso acontece com todas as spells que aplica o status negativo sleep
e mesmo assim n da erro o erro acontece apenas se seu chamar o pokemon de volta pra pokeball enquanto ele esta de sleep
acredito q o erro esteja neste if
if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then
setPlayerStorageValue(cid, stg, cd)
return true
end
Editado Janeiro 16 por wevertonvrb
info
Grupo: Herói
Registrado: 07/03/16
Posts: 1.4k
Reputação: +385
Gênero: Masculino

Sim, está certo.
O problema reside no fato dele não encontrar a criatura. Portanto, tem haver com o sistema de sleep. Verifique o que acontece com uma criatura quando eme sleep.
info
Grupo: Visconde
Registrado: 21/05/13
Posts: 303
Reputação: +25

15 horas atrás, Poccnn disse:Sim, está certo.
O problema reside no fato dele não encontrar a criatura. Portanto, tem haver com o sistema de sleep. Verifique o que acontece com uma criatura quando eme sleep.
já postei o sistema de sleep e marquei as linhas relacionadas ao erro sera q pode me dar uma ajuda? n estou conseguindo solucionar este erro
o sistema esta funcionando porem se eu chamar o pokemon de volta pra pokeball (dar um /r) enquanto ele estiver com sleep surge o erro
info
Grupo: Herói
Registrado: 07/03/16
Posts: 1.4k
Reputação: +385
Gênero: Masculino

Só saiba disso: ele não está encontrando a criatura. Verifique o do porque que ele não a encontra.
info
Grupo: Visconde
Registrado: 21/05/13
Posts: 303
Reputação: +25

12 horas atrás, Poccnn disse:Só saiba disso: ele não está encontrando a criatura. Verifique o do porque que ele não a encontra.
ele n a encontra pq eu a removo
pff ajuda com essa
info
Grupo: Visconde
Registrado: 20/03/14
Posts: 367
Reputação: +219
Gênero: Masculino

Poste a function doSleep2 toda
info
Grupo: Herói
Registrado: 07/03/16
Posts: 1.4k
Reputação: +385
Gênero: Masculino

9 horas atrás, wevertonvrb disse:ele n a encontra pq eu a removo
pff ajuda com essa
Ora... Se não existe criatura, como pode querer pegar a criatura? Pensa.
info
Grupo: Visconde
Registrado: 21/05/13
Posts: 303
Reputação: +25

12 horas atrás, Poccnn disse:Ora... Se não existe criatura, como pode querer pegar a criatura? Pensa.
sim eu entendi isso, o erro acontece quando eu tiro a criatura, mas eu não estou conseguindo resolver isso, seio man por favor me ajuda com essa pff ta difícil pra mim
20 horas atrás, Drakopoulos disse:Poste a function doSleep2 toda
já postei, ela no meu primeiro post eu marquei as linhas em vermelho pois é um arquivo muito grande cheio de funções porem a dosleep2 ta completa
Editado Janeiro 18 por wevertonvrb
info
Grupo: Visconde
Registrado: 20/03/14
Posts: 367
Reputação: +219
Gênero: Masculino

Agora, wevertonvrb disse:já postei, ela no meu primeiro post eu marquei as linhas em vermelho pois é um arquivo muito grande cheio de funções porem a dosleep2 ta completa
Tem certeza q a função está completa ali? se possível postar novamente.
info
Grupo: Visconde
Registrado: 21/05/13
Posts: 303
Reputação: +25

5 horas atrás, Drakopoulos disse:Tem certeza q a função está completa ali? se possível postar novamente.
sim esta vou postar novamente
function doSleep2(cid, cd, check, first) --------------------------------------------------esta é a linha 486---------------------------------------------------------
local stg = conds["Sleep"]
--is creature?
-
-
-
-
if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then --------------------------esta é a linha 496 -------------------------------------------------------
setPlayerStorageValue(cid, stg, cd) --allterado v1.8
return true
end
if not isSleeping(cid) then
addEvent(doSendSleepEffect, 500, cid)
end
if not check and getPlayerStorageValue(cid, stg) >= 1 then
setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
else
setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
end
local a = getPlayerStorageValue(cid, stg)
if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
local item = getPlayerSlotItem(getCreatureMaster(cid), ![]()
doItemSetAttribute(item.uid, "sleep", a)
end
if a <= -1 then
if not isPlayer(cid) then
local dittoStg = getPlayerStorageValue(cid, 1010)
if getCreatureName(cid) == "Ditto" and isSummon(cid) and tostring(dittoStg) and dittoStg ~= "Ditto" then
doSetCreatureOutfit(cid, {lookType = getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "transOutfit")}, -1)
else
doRemoveCondition(cid, CONDITION_OUTFIT)
end
if getPlayerStorageValue(cid, 625877) ~= -1 then
doSetCreatureOutfit(cid, {lookType = getPlayerStorageValue(cid, 625877)}, -1) --alterado v1.6
end
end
if isPlayer(cid) then
if not isParalyze(cid) then
mayNotMove(cid, false) --alterado
end
else
if getCreatureCondition(cid, CONDITION_PARALYZE) == true then
doRemoveCondition(cid, CONDITION_PARALYZE)
addEvent(doAddCondition, 10, cid, paralizeArea2)
end
if not isParalyze(cid) then
doRegainSpeed(cid) --alterado
end
end
setPlayerStorageValue(cid, stg, -1)
return true
end
if first then
if getCreatureName(cid) == "Ursaring" and getCreatureCondition(cid, CONDITION_OUTFIT) == true then
elseif not isPlayer(cid) then
if isInArray({604, 605, 1015, 1016, 1183, 1184}, getCreatureOutfit(cid).lookType) then
Info = 0 --alterado v1.6
else
Info = getMonsterInfo(getCreatureName(cid)).lookCorpse
end
local look = getCreatureOutfit(cid)
---------
local dittoStg = getPlayerStorageValue(cid, 1010)
if getCreatureName(cid) == "Ditto" and isSummon(cid) and tostring(dittoStg) and dittoStg ~= "Ditto" then
local InfoDitto = getMonsterInfo(tostring(dittoStg)).lookCorpse
if InfoDitto ~= 0 and look.lookType ~= 0 then
--doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(tostring(dittoStg)).lookCorpse}, -1)
end
else
if getCreatureName(cid) == "Shiny Golem" and getCreatureOutfit(cid).lookType == 1403 then
doRemoveCondition(cid, CONDITION_OUTFIT)
elseif Info ~= 0 and look.lookType ~= 0 then
--doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(cid)).lookCorpse}, -1)
end
end
end
end
--alterado v1.6
if isPlayer(cid) then
mayNotMove(cid, true)
else
doChangeSpeed(cid, -getCreatureSpeed(cid))
end
addEvent(doSleep2, 1000, cid, -1, a, false)
end
e este é o erro
[18/01/2017 23:12:45] [Error - Spell Interface]
[18/01/2017 23:12:45] In a timer event called from:
[18/01/2017 23:12:45] data/spells/scripts/ps/Yawn.lua:onCastSpell
[18/01/2017 23:12:45] Description:
[18/01/2017 23:12:45] (luaGetCreatureStorage) Creature not found
[18/01/2017 23:12:45] [Error - Spell Interface]
[18/01/2017 23:12:45] In a timer event called from:
[18/01/2017 23:12:45] data/spells/scripts/ps/Yawn.lua:onCastSpell
[18/01/2017 23:12:45] Description:
[18/01/2017 23:12:45] data/lib/newStatusSyst.lua:496: attempt to compare number with boolean
[18/01/2017 23:12:45] stack traceback:
[18/01/2017 23:12:45] data/lib/newStatusSyst.lua:496: in function <data/lib/newStatusSyst.lua:486>
info
Grupo: Herói
Registrado: 07/03/16
Posts: 1.4k
Reputação: +385
Gênero: Masculino

Eu quero saber o que é um pokemon em sleep, um item? Um monstro?
11 horas atrás, wevertonvrb disse:man por favor me ajuda com essa pff ta difícil pra mim
Eu não entendo nada de pokemon por isso não dá pra te ajudar.
info
Grupo: Visconde
Registrado: 21/05/13
Posts: 303
Reputação: +25

2 horas atrás, Poccnn disse:Eu quero saber o que é um pokemon em sleep, um item? Um monstro?
Eu não entendo nada de pokemon por isso não dá pra te ajudar.
falarei de um jeito q você deve entender
quando o summoner de um player esta com (paralize,stun) no meu caso quando esta com sleep (dormindo).
quando este status esta ativado no sumoner e ele é morto, ou se dar um \r nele e o apaga, quando acontece qualquer coisa que ele deixa de existir gera este erro de criatura não encontrada
sim ela n sera encontrada pois esta morta ou não existe +



info
Grupo: Visconde
Registrado: 21/05/13
Posts: 303
Reputação: +25
se o meu pokemon estiver com sleep (dormindo) e eu o chamar de volta para pokeball gera o seguinte erro
[14/01/2017 03:47:03] [Error - Spell Interface]
[14/01/2017 03:47:03] In a timer event called from:
[14/01/2017 03:47:03] data/spells/scripts/ps/Grass Whistle.lua:onCastSpell -- essa é a spell q foi usada para por sleep, mas o erro acontece com qualquer coisa q deixe com sleep e so acontece se eu chamar de volta o pokemon dormindo
[14/01/2017 03:47:03] Description:
[14/01/2017 03:47:03] (luaGetCreatureStorage) Creature not found
[14/01/2017 03:47:03] [Error - Spell Interface]
[14/01/2017 03:47:03] In a timer event called from:
[14/01/2017 03:47:03] data/spells/scripts/ps/Grass Whistle.lua:onCastSpell
[14/01/2017 03:47:03] Description:
[14/01/2017 03:47:03] data/lib/newStatusSyst.lua:496: attempt to compare number with boolean
[14/01/2017 03:47:03] stack traceback:
[14/01/2017 03:47:03] data/lib/newStatusSyst.lua:496: in function <data/lib/newStatusSyst.lua:486>
vou postar a função do erro
function doSleep2(cid, cd, check, first) --------------------------------------------------esta é a linha 486---------------------------------------------------------
local stg = conds["Sleep"]
--is creature?
--
--
--
--

if getPlayerStorageValue(cid, stg) >= 1 and cd ~= -1 then --------------------------esta é a linha 496 -------------------------------------------------------
setPlayerStorageValue(cid, stg, cd) --allterado v1.8
return true
end
if not isSleeping(cid) then
addEvent(doSendSleepEffect, 500, cid)
end
if not check and getPlayerStorageValue(cid, stg) >= 1 then
setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd - 1)
else
setPlayerStorageValue(cid, stg, getPlayerStorageValue(cid, stg) + cd)
end
local a = getPlayerStorageValue(cid, stg)
if isSummon(cid) and getPlayerStorageValue(cid, 212123) <= 0 then
local item = getPlayerSlotItem(getCreatureMaster(cid),
doItemSetAttribute(item.uid, "sleep", a)
end
if a <= -1 then
if not isPlayer(cid) then
local dittoStg = getPlayerStorageValue(cid, 1010)
if getCreatureName(cid) == "Ditto" and isSummon(cid) and tostring(dittoStg) and dittoStg ~= "Ditto" then
doSetCreatureOutfit(cid, {lookType = getItemAttribute(getPlayerSlotItem(getCreatureMaster(cid), 8).uid, "transOutfit")}, -1)
else
doRemoveCondition(cid, CONDITION_OUTFIT)
end
if getPlayerStorageValue(cid, 625877) ~= -1 then
doSetCreatureOutfit(cid, {lookType = getPlayerStorageValue(cid, 625877)}, -1) --alterado v1.6
end
end
if isPlayer(cid) then
if not isParalyze(cid) then
mayNotMove(cid, false) --alterado
end
else
if getCreatureCondition(cid, CONDITION_PARALYZE) == true then
doRemoveCondition(cid, CONDITION_PARALYZE)
addEvent(doAddCondition, 10, cid, paralizeArea2)
end
if not isParalyze(cid) then
doRegainSpeed(cid) --alterado
end
end
setPlayerStorageValue(cid, stg, -1)
return true
end
if first then
if getCreatureName(cid) == "Ursaring" and getCreatureCondition(cid, CONDITION_OUTFIT) == true then
elseif not isPlayer(cid) then
if isInArray({604, 605, 1015, 1016, 1183, 1184}, getCreatureOutfit(cid).lookType) then
Info = 0 --alterado v1.6
else
Info = getMonsterInfo(getCreatureName(cid)).lookCorpse
end
local look = getCreatureOutfit(cid)
---------
local dittoStg = getPlayerStorageValue(cid, 1010)
if getCreatureName(cid) == "Ditto" and isSummon(cid) and tostring(dittoStg) and dittoStg ~= "Ditto" then
local InfoDitto = getMonsterInfo(tostring(dittoStg)).lookCorpse
if InfoDitto ~= 0 and look.lookType ~= 0 then
--doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(tostring(dittoStg)).lookCorpse}, -1)
end
else
if getCreatureName(cid) == "Shiny Golem" and getCreatureOutfit(cid).lookType == 1403 then
doRemoveCondition(cid, CONDITION_OUTFIT)
elseif Info ~= 0 and look.lookType ~= 0 then
--doSetCreatureOutfit(cid, {lookType = 0, lookTypeEx = getMonsterInfo(getCreatureName(cid)).lookCorpse}, -1)
end
end
end
end
--alterado v1.6
if isPlayer(cid) then
mayNotMove(cid, true)
else
doChangeSpeed(cid, -getCreatureSpeed(cid))
end
addEvent(doSleep2, 1000, cid, -1, a, false)
end