Como assim um grupo?
- Fórum
- OTServ
- Suporte
- Tópicos Sem Resposta
- [Encerrado] Função Pokedex
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

info
Grupo: Campones
Registrado: 13/06/12
Posts: 83
Reputação: +13

em certos pokemons, tipo uma lista
Exemplo:
Nopokedex = {"Lugia", "Ho-oh", Etc...}
Ai a pokedex não poderia ser usada nestes pokemons.
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Me passa o script da pokedex, provavelmente é data/actions/scripts
info
Grupo: Campones
Registrado: 13/06/12
Posts: 83
Reputação: +13

local rate = 20
function onUse(cid, item, fromPos, item2, toPos)
if not isCreature(item2.uid) then
return true
end
local poke = getCreatureName(item2.uid)
if isMonster(item2.uid) then
local this = newpokedex[getCreatureName(item2.uid)]
local myball = 0
if isSummon(item2.uid) then
myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
end
if not getPlayerInfoAboutPokemon(cid, poke).dex then
local exp = this.level * rate
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked ".. getCreatureName(item2.uid).." in your pokedex!")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained "..exp.." experience points.")
doSendMagicEffect(getThingPos(cid), 210)
doPlayerAddExperience(cid, exp)
doAddPokemonInDexList(cid, poke)
else
doShowPokedexRegistration(cid, item2, myball)
end
return true
end
if not isPlayer(item2.uid) then return true end
local kanto = 0
local johto = 0
--alterado v1.7 \/\/
for i = 1, #oldpokedex do
if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
if i <= 151 then
kanto = kanto+1
elseif i >= 209 then
johto = johto+1
end
end
end --alterado v1.6
local player = getRecorderPlayer(toPos, cid)
if cid == player then
doPlayerSendTextMessage(cid, 27, "You has unlocked "..kanto.." kanto's and "..johto.." johto's pokémons until now.")
doPlayerSetVocation(cid, 9) --alterado v1.6
openChannelDialog(cid)
end
return true
end
info
Grupo: Infante
Registrado: 27/08/11
Posts: 1.9k
Reputação: +85
Gênero: Masculino
Char no Tibia: Bruno Maciel

Ja tento ir em !!
data/lib/configuration
e ver \/
oldpokedex = {
ou
newpokedex = {
info
Grupo: Herói
Registrado: 14/12/10
Posts: 3.6k
Reputação: +846
Gênero: Masculino

Troca por:
local rate = 20
function onUse(cid, item, fromPos, item2, toPos)
local no_can = {"Pikachu", "Raichu", "Zapdos"} -- Entre aspas
if not isCreature(item2.uid) then
return true
end
if isInArray(no_can, getCreatureName(item2.uid)) then return doPlayerSendCancel(cid, "This poke is disabled!") end
local poke = getCreatureName(item2.uid)
if isMonster(item2.uid) then
local this = newpokedex[getCreatureName(item2.uid)]
local myball = 0
if isSummon(item2.uid) then
myball = getPlayerSlotItem(getCreatureMaster(item2.uid), 8)
end
if not getPlayerInfoAboutPokemon(cid, poke).dex then
local exp = this.level * rate
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked ".. getCreatureName(item2.uid).." in your pokedex!")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have gained "..exp.." experience points.")
doSendMagicEffect(getThingPos(cid), 210)
doPlayerAddExperience(cid, exp)
doAddPokemonInDexList(cid, poke)
else
doShowPokedexRegistration(cid, item2, myball)
end
return true
end
if not isPlayer(item2.uid) then return true end
local kanto = 0
local johto = 0
--alterado v1.7 \/\/
for i = 1, #oldpokedex do
if getPlayerInfoAboutPokemon(item2.uid, oldpokedex[i][1]).dex then
if i <= 151 then
kanto = kanto+1
elseif i >= 209 then
johto = johto+1
end
end
end --alterado v1.6
local player = getRecorderPlayer(toPos, cid)
if cid == player then
doPlayerSendTextMessage(cid, 27, "You has unlocked "..kanto.." kanto's and "..johto.." johto's pokémons until now.")
doPlayerSetVocation(cid, 9) --alterado v1.6
openChannelDialog(cid)
end
return true
end
Nessa linha:
local no_can = {"Pikachu", "Raichu", "Zapdos"}
Entre aspas e separados por vírgula coloca o nome dos pokes
Editado Abril 28 por Roksas
info
Grupo: Campones
Registrado: 13/06/12
Posts: 83
Reputação: +13

Funcionou Certinho, Muito Obrigado ![]()
info
Grupo: Herói
Registrado: 25/10/12
Posts: 2.4k
Reputação: +687
Gênero: Masculino
Char no Tibia: Nuncative

Movido p/ pedidos e duvidas resolvidos.
info
Grupo: Herói
Registrado: 28/11/10
Posts: 3.4k
Reputação: +585
Gênero: 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
Grupo: Campones
Registrado: 13/06/12
Posts: 83
Reputação: +13
Olá gostaria de uma função pra que a pokedex não possa ser usada em um grupo de pokemons...
Server: Slicer 1.9