ve pvt gabriel
- Forums
- xTibia - Notícias e Suporte
- Soluções
- Archived
- [ERRO] Spells
info
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: Masculino

ainda n sabe ler um erro? kkk'
ta dizendo q n tens a funçao 'getSelectedCreature'... pede pra sei la quem fez esses codigos ae te passar ela... kk'
Edited Março 18 by Slicer
info
Group: Herói
Joined: 12/06/12
Posts: 2.2k
Reputation: +739
Gender: Masculino
Tibia Character: Supreme Player

/\ então não estou entendendo nada , se funciona as outras spells por que principalmente essas que o Pokemon usa em si mesmo não funfa ???
Edited Março 18 by Gabrieltxu
info
Group: Príncipe
Joined: 19/08/10
Posts: 4k
Reputation: +1.1k
Gender: Masculino

hã... provavelmente as outras n usam essa funçao q ta faltando? --' vo nem comenta heim...
info
Group: Herói
Joined: 12/06/12
Posts: 2.2k
Reputation: +739
Gender: Masculino
Tibia Character: Supreme Player

Bom deixa esse erro para depois , então agora to com esse erro aqui , é sobre a Pokedex , tipo ele mostra que vc desbloqueou ele na Pokedex mais quando vc coloca para abrir as informações não mostra , segue a print \/

Outra as informações do Pokémon fica no proprio xml dele segue esse exemplo \/
e por ultimo meu script da dex \/
local function unlockPokedex(cid, info, pos)
if(getPokedex(cid, info.id).unlocked == false) then
setPokedex(cid, {pokemon=info.id, unlocked=true, cash=-1})
if(info.experience > 0) then
doPlayerAddExp(cid, info.experience)
end
local name = ""
if(info.shiny) then
name = "Shiny "
end
name = name .."".. info.nickName
doPlayerSendTextMessage(cid, 27, "You have unlocked ".. name ..". Earned ".. info.experience .." experience.")
doSendMagicEffect(pos, 209)
sendPokedex(cid, info.id)
else
sendPokedex(cid, info.id, true)
end
end
function onUse(cid, item, fromPos, itemEx, toPos)
if(isMonster(itemEx.uid))then
local pos = getCreaturePosition(cid)
if(getDistanceBetween(pos, toPos) > 3)then
doPlayerSendCancel(cid, "Too far away.")
return true
end
local name = getCreatureName(itemEx.uid, true)
local info = getMonsterInfo(itemEx.uid)
if(isSummon(itemEx.uid) and itemEx.uid ~= getPokemon(cid) and getPlayerLevel(cid) < info.level) then
doPlayerSendTextMessage(cid, 27, "It's only possible to unlock trainer's pokemons if your level is higher than pokemons level.")
end
unlockPokedex(cid, info, pos)
end
return true
end
Não sei como funciona essa function, tenta trocar sua lib por isso:
function onTargetBurning(cid, target)
Edited Março 31 by Techrlz




