<action itemid="7492" script="telescroll.lua"/>
--:::::::::::::::::::::::::::::::::::::::::::::::::: ::-- --:::::::::::Teleport Scroll like Diablo II:::::::::::-- --::::::::::By NauR with Ernie's little help::::::::::-- --:::::::::::::::::::::::::::::::::::::::::::::::::: ::--
function onUse(cid, item, frompos, item2, topos)
local town = getPlayerTown(cid) local temple = getTownTemplePosition(town) local pos = getCreaturePosition(cid) if getPlayerSkullType(cid) == 0 and getCreatureCondition(cid, CONDITION_INFIGHT) == 0 then if getPlayerStorageValue(cid, 10000) < 1 then setPlayerStorageValue(cid,10001,pos.x) setPlayerStorageValue(cid,10002,pos.y) setPlayerStorageValue(cid,10003,pos.z) setPlayerStorageValue(cid,10000,1) doTeleportThing(cid,temple) doSendMagicEffect(temple, 10) elseif getPlayerStorageValue(cid, 10000) == 1 then local oldpos = {x = getPlayerStorageValue(cid, 10001),y = getPlayerStorageValue(cid, 10002),z = getPlayerStorageValue(cid, 10003)} doTeleportThing(cid,oldpos) doSendMagicEffect(oldpos, 10) setPlayerStorageValue(cid,10000,0) doRemoveItem(item.uid,1) end else doPlayerSendCancel(cid,"You can't use this scroll if you've in fight or get skull") end end
|