Ir para conteúdo

[Encerrado] [BUG] Teleport


leandropamgomes

Posts Recomendados

Eai galerinha do xtibia, estou com um bug no teleport, quando ligo o servidor aparece isso:

 

 

[10/12/2013 20:19:50] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/tele.lua:22: unexpected symbol near '['

[10/12/2013 20:19:50] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/tele.lua)
[10/12/2013 20:19:50] data/talkactions/scripts/tele.lua:22: unexpected symbol near '['
[10/12/2013 20:19:50] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/tele.lua:22: unexpected symbol near '['
[10/12/2013 20:19:50] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/tele.lua)
[10/12/2013 20:19:50] data/talkactions/scripts/tele.lua:22: unexpected symbol near '['
[10/12/2013 20:19:50] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/tele.lua:22: unexpected symbol near '['
[10/12/2013 20:19:50] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/tele.lua)
[10/12/2013 20:19:50] data/talkactions/scripts/tele.lua:22: unexpected symbol near '['

Aqui em baixo está meu data/talkactions/scripts/tele.lua.

local poke = {"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 = 1800
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 = "Saffron", id = 1, sto = 897530},
[2] = {name = "Cerulean", id = 2, sto = 897531},
[3] = {name = "Celadon", id = 3, sto = 897532},
[4] = {name = "Vermilion", id = 4, sto = 897533},
[5] = {name = "Fuchsia", id = 5, sto = 897534},
[6] = {name = "Lavender", id = 6, sto = 897535}, --alterado v1.7
[7] = {name = "Cinnabar", id = 7, sto = 897536},
[8] = {name = "Viridian", id = 8, sto = 897537},
[9] = {name = "Pewter", id = 9}, sto = 897538},
[10] = {name = "Coliseum", id = 10, sto = 897540},
[11] = {name = "Pallet", id = 11,
[12] = {name = "Hamlin", id = 14, sto = 897541},
}
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, Agatha.stoIni) >= 1 and getPlayerStorageValue(cid, Agatha.stoIni) < 50 then --alterado v1.9
doPlayerSendCancel(cid, "You can't do that here!")
return true
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 v1.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 v1.6
end
if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then
return doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7
end
if config.premium and not isPremium(cid) then
doPlayerSendCancel(cid, "Only premium members are allowed to use teleport.")
return true
end
if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Your pokemon can't concentrate during battles.")
return true
end
if (param == '') then
local str = ""
str = str .. "Places to go :\n\nHouse\n"
for a = 1, #places do
str = str..""..places[a].name.."\n"
end
doShowTextDialog(cid, 7416, str)
return true
end
local item = getPlayerSlotItem(cid, 8)
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
local citySto = 0 --alterado v1.7
if string.lower(param) == "house" then
if not getHouseByPlayerGUID(getPlayerGUID(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You don't own a house.")
return true
end
telepos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))
myplace = "our home"
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
citySto = places[x].sto or -1 --alterado v1.7
end
end
if myplace == "" then
doPlayerSendCancel(cid, "That place doesn't exist.")
return true
end
end
if myplace ~= "" and townid > 0 then
telepos = getTownTemplePosition(townid)
end
if getDistanceBetween(getThingPos(cid), telepos) <= 15 then
doPlayerSendCancel(cid, "You are too near to the place you want to go!")
return true
end
doSendMagicEffect(getThingPos(summon), 29)
doSendMagicEffect(getThingPos(cid), 29)
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.."!", 1)
doCreatureSay(cid, ""..nome..", teleport to "..myplace.."!", 1, false, 0, lastppos)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER, false, 0, lastspos)
doCreatureSetLookDir(cid, SOUTH)
doCreatureSetLookDir(summon, SOUTH)
doSendMagicEffect(getThingPos(summon), CONST_ME_TELEPORT)
return true
end

Ajude-me por favor.
Editado por leandropamgomes
Link para o comentário
Compartilhar em outros sites

Aqui:

 

 

