Deve ter o código dos pokes iniciais, você tem? O script.
- Forums
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] [AJUDA] Pokes iniciais
[Encerrado] [AJUDA] Pokes iniciais
By rauanv, 11 de mai. de 2013 in Tópicos Sem Resposta
info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino

O que ta no starter.lua é isso
local starterpokes = {
["Bulbasaur"] = {x = 45, y = 70, z = 7},
["Charmander"] = {x = 43, y = 70, z = 7},
["Squirtle"] = {x = 47, y = 70, z = 7},
["Chikorita"] = {x = 51, y = 70, z = 7}, --alterado 2.7 -soh pegue se for usar o mapa do stigal!-
["Totodile"] = {x = 53, y = 70, z = 7},
["Cyndaquil"] = {x = 49, y = 70, z = 7},
}
local level = 5
local extrastr = 1.5
local btype = "normal"
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) > 10 then
return true
end
local pokemon = ""
for a, b in pairs (starterpokes) do
if isPosEqualPos(topos, b) then
pokemon = a
end
end
if pokemon == "" then return true end
if getPlayerStorageValue(cid, 9658754) ~= 1 then
sendMsgToPlayer(cid, 27, "Talk to the Prof. Robert to choose your beginner city first!")
return true
end
local gender = getRandomGenderByName(pokemon)
local mypoke = getPokemonStatus(pokemon)
if not mypoke then return true end
local offense = mypoke.off * level * extrastr
local defense = mypoke.def * level * extrastr
local speed = mypoke.agi * level * extrastr
local vit = mypoke.vit * level * extrastr
local spatk = mypoke.spatk * level * extrastr
local happy = 180
local leveltable = getPokemonExperienceTable(pokemon)
doPlayerAddItem(cid, 2394, 10)
local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", pokemon)
doItemSetAttribute(item, "hp", 1)
doItemSetAttribute(item, "level", level)
doItemSetAttribute(item, "exp", leveltable[level])
doItemSetAttribute(item, "nextlevelexp", leveltable[level+1] - leveltable[level])
doItemSetAttribute(item, "offense", offense)
doItemSetAttribute(item, "defense", defense)
doItemSetAttribute(item, "speed", speed)
doItemSetAttribute(item, "vitality", vit)
doItemSetAttribute(item, "specialattack", spatk)
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
doItemSetAttribute(item, "description", "Contains a "..pokemon..".")
doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".")
doItemSetAttribute(item, "unique", getCreatureName(cid)) --alterado v2.6
doPlayerAddItemEx(cid, item, true)
doTransformItem(item, pokeballs[btype].on)
doPlayerSendTextMessage(cid, 27, "You got your first pokemon! You also received some pokeballs to help you in your way.")
doPlayerSendTextMessage(cid, 27, "Don\'t forget to use your pokedex on every undiscovered pokemon!")
doSendMagicEffect(getThingPos(cid), 29)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(cid), 27)
doSendMagicEffect(getThingPos(cid), 29)
return TRUE
end
E ja tentei procurar id dos pokemons para tentar colocar no bau pelo remeres, mas nao achei !!
info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino

Abre o actions.xml com o bloco de notas e cole isso dentro:
<action uniqueid="15309" event="script" value="starter.lua"/>
Aí no map editor, você põe UNIQUE ID 15309 no baú.
é pra colocar em todos os baus esse uniqueID ?
______________
Não Deu certo
Edited Maio 11 by rauanv
info
Group: Herói
Joined: 14/12/10
Posts: 3.6k
Reputation: +846
Gender: Masculino

Tem mais de um baú é? Tem que reiniciar o server cara!
Edited Maio 11 by Roksas
Tem po kkk são os baus iniciais
Charmander
Squirtle
Bulbasaur
Chikorita
Cyndaquil
Totodile
Vou reiniciar, mudar o config.lua de novo, e ver se deu certo !
Mano, não deu certo, eu exclui a pasta toda, arrumei o config.lua, e os baus ainda estão vazios
Edited Maio 11 by rauanv
info
Group: Visconde
Joined: 07/02/12
Posts: 427
Reputation: +112

