Ir para conteúdo

Cassino System


DinoAdmin

Posts Recomendados

Bom Este sistema de Cassino Funciona assim:

 

Tem 3 Bau e quando o player consegue 75000 Casino coins ele pode abrir um dos baus e pegar um pokemon (chansey,ditto ou porygon)

é um sistema bem simples.

 

Vamos lá:

 

Vá em data/action/script/ crie um arquivo chamado cassino.lua e cole isso dentro:

 

 

 

local level = 40 --level do pokemon que vai ser pego no bau

local extrastr = 1

local cost = 75000 -- quantidade de cassino coins que precisa ter para pegar o pokemon

local coins = 23254 -- ID Do cassino coin

local btype = "normal"

function onUse(cid, item, frompos, item2, topos)

local pokemon = ""

if item.uid == nil then return true end

if item.actionid == 22420 then

pokemon = "Porygon"

elseif item.actionid == 22421 then

pokemon = "Chansey"

elseif item.actionid == 22422 then

pokemon = "Ditto"

else

return true

end

if getPlayerStorageValue(cid, coins) < cost then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You dont have enough cassino coins, you need 75000 coins.")

return true

end

if getPlayerMana(cid) >= 6 then

return doPlayerSendCancel(cid, "You don't have capacity for your prize!")

end

if pokemon == "" then return true end

local gender = getRandomGenderByName(pokemon)

local mypoke = getPokemonStatus(pokemon)

if not mypoke then return true end

local offense = mypoke.off * level * extrastr

local defense = mypoke.def * level * extrastr

local speed = mypoke.agi * level * extrastr

local vit = mypoke.vit * level * extrastr

local spatk = mypoke.spatk * level * extrastr

local happy = 180

local leveltable = getPokemonExperienceTable(pokemon)

local item = doCreateItemEx(2219)

doItemSetAttribute(item, "poke", pokemon)

doItemSetAttribute(item, "hp", 1)

doItemSetAttribute(item, "level", level)

doItemSetAttribute(item, "exp", leveltable[level])

doItemSetAttribute(item, "nextlevelexp", leveltable[level+1] - leveltable[level])

doItemSetAttribute(item, "offense", offense)

doItemSetAttribute(item, "defense", defense)

doItemSetAttribute(item, "speed", speed)

doItemSetAttribute(item, "vitality", vit)

doItemSetAttribute(item, "specialattack", spatk)

doItemSetAttribute(item, "happy", happy)

doItemSetAttribute(item, "gender", gender)

doItemSetAttribute(item, "description", "Contains a "..pokemon..".")

doItemSetAttribute(item, "fakedesc", "Contains a "..pokemon..".")

doPlayerAddItemEx(cid, item, true)

doTransformItem(item, pokeballs[btype].on)

doPlayerSendTextMessage(cid, 27, "You choose a "..pokemon..".")

setPlayerStorageValue(cid, 23254, getPlayerStorageValue(cid, 23254) - 75000)

doSendMagicEffect(getThingPos(cid), 29)

doSendMagicEffect(getThingPos(cid), 27)

doSendMagicEffect(getThingPos(cid), 29)

return TRUE

end

 

 

 

Agora coloque esta tag em data/action/action.xml

<action actionid="22420-22422" event="script" value="cassino.lua"/>

 

Modo de criação:

Abra seu mapa no RME E Vá ate o cassino do mesmo.

Coloque 3 baus e coloque os Seguintes ActionID Neles:

 

Pokemon --- ActionID

 

Porygon = 22420

Chansey = 22421

Ditto = 22422

 

Apois fazer isso salve e feche o mapa.

 

Agora em data/action/script/ Crie um arquivo chamado "coincase.lua" e cole isso dentro:

 

 

 

local coins = 23254

function onUse(cid, item, frompos, item2, topos)

if getPlayerStorageValue(cid, coins) >= 1 then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have "..getPlayerStorageValue(cid, coins).." cassino coins left.")

return true

end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have any cassino coins. To buy coins, order at celadon's cassino.")

return true

end

 

 

 

 

