Aksz 5 Postado Novembro 12, 2010 Share Postado Novembro 12, 2010 (editado) Nome: Box SystemAutor: Aksz Versão Testada: Mix YourOts 8.54 Olá,Estou começando na área scripting e estou postando um script. Bom, trouxe hoje aqui para vocês o script Box, para quem ja jogou P.O deve conhecer, você abre por exemplo uma Box 2 e sai um Pokemon. Hoje estou postando um exemplo da Box 3. Que para abrir ela precisa de level 60. Chega de conversar e vamos pro scripting. Adicione isto com o nome de box.lua na pasta data/actions/scripts: function onUse(cid, item, frompos, item2, topos) r1 = math.random(1,3) if getPlayerLevel(cid) >= 60 then if doPlayerRemoveItem(cid,7884,1) == TRUE then if r1 == 1 then doPlayerSendTextMessage(cid,22,"Você ganhou um Porygon.") doPlayerAddItem(cid,2128,1) elseif r1 == 2 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonchan.") doPlayerAddItem(cid,2129,1) elseif r1 == 3 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonlee.") doPlayerAddItem(cid,2130,1) end end end end Agora adicione isto no Actions.xml na pasta data/actions: <action itemid="7884" event="script" value="box.lua"/>→ Configurando o Script function onUse(cid, item, frompos, item2, topos)r1 = math.random(1,3) if getPlayerLevel(cid) >= 60 then if doPlayerRemoveItem(cid,7884,1) == TRUE then if r1 == 1 then doPlayerSendTextMessage(cid,22,"Você ganhou um Porygon.") doPlayerAddItem(cid,2128,1) elseif r1 == 2 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonchan.") doPlayerAddItem(cid,2129,1) elseif r1 == 3 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonlee.") doPlayerAddItem(cid,2130,1) end end end end Azul - É a quantidade de Pokemons que terá na Box.Preto - É o level que precisa usar a Box. Laranja - É o ID da Box. Vermelho - É o nome do Pokemon que aparecerá na mensagem quando abrir a Box. Roxo - ID da Pokebola do Pokemon. Obs: Se você for trocar o ID da Box no script terá que trocar na tag também. [/color][/color] <action itemid="7884" event="script" value="box.lua"/> Preto - ID da Box. → Adicionando outro Pokemon na Box function onUse(cid, item, frompos, item2, topos)r1 = math.random(1,3) if getPlayerLevel(cid) >= 60 then if doPlayerRemoveItem(cid,7884,1) == TRUE then if r1 == 1 then doPlayerSendTextMessage(cid,22,"Você ganhou um Porygon.") doPlayerAddItem(cid,2128,1) elseif r1 == 2 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonchan.") doPlayerAddItem(cid,2129,1) elseif r1 == 3 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonlee.") doPlayerAddItem(cid,2130,1) elseif r1 == 4 doPlayerSendTextMessage(cid,22,"Você ganhou um Chansey.") doPlayerAddItem(cid,2131,1) end end end end Preto - Troque pela quantidade de Pokemons que você colocar. Vermelho - Mais um pokemon. Azul - Troque sempre que for adicionar um pokemon. Exemplo: Em cima está 3, no próximo pokemon coloque 4, no próximo pokemon coloque 5 e vai... Cinza - Nome do novo pokemon. Verde - ID da pokebola do novo pokemon. → Script Box, funciona no Go/Back do MatheusMkalo Adicione isto com o nome de box.lua em data/actions/scripts: function onUse(cid, item, frompos, item2, topos) r1 = math.random(1,3) if getPlayerLevel(cid) >= 60 then if doPlayerRemoveItem(cid,7884,1) == TRUE then if r1 == 1 then doPlayerSendTextMessage(cid,22,"Você ganhou um Porygon.") local s = doPlayerAddItem(cid, 2222) doItemSetAttribute(s, "description", "This is Porygon's pokeball. HP = ["..(10).."/"..(100).."]") elseif r1 == 2 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonchan.") local t = doPlayerAddItem(cid, 2222) doItemSetAttribute(t, "description", "This is Hitmonchan's pokeball. HP = ["..(10).."/"..(100).."]") elseif r1 == 3 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonlee.") local r = doPlayerAddItem(cid, 2222) doItemSetAttribute(r, "description", "This is Hitmonlee's pokeball. HP = ["..(10).."/"..(100).."]") end end end end Agora, adicione isto no actions.xml: <action itemid="7884" event="script" value="box.lua"/> → Configurando function onUse(cid, item, frompos, item2, topos)r1 = math.random(1,3) if getPlayerLevel(cid) >= 60 then if doPlayerRemoveItem(cid,7884,1) == TRUE then if r1 == 1 then doPlayerSendTextMessage(cid,22,"Você ganhou um Porygon.") local s = doPlayerAddItem(cid, 2222) doItemSetAttribute(s, "description", "This is Porygon's pokeball. HP = ["..(10).."/"..(100).."]") elseif r1 == 2 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonchan.") local t = doPlayerAddItem(cid, 2222) doItemSetAttribute(t, "description", "This is Hitmonchan's pokeball. HP = ["..(10).."/"..(100).."]") elseif r1 == 3 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonlee.") local r = doPlayerAddItem(cid, 2222) doItemSetAttribute(r, "description", "This is Hitmonlee's pokeball. HP = ["..(10).."/"..(100).."]") end end end end Preto - Quantidade de Pokemons Vermelho - Level que poderá usar a Box Laranja - ID da Box Vinho - Nome do Pokemon que aparecerá na mensagem Roxo - ID da Pokebola que você configurou no script do MatheusMkalo. Verde - Nome do Pokemon Azul - HP do Pokemon e HP maxima do Pokemon Exemplo: Aparecerá in-game [10/100], você tem que colocar o HP de acordo que você configurou no script do MatheusMkalo, coloque [1000/1000], se o pokemon tiver esse HP e o HPMax. → Adicionando um novo pokemon function onUse(cid, item, frompos, item2, topos)r1 = math.random(1,4) if getPlayerLevel(cid) >= 60 then if doPlayerRemoveItem(cid,7884,1) == TRUE then if r1 == 1 then doPlayerSendTextMessage(cid,22,"Você ganhou um Porygon.") local s = doPlayerAddItem(cid, 2222) doItemSetAttribute(s, "description", "This is Porygon's pokeball. HP = ["..(10).."/"..(100).."]") elseif r1 == 2 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonchan.") local t = doPlayerAddItem(cid, 2222) doItemSetAttribute(t, "description", "This is Hitmonchan's pokeball. HP = ["..(10).."/"..(100).."]") elseif r1 == 3 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonlee.") local r = doPlayerAddItem(cid, 2222) doItemSetAttribute(r, "description", "This is Hitmonlee's pokeball. HP = ["..(10).."/"..(100).."]") elseif r1 == 4 doPlayerSendTextMessage(cid,22,"Você ganhou um Chansey.") local o = doPlayerAddItem(cid, 2222) doItemSetAttribute(o, "description", "This is Chansey's pokeball. HP = ["..(1000).."/"..(1000).."]") end end end end Preto - A quantidade de Pokemons Vermelho - Novo script do pokemon Azul - Mude sempre que for adicionar um pokemon Exemplo: Se o de cima for 10 o próximo pokemon tem que ser 11. Laranja - Nome do novo pokemon que aparecerá na mensagem Cinza - Nome do novo pokemon Vinho - HP do novo pokemon Pronto, acabou. Dúvidas, Bug's e Erros? Poste aqui. Créditos: Aksz - Fazer o script da box Kydrai - Adicionar a função para dar certo o script em uma pokebola só. Att, Aksz. Editado Novembro 12, 2010 por Aksz Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/ Compartilhar em outros sites More sharing options...
tinfer 7 Postado Novembro 12, 2010 Share Postado Novembro 12, 2010 Gostei dos seus scripts cara,mais da para melhorar usando tabbles,irá diminuir muitos eles... function onUse(cid, item, frompos, item2, topos) local box = { [1] ={item = 7884,msg = "Você ganhou um Porygon."}, [2] ={item = 2129,msg = "Você ganhou um Hitmonchan."}, [3] ={item = 2130,msg = "Você ganhou um Hitmonlee."} } local level = 60 local e = box[math.random(1,3)] if getPlayerLevel(cid) >= level then doPlayerSendTextMessage(cid,22,e.msg) doPlayerAddItem(cid, e.item, 1) doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, "Você deve ter level "..level.." ou mais para abriar esta box.") end return TRUE end Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-956861 Compartilhar em outros sites More sharing options...
Aksz 5 Postado Novembro 12, 2010 Autor Share Postado Novembro 12, 2010 @Spits Valeu, to começando em scripting e você me ajudou bastante '-' REP Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-956868 Compartilhar em outros sites More sharing options...
thequestion 1 Postado Novembro 12, 2010 Share Postado Novembro 12, 2010 (editado) Pois é, todos fazendo scripts para Pokemon, espero que inovem também, e não só copiem... Parabéns Editado Novembro 12, 2010 por TheQuestion Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-956951 Compartilhar em outros sites More sharing options...
brunin86 15 Postado Novembro 12, 2010 Share Postado Novembro 12, 2010 Você podia me ajudar? Queria assim : Ao usar o item 7884 ( no caso : pokeball ) adicionasse o item equivalente ao id 2653 ( até ai eu sei fazer ) mas queria que ao invés de adicionar a descrição no item: doItemSetAttribute(o, "description", "This is Chansey's pokeball. HP = ["..(1000).."/"..(1000).."]") Adicionar sim, um actionid. Que no meu caso, é 1 id para todas as pokeballs só que cada uma com o actionid diferente. Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-957015 Compartilhar em outros sites More sharing options...
tinfer 7 Postado Novembro 12, 2010 Share Postado Novembro 12, 2010 (editado) @UP ve se é isso q vc quer: function onUse(cid, item, frompos, item2, topos) local box = { [1] ={msg = "Você ganhou um Porygon.",action_id = 10}, [2] ={msg = "Você ganhou um Hitmonchan.",action_id = 11}, [3] ={msg = "Você ganhou um Hitmonlee.",action_id = 12}, [4] ={msg = "Você ganhou um Chansey.",action_id = 13} } local level = 60 -- level para usar local item = 2222 -- do seu item local e = box[math.random(1,4)] if getPlayerLevel(cid) >= level then doPlayerSendTextMessage(cid,22,e.msg) b = doPlayerAddItem(cid, item, 1) doItemSetAttribute(b, "aid", e.action_id) doRemoveItem(item.uid, 1) else doPlayerSendCancel(cid, "Você deve ter level "..level.." ou mais para abriar esta box.") end return TRUE end Editado Novembro 12, 2010 por Spits Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-957047 Compartilhar em outros sites More sharing options...
RodrigoSc 8 Postado Novembro 13, 2010 Share Postado Novembro 13, 2010 (editado) Alguem pode hacer este script para Pokemon Server V.41 Edited FAMILIAR? queria que ao invés de adicionar a descrição no item Adicionar um name com /attr set name "pidgey Pokeball Editado Novembro 13, 2010 por RodrigoSigrist Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-957203 Compartilhar em outros sites More sharing options...
LaisDosOts 17 Postado Novembro 13, 2010 Share Postado Novembro 13, 2010 Muito legal, já havia visto seu post em outro forum =] Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-957231 Compartilhar em outros sites More sharing options...
brunin86 15 Postado Novembro 13, 2010 Share Postado Novembro 13, 2010 @Spits, vlw isso msm REP+ Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-957236 Compartilhar em outros sites More sharing options...
papamix 1 Postado Novembro 14, 2010 Share Postado Novembro 14, 2010 Bom script de box,eu tava procurano um desses pro meu serv. Vlw Assim que eu puder do Rep+ pra vc. Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-957642 Compartilhar em outros sites More sharing options...
realquimista 5 Postado Novembro 15, 2010 Share Postado Novembro 15, 2010 So uma observacao, o legal da box e que ela nao diz que pokemon. Ai fica o misterio, entao se tiver como tire a mensagem. Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-958197 Compartilhar em outros sites More sharing options...
lucas760895 0 Postado Novembro 16, 2010 Share Postado Novembro 16, 2010 eu queria saber como faz pra por no poke v4.1 eu coloquei tudo certinho do use no item mas nao vai, nem se quer se mexe o item alguem pode me ajudar?! Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-958595 Compartilhar em outros sites More sharing options...
glugluguga 11 Postado Novembro 16, 2010 Share Postado Novembro 16, 2010 Para funcionar no pokeserver v4.1 EDIT BY FAMILIA... Ao invés de doItemSetAttribute(r, "description", "This is Hitmonlee's pokeball. HP = ["..(10).."/"..(100).."]") trocar por doItemSetAttribute(r, "name", "pidgey Pokeball") o script ficando então assim: function onUse(cid, item, frompos, item2, topos)r1 = math.random(1,3) if getPlayerLevel(cid) >= 60 then if doPlayerRemoveItem(cid,7884,1) == TRUE then if r1 == 1 then doPlayerSendTextMessage(cid,22,"Você ganhou um Porygon.") local s = doPlayerAddItem(cid, 2532) doItemSetAttribute(s, "name", "porygon Pokeball") elseif r1 == 2 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonchan.") local t = doPlayerAddItem(cid, 2532) doItemSetAttribute(t, "name", "hitmonchan Pokeball") elseif r1 == 3 then doPlayerSendTextMessage(cid,22,"Você ganhou um Hitmonlee.") local r = doPlayerAddItem(cid, 2532) doItemSetAttribute(r, "name", "hitmonlee Pokeball") end end end end Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-958693 Compartilhar em outros sites More sharing options...
RodrigoSc 8 Postado Novembro 16, 2010 Share Postado Novembro 16, 2010 +REP glugluguga Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-958765 Compartilhar em outros sites More sharing options...
lucas760895 0 Postado Novembro 17, 2010 Share Postado Novembro 17, 2010 vlw rep+! Link para o comentário https://xtibia.com/forum/topic/144711-actionsbox-system/#findComment-959003 Compartilhar em outros sites More sharing options...
Posts Recomendados