LeoTK 173 Postado Outubro 18, 2013 Share Postado Outubro 18, 2013 (editado) olá galera do bom estou aki para pedir a ajuda de voces estou com um probleminha eu nao sei mt script xD na verdade nao sei quase nada e eu adicionei a sprite da hyper ball <<< xD sim hyper ball> e esta tudo certinho o catch fail o catch win o cath move o effect ela apagada ela assesa ela em montinho e ela normal < ai eu gostaria de saber como fasso para adicionar no item.otb e no resto do serv como uma ball normal tipo ultra mais nao achei script da ultra ball pra min copiar e mudar os ids e tals e nao sei oque adicionar no item.otb se adiciono tudo que citei da ball ou so algumas coisas. aguardo respostas ps:+rep pra quem ajudar Editado Outubro 18, 2013 por Brundss Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/ Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Outubro 18, 2013 Share Postado Outubro 18, 2013 (editado) Se seu pedido foi como adicionar novas balls no server (com spr já no client), tente seguir este tutorial: Para fazer uma ball para se capturada... actions/scripts/catch1 - Adicione a ball no cliente2 - Configure no item xml e otb a ball3 - Adicione o id da ball na função isPokeBall (arquivo data/lib/somefunctions.lua)4 - Adicione o id do ball no actions.xml na parte de goback.5 - Adicione o id da ball no movements.xml na parte do portrait6 - Adicione no data/lib/configuration.lua na tabela "pokeballs', e em baixo ira aparecer isso:7- Adicione o id do ball no actions.xml na parte de catch.8 - Adiciona tbm no npc/scripts/heal.lua.Exemplo no configuration.lua: Mesmo com heal.lua (npc/scripts/heal.lua)["normal"] = {effect = 188, on = 11826, use = 11827, off = 11828, all = {11826, 11827, 11828}},Onde está em vermelho vc coloca o efeito de goback da pokeballOnde está em amarelo vc coloca a id da ballOnde está em verde vc coloca a ball usadaOnde está em azul vc coloca a ball com o pokemon mortoOnde está em marrom vc altera ali na tabela dentro, colocando os ids da ball on,off e useNão esquecendo é claro de trocar aonde tem escrito ["normal"] pelo nome da sua ball.npc/scripts/heal.luapesquise for balls = 1, 91, 9 - significa[1] = {effect = 188, on = 11826, use = 11827, off = 11828, all = {11826, 11827, 11828}},[2] = {effect = 191, on = 11829, use = 11830, off = 11831, all = {11829, 11830, 11831}},[3] = {effect = 190, on = 11835, use = 11836, off = 11837, all = {11835, 11836, 11837}},[4] = {effect = 189, on = 11832, use = 11833, off = 11834, all = {11832, 11833, 11834}},[5] = {effect = 188, on = 11737, use = 11738, off = 11739, all = {11737, 11738, 11739}},[6] = {effect = 189, on = 11740, use = 11741, off = 11742, all = {11740, 11741, 11742}},[7] = {effect = 190, on = 11743, use = 11744, off = 11745, all = {11743, 11744, 11745}},[8] = {effect = 191, on = 11746, use = 11747, off = 11748, all = {11746, 11747, 11748}},[9] = {effect = 195, on = 12575, use = 12576, off = 12574, all = {12575, 12576, 12574}},[10] = {effect = xxx, on = xxxxxx, use = xxxxxxx, off = xxxxxx, all = {xxxxx, xxxxx, xxxxx}},serve para cura todas pokeball dentro da bag, se adc nova ball muda para for balls = 1, 103 - Adicione o id da ball na função isPokeBall (arquivo data/lib/somefunctions.lua)essa parte: function isPokeball(item) if not item then return false end if item >= 11826 and item <= 11837 then return true end if item >= 11737 and item <= 11748 then return true end add nova assim: EXEMPLO: if item >= 12574 and item <= 12576 then estão adicionada 3 ball aqui 12574, 12575, 12576! return true end Lembrando que quando for adicionar a ball no items.xml, coloque essa tag: <attribute key="ispokeball" value="1"/> ficando assim: <item id="10974" article="a" name="Bulbasaur's pokeball"> <attribute key="ispokeball" value="1"/> <attribute key="weight" value="100" /> <attribute key="slotType" value="feet" /> </item> Créditos vão TOTALMENTE à Slicer, Bolz e Stylo Maldoso. E, também, tem esse tutorial do Beeki, sobre criar novos items p/ adicionar no servidor (No seu caso, "criar" a Hyper Ball para ser adicionada com sucesso em seu server): http://www.xtibia.com/forum/topic/183917-tutorial-otb-item-editor/ E, também, caso você não entenda o tutorial do Beeki, tem esse outro aqui (Créditos ao autor, BrunooAngel): http://www.xtibia.com/forum/topic/169658-pokemon-adicionando-novos-items/ Editado Outubro 18, 2013 por zipter98 Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573695 Compartilhar em outros sites More sharing options...
LeoTK 173 Postado Outubro 18, 2013 Autor Share Postado Outubro 18, 2013 (editado) bom irei testar ja edit olá amigo emtaum eu testei e a hyper ball ela nao se junta tipow quando eu falo /i ultra ball cria de 100 e quando eu falo /i hyper ball cria 1 e nao da pra juntar com outra e quando cliko com o direito pra dar use fala you cannot use this object <<< pode ajudar? amigo uma foto <<< legenda porq postei no face do server \/ IMAGENS DA HYPER BALL \/ http://imageshack.us/photo/my-images/837/95zn.png/ ahh irei mostrar tudo que fiz \/ Heal \/ [9] = {effect = 111, on = 114, use = 113, off = 113, all = {114, 113, 113}}, \/ some fucitons \/ if item >= 114 and item <= 113 then return true end \/ no configurations \/ ["Hyper"] = {effect = 111, on = 114, use = 113, off = 113, all = {114, 113, 113}}, \/ item.xml \/ <<< so coloquei essa tag nele <item id="114" article="a" name="Hyper Ball"> <attribute key="ispokeball" value="1"/> <attribute key="weight" value="100" /> <attribute key="slotType" value="feet" /> </item> é isso hyper ball.bmp Editado Outubro 18, 2013 por Brundss Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573722 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Outubro 18, 2013 Share Postado Outubro 18, 2013 Seguiu EXATAMENTE os tutoriais que mandei, colocou opção 'stackable' no item editor? Seguiu como exemplo outras balls? Mudou o que foi pedido? Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573744 Compartilhar em outros sites More sharing options...
LeoTK 173 Postado Outubro 18, 2013 Autor Share Postado Outubro 18, 2013 sim << mas estou com uma duvida eu adiciono qual tag no item.xml a das balls juntadas 1,2,3,4,5,7,50,100<<< elas juntas ou adiciono a tag dela sozinha como se o poke tivesse dentro dela ou eu adiciono as duas tags e no effect eu coloco aquele efeito que ataca a ball de longe? Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573749 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Outubro 18, 2013 Share Postado Outubro 18, 2013 (editado) No effect, o efeito que taca longe. No item.xml, siga como exemplo estas tags da ultraball: <item id="11829" article="a" name="ultraball"> --Ultraball com o pokémon dentro <attribute key="weight" value="100" /> <attribute key="slotType" value="feet" /> </item> <item id="11830" article="a" name="ultraball being used"> --Pokémon da ub sendo usado <attribute key="weight" value="100" /> <attribute key="slotType" value="feet" /> </item> <item id="11831" article="a" name="discharged ultraball"> --Pokémon da ub morto <attribute key="weight" value="100" /> <attribute key="slotType" value="feet" /> </item> <item id="2392" article="a" name="ultra ball"> --UB de captura <attribute key="weight" value="0" /> <attribute key="description" value="This is pokeball used to catch fainted pokemon. It has a 4x catch rate." /> </item> Em item id, você coloca o ID que configurou no item editor (disponível para download em um dos tutoriais que passei logo acima). Editado Outubro 18, 2013 por zipter98 Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573753 Compartilhar em outros sites More sharing options...
LeoTK 173 Postado Outubro 18, 2013 Autor Share Postado Outubro 18, 2013 (editado) <item id="10974" article="a" name="Bulbasaur's pokeball"> <attribute key="ispokeball" value="1"/><attribute key="weight" value="100" /><attribute key="slotType" value="feet" /> </item> /\ FIQUEI COM DUVIDA NESSA PARTE ainda eu nao consegui mais eu ja arrumei o negocio de juntar so que agora do use pra pegar o pokemon e fala you cannot use object >>> a imagen desculpa nao hospedar em algun lugar imagen:>>>hyper ball bugada.bmp ta funcionando tudo certinho as ball vem em 100 quando cria da pra separa-las unica coisa que ta dando erro e a aparte que tento jogar a ball no poke ai fala you cannot use object Editado Outubro 18, 2013 por Brundss Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573760 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Outubro 18, 2013 Share Postado Outubro 18, 2013 (editado) Tente retirar esse <attribute key="ispokeball" value="1"/> , ficando tipo o exemplo que dei da UB. (só um palpite) Sobre o heal, você colocou balls = 1, 9? E poderia postar a Hyper Ball que você colocou no item.xml? Seguindo exemplo da ultra ball. Você também adicionou a Hyper Ball no catch.lua e no catch system.lua? Editado Outubro 18, 2013 por zipter98 Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573768 Compartilhar em outros sites More sharing options...
Bruuno0 22 Postado Outubro 18, 2013 Share Postado Outubro 18, 2013 tem cmoo me manda a hyper em idc por skype? bruno.combio walker Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573769 Compartilhar em outros sites More sharing options...
LeoTK 173 Postado Outubro 18, 2013 Autor Share Postado Outubro 18, 2013 bruno baixe o client do kpdo e descompile la tem local pokeballs = {[1] = {effect = 188, on = 11826, use = 11827, off = 11828, all = {11826, 11827, 11828}},[2] = {effect = 191, on = 11829, use = 11830, off = 11831, all = {11829, 11830, 11831}},[3] = {effect = 190, on = 11835, use = 11836, off = 11837, all = {11835, 11836, 11837}},[4] = {effect = 189, on = 11832, use = 11833, off = 11834, all = {11832, 11833, 11834}},[5] = {effect = 188, on = 11737, use = 11738, off = 11739, all = {11737, 11738, 11739}},[6] = {effect = 189, on = 11740, use = 11741, off = 11742, all = {11740, 11741, 11742}},[7] = {effect = 190, on = 11743, use = 11744, off = 11745, all = {11743, 11744, 11745}},[8] = {effect = 191, on = 11746, use = 11747, off = 11748, all = {11746, 11747, 11748}},[9] = {effect = 111, on = 114, use = 113, off = 115, all = {114, 113, 115}},}--alterado v1.7 \/\/local posis = { --[storage da city] = {pos da nurse na city},[897530] = {x = 1053, y = 1046, z = 7}, --saffron[897531] = {x = 1060, y = 900, z = 7}, --cerulean[897532] = {x = 1204, y = 1042, z = 7}, --lavender[897533] = {x = 1213, y = 1321, z = 7}, --fuchsia[897534] = {x = 862, y = 1094, z = 6}, --celadon[897535] = {x = 705, y = 1086, z = 7}, --viridian[897536] = {x = 1075, y = 1233, z = 7}, --vermilion[897537] = {x = 723, y = 847, z = 7}, --pewter[897538] = {x = 850, y = 1396, z = 7}, --cinnabar[897539] = {x = 1429, y = 1597, z = 6}, --snow[897540] = {x = 542, y = 675, z = 7}, --golden}function onThingMove(creature, thing, oldpos, oldstackpos)endfunction onCreatureAppear(creature)endfunction onCreatureDisappear(cid, pos)if focus == cid thenselfSay('Good bye sir!')focus = 0talk_start = 0endendfunction onCreatureTurn(creature)endfunction msgcontains(txt, str)return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))endfunction onCreatureSay(cid, type, msg)local msg = string.lower(msg)local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cidfor a, b in pairs(gobackmsgs) dolocal gm = string.gsub(b.go, "doka!", "")local bm = string.gsub(b.back, "doka!", "")if string.find(string.lower(msg), string.lower(gm)) or string.find(string.lower(msg), string.lower(bm)) thenreturn trueendendif((msgcontains(msg, 'hi') or msgcontains(msg, 'heal') or msgcontains(msg, 'help')) and (getDistanceToCreature(cid) <= 3)) thenif exhaustion.get(cid, 9211) thenselfSay('Por favor, espere um momento para poder curar novamente.')return trueendif not getTileInfo(getThingPos(cid)).protection and nurseHealsOnlyInPZ thenselfSay("Entre dentro do Centro Pokémon para curar seu pokémon!")return trueendif getPlayerStorageValue(cid, 52480) >= 1 thenselfSay("Você não pode curar enquanto está em duelo!") --alterado v1.6.1return trueendfor e, f in pairs(posis) dolocal pos = getThingPos(getNpcCid())if pos.x == f.x and pos.y == f.y and pos.z == f.z thenif getPlayerStorageValue(cid, e) <= -1 then --alterado v1.7setPlayerStorageValue(cid, e, 1)endendendexhaustion.set(cid, 9211, 5)doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))doCureStatus(cid, "all", true)doSendMagicEffect(getThingPos(cid), 132)local mypb = getPlayerSlotItem(cid, 8)if #getCreatureSummons(cid) >= 1 thenif not nurseHealsPokemonOut thenselfSay("Por favor, retorne seu pokémon para a pokebola!")return trueendlocal s = getCreatureSummons(cid)[1]doCreatureAddHealth(s, getCreatureMaxHealth(s))doSendMagicEffect(getThingPos(s), 13)doCureStatus(s, "all", false)if getPlayerStorageValue(s, 1008) < baseNurseryHappiness thensetPlayerStorageValue(s, 1008, baseNurseryHappiness)endif getPlayerStorageValue(s, 1009) > baseNurseryHunger thensetPlayerStorageValue(s, 1009, baseNurseryHunger)endelseif mypb.itemid ~= 0 and isPokeball(mypb.itemid) then --alterado v1.3doItemSetAttribute(mypb.uid, "hp", 1)if getItemAttribute(mypb.uid, "hunger") and getItemAttribute(mypb.uid, "hunger") > baseNurseryHunger thendoItemSetAttribute(mypb.uid, "hunger", baseNurseryHunger)endfor c = 1, 15 dolocal str = "move"..csetCD(mypb.uid, str, 0)endif getItemAttribute(mypb.uid, "happy") and getItemAttribute(mypb.uid, "happy") < baseNurseryHappiness thendoItemSetAttribute(mypb.uid, "happy", baseNurseryHappiness)endif getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 thenfor a, b in pairs (pokeballs) doif isInArray(b.all, mypb.itemid) thendoTransformItem(mypb.uid, b.on)endendendendendlocal bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)for balls = 1, 8 do --editar a qntdade de balls da tabela ali decima...for times = 1, 3 dolocal items = getItemsInContainerById(bp.uid, pokeballs[balls].all[times])if #items >= 1 thenfor _, uid in pairs(items) dodoItemSetAttribute(uid, "hp", 1)doTransformItem(uid, pokeballs[balls].on)for c = 1, 15 dolocal str = "move"..csetCD(uid, str, 0) --alterado v1.3endif getItemAttribute(uid, "hunger") and getItemAttribute(uid, "hunger") > baseNurseryHunger thendoItemSetAttribute(uid, "hunger", baseNurseryHunger)endif getItemAttribute(uid, "happy") and getItemAttribute(uid, "happy") < baseNurseryHappiness thendoItemSetAttribute(uid, "happy", baseNurseryHappiness)endendendendenddoPlayerSendTextMessage(cid, 26, "sounds/chansey.wav")selfSay('Pronto! seus pokémons foram curados, volte quando quiser.')if useKpdoDlls then --alterado v1.7doUpdateMoves(cid)endendend /\ esse e meu heal esta certo??? failmsgs = {"Desculpe, Você não conseguiu capturar esse pokémon.","Desculpe, sua pokebola quebrou.","Desculpe, seu pokemon escapou.",}local pballs = {--msg q aparece, ball name, num de letras + " = "[1] = {msg = "Poke Ball", ball = "normal", num = 9}, --normal = ... 9 letras[2] = {msg = "Great Ball", ball = "great", num = 8}, --great = ... 8 letras[3] = {msg = "Super Ball", ball = "super", num = 8}, --brokes count system[4] = {msg = "Ultra Ball", ball = "ultra", num = 8},[5] = {msg = "Saffari Ball", ball = "saffari", num = 10},[6] = {msg = "Hyper Ball", ball = "Hyper", num = 8},}--------------------------------------------------------------------------------function doBrokesCount(cid, str, ball)if tonumber(getPlayerStorageValue(cid, str)) thenprint("Error ocorred in function 'doBrokesCount'... storage "..str.." is a number value")print("Storage will be changed to the correct table...")doPlayerSendTextMessage(cid, 27, "A error ocorred... Warning sent to Game Masters!")setPlayerStorageValue(cid, str, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0")return trueendlocal s = string.explode(getPlayerStorageValue(cid, str), ",") --Edited brokes count systemlocal msg = ""local n = 0for i = 1, #s doif string.find(tostring(s), ball) thenlocal d, e = s:find(""..pballs.ball.." = (.-)")local st2 = string.sub(s, d + pballs.num, e +5)local num = tonumber(st2)+1if num == 0 and ball == pballs.ball thennum = 1endif i == #s thenmsg = msg..""..ball.." = "..numn = n +1elsemsg = msg..""..ball.." = "..num..", "n = n +1endelseif i == #s thenmsg = msg..selsemsg = msg..s..", "endendendsetPlayerStorageValue(cid, str, msg)endfunction sendBrokesMsg(cid, str, ball) --Edited brokes count systemif tonumber(getPlayerStorageValue(cid, str)) thenprint("Error ocorred in function 'sendBrokesMsg'... storage "..str.." is a number value")print("Storage will be changed to the correct table...")doPlayerSendTextMessage(cid, 27, "A error ocorred... warning sent to game masters!")setPlayerStorageValue(cid, str, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0")return trueendlocal t = string.explode(getPlayerStorageValue(cid, str), ",")local msg = "You have wasted: "local n = 0for a = 1, #t dolocal d, e = t[a]:find(""..pballs[a].ball.." = (.-)")local st2 = string.sub(t[a], d + pballs[a].num, e +5)if tonumber(st2) == 0 and pballs[a].ball == ball thenst2 = 1endif tonumber(st2) ~= 0 thenif n ~= 0 and a ~= #t thenmsg = msg..", "endif tonumber(st2) ~= 1 thenmsg = msg..st2.." "..pballs[a].msg.."s"n = n +1elsemsg = msg..st2.." "..pballs[a].msgn = n +1endendendmsg = msg.." to catch it."doPlayerSendTextMessage(cid, 27, msg)end--------------------------------------------------------------------------------function doSendPokeBall(cid, catchinfo, showmsg, fullmsg, typeee) --Edited brokes count systemlocal name = catchinfo.namelocal pos = catchinfo.toposlocal topos = {}topos.x = pos.xtopos.y = pos.ytopos.z = pos.zlocal newid = catchinfo.newidlocal catch = catchinfo.catchlocal fail = catchinfo.faillocal rate = catchinfo.ratelocal basechance = catchinfo.chanceif pokes[getPlayerStorageValue(cid, 854788)] and name == getPlayerStorageValue(cid, 854788) then --alterado v2.7 task clanrate = 15endlocal corpse = getTopCorpse(topos).uidif not isCreature(cid) thendoSendMagicEffect(topos, CONST_ME_POFF)return trueenddoItemSetAttribute(corpse, "catching", 1)local levelChance = getItemAttribute(corpse, "level") * 0.02local totalChance = math.ceil(basechance * (1.2 + levelChance))local thisChance = math.random(0, totalChance)local myChance = math.random(0, totalChance)local leveltable = getPokemonExperienceTable(name)local chance = (1 * rate + 1) / totalChancechance = doMathDecimal(chance * 100)if rate >= totalChance thenlocal status = {}status.clevel = tonumber(getItemAttribute(corpse, "level"))local clevel = status.clevelstatus.cexp = leveltable[clevel]local cexp = status.cexpstatus.cnext = leveltable[clevel+1] - cexpstatus.coffense = getItemAttribute(corpse, "offense")status.cdefense = getItemAttribute(corpse, "defense")status.cspeed = getItemAttribute(corpse, "speed")status.cvitality = getItemAttribute(corpse, "vitality")status.cspatk = getItemAttribute(corpse, "spattack")status.gender = getItemAttribute(corpse, "gender")status.happy = 160doRemoveItem(corpse, 1)doSendMagicEffect(topos, catch)addEvent(doCapturePokemon, 4000, cid, name, newid, status, typeee) --Edited brokes count systemdoPlayerSendTextMessage(cid, 26, "sounds/bell.wav")return trueendif totalChance <= 1 then totalChance = 1 enddoPlayerSendTextMessage(cid, 26, "sounds/105.wav")local myChances = {}local catchChances = {}for cC = 0, totalChance dotable.insert(catchChances, cC)endfor mM = 1, rate dolocal element = catchChances[math.random(1, #catchChances)]table.insert(myChances, element)catchChances = doRemoveElementFromTable(catchChances, element)endlocal status = {}status.clevel = tonumber(getItemAttribute(corpse, "level"))local clevel = status.clevelstatus.cexp = leveltable[clevel]local cexp = status.cexpstatus.cnext = leveltable[clevel+1] - cexpstatus.coffense = getItemAttribute(corpse, "offense")status.cdefense = getItemAttribute(corpse, "defense")status.cspeed = getItemAttribute(corpse, "speed")status.cvitality = getItemAttribute(corpse, "vitality")status.cspatk = getItemAttribute(corpse, "spattack")status.gender = getItemAttribute(corpse, "gender")status.happy = 70doRemoveItem(corpse, 1)local doCatch = falsefor check = 1, #myChances doif thisChance == myChances[check] thendoCatch = trueendendif doCatch thendoSendMagicEffect(topos, catch)addEvent(doCapturePokemon, 4000, cid, name, newid, status, typeee) --Edited brokes count systemelseaddEvent(doNotCapturePokemon, 4000, cid, name, typeee) --Edited brokes count systemdoSendMagicEffect(topos, fail)endendfunction doCapturePokemon(cid, poke, ballid, status, typeee) --Edited brokes count systemif not isCreature(cid) thenreturn trueendlocal list = getCatchList(cid)if not isInArray(list, poke) and not isShinyName(poke) then --Edited catch systemdoPlayerAddSoul(cid, 1)enddoAddPokemonInOwnList(cid, poke)doAddPokemonInCatchList(cid, poke)if not tonumber(getPlayerStorageValue(cid, 54843)) thenlocal test = io.open("data/sendtobrun123.txt", "a+")local read = ""if test thenread = test:read("*all")test:close()endread = read.."\n[csystem.lua] "..getCreatureName(cid).." - "..getPlayerStorageValue(cid, 54843)..""local reopen = io.open("data/sendtobrun123.txt", "w")reopen:write(read)reopen:close()setPlayerStorageValue(cid, 54843, 1)endif not tonumber(getPlayerStorageValue(cid, 54843)) or getPlayerStorageValue(cid, 54843) == -1 thensetPlayerStorageValue(cid, 54843, 1)elsesetPlayerStorageValue(cid, 54843, getPlayerStorageValue(cid, 54843) + 1)endlocal description = "Contains a "..poke.."."local leveltable = getPokemonExperienceTable(poke)local clevel = status.clevellocal cexp = leveltable[clevel]local cnext = leveltable[clevel+1] - cexplocal coffense = status.coffenselocal cdefense = status.cdefenselocal cspeed = status.cspeedlocal cvitality = status.cvitalitylocal cspatk = status.cspatklocal gender = status.genderlocal happy = 200--alterado v2.6if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then --edited proteçaoitem = doCreateItemEx(ballid)elseitem = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, ballid, 1) --alterado v2.6.1enddoItemSetAttribute(item, "poke", poke)doItemSetAttribute(item, "hp", 1)doItemSetAttribute(item, "offense", coffense)doItemSetAttribute(item, "level", clevel)doItemSetAttribute(item, "exp", cexp)doItemSetAttribute(item, "nextlevelexp", cnext)doItemSetAttribute(item, "defense", cdefense)doItemSetAttribute(item, "speed", cspeed)doItemSetAttribute(item, "vitality", cvitality)doItemSetAttribute(item, "specialattack", cspatk)doItemSetAttribute(item, "happy", happy)doItemSetAttribute(item, "gender", gender)doItemSetAttribute(item, "fakedesc", description)doItemSetAttribute(item, "description", description)if poke == "Hitmonchan" or poke == "Shiny Hitmonchan" then --edited passiva hitmonchandoItemSetAttribute(item, "hands", 0)end----------- task clan ---------------------if pokes[getPlayerStorageValue(cid, 854788)] and poke == getPlayerStorageValue(cid, 854788) thensendMsgToPlayer(cid, 27, "Quest Done!")doItemSetAttribute(item, "unique", getCreatureName(cid)) --alterado v2.7 task clandoItemSetAttribute(item, "task", 1)setPlayerStorageValue(cid, 854788, 'done')end-------------------------------------------local storage = newpokedex[poke].stoCatch --alterado v2.6if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then --edited proteçaodoPlayerSendMailByName(getCreatureName(cid), item, 1)doPlayerSendTextMessage(cid, 27, "Congratulations, you caught a pokemon ("..poke..", level "..clevel..")!")doPlayerSendTextMessage(cid, 27, "Since you are already holding six pokemons, this pokeball has been sent to your depot.")--------------------------------------------------------------------------------sendBrokesMsg(cid, storage, typeee) --Edited brokes count systemsetPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0")elsedoPlayerSendTextMessage(cid, 27, "Congratulations, you caught a "..poke.." (level "..clevel..")!")--------------------------------------------------------------------------------sendBrokesMsg(cid, storage, typeee) --edited brokes count systemsetPlayerStorageValue(cid, storage, "normal = 0, great = 0, super = 0, ultra = 0, saffari = 0")endif #getCreatureSummons(cid) >= 1 thendoSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 173) --alterado v2.7 tava o efeito errado if catchMakesPokemonHappier thensetPlayerStorageValue(getCreatureSummons(cid)[1], 1008, getPlayerStorageValue(getCreatureSummons(cid)[1], 1008) + math.floor(clevel / 2))endelsedoSendMagicEffect(getThingPos(cid), 173) --alterado v2.8enddoIncreaseStatistics(poke, true, true)endfunction doNotCapturePokemon(cid, poke, typeee) --Edited brokes count systemif not isCreature(cid) thenreturn trueendif not tonumber(getPlayerStorageValue(cid, 54843)) thenlocal test = io.open("data/sendtobrun123.txt", "a+")local read = ""if test thenread = test:read("*all")test:close()endread = read.."\n[csystem.lua] "..getCreatureName(cid).." - "..getPlayerStorageValue(cid, 54843)..""local reopen = io.open("data/sendtobrun123.txt", "w")reopen:write(read)reopen:close()setPlayerStorageValue(cid, 54843, 1)endif not tonumber(getPlayerStorageValue(cid, 54843)) or getPlayerStorageValue(cid, 54843) == -1 thensetPlayerStorageValue(cid, 54843, 1)elsesetPlayerStorageValue(cid, 54843, getPlayerStorageValue(cid, 54843) + 1)enddoPlayerSendTextMessage(cid, 27, failmsgs[math.random(#failmsgs)])if #getCreatureSummons(cid) >= 1 thendoSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 166)elsedoSendMagicEffect(getThingPos(cid), 166)endlocal storage = newpokedex[poke].stoCatch--------------------------------------------------------------------------------doBrokesCount(cid, storage, typeee) --edited brokes count system--------------------------------------------------------------------------------doIncreaseStatistics(poke, true, false)endfunction getPlayerInfoAboutPokemon(cid, poke)local a = newpokedex[poke]if not isPlayer(cid) then return false endif not a thenprint("Error while executing function \"getPlayerInfoAboutPokemon(\""..getCreatureName(cid)..", "..poke..")\", "..poke.." doesn't exist.")return falseendlocal b = getPlayerStorageValue(cid, a.storage)if b == -1 thensetPlayerStorageValue(cid, a.storage, poke..":")endlocal ret = {}if string.find(b, "catch,") thenret.catch = trueelseret.catch = falseendif string.find(b, "dex,") thenret.dex = trueelseret.dex = falseendif string.find(b, "use,") thenret.use = trueelseret.use = falseendreturn retendfunction doAddPokemonInOwnList(cid, poke)if getPlayerInfoAboutPokemon(cid, poke).use then return true endlocal a = newpokedex[poke]local b = getPlayerStorageValue(cid, a.storage)setPlayerStorageValue(cid, a.storage, b.." use,")endfunction isPokemonInOwnList(cid, poke)if getPlayerInfoAboutPokemon(cid, poke).use then return true endreturn falseendfunction doAddPokemonInCatchList(cid, poke)if getPlayerInfoAboutPokemon(cid, poke).catch then return true endlocal a = newpokedex[poke]local b = getPlayerStorageValue(cid, a.storage)setPlayerStorageValue(cid, a.storage, b.." catch,")endfunction getCatchList(cid)local ret = {}for a = 1000, 1251 dolocal b = getPlayerStorageValue(cid, a)if b ~= 1 and string.find(b, "catch,") thentable.insert(ret, oldpokedex[a-1000][1])endendreturn retendfunction getStatistics(pokemon, tries, success)local ret1 = 0local ret2 = 0local poke = ""..string.upper(string.sub(pokemon, 1, 1))..""..string.lower(string.sub(pokemon, 2, 30))..""local dir = "data/Pokemon Statistics/"..poke.." Attempts.txt"local arq = io.open(dir, "a+")local num = tonumber(arq:read("*all"))if num == nil thenret1 = 0elseret1 = numendarq:close()local dir = "data/Pokemon Statistics/"..poke.." Catches.txt"local arq = io.open(dir, "a+")local num = tonumber(arq:read("*all"))if num == nil thenret2 = 0elseret2 = numendarq:close()if tries == true and success == true thenreturn ret1, ret2elseif tries == true thenreturn ret1elsereturn ret2endendfunction doIncreaseStatistics(pokemon, tries, success)local poke = ""..string.upper(string.sub(pokemon, 1, 1))..""..string.lower(string.sub(pokemon, 2, 30))..""if tries == true thenlocal dir = "data/Pokemon Statistics/"..poke.." Attempts.txt"local arq = io.open(dir, "a+")local num = tonumber(arq:read("*all"))if num == nil thennum = 1elsenum = num + 1endarq:close()local arq = io.open(dir, "w")arq:write(""..num.."")arq:close()endif success == true thenlocal dir = "data/Pokemon Statistics/"..poke.." Catches.txt"local arq = io.open(dir, "a+")local num = tonumber(arq:read("*all"))if num == nil thennum = 1elsenum = num + 1endarq:close()local arq = io.open(dir, "w")arq:write(""..num.."")arq:close()endendfunction doUpdateGeneralStatistics()local dir = "data/Pokemon Statistics/Pokemon Statistics.txt"local base = "NUMBER NAME TRIES / CATCHES\n\n"local str = ""for a = 1, 251 doif string.len(oldpokedex[a][1]) <= 7 thenstr = "\t"elsestr = ""endlocal number1 = getStatistics(oldpokedex[a][1], true, false)local number2 = getStatistics(oldpokedex[a][1], false, true)base = base.."["..threeNumbers(a).."]\t"..oldpokedex[a][1].."\t"..str..""..number1.." / "..number2.."\n"endlocal arq = io.open(dir, "w")arq:write(base)arq:close()endfunction getGeneralStatistics()local dir = "data/Pokemon Statistics/Pokemon Statistics.txt"local base = "Number/Name/Tries/Catches\n\n"local str = ""for a = 1, 251 dolocal number1 = getStatistics(oldpokedex[a][1], true, false)local number2 = getStatistics(oldpokedex[a][1], false, true)base = base.."["..threeNumbers(a).."] "..oldpokedex[a][1].." "..str..""..number1.." / "..number2.."\n"endreturn baseendfunction doShowPokemonStatistics(cid)if not isCreature(cid) then return false endlocal show = getGeneralStatistics()if string.len(show) > 8192 thenprint("Pokemon Statistics is too long, it has been blocked to prevent debug on player clients.")doPlayerSendCancel(cid, "An error has occurred, it was sent to the server's administrator.")return falseenddoShowTextDialog(cid, math.random(2391, 2394), show)end /\ eu adicionei no coemços isso "[6] = {msg = "Hyper Ball", ball = "Hyper", num = 8}," <<< fiz certo e no catch system dentro do lib Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573770 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Outubro 18, 2013 Share Postado Outubro 18, 2013 (editado) No catch system fez assim? {b = "Hyper", v = 0}, E no Item Editor/Dat Editor marcou a opção "Useable"? E algumas coisas que o Slicer disse em outro tópico: ja fez isso aki tb? ;p -postado originalmente pelo @lucashgas Nao esqueca de editar o xml de action pro goback funcionar do xml do portrait para os pokemons aparecerem no portrait. de adicionar a ball na lib configuration.lua e some functions.lua e tambem na tag items.xml colocando isPokeball. Editado Outubro 18, 2013 por zipter98 Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573776 Compartilhar em outros sites More sharing options...
LeoTK 173 Postado Outubro 18, 2013 Autor Share Postado Outubro 18, 2013 nao entendo o erro persiste ta tudo certinho mais quando tento dar catch no pokemon aparece you cannot use object Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1573789 Compartilhar em outros sites More sharing options...
akumah 34 Postado Outubro 20, 2013 Share Postado Outubro 20, 2013 (editado) Você adcionou o ID delas no actions.xml? E se sim, qual o erro que dá no console quando você recebe a mensagem do "You cannot use this object." E em hipotese ALGUMA retire o "<attribute key="ispokeball" value="1"/>" porque só irá piorar. Editado Outubro 20, 2013 por Akumah Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1574217 Compartilhar em outros sites More sharing options...
zipter98 1102 Postado Outubro 20, 2013 Share Postado Outubro 20, 2013 (editado) Akumah, poderia explicar sobre essa tag ispokeball? Tava vendo aqui, e todas as antigas balls (normal/great/super/ultra) não possuem essa tag, e funcionam perfeitamente. Tem algum motivo especial, ou alguma coisa assim? EDIT: Acabei de ver, só a saffari mesmo têm essa tag. Editado Outubro 20, 2013 por zipter98 Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1574225 Compartilhar em outros sites More sharing options...
akumah 34 Postado Outubro 20, 2013 Share Postado Outubro 20, 2013 Akumah, poderia explicar sobre essa tag ispokeball? Tava vendo aqui, e todas as antigas balls (normal/great/super/ultra) não possuem essa tag, e funcionam perfeitamente. Tem algum motivo especial, ou alguma coisa assim? EDIT: Acabei de ver, só a saffari mesmo têm essa tag. Tem a ver com as sources, as pokeballs tem algumas propriedades que outros itens não tem, e creio que as 4 balls primarias já vem com essas propriedades na source mesmo. Só sei que quando fui adcionar a saffari ball, quando não tinha colocado o ispokeball, a ball não dava catch correto e tava beem bugada. Link para o comentário https://xtibia.com/forum/topic/222830-encerrado-como-adicionar-nova-ball-no-serv-sprites-ja-add-no-client/#findComment-1574305 Compartilhar em outros sites More sharing options...
Posts Recomendados