Hello,
Ive created very interesting quest, and this script is a part of it.
Its like DHQ lever, but now you must stand on X tiles at once to remove X walls for X seconds.
Then tiles back to normal and walls appears again, everything is configurable.
You must add action id on every tile you chosen.
Ive created very interesting quest, and this script is a part of it.
Its like DHQ lever, but now you must stand on X tiles at once to remove X walls for X seconds.
Then tiles back to normal and walls appears again, everything is configurable.
Code:
local positions = {
{x=865, y=1171, z=9},
{x=871, y=1199, z=9},
{x=893, y=1169, z=9}
}
local bonesPositions = {
{x=865, y=1185, z=9},
{x=865, y=1186, z=9},
{x=865, y=1187, z=9}
}
local blockID = 6890
local openTime = 60
function onStepIn(cid, item, pos)
doTransformItem(item.uid, 425)
for i = 1, #positions do
local v = getTopCreature(positions[i]).uid
if not isPlayer(v) then
return true
end
end
if getGlobalStorageValue(8471) < os.time() then
setGlobalStorageValue(8471,os.time()+openTime)
addEvent(bonesBack, openTime * 1000)
for i = 1, #bonesPositions do
local v = getTileItemById(bonesPositions[i], blockID)
doSendMagicEffect(bonesPositions[i], 13)
doRemoveItem(v.uid, 1)
end
end
return true
end
function bonesBack()
local bones = getTileItemById(bonesPositions[1], blockID)
if bones.uid <= 0 then
for i = 1, #bonesPositions do
doCreateItem(blockID, 1, bonesPositions[i])
doSendMagicEffect(bonesPositions[i], 13)
end
for i = 1, #positions do
local v = getThingfromPos(positions[i])
doTransformItem(v.uid,426)
doSendMagicEffect(positions[i], 13)
end
end
end
function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
if getGlobalStorageValue(8471) < os.time() then
doTransformItem(item.uid, 426)
end
return true
end
You must add action id on every tile you chosen.