local evo = {
["Caterpie"] = "metapod",
["Metapod"] = "butterfree",
["Venonate"] = "venomoth",
["Oddish"] = "gloom",
["Gloom"] = "vileplume",
["Bulbasaur"] = "ivysaur",
["Ivysaur"] = "venusaur",
["Bellsprout"] = "weepinbell",
["Weepinbell"] = "victreebel",
[""] = "",
[""] = "",
[""] = "",
[""] = "",
[""] = "",
[""] = "",
[""] = "",
}
local pokeballs = {
[2531] = {"Pokeball"},
[2557] = {"Superball"},
[2524] = {"Greatball"},
[2525] = {"Ultraball"},
[2523] = {"Masterball"},
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isMonster(itemEx.uid) and getCreatureMaster(itemEx.uid) == cid then
local monster = getCreatureName(itemEx.uid)
if evo[monster] then
local health, maxHealth = getCreatureHealth(itemEx.uid), getCreatureMaxHealth(itemEx.uid)
doRemoveCreature(itemEx.uid)
doRemoveItem(item.uid)
local summon = doCreateMonster(evo[monster], toPosition)
doConvinceCreature(cid, summon)
local balls = pokeballs[getPlayerSlotItem(cid,8).itemid]
doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "name", ""..evo[monster].." "..balls[1])
doCreatureAddHealth(summon, health-maxHealth)
doSendMagicEffect(getThingPos(summon), 18)
return TRUE
end
end
return FALSE
end