RigBy 285 Postado Julho 2, 2015 Share Postado Julho 2, 2015 (editado) Fruit Picking Introdução: é um sistema simples, consiste em você pode colher a fruta da arvore e ela crescer depois de um tempo de novo. Instalar o script: em action/script crie: FruitHarvesting.lua adicione: -- Do not remove the credits -- -- [ACTION] Fruit Harvesting -- -- Developed by Rigby -- -- Especially for the Xtibia.com -- local config = { -- [ID_DA_ARVORE] = {FRUTA, QUANTIDADE{minimo, maximo}, ID_DA_ARVORE_SEM_FRUTO, TEMPO_PARA_ÀRVORE_FICA_COM_FRUTO} [5157] = {fruit = 5097, quantity = {0,1}, treeWithoutFruit = 5156, timeToGrow = 5}, [4006] = {fruit = 2675, quantity = {0,3}, treeWithoutFruit = 4008, timeToGrow = 20}, [5094] = {fruit = 2676, quantity = {3,6}, treeWithoutFruit = 5092, timeToGrow = 30}, [5096] = {fruit = 2678, quantity = {2,7}, treeWithoutFruit = 2726, timeToGrow = 70}, } function onUse(cid, item, fromPosition, itemEx, toPosition) for i, k in pairs(config) do if (isInArray(i, item.itemid) == true) then random = math.random(k.quantity[1],k.quantity[2]) doTransformItem(item.uid, k.treeWithoutFruit, 1) doPlayerAddItem(cid,k.fruit,random) addEvent(function() doTransformItem(getThingFromPos(toPosition).uid, i) end, k.timeToGrow * 1000) if random > 0 then doPlayerSendTextMessage(cid,27,"Você pego "..random.." "..getItemNameById(k.fruit).."!") else doPlayerSendTextMessage(cid,27,"Àrvore não deu nenhum fruto!") end end end return true end em action/action.xml adicione a tag: <action itemid="5157;4006;5094;5096" event="script" value="FruitHarvesting.lua"/> Se você adicionar mais arvore não esqueça de adiciona o id na tag também. Editado Julho 2, 2015 por RigBy JS Lotus reagiu a isso 1 Link para o comentário Compartilhar em outros sites More sharing options...
valakas 90 Postado Julho 2, 2015 Share Postado Julho 2, 2015 muito bom, isso vai ser util para min futuramente Link para o comentário Compartilhar em outros sites More sharing options...
RigBy 285 Postado Julho 3, 2015 Autor Share Postado Julho 3, 2015 obrigado. Link para o comentário Compartilhar em outros sites More sharing options...
Drk Shadow 48 Postado Julho 26, 2015 Share Postado Julho 26, 2015 Amigo, e se no caso eu quisesse que isso fosse usado em um item ? por exemplo, uma tesoura ira coletar os frutos ? REP+, desde já agradeço. Link para o comentário Compartilhar em outros sites More sharing options...
RigBy 285 Postado Julho 27, 2015 Autor Share Postado Julho 27, 2015 Amigo, e se no caso eu quisesse que isso fosse usado em um item ? por exemplo, uma tesoura ira coletar os frutos ? REP+, desde já agradeço. Ai .lua -- Do not remove the credits -- -- [ACTION] Fruit Harvesting -- -- Developed by Rigby -- -- Especially for the Xtibia.com -- local config = { -- [ID_DA_ARVORE] = {FRUTA, QUANTIDADE{minimo, maximo}, ID_DA_ARVORE_SEM_FRUTO, TEMPO_PARA_ÀRVORE_FICA_COM_FRUTO} [5157] = {fruit = 5097, quantity = {0,1}, treeWithoutFruit = 5156, timeToGrow = 5}, [4006] = {fruit = 2675, quantity = {0,3}, treeWithoutFruit = 4008, timeToGrow = 20}, [5094] = {fruit = 2676, quantity = {3,6}, treeWithoutFruit = 5092, timeToGrow = 30}, [5096] = {fruit = 2678, quantity = {2,7}, treeWithoutFruit = 2726, timeToGrow = 70}, } function onUse(cid, item, fromPosition, itemEx, toPosition) for i, k in pairs(config) do if itemEx.itemid == i then random = math.random(k.quantity[1],k.quantity[2]) doTransformItem(itemEx.uid, k.treeWithoutFruit, 1) doPlayerAddItem(cid,k.fruit,random) addEvent(function() doTransformItem(getThingFromPos(toPosition).uid, i) end, k.timeToGrow * 1000) if random > 0 then doPlayerSendTextMessage(cid,27,"Você pego "..random.." "..getItemNameById(k.fruit).."!") else doPlayerSendTextMessage(cid,27,"Àrvore não deu nenhum fruto!") end end end return true end .xml <action itemid="ID_DO_ITEM" event="script" value="NOME_DO_SCRIPT.lua"/> JS Lotus reagiu a isso 1 Link para o comentário Compartilhar em outros sites More sharing options...
Drk Shadow 48 Postado Julho 27, 2015 Share Postado Julho 27, 2015 Não posso testar agora, mais com certeza deve funcionar, REP+ novamente, obrigado. Link para o comentário Compartilhar em outros sites More sharing options...
Marco Oliveira 205 Postado Julho 27, 2015 Share Postado Julho 27, 2015 Otimo topico RigBy. Porem a linha arvore 5094 não existe em meu OTServ mas já resolvi , e também tava crescendo em imediato os frutos. Mas fora isso tudo funcionou perfeitamente. Rep + Link para o comentário Compartilhar em outros sites More sharing options...
RigBy 285 Postado Julho 27, 2015 Autor Share Postado Julho 27, 2015 Não posso testar agora, mais com certeza deve funcionar, REP+ novamente, obrigado. Blz Otimo topico RigBy. Porem a linha arvore 5094 não existe em meu OTServ mas já resolvi , e também tava crescendo em imediato os frutos. Mas fora isso tudo funcionou perfeitamente. Rep + Ué, so basta você modifica o tempo em "timeToGrow", da pra adicionar mais, so basta adiciona isso dentro do "local config = {" [ID_DA_ARVORE] = {FRUTA, QUANTIDADE{minimo, maximo}, ID_DA_ARVORE_SEM_FRUTO, TEMPO_PARA_ÀRVORE_FICA_COM_FRUTO}, Ficando [5096] = {fruit = 2678, quantity = {2,7}, treeWithoutFruit = 2726, timeToGrow = 70}, Link para o comentário Compartilhar em outros sites More sharing options...
SkyLigh 453 Postado Julho 28, 2015 Share Postado Julho 28, 2015 Parabéns cara muito foda Link para o comentário Compartilhar em outros sites More sharing options...
RigBy 285 Postado Julho 29, 2015 Autor Share Postado Julho 29, 2015 Tava testando a TFS 1.2, e acabei adaptando esse script, então ta ai quem quiser. -- Do not remove the credits -- -- [ACTION] Fruit Harvesting [TFS 1.2]-- -- Developed by Rigby -- -- Especially for the Xtibia.com -- local config = { -- [ID_DA_ARVORE] = {FRUTA, QUANTIDADE{minimo, maximo}, ID_DA_ARVORE_SEM_FRUTO, TEMPO_PARA_ÀRVORE_FICA_COM_FRUTO} [5157] = {fruit = 5097, quantity = {0,1}, treeWithoutFruit = 5156, timeToGrow = 5}, [4006] = {fruit = 2675, quantity = {0,3}, treeWithoutFruit = 4008, timeToGrow = 5}, [5094] = {fruit = 2676, quantity = {3,6}, treeWithoutFruit = 5092, timeToGrow = 5}, [5096] = {fruit = 2678, quantity = {2,7}, treeWithoutFruit = 2726, timeToGrow = 5}, } function onUse(player, item, fromPosition, itemEx, toPosition) for i, k in pairs(config) do if item:getId() == i then random = math.random(k.quantity[1],k.quantity[2]) item:transform(k.treeWithoutFruit) player:addItem(k.fruit, random) addEvent(function() item:transform(i) end, k.timeToGrow * 1000) if random > 0 then player:sendTextMessage(27,"Você pego "..random.." "..ItemType(k.fruit):getName().."!") else player:sendTextMessage(27,"Àrvore não deu nenhum fruto!") end end end return true end Link para o comentário Compartilhar em outros sites More sharing options...
carlos fabian 15 Postado Agosto 9, 2015 Share Postado Agosto 9, 2015 Ola , Script Muito Bom , Mas Poderia Fazer De Tal Forma : Eu Uso Tal Item "tesoura" Na Arvore , E O Player Fica Uns 3 Segundos Com Outra Outfit Sem Poder Se Mecher , Depois Desses 3 Segundos A Arvore Fica Sem Frutos E O Player Volta A Sua Outfit Normal . Link para o comentário Compartilhar em outros sites More sharing options...
Luga03 330 Postado Fevereiro 5, 2016 Share Postado Fevereiro 5, 2016 Script bem simples e bem útil! parabéns!!! Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados