CREDITOS : orzeleagle
ACTIONS Casino [Tfs 0.3.6]
Oi! Neste assunto, eu gostaria de lhe apresentar um roteiro para um cassino. Eu sei que já há temas, no entanto, o meu script uma barraquinha. Por quê? É simples:
* Script é universal, você pode usá-la facilmente para qualquer número de Levante
* Você pode facilmente mudar as chances de ganhar, o número mínimo e máximo dos itens, adicionar novos itens ao jogo, e ganhando múltiplos de tempo de repouso (esgotado).
"As ações / scripts casino.lua /:
Código:
--[ Script written and published by Orzeleagle/Collocorpus ]-- function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { chance = math.random(1, 100), --losowanie win_chance = 28, --chance to win a percentage of multi = 2, --how many times you win more (eg 2 or 1cc bet, win and get 2cc) items = {2160, 2152}, --id items whom you can play min_count = 1, --Minimum Number of items (1 = least 1cc) max_count = 10 --maximum number of objects (10 = maximum 10cc) } local positions = { [56501] = {x=(fromPosition.x-1), y=fromPosition.y, z=fromPosition.z, stackpos=255}, [56502] = {x=(fromPosition.x+1), y=fromPosition.y, z=fromPosition.z, stackpos=255}, [56503] = {x=fromPosition.x, y=(fromPosition.y-1), z=fromPosition.z, stackpos=255}, [56504] = {x=fromPosition.x, y=(fromPosition.y+1), z=fromPosition.z, stackpos=255} } local itemplay = getThingfromPos(positions[item.actionid]) local storage, exh = 56500, 2 --storage id, time exh if (item.itemid == 1945) then doTransformItem(item.uid, 1946) if (getPlayerStorageValue(cid, storage)-os.time(t) < 1) then doPlayerSetStorageValue(cid, storage, os.time(t)+exh) if (isInArray(config.items, itemplay.itemid)) then if (itemplay.type >= config.min_count) and (itemplay.type <= config.max_count) then if (config.chance <= config.win_chance) then doRemoveItem(itemplay.uid, itemplay.type) doCreateItem(itemplay.itemid, (itemplay.type*config.multi), positions[item.actionid]) doSendMagicEffect(positions[item.actionid], 31) doSendMagicEffect(getCreaturePosition(cid), 27) doPlayerSendCancel(cid, "Congratulations, you just won in our casino!") doSendAnimatedText(getCreaturePosition(cid), "~!Winner!~", TEXTCOLOR_YELLOW) return true else doRemoveItem(itemplay.uid, itemplay.type) doSendMagicEffect(positions[item.actionid], 31) doSendMagicEffect(getCreaturePosition(cid), 13) doPlayerSendCancel(cid, "It is your unlucky day! You lost.") doSendAnimatedText(getCreaturePosition(cid), "~!Loser!~", TEXTCOLOR_LIGHTBLUE) return true end else doPlayerSendCancel(cid, "You can play only with amount from ".. config.min_count .." to ".. config.max_count ..".") doSendMagicEffect(fromPosition, 2) return true end else doPlayerSendCancel(cid, "You cannot play with this item.") doSendMagicEffect(fromPosition, 2) return true end else doPlayerSendCancel(cid, "You must wait another ".. getPlayerStorageValue(cid, storage)-os.time(t) .." seconds.") doSendMagicEffect(fromPosition, 2) return true end else doTransformItem(item.uid, 1945) doSendMagicEffect(fromPosition, 2) return true end end
VERMELHO: chance de ganhar uma porcentagem do jogo
AMARELO: um conjunto múltiplo de ganhar
AZUL: itens tipo decimal ID (o padrão é de cristal e moeda de platina)
Violeta: número mínimo e máximo de itens
VERDE: esgotado (em seg)
em actions.xml:
<action actionid="56501-56504" event="script" value="casino.lua" />