info
Group: Herói
Joined: 12/06/12
Posts: 2.2k
Reputation: +739
Gender: Masculino
Tibia Character: Supreme Player
Bom Galera estava editando meu servidor ai me deparei com esse erro e como não manjo em Spells vim pedir a ajuda de vocês , então segue ai o erro e o seu Script :
Erro:
[Erros - Attacks Interface] data/attacks/scripts/normal/harden.lua:onSay Description: data/attacks/lib/lib.lua:65: attempt to call global 'getSelectedCreature' <a nil value> Stack traceback: data/attacks/lib/lib.lua:65: in function 'geTargetBuff' data/attacks/scripts/normal/harden.lua:11: in function <data/attacks/scripts/normal/Harden.lua:9>Script do Harden.lua
function onCreatureHarden(cid)
doBuff(cid, cid, "Harden", 1000, 8, {value=120})
return true
end
local attack = createAttackObject()
setAttackParams(attack, ATTACK_ON_CREATURE, onCreatureHarden)
function onSay(cid, var)
if check(cid, false) then return false end
cid = getTargetBuff(cid, 3)
if(not cid) then
return false
end
doAttack(cid, attack, var)
return true
end
e do Lib.lua da minha pasta Attacks:
function onTargetBurning(cid, target)
local master = getCreatureMaster(target)
if(isPlayer(master)) then
local vocation = getPlayerVocationId(master)
if(isInArray(noBurn_vocations, vocation)) then
return true
end
end
local power = math.min((getCreatureLevel(cid) + 15) / 2.5, 40)
doBuff(target, cid, "burn", 2000, math.random(4, 8), {value=power})
return true
end
function onTargetStrongBurning(cid, target)
local master = getCreatureMaster(target)
if(isPlayer(master)) then
local vocation = getPlayerVocationId(master)
if(isInArray(noBurn_vocations, vocation)) then
return true
end
end
local power = math.min((getCreatureLevel(cid) + 20) / 1.8, 75)
doBuff(target, cid, "burn", 2000, math.random(4, 8), {value=power})
return true
end
function onTargetPoison(cid, target)
local master = getCreatureMaster(target)
if(isPlayer(master)) then
local vocation = getPlayerVocationId(master)
if(isInArray(noPoison_vocations, vocation)) then
return true
end
end
local power = math.min((getCreatureLevel(cid) + 15) / 2.5, 40)
doBuff(target, cid, "poison", 2000, math.random(4, 8), {value=power})
return true
end
function onTargetStrongPoison(cid, target)
local master = getCreatureMaster(target)
if(isPlayer(master)) then
local vocation = getPlayerVocationId(master)
if(isInArray(noPoison_vocations, vocation)) then
return true
end
end
local power = math.min((getCreatureLevel(cid) + 20) / 1.8, 75)
doBuff(target, cid, "poison", 1500, 15, {value=power})
return true
end
--[[-------------------------------------------------------------------------------------------------]]--
function getTargetBuff(cid, distance)
local master = getCreatureMaster(cid)
if(isPlayer(master) == false) then
return cid
end
local selected = getSelectedCreature(master)
if(isCreature(selected) == false) then
return cid
end
if(check(cid, true, distance, selected)) then
return false
end
return selected
end
function squareShoot(cid, shoot, effect)
if(isCreature(cid) == false) then
return true
end
local tmp = getCreaturePosition(cid)
local tmp2 = {{x=tmp.x-1, y=tmp.y, z=tmp.z}, {x=tmp.x, y=tmp.y+1, z=tmp.z}}
local tmp3 = {{x=tmp.x, y=tmp.y+1, z=tmp.z}, {x=tmp.x+1, y=tmp.y, z=tmp.z}}
local tmp4 = {{x=tmp.x+1, y=tmp.y, z=tmp.z}, {x=tmp.x, y=tmp.y-1, z=tmp.z}}
local tmp5 = {{x=tmp.x, y=tmp.y-1, z=tmp.z}, {x=tmp.x-1, y=tmp.y, z=tmp.z}}
doSendDistanceShoot(tmp2[1], tmp2[2], shoot)
doSendDistanceShoot(tmp3[1], tmp3[2], shoot)
doSendDistanceShoot(tmp4[1], tmp4[2], shoot)
doSendDistanceShoot(tmp5[1], tmp5[2], shoot)
if(effect) then
doSendMagicEffect(tmp2[2], effect)
doSendMagicEffect(tmp3[2], effect)
doSendMagicEffect(tmp4[2], effect)
doSendMagicEffect(tmp5[2], effect)
end
end
Outra spell que tem erro é a rage , segue o erro \/
[Erros - Attacks Interface] data/attacks/scripts/normal/Rage.lua:onSay Description: data/attacks/lib/lib.lua:65: attempt to call global 'getSelectedCreature' <a nil value> Stack traceback: data/attacks/lib/lib.lua:65: in function 'geTargetBuff' data/attacks/scripts/normal/Rage.lua:11: in function <data/attacks/scripts/normal/Rage.lua:9>/\ Parece ser o mesmo tipo de erro .
Outra spell bugada é a Agility segue o erro \/
[Erros - Attacks Interface] data/attacks/scripts/psychic/Agility.lua:onSay Description: data/attacks/lib/lib.lua:65: attempt to call global 'getSelectedCreature' <a nil value> Stack traceback: data/attacks/lib/lib.lua:65: in function 'geTargetBuff' data/attacks/scripts/psychic/Agility.lua:11: in function <data/attacks/scripts/psychic/Agility.lua:9>e mais uma vez o mesmo tipo de erro '-'
é galera por enquanto é esses erros , obrigado ai para quem ajudar , rep+ ;3