function onUse(cid, item, fromPosition, itemEx, toPosition)
if((itemEx.uid <= 65535 or itemEx.actionid > 0) and isInArray({354, 355}, itemEx.itemid)) then
doTransformItem(itemEx.uid, 392)
doDecayItem(itemEx.uid)
doSendMagicEffect(toPosition, CONST_ME_POFF)
return true
end
if(itemEx.itemid == 7200) then
doTransformItem(itemEx.uid, 7236)
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
return true
end
local _uid = 1200
local _time = 1 -- time the portal stays open in minutes
local _to = { x = 1110, y = 503, z = 6 }, -- Where Teleport Goes
local _tp = { x = 1096, y = 516, z = 3, stackpos=2} -- Where Teleport Creates
local function deleteTeleport()
local teleport = getTileItemById(_tp, 1387)
if(teleport.uid > 0) then
doRemoveItem(teleport.uid)
doSendMagicEffect(_tp, CONST_ME_POFF)
doSendAnimatedText(_tp, "Closed", TEXTCOLOR_RED)
end
return true
end
if itemEx.uid == _uid then
doCreateTeleport(1387, _to, _tp)
addEvent(deleteTeleport, _time * 1000 * 60)
doCreatureSay(cid, "You have " .. _time .. " minutes to enter the portal!", TALKTYPE_ORANGE_1)
end
return false
end
17-20 lines:
local _to = { x = 32368, y = 32220, z = 7 }, -- Where Teleport Goes
local _tp = { x = 32371, y = 32215, z = 7, stackpos=2 } -- Where Teleport Creates
local function deleteTeleport()
local _uid = 1200
local _time = 1 -- time the portal stays open in minutes
local _to = { x = 1110, y = 503, z = 6 }, -- Where Teleport Goes
local _tp = { x = 1096, y = 516, z = 3, stackpos=2} -- Where Teleport Creates
function onUse(cid, item, fromPosition, itemEx, toPosition)
if((itemEx.uid <= 65535 or itemEx.actionid > 0) and isInArray({354, 355}, itemEx.itemid)) then
doTransformItem(itemEx.uid, 392)
doDecayItem(itemEx.uid)
doSendMagicEffect(toPosition, CONST_ME_POFF)
return true
end
if(itemEx.itemid == 7200) then
doTransformItem(itemEx.uid, 7236)
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
return true
end
local function deleteTeleport()
local teleport = getTileItemById(_tp, 1387)
if(teleport.uid > 0) then
doRemoveItem(teleport.uid)
doSendMagicEffect(_tp, CONST_ME_POFF)
doSendAnimatedText(_tp, "Closed", TEXTCOLOR_RED)
end
return true
end
if itemEx.uid == _uid then
doCreateTeleport(1387, _to, _tp)
addEvent(deleteTeleport, _time * 1000 * 60)
doCreatureSay(cid, "You have " .. _time .. " minutes to enter the portal!", TALKTYPE_ORANGE_1)
end
return false
end
if getPlayerStorageValue(cid, arena_room+getPlayerStorageValue(cid, 42355)*10-1) == 1 or arena_room+getPlayerStorageValue(cid, 42355)*10-1 == 42299 then
if getGlobalStorageValue(cid, arena_room) == 0 then
local monster_uid = getGlobalStorageValue(arena_room+100)
if monster_uid > 0 then
if isCreature(monster_uid) == TRUE then
doRemoveCreature(monster_uid)
end
end
local spawn_pos = getThingPos(arena_room)
local monster = doCreateMonster(arena_monsters[arena_room+getPlayerStorageValue(cid, 42355)*10], {x=spawn_pos.x-1,y=spawn_pos.y-1,z=spawn_pos.z})
setGlobalStorageValue(arena_room+100, monster)
doTeleportThing(cid, spawn_pos, TRUE)
setGlobalStorageValue(arena_room, cid)
setGlobalStorageValue(arena_room-1, 0)
setPlayerStorageValue(cid, 42350, os.time()+arena_room_max_time)
else
doTeleportThing(cid, fromPosition, TRUE)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE,getCreatureName(getGlobalStorageValue(cid, arena_room))..' is now in next room. Wait a moment and try again.')
doItemSetAttribute(doCreateTeleport(1387, _to, _tp), "aid", 10000)
<movevent type="StepIn" actionid="10000" event="script" value="remove.lua"/>
function onStepIn(cid, item, position, fromPosition)
doRemoveItem(item.uid)
end
local _uid = 15479
local _time = 1 -- time the portal stays open in minutes
local _to = { x = 333, y = 921, z = 15 } -- Where Teleport Goes
local _tp = { x = 314, y = 810, z = 15, stackpos=2 } -- Where Teleport Creates
function onUse(cid, item, fromPosition, itemEx, toPosition)
if((itemEx.uid <= 65535 or itemEx.actionid > 0) and isInArray({354, 355}, itemEx.itemid)) then
doTransformItem(itemEx.uid, 392)
doDecayItem(itemEx.uid)
doSendMagicEffect(toPosition, CONST_ME_POFF)
return true
end
if(itemEx.itemid == 7200) then
doTransformItem(itemEx.uid, 7236)
doSendMagicEffect(toPosition, CONST_ME_BLOCKHIT)
return true
end
local function deleteTeleport()
local teleport = getTileItemById(_tp, 1387)
if(teleport.uid > 0) then
doRemoveItem(teleport.uid)
doSendMagicEffect(_tp, CONST_ME_POFF)
end
return true
end
if itemEx.uid == _uid then
doItemSetAttribute(doCreateTeleport(1387, _to, _tp), "aid", 31249)
addEvent(deleteTeleport, _time * 1000 * 60)
doCreatureSay(cid, "You have " .. _time .. " minutes to enter the portal!", TALKTYPE_ORANGE_1)
end
return false
end
local t = {
uid = 15479, -- uniqueid of the special tile
time = 1, -- time the portal stays open in minutes
createPos = {x=314, y=810, z=15}, -- Where Teleport Creates
exhaustStorage = 10000,
exhaustDuration = 3 * 60 -- in seconds
}
local function deleteTeleport()
local v = getTileItemById(t.createPos, 1387).uid
return v > 0 and doRemoveItem(v) and doSendMagicEffect(t.createPos, CONST_ME_POFF)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if((itemEx.uid <= 65535 or itemEx.actionid > 0) and isInArray({354, 355}, itemEx.itemid)) then
doTransformItem(itemEx.uid, 392)
doDecayItem(itemEx.uid)
elseif(itemEx.itemid == 7200) then
doTransformItem(itemEx.uid, 7236)
doSendMagicEffect(toPosition, CONST_ME_HITAREA)
elseif itemEx.uid == t.uid then
if os.time() - getGlobalStorageValue(t.exhaustStorage) >= t.exhaustDuration then
doItemSetAttribute(doCreateItem(1387, 1, t.createPos), "aid", 31249)
addEvent(deleteTeleport, t.time * 60000)
doCreatureSay(cid, "You have " .. t.time .. " minute".. (t.time ~= 1 and "s" or "") .." to enter the portal!", TALKTYPE_ORANGE_1)
setGlobalStorageValue(t.exhaustStorage, os.time())
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is not time yet.")
end
else
return false
end
return true
end
local destination = {x=333, y=921, z=15} -- Where Teleport Goes
function onStepIn(cid, item, position, fromPosition)
doTeleportThing(cid, destination)
doSendMagicEffect(destination, CONST_ME_TELEPORT)
doRemoveItem(item.uid)
end
local destination = {x=333, y=921, z=15}[COLOR="Red"][B],[/B][/COLOR]
doSendMagicEffect(de[COLOR="Red"][B]si[/B][/COLOR]nation