• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Casino

orzeleagle

Member
Joined
Dec 21, 2009
Messages
183
Reaction score
7
Location
Poland
1. Open RME and make this:
casino.png


Lever ID: 1945
** Unique ID: 5885

Casino is only the Crystal Coin.

Data/Actions XML:
Code:
<action uniqueid="[B]5885[/B]" script="kasyno.lua" />

Data/Actions/Scripts/kasyno.lua: (75% to win)
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == [B]588[/B]5 then
[B]kasapos = {x=0, y=0, z=0, stackpos=255}[/B]
getkasa = getThingfromPos(kasapos)
[B]winpos = {x=0, y=0, z=0}[/B]
if getkasa.itemid == 2160 and getkasa.type == 5 then
rand = math.random(4)
if rand == 1 then
doRemoveItem(getkasa.uid,5)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"You lost 5 Crystal Coins :(.")
end
if rand == 2 or rand == 4 or rand == 3 then
doRemoveItem(getkasa.uid,5)
doCreateItem(2160,15,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22," You won 15 Crystal Coins :).")
end
end
if getkasa.itemid == 2160 and getkasa.type == 10 then
rand = math.random(4)
if rand == 1 then
doRemoveItem(getkasa.uid,10)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"You lost 10 Crystal Coins :(.")
end
if rand == 2 or rand == 4 or rand == 3 then
doRemoveItem(getkasa.uid,10)
doCreateItem(2160,30,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22,"You won 30 Crystal Coins :).")
end
end
if getkasa.itemid == 2160 and getkasa.type == 25 then
rand = math.random(4)
if rand == 1 then
doRemoveItem(getkasa.uid,25)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"You lost 25 Crystal Coins :(.")
end
if rand == 2 or rand == 4 or rand == 3 then
doRemoveItem(getkasa.uid,25)
doCreateItem(2160,75,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22,"You won 75 Crystal Coins :) .")
end
end
if getkasa.itemid == 2160 and getkasa.type == 50 then
rand = math.random(4)
if rand == 1 then
doRemoveItem(getkasa.uid,50)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"You lost 50 Crystal Coins :(.")
end
if rand == 2 or rand == 4 or rand == 3 then
doRemoveItem(getkasa.uid,50)
doCreateItem(2160,100,winpos)
doCreateItem(2160,50,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22,"You won 150 Crystal Coins :).")
end
end
if getkasa.itemid > 2160 or getkasa.itemid < 2160 then
doPlayerSendTextMessage(cid,22,"Place 5, 10, 25 or 50 Crystal Coins.")
end
if getkasa.itemid == 2160 and getkasa.type == 1 or getkasa.itemid == 2160 and getkasa.type == 2 or getkasa.itemid == 2160 and getkasa.type == 3 or getkasa.itemid == 2160 and getkasa.type == 4 or getkasa.itemid == 2160 and getkasa.type == 6 or getkasa.itemid == 2160 and getkasa.type == 7 or getkasa.itemid == 2160 and getkasa.type == 8
or getkasa.itemid == 2160 and getkasa.type == 9 or getkasa.itemid == 2160 and getkasa.type == 11 or getkasa.itemid == 2160 and getkasa.type == 12 or getkasa.itemid == 2160 and getkasa.type == 13 or getkasa.itemid == 2160 and getkasa.type == 14 or getkasa.itemid == 2160 and getkasa.type == 15 or getkasa.itemid == 2160 and getkasa.type == 16
or getkasa.itemid == 2160 and getkasa.type == 17 or getkasa.itemid == 2160 and getkasa.type == 18 or getkasa.itemid == 2160 and getkasa.type == 19 or getkasa.itemid == 2160 and getkasa.type == 20 or getkasa.itemid == 2160 and getkasa.type == 21 or getkasa.itemid == 2160 and getkasa.type == 22 or getkasa.itemid == 2160 and getkasa.type == 23
or getkasa.itemid == 2160 and getkasa.type == 24 or getkasa.itemid == 2160 and getkasa.type == 26 or getkasa.itemid == 2160 and getkasa.type == 27 or getkasa.itemid == 2160 and getkasa.type == 28 or getkasa.itemid == 2160 and getkasa.type == 29 or getkasa.itemid == 2160 and getkasa.type == 30 or getkasa.itemid == 2160 and getkasa.type == 31
or getkasa.itemid == 2160 and getkasa.type == 32 or getkasa.itemid == 2160 and getkasa.type == 33 or getkasa.itemid == 2160 and getkasa.type == 34 or getkasa.itemid == 2160 and getkasa.type == 35 or getkasa.itemid == 2160 and getkasa.type == 36 or getkasa.itemid == 2160 and getkasa.type == 37 or getkasa.itemid == 2160 and getkasa.type == 38
or getkasa.itemid == 2160 and getkasa.type == 39 or getkasa.itemid == 2160 and getkasa.type == 40 or getkasa.itemid == 2160 and getkasa.type == 41 or getkasa.itemid == 2160 and getkasa.type == 42 or getkasa.itemid == 2160 and getkasa.type == 43 or getkasa.itemid == 2160 and getkasa.type == 44 or getkasa.itemid == 2160 and getkasa.type == 45
or getkasa.itemid == 2160 and getkasa.type == 46 or getkasa.itemid == 2160 and getkasa.type == 47 or getkasa.itemid == 2160 and getkasa.type == 48 or getkasa.itemid == 2160 and getkasa.type == 49 or getkasa.itemid == 2160 and getkasa.type > 50 then
doPlayerSendTextMessage(cid,22,"Place 5, 10, 25 or 50 Crystal Coins.")
end
end
end

