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...
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
Testa aê.







info
Grupo: Infante
Registrado: 27/08/11
Posts: 1.9k
Reputação: +85
Gênero: Masculino
Char no Tibia: Bruno Maciel
Estou com um bug na passiva !!
BUG
SCRIPT
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
Rep++