local poke = {"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 = 1800
 
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 = "Saffron", id = 1, sto = 897530},
[2] = {name = "Cerulean", id = 2, sto = 897531},
[3] = {name = "Celadon", id = 3, sto = 897532},
[4] = {name = "Vermilion", id = 4, sto = 897533},
[5] = {name = "Fuchsia", id = 5, sto = 897534},
[6] = {name = "Lavender", id = 6, sto = 897535},  --alterado v1.7
[7] = {name = "Cinnabar", id = 7, sto = 897536},
[8] = {name = "Viridian", id = 8, sto = 897537},          
[9] = {name = "Pewter", id = 9, sto = 897538},
[10] = {name = "Coliseum", id = 10, sto = 897540},
[11] = {name = "Pallet", id = 11,
[12] = {name = "Hamlin", id = 14, sto = 897541},
}
 
 
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, Agatha.stoIni) >= 1 and getPlayerStorageValue(cid, Agatha.stoIni) < 50 then --alterado v1.9
  doPlayerSendCancel(cid, "You can't do that here!")
    return true
    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 v1.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 v1.6
    end
    
    if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then 
  return doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!")   --alterado v1.7
    end
   
 
if config.premium and not isPremium(cid) then
doPlayerSendCancel(cid, "Only premium members are allowed to use teleport.")
return true
end
 
if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Your pokemon can't concentrate during battles.")
return true
end
 
if (param == '') then
local str = ""
str = str .. "Places to go :\n\nHouse\n"
for a = 1, #places do
str = str..""..places[a].name.."\n"
end
doShowTextDialog(cid, 7416, str)
return true
end
 
local item = getPlayerSlotItem(cid, 8)
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
local citySto = 0  --alterado v1.7
 
if string.lower(param) == "house" then
 
if not getHouseByPlayerGUID(getPlayerGUID(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You don't own a house.")
return true
end
 
telepos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))
myplace = "our home"
 
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
citySto = places[x].sto or -1  --alterado v1.7
end
end
 
if myplace == "" then
doPlayerSendCancel(cid, "That place doesn't exist.")
return true
end
 
end
 
if myplace ~= "" and townid > 0 then
telepos = getTownTemplePosition(townid)
end
 
 
if getDistanceBetween(getThingPos(cid), telepos) <= 15 then
doPlayerSendCancel(cid, "You are too near to the place you want to go!")
return true
end
 
doSendMagicEffect(getThingPos(summon), 29)
doSendMagicEffect(getThingPos(cid), 29)
 
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.."!", 1)
doCreatureSay(cid, ""..nome..", teleport to "..myplace.."!", 1, false, 0, lastppos)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER, false, 0, lastspos)
 
doCreatureSetLookDir(cid, SOUTH)
doCreatureSetLookDir(summon, SOUTH)
 
doSendMagicEffect(getThingPos(summon), CONST_ME_TELEPORT)
 
 
return true
end

 

 

Editado por zipter98
Link para o comentário
Compartilhar em outros sites

Voce esqueceu de por um "}" na linha 22.. Aqui segue o script arrumado

 

 

 

