otavio101 15 Posted November 19, 2013 Share Posted November 19, 2013 Olá, uso PDA com Level, e estou fazendo algumas modificações e queria mudar as stones e transforma-las em talkactions por exemplo, Fire Stone - !FIRE Ao dizer !FIRE ele checa se o Charmander está no level 18 e se estiver evolui. Link to comment Share on other sites More sharing options...
zipter98 1101 Posted November 19, 2013 Share Posted November 19, 2013 (edited) Se um pokémon evoluisse, por exemplo, com leaf stone, o comando seria qual? !grass ou !leaf? E se um pokémon tiver dois elementos, será verificado o elemento primário? Por exemplo, Venusaur é grass/poison. Então, com qual comando seria evoluído o Ivysaur? Ah, tem alguma informação adicional? Poderá evoluir o pokémon durante batalha? Edited November 19, 2013 by zipter98 Link to comment Share on other sites More sharing options...
otavio101 15 Posted November 19, 2013 Author Share Posted November 19, 2013 (edited) Pode ser durante a batalha, cara pode usar o nome das stone mesmo isso ai depois eu consigo mudar . Pode colocar pro elemento primario ser prioridade. A cara se conseguir colocar um Delay (Tempo de uso) de 10min eu agradeço também =D Edited November 19, 2013 by otaviogfl Link to comment Share on other sites More sharing options...
zipter98 1101 Posted November 19, 2013 Share Posted November 19, 2013 (edited) Bom, eu tentei fazer aqui. Não está completo, pois a configuração é bem grande. Sobre as special evolutions, fiz/tentei apenas do Eevee. Para fazer as outras, basta seguir esta como base. Qualquer erro, só postar. Ah, não se esqueça de ir configurando as words na tag, a medida que configura no script. Enfim, crie um arquivo .lua com o nome evolvetalk,em data/talkactions/scripts, com o conteúdo: function evolving_pokemon(cid, mypoke, theevo) if not isCreature(cid) then return true end if not pokes[theevo] or not pokes[theevo].offense then doReturnPokemon(cid, mypoke, getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect, false, true) return true end local pokeball = getPlayerSlotItem(cid, 8) local description = "Contains a "..theevo.."." local pct = getCreatureHealth(mypoke) / getCreatureMaxHealth(mypoke) doItemSetAttribute(pokeball.uid, "hp", pct) doItemSetAttribute(pokeball.uid, "poke", theevo) doItemSetAttribute(pokeball.uid, "description", "Contains a "..theevo..".") doPlayerSendTextMessage(cid, 27, "Seu "..getPokeName(mypoke).." evoluiu para "..theevo.."!") setPlayerStorageValue(cid, 412001, os.time () + 600) doSendMagicEffect(getThingPos(mypoke), 18) doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[theevo]) doSendMagicEffect(getThingPos(cid), 173) local oldpos = getThingPos(mypoke) local oldlod = getCreatureLookDir(mypoke) local oldlvl = getPokemonLevel(mypoke) doRemoveCreature(mypoke) doSummonMonster(cid, theevo) doTeleportThing(mypoke, oldpos, false) doCreatureSetLookDir(mypoke, oldlod) sendFinishEvolutionEffect(pk, true) addEvent(sendFinishEvolutionEffect, 550, mypoke, true) addEvent(sendFinishEvolutionEffect, 1050, mypoke) doAddPokemonInOwnList(cid, theevo) local status = getPokemonStatus(getCreatureName(mypoke)) local off = status.off * 7.5 local def = status.def * 7.5 local agi = status.agi * 7.5 local spatk = status.spatk * 7.5 local vit = status.vit * 7 doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") + off) doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") + def) doItemSetAttribute(pokeball.uid, "speed", getItemAttribute(pokeball.uid, "speed") + agi) doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") + spatk) doItemSetAttribute(pokeball.uid, "vitality", getItemAttribute(pokeball.uid, "vitality") + vit) doPlayerSendTextMessage(cid, 27, "Bônus de evolução: • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."") local happy = getItemAttribute(pokeball.uid, "happy") doItemSetAttribute(pokeball.uid, "happy", happy + happyGainedOnEvolution) if happy + happyGainedOnEvolution > 255 then doItemSetAttribute(pokeball.uid, "happy", 255) end adjustStatus(mypoke, pokeball.uid, true, false) if useKpdoDlls then doUpdateMoves(cid) end end function onSay(cid, words, param, channel) local pokes_evolve = { --["Nome do poke"] = {level = level necessário para evoluir, to = "Nome da evolução"}, ["Charmander"] = {level = 16, to = "Charmeleon"}, ["Charmeleon"] = {level = 36, to = "Charizard"}, ["Squirtle"] = {level = 16, to = "Wartortle"}, ["Wartortle"] = {level = 36, to = "Blastoise"}, ["Bulbasaur"] = {level = 16, to = "Ivysaur"}, ["Ivysaur"] = {level = 36, to = "Venusaur"}, } local t = { --["elemento"] = {words = "o que deverá ser dito pelo player (sem o !)"}, ["grass"] = {words = "leaf"}, ["fire"] = {words = "fire"}, ["water"] = {words = "water"}, ["bug"] = {words = "cocoon"}, ["normal"] = {words = "heart"}, } local evolvess = { --["o que deverá ser dito pelo player (dessa vez, com !)"] = {level = level necessário para evoluir, poke = "evolução"}, OBS: Essa tabela é própria para o Eeevee. ["!fire"] = {level = 20, poke = "Flareon"}, ["!water"] = {level = 20, poke = "Vaporeon"}, ["!thunder"] = {level = 20, poke = "Jolteon"}, ["!darkness"] = {level = 20, poke = "Umbreon"}, ["!enigma"] = {level = 20, poke = "Espeon"}, } if #getCreatureSummons(cid) == 0 then return doPlayerSendCancel(cid, "Você precisa de um pokémon para evoluir.") end if getPlayerStorageValue(cid, 412001) > os.time () then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 412001).." segundo(s) para evoluir um pokémon novamente.") end local mypoke = getCreatureSummons(cid)[1] if not pokes_evolve[getCreatureName(mypoke)] then return doPlayerSendCancel(cid, "Esse pokémon não possui evolução.") end if isCreature(mypoke) then elemento = pokes[getCreatureName(mypoke)].type pokemon = pokes_evolve[getCreatureName(mypoke)] end local next_evo = pokemon.to if mypoke == "Eevee" then --Só fiz uma special evo, faça as outras seguindo como base a do Eevee. if not isCreature(mypoke) then return true end evos = evolvess[words].poke evos_lv = evolvess[words].level if (words == ""..evolvess[words].."") then if getPokemonLevel(mypoke) >= evos_lv then evolving_pokemon(cid, mypoke, evos) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end end if (words == "!"..t[elemento].words.."") then if getPokemonLevel(mypoke) >= pokemon.level then evolving_pokemon(cid, mypoke, next_evo) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end return true end Depois, em data/talkactions, talkactions.xml, adicione a tag: <talkaction words="!fire;!normal;!leaf;!water;!cocoon" event="script" value="evolvetalk.lua"/> Edited November 19, 2013 by zipter98 Link to comment Share on other sites More sharing options...
otavio101 15 Posted November 19, 2013 Author Share Posted November 19, 2013 (edited) Vlw cara deu quase tudo certo só apareceu esse erro: [19/11/2013 18:45:16] [Error - TalkAction Interface][19/11/2013 18:45:16] data/talkactions/scripts/evolvetalk.lua:onSay[19/11/2013 18:45:16] Description:[19/11/2013 18:45:16] (luaDoTeleportThing) Thing not found[19/11/2013 18:45:16] [Error - TalkAction Interface][19/11/2013 18:45:16] data/talkactions/scripts/evolvetalk.lua:onSay[19/11/2013 18:45:16] Description:[19/11/2013 18:45:16] (luaDoCreatureSetLookDir) Creature not found[19/11/2013 18:45:16] [Error - TalkAction Interface][19/11/2013 18:45:16] data/talkactions/scripts/evolvetalk.lua:onSay[19/11/2013 18:45:16] Description:[19/11/2013 18:45:16] (luaGetCreatureName) Creature not found[19/11/2013 18:45:16] [Error - TalkAction Interface][19/11/2013 18:45:16] data/talkactions/scripts/evolvetalk.lua:onSay[19/11/2013 18:45:16] Description:[19/11/2013 18:45:16] data/talkactions/scripts/evolvetalk.lua:44: attempt to index local 'status' (a boolean value)[19/11/2013 18:45:16] stack traceback:[19/11/2013 18:45:16] data/talkactions/scripts/evolvetalk.lua:44: in function 'evolving_pokemon'[19/11/2013 18:45:16] data/talkactions/scripts/evolvetalk.lua:135: in function Parece que o tempo para soltar o comando novamente também não diminui. Edited November 19, 2013 by otaviogfl Link to comment Share on other sites More sharing options...
zipter98 1101 Posted November 19, 2013 Share Posted November 19, 2013 (edited) Tenta: function evolving_pokemon(cid, mypoke, theevo) if not isCreature(cid) then return true end if not pokes[theevo] or not pokes[theevo].offense then doReturnPokemon(cid, mypoke, getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect, false, true) return true end local pokeball = getPlayerSlotItem(cid, 8) local description = "Contains a "..theevo.."." local pct = getCreatureHealth(mypoke) / getCreatureMaxHealth(mypoke) doItemSetAttribute(pokeball.uid, "hp", pct) doItemSetAttribute(pokeball.uid, "poke", theevo) doItemSetAttribute(pokeball.uid, "description", "Contains a "..theevo..".") doPlayerSendTextMessage(cid, 27, "Seu "..getPokeName(mypoke).." evoluiu para "..theevo.."!") doSendMagicEffect(getThingPos(mypoke), 18) doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[theevo]) doSendMagicEffect(getThingPos(cid), 173) local oldpos = getThingPos(mypoke) local oldlod = getCreatureLookDir(mypoke) local oldlvl = getPokemonLevel(mypoke) doRemoveCreature(mypoke) doSummonMonster(cid, theevo) local pk = getCreatureSummons(cid)[1] doTeleportThing(pk, oldpos, false) doCreatureSetLookDir(pk, oldlod) sendFinishEvolutionEffect(pk, true) addEvent(sendFinishEvolutionEffect, 550, pk, true) addEvent(sendFinishEvolutionEffect, 1050, pk) doAddPokemonInOwnList(cid, theevo) local status = getPokemonStatus(getCreatureName(pk)) local off = status.off * 7.5 local def = status.def * 7.5 local agi = status.agi * 7.5 local spatk = status.spatk * 7.5 local vit = status.vit * 7 doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") + off) doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") + def) doItemSetAttribute(pokeball.uid, "speed", getItemAttribute(pokeball.uid, "speed") + agi) doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") + spatk) doItemSetAttribute(pokeball.uid, "vitality", getItemAttribute(pokeball.uid, "vitality") + vit) doPlayerSendTextMessage(cid, 27, "Bônus de evolução: • Offense: +"..doMathDecimal(off).." • Defense: +"..doMathDecimal(def).." • Spc. Atk: +"..doMathDecimal(spatk).." • Agility: +"..doMathDecimal(agi).." • Vitality: +"..doMathDecimal(vit).."") local happy = getItemAttribute(pokeball.uid, "happy") doItemSetAttribute(pokeball.uid, "happy", happy + happyGainedOnEvolution) if happy + happyGainedOnEvolution > 255 then doItemSetAttribute(pokeball.uid, "happy", 255) end adjustStatus(mypoke, pokeball.uid, true, false) if useKpdoDlls then doUpdateMoves(cid) end end function onSay(cid, words, param, channel) local pokes_evolve = { --["Nome do poke"] = {level = level necessário para evoluir, to = "Nome da evolução"}, ["Charmander"] = {level = 16, to = "Charmeleon"}, ["Charmeleon"] = {level = 36, to = "Charizard"}, ["Squirtle"] = {level = 16, to = "Wartortle"}, ["Wartortle"] = {level = 36, to = "Blastoise"}, ["Bulbasaur"] = {level = 16, to = "Ivysaur"}, ["Ivysaur"] = {level = 36, to = "Venusaur"}, } local t = { --["elemento"] = {words = "o que deverá ser dito pelo player (sem o !)"}, ["grass"] = {words = "leaf"}, ["fire"] = {words = "fire"}, ["water"] = {words = "water"}, ["bug"] = {words = "cocoon"}, ["normal"] = {words = "heart"}, } local evolvess = { --["o que deverá ser dito pelo player (dessa vez, com !)"] = {level = level necessário para evoluir, poke = "evolução"}, OBS: Essa tabela é própria para o Eeevee. ["!fire"] = {level = 20, poke = "Flareon"}, ["!water"] = {level = 20, poke = "Vaporeon"}, ["!thunder"] = {level = 20, poke = "Jolteon"}, ["!darkness"] = {level = 20, poke = "Umbreon"}, ["!enigma"] = {level = 20, poke = "Espeon"}, } if #getCreatureSummons(cid) == 0 then return doPlayerSendCancel(cid, "Você precisa de um pokémon para evoluir.") end if getPlayerStorageValue(cid, 412001) > os.time () then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 412001) - os.time ().." segundo(s) para evoluir um pokémon novamente.") end local mypoke = getCreatureSummons(cid)[1] if not pokes_evolve[getCreatureName(mypoke)] then return doPlayerSendCancel(cid, "Esse pokémon não possui evolução.") end if isCreature(mypoke) then elemento = pokes[getCreatureName(mypoke)].type pokemon = pokes_evolve[getCreatureName(mypoke)] end local next_evo = pokemon.to if mypoke == "Eevee" then --Só fiz uma special evo, faça as outras seguindo como base a do Eevee. if not isCreature(mypoke) then return true end evos = evolvess[words].poke evos_lv = evolvess[words].level if (words == ""..evolvess[words].."") then if getPokemonLevel(mypoke) >= evos_lv then evolving_pokemon(cid, mypoke, evos) setPlayerStorageValue(cid, 412001, os.time () + 600) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end end if (words == "!"..t[elemento].words.."") then if getPokemonLevel(mypoke) >= pokemon.level then evolving_pokemon(cid, mypoke, next_evo) setPlayerStorageValue(cid, 412001, os.time () + 600) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end return true end Edited November 20, 2013 by zipter98 Link to comment Share on other sites More sharing options...
otavio101 15 Posted November 20, 2013 Author Share Posted November 20, 2013 (edited) Quando evolui o level não aparece, e o tempo continua com problema. Mas não aparece nenhum erro. Se der gostaria que não ganhasse Bônus de evolução nos atributos. Edited November 20, 2013 by otaviogfl Link to comment Share on other sites More sharing options...
zipter98 1101 Posted November 20, 2013 Share Posted November 20, 2013 Quando volta o pokémon para a ball, o level aparece? Sobre o tempo, editei o script ali em cima. Link to comment Share on other sites More sharing options...
otavio101 15 Posted November 20, 2013 Author Share Posted November 20, 2013 (edited) Sim aparece xD O tempo agora está OK vlw. Edited November 20, 2013 by otaviogfl Link to comment Share on other sites More sharing options...
zipter98 1101 Posted November 20, 2013 Share Posted November 20, 2013 (edited) Sobre não ganhar os bônus de status, tente assim: function evolving_pokemon(cid, mypoke, theevo) if not isCreature(cid) then return true end if not pokes[theevo] or not pokes[theevo].offense then doReturnPokemon(cid, mypoke, getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect, false, true) return true end local pokeball = getPlayerSlotItem(cid, 8) local description = "Contains a "..theevo.."." local pct = getCreatureHealth(mypoke) / getCreatureMaxHealth(mypoke) doItemSetAttribute(pokeball.uid, "hp", pct) doItemSetAttribute(pokeball.uid, "poke", theevo) doItemSetAttribute(pokeball.uid, "description", "Contains a "..theevo..".") doPlayerSendTextMessage(cid, 27, "Seu "..getPokeName(mypoke).." evoluiu para "..theevo.."!") doSendMagicEffect(getThingPos(mypoke), 18) doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[theevo]) doSendMagicEffect(getThingPos(cid), 173) local oldpos = getThingPos(mypoke) local oldlod = getCreatureLookDir(mypoke) local oldlvl = getPokemonLevel(mypoke) doRemoveCreature(mypoke) doSummonMonster(cid, theevo) local pk = getCreatureSummons(cid)[1] doTeleportThing(pk, oldpos, false) doCreatureSetLookDir(pk, oldlod) sendFinishEvolutionEffect(pk, true) addEvent(sendFinishEvolutionEffect, 550, pk, true) addEvent(sendFinishEvolutionEffect, 1050, pk) doAddPokemonInOwnList(cid, theevo) local happy = getItemAttribute(pokeball.uid, "happy") doItemSetAttribute(pokeball.uid, "happy", happy + happyGainedOnEvolution) if happy + happyGainedOnEvolution > 255 then doItemSetAttribute(pokeball.uid, "happy", 255) end adjustStatus(mypoke, pokeball.uid, true, false) if useKpdoDlls then doUpdateMoves(cid) end end function onSay(cid, words, param, channel) local pokes_evolve = { --["Nome do poke"] = {level = level necessário para evoluir, to = "Nome da evolução"}, ["Charmander"] = {level = 16, to = "Charmeleon"}, ["Charmeleon"] = {level = 36, to = "Charizard"}, ["Squirtle"] = {level = 16, to = "Wartortle"}, ["Wartortle"] = {level = 36, to = "Blastoise"}, ["Bulbasaur"] = {level = 16, to = "Ivysaur"}, ["Ivysaur"] = {level = 36, to = "Venusaur"}, } local t = { --["elemento"] = {words = "o que deverá ser dito pelo player (sem o !)"}, ["grass"] = {words = "leaf"}, ["fire"] = {words = "fire"}, ["water"] = {words = "water"}, ["bug"] = {words = "cocoon"}, ["normal"] = {words = "heart"}, } local evolvess = { --["o que deverá ser dito pelo player (dessa vez, com !)"] = {level = level necessário para evoluir, poke = "evolução"}, OBS: Essa tabela é própria para o Eeevee. ["!fire"] = {level = 20, poke = "Flareon"}, ["!water"] = {level = 20, poke = "Vaporeon"}, ["!thunder"] = {level = 20, poke = "Jolteon"}, ["!darkness"] = {level = 20, poke = "Umbreon"}, ["!enigma"] = {level = 20, poke = "Espeon"}, } if #getCreatureSummons(cid) == 0 then return doPlayerSendCancel(cid, "Você precisa de um pokémon para evoluir.") end if getPlayerStorageValue(cid, 412001) > os.time () then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 412001) - os.time ().." segundo(s) para evoluir um pokémon novamente.") end local mypoke = getCreatureSummons(cid)[1] if not pokes_evolve[getCreatureName(mypoke)] then return doPlayerSendCancel(cid, "Esse pokémon não possui evolução.") end if isCreature(mypoke) then elemento = pokes[getCreatureName(mypoke)].type pokemon = pokes_evolve[getCreatureName(mypoke)] end local next_evo = pokemon.to if mypoke == "Eevee" then --Só fiz uma special evo, faça as outras seguindo como base a do Eevee. if not isCreature(mypoke) then return true end evos = evolvess[words].poke evos_lv = evolvess[words].level if (words == ""..evolvess[words].."") then if getPokemonLevel(mypoke) >= evos_lv then evolving_pokemon(cid, mypoke, evos) setPlayerStorageValue(cid, 412001, os.time () + 600) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end end if (words == "!"..t[elemento].words.."") then if getPokemonLevel(mypoke) >= pokemon.level then evolving_pokemon(cid, mypoke, next_evo) setPlayerStorageValue(cid, 412001, os.time () + 600) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end return true end Agora, está tudo funcionando sem bugs? Bugs que eu digo, é como, por exemplo, um determinado pokémon não evoluir corretamente; algum erro no console; etc. Edited November 20, 2013 by zipter98 Link to comment Share on other sites More sharing options...
otavio101 15 Posted November 20, 2013 Author Share Posted November 20, 2013 Sem erros no console, porém quando evolui você esqueceu de colocar pra pegar os atributos. Chando chamander vira charmelon ele não pega os atributos do charmander. Link to comment Share on other sites More sharing options...
zipter98 1101 Posted November 20, 2013 Share Posted November 20, 2013 Ih, é mesmo ._. tenta agora: function evolving_pokemon(cid, mypoke, theevo) if not isCreature(cid) then return true end if not pokes[theevo] or not pokes[theevo].offense then doReturnPokemon(cid, mypoke, getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect, false, true) return true end local pokeball = getPlayerSlotItem(cid, 8) local description = "Contains a "..theevo.."." local pct = getCreatureHealth(mypoke) / getCreatureMaxHealth(mypoke) doItemSetAttribute(pokeball.uid, "hp", pct) doItemSetAttribute(pokeball.uid, "poke", theevo) doItemSetAttribute(pokeball.uid, "description", "Contains a "..theevo..".") doPlayerSendTextMessage(cid, 27, "Seu "..getPokeName(mypoke).." evoluiu para "..theevo.."!") doSendMagicEffect(getThingPos(mypoke), 18) doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[theevo]) doSendMagicEffect(getThingPos(cid), 173) local oldpos = getThingPos(mypoke) local oldlod = getCreatureLookDir(mypoke) local oldlvl = getPokemonLevel(mypoke) doRemoveCreature(mypoke) doSummonMonster(cid, theevo) local pk = getCreatureSummons(cid)[1] doTeleportThing(pk, oldpos, false) doCreatureSetLookDir(pk, oldlod) sendFinishEvolutionEffect(pk, true) addEvent(sendFinishEvolutionEffect, 550, pk, true) addEvent(sendFinishEvolutionEffect, 1050, pk) doAddPokemonInOwnList(cid, theevo) local status = getPokemonStatus(getCreatureName(pk)) local off = status.off local def = status.def local agi = status.agi local spatk = status.spatk local vit = status.vit doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") + off) doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") + def) doItemSetAttribute(pokeball.uid, "speed", getItemAttribute(pokeball.uid, "speed") + agi) doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") + spatk) doItemSetAttribute(pokeball.uid, "vitality", getItemAttribute(pokeball.uid, "vitality") + vit) local happy = getItemAttribute(pokeball.uid, "happy") doItemSetAttribute(pokeball.uid, "happy", happy + happyGainedOnEvolution) if happy + happyGainedOnEvolution > 255 then doItemSetAttribute(pokeball.uid, "happy", 255) end adjustStatus(mypoke, pokeball.uid, true, false) if useKpdoDlls then doUpdateMoves(cid) end end function onSay(cid, words, param, channel) local pokes_evolve = { --["Nome do poke"] = {level = level necessário para evoluir, to = "Nome da evolução"}, ["Charmander"] = {level = 16, to = "Charmeleon"}, ["Charmeleon"] = {level = 36, to = "Charizard"}, ["Squirtle"] = {level = 16, to = "Wartortle"}, ["Wartortle"] = {level = 36, to = "Blastoise"}, ["Bulbasaur"] = {level = 16, to = "Ivysaur"}, ["Ivysaur"] = {level = 36, to = "Venusaur"}, } local t = { --["elemento"] = {words = "o que deverá ser dito pelo player (sem o !)"}, ["grass"] = {words = "leaf"}, ["fire"] = {words = "fire"}, ["water"] = {words = "water"}, ["bug"] = {words = "cocoon"}, ["normal"] = {words = "heart"}, } local evolvess = { --["o que deverá ser dito pelo player (dessa vez, com !)"] = {level = level necessário para evoluir, poke = "evolução"}, OBS: Essa tabela é própria para o Eeevee. ["!fire"] = {level = 20, poke = "Flareon"}, ["!water"] = {level = 20, poke = "Vaporeon"}, ["!thunder"] = {level = 20, poke = "Jolteon"}, ["!darkness"] = {level = 20, poke = "Umbreon"}, ["!enigma"] = {level = 20, poke = "Espeon"}, } if #getCreatureSummons(cid) == 0 then return doPlayerSendCancel(cid, "Você precisa de um pokémon para evoluir.") end if getPlayerStorageValue(cid, 412001) > os.time () then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 412001) - os.time ().." segundo(s) para evoluir um pokémon novamente.") end local mypoke = getCreatureSummons(cid)[1] if not pokes_evolve[getCreatureName(mypoke)] then return doPlayerSendCancel(cid, "Esse pokémon não possui evolução.") end if isCreature(mypoke) then elemento = pokes[getCreatureName(mypoke)].type pokemon = pokes_evolve[getCreatureName(mypoke)] end local next_evo = pokemon.to if mypoke == "Eevee" then --Só fiz uma special evo, faça as outras seguindo como base a do Eevee. if not isCreature(mypoke) then return true end evos = evolvess[words].poke evos_lv = evolvess[words].level if (words == ""..evolvess[words].."") then if getPokemonLevel(mypoke) >= evos_lv then evolving_pokemon(cid, mypoke, evos) setPlayerStorageValue(cid, 412001, os.time () + 600) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end end if (words == "!"..t[elemento].words.."") then if getPokemonLevel(mypoke) >= pokemon.level then evolving_pokemon(cid, mypoke, next_evo) setPlayerStorageValue(cid, 412001, os.time () + 600) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end return true end Link to comment Share on other sites More sharing options...
otavio101 15 Posted November 20, 2013 Author Share Posted November 20, 2013 Não tem nenhum erro no console, mas precisa chamar ele se não fica sem level e quando ele fica sem level o status fica bugado. Link to comment Share on other sites More sharing options...
zipter98 1101 Posted November 20, 2013 Share Posted November 20, 2013 (edited) Deixa eu ver se entendi: Se o player não retornar o pokémon pra ball, ele fica sem level, e, consequentemente, os status bugam? Se for, já encontrei uma solução pra isso. Mas, antes, poderia informar qual servidor base você utiliza? Bom, se for PDA, e tiver a função getPokeballType, provavelmente irá funcionar. Testei aqui no meu sistema de evolução, e no console dá apenas um erro de creature not found quando vai setar a skull nele; porém, nada prejudicial (ao menos, aqui não ocorreu bug algum em relação à isso). function evolving_pokemon(cid, mypoke, theevo) if not isCreature(cid) then return true end if not pokes[theevo] or not pokes[theevo].offense then doReturnPokemon(cid, mypoke, getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect, false, true) return true end local pokeball = getPlayerSlotItem(cid, 8) local description = "Contains a "..theevo.."." local pct = getCreatureHealth(mypoke) / getCreatureMaxHealth(mypoke) doItemSetAttribute(pokeball.uid, "hp", pct) doItemSetAttribute(pokeball.uid, "poke", theevo) doItemSetAttribute(pokeball.uid, "description", "Contains a "..theevo..".") doPlayerSendTextMessage(cid, 27, "Seu "..getPokeName(mypoke).." evoluiu para "..theevo.."!") doSendMagicEffect(getThingPos(mypoke), 18) doTransformItem(getPlayerSlotItem(cid, 7).uid, fotos[theevo]) doSendMagicEffect(getThingPos(cid), 173) local oldpos = getThingPos(mypoke) local oldlod = getCreatureLookDir(mypoke) local oldlvl = getPokemonLevel(mypoke) doRemoveCreature(mypoke) doSummonMonster(cid, theevo) local pk = getCreatureSummons(cid)[1] doTeleportThing(pk, oldpos, false) doCreatureSetLookDir(pk, oldlod) sendFinishEvolutionEffect(pk, true) addEvent(sendFinishEvolutionEffect, 550, pk, true) addEvent(sendFinishEvolutionEffect, 1050, pk) doAddPokemonInOwnList(cid, theevo) local status = getPokemonStatus(getCreatureName(pk)) local off = status.off local def = status.def local agi = status.agi local spatk = status.spatk local vit = status.vit doItemSetAttribute(pokeball.uid, "offense", getItemAttribute(pokeball.uid, "offense") + off) doItemSetAttribute(pokeball.uid, "defense", getItemAttribute(pokeball.uid, "defense") + def) doItemSetAttribute(pokeball.uid, "speed", getItemAttribute(pokeball.uid, "speed") + agi) doItemSetAttribute(pokeball.uid, "specialattack", getItemAttribute(pokeball.uid, "specialattack") + spatk) doItemSetAttribute(pokeball.uid, "vitality", getItemAttribute(pokeball.uid, "vitality") + vit) local happy = getItemAttribute(pokeball.uid, "happy") doItemSetAttribute(pokeball.uid, "happy", happy + happyGainedOnEvolution) if happy + happyGainedOnEvolution > 255 then doItemSetAttribute(pokeball.uid, "happy", 255) end adjustStatus(mypoke, pokeball.uid, true, false) doReturnPokemon(cid, getCreatureSummons(cid)[1], getPlayerSlotItem(cid, 8), pokeballs[getPokeballType(getPlayerSlotItem(cid, 8).itemid)].effect) if useKpdoDlls then doUpdateMoves(cid) end end function onSay(cid, words, param, channel) local pokes_evolve = { --["Nome do poke"] = {level = level necessário para evoluir, to = "Nome da evolução"}, ["Charmander"] = {level = 16, to = "Charmeleon"}, ["Charmeleon"] = {level = 36, to = "Charizard"}, ["Squirtle"] = {level = 16, to = "Wartortle"}, ["Wartortle"] = {level = 36, to = "Blastoise"}, ["Bulbasaur"] = {level = 16, to = "Ivysaur"}, ["Ivysaur"] = {level = 36, to = "Venusaur"}, } local t = { --["elemento"] = {words = "o que deverá ser dito pelo player (sem o !)"}, ["grass"] = {words = "leaf"}, ["fire"] = {words = "fire"}, ["water"] = {words = "water"}, ["bug"] = {words = "cocoon"}, ["normal"] = {words = "heart"}, } local evolvess = { --["o que deverá ser dito pelo player (dessa vez, com !)"] = {level = level necessário para evoluir, poke = "evolução"}, OBS: Essa tabela é própria para o Eeevee. ["!fire"] = {level = 20, poke = "Flareon"}, ["!water"] = {level = 20, poke = "Vaporeon"}, ["!thunder"] = {level = 20, poke = "Jolteon"}, ["!darkness"] = {level = 20, poke = "Umbreon"}, ["!enigma"] = {level = 20, poke = "Espeon"}, } if #getCreatureSummons(cid) == 0 then return doPlayerSendCancel(cid, "Você precisa de um pokémon para evoluir.") end if getPlayerStorageValue(cid, 412001) > os.time () then return doPlayerSendCancel(cid, "Aguarde "..getPlayerStorageValue(cid, 412001) - os.time ().." segundo(s) para evoluir um pokémon novamente.") end local mypoke = getCreatureSummons(cid)[1] if not pokes_evolve[getCreatureName(mypoke)] then return doPlayerSendCancel(cid, "Esse pokémon não possui evolução.") end if isCreature(mypoke) then elemento = pokes[getCreatureName(mypoke)].type pokemon = pokes_evolve[getCreatureName(mypoke)] end local next_evo = pokemon.to if mypoke == "Eevee" then --Só fiz uma special evo, faça as outras seguindo como base a do Eevee. if not isCreature(mypoke) then return true end evos = evolvess[words].poke evos_lv = evolvess[words].level if (words == ""..evolvess[words].."") then if getPokemonLevel(mypoke) >= evos_lv then evolving_pokemon(cid, mypoke, evos) setPlayerStorageValue(cid, 412001, os.time () + 600) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end end if (words == "!"..t[elemento].words.."") then if getPokemonLevel(mypoke) >= pokemon.level then evolving_pokemon(cid, mypoke, next_evo) setPlayerStorageValue(cid, 412001, os.time () + 600) else return doPlayerSendCancel(cid, "Seu pokémon não possui o level necessário para evoluir!") end end return true end Edited November 20, 2013 by zipter98 Link to comment Share on other sites More sharing options...
otavio101 15 Posted November 20, 2013 Author Share Posted November 20, 2013 (edited) Já tava querendo tirar a skull mesmo. Aqui não deu esse erro de skull não, porém o pokémon volta pra pokeball =x Fui tentar usar o evolve no Eevee aqui e não funcionou diz que ele não tem evoluções. O status ainda muda mesmo que pouco. 15:25 You see a superball.It contains an Charmander [level 16].It is male.--- Status ---Offense: 83 Defense: 68Agility: 1 Sp. Attack: 96Vitality: 6215:25 You see a superball.It contains a Charmeleon [level 16].It is male.--- Status ---Offense: 88 Defense: 73Agility: 1 Sp. Attack: 102Vitality: 66 Edited November 20, 2013 by otaviogfl Link to comment Share on other sites More sharing options...
Recommended Posts