JDB
OtLand Veteran
- Joined
- Jun 1, 2009
- Messages
- 4,145
- Solutions
- 2
- Reaction score
- 115
How it works:
data/actions/actions.xml
data/actions/scripts/dhq.lua
- Pull Lever.
- Teleport Appears and Wall Removes.
- 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: