• 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!

[Quest] PoI by Moqill

Moqill

czejwone jabjuszko to ja!
Joined
Jan 4, 2008
Messages
1,016
Reaction score
22
Autor: Moqill
Licencja: X11
Tested: TFS 0.4_

PHP:
<action uniqueid="2040-2057" script="quests/poi/stones.lua" />
Script stones.lua
PHP:
    local config = {
    		-- 1 sala
    	[2040] = {stone = {x=X, y=Y, z=Z}, time=20, stoneid=1304, switch=1945},
    	[2041] = {stone = {x=608, y=645, z=10}, time=20, 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

You must add to movements.xml:
PHP:
		<!-- PoI -->
	<movevent type="StepIn" uniqueid="2060-2065" script="quests/poi/thrones.lua"/>
	<movevent type="StepIn" uniqueid="2066-2071" script="quests/poi/bramka.lua"/>
This is script bramka.lua
PHP:
    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

Script thrones.lua
PHP:
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
 
maybe later
 
Last edited:
Can't really understand your bramka.lua. I tried making my own actionscript using a bit of your script:
Code:
  local config = {
		[10280] = {storage = 10280, name = "Verminor´s", efekt = 20},
		[10281] = {storage = 10281, name = "Infernatil´s", efekt = 15},
		[10282] = {storage = 10282, name = "Tafariel´s", efekt = 2},
		[10283] = {storage = 10283, name = "Apocalypse´s", efekt = 4},
		[10284] = {storage = 10284, name = "Pumina's", efekt = 7},
		[10285] = {storage = 10285, name = "Ashfalor´s", efekt = 17}
    }
function onUse(cid, item, frompos, item2, topos)
local cfg = config[item.uid]
local item.uid == 10281 and item.itemid == 1223 and pos == {x=345, y=1419, z=12} then
        if getPlayerStorageValue(cid, cfg.storage, pos) ~= 1 then
            doTransformItem(item.uid,item.itemid+1)
			doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You absorbed enough energy! You may pass.')
        else
            doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'Sorry, but you did not absorb enough energy!')
        end
    end
 
Back
Top