Autor: Moqill
Licencja: open source
Testowane: TFS 0.4_\\

Oto pliczek który dodajemy za pomocą:

action.xml
	<action uniqueid="2040-2057" script="quests/poi/stones.lua" />
stone.lua
local config = {
		-- 1 sala
	[2040] = {stone = {x=608, y=646, z=10}, time=20, stoneid=1304, switch=1945},
	[2041] = {stone = {x=608, y=645, z=10}, time=20, stoneid=1304, switch=1945},
	[2042] = {stone = {x=608, y=644, z=10}, time=20, stoneid=1304, switch=1945},
		-- 2 sala
	[2043] = {stone = {x=649, y=645, z=12}, time=20, stoneid=1304, switch=1945},
	[2044] = {stone = {x=650, y=645, z=12}, time=20, stoneid=1304, switch=1945},
	[2045] = {stone = {x=651, y=645, z=12}, time=20, stoneid=1304, switch=1945},
		-- 3 sale z fioletowymi ogniami
	[2046] = {stone = {x=660, y=650, z=11}, time=10, stoneid=1304, switch=1945},
	[2047] = {stone = {x=662, y=650, z=11}, time=10, stoneid=1304, switch=1945},
	[2048] = {stone = {x=664, y=650, z=11}, time=10, stoneid=1304, switch=1945},
	[2049] = {stone = {x=666, y=650, z=11}, time=10, stoneid=1304, switch=1945},
		-- ostatnia sala 8 kamieni
	[2050] = {stone = {x=684, y=650, z=12}, time=60, stoneid=1304, switch=1945},
	[2051] = {stone = {x=685, y=650, z=12}, time=60, stoneid=1304, switch=1945},
	[2052] = {stone = {x=686, y=650, z=12}, time=60, stoneid=1304, switch=1945},
	[2053] = {stone = {x=687, y=650, z=12}, time=60, stoneid=1304, switch=1945},
	[2054] = {stone = {x=688, y=650, z=12}, time=60, stoneid=1304, switch=1945},
	[2055] = {stone = {x=689, y=650, z=12}, time=60, stoneid=1304, switch=1945},
	[2056] = {stone = {x=690, y=650, z=12}, time=60, stoneid=1304, switch=1945},
	[2057] = {stone = {x=691, y=650, z=12}, time=60, stoneid=1304, switch=1945}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = config[item.uid]
	local stoneCheck = getTileItemById(cfg.stone, cfg.stoneid)
 
		if item.itemid == 1945 then
			doRemoveItem(stoneCheck.uid)
			doCreatureSay(cid, "You deleted this stone for "..cfg.time.." minutes. Hurry up!", TALKTYPE_ORANGE_1)
			doTransformItem(item.uid, item.itemid + 1)
			local function eventCreateItem(a) doCreateItem(a[1], a[2], a[3]) end
			addEvent(eventCreateItem, cfg.time*60*1000, {cfg.stoneid, 1, cfg.stone})
			local function eventDoTransformItem(b) doTransformItem(b[1], b[2]) end
			addEvent(eventDoTransformItem, cfg.time*60*1000, {item.uid, cfg.switch})
		elseif item.itemid == 1946 then
			doPlayerSendCancel(cid, "The stone is deleted.")
		end
	return true
end

I Teraz 2 pliczki do tronów i bramek. Dodajemy za pomocą:

movements.xml
		<!-- PoI -->
	<movevent type="StepIn" uniqueid="2060-2065" script="quests/poi/thrones.lua"/>
	<movevent type="StepIn" uniqueid="2066-2071" script="quests/poi/bramka.lua"/>
bramka.lua
local config = {
	[2066] = {storage = 2060, name="Verminor´s", efekt = 20},
	[2067] = {storage = 2061, name="Infernatil´s", efekt = 15},
	[2068] = {storage = 2062, name="Tafariel´s", efekt = 2},
	[2069] = {storage = 2063, name="Apocalypse´s", efekt = 4},
	[2070] = {storage = 2064, name="Pumina's", efekt = 7},
	[2071] = {storage = 2065, name="Ashfalor´s", efekt = 17}
}
 
function onStepIn(cid, item, pos)
local pos = {x=712, y=658, z=12}
local cfg = config[item.uid]
	if getPlayerStorageValue(cid, cfg.storage) ~= 1 then
		doTeleportThing(cid, pos)
		doCreatureSay(cid, "Sorry, but you did not absorb enough energy! You must touch " ..cfg.name.. " throne!", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(cid),cfg.efekt)
	end
	return true
end
thrones.lua
local config = {
	[2060] = {storage = 2060, name = "Verminor´s", efekt = 20},
	[2061] = {storage = 2061, name = "Infernatil´s", efekt = 15},
	[2062] = {storage = 2062, name = "Tafariel´s", efekt = 2},
	[2063] = {storage = 2063, name = "Apocalypse´s", efekt = 4},
	[2064] = {storage = 2064, name = "Pumina's", efekt = 7},
	[2065] = {storage = 2065, name = "Ashfalor´s", efekt = 17}
}
 
function onStepIn(cid, item, pos)
local cfg = config[item.uid]
local pos = getCreaturePosition(cid)
	if getPlayerStorageValue(cid, cfg.storage) == -1 then
		setPlayerStorageValue(cid,cfg.storage,1)
		doCreatureSay(cid, 'You have touched '..cfg.name..' throne and absorbed some of his spirit.', TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(cid),cfg.efekt)
		doTeleportThing(cid, {x=pos.x, y=pos.y+2, z=pos.z})
		doCreatureSay(cid,"Begone.", TALKTYPE_ORANGE_1)
 
	else
		doCreatureSay(cid, 'You have already absorbed some of '..cfg.name..' spirit.', TALKTYPE_ORANGE_1)
		doTeleportThing(cid, {x=pos.x, y=pos.y+2, z=pos.z})	
	end	
return true
end