Agora em data/action/script/ crie um arquivo chamado "slotmachine.lua" e cole isso dentro:

 

 

 

local coins = 23254

local cost = 10

local playing = createConditionObject(CONDITION_INFIGHT)

setConditionParam(playing, CONDITION_PARAM_TICKS, 3000)

 

local function checkPrize(array)

local prize = 0

if array[1] == array[2] and array[2] == array[3] and array[1] == 9 then --3n iguais = 9

return "jackpot"

end

if array[1] == array[2] and array[1] == array[3] then -- 3n iguais

return 20 * array[1]

end

if array[1] == array[2] or array[1] == array[3] then

return 8 * array[1]

end

if array[2] == array[3] then

return 8 * array[2]

end

if (array[1] == array[2] - 1 and array[1] == array[3] - 2) or (array[1] == array[2] + 1 and array[1] == array[3] + 2) then

return (array[1] + array[2] + array[3]) * 9

end

return 0

end

 

function getJackpotEffect()

local it = math.random(1,5)

if it == 1 then

return 27

elseif it == 2 then

return 28

elseif it == 3 then

return 29

elseif it == 4 then

return 84

else

return 85

end

end

function sendJackpotEffect(pos)

local pos1 = {x = pos.x + 2, y = pos.y, z = pos.z}

local pos2 = {x = pos.x + 1, y = pos.y + 1, z = pos.z}

local pos3 = {x = pos.x, y = pos.y + 2, z = pos.z}

local pos4 = {x = pos.x - 1, y = pos.y + 1, z = pos.z}

local pos5 = {x = pos.x - 2, y = pos.y, z = pos.z}

local pos6 = {x = pos.x - 1, y = pos.y - 1, z = pos.z}

local pos7 = {x = pos.x, y = pos.y - 2, z = pos.z}

local pos8 = {x = pos.x + 1, y = pos.y - 1, z = pos.z}

doSendDistanceShoot(pos, pos1, 39)

doSendDistanceShoot(pos, pos2, 39)

doSendDistanceShoot(pos, pos3, 39)

doSendDistanceShoot(pos, pos4, 39)

doSendDistanceShoot(pos, pos5, 39)

doSendDistanceShoot(pos, pos6, 39)

doSendDistanceShoot(pos, pos7, 39)

doSendDistanceShoot(pos, pos8, 39)

doSendMagicEffect(pos1, getJackpotEffect())

doSendMagicEffect(pos2, getJackpotEffect())

doSendMagicEffect(pos3, getJackpotEffect())

doSendMagicEffect(pos4, getJackpotEffect())

doSendMagicEffect(pos5, getJackpotEffect())

doSendMagicEffect(pos6, getJackpotEffect())

doSendMagicEffect(pos7, getJackpotEffect())

doSendMagicEffect(pos8, getJackpotEffect())

end

 

function onUse(cid, item, frompos, item2, topos)

if getPlayerGroupId(cid) == 11 then

return true

end

if topos.y + 1 ~= getThingPos(cid).y or topos.x ~= getThingPos(cid).x then

local poss = {x = topos.x, y = topos.y + 1, z = topos.z}

if isWalkable(poss, cid, 0, 0) then

doPushCreature(cid, getDirectionTo(getThingPos(cid), poss), 1, 0)

if not (getThingPos(cid).x == topos.x and getThingPos(cid).y == topos.y + 1) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please, stay in front of the slot machine to play it.")

return true

end

doCreatureSetLookDir(cid, 0)

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please, stay in front of the slot machine to play it.")

return true

end

end

doCreatureSetLookDir(cid, 0)

if getPlayerNoMove(cid) == true then

return true

end

if getPlayerStorageValue(cid, coins) < cost then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have enough cassino coins to play the slot machine.")

return true

end

local mymoney = getPlayerStorageValue(cid, coins)

setPlayerStorageValue(cid, coins, mymoney - cost)

doPlayerSetNoMove(cid, true)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You pushed the machine lever (-10 coins), now you have "..mymoney - cost.." coins left.")

local a = item.itemid

doTransformItem(item2.uid, a + 1)

local function doPullBack(pos)