local poke = {"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 = 1800
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 = "Saffron", id = 1, sto = 897530},
[2] = {name = "Cerulean", id = 2, sto = 897531},
[3] = {name = "Celadon", id = 3, sto = 897532},
[4] = {name = "Vermilion", id = 4, sto = 897533},
[5] = {name = "Fuchsia", id = 5, sto = 897534},
[6] = {name = "Lavender", id = 6, sto = 897535}, --alterado v1.7
[7] = {name = "Cinnabar", id = 7, sto = 897536},
[8] = {name = "Viridian", id = 8, sto = 897537},
[9] = {name = "Pewter", id = 9, sto = 897538},
[10] = {name = "Coliseum", id = 10, sto = 897540},
[11] = {name = "Pallet", id = 11},
[12] = {name = "Hamlin", id = 14, sto = 897541},
}
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, Agatha.stoIni) >= 1 and getPlayerStorageValue(cid, Agatha.stoIni) < 50 then --alterado v1.9
doPlayerSendCancel(cid, "You can't do that here!")
return true
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 v1.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 v1.6
end
if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then
return doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7
end
if config.premium and not isPremium(cid) then
doPlayerSendCancel(cid, "Only premium members are allowed to use teleport.")
return true
end
if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Your pokemon can't concentrate during battles.")
return true
end
if (param == '') then
local str = ""
str = str .. "Places to go :\n\nHouse\n"
for a = 1, #places do
str = str..""..places[a].name.."\n"
end
doShowTextDialog(cid, 7416, str)
return true
end
local item = getPlayerSlotItem(cid, 8)
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
local citySto = 0 --alterado v1.7
if string.lower(param) == "house" then
if not getHouseByPlayerGUID(getPlayerGUID(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You don't own a house.")
return true
end
telepos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))
myplace = "our home"
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
citySto = places[x].sto or -1 --alterado v1.7
end
end
if myplace == "" then
doPlayerSendCancel(cid, "That place doesn't exist.")
return true
end
end
if myplace ~= "" and townid > 0 then
telepos = getTownTemplePosition(townid)
end
if getDistanceBetween(getThingPos(cid), telepos) <= 15 then
doPlayerSendCancel(cid, "You are too near to the place you want to go!")
return true
end
doSendMagicEffect(getThingPos(summon), 29)
doSendMagicEffect(getThingPos(cid), 29)
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.."!", 1)
doCreatureSay(cid, ""..nome..", teleport to "..myplace.."!", 1, false, 0, lastppos)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER, false, 0, lastspos)
doCreatureSetLookDir(cid, SOUTH)
doCreatureSetLookDir(summon, SOUTH)
doSendMagicEffect(getThingPos(summon), CONST_ME_TELEPORT)
return true
end

 

 


Se voce olhar tambem voce esqueceu de por o Storage da vocation 11 na linha 23

 [11] = {name = "Pallet", id = 11},
Editado por kaizy536
Link para o comentário
Compartilhar em outros sites

TENTE ESSA AQUI AMIGO!

 

 

local poke = {"Shiny Mr. Mime", 'Mew', 'Mewtwo', 'Abra', 'Kadabra', 'Alakazam', 'Drowzee', 'Hypno', 'Mr. Mime', 'Porygon', 'Shiny Abra', 'Shiny Alakazam',
'Shiny Hypno', 'Porygon2'}
local etele = 9499
local cdtele = 1800
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 = "Saffron", id = 1, sto = 897530},
[2] = {name = "Cerulean", id = 2, sto = 897531},
[3] = {name = "Celadon", id = 3, sto = 897532},
[4] = {name = "Vermilion", id = 4, sto = 897533},
[5] = {name = "Fuchsia", id = 5, sto = 897534},
[6] = {name = "Lavender", id = 6, sto = 897535}, --alterado v1.7
[7] = {name = "Cinnabar", id = 7, sto = 897536},
[8] = {name = "Viridian", id = 8, sto = 897537},
[9] = {name = "Pewter", id = 9}, sto = 897538},
[10] = {name = "Coliseum", id = 10, sto = 897540},
[11] = {name = "Pallet", id = 11},
[12] = {name = "Hamlin", id = 14, sto = 897541},
}
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, Agatha.stoIni) >= 1 and getPlayerStorageValue(cid, Agatha.stoIni) < 50 then --alterado v1.9
doPlayerSendCancel(cid, "You can't do that here!")
return true
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 v1.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 v1.6
end
if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then
return doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7
end
if config.premium and not isPremium(cid) then
doPlayerSendCancel(cid, "Only premium members are allowed to use teleport.")
return true
end
if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Your pokemon can't concentrate during battles.")
return true
end
if (param == '') then
local str = ""
str = str .. "Places to go :\n\nHouse\n"
for a = 1, #places do
str = str..""..places[a].name.."\n"
end
doShowTextDialog(cid, 7416, str)
return true
end
local item = getPlayerSlotItem(cid, 8)
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
local citySto = 0 --alterado v1.7
if string.lower(param) == "house" then
if not getHouseByPlayerGUID(getPlayerGUID(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You don't own a house.")
return true
end
telepos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))
myplace = "our home"
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
citySto = places[x].sto or -1 --alterado v1.7
end
end
if myplace == "" then
doPlayerSendCancel(cid, "That place doesn't exist.")
return true
end
end
if myplace ~= "" and townid > 0 then
telepos = getTownTemplePosition(townid)
end
if getDistanceBetween(getThingPos(cid), telepos) <= 15 then
doPlayerSendCancel(cid, "You are too near to the place you want to go!")
return true
end
doSendMagicEffect(getThingPos(summon), 29)
doSendMagicEffect(getThingPos(cid), 29)
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.."!", 1)
doCreatureSay(cid, ""..nome..", teleport to "..myplace.."!", 1, false, 0, lastppos)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER, false, 0, lastspos)
doCreatureSetLookDir(cid, SOUTH)
doCreatureSetLookDir(summon, SOUTH)
doSendMagicEffect(getThingPos(summon), CONST_ME_TELEPORT)
return true
end

 

 

