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

Action Demon Helmet Quest! v2.0

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Solutions
2
Reaction score
115
How it works:
  1. Pull Lever.
  2. Teleport Appears and Wall Removes.
  3. When the time is up the teleport disapears and the wall reapears.

data/actions/actions.xml
PHP:
<action uniqueid="5001" event="script" value="dhq.lua"/>

data/actions/scripts/dhq.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {
		p = {
			wall_ = { x = 100, y = 100, z = 7 }, -- Where the wall is.
			tp = { x = 100, y = 100, z = 7 }, -- Where the teleport creates.
			to = { x = 100, y = 100, z = 7 }, -- Where the teleport takes the player.
			lever = { x = 100, y = 100, z = 7 } -- Where the lever is.
		},
		time = 10, -- Time the teleport remains open.
		level = 100, -- Level to pull the lever.
		wall_id = 1445, -- Wall item id.
		msg = "Success!" -- Message given after lever is pulled.
	}
	if(item.itemid == 1945) then
		local h = cfg.p
		if(getPlayerLevel(cid) >= cfg.level) then
			local function resetQuest() return doCreateItem(cfg.wall_id, 1, h.wall_) and doRemoveItem(getTileItemById(h.tp, 1387).uid) and doTransformItem(getTileItemById(h.lever, 1946).uid, 1945) end
			return doCreateTeleport(1387, h.to, h.tp) and doRemoveItem(getTileItemById(h.wall_, cfg.wall_id).uid) and doCreatureSay(cid, cfg.msg, TALKTYPE_ORANGE_1) and addEvent(resetQuest, cfg.time * 1000) and doTransformItem(getTileItemById(h.lever, 1945).uid, 1946)
		else
			doPlayerSendCancel(cid, "Sorry, you your level is too low.")
		end
	elseif(item.itemid == 1946) then
		doPlayerSendCancel(cid, "Sorry, not possible.")
		doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
	end
	return true
end
 
Last edited:
Very nice!
Just one small problem, the lever won't reset to 1945 when the players are done with the quest. Is there something I've forgot to add or is there something wrong with the script?
 
Very nice!
Just one small problem, the lever won't reset to 1945 when the players are done with the quest. Is there something I've forgot to add or is there something wrong with the script?

I have tested it on 0.3.6pl1, what version do you use?
 
ah ok thanks didnt rly see it ;P

just read

How it works:

1. Pull Lever.
2. Teleport Appears and Wall Removes.
3. Then after a certain time the tp disappear.
:D

thanks you
 
hey what time is in rl tibia of teleport
not 10 sec
60?

and how to fix this when teleport removed and player staying on stone position:
 

Attachments

Last edited:
Back
Top