doTransformItem(getTileItemById(pos, a + 1).uid, a)

end

addEvent(doPullBack, 500, topos)

local function doPlay(cid, pos, first, second, third)

doAddCondition(cid, playing)

if first == 0 then

firstplay = math.random(1, 9)

doSendAnimatedText(pos, firstplay, 66)

addEvent(doPlay, 900, cid, pos, firstplay, second, third)

return true

end

if second == 0 then

secondplay = math.random(1, 9)

doSendAnimatedText(pos, secondplay, 66)

addEvent(doPlay, 900, cid, pos, first, secondplay, third)

return true

end

if third == 0 then

thirdplay = math.random(1, 9)

doSendAnimatedText(pos, thirdplay, 66)

addEvent(doPlay, 900, cid, pos, first, second, thirdplay)

return true

end

if checkPrize({first, second, third}) == "jackpot" then

doSendAnimatedText(pos, "JACKPOT!", 180)

sendJackpotEffect(getThingPos(cid))

addEvent(doSendAnimatedText, 600, pos, "JACKPOT!", 66)

addEvent(sendJackpotEffect, 600, getThingPos(cid))

addEvent(doSendAnimatedText, 1400, pos, "JACKPOT!", 180)

addEvent(sendJackpotEffect, 1400, getThingPos(cid))

addEvent(doSendAnimatedText, 2200, pos, "JACKPOT!", 66)

addEvent(sendJackpotEffect, 2200, getThingPos(cid))

local ppos = getThingPos(cid)

local win = (mymoney - cost) + 1000

addEvent(doSendAnimatedText, 2500, ppos, "+1000", 35)

addEvent(setPlayerStorageValue, 2500, cid, coins, win)

addEvent(doPlayerSendTextMessage, 2500, cid, MESSAGE_STATUS_CONSOLE_BLUE, "You won 1000 cassino coins, now you have "..win.." coins left.")

addEvent(doPlayerSetNoMove, 2500, cid, false)

 

elseif checkPrize({first, second, third}) == 0 then

doSendAnimatedText(pos, "FAIL", 180)

doPlayerSetNoMove(cid, false)

elseif checkPrize({first, second, third}) <= 30 then

doSendAnimatedText(pos, "GOOD", 215)

local ppos = getThingPos(cid)

local prize = checkPrize({first, second, third})

local win = (mymoney - cost) + prize

addEvent(doSendAnimatedText, 500, ppos, "+"..prize.."", 35)

addEvent(setPlayerStorageValue, 500, cid, coins, win)

addEvent(doPlayerSendTextMessage, 500, cid, MESSAGE_STATUS_CONSOLE_BLUE, "You won "..prize.." cassino coins, now you have "..win.." coins left.")

addEvent(doPlayerSetNoMove, 500, cid, false)

elseif checkPrize({first, second, third}) <= 65 then

doSendAnimatedText(pos, "GREAT", 210)

local ppos = getThingPos(cid)

local prize = checkPrize({first, second, third})

local win = (mymoney - cost) + prize

addEvent(doSendAnimatedText, 500, ppos, "+"..prize.."", 35)

addEvent(setPlayerStorageValue, 500, cid, coins, win)

addEvent(doPlayerSendTextMessage, 500, cid, MESSAGE_STATUS_CONSOLE_BLUE, "You won "..prize.." cassino coins, now you have "..win.." coins left.")

addEvent(doPlayerSetNoMove, 500, cid, false)

else

doSendAnimatedText(pos, "EXCELLENT", 35)

local ppos = getThingPos(cid)

local prize = checkPrize({first, second, third})

local win = (mymoney - cost) + prize

addEvent(doSendAnimatedText, 500, ppos, "+"..prize.."", 35)

addEvent(setPlayerStorageValue, 500, cid, coins, win)

addEvent(doPlayerSendTextMessage, 500, cid, MESSAGE_STATUS_CONSOLE_BLUE, "You won "..prize.." cassino coins, now you have "..win.." coins left.")

addEvent(doPlayerSetNoMove, 500, cid, false)

end

return true

end

doAddCondition(cid, playing)

