arkires 8 Postado Março 26, 2011 Share Postado Março 26, 2011 Bom tava procurando um scrip parecido e acabei achando em outro forum um scrip bem legal e resolvi trazer para o xtibia Nome: Cassino slot machineAutor: CyberM do otland Versão Testada: tfs 0.4 Informações Adicionais: video auto-explicativo. Frutas padrões Ganho padrão de combos Outras infos -Qualquer item jogado nos grounds de slot são deletados, para prevenir bugs e trapaças-Ao player "usar" a alavanca ele não pode se mover até o jogo acabar -Se o player "desaparecer" o jogo renicia Em actions/scripts crie um arquivo .lua chamado cassino e coloque isto dentro: Código: --[[ Advanced Slot Machine by Cybermaster ]]-- --REQUIRED MONEY(gp) TO PLAY SLOT MACHINE local money = 1000 --MILISECONDS TO CHANGE FRUITS local time = 200 --ITERATOR TIME TO STOP CHANGING FRUIT IF PLAYER DOESN'T (30 is like 7 seconds) local limit = 30 --FRUITS THAT WILL RANDOMLY APPEAR AND SWITCH local fruits = {2674,2675,2676,2679,2680,2682,2683,5097,8841} --PRIZES TABLES local win = { -- [{FRUIT.1,FRUIT.2,FRUIT.3} = {PRIZE,#PRIZE}] --MIXED COMBOS [{2679,2683,2679}] = {2160,2}, -- cherry-pumpkin-cherry [{8841,2682,8841}] = {2160,1}, -- lemon-melon-lemon --TRIPLE COMBOS [{2680,2680,2680}] = {2152,80}, -- triple strawberry [{5097,5097,5097}] = {2152,60}, -- triple mango [{2683,2683,2683}] = {2152,80}, -- triple pumpkin [{2682,2682,2682}] = {2152,50}, -- triple melon [{2676,2676,2676}] = {2152,40}, -- triple banana [{8841,8841,8841}] = {2152,25}, -- triple lemon [{2679,2679,2679}] = {2152,20}, -- triple cherry [{2675,2675,2675}] = {2152,30}, -- triple orange [{2674,2674,2674}] = {2152,10}, -- triple apple --ANY COMBOS [{ANY,2683,2683}] = {2152,5}, -- double pumpkin right [{2683,2683,ANY}] = {2152,5}, -- double pumpkin left [{2683,ANY,2683}] = {2152,10}, -- pumpkin sides combo [{ANY,2679,2679}] = {2152,4}, -- double cherry right [{2679,2679,ANY}] = {2152,4}, -- double cherry left [{2679,ANY,2679}] = {2152,8}, -- cherry sides combo [{ANY,8841,8841}] = {2152,5}, -- double lemon right [{8841,8841,ANY}] = {2152,5}, -- double lemon left [{8841,ANY,8841}] = {2152,5}, -- lemon sides combo } --MESSAGES THAT RANDOMLY APPEAR WHEN PLAYER WINS local messages = {'Bingo!','Lucky!','Jackpot!','Win!'} --FRUITS ROWS local p = { --[LEVER.UNIQUEID] [6297] = {},[6298] = {},[6299] = {},[6300] = {}, --[6301] = {}, } --JUST PUT THE INITIAL ROW POS FROM LEFT, SECOND & THIRD WILL BE AUTOM. GENERATED for i = 1,3 do --p, UNIQUEID.LEVER, {POS FROM TILE OF LEFT} table.insert(p[6297],i,{x=91+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6298],i,{x=95+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6299],i,{x=99+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6300],i,{x=103+(i-1),y=145,z=7,stackpos=1}) -- table.insert(p[6301],i,{x=19+(i-1),y=145,z=7,stackpos=1}) end function verifyRow(cid, array, pos) local result, prize = false, '' for a, b in pairs(win) do if getTileItemById(pos[1],a[1]).uid > 1 or a[1] == ANY then if getTileItemById(pos[2],a[2]).uid > 1 or a[2] == ANY then if getTileItemById(pos[3],a[3]).uid > 1 or a[3] == ANY then doPlayerAddItem(cid, b[1], b[2] or 1, true) doSendAnimatedText(getThingPos(cid), messages[math.random(#messages)], math.random(255)) result, prize, amount = true, b[1], b[2] end end end end if prize ~= '' then doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'Congratulations!! You won '..amount..' '..getItemPluralNameById(prize)..'!') end for i = 1,3 do doSendMagicEffect(pos[i], result and CONST_ME_GIFT_WRAPS or CONST_ME_EXPLOSIONHIT) doRemoveItem(getTileThingByPos(pos[i]).uid) end return not result and doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You have lost in the Slot Machine Try again') end function onUse(cid, item, fromPosition, itemEx, toPosition) local function doFruit(pos,cid,id,limit) if not isPlayer(cid) then return doItemEraseAttribute(item.uid, 'aid'), getTileThingByPos(pos).uid > 0 and doRemoveItem(getTileThingByPos(pos).uid) end if getTileThingByPos(pos).itemid < 1 then doSendMagicEffect(pos, CONST_ME_POFF) doCreateItem(fruits[math.random(#fruits)], 1, pos) else doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1) end if limit <= 0 then doSendMagicEffect(pos,math.random(28,30)) doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1) doItemSetAttribute(getTileThingByPos(fromPosition) .uid, 'aid', getTileThingByPos(fromPosition).actionid+1) doTransformItem(getTileThingByPos(fromPosition).ui d, getTileThingByPos(fromPosition).itemid == 9826 and 9825 or 9826) elseif getTileThingByPos(fromPosition).actionid > id then doSendMagicEffect(pos,math.random(28,30)) doTransformItem(getTileThingByPos(pos).uid,fruits[math.random(#fruits)],1) else addEvent(doFruit,time,pos,cid,id,limit-1) end end if item.actionid == 0 then if not doPlayerRemoveMoney(cid, money) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You need '..money..' gps to play Slot Machine.') end doItemSetAttribute(item.uid, 'aid', 1) doCreatureSetNoMove(cid, true) doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826) doSendAnimatedText(getThingPos(cid), '-$'..money,COLOR_RED) for i = 1,3 do doFruit(p[item.uid][i],cid,i,i*limit) end elseif isInArray({1,2,3},item.actionid) then doItemSetAttribute(item.uid, 'aid', item.actionid+1) doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826) elseif item.actionid == 4 then doCreatureSetNoMove(cid, false) doItemEraseAttribute(item.uid, 'aid') doTransformItem(item.uid, item.itemid == 9826 and 9825 or 9826) verifyRow(cid, win, p[item.uid]) end return true end E em actions.xml adicione esta tag: <action uniqueid="6297-6300" event="script" value="cassino.lua"/> Agora em movements/scripts crie um arquivo .lua chamado cassino e coloque isto dentro: Código: function onAddItem(moveItem, tileItem, position, cid) if isPlayer(cid) then doRemoveItem(moveItem.uid) doSendMagicEffect(position, CONST_ME_EXPLOSIONHIT) end end Agora em movements.xml adicione esta tag: <movevent type="AddItem" tileitem="1" actionid="6577" event="script" value="cassino.lua"/> Código: --FRUITS ROWS local p = { --[LEVER.UNIQUEID] [6297] = {},[6298] = {},[6299] = {},[6300] = {}, --[6301] = {}, } --JUST PUT THE INITIAL ROW POS FROM LEFT, SECOND & THIRD WILL BE AUTOM. GENERATED for i = 1,3 do --p, UNIQUEID.LEVER, {POS FROM TILE OF LEFT} table.insert(p[6297],i,{x=91+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6298],i,{x=95+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6299],i,{x=99+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6300],i,{x=103+(i-1),y=145,z=7,stackpos=1}) -- table.insert(p[6301],i,{x=19+(i-1),y=145,z=7,stackpos=1}) end NOTA: Coloque o actionid 6577 ao tile embaixo da alavancaItemid das alavancas usadas: 9825 - 9826 Actionid usado: 6577 Uniqueid usado: 6297, ... etc (para cada alavanca usa-se um diferente uid) para qual quer bug que os scrip oferecer não darei suporte pois não é meu scrip *.* espero que fassa um bom uso Link para o comentário https://xtibia.com/forum/topic/154098-cassino-slot-machine/ Compartilhar em outros sites More sharing options...
Tedescoo 8 Postado Abril 6, 2011 Share Postado Abril 6, 2011 da esse erro [05/04/2011 21:41:36] [Error - LuaScriptInterface::loadFile] data/actions/scripts/cassino.lua:100: ')' expected near 'd' [05/04/2011 21:41:36] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/cassino.lua) [05/04/2011 21:41:36] data/actions/scripts/cassino.lua:100: ')' expected near 'd' '-' da pra ajudar ? '-' Link para o comentário https://xtibia.com/forum/topic/154098-cassino-slot-machine/#findComment-1021565 Compartilhar em outros sites More sharing options...
tinfer3 6 Postado Abril 6, 2011 Share Postado Abril 6, 2011 (editado) Na linha 100,tem alguns espaços a mais. doTransformItem(getTileThingByPos(fromPosition).uid, getTileThingByPos(fromPosition).itemid == 9826 and 9825 or 9826) Editado Abril 6, 2011 por LordJoker Link para o comentário https://xtibia.com/forum/topic/154098-cassino-slot-machine/#findComment-1021571 Compartilhar em outros sites More sharing options...
Tedescoo 8 Postado Abril 6, 2011 Share Postado Abril 6, 2011 (editado) é funcionou só que tem um porém , as frutas não aparace nos tile , e não achei em nem um lugar do script que te as pos pra por os tile que vai aparacer as frutas '-' @edit eu acionei a alavanca funfo normal só nao aparaceu as frutas nos tile , mas qnd eu fui ve no templo tava lá as frutas '-' Editado Abril 6, 2011 por Psycho123 Link para o comentário https://xtibia.com/forum/topic/154098-cassino-slot-machine/#findComment-1021616 Compartilhar em outros sites More sharing options...
billstorck 0 Postado Julho 8, 2011 Share Postado Julho 8, 2011 mude a position no lugar de table.insert(p[6297],i,{x=91+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6298],i,{x=95+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6299],i,{x=99+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6300],i,{x=103+(i-1),y=145,z=7,stackpos=1}) -- table.insert(p[6301],i,{x=19+(i-1),y=145,z=7,stackpos=1}) coloque as cordenadas do local querido . Link para o comentário https://xtibia.com/forum/topic/154098-cassino-slot-machine/#findComment-1060406 Compartilhar em outros sites More sharing options...
FeehGusso 3 Postado Outubro 22, 2011 Share Postado Outubro 22, 2011 Aki a alavanca fika parada... nao se mexe... ja trokei os ids da script para 1946 e 1945 q sao as normal... mesmo assim nao da certo... Alguem ai me ajuda? :X nao consigo por esse sitema... Valeu Link para o comentário https://xtibia.com/forum/topic/154098-cassino-slot-machine/#findComment-1121144 Compartilhar em outros sites More sharing options...
risada21 29 Postado Novembro 2, 2011 Share Postado Novembro 2, 2011 VOCE ESTA NO XTIBIA.COM - A SUA COMUNIDADE DE TIBIA Ola, Tentei colocar este script em meu Server, como nao houve sucesso recorri ao topico novamente. CLASSIFICAÇAO: TEXTO: ( )Curto ( )Misturado (X)BOM ( )OTIMO o SCRIP apresenta IMAGEM: (X) SIM ( ) NAO VISUALIZAÇAO: ( ) LENTA (X)MEDIA ( ) RAPIDA ENTENDIMENTO: ( ) FACIL (X) MEDIO ( ) Dificil COLOQUE A IMAGEM DE INFORMAÇOES SOBRE O SCRIPT EM PORTUGUES PORFAVOR e expecifique melhor os locais. o ID DOS CHAOS FICAM EM QUE LOCAL? ACTIONS/UNIQUES? AVISO: ESTE LOCAL NAO é APROPRIADO PARA PEDIR SCRIPTS. FAÇA CORRETO, FAÇA SUA PARTE! Uma Campanha: HARD CORPORATION & VOCE. Consulte a Classificaçao Indicativa de Versao e Textual Deste TOPICO. Link para o comentário https://xtibia.com/forum/topic/154098-cassino-slot-machine/#findComment-1126706 Compartilhar em outros sites More sharing options...
LucasCastro 9 Postado Janeiro 18, 2012 Share Postado Janeiro 18, 2012 aqui deu td certo dboua, script bem legal! Vlw's ;D Link para o comentário https://xtibia.com/forum/topic/154098-cassino-slot-machine/#findComment-1179696 Compartilhar em outros sites More sharing options...
JumentoCuzaum 10 Postado Maio 22, 2012 Share Postado Maio 22, 2012 (editado) Fiz Tudo Certo Mais Não Entendi alguem me ensina como mexer la e o que botar no RME - Mapa e se esta tudo certe ae alguem me explica :S essa parte: Código: --FRUITS ROWS local p = { --[LEVER.UNIQUEID] [6297] = {},[6298] = {},[6299] = {},[6300] = {}, --[6301] = {}, } --JUST PUT THE INITIAL ROW POS FROM LEFT, SECOND & THIRD WILL BE AUTOM. GENERATED for i = 1,3 do --p, UNIQUEID.LEVER, {POS FROM TILE OF LEFT} table.insert(p[6297],i,{x=91+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6298],i,{x=95+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6299],i,{x=99+(i-1),y=145,z=7,stackpos=1}) table.insert(p[6300],i,{x=103+(i-1),y=145,z=7,stackpos=1}) -- table.insert(p[6301],i,{x=19+(i-1),y=145,z=7,stackpos=1}) end Quote NOTA: Coloque o actionid 6577 ao tile embaixo da alavanca Itemid das alavancas usadas: 9825 - 9826 Actionid usado: 6577 Uniqueid usado: 6297, ... etc (para cada alavanca usa-se um diferente uid) Editado Maio 23, 2012 por FriikoPall Link para o comentário https://xtibia.com/forum/topic/154098-cassino-slot-machine/#findComment-1263811 Compartilhar em outros sites More sharing options...
Posts Recomendados