[PDA] PokéDex em corpses de pokémons

zipter98
em Mods, funções e outros

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Sinceramente, não sei qual a área mais adequada para um complemento a um sistema, mas w/e.

Este complemento é designado a possibilidade de uso da PokéDex em corpses de pokémons, podendo obter suas informações.

Sim, simples assim.

data/actions/scripts, pokedex.lua:

Troque:

if not isCreature(item2.uid) then
    return true
end
por:
if not isCreature(item2.uid) then
    local name = getItemNameById(item2.itemid)
    if name:find("fainted") then
        name = doCorrectPokemonName(name:gsub("fainted ", ""))
        if not getPlayerInfoAboutPokemon(cid, name).dex then
            local exp = newpokedex[name].level * rate
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked "..name.." and received "..exp.." experience points.")
            doSendMagicEffect(getThingPos(cid), 210)
            doPlayerAddExperience(cid, exp)
            doAddPokemonInDexList(cid, name)
        else
            doShowPokedexRegistration(cid, name, getPlayerSlotItem(cid, 8))
        end
    end
    return true
end
Testado em PDA v1.9, por Slicer.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Strogman

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 04/11/12Posts: 464Gênero: MasculinoChar no Tibia: Lysty Of Death

boa ideia bem inovador e util as vezes você tá em uma hunt forte e quer da dex mais não consegue pq se der pode acabar morrendo etc

 

                                 logo_full_1600.png.f8d0c5d8ba71c660bad630b327c3e64d.png

                                                              htps://www.facebook.com/PokemonOnlineSVKE

                                                                                                                       PokeSvke

kaleudd

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 15/06/15Posts: 729

Bem,eu testei aqui e quando dou dex no corpo nao acontece nada,somente no pokemon como sempre era

 

Meu Pokedex.lua do actions.

local rate = 50

function onUse(cid, item, fromPos, item2, toPos)
 
if not isCreature(item2.uid) then
    local name = getItemNameById(item2.itemid)
    if name:find("fainted") then
        name = doCorrectPokemonName(name:gsub("fainted ", ""))
        if not getPlayerInfoAboutPokemon(cid, name).dex then
            local exp = newpokedex[name].level * rate
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have unlocked "..name.." and received "..exp.." experience points.")
            doSendMagicEffect(getThingPos(cid), 210)
            doPlayerAddExperience(cid, exp)
            doAddPokemonInDexList(cid, name)
        else
            doShowPokedexRegistration(cid, name, getPlayerSlotItem(cid, 8).uid)
        end
    end
    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 isOutlanderPokemon(getCreatureName(item2.uid)) then return false end
		if pokes[poke].dex then
			if getPlayerStorageValue(cid, pokes[poke].dex) <= 0 then
				exp = pokes[poke].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)
				setPlayerStorageValue(cid, pokes[poke].dex, 1)
				doShowPokedexRegistration(cid, item2, myball)
			return true
			else
				doShowPokedexRegistration(cid, item2, myball)
			return true
			end
		end
		doShowPokedexRegistration(cid, item2, myball)
	return true
	end

if not isPlayer(item2.uid) then return true end

	local kanto = 0
	local johto = 0
	local other = 0
	for i = 1, #oldpokedex do
			if i <= 151 then
				kanto = kanto+1
		    elseif i <= 251 and i > 151 then
				johto = johto+1
		    elseif i >= 252 then
				other = other+1
		    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 and "..other.." other's pokémons until now.") 
		 doPlayerSetVocation(cid, 9) --alterado v1.6
		 openChannelDialog(cid)
	end

return true
end

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Aparentemente a versão do PDA que você usa não é a mesma que a minha. Tente assim:

 

 

local rate = 50
 
function onUse(cid, item, fromPos, item2, toPos)
 
    if not isCreature(item2.uid) then
        local name = getItemNameById(item2.itemid)
        if name:find("fainted") then
            name = doCorrectPokemonName(name:gsub("fainted ", ""))
            if isOutlanderPokemon(getCreatureName(item2.uid)) then return false end
            if pokes[poke].dex then
                if getPlayerStorageValue(cid, pokes[poke].dex) <= 0 then
                    local exp = pokes[poke].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)
                    setPlayerStorageValue(cid, pokes[poke].dex, 1)
                    doShowPokedexRegistration(cid, name, getPlayerSlotItem(cid, 8))
                else
                    doShowPokedexRegistration(cid, name, getPlayerSlotItem(cid, 8))
                end
            end
        end
        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 isOutlanderPokemon(getCreatureName(item2.uid)) then return false end
        if pokes[poke].dex then
            if getPlayerStorageValue(cid, pokes[poke].dex) <= 0 then
                exp = pokes[poke].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)
                setPlayerStorageValue(cid, pokes[poke].dex, 1)
                doShowPokedexRegistration(cid, item2, myball)
                return true
            else
                doShowPokedexRegistration(cid, item2, myball)
                return true
            end
        end
        doShowPokedexRegistration(cid, item2, myball)
        return true
    end

    if not isPlayer(item2.uid) then return true end

    local kanto = 0
    local johto = 0
    local other = 0
    for i = 1, #oldpokedex do
        if i <= 151 then
            kanto = kanto+1
        elseif i <= 251 and i > 151 then
            johto = johto+1
        elseif i >= 252 then
            other = other+1
        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 and "..other.." other's pokémons until now.") 
        doPlayerSetVocation(cid, 9) --alterado v1.6
        openChannelDialog(cid)
    end

    return true
