Queria saber oque ta acontecendo que esta dando o seguinte erro :
[25/04/2013 22:22:24] [Error - Spell Interface]
[25/04/2013 22:22:24] data/spells/scripts/passivas/megadrain.lua:onCastSpell
[25/04/2013 22:22:24] Description:
[25/04/2013 22:22:24] data/spells/scripts/passivas/megadrain.lua:14: attempt to call global 'getWildPokemonLevel' (a nil value)
[25/04/2013 22:22:24] stack traceback:
[25/04/2013 22:22:25] data/spells/scripts/passivas/megadrain.lua:14: in function <data spells="" scripts="" passivas="" megadrain.lua:12="">
esse é o script da spell :
arr = {
{0, 0, 0, 0, 0},
{0, 1, 1, 1, 0},
{0, 1, 2, 1, 0},
{0, 1, 1, 1, 0},
{0, 0, 0, 0, 0}
}
local mega = {"Oddish", "Gloom", "Vileplume", "Kabuto", "Kabutops", "Parasect", "Tangela", "Shiny Oddish",
"Shiny Gloom", "Shiny Vileplume", "Shiny Kabuto", "Shiny Kabutops", "Shiny Parasect", "Shiny Tangela"}
function onCastSpell(cid, var)
local min = getWildPokemonLevel(cid)*10 --nao sei como funciona o sistema de dano...
local max = getWildPokemonLevel(cid)*15 --nao sei como funciona o sistema de dano...
if isCreature(cid) then
local name = getCreatureName(cid)
if isInArray(mega, name) then
if math.random(1, 100) <= 20 then -- Porcentagem de chance pro poke usar a passiva... 20 = 20%
local uid = checkAreaUid(getThingPos(cid), arr, 1, 1)
for _,pid in pairs(uid) do
if isCreature(pid) then
if getCreatureTarget(pid) == cid then
local hp = getCreatureHealth(pid)
local drain = choose(min, max)
if hp-drain >= 1 then
doCreatureAddHealth(pid, -drain)
doCreatureAddHealth(cid, drain)
doSendAnimatedText(getThingPos(pid), "-"..drain.."", 144)
doSendAnimatedText(getThingPos(cid), "+"..drain.."", 32)
end
end
end
end
end
end
end
end
</data>