• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[actions] TFS v0.2.8. MysticS. When i put corpse, wall dissapear.

miklus

New Member
Joined
Feb 17, 2009
Messages
64
Reaction score
0
Location
Poland, Belchatow
51pz81.jpg


I need script for TFS v0.2.8. MS.
When i put corpse on this gray SQM- then wall will dissapear.
 
LUA:
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
 
Last edited:
Code:
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
somethink like this but for TFS v0.2.8.0 Mystic Spirit
 
quest.lua
Code:
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

actions.lua
Code:
	<action uniqueid="7431" event="script" value="quest.lua"/>

NO ACTION ON SERVER, but no errors in console.
 
Back
Top