Ninkobi
Owner /Founder of Syphera
I made a script for teleport scrolls with battle check and time delay of 20 minutes. Here it is:
Not tested. Please test it.
Code:
local exhausttime = 20 * 60 * 1000
local exhaust = createConditionObject(CONDITION_EXHAUSTED)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, exhausttime)
function onUse(cid, item, frompos, item2, topos)
temple = getPlayerMasterPos(cid)
pos = getPlayerPosition(cid)
if hasCondition(cid, CONDITION_EXHAUSTED) == TRUE then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return TRUE
end
if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
doSendMagicEffect(pos,2)
doTeleportThing(cid,temple)
doSendMagicEffect(temple,10)
doAddCondition(cid, exhaust)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid,"You have PZ lock.")
end
return 1
end
Not tested. Please test it.