end 

 

 

Se der algum erro na distro, por favor, avise.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

kaleudd

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 15/06/15Posts: 729

Bem,troquei pelo seu e continua o problema,ao dar dex em pokes morto,nao acontece nada,e tmb nao aparece nenhum erro '-'

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Saberia dizer se as corpses dos pokémons do seu servidor são "defeated pokemon_name" ou "fainted pokemon_name"? Eu não pretendia adaptar o código para outras bases diferentes da que usei, mas vou abrir uma exceção.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

kaleudd

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 15/06/15Posts: 729

Bem,eles sao Fainted charmander <um exemplo


@up?

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Troque:

if not isCreature(item2.uid) then
    local name = getItemNameById(item2.itemid)
    if name:find("fainted") then
        name = doCorrectPokemonName(name:gsub("fainted ", ""))
        if isOutlanderPokemon(getCreatureName(item2.uid)) then return false end
        if pokes[poke].dex then
            if getPlayerStorageValue(cid, pokes[poke].dex) <= 0 then
                local exp = pokes[poke].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)
                setPlayerStorageValue(cid, pokes[poke].dex, 1)
                doShowPokedexRegistration(cid, name, getPlayerSlotItem(cid, 8))
            else
                doShowPokedexRegistration(cid, name, getPlayerSlotItem(cid, 8))
            end
        end
    end
    return true
end
por:
if not isCreature(item2.uid) then
    print("Usou em item.")
    local name = getItemNameById(item2.itemid)
    print("Nome do item: "..name)
    if name:find("fainted") then
        name = doCorrectPokemonName(name:gsub("fainted ", ""))
        print("Nome do pokemon: "..name)
        if isOutlanderPokemon(getCreatureName(item2.uid)) then return false end
        if pokes[poke].dex then
            print("Esta na tabela.")
            if getPlayerStorageValue(cid, pokes[poke].dex) <= 0 then
                local exp = pokes[poke].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)
                setPlayerStorageValue(cid, pokes[poke].dex, 1)
                doShowPokedexRegistration(cid, name, getPlayerSlotItem(cid, 8))
            else
                doShowPokedexRegistration(cid, name, getPlayerSlotItem(cid, 8))
            end
        end
    end
    return true
end
E informe o que for imprimido no console.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

kaleudd

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 15/06/15Posts: 729

ando dou dex nos pokes mortos aparece isso agora

[09/08/2015 20:15:04] Usou em item.
[09/08/2015 20:15:04] Nome do item: asphalt

 

na distro!!!

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

Cara, você não está usando a PokéDex numa corpse. Está usando no asfalto.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

kaleudd

avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 15/06/15Posts: 729

Usei no corpo.porem aparece como se o corpo tivesse invisível e da dez em baixo do corpo testei em vários corpos se poke

zipter98

avatar
Herói
Herói

INFOS

Grupo: HeróiRegistrado: 20/09/12Posts: 2553Gênero: Masculino

O problema está nas corpses, não no sistema.

Não respondo PMs solicitando suporte. Já existem seções no fórum para isto.

Rumplestiltiskin

Omnia mutantur, nihil interitum...
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 08/09/15Posts: 13Char no Tibia: Omnia

Zipter, posso te fazer um pedido ? Eu ficaria muito agradecido se começasse a desenvolver sistemas para a base PokéCyan, afinal, creio que seja a mais utilizada...

Por favor ! :D
Vlw

borealis.gif160009228_39826e.gif

Loouis

Luiz Henrique
avatar
Cavaleiro
Cavaleiro

INFOS

Grupo: CavaleiroRegistrado: 08/02/14Posts: 151

O problema está nas corpses, não no sistema.

Tbm adoraria alguns sistemas para a base cyan