addEvent(doPlay, 850, cid, topos, 0, 0, 0)

return true

end

 

 

 

 

Agora em data/action/action.xml coloque a seguinte tag:

 

<action itemid="11420" event="script" value="slotmachine.lua"/>

 

Modo de Preparo:

Vá no RME Novamente e coloque os ActionID Nas Maquinas de cassino.

ActionID:11420

 

Salve e feche seu mapa.

 

Agora o Npc, vá em data/npc/ e vá em "cassino seller" apague oque estiver dentro e cole isto:

 

 

 

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Cassino Seller Anna" script="celadon.lua" speed="0">

<health now="150" max="150"/>

<look type="511" head="91" body="114" legs="86" feet="0"/>

</npc>

 

 

 

Agora em data/npc/script/ crie um arquivo chamado celadon.lua e cole isto dentro:

 

 

 

local focus = 0

local talk_start = 0

local price = 0

local conv = 0

function msgcontains(txt, str)

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end

function onCreatureSay(cid, type, msg)

local msg = string.lower(msg)

if focus == cid then

talk_start = os.clock()

end

if msgcontains(msg, 'bye') and focus == cid then

selfSay('Have a nice gambling!')

focus = 0

return true

end

if msgcontains(msg, 'no') and focus == cid and conv == 0 then

selfSay('Ok then, feel free to come back whenever you want to.', cid)

focus = 0

return true

end

if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) <= 3 then

selfSay("Hello! You are at the Celadon's Gamer Corner. To gamble here, you need cassino coins. Do you want to buy some?", cid)

focus = cid

talk_start = os.clock()

conv = 0

return true

end

if ((msgcontains(msg, 'yes') and conv == 0) or msgcontains(msg, 'coins')) and focus == cid and conv ~= 1 then

selfSay('Tell me, how many coins do you wish to buy?', cid)

conv = 1

return true

end

if tonumber(msg) ~= nil and tonumber(msg) >= 1 and tonumber(msg) <= 150000 and focus == cid then

if getPlayerStorageValue(cid, 23254) >= 100000000 then

selfSay("It seems that you already have a lot of coins! You can't buy more coins if you already have more than 1000.", cid)

return true

end

if price / 10 == tonumber(msg) then

return true

end

price = tonumber(msg) * 1

selfSay(""..msg.." coins are going to cost "..price.." dollars, can you afford it?", cid)

conv = 3

return true

end

if tonumber(msg) ~= nil and (tonumber(msg) < 1 or tonumber(msg) > 150000) and focus == cid then

selfSay("I can sell only sell amounts between 1 and 500 of coins at once!", cid)

conv = 2

return true

end

if msgcontains(msg, 'yes') and conv == 3 and focus == cid then

if getPlayerStorageValue(cid, 23254) == -1 then

setPlayerStorageValue(cid, 23254, 0)

end

if doPlayerRemoveMoney(cid, price) then

local amount = price

setPlayerStorageValue(cid, 23254, getPlayerStorageValue(cid, 23254) + amount)

selfSay("Here you are! You bought "..amount.." cassino coins, have a nice gambling!", cid)

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You bought "..amount.." cassino coins. Now you have a total of "..getPlayerStorageValue(cid, 23254).." cassino coins.", cid)

else

selfSay("Sorry, buy you don't have enough money to pay for it!", cid)

end

conv = 2

return true

end

if msgcontains(msg, 'no') and conv == 3 and focus == cid then

selfSay("So, would you like to buy any coins?", cid)

conv = 0

return true

end

end

 

local intervalmin = 38

local intervalmax = 70

local delay = 25

local number = 1

local messages = {"Come here to buy cassino coins! Check our prices!",

"Looking for coins? You can buy them here!",

"Check out our prices! Start gambling today!",

"Did you know you can exchange coins for wonderful prizes?",

}

function onThink()

if focus == 0 then

selfTurn(1)

delay = delay - 0.5

if delay <= 0 then

selfSay(messages[number])

number = number + 1

if number > #messages then

number = 1

end

delay = math.random(intervalmin, intervalmax)

end

return true

else

if not isCreature(focus) then

focus = 0

