Amantezinho 18 Postado Outubro 16, 2015 Share Postado Outubro 16, 2015 Boa tarde galera.... Pedido1: Um script que impeça o carregamento de mais de um pokémon igual. (ex: 2 charmander, etc) Pedido2: Algo estilo o sistema de Clãs (ou este mesmo, pois não achei), que só pode usar o Pokémon sendo de tal clã, ou tendo tal storage. Agradeço desde já; Link para o comentário https://xtibia.com/forum/topic/237412-n%C3%A3o-carregar-pokemons-iguais-e-pok%C3%A9mon-que-s%C3%B3-pode-ser-usado-por-storage/ Compartilhar em outros sites More sharing options...
0 zipter98 1102 Postado Outubro 16, 2015 Share Postado Outubro 16, 2015 Poderia postar seu código de go/back (data/actions/scripts)? Se também puder informar os IDs das pokeballs do seu servidor, agradeço. PS: Me refiro às pokeballs usadas para conter pokémons, não para capturá-los. Link para o comentário https://xtibia.com/forum/topic/237412-n%C3%A3o-carregar-pokemons-iguais-e-pok%C3%A9mon-que-s%C3%B3-pode-ser-usado-por-storage/#findComment-1673233 Compartilhar em outros sites More sharing options...
0 meubk 257 Postado Outubro 16, 2015 Share Postado Outubro 16, 2015 Eu acho q o certo seria fazer a verificação junto com a verificação que só pode carregar 6 pokebolas. Não sei como funciona os servidores de pokemon de hoje, não sei se esta verificação é por script ou algum código nas sources. Link para o comentário https://xtibia.com/forum/topic/237412-n%C3%A3o-carregar-pokemons-iguais-e-pok%C3%A9mon-que-s%C3%B3-pode-ser-usado-por-storage/#findComment-1673236 Compartilhar em outros sites More sharing options...
0 Amantezinho 18 Postado Outubro 16, 2015 Autor Share Postado Outubro 16, 2015 Poderia postar seu código de go/back (data/actions/scripts)? Se também puder informar os IDs das pokeballs do seu servidor, agradeço. PS: Me refiro às pokeballs usadas para conter pokémons, não para capturá-los. GOBACK local backMSG = {"Come back, doka!", "Thanks for helping, doka!", "That's enough, come back!", "You were great, doka!", "Excellent work, doka!", "Well done, doka!"} local goMSG = {"Go, doka!", "Let's do it, doka!", "I choose you, doka!", "I need your help, doka!", "Let's fight, doka!", "It's battle time, doka!"} function onUse(cid, item, frompos, item2, topos) if #getCreatureSummons(cid) >= 1 and getPlayerStorageValue(getCreatureSummons(cid)[1], 33) >= 1 then return true end -------- msgunicaback = backMSG[math.random(#backMSG)] msgunicago = goMSG[math.random(#goMSG)] btype = getPokeballType(item.itemid) usando = pokeballs[btype].use online = pokeballs[btype].on morto = pokeballs[btype].off if isIconeSystem(cid) then effect = getItemAttribute(item.uid, "effect") else effect = getItemAttribute(item.uid, "effect") end -------- if item.itemid == usando then if #getCreatureSummons(cid) >= 1 then local z = getCreatureSummons(cid)[1] local pokename = getCreatureName(z) local mbk = msgunicaback:gsub("doka", pokename) if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) then doTransformItem(item.uid, item.itemid-1) doCreatureSay(cid, mbk, TALKTYPE_SAY) local summom = getCreatureSummons(cid) local maxh = pokes[getCreatureName(summom[1])].vida local pct2 = ((getCreatureHealth(summom[1])) / (getCreatureMaxHealth(summom[1]))) local vids = ((getCreatureHealth(summom[1])) - 2) doCreatureAddHealth(summom[1], -vids) setCreatureMaxHealth(summom[1], maxh) doCreatureAddHealth(summom[1], ((maxh) * (pct2))) if math.random(1,100) <= 35 then setPokemonFeed(cid, getPokemonFeed(cid)-15) -- Food system end doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), ".")) .. " HP = ["..getCreatureHealth(z).."/"..getCreatureMaxHealth(z).."]") setPlayerStorageValue(cid, 61204, 0) setPlayerStorageValue(cid, 2, 0) doSendMagicEffect(getCreaturePosition(z), effect) doRemoveCreature(z) if getPlayerStorageValue(cid, 991) >= 1 then --- Ginasios doSendAnimatedText(getThingPos(cid), "POKEOUT", 181) setPlayerStorageValue(cid, 991, getPlayerStorageValue(cid, 991) -1) end return true end end elseif item.itemid == morto then return doPlayerSendCancel(cid, "This monster is fainted.") elseif item.itemid == online then if isZumbie(cid) or isHuman(cid) then return doPlayerSendCancel(cid, "Sorry, is not possible.") end if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then doPlayerSendCancel(cid, "You must put your card in the correct place!") return TRUE end if not canSummon(cid) then return doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM) end if getPlayerStorageValue(cid, 63215) >= 1 then return doPlayerSendCancel(cid, "You can't use card while surfing.") end if getPlayerStorageValue(cid, 62314) >= 1 then return doPlayerSendCancel(cid, "You can't use card while flying.") end if #getCreatureSummons(cid) >= 1 then return doPlayerSendCancel(cid, "You have already summoned a monster.") end for i,x in pairs(pokes) do if i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) then if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this monster.") return true end local removed = doCreateItem(1285, 1, getThingPos(cid)) doSummonMonster(cid, i) local pk = getCreatureSummons(cid)[1] doTeleportThing(pk, getClosestFreeTile(pk, getThingPos(cid)), false) doRemoveItem(removed, 1) doCreatureSetLookDir(pk, 2) local maxh = pokes[getCreatureName(pk)].vida local levellife = ((getPlayerLevel(cid)) *2+ getPokemonBoost(getPlayerSlotItem(cid,8).uid)) local health = tonumber(getItemAttribute(item.uid, "poke"):match("%[(.-)/")) doConvinceCreature(cid, pk) doCreatureAddHealth(pk, health-maxh) local pct = ((getCreatureHealth(pk)) / (getCreatureMaxHealth(pk))) local vidis = (getCreatureHealth(pk)) setCreatureMaxHealth(pk, ((maxh) + (levellife))) doCreatureAddHealth(pk, 2) doCreatureAddHealth(pk, -vidis) doCreatureAddHealth(pk, ((getCreatureMaxHealth(pk)) * (pct)) - 2) doTransformItem(item.uid, item.itemid+1) local pokename = getCreatureName(getCreatureSummons(cid)[1]) local mgo = msgunicago:gsub("doka", pokename) doCreatureSay(cid, mgo, TALKTYPE_SAY) if math.random(1,100) <= 35 then setPokemonFeed(cid, getPokemonFeed(cid)-5) -- Food system end doSendFeedEffect(cid) if getItemAttribute(item.uid, "nome") ~= "Ditto" then for i = 1, 12 do if not getMoveNamee(cid, i) then addEvent(doGoBackSetCooldown, 200, cid) end end else for a = 1, 12 do setPokemonCooldown(cid, a, "Don't have this move.") end end ----- Burn, venom e ice system ------ getBurn(cid) getVenom(cid) getIce(cid) ----- Burn, venom e ice system ------ doItemSetAttribute(item.uid, "poke", getItemAttribute(item.uid, "poke"):sub(1, findLetter(getItemAttribute(item.uid, "poke"), "."))) doItemSetAttribute(item.uid, "pokes", ""..pokename.."") doSendMagicEffect(getCreaturePosition(pk), effect) setPlayerStorageValue(cid, 61204, 1) registerCreatureEvent(pk, "DiePoke") registerCreatureEvent(pk, "Exp") --ShinyBallSystem\/ isShinyBallOrBoosted(cid, item) if getPlayerStorageValue(cid, 991) >= 1 then --- Ginasios doSendAnimatedText(getThingPos(cid), "POKEIN", TEXTCOLOR_LIGHTBLUE) end break end end end return TRUE end ID Das balls: 11642-12193;7854-7883;11624-11626;11627-11629;11618-11620;11621-11623;2655;2656;2659;2657;2224;2227;2658;2220;2221;2222;2223;2653;2654;2651;2652 Link para o comentário https://xtibia.com/forum/topic/237412-n%C3%A3o-carregar-pokemons-iguais-e-pok%C3%A9mon-que-s%C3%B3-pode-ser-usado-por-storage/#findComment-1673252 Compartilhar em outros sites More sharing options...
0 zipter98 1102 Postado Outubro 17, 2015 Share Postado Outubro 17, 2015 (editado) Abaixo de: if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this monster.") return true end coloque: ----------- Bloqueio para pokémons iguais local pokeballs = {} --Configure nesta tabela o ID das pokeballs (on/off). function getPokeballsInContainer(container) -- Function By Kydrai if not isContainer(container) then return {} end local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot = 0, getContainerSize(container) - 1 do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getPokeballsInContainer(item.uid) for i = 0, #itemsbag do table.insert(items, itemsbag[i]) end elseif isInArray(pokeballs, item.itemid) then table.insert(items, item.uid) end end end return items end local player_pokeballs = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid) if #player_pokeballs > 0 then for i = 1, #player_pokeballs do local poke_name = getItemAttribute(player_pokeballs[i], "poke"):sub(9, findLetter(getItemAttribute(player_pokeballs[i], "poke"), "'") - 1) if poke_name == i then return doPlayerSendCancel(cid, "You can't carry two or more pokemons of the same specie.") end end end ----------- Pokémons restritos por storage local restrict_pokes = { --["nome_do_pokemon"] = {key = storage, value = valor_da_storage}, ["Shiny Flareon"] = {key = 92291, value = 5}, ["Shiny Fearow"] = {key = 3923, value = 5}, } local p = restrict_pokes[i] if p and getPlayerStorageValue(cid, p.key) ~= p.value then return doPlayerSendCancel(cid, "Sorry, you can't use this pokemon.") end Editado Outubro 17, 2015 por zipter98 Link para o comentário https://xtibia.com/forum/topic/237412-n%C3%A3o-carregar-pokemons-iguais-e-pok%C3%A9mon-que-s%C3%B3-pode-ser-usado-por-storage/#findComment-1673294 Compartilhar em outros sites More sharing options...
0 Amantezinho 18 Postado Outubro 18, 2015 Autor Share Postado Outubro 18, 2015 (editado) Eu acho q o certo seria fazer a verificação junto com a verificação que só pode carregar 6 pokebolas. Não sei como funciona os servidores de pokemon de hoje, não sei se esta verificação é por script ou algum código nas sources. Desculpe não ter, lhe respondido, foi meu primo quem respondeu em meu lugar. Compreendo seu ponto de vista, porém a minha equipe ainda não conta com pessoas de confiança para dar-lhes informações da base do servidor, então modificar sources é um pouco complicado( pois realmente eu não sou bom nessa parte.) Mas agradeço a sua preocupação em ajudar. Abaixo de:if getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) then doPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this monster.") return true end coloque: ----------- Bloqueio para pokémons iguais local pokeballs = {} --Configure nesta tabela o ID das pokeballs (on/off). function getPokeballsInContainer(container) -- Function By Kydrai if not isContainer(container) then return {} end local items = {} if isContainer(container) and getContainerSize(container) > 0 then for slot = 0, getContainerSize(container) - 1 do local item = getContainerItem(container, slot) if isContainer(item.uid) then local itemsbag = getPokeballsInContainer(item.uid) for i = 0, #itemsbag do table.insert(items, itemsbag) end elseif isInArray(pokeballs, item.itemid) then table.insert(items, item.uid) end end end return items end local player_pokeballs = getPokeballsInContainer(getPlayerSlotItem(cid, 3).uid) if #player_pokeballs > 0 then for i = 1, #player_pokeballs do local poke_name = getItemAttribute(player_pokeballs, "poke"):sub(9, findLetter(getItemAttribute(player_pokeballs, "poke"), "'") - 1) if poke_name == i then return doPlayerSendCancel(cid, "You can't carry two or more pokemons of the same specie.") end end end ----------- Pokémons restritos por storage local restrict_pokes = { --["nome_do_pokemon"] = {key = storage, value = valor_da_storage}, ["Shiny Flareon"] = {key = 92291, value = 5}, ["Shiny Fearow"] = {key = 3923, value = 5}, } local p = restrict_pokes if p and getPlayerStorageValue(cid, p.key) ~= p.value then return doPlayerSendCancel(cid, "Sorry, you can't use this pokemon.") end Zipter, quanto ao seu script, na parte dos id's das balls, estou usando icon system, como coloco os IDS? tem como por um exemplo? (tipo, os espaços, vírgulas e ponto-e-vírgula?) Não estou conseguindo impedir de carregar 2 pokes, coloquei os ID on/off das balls normais, coloquei tamém dos icones e nada. :\ Editado Outubro 19, 2015 por Iluargrott2 Link para o comentário https://xtibia.com/forum/topic/237412-n%C3%A3o-carregar-pokemons-iguais-e-pok%C3%A9mon-que-s%C3%B3-pode-ser-usado-por-storage/#findComment-1673388 Compartilhar em outros sites More sharing options...
Pergunta
Amantezinho 18
Boa tarde galera....
Pedido1: Um script que impeça o carregamento de mais de um pokémon igual. (ex: 2 charmander, etc)
Pedido2: Algo estilo o sistema de Clãs (ou este mesmo, pois não achei), que só pode usar o Pokémon sendo de tal clã, ou tendo tal storage.
Agradeço desde já;
Link para o comentário
https://xtibia.com/forum/topic/237412-n%C3%A3o-carregar-pokemons-iguais-e-pok%C3%A9mon-que-s%C3%B3-pode-ser-usado-por-storage/Compartilhar em outros sites
5 respostass a esta questão
Posts Recomendados