Parchment Quest

Broldosk

Banned User
Joined
Aug 23, 2019
Messages
31
Best answers
0
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:

M0ustafa

Î Àm ŁĕğẹňĎ
Support Team
Joined
Mar 4, 2017
Messages
816
Best answers
80
Reaction score
284
Location
Egypt
TFS version? What is this script supposed to do? And please read this before creating your next thread.
 

M0ustafa

Î Àm ŁĕğẹňĎ
Support Team
Joined
Mar 4, 2017
Messages
816
Best answers
80
Reaction score
284
Location
Egypt
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.)
 
OP
Broldosk

Broldosk

Banned User
Joined
Aug 23, 2019
Messages
31
Best answers
0
Reaction score
1
no item moves from game



Screenshot_1.jpgScreenshot_2.jpgScreenshot_3.jpgScreenshot_4.jpg
 

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
595
Best answers
16
Reaction score
70
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:
 

Delusion

Divine Intellect
Support Team
Joined
Feb 14, 2015
Messages
4,903
Best answers
446
Reaction score
2,516
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
;)
 
OP
Broldosk

Broldosk

Banned User
Joined
Aug 23, 2019
Messages
31
Best answers
0
Reaction score
1
i have one problem. my source no have
CREATURE_EVENT_THROW
in game.cpp
 

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
595
Best answers
16
Reaction score
70
i have one problem. my source no have
CREATURE_EVENT_THROW
in game.cpp
but u dont need it, look for any other function and add below it, u can search for:
C++:
else if(tmpStr == "preparedeath")
    m_type = CREATURE_EVENT_PREPAREDEATH;
and add below it
 

roriscrave

Intermediate OT User
Joined
Dec 7, 2011
Messages
595
Best answers
16
Reaction score
70
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
 
OP
Broldosk

Broldosk

Banned User
Joined
Aug 23, 2019
Messages
31
Best answers
0
Reaction score
1
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:
Top