return true

end

local npcpos = getThingPos(getThis())

local focpos = getThingPos(focus)

if npcpos.z ~= focpos.z then

focus = 0

return true

end

if getDistanceToCreature(focus) > 3 then

selfSay('Come back whenever you want to buy more coins!', cid)

focus = 0

return true

end

 

local dir = doDirectPos(npcpos, focpos)

selfTurn(dir)

end

if os.clock() - talk_start > 59 then

selfSay('We can talk later, when you are decided about what to buy.', cid)

focus = 0

end

 

return true

end

 

 

 

 

Prontinho agora voce tem um sistema de cassino que dá pokemons ao ter um numero de cassino coins.

qualquer duvida pode perguntar nesse topico.

 

Creditos:

DinoAdmin

Lakz

Editado por DinoAdmin
Link para o comentário
Compartilhar em outros sites

  • 2 months later...

There are actually many websites that give dating services, the majority is customize made to fit with unique desires, just like adult dating with the above 40s, adult dating for lesbians, adult dating for large coach online factory people, dating for nudists, which makes it easier and easier to make sure that you join the sites that suit your needs rather than wasting money and time on ones that do not. Some sites are totally free http://coachfactoryhandbagoutlet2u.webs.com/ to join but then charge you if you send or receive messages, others are completely free to join and use and you can send and receive messages without ever spending any money. Word of warning - keep your feet on the ground, some of these tailor made sites are pandering to people who fantasise, such as the ones that offer women the chance to date a good looking, young, millionaire. Millionaires do join such sites but you will find coach factory store that most of the members on such sites are the needy poor women wanting to meet them. The sites that are specifically for people wanting casual sex and for married people wanting secret liaisons are usually frequented by men and they tend to become very disappointed when they find out that most of the other members are men like themselves.

Without a doubt one does receive weird individuals with these websites although those people live and also breathing within the real world way too and also you've got achieved them simply throughout the nook when you traveled to a new tavern. Weird http://www.aicon.com/coachfactory.html people are not exclusive to online dating.Do not let the cost of a paid for site worry you. They are a good investment. For the price of a few drinks you could end up with a fantastic partner. A lot of the paid for sites are very good and do not cost much. Another word of warning - beware of the totally free sites. They seem like a bargain, but you often get riff raff on them and because those sites are free the people do not take it so seriously. A cheap coach factory backpacks lot of them sign up and do not even bother to go back and check their messages. People who are unemployed and unemployable and who can spend all day long sitting at their computer.

 

You'll find countless web sites that provide online dating services, nearly everyone is target built to go well with specific demands, including relationship for your about 40s, relationship to get lesbians, relationship to get huge outlet coach factory people, dating for nudists, which makes it easier and easier to make sure that you join the sites that suit your needs rather than wasting money and time on ones that do not. Some sites are totally free http://coachfactoryhandbagoutlet2u.webs.com/ to join but then charge you if you send or receive messages, others are completely free to join and use and you can send and receive messages without ever spending any money. Word of warning - keep your feet on the ground, some of these tailor made sites are pandering to people who fantasise, such as the ones that offer women the chance to date a good looking, young, millionaire. Millionaires do join such sites but you will find coach factory store that most of the members on such sites are the needy poor women wanting to meet them. The sites that are specifically for people wanting casual sex and for married people wanting secret liaisons are usually frequented by men and they tend to become very disappointed when they find out that most of the other members are men like themselves.

Indeed you need to do find unusual folks upon such web sites but people reside and breath inside real-world as well and you have got fulfilled all of them simply just about the place after you visited a pub. Unusual http://www.aicon.com/coachfactory.html people are not exclusive to online dating.Do not let the cost of a paid for site worry you. They are a good investment. For the price of a few drinks you could end up with a fantastic partner. A lot of the paid for sites are very good and do not cost much. Another word of warning - beware of the totally free sites. They seem like a bargain, but you often get riff raff on them and because those sites are free the people do not take it so seriously. A coach factory store lot of them sign up and do not even bother to go back and check their messages. People who are unemployed and unemployable and who can spend all day long sitting at their computer.

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...