Diego Skate 3 Postado Janeiro 8, 2011 Share Postado Janeiro 8, 2011 (editado) Nome: Pokémon MOVE (Order System) Autor: PoRaI ou PoPoRaI Server: Polska 8.42 - Acho que pode funcionar em versões novas. Como functiona? No Pokémon Online funciona da seguinte maneira: Clicando no botão order e em algum local que possa andar, o pokémon vai até o local, então esse sistema funciona igualzinho ao sistema do Pokémon Online. 1º - Adiciona na LIB (Data → lib → functions.lua), você ira adicionar uma função criada pelo DOKMOS, doPushCreature. ------------------ Function doPushCreature(uid,direction,distance,time) by Dokmos ------------------ function doPushCreature(uid,direction,distance,time) if isCreature(uid) == TRUE then local rand = (2*math.random(0,1))-1 local rand2 = math.random(-1,0) if direction == 0 then signal = {0,rand,-rand,rand,-rand,0,-1,-1,-1,0,0,0} elseif direction == 1 then signal = {1,1,1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 2 then signal = {0,rand,-rand,rand,-rand,0,1,1,1,0,0,0} elseif direction == 3 then signal = {-1,-1,-1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 4 then signal = {-1,rand2,(-rand2)-1,0,1,rand2+1,rand2,0} elseif direction == 5 then signal = {1,-rand2,-((-rand2)-1),0,1,rand2+1,rand2,0} elseif direction == 6 then signal = {-1,rand2,(-rand2)-1,0,-1,(-rand2)-1,rand2,0} else signal = {1,-rand2,-((-rand2)-1),0,-1,(-rand2)-1,rand2,0} end local pos = getThingPos(uid) nsig = #signal nvar = 0 repeat nvar = nvar+1 newpos = {x=pos.x+(signal[nvar]),y=pos.y+(signal[(nsig/2)+nvar]),z=pos.z} newtile = {x=newpos.x,y=newpos.y,z=newpos.z,stackpos=0} until getTileThingByPos(newtile).uid ~= 0 and hasProperty(getTileThingByPos(newtile).uid,3) == FALSE and queryTileAddThing(uid,newpos) == 1 or nvar == (nsig/2) if distance == nil or distance == 1 then doTeleportThing(uid,newpos,TRUE) else distance = distance-1 doTeleportThing(uid,newpos,TRUE) if time ~= nil then addEvent(doPushCreature,time,uid,direction,distance,time) else addEvent(doPushCreature,500,uid,direction,distance,500) end end end end 2º - Em actions.xml coloque: <action itemid="idaqui" script="move.lua" allowfaruse="1"/> 3º - Cria um arquivo em: Data → Actions → Scripts um novo arquivo chamado move.lua function onUse(cid, item, frompos, item2, toPosition) function doOrderMove(cid) -- By PoRaI. local creature = getCreatureSummons(cid)[1] local pokepos = getCreaturePosition(creature) local ir = toPosition if pokepos.x == ir.x and pokepos.y == ir.y then return TRUE end if pokepos.x ~= ir.x or pokepos.y ~= ir.y then if(pokepos.y - ir.y) >= 1 then addEvent(doPushCreature, 300, creature, NORTH, pokepos.y - ir.y) end if(ir.y - pokepos.y) >= 1 then addEvent(doPushCreature, 300, creature, SOUTH, ir.y - pokepos.y) end if(pokepos.x - ir.x) >= 1 then doPushCreature(creature, WEST, pokepos.x - ir.x) end if(ir.x - pokepos.x) >= 1 then addEvent(doPushCreature, 300, creature, EAST, ir.x - pokepos.x) end return FALSE end end if #getCreatureSummons(cid) == 1 then doOrderMove(cid) end end Créditos ao PoRaI & DOKMOS Só estou divulgando! Editado Janeiro 11, 2011 por Diego Skate Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/ Compartilhar em outros sites More sharing options...
brun123 369 Postado Janeiro 8, 2011 Share Postado Janeiro 8, 2011 (editado) bugs que encontrei: Se ficar usando o order sem parar o pokemon começa a blinkar que nem maluco. Como o delay do doPushCreature é de 300, pokemons muito lerdos aparentam estar teletransportando. Devido a falta do return true, quando usa o order aparece a mensagem "You cannot use this object." mas o script roda mesmo assim. Ficaria melhor se o treinador falasse "<nome do poke>, move!" ou algo assim pra parecer realmente que foi uma ordem, e não uma telepatia com o pokemon. Não é culpa sua isso, mas já era de se esperar que o PoRai não liberasse o order dele perfeitinho (sei que ele é capaz porque já vi varios teasers/joguei no server dele). Vlw mesmo assim por compartilhar, ainda mais essa função doPushCreature que pouca gente conhecia. Isso ai é a base perfeita pra fazer o order A propósito, esse Dokmos é um gênio, quem usa a própria função para fazer a mesma função? Esse doPushCreature é sinistro Editado Janeiro 8, 2011 por brun123 Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986116 Compartilhar em outros sites More sharing options...
Diego Skate 3 Postado Janeiro 8, 2011 Autor Share Postado Janeiro 8, 2011 então só apenas divulguei não mexo com scripter então se pah já tira uma base Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986127 Compartilhar em outros sites More sharing options...
kevinloko 10 Postado Janeiro 9, 2011 Share Postado Janeiro 9, 2011 (editado) Ei eu queria saber aonde eu coloko essa parte 1º - Adiciona na LIB (Data → lib → functions.lua), você ira adicionar uma função criada pelo DOKMOS, doPushCreature.------------------ Function doPushCreature(uid,direction,distance,time) by Dokmos ------------------ function doPushCreature(uid,direction,distance,time) if isCreature(uid) == TRUE then local rand = (2*math.random(0,1))-1 local rand2 = math.random(-1,0) if direction == 0 then signal = {0,rand,-rand,rand,-rand,0,-1,-1,-1,0,0,0} elseif direction == 1 then signal = {1,1,1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 2 then signal = {0,rand,-rand,rand,-rand,0,1,1,1,0,0,0} elseif direction == 3 then signal = {-1,-1,-1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 4 then signal = {-1,rand2,(-rand2)-1,0,1,rand2+1,rand2,0} elseif direction == 5 then signal = {1,-rand2,-((-rand2)-1),0,1,rand2+1,rand2,0} elseif direction == 6 then signal = {-1,rand2,(-rand2)-1,0,-1,(-rand2)-1,rand2,0} else signal = {1,-rand2,-((-rand2)-1),0,-1,(-rand2)-1,rand2,0} end local pos = getThingPos(uid) nsig = #signal nvar = 0 repeat nvar = nvar+1 newpos = {x=pos.x+(signal[nvar]),y=pos.y+(signal[(nsig/2)+nvar]),z=pos.z} newtile = {x=newpos.x,y=newpos.y,z=newpos.z,stackpos=0} until getTileThingByPos(newtile).uid ~= 0 and hasProperty(getTileThingByPos(newtile).uid,3) == FALSE and queryTileAddThing(uid,newpos) == 1 or nvar == (nsig/2) if distance == nil or distance == 1 then doTeleportThing(uid,newpos,TRUE) else distance = distance-1 doTeleportThing(uid,newpos,TRUE) if time ~= nil then addEvent(doPushCreature,time,uid,direction,distance,time) else addEvent(doPushCreature,500,uid,direction,distance,500) end end end end TIPOW MEU CHAR VAI JUNTO COM O POKE =/ Editado Janeiro 9, 2011 por Lolboss Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986180 Compartilhar em outros sites More sharing options...
Vampiresco 35 Postado Janeiro 9, 2011 Share Postado Janeiro 9, 2011 Será que funciona para a versão 8.54? Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986269 Compartilhar em outros sites More sharing options...
camcam 3 Postado Janeiro 9, 2011 Share Postado Janeiro 9, 2011 Alguem Ja Testou Em 8,54? e Viu Se Funfou? Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986377 Compartilhar em outros sites More sharing options...
phelipericardao 4 Postado Janeiro 9, 2011 Share Postado Janeiro 9, 2011 AK NO SERVER FAMILIA POKEMOn 8.54 o sever cai no quando vai liga com o sistem ! Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986386 Compartilhar em outros sites More sharing options...
papamix 1 Postado Janeiro 9, 2011 Share Postado Janeiro 9, 2011 Ae uma boa base de move pro pokeserv aki do forum rep+ pela ajuda ae Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986535 Compartilhar em outros sites More sharing options...
Administrador PoRaI 99 Postado Janeiro 10, 2011 Administrador Share Postado Janeiro 10, 2011 (editado) Dokmos é um programador em C++ A proposito, 90% de chance de não funcionar em um servidor 8.54 (desses de pokémon) suas libs é source são muito desatualizadas. Eu que criei o script, eu usei a função doPushCreature por que tava com preguiça de fazer uma .__. Não pensei que o script iria vazar tão rapido assim. Se vocês querem que aparece msg: "Pikachu, move!" faça assim: function onUse(cid, item, frompos, item2, toPosition)function doOrderMove(cid) -- By PoRaI. local creature = getCreatureSummons(cid)[1] local pokepos = getCreaturePosition(creature) local ir = toPosition if pokepos.x == ir.x and pokepos.y == ir.y then return TRUE end if pokepos.x ~= ir.x or pokepos.y ~= ir.y then if(pokepos.y - ir.y) >= 1 then addEvent(doPushCreature, 300, creature, NORTH, pokepos.y - ir.y) end if(ir.y - pokepos.y) >= 1 then addEvent(doPushCreature, 300, creature, SOUTH, ir.y - pokepos.y) end if(pokepos.x - ir.x) >= 1 then doPushCreature(creature, WEST, pokepos.x - ir.x) end if(ir.x - pokepos.x) >= 1 then addEvent(doPushCreature, 300, creature, EAST, ir.x - pokepos.x) end return FALSE end end if #getCreatureSummons(cid) == 1 then doCreatureSay(cid,getCreatureName(creature) ..", move!",1) doOrderMove(cid) end end Editado Janeiro 10, 2011 por PoRaI Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986565 Compartilhar em outros sites More sharing options...
kevinloko 10 Postado Janeiro 10, 2011 Share Postado Janeiro 10, 2011 Dokmos é um programador em C++ A proposito, 90% de chance de não funcionar em um servidor 8.54 (desses de pokémon) suas libs é source são muito desatualizadas. Eu que criei o script, eu usei a função doPushCreature por que tava com preguiça de fazer uma .__. Não pensei que o script iria vazar tão rapido assim. Se vocês querem que aparece msg: "Pikachu, move!" faça assim: function onUse(cid, item, frompos, item2, toPosition)function doOrderMove(cid) -- By PoRaI. local creature = getCreatureSummons(cid)[1] local pokepos = getCreaturePosition(creature) local ir = toPosition if pokepos.x == ir.x and pokepos.y == ir.y then return TRUE end if pokepos.x ~= ir.x or pokepos.y ~= ir.y then if(pokepos.y - ir.y) >= 1 then addEvent(doPushCreature, 300, creature, NORTH, pokepos.y - ir.y) end if(ir.y - pokepos.y) >= 1 then addEvent(doPushCreature, 300, creature, SOUTH, ir.y - pokepos.y) end if(pokepos.x - ir.x) >= 1 then doPushCreature(creature, WEST, pokepos.x - ir.x) end if(ir.x - pokepos.x) >= 1 then addEvent(doPushCreature, 300, creature, EAST, ir.x - pokepos.x) end return FALSE end end if #getCreatureSummons(cid) == 1 then doCreatureSay(cid,getCreatureName(creature) ..", move!",1) doOrderMove(cid) end end ei tipow voce podia passar o script para a gente né =P Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986567 Compartilhar em outros sites More sharing options...
Administrador PoRaI 99 Postado Janeiro 10, 2011 Administrador Share Postado Janeiro 10, 2011 (editado) ei tipow voce podia passar o script para a gente né =P Dokmos é um programador em C++ A proposito, 90% de chance de não funcionar em um servidor 8.54 (desses de pokémon) suas libs é source são muito desatualizadas. Eu que criei o script, eu usei a função doPushCreature por que tava com preguiça de fazer uma .__. Não pensei que o script iria vazar tão rapido assim. Se vocês querem que aparece msg: "Pikachu, move!" faça assim: function onUse(cid, item, frompos, item2, toPosition) function doOrderMove(cid) -- By PoRaI. local creature = getCreatureSummons(cid)[1] local pokepos = getCreaturePosition(creature) local ir = toPosition if pokepos.x == ir.x and pokepos.y == ir.y then return TRUE end if pokepos.x ~= ir.x or pokepos.y ~= ir.y then if(pokepos.y - ir.y) >= 1 then addEvent(doPushCreature, 300, creature, NORTH, pokepos.y - ir.y) end if(ir.y - pokepos.y) >= 1 then addEvent(doPushCreature, 300, creature, SOUTH, ir.y - pokepos.y) end if(pokepos.x - ir.x) >= 1 then doPushCreature(creature, WEST, pokepos.x - ir.x) end if(ir.x - pokepos.x) >= 1 then addEvent(doPushCreature, 300, creature, EAST, ir.x - pokepos.x) end return FALSE end end if #getCreatureSummons(cid) == 1 then doCreatureSay(cid,getCreatureName(creature) ..", move!",1) doOrderMove(cid) end end Que script? quem eu saiba ja está aqui no topico , no inicio dele. Editado Abril 30, 2017 por Bennyyw Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986572 Compartilhar em outros sites More sharing options...
kevinloko 10 Postado Janeiro 10, 2011 Share Postado Janeiro 10, 2011 Mas nao esta perfeito, tipow se nao puder passar o script só me ensina a fazer meu char nao ir junto com o poke se tiver como plx =D Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986574 Compartilhar em outros sites More sharing options...
Administrador PoRaI 99 Postado Janeiro 10, 2011 Administrador Share Postado Janeiro 10, 2011 O char vai junto com o pokémon pq as source do servidor é muito desatualizada, ate o 8.42 é melhor que isso Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986595 Compartilhar em outros sites More sharing options...
junior2b 18 Postado Janeiro 10, 2011 Share Postado Janeiro 10, 2011 Ei eu queria saber aonde eu coloko essa parte 1º - Adiciona na LIB (Data → lib → functions.lua), você ira adicionar uma função criada pelo DOKMOS, doPushCreature.------------------ Function doPushCreature(uid,direction,distance,time) by Dokmos ------------------ function doPushCreature(uid,direction,distance,time) if isCreature(uid) == TRUE then local rand = (2*math.random(0,1))-1 local rand2 = math.random(-1,0) if direction == 0 then signal = {0,rand,-rand,rand,-rand,0,-1,-1,-1,0,0,0} elseif direction == 1 then signal = {1,1,1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 2 then signal = {0,rand,-rand,rand,-rand,0,1,1,1,0,0,0} elseif direction == 3 then signal = {-1,-1,-1,0,0,0,0,rand,-rand,rand,-rand,0} elseif direction == 4 then signal = {-1,rand2,(-rand2)-1,0,1,rand2+1,rand2,0} elseif direction == 5 then signal = {1,-rand2,-((-rand2)-1),0,1,rand2+1,rand2,0} elseif direction == 6 then signal = {-1,rand2,(-rand2)-1,0,-1,(-rand2)-1,rand2,0} else signal = {1,-rand2,-((-rand2)-1),0,-1,(-rand2)-1,rand2,0} end local pos = getThingPos(uid) nsig = #signal nvar = 0 repeat nvar = nvar+1 newpos = {x=pos.x+(signal[nvar]),y=pos.y+(signal[(nsig/2)+nvar]),z=pos.z} newtile = {x=newpos.x,y=newpos.y,z=newpos.z,stackpos=0} until getTileThingByPos(newtile).uid ~= 0 and hasProperty(getTileThingByPos(newtile).uid,3) == FALSE and queryTileAddThing(uid,newpos) == 1 or nvar == (nsig/2) if distance == nil or distance == 1 then doTeleportThing(uid,newpos,TRUE) else distance = distance-1 doTeleportThing(uid,newpos,TRUE) if time ~= nil then addEvent(doPushCreature,time,uid,direction,distance,time) else addEvent(doPushCreature,500,uid,direction,distance,500) end end end end TIPOW MEU CHAR VAI JUNTO COM O POKE =/ Tente usar isArray < Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986665 Compartilhar em outros sites More sharing options...
paulgrande 23 Postado Janeiro 10, 2011 Share Postado Janeiro 10, 2011 e se colokar setcreaturenomove no player ate o poke xegar no lugar? Link para o comentário https://xtibia.com/forum/topic/149069-action-pok%C3%A9mon-move/#findComment-986682 Compartilhar em outros sites More sharing options...
Posts Recomendados