oR

(50% to win):
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == [B]5885[/B] then
[B]kasapos = {x=0, y=0, z=0, stackpos=255}[/B]
getkasa = getThingfromPos(kasapos)
[B]winpos = {x=0, y=0, z=0}[/B]
if getkasa.itemid == 2160 and getkasa.type == 5 then
rand = math.random(4)
if rand == 1 or rand == 4 then
doRemoveItem(getkasa.uid,5)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"You lost 5 Crystal Coins :(.")
end
if rand == 2 or rand == 3 then
doRemoveItem(getkasa.uid,5)
doCreateItem(2160,15,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22,"You won 15 Crystal Coins :).")
end
end
if getkasa.itemid == 2160 and getkasa.type == 10 then
rand = math.random(4)
if rand == 1 or rand == 4 then
doRemoveItem(getkasa.uid,10)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"You lost 10 Crystal Coins :(.")
end
if rand == 2 or rand == 3 then
doRemoveItem(getkasa.uid,10)
doCreateItem(2160,30,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22,"You won 30 Crystal Coins :).")
end
end
if getkasa.itemid == 2160 and getkasa.type == 25 then
rand = math.random(4)
if rand == 1 or rand == 4 then
doRemoveItem(getkasa.uid,25)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"You lost 25 Crystal Coins :(.")
end
if rand == 2 or rand == 3 then
doRemoveItem(getkasa.uid,25)
doCreateItem(2160,75,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22,"You won 75 Crystal Coins :) .")
end
end
if getkasa.itemid == 2160 and getkasa.type == 50 then
rand = math.random(4)
if rand == 1 or rand == 4 then
doRemoveItem(getkasa.uid,50)
doSendMagicEffect(kasapos,2)
doPlayerSendTextMessage(cid,22,"You lost 50 Crystal Coins :(.")
end
if rand == 2 or rand == 3 then
doRemoveItem(getkasa.uid,50)
doCreateItem(2160,100,winpos)
doCreateItem(2160,50,winpos)
doSendMagicEffect(winpos,13)
doSendMagicEffect(topos,21)
doPlayerSendTextMessage(cid,22,"You won 150 Crystal Coins :).")
end
end
if getkasa.itemid > 2160 or getkasa.itemid < 2160 then
doPlayerSendTextMessage(cid,22,"Place 5, 10, 25 or 50 Crystal Coins.")
end
if getkasa.itemid == 2160 and getkasa.type == 1 or getkasa.itemid == 2160 and getkasa.type == 2 or getkasa.itemid == 2160 and getkasa.type == 3 or getkasa.itemid == 2160 and getkasa.type == 4 or getkasa.itemid == 2160 and getkasa.type == 6 or getkasa.itemid == 2160 and getkasa.type == 7 or getkasa.itemid == 2160 and getkasa.type == 8
or getkasa.itemid == 2160 and getkasa.type == 9 or getkasa.itemid == 2160 and getkasa.type == 11 or getkasa.itemid == 2160 and getkasa.type == 12 or getkasa.itemid == 2160 and getkasa.type == 13 or getkasa.itemid == 2160 and getkasa.type == 14 or getkasa.itemid == 2160 and getkasa.type == 15 or getkasa.itemid == 2160 and getkasa.type == 16
or getkasa.itemid == 2160 and getkasa.type == 17 or getkasa.itemid == 2160 and getkasa.type == 18 or getkasa.itemid == 2160 and getkasa.type == 19 or getkasa.itemid == 2160 and getkasa.type == 20 or getkasa.itemid == 2160 and getkasa.type == 21 or getkasa.itemid == 2160 and getkasa.type == 22 or getkasa.itemid == 2160 and getkasa.type == 23
or getkasa.itemid == 2160 and getkasa.type == 24 or getkasa.itemid == 2160 and getkasa.type == 26 or getkasa.itemid == 2160 and getkasa.type == 27 or getkasa.itemid == 2160 and getkasa.type == 28 or getkasa.itemid == 2160 and getkasa.type == 29 or getkasa.itemid == 2160 and getkasa.type == 30 or getkasa.itemid == 2160 and getkasa.type == 31
or getkasa.itemid == 2160 and getkasa.type == 32 or getkasa.itemid == 2160 and getkasa.type == 33 or getkasa.itemid == 2160 and getkasa.type == 34 or getkasa.itemid == 2160 and getkasa.type == 35 or getkasa.itemid == 2160 and getkasa.type == 36 or getkasa.itemid == 2160 and getkasa.type == 37 or getkasa.itemid == 2160 and getkasa.type == 38
or getkasa.itemid == 2160 and getkasa.type == 39 or getkasa.itemid == 2160 and getkasa.type == 40 or getkasa.itemid == 2160 and getkasa.type == 41 or getkasa.itemid == 2160 and getkasa.type == 42 or getkasa.itemid == 2160 and getkasa.type == 43 or getkasa.itemid == 2160 and getkasa.type == 44 or getkasa.itemid == 2160 and getkasa.type == 45
or getkasa.itemid == 2160 and getkasa.type == 46 or getkasa.itemid == 2160 and getkasa.type == 47 or getkasa.itemid == 2160 and getkasa.type == 48 or getkasa.itemid == 2160 and getkasa.type == 49 or getkasa.itemid == 2160 and getkasa.type > 50 then
doPlayerSendTextMessage(cid,22,"Place 5, 10, 25 or 50 Crystal Coins.")
end
end
end

