miklus
New Member
I need script for TFS v0.2.8. MS.
When i put corpse on this gray SQM- then wall will dissapear.
local tile = {x=1, y=1, z=1}
local wall = {x=1, y=1, z=7}
local f, e = function(p)
doTransformItem(getTileItemById(p, 1946).uid, 1945)
doCreateItem(1025, 1, wall)
end, 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
local z = getTileItemById(tile, 5527).uid -- get corpse
if z ~= 0 then
doTransformItem(item.uid, 1946)
doRemoveItem(z) -- remove corpse
doRemoveItem(getTileItemById(wall, 1025).uid) -- remove wall
e = addEvent(f, 2 * 60 * 1000, fromPosition) -- reset in 2m
else
doPlayerSendCancel(cid, 'Sorry, not possible.')
end
else
stopEvent(e)
f(fromPosition)
end
return TRUE
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local corpsePos = {x=2849, y=2309, z=5, stackpos=255}
local wallPos = {x=2850, y=2308, z=5, stackpos=1}
local corpseId = 5527
local wallId = 1032
local time = 120
local corpse = getThingfromPos(corpsePos)
local wall = getThingfromPos(wallPos)
if item.itemid == 1945 then
if corpse.itemid == corpseId then
doRemoveItem(wall.uid, 1)
doRemoveItem(corpse.uid, 1)
doSendMagicEffect(wallPos, CONST_ME_POFF)
doTransformItem(item.uid, item.itemid+1)
addEvent(createWall, time*1000, wallPos, wallId)
else
doPlayerSendTextMessage(cid, 20, "Put corpse.")
end
else
doTransformItem(item.uid, item.itemid-1)
end
return TRUE
end
function createWall(wallPos, wallId)
if getThingfromPos(wallPos).itemid ~= wallId then
doCreateItem(wallId, 1, wallPos)
end
return TRUE
end
local tile = {x=2778, y=2323, z=5}
local wall = {x=2779, y=2324, z=5}
local f, e = function(p)
doTransformItem(getTileItemById(p, 1946).uid, 1945)
doCreateItem(1032, 1, wall)
end, 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 1945 then
local z = getTileItemById(tile, 5527).uid
if z ~= 0 then
doTransformItem(item.uid, 1946)
doRemoveItem(z)
doRemoveItem(getTileItemById(wall, 1032).uid)
e = addEvent(f, 2 * 60 * 1000, fromPosition)
else
doPlayerSendCancel(cid, 'Sorry, not possible.')
end
else
stopEvent(e)
f(fromPosition)
end
return TRUE
en
<action uniqueid="7431" event="script" value="quest.lua"/>