GA

[ERRO] Spells

Por Gabrieltxu, 18 de mar. de 2014 em Archived

erro
script
7
841
GabrieltxuG
18 de março de 2014 às 21:10

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

TechrlzT
18 de março de 2014 às 21:13

ve pvt gabriel

SlicerS
18 de março de 2014 às 22:30

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'

Editado Março 18 por Slicer

GabrieltxuG
18 de março de 2014 às 23:31

/\ 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 ???

Editado Março 18 por Gabrieltxu

SlicerS
19 de março de 2014 às 08:51

hã... provavelmente as outras n usam essa funçao q ta faltando? --' vo nem comenta heim...

GabrieltxuG
19 de março de 2014 às 19:11

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 \/

 

 

 

rAl2E63.jpg

 

 

 

 

Outra as informações do Pokémon fica no proprio xml dele segue esse exemplo \/

 

 

 

 

 

<pokemon id="46" name="Paras" experience="40" speed="150">
<look type="81" corpse="3007"/>
<types first="Bug" second="Grass"/>
<pokedex description="Burrows to suck tree roots. The mushrooms on its back grow by drawing nutrients from the bug host."/>
<portraits droped="8024" hided="8242" portrait="11283"/>
<flags>
<flag pushable="1"/>
<flag targetdistance="1"/>
<flag nonAgresive="1"/>
</flags>
<abilites>
<cut/>
<dig/>
</abilites>
<evolutions>
<evo name="Parasect"/>
</evolutions>
<fist min="9" max="12" type="Bug" effect="16"/>
<statistics level="5" prize="60" gender="500" shinyCard="12247"/>
<statistics attack="58" defense="55" vitality="35" speed="25"/>
<attack id="1" name="Scratch"/>
<attack id="2" name="Stun Spore"/>
<attack id="3" name="Poison Powder" level="5"/>
<attack id="4" name="Leech Life" level="8"/>
<loot>
<item name="Mushroom" chance="5.23"/>
<item name="Seed" count="25" chance="36.26"/>
<item name="Bottle of Moss Bug" chance="6.03"/>
<item name="Paras Card" chance="0.29"/>
</loot>
</pokemon>

 

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

 

2 semanas depois...
TechrlzT
31 de março de 2014 às 12:38

Não sei como funciona essa function, tenta trocar sua lib por isso:

 

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 = getCreatureTarget(cid)
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

ou isso:

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 = getCreatureTarget(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

Editado Março 31 por Techrlz