Editado por Cyphos
Link para o comentário
Compartilhar em outros sites

deve tar certo tava faltando a storage da city

 

local poke = {"Shiny Mr. Mime", 'Mew', 'Mewtwo', 'Abra', 'Kadabra', 'Alakazam', 'Drowzee', 'Hypno', 'Mr. Mime', 'Porygon', 'Shiny Abra', 'Shiny Alakazam',
'Shiny Hypno', 'Porygon2'}

local etele = 9499
local cdtele = 1800

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 = "Saffron", id = 1, sto = 897530},
[2] = {name = "Cerulean", id = 2, sto = 897531},
[3] = {name = "Celadon", id = 3, sto = 897532},
[4] = {name = "Vermilion", id = 4, sto = 897533},
[5] = {name = "Fuchsia", id = 5, sto = 897534},
[6] = {name = "Lavender", id = 6, sto = 897535}, --alterado v1.7
[7] = {name = "Cinnabar", id = 7, sto = 897536},
[8] = {name = "Viridian", id = 8, sto = 897537},
[9] = {name = "Pewter", id = 9}, sto = 897538},
[10] = {name = "Coliseum", id = 10, sto = 897540},
[11] = {name = "Pallet", id = 11, sto = 897539},
[12] = {name = "Hamlin", id = 12, sto = 897541},
}


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, Agatha.stoIni) >= 1 and getPlayerStorageValue(cid, Agatha.stoIni) < 50 then --alterado v1.9
doPlayerSendCancel(cid, "You can't do that here!")
return true
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 v1.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 v1.6
end

if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then
return doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7
end


if config.premium and not isPremium(cid) then
doPlayerSendCancel(cid, "Only premium members are allowed to use teleport.")
return true
end

if config.battle and getCreatureCondition(cid, CONDITION_INFIGHT) then
doPlayerSendCancel(cid, "Your pokemon can't concentrate during battles.")
return true
end

if (param == '') then
local str = ""
str = str .. "Places to go :\n\nHouse\n"
for a = 1, #places do
str = str..""..places[a].name.."\n"
end
doShowTextDialog(cid, 7416, str)
return true
end

local item = getPlayerSlotItem(cid, 8)
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
local citySto = 0 --alterado v1.7

if string.lower(param) == "house" then

if not getHouseByPlayerGUID(getPlayerGUID(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "You don't own a house.")
return true
end

telepos = getHouseEntry(getHouseByPlayerGUID(getPlayerGUID(cid)))
myplace = "our home"

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
citySto = places[x].sto or -1 --alterado v1.7
end
end

if myplace == "" then
doPlayerSendCancel(cid, "That place doesn't exist.")
return true
end

end

if myplace ~= "" and townid > 0 then
telepos = getTownTemplePosition(townid)
end


if getDistanceBetween(getThingPos(cid), telepos) <= 15 then
doPlayerSendCancel(cid, "You are too near to the place you want to go!")
return true
end

doSendMagicEffect(getThingPos(summon), 29)
doSendMagicEffect(getThingPos(cid), 29)

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.."!", 1)
doCreatureSay(cid, ""..nome..", teleport to "..myplace.."!", 1, false, 0, lastppos)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER)
doCreatureSay(summon, "TELEPORT!", TALKTYPE_MONSTER, false, 0, lastspos)

doCreatureSetLookDir(cid, SOUTH)
doCreatureSetLookDir(summon, SOUTH)

doSendMagicEffect(getThingPos(summon), CONST_ME_TELEPORT)


return true
end

 

Link para o comentário
Compartilhar em outros sites

  • 4 years later...
A questão neste tópico de suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...