• 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!

Need Help with quest chest

Leitwolf93

New Member
Joined
Sep 7, 2010
Messages
1
Reaction score
0
Hello people,
I've got a proplem I'm doing one's own tibia on server.
I go much but knows how to make quest I know not real.
So the proplem is that I know not if I put an item in the chest that each player can only once get out of it should then it's empty but I'm not knows how to do it = (please help me

(Ahh my English, I really an info surprised not bad ^ ^ sorry.
Mfg Leitwolf93
 
Hello...
I tried to understand what you talking about! Do u want do a quest right?
Then do that:
Go to DATA/ACTION/SCRIPTS and copy any file from there and paste...in the same folder...then rename for what u want...like quest1.lua, after that open it with notepad and paste this
function onUse(cid, item, frompos, item2, topos)


if item.uid == 6017 then
if getPlayerStorageValue(cid,6017) == -1 then
doPlayerSendTextMessage(cid,25,"You have found a crystal coin.")
doPlayerAddItem(cid,2160,1)
setPlayerStorageValue(cid,6017,1)
else
doPlayerSendTextMessage(cid,25,"The is empty.")
end

end
return TRUE
end

Red words - you put the unique id u choose in map editor...( in map editor create one chest in the quest and right click on it and click properties...choose one unique id for chest)
Blue words - you put the id of the item reward of the quest!
After that save the quest1.lua and go
DATA/ACTIONS ... open actions.xml with notepad and paste this
<action uniqueid="6017" event="script" value="quest1.lua" />

Thats done
See ya!
 
You'll only have to change the configuration and add it to 'actions.xml'.

LUA:
local r = { -- configuration
	storage = 1501, -- storage
	reward = 1052, -- itemid of rewarded item.
	count = 1 -- amount of reward you get.
	}

function onUse(cid,item,itemEx,fromPosition,toPosition)
local v = getThingPos(cid)
	if getPlayerStorageVale(cid,r.storage) < 1 then
		doPlayerSendTextMessage(cid,27,'You got '..getItemArticleById(r.reward)..' '..getItemNameById(r.reward)..'!')
		doSendMagicEffect(v,12)
		setPlayerStorageValue(cid,r.storage,1)
		doPlayerGiveItem(cid,r.reward,r.count)
	else
		doPlayerSendTextMessage(cid,27,'You may only use this chest once.')
		doSendMagicEffect(v,2)
	end
	return true
end
 
Too complicated, in the mapeditor just set the actionid of the chest to 2000, give it any unique id and put the item inside.
 
Back
Top