Kasapos - Where do we put kase / Stackpos unchanged.
Winpos - where lie won cash

rep me :D
 
Last edited:
This casino was made by me, Summ and Marki from Open-Tibia.de

This script is working kinda easy!

Casino.lua, safe it at data\actions\scripts
Code:
local c = {
reward_position = { x = 1060, y = 1014, z = 7}, -- Reward will appear here
money_position = { x = 1058, y = 1014, z = 7, stackpos=255}, -- Position of the money
money_id = 2160, -- Crystal Coin
money_amount = 1, -- How much crystal coins?
win_amount = 3 -- How much you will win.
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local random = math.random(1, 3)
	local getMoney = getThingfromPos(c.money_position)
	if (item.itemid == 1945) then
		if getMoney.itemid == c.money_id and getMoney.type >= c.money_amount then
			doTransformItem(item.uid, 1946)		
			doRemoveItem(getMoney.uid, c.money_amount)
			doSendMagicEffect(c.money_position, CONST_ME_POFF)
			if random == 1 then
				doCreateItem(c.money_id, c.win_amount, c.reward_position)
				doSendAnimatedText(getPlayerPosition(cid), "Won!", TEXTCOLOR_GREEN)
				doSendMagicEffect(c.reward_position, CONST_ME_MAGIC_RED)
			elseif random ~= 1 then
				doSendAnimatedText(getPlayerPosition(cid), "Looser", TEXTCOLOR_RED)
			end
		else
			doPlayerSendCancel(cid,"Sorry, you need to place " .. c.money_amount .. " Crystal Coin on the left tile.")
		end
	elseif (item.itemid == 1946) then
		return doTransformItem(item.uid, 1945)
	end
	return true
end

Config:
reward_position - The Position where the Reward will appear if you win.
money_position - Position where you have to place the money id, with money_amount
money_id - ID of the money, it's Crystal Coin right now
money_amount - The amount of the money, you have to place on money_position
win_amount - How much you will win...
 
This casino was made by me, Summ and Marki from Open-Tibia.de

This script is working kinda easy!

Casino.lua, safe it at data\actions\scripts
Code:
local c = {
reward_position = { x = 1060, y = 1014, z = 7}, -- Reward will appear here
money_position = { x = 1058, y = 1014, z = 7, stackpos=255}, -- Position of the money
money_id = 2160, -- Crystal Coin
money_amount = 1, -- How much crystal coins?
win_amount = 3 -- How much you will win.
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local random = math.random(1, 3)
	local getMoney = getThingfromPos(c.money_position)
	if (item.itemid == 1945) then
		if getMoney.itemid == c.money_id and getMoney.type >= c.money_amount then
			doTransformItem(item.uid, 1946)		
			doRemoveItem(getMoney.uid, c.money_amount)
			doSendMagicEffect(c.money_position, CONST_ME_POFF)
			if random == 1 then
				doCreateItem(c.money_id, c.win_amount, c.reward_position)
				doSendAnimatedText(getPlayerPosition(cid), "Won!", TEXTCOLOR_GREEN)
				doSendMagicEffect(c.reward_position, CONST_ME_MAGIC_RED)
			elseif random ~= 1 then
				doSendAnimatedText(getPlayerPosition(cid), "Looser", TEXTCOLOR_RED)
			end
		else
			doPlayerSendCancel(cid,"Sorry, you need to place " .. c.money_amount .. " Crystal Coin on the left tile.")
		end
	elseif (item.itemid == 1946) then
		return doTransformItem(item.uid, 1945)
	end
	return true
end

Config:
reward_position - The Position where the Reward will appear if you win.
money_position - Position where you have to place the money id, with money_amount
money_id - ID of the money, it's Crystal Coin right now
money_amount - The amount of the money, you have to place on money_position
win_amount - How much you will win...

my script is easier
 
my script is easier

If you think so ... :) But look at yours and then take a look at mine. (Easy overview) Mine is way better for newcomers, they can edit the configuration easily. That's the reason why I made this script.
I could also add more options with 10 / 20 / 50 Crystal Coins.
 
here i think this is better and even more configurable the only thing is that it always send the cancel message even when you placed the right amount of money and sometimes when you use the lever it does nothing but send the cancel message just keep pressing use until it does something, anyways those problems are beyond me and if anyone want to attempt to fix you are more than welcome to do so, so here is the script:
Lua:
local cfg = {
	switch = 9825, --Change this to the switch you want to use--
	action = 6000  --change this to the action id that you want--
	}
local t = {
		[{gold}] = {money = 2148, grand = "You won the Grand Prize.", jackpot = "You won the JackPot.", win = "You won.", lost = "You lost 5 gold coins.", cost = 5, chance = {
																								[{1, 1000}] = {Reward = 1, item = 2148},
																								[{1001, 2000}] = {Reward = 25, item = 2148},
																								[{2001, 4000}] = {lose = true},
																								[{4001, 5000}] = {reward = 50, item = 2148},
																								[{5001, 6000}] = {lose = true},
																								[{6001, 6500}] = {Reward = 75, item = 2148},
																								[{6501, 7000}] = {Reward = 100, item = 2148},
																								[{7001, 7100}] = {GrandReward = 5, item = 2152},
																								[{7101, 8000}] = {lose = true},
																								[{8001, 8050}] = {JackPot = 1, item = 2160}}},
		[{platinum}] = {money = 2152, grand = "You won the Grand Prize.", jackpot = "You won the JackPot.", win = "You won.", lost = "You lost 5 platinum coins.", cost = 5, chance = {
																								[{1, 1000}] = {Reward = 1, item = 2152},
																								[{1001, 2000}] = {Reward = 25, item = 2152},
																								[{2001, 4000}] = {lose = true},
																								[{4001, 5000}] = {reward = 50, item = 2152},
																								[{5001, 6000}] = {lose = true},
																								[{6001, 6500}] = {Reward = 75, item = 2152},
																								[{6501, 7000}] = {Reward = 100, item = 2152},
																								[{7001, 7100}] = {GrandReward = 5, item = 2160},
																								[{7101, 8000}] = {lose = true},
																								[{8001, 8050}] = {JackPot = 1, item = 2160}}},
		[{crystal}] = {money = 2160, grand = "You won the Grand Prize.", jackpot = "You won the JackPot.", win = "You won.", lost = "You lost 5 crystal coins.", cost = 5, chance = {
																								[{1, 1000}] = {Reward = 1, item = 2160},
																								[{1001, 2000}] = {Reward = 25, item = 2160},
																								[{2001, 4000}] = {lose = true},
																								[{4001, 5000}] = {reward = 50, item = 2160},
																								[{5001, 6000}] = {lose = true},
																								[{6001, 6500}] = {Reward = 75, item = 2160},
																								[{6501, 7000}] = {Reward = 100, item = 2160},
																								[{7001, 7100}] = {GrandReward = 200, item = 2160},
																								[{7101, 8000}] = {lose = true},
																								[{8001, 8050}] = {JackPot = 400, item = 2160}}}																							
	}																							
function onUse(cid, item, toPosition, itemEx, fromPosition)
	for i, k in pairs(t) do
		for chance, k2 in pairs(k.chance) do
			local getMoney = getThingfromPos({x = toPosition.x, y = toPosition.y+1, z = toPosition.z, stackpos = 255})
			if item.itemid == cfg.switch and item.actionid == cfg.action then
				if getMoney.itemid == k.money and getMoney.type == k.cost then
					local v = math.random(8050)
					if v >= chance[1] and v <= chance[2] then
						if k2.Reward then
							doRemoveItem(getMoney.uid)
							doPlayerAddItem(cid, k2.item, k2.Reward)
							doPlayerSendTextMessage(cid, 25, k.win)
						end	
						if k2.lose then
							doRemoveItem(getMoney.uid)
							doPlayerSendTextMessage(cid, 25, k.lost)
						end
						if k2.GrandReward then
							doRemoveItem(getMoney.uid)
							doPlayerAddItem(cid, k2.item, k2.GrandReward)
							doPlayerSendTextMessage(cid, 25, k.grand)
						end
						if k2.JackPot then
							doRemoveItem(getMoney.uid)
							doPlayerAddItem(cid, k2.item, k2.JackPot)
							doPlayerSendTextMessage(cid, 25, k.jackpot)
						end
					end	
				else
					doPlayerSendCancel(cid, "Make sure there is "..k.cost.." coins on the table.")
				end
			end	
		end
	end
end
P.S.
this works with all three currency and each have different winnings. and this can only be used if the player is standing in front of the counter where he places the money and the switch mus be always a tile up to where the counter is:
[T X] [X T]
[P M] [M P]
X= Switch, T= any blocking object, P= Player and M= Counter Where the money goes
only in those two forms that you may place the switch.
 
Last edited:
Back
Top