• 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 Genius (Minigame)

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Reaction score
106
Location
Brazil
Well, i am back :p

This script was made by me 30 mins ago.
bearpaw.png

Yeah, it is not the first Genius minigame on all tibia script, but not the last one. i did it to have something to post <_<

Whatever, watch this script working

Genius in tibia By mock - YouTube

And now add this tag on actions.xml
<action actionid="1220" event="script" value="genius.lua"/>
open your map editor, in somewhere put the item id 9562, take a sqm in down of the 9562, in south add one 9563... Just take a look in the video, just copy the positions, and in each of them add actionid 1220.

create an genius.lua and add it:
Lua:
--BY Mock the bear (MTB)
local IDS = {
	[9562] = {'Red',0,15},
	[9563] = {'Blue',2,10},
	[9564] = {'Purple',3,22},
	[9565] = {'Green',1,45}
}
local GAME = {}
local reverse = {[0]=2,[2]=0,[3]=1,[1]=3}
function CP(cpos) -- because getPosByDir is bugged
	return {x=cpos.x,y=cpos.y,z=cpos.z}
end
local function gameloop()
	if GAME.next then
		if GAME.next <= os.time() then
			local selected = math.random(9562,9565)
			doSendMagicEffect(getPosByDir(CP(GAME.center),IDS[selected][2]),IDS[selected][3])
			GAME.delay = os.time()+10 + 5*(#GAME.list+1)
			GAME.list[#GAME.list+1] = selected
			GAME.next =  nil
			GAME.pressing = 1
			addEvent(doSendAnimatedText,500,CP(GAME.center),'GO!',182)
		end
	elseif GAME.delay then
		if GAME.delay <= os.time() then
			doTeleportThing(GAME.cid,GAME.oldpos)
			doCreatureSetNoMove(GAME.cid,false)
			doPlayerSendCancel(GAME.cid,"Timeout")
			GAME = {}
			collectgarbage()
			return
		end
	elseif GAME.show then
		if GAME.show <= os.time() then
			local selected = GAME.list[GAME.show_now]
			doSendMagicEffect(getPosByDir(CP(GAME.center),IDS[selected][2]),IDS[selected][3])
			GAME.show_now = GAME.show_now+1
			GAME.show = os.time()+1
			if GAME.show_now > #GAME.list then
				GAME.show_now = nil
				GAME.show = nil
				GAME.next = os.time()+1
			end
		end
	end
	addEvent(gameloop,1000)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if GAME.begin then
		if GAME.cid ~= cid then
			return false
		else
			if GAME.delay then
				doSendMagicEffect(getPosByDir(CP(GAME.center),IDS[item.itemid][2]),IDS[item.itemid][3])
				if item.itemid == GAME.list[GAME.pressing] then
					GAME.pressing = GAME.pressing+1
					if GAME.pressing > #GAME.list then
						GAME.delay = nil
						addEvent(function()
							GAME.show = os.time()+2
							GAME.show_now = 1
						end,1000)
					end
				else
					doPlayerSendCancel(GAME.cid,"WRONG! Your record is "..#GAME.list..".")
					doTeleportThing(GAME.cid,GAME.oldpos)
					doCreatureSetNoMove(GAME.cid,false)
					GAME = {}
					collectgarbage()
					return
				end
			end
		end
	else
		if IDS[item.itemid] then
			local center = getPosByDir(CP(fromPosition),reverse[IDS[item.itemid][2]])
			doSendMagicEffect(center,10)
			GAME.oldpos = CP(getCreaturePosition(cid))
			doTeleportThing(cid,center)
			doCreatureSetNoMove(cid,true)
			GAME.begin = true
			GAME.next = os.time()+3
			GAME.cid = cid
			GAME.list = {}
			GAME.center = center
			GAME.stept = 1
			gameloop(cid)
		else
			error('This itemid do not belong to the action.')
		end
	end
end

Tested on 0.3.6

For some people this game is called Simon
 
Last edited:
Nice, but could you answer me at msn :) Rep by the way!
 
What is the Genius game? Do you mean Simon?
Also, welcome back.

EDIT: Yeah, it's Simon.
 
and it is possible to add a point of money, for example:
15 points = 2cc
35 points = 5cc
50 points = 9cc
70 points = 12cc
85 points = 15cc
100 points = 20cc

that every time you hit in each game, you will earn one point.
points are reset to lose.
 
well the game is not ur best job, but its funny xD
I like ur server game interface (i dont know if real tibia have it, many time without logging there)
 
Just replace of all the doSendAnimatedText lines and then it will be for 9.x.
I expected you to be smarter than that, Mock.
 
Back
Top