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

Parchment Quest

Broldosk

New Member
Joined
Aug 23, 2019
Messages
31
Reaction score
1
Greetings guys, i need one help.
I recently added the moveitem function to my server, but I can't create the parchment quest with it.

TFS: 0.4
Tibia 8.6

this is my script

<action actionid="60999" script="parchmove.lua" />

Lua:
local cfg = {

    playerStorage = 60999,

    globalStorage = 60999,

    time = 60 * 60 * 24, -- in seconds

    positions = {

        {x=33060, y=31623, z=15},

        {x=33066, y=31623, z=15},

        {x=33060, y=31627, z=15},

        {x=33066, y=31627, z=15}

    }

}



function isCooldownReady()

    return os.time() > getGlobalStorageValue(cfg.globalStorage)

end



function onUse(cid, item, frompos, item2, topos)

    if not isCooldownReady() then

        return true

    end



    for _, t in pairs(cfg.positions) do

        doSummonCreature("Demon", t)

    end



    setPlayerStorageValue(cid, cfg.playerStorage, 1)

    setGlobalStorageValue(cfg.globalStorage, os.time() + cfg.time)

end



and creaturescript. and
login.lua registerCreatureEvent(cid, "parchment")

Lua:
local config = {



        str = 60999, --

        tempo = 10, --

        itemID = 1951, -- id item

        tileAID = 1742, -- Actionid  tile

        monster = {"Demon"} -- monstr

     

}



function isCooldownReady()

    return os.time() > getGlobalStorageValue(config.globalStorage)

end



function onMoveItem(cid, item, count, toContainer, fromContainer, fromPos, toPos)

        if getTileItemById(config.pos_item, config.id_item).uid > 0  then

        if not isCooldownReady() then

            return true

        end



        for _, t in pairs(config.positions) do

            doSummonCreature("Demon", t)

        end



        setPlayerStorageValue(cid, config.playerStorage, 1)

        setGlobalStorageValue(config.globalStorage, os.time() + config.time)

    else

        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "!")

    end

    return true









end



if anyone can give me a light (=
 
Last edited by a moderator:
TFS version? What is this script supposed to do? And please read this before creating your next thread.
 
Okey, After taking a deep search I understood that you meant Real-MAP Parchment Room quest (Never played real tibia so it was hard to figure it out) and by looking at your scripts so first step you'll have to edit your source and add function onMoveItem to get this script working.
Follow this tutorial and after compiling test your scripts then post here if there are still issues.
Or if you already added the function onMoveItem before so please post what errors are you getting when you use these scripts. (Would have been easier and solved if you gave more details.)
 
i don't know your case but some tfs 0.4 don't have the onMoveItem function so you might need to add it:
here is a link if your source does not have the function:
 
i don't know your case but some tfs 0.4 don't have the onMoveItem function so you might need to add it:
here is a link if your source does not have the function:
I recently added the moveitem function to my server
;)
 
u need to make it:
C++:
else if(tmpStr == "preparedeath")
    m_type = CREATURE_EVENT_PREPAREDEATH;
else if(tmpStr == "moveitem")
    m_type = CREATURE_EVENT_MOVEITEM;

if your code is type, use type:

C++:
else if(type == "preparedeath")
    _type = CREATURE_EVENT_PREPAREDEATH;
else if(type == "moveitem")
    _type = CREATURE_EVENT_MOVEITEM;

just write the same as the other scripts
 
I used the same function but differently, I believe it worked because there was no error in the distro.

Parchment quest solved.

script


function doQuestAgain()
setGlobalStorageValue(cid, 60999, -1)
end

function onAddItem(moveitem, tileitem, position)
if moveitem.itemid == 1951 and moveitem.actionid == 60999 then
doTransformItem(moveitem.uid, 1953)
demon1pos = {x=33060, y=31623, z=15}
demon2pos = {x=33066, y=31623, z=15}
demon3pos = {x=33060, y=31627, z=15}
demon4pos = {x=33066, y=31627, z=15}
doSummonCreature("Demon", demon1pos)
doSummonCreature("Demon", demon2pos)
doSummonCreature("Demon", demon3pos)
doSummonCreature("Demon", demon4pos)
setPlayerStorageValue(uid, 60998, 1)
setGlobalStorageValue(uid, 60999, 1)
addEvent(doQuestAgain, 54000)
end
return TRUE
end

and movements
<movevent type="AddItem" actionid="60999" event="script" value="1234.lua"/>

now solved <3 sorry guys for spam here.
 
Last edited by a moderator:
Back
Top