local poke = {"Espeon", "Shiny Xatu", "Jynx", "Shiny Jynx", "Xatu", "Natu", "Exeggutor", "Slowking", "Slowbro", "Shiny Mr. Mime", 'Mew', 'Mewtwo', 'Abra', 'Kadabra', 'Alakazam', 'Drowzee', 'Hypno', 'Mr. Mime', 'Porygon', 'Shiny Abra', 'Shiny Alakazam',
'Shiny Hypno', 'Porygon2'} --alterado v1.9
local etele = 9499
local cdtele = 16
local config = {
premium = true, -- se precisa ser premium account (true or false)
battle = true -- se precisa estar sem battle (true). Se colocar false, poderá usar teleport no meio de batalhas
}
local places = {
[1] = {name = "Seelan", id = 1, sto = 87530},
[3] = {name = "Oddiy", id = 3, sto = 87531},
[4] = {name = "Flamy", id = 4, sto = 87532},
[5] = {name = "Desert", id = 5, sto = 87533},
[2] = {name = "Glacy", id = 2, sto = 87534},
[6] = {name = "Coliseu", id = 6, sto = 87535},
}
function onSay(cid, words, param)
if #getCreatureSummons(cid) == 0 then
doPlayerSendCancel(cid, "You need a pokemon to use teleport.")
return true
end
if not isInArray(poke, getCreatureName(getCreatureSummons(cid)[1])) then
return 0
end
if getPlayerStorageValue(cid, 22545) == 1 then --golden arena
doPlayerSendCancel(cid, "You can't do that while the golden arena!")
return true
end
if getPlayerStorageValue(cid, 212124) >= 1 then --alterado v2.6
return doPlayerSendCancel(cid, "You can't do it with a pokemon with mind controlled!")
end
if getPlayerStorageValue(cid, 52480) >= 1 then
return doPlayerSendCancel(cid, "You can't do it while a duel!") --alterado v2.6
end
if exhaustion.get(cid, etele) and exhaustion.get(cid, etele) > 0 then
local tempo = tonumber(exhaustion.get(cid, etele)) or 0
local min = math.floor(tempo)
doPlayerSendCancel(cid, "Seu pokemon está cansado, espere "..getStringmytempo(tempo).."Para Teleportar de novo.")
return true
end
if config.premium and not isPremium(cid) then
doPlayerSendCancel(cid, "Somente os membros premium podem usar o teletransporte.")
return true
end
if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Seu pokémon nao pode se concentrar durante as batalhas.")
return true
end
if (param == '') then
local str = ""
str = str .. "Lugares para ir :\n\nHouse\n"
for a = 1, #places do
str = str..""..string.lower(places[a].name).."\n"
end
doShowTextDialog(cid, 7416, str)
return true
end
local item = getPlayerSlotItem(cid, ?
local nome = getPokeballName(item.uid)
local summon = getCreatureSummons(cid)[1]
local lastppos = getThingPos(cid)
local lastspos = getThingPos(summon)
local telepos = {}
local myplace = ""
local townid = 0
if string.lower(param) == "house" then
if not getHouseByPlayerGUID(getPlayerGUID(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Voce nao possui uma casa.")
return true
end
telepos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))
myplace = "nosso Lar"
else
for x = 1, #places do
if string.find(string.lower(places[x].name), string.lower(param)) then
townid = places[x].id
myplace = places[x].name
end
end
if myplace == "" then
doPlayerSendCancel(cid, "Esse lugar nao existe.")
return true
end
end
if myplace ~= "" and townid > 0 then
telepos = getTownTemplePosition(townid)
end
doSendMagicEffect(getThingPos(summon), 29)
doSendMagicEffect(getThingPos(cid), 29)
doReturnPokemon(cid, summon, item, 0)
doTeleportThing(cid, telepos, false)
local pos2 = getClosestFreeTile(cid, getPosByDir(getThingPos(cid), SOUTH))
--doTeleportThing(summon, pos2, false)
--doSendMagicEffect(getThingPos(cid), 29)
doCreatureSay(cid, ""..nome..", teleport to "..myplace.."!", TALKTYPE_ORANGE_1)
doCreatureSay(cid, ""..nome..", teleport to "..myplace.."!", TALKTYPE_ORANGE_1, false, 0, lastppos)
doCreatureSetLookDir(cid, SOUTH)
exhaustion.set(cid, etele, cdtele)
return true
end