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.
Por Amantezinho, 16 de out. de 2015 em Scripts
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.
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.
info
Grupo: Campones
Registrado: 02/10/15
Posts: 92
Reputação: +18

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 thenreturn trueend--------msgunicaback = backMSG[math.random(#backMSG)]msgunicago = goMSG[math.random(#goMSG)]btype = getPokeballType(item.itemid)usando = pokeballs[btype].useonline = pokeballs[btype].onmorto = pokeballs[btype].offif isIconeSystem(cid) theneffect = getItemAttribute(item.uid, "effect")elseeffect = getItemAttribute(item.uid, "effect")end--------if item.itemid == usando thenif #getCreatureSummons(cid) >= 1 thenlocal z = getCreatureSummons(cid)[1]local pokename = getCreatureName(z)local mbk = msgunicaback:gsub("doka", pokename)if getItemAttribute(item.uid, "poke"):find(getCreatureName(z)) thendoTransformItem(item.uid, item.itemid-1)doCreatureSay(cid, mbk, TALKTYPE_SAY)local summom = getCreatureSummons(cid)local maxh = pokes[getCreatureName(summom[1])].vidalocal 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 thensetPokemonFeed(cid, getPokemonFeed(cid)-15) -- Food systemenddoItemSetAttribute(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 --- GinasiosdoSendAnimatedText(getThingPos(cid), "POKEOUT", 181)setPlayerStorageValue(cid, 991, getPlayerStorageValue(cid, 991) -1)endreturn trueendendelseif item.itemid == morto thenreturn doPlayerSendCancel(cid, "This monster is fainted.")elseif item.itemid == online thenif isZumbie(cid) or isHuman(cid) thenreturn doPlayerSendCancel(cid, "Sorry, is not possible.")endif item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid thendoPlayerSendCancel(cid, "You must put your card in the correct place!")return TRUEendif not canSummon(cid) thenreturn doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTENOUGHROOM)endif getPlayerStorageValue(cid, 63215) >= 1 thenreturn doPlayerSendCancel(cid, "You can't use card while surfing.")endif getPlayerStorageValue(cid, 62314) >= 1 thenreturn doPlayerSendCancel(cid, "You can't use card while flying.")endif #getCreatureSummons(cid) >= 1 thenreturn doPlayerSendCancel(cid, "You have already summoned a monster.")endfor i,x in pairs(pokes) doif i == getItemAttribute(item.uid, "poke"):sub(9, findLetter(getItemAttribute(item.uid, "poke"), "'")-1) thenif getPlayerLevel(cid) < x.level+getPokemonBoostt(item.uid) thendoPlayerSendCancel(cid, "You need level "..x.level+getPokemonBoostt(item.uid).." or higher to use this monster.")return trueendlocal 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)].vidalocal 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 thensetPokemonFeed(cid, getPokemonFeed(cid)-5) -- Food systemenddoSendFeedEffect(cid)if getItemAttribute(item.uid, "nome") ~= "Ditto" thenfor i = 1, 12 doif not getMoveNamee(cid, i) thenaddEvent(doGoBackSetCooldown, 200, cid)endendelsefor a = 1, 12 dosetPokemonCooldown(cid, a, "Don't have this move.")endend----- 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 --- GinasiosdoSendAnimatedText(getThingPos(cid), "POKEIN", TEXTCOLOR_LIGHTBLUE)endbreakendendendreturn TRUEend
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
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
----------- 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 por zipter98
info
Grupo: Campones
Registrado: 02/10/15
Posts: 92
Reputação: +18

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) thendoPlayerSendCancel(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 por Iluargrott2
info
Grupo: Campones
Registrado: 02/10/15
Posts: 92
Reputação: +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á;