local starterpokes = {
["Bulbasaur"] = {x = 45, y = 70, z = 7},
["Charmander"] = {x = 43, y = 70, z = 7},
["Squirtle"] = {x = 47, y = 70, z = 7},
["Chikorita"] = {x = 51, y = 70, z = 7}, --alterado 2.7 -soh pegue se for usar o mapa do stigal!-
["Totodile"] = {x = 53, y = 70, z = 7},
["Cyndaquil"] = {x = 49, y = 70, z = 7},
}
local level = 5
local extrastr = 1.5
local btype = "normal"
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) > 10 then
return true
end
local pokemon = ""
for a, b in pairs (starterpokes) do
if isPosEqualPos(topos, b) then
pokemon = a
end
end
if pokemon == "" then return true end
if getPlayerStorageValue(cid, 9658754) ~= 1 then
sendMsgToPlayer(cid, 27, "Talk to the Prof. Robert to choose your beginner city first!")
return true
end
local gender = getRandomGenderByName(pokemon)
local mypoke = getPokemonStatus(pokemon)
if not mypoke then return true end
local offense = mypoke.off * level * extrastr
local defense = mypoke.def * level * extrastr
local speed = mypoke.agi * level * extrastr
local vit = mypoke.vit * level * extrastr
local spatk = mypoke.spatk * level * extrastr
local happy = 180
local leveltable = getPokemonExperienceTable(pokemon)
doPlayerAddItem(cid, 2394, 10)
local item = doCreateItemEx(2219)
doItemSetAttribute(item, "poke", pokemon)
doItemSetAttribute(item, "hp", 1)
doItemSetAttribute(item, "level", level)
doItemSetAttribute(item, "exp", leveltable[level])
doItemSetAttribute(item, "nextlevelexp", leveltable[level+1] - leveltable[level])
doItemSetAttribute(item, "offense", offense)
doItemSetAttribute(item, "defense", defense)
doItemSetAttribute(item, "speed", speed)
doItemSetAttribute(item, "vitality", vit)
doItemSetAttribute(item, "specialattack", spatk)
doItemSetAttribute(item, "happy", happy)
doItemSetAttribute(item, "gender", gender)
doItemSetAttribute(item, "description", "Contains a "..pokemon..".")
doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".")
doItemSetAttribute(item, "unique", getCreatureName(cid)) --alterado v2.6
doPlayerAddItemEx(cid, item, true)
doTransformItem(item, pokeballs[btype].on)
doPlayerSendTextMessage(cid, 27, "You got your first pokemon! You also received some pokeballs to help you in your way.")
doPlayerSendTextMessage(cid, 27, "Don\'t forget to use your pokedex on every undiscovered pokemon!")
doSendMagicEffect(getThingPos(cid), 29)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getThingPos(cid), 27)
doSendMagicEffect(getThingPos(cid), 29)
return TRUE
end
Explicação dos script, você deve estar configurando errado, e no seu mapa também.
Em Vermelho - seria o nome do pokémon que o player ia ganhar.
Em Azul - Ali é o local do baú onde está no mapa por exemplo o baú está na cordenada x: 1052 y: 1052 z: 7 então teria que alterar ali. as cordenadas.
Não mano, eu fiz exatamente isso ! primeiro o nome, depois as coordenadas !
Eu troquei meu server para o do gabrieltxu 3.0
E ainda esta com esse problema, sendo que, as coordenadas do starter.lua, são as mesmas no Rme
info
Group: Grão-Duque
Joined: 28/07/11
Posts: 3.5k
Reputation: +570
Gender: Masculino
Tibia Character: Transloko

Tópico movido para a seção de dúvidas e pedidos resolvidos.
Tópico movido para a seção de dúvidas e pedidos resolvidos.
info
Group: Herói
Joined: 28/11/10
Posts: 3.4k
Reputation: +585
Gender: Masculino

+ 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.




info
Group: Campones
Joined: 15/11/11
Posts: 20
Reputation: +1
Bom galera, eu criei um ot aqui, mas to com um problema [claro, se não, eu não estaria pedindo ajuda]
mas então, quando cria a acc, e vai tentar pegar os pokes iniciais, os baus estão vazios !!
Alguem pode me ajudar ? ja estou a horas procurando alguma solução, e não acho nada !
[PDA by : bolz V2]
[desculpa pela falta de informação, primeira vez aqui kk ]