• 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 chest problems

Nigtwisj

Some person
Joined
Oct 26, 2014
Messages
127
Solutions
1
Reaction score
90
Location
Sweden
So i have these chests that i want to give items. But when i open them it opens the chest and gives me the items basicly duplicating the rewards

This is how my chests are set up.
cc60e2ee7320476a57e2109b274735ff.png
38ddf985c1bd56f8f5899e55a9c33bea.png


And this is what happens when i open them ingame

87244fbc258748274268860cb443ddcf.jpg
 
Back in my days the content should be empty. The script alone was handling what was given to the player.

But maybe now the programs are smart enough to look in the scripts and just display what will be given?
 
Back in my days the content should be empty. The script alone was handling what was given to the player.

But maybe now the programs are smart enough to look in the scripts and just display what will be given?
smart enough?
not hard to use functions given to you to go through the chest and give each item inside of it o-o
 
Here is the code im using

Code:
local specialQuests = {
   [2001] = 30015 --Annihilator
}

local questsExperience = {
   [30015] = 10000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

     local storage = specialQuests[item.actionid]
     if(not storage) then
         storage = item.uid
             if(storage > 65535) then
             return false
         end
     end

     if(getPlayerStorageValue(cid, storage) > 0) then
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
         return true
     end

     local items = {}
     local reward = 0

     local size = isContainer(item.uid) and getContainerSize(item.uid) or 0
     if(size == 0) then
         reward = doCopyItem(item, false)
     else
         for i = 0, size do
             local tmp = getContainerItem(item.uid, i)
             if(tmp.itemid > 0) then
                 table.insert(items, tmp)
             end
         end
     end

     size = table.maxn(items)
     if(size == 1) then
         reward = doCopyItem(items[1], true)
     end

     local result = ""
     if(reward ~= 0) then
         local ret = getItemDescriptions(reward.itemid)
         if(reward.type > 0 and isItemRune(reward.itemid)) then
             result = reward.type .. " charges " .. ret.name
         elseif(reward.type > 0 and isItemStackable(reward.itemid)) then
             result = reward.type .. " " .. ret.plural
         else
             result = ret.article .. " " .. ret.name
         end
     else
         if(size > 20) then
             reward = doCopyItem(item, false)
         elseif(size > 8) then
             reward = getThing(doCreateItemEx(1988, 1))
         else
             reward = getThing(doCreateItemEx(1987, 1))
         end
         for i = 1, size do
             local tmp = doCopyItem(items[i], true)
             if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then
                 print("[Warning] QuestSystem:", "Could not add quest reward")
             else
                 local ret = ", "
                 if(i == 1) then
                     ret = ""
                 elseif(i == size) then
                     ret = " and "
                 end
                 result = result .. ret
                 ret = getItemDescriptions(tmp.itemid)
                 if(tmp.type > 0 and isItemRune(tmp.itemid)) then
                     result = result .. tmp.type .. " charges " .. ret.name
                 elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then
                     result = result .. tmp.type .. " " .. ret.plural
                 else
                     result = result .. ret.article .. " " .. ret.name
                 end
             end
         end
     end

     if getPlayerFreeCap(cid) < getItemWeightByUID(reward.uid) then
         result = "You have found a reward weighing "..getItemWeightByUID(reward.uid).." oz. It is to heavy."
     elseif(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then
         result = "You have found a reward, but you don't have enough space."
     else
         result = "You have found " .. result .. "."
         setPlayerStorageValue(cid, storage, 1)
         if(questsExperience[storage] ~= nil) then
             doPlayerAddExp(cid, questsExperience[storage])
         end
     end

     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result)
     return true
end
 
Your server is fucked up, actions should overrun normal use of items. I don't think is anything wrong with the script and even if it had an error that shouldnt happen. What server are you using?
 
Chest item id (1740) is somewhere in actions.xml?
Yes, this exists in the actions.xml

Code:
<action itemid="1740" script="quests/quests.lua"/>
    <action fromid="1747" toid="1749" script="quests/quests.lua"/>
I changed that to 2000 and removed those 2 lines and i ended up getting the problem you were seeing. I tried using the code above but that doesnt seem to work either.

Edit: I can get it to work if i put the unique id of the item inthe the inuque id of the chest. but that doesnt help me if i want to have a chest give a backpack of items for example
 
You have this quest multiple scripted. You have one script for action id 2000 and another script for unique id 1200. And both are executed at once. If you are using TFS, there's default quest script. It works very well. So you don't have to make another script. I'm sure you have it scripted multiple amount of times. To do a proper quest, you have to set aid 2000, random uid and put items inside in RME, nothing else, no lua scripting at all.

or

Maybe you have quest system inside your engine. Try disabling your lua script and try again.
 
Last edited:
You have this quest multiple scripted. You have one script for action id 2000 and another script for unique id 1200. And both are executed at once. If you are using TFS, there's default quest script. It works very well. So you don't have to make another script. I'm sure you have it scripted multiple amount of times. To do a proper quest, you have to set aid 2000, random uid and put items inside in RME, nothing else, no lua scripting at all.

or

Maybe you have quest system inside your engine. Try disabling your lua script and try again.

I disabled my lua script and it did nothing. And i have made sure i dont have it double scripted and that im using the basic script that followed with the dist.
Here is the basic code that was in it.
Code:
local annihilatorReward = {1990, 2400, 2431, 2494}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if item.uid > 1000 and item.uid < 10000 then
        local itemWeight = getItemWeight(item.uid, 1, FALSE)
        local playerCap = getPlayerFreeCap(cid)
        if isInArray(annihilatorReward, item.uid) == TRUE then
            if getPlayerStorageValue(cid, 30015) == -1 then
                if playerCap >= itemWeight then
                    if item.uid == 1990 then
                        local container = doPlayerAddItem(cid, 1990, 1)
                        doAddContainerItem(container, 2326, 1)
                    else
                        doPlayerAddItem(cid, item.uid, 1)
                    end
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. '.')
                    setPlayerStorageValue(cid, 30015, 1)
                else
                    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
                end
            else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
            end
        elseif getPlayerStorageValue(cid, item.uid) == -1 then
            if playerCap >= itemWeight then
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. '.')
                doPlayerAddItem(cid, item.uid, 1)
                setPlayerStorageValue(cid, item.uid, 1)
            else
                doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemName(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.')
            end
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
        end
    else
        return FALSE
    end
    return TRUE
end

It has to be something with this. im not the person to talk about scripts but when im using this scrip and my unique id is less that 10000 it gives the item that has the same id as the uniqueid. but when i use an id over 10000 it just opens the chest and does nothing.
 
Edited, meant actions.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>

<actions>
    <!-- Quests -->
    <action itemid="1740" script="quests/quests.lua"/>
    <action fromid="1747" toid="1749" script="quests/quests.lua"/>
    <action uniqueid="30015" script="quests/annihilator.lua"/>

    <!-- Tools -->
    <action itemid="9930" script="rustremover.lua"/>
    <action itemid="2420" script="tools/machete.lua"/>
    <action itemid="2550" script="tools/scythe.lua"/>
    <action itemid="2580" script="tools/fishing.lua" allowfaruse="1"/>
    <action itemid="2554" script="tools/shovel.lua"/>
    <action itemid="2120" script="tools/rope.lua"/>
    <action itemid="2553" script="tools/pick.lua"/>

    <!-- Increase/Decrease ItemId -->
    <action itemid="1873" function="increaseItemId"/>
    <action itemid="1874" function="decreaseItemId"/>
    <action itemid="1875" function="increaseItemId"/>
    <action itemid="1876" function="decreaseItemId"/>
    <action itemid="2162" function="increaseItemId"/>
    <action itemid="2163" function="decreaseItemId"/>
    <action itemid="3743" function="increaseItemId"/>
    <action itemid="3744" function="decreaseItemId"/>
    <action itemid="3947" function="increaseItemId"/>
    <action itemid="3948" function="decreaseItemId"/>
    <action itemid="1479" function="increaseItemId"/>
    <action itemid="1480" function="decreaseItemId"/>
    <action itemid="1945" function="increaseItemId"/>
    <action itemid="1946" function="decreaseItemId"/>
    <action itemid="2037" function="increaseItemId"/>
    <action itemid="2038" function="decreaseItemId"/>
    <action itemid="2039" function="increaseItemId"/>
    <action itemid="2040" function="decreaseItemId"/>
    <action itemid="2058" function="increaseItemId"/>
    <action itemid="2059" function="decreaseItemId"/>
    <action itemid="2060" function="increaseItemId"/>
    <action itemid="2061" function="decreaseItemId"/>
    <action itemid="2066" function="increaseItemId"/>
    <action itemid="2067" function="decreaseItemId"/>
    <action itemid="2068" function="increaseItemId"/>
    <action itemid="2069" function="decreaseItemId"/>
    <action itemid="2064" function="increaseItemId"/>
    <action itemid="2065" function="decreaseItemId"/>
    <action itemid="2578" function="increaseItemId"/>
    <action itemid="2096" function="increaseItemId"/>
    <action itemid="2097" function="decreaseItemId"/>
    <action itemid="1786" function="increaseItemId"/>
    <action itemid="1787" function="decreaseItemId"/>
    <action itemid="1788" function="increaseItemId"/>
    <action itemid="1789" function="decreaseItemId"/>
    <action itemid="1790" function="increaseItemId"/>
    <action itemid="1791" function="decreaseItemId"/>
    <action itemid="1792" function="increaseItemId"/>
    <action itemid="1793" function="decreaseItemId"/>
    <action itemid="1634" function="increaseItemId"/>
    <action itemid="1635" function="decreaseItemId"/>
    <action itemid="1636" function="increaseItemId"/>
    <action itemid="1637" function="decreaseItemId"/>
    <action itemid="1638" function="increaseItemId"/>
    <action itemid="1639" function="decreaseItemId"/>
    <action itemid="1640" function="increaseItemId"/>
    <action itemid="1641" function="decreaseItemId"/>
    <action itemid="7058" function="increaseItemId"/>
    <action itemid="7059" function="decreaseItemId"/>
    <action itemid="8684" function="increaseItemId"/>
    <action itemid="8685" function="decreaseItemId"/>
    <action itemid="8686" function="increaseItemId"/>
    <action itemid="8687" function="decreaseItemId"/>
    <action itemid="8688" function="increaseItemId"/>
    <action itemid="8689" function="decreaseItemId"/>
    <action itemid="8690" function="increaseItemId"/>
    <action itemid="8691" function="decreaseItemId"/>
    <action itemid="9575" function="increaseItemId"/>
    <action itemid="9576" function="decreaseItemId"/>
    <action itemid="9577" function="increaseItemId"/>
    <action itemid="9578" function="decreaseItemId"/>
    <action itemid="9579" function="increaseItemId"/>
    <action itemid="9580" function="decreaseItemId"/>
    <action itemid="9581" function="increaseItemId"/>
    <action itemid="9582" function="decreaseItemId"/>
    <action itemid="9747" function="increaseItemId"/>
    <action itemid="9748" function="decreaseItemId"/>
    <action itemid="9749" function="increaseItemId"/>
    <action itemid="9750" function="decreaseItemId"/>

    <!-- Food -->
    <action fromid="2362" toid="2363" script="other/food.lua"/>
    <action fromid="2666" toid="2691" script="other/food.lua"/>
    <action fromid="2695" toid="2696" script="other/food.lua"/>
    <action fromid="2787" toid="2796" script="other/food.lua"/>
    <action itemid="5097" script="other/food.lua"/>
    <action itemid="6125" script="other/food.lua"/>
    <action itemid="6278" script="other/food.lua"/>
    <action itemid="6279" script="other/food.lua"/>
    <action itemid="6394" script="other/food.lua"/>
    <action itemid="6501" script="other/food.lua"/>
    <action fromid="6541" toid="6545" script="other/food.lua"/>
    <action itemid="6569" script="other/food.lua"/>
    <action itemid="6574" script="other/food.lua"/>
    <action itemid="7158" script="other/food.lua"/>
    <action itemid="7159" script="other/food.lua"/>
    <action fromid="7372" toid="7377" script="other/food.lua"/>

    <!-- Spellbooks -->
    <action itemid="2175" script="other/spellbook.lua"/>
    <action itemid="6120" script="other/spellbook.lua"/>
    <action fromid="8900" toid="8904" script="other/spellbook.lua"/>
    <action itemid="8918" script="other/spellbook.lua"/>

    <!-- Other -->
    
    <action itemid="6578" script="other/partyhat.lua"/>
    <action itemid="2114" script="other/piggybank.lua"/>
    <action fromid="6570" toid="6571" script="other/surprisebag.lua"/>
    <action itemid="6576" script="other/fireworksrocket.lua"/>
    <action itemid="2036" script="other/watch.lua"/>
    <action fromid="1728" toid="1731" script="other/watch.lua"/>
    <action itemid="6572" script="other/partytrumpet.lua"/>
    <action itemid="2785" script="other/blueberrybush.lua"/>
    <action itemid="2579" script="other/trap.lua"/>
    <action itemid="2148" script="other/changegold.lua"/>
    <action itemid="2152" script="other/changegold.lua"/>
    <action itemid="2160" script="other/changegold.lua"/>
    <action fromid="3901" toid="3938" script="other/constructionkits.lua"/>
    <action fromid="2070" toid="2078" script="other/music.lua"/>
    <action fromid="2080" toid="2085" script="other/music.lua"/>
    <action itemid="2332" script="other/music.lua"/>
    <action itemid="2364" script="other/music.lua"/>
    <action fromid="2367" toid="2368" script="other/music.lua"/>
    <action fromid="2370" toid="2373" script="other/music.lua"/>
    <action fromid="2041" toid="2042" script="other/decayto.lua"/>
    <action fromid="2044" toid="2045" script="other/decayto.lua"/>
    <action fromid="2047" toid="2048" script="other/decayto.lua"/>
    <action fromid="2050" toid="2055" script="other/decayto.lua"/>
    <action itemid="430" script="other/teleport.lua"/>
    <action itemid="1369" script="other/teleport.lua"/>
    <action itemid="1386" script="other/teleport.lua"/>
    <action itemid="3678" script="other/teleport.lua"/>
    <action itemid="5543" script="other/teleport.lua"/>
    <action fromid="2376" toid="2404" script="other/destroy.lua"/>
    <action fromid="2406" toid="2419" script="other/destroy.lua"/>
    <action fromid="2421" toid="2453" script="other/destroy.lua"/>
    <action fromid="2005" toid="2009" script="other/fluids.lua"/>
    <action fromid="2011" toid="2015" script="other/fluids.lua"/>
    <action itemid="2023" script="other/fluids.lua"/>
    <action itemid="1775" script="other/fluids.lua"/>
    <action fromid="2031" toid="2034" script="other/fluids.lua"/>
    <action fromid="2574" toid="2577" script="other/fluids.lua"/>
    <action fromid="5792" toid="5797" script="other/dice.lua"/>
    <action itemid="7588" script="other/potions.lua"/>
    <action itemid="7589" script="other/potions.lua"/>
    <action itemid="7590" script="other/potions.lua"/>
    <action itemid="7591" script="other/potions.lua"/>
    <action itemid="7618" script="other/potions.lua"/>
    <action itemid="7620" script="other/potions.lua"/>
    <action itemid="8472" script="other/potions.lua"/>
    <action itemid="8473" script="other/potions.lua"/>
    <action itemid="8474" script="other/potions.lua"/>
    <action itemid="8704" script="other/potions.lua"/>
    <action itemid="2692" script="other/createbread.lua"/>
    <action itemid="2694" script="other/createbread.lua"/>
    <action fromid="6436" toid="6447" script="other/windows.lua"/>
    <action fromid="6450" toid="6473" script="other/windows.lua"/>
    <action fromid="6788" toid="6791" script="other/windows.lua"/>
    <action fromid="7025" toid="7032" script="other/windows.lua"/>
    <action fromid="10264" toid="10267" script="other/windows.lua" />
    <action fromid="10488" toid="10491" script="other/windows.lua" />
    <action fromid="1209" toid="1214" script="other/doors.lua"/>
    <action fromid="1219" toid="1262" script="other/doors.lua"/>
    <action fromid="1539" toid="1542" script="other/doors.lua"/>
    <action fromid="2086" toid="2092" script="other/doors.lua"/>
    <action fromid="3535" toid="3552" script="other/doors.lua"/>
    <action fromid="4913" toid="4918" script="other/doors.lua"/>
    <action fromid="5082" toid="5085" script="other/doors.lua"/>
    <action fromid="5098" toid="5145" script="other/doors.lua"/>
    <action fromid="5278" toid="5295" script="other/doors.lua"/>
    <action fromid="5515" toid="5518" script="other/doors.lua"/>
    <action fromid="5732" toid="5737" script="other/doors.lua"/>
    <action fromid="5745" toid="5749" script="other/doors.lua"/>
    <action fromid="6192" toid="6209" script="other/doors.lua"/>
    <action fromid="6249" toid="6266" script="other/doors.lua"/>
    <action fromid="6795" toid="6802" script="other/doors.lua"/>
    <action fromid="6891" toid="6908" script="other/doors.lua"/>
    <action fromid="7033" toid="7050" script="other/doors.lua"/>
    <action fromid="7054" toid="7057" script="other/doors.lua"/>
    <action fromid="8541" toid="8558" script="other/doors.lua"/>
    <action fromid="9165" toid="9184" script="other/doors.lua"/>
    <action fromid="9267" toid="9284" script="other/doors.lua"/>
    <action itemid="10032" script="other/doors.lua" />
    <action fromid="10268" toid="10285" script="other/doors.lua" />
    <action fromid="10468" toid="10486" script="other/doors.lua" />
    <action itemid="1981" function="highscoreBook"/>
</actions>
 
After you do all of it, test it with normal player, not GM!

Remove this:
Code:
<action itemid="1740" script="quests/quests.lua"/>
<action fromid="1747" toid="1749" script="quests/quests.lua"/>

Add this:
Code:
<action actionid="2000" event="script" value="quests/system.lua"/>
<action actionid="2001" event="script" value="quests/system.lua"/>

Make new file data/actions/scripts/quests/system.lua with this:
Code:
local specialQuests = {
    [2001] = 30015 --Annihilator
}

local questsExperience = {
    [30015] = 10000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE) then
        return TRUE
    end

    local storage = specialQuests[item.actionid]
    if(storage == nil) then
        storage = item.uid
        if(storage > 65535) then
            return FALSE
        end
    end

    local result = "It is empty."
    if(getPlayerStorageValue(cid, storage) == -1) then
        local items = {}
        local reward = 0

        local size = isContainer(item.uid) == TRUE and getContainerSize(item.uid) or 0
        if(size == 0) then
            reward = doCopyItem(item, FALSE)
        else
            for i = 0, size do
                local tmp = getContainerItem(item.uid, i)
                if(tmp.itemid > 0) then
                    table.insert(items, tmp)
                end
            end
        end

        size = table.maxn(items)
        if(size == 1) then
            reward = doCopyItem(items[1], TRUE)
        end

        if(reward ~= 0) then
            local ret = getItemDescriptions(reward.uid)
            if(reward.type > 0 and isItemRune(reward.itemid) == TRUE) then
                result = reward.type .. " charges " .. ret.name
            elseif(reward.type > 0 and isItemStackable(reward.itemid) == TRUE) then
                result = reward.type .. " " .. ret.plural
            else
                result = ret.article .. " " .. ret.name
            end
        else
            result = ""
            if(size > 20) then
                reward = doCopyItem(item, FALSE)
            elseif(size > 8) then
                reward = getThing(doCreateItemEx(1988, 1))
            else
                reward = getThing(doCreateItemEx(1987, 1))
            end

            for i = 1, size do
                local tmp = doCopyItem(items[i], TRUE)
                if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then
                    print("[Warning] QuestSystem:", "Could not add quest reward")
                else
                    local ret = ", "
                    if(i == 2) then
                        ret = " and "
                    elseif(i == 1) then
                        ret = ""
                    end

                    result = result .. ret
                    ret = getItemDescriptions(tmp.uid)
                    if(tmp.type > 0 and isItemRune(tmp.itemid) == TRUE) then
                        result = result .. tmp.type .. " charges " .. ret.name
                    elseif(tmp.type > 0 and isItemStackable(tmp.itemid) == TRUE) then
                        result = result .. tmp.type .. " " .. ret.plural
                    else
                        result = result .. ret.article .. " " .. ret.name
                    end
                end
            end
        end

        if(doPlayerAddItemEx(cid, reward.uid, FALSE) ~= RETURNVALUE_NOERROR) then
            result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space."
        else
            result = "You have found " .. result .. "."
            setPlayerStorageValue(cid, storage, 1)
            if(questsExperience[storage] ~= nil) then
                doPlayerAddExp(cid, questsExperience[storage])
                doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE)
            end
        end
    end

    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result)
    return TRUE
end

If problem still exists, check your libs. data/libs/, data/actions/libs/ and data/actions/scripts/libs/

To make the quest works:
1. put action id 2000 on any container, ex chest box
2. put unique id (your quest id)
3. put any items inside, with backpacks or not
4. nothing else
 
Last edited:
After you do all of it, test it with normal player, not GM!

Remove this:
Code:
<action itemid="1740" script="quests/quests.lua"/>
<action fromid="1747" toid="1749" script="quests/quests.lua"/>

Add this:
Code:
<action actionid="2000" event="script" value="quests/system.lua"/>
<action actionid="2001" event="script" value="quests/system.lua"/>

Make new file data/actions/scripts/quests/system.lua with this:
Code:
local specialQuests = {
    [2001] = 30015 --Annihilator
}

local questsExperience = {
    [30015] = 10000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(getPlayerCustomFlagValue(cid, PlayerCustomFlag_GamemasterPrivileges) == TRUE) then
        return TRUE
    end

    local storage = specialQuests[item.actionid]
    if(storage == nil) then
        storage = item.uid
        if(storage > 65535) then
            return FALSE
        end
    end

    local result = "It is empty."
    if(getPlayerStorageValue(cid, storage) == -1) then
        local items = {}
        local reward = 0

        local size = isContainer(item.uid) == TRUE and getContainerSize(item.uid) or 0
        if(size == 0) then
            reward = doCopyItem(item, FALSE)
        else
            for i = 0, size do
                local tmp = getContainerItem(item.uid, i)
                if(tmp.itemid > 0) then
                    table.insert(items, tmp)
                end
            end
        end

        size = table.maxn(items)
        if(size == 1) then
            reward = doCopyItem(items[1], TRUE)
        end

        if(reward ~= 0) then
            local ret = getItemDescriptions(reward.uid)
            if(reward.type > 0 and isItemRune(reward.itemid) == TRUE) then
                result = reward.type .. " charges " .. ret.name
            elseif(reward.type > 0 and isItemStackable(reward.itemid) == TRUE) then
                result = reward.type .. " " .. ret.plural
            else
                result = ret.article .. " " .. ret.name
            end
        else
            result = ""
            if(size > 20) then
                reward = doCopyItem(item, FALSE)
            elseif(size > 8) then
                reward = getThing(doCreateItemEx(1988, 1))
            else
                reward = getThing(doCreateItemEx(1987, 1))
            end

            for i = 1, size do
                local tmp = doCopyItem(items[i], TRUE)
                if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then
                    print("[Warning] QuestSystem:", "Could not add quest reward")
                else
                    local ret = ", "
                    if(i == 2) then
                        ret = " and "
                    elseif(i == 1) then
                        ret = ""
                    end

                    result = result .. ret
                    ret = getItemDescriptions(tmp.uid)
                    if(tmp.type > 0 and isItemRune(tmp.itemid) == TRUE) then
                        result = result .. tmp.type .. " charges " .. ret.name
                    elseif(tmp.type > 0 and isItemStackable(tmp.itemid) == TRUE) then
                        result = result .. tmp.type .. " " .. ret.plural
                    else
                        result = result .. ret.article .. " " .. ret.name
                    end
                end
            end
        end

        if(doPlayerAddItemEx(cid, reward.uid, FALSE) ~= RETURNVALUE_NOERROR) then
            result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space."
        else
            result = "You have found " .. result .. "."
            setPlayerStorageValue(cid, storage, 1)
            if(questsExperience[storage] ~= nil) then
                doPlayerAddExp(cid, questsExperience[storage])
                doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE)
            end
        end
    end

    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result)
    return TRUE
end

If problem still exists, check your libs. data/libs/, data/actions/libs/ and data/actions/scripts/libs/

To make the quest works:
1. put action id 2000 on any container, ex chest box
2. put unique id (your quest id)
3. put any items inside, with backpacks or not
4. nothing else

So i did all of this and now nothing happens at all when i click the chest it just opens like a normal chest. What should i look for in my actions/libs. I have an action.lua in there with this code
Code:
function destroyItem(cid, itemEx, toPosition)
    if itemEx.uid <= 65535 or itemEx.actionid > 0 then
        return FALSE
    end

    if (itemEx.itemid >= 1724 and itemEx.itemid <= 1741) or (itemEx.itemid >= 2581 and itemEx.itemid <= 2588) or itemEx.itemid == 1770 or itemEx.itemid == 2098 or itemEx.itemid == 1774 or itemEx.itemid == 1775 or itemEx.itemid == 2064 or (itemEx.itemid >= 1747 and itemEx.itemid <= 1753) or (itemEx.itemid >= 1714 and itemEx.itemid <= 1717) or (itemEx.itemid >= 1650 and itemEx.itemid <= 1653) or (itemEx.itemid >= 1666 and itemEx.itemid <= 1677) or (itemEx.itemid >= 1614 and itemEx.itemid <= 1616) or (itemEx.itemid >= 3813 and itemEx.itemid <= 3820) or (itemEx.itemid >= 3807 and itemEx.itemid <= 3810) or (itemEx.itemid >= 2080 and itemEx.itemid <= 2085) or (itemEx.itemid >= 2116 and itemEx.itemid <= 2119) or itemEx.itemid == 2094 or itemEx.itemid == 2095 or itemEx.itemid == 1619 or itemEx.itemid == 2602 or itemEx.itemid == 3805 or itemEx.itemid == 3806 then
        if math.random(1, 7) == 1 then
            if itemEx.itemid == 1738 or itemEx.itemid == 1739 or (itemEx.itemid >= 2581 and itemEx.itemid <= 2588) or itemEx.itemid == 1770 or itemEx.itemid == 2098 or itemEx.itemid == 1774 or itemEx.itemid == 1775 or itemEx.itemid == 2064 then
                doCreateItem(2250, 1, toPosition)
            elseif (itemEx.itemid >= 1747 and itemEx.itemid <= 1749) or itemEx.itemid == 1740 then
                doCreateItem(2251, 1, toPosition)
            elseif (itemEx.itemid >= 1714 and itemEx.itemid <= 1717) then
                doCreateItem(2252, 1, toPosition)
            elseif (itemEx.itemid >= 1650 and itemEx.itemid <= 1653) or (itemEx.itemid >= 1666 and itemEx.itemid <= 1677) or (itemEx.itemid >= 1614 and itemEx.itemid <= 1616) or (itemEx.itemid >= 3813 and itemEx.itemid <= 3820) or (itemEx.itemid >= 3807 and itemEx.itemid <= 3810) then
                doCreateItem(2253, 1, toPosition)
            elseif (itemEx.itemid >= 1724 and itemEx.itemid <= 1737) or (itemEx.itemid >= 2080 and itemEx.itemid <= 2085) or (itemEx.itemid >= 2116 and itemEx.itemid <= 2119) or itemEx.itemid == 2094 or itemEx.itemid == 2095 then
                doCreateItem(2254, 1, toPosition)
            elseif (itemEx.itemid >= 1750 and itemEx.itemid <= 1753) or itemEx.itemid == 1619 or itemEx.itemid == 1741 then
                doCreateItem(2255, 1, toPosition)
            elseif itemEx.itemid == 2602 then
                doCreateItem(2257, 1, toPosition)
            elseif itemEx.itemid == 3805 or itemEx.itemid == 3806 then
                doCreateItem(2259, 1, toPosition)
            end
            doRemoveItem(itemEx.uid, 1)
        end
        doSendMagicEffect(toPosition, CONST_ME_POFF)
        return TRUE
    end
    return FALSE
end
 
You are using a server from 2009 year (post from end 2010, they changed only protocols for newer tibia). As I remember, more popular was The Forgotten Server Crying Damson. Becouse it has less bugs. Crying Damson was updated more frequently and I recommend to use TFS Crying Damson 0.3.6 or 0.4. Both versions are for Tibia 8.6, your OTS is for Tibia 8.62, this little downgrade wont change anything.

This what I got after searching this.
As you see alot of people had exactly the same problem with TFS Mystic Spirit 0.2.8. Becouse server's engine, which are you using is bugged. From all infos, I found this thread with temporary solution (look at creation date) https://otland.net/threads/quest-rewards-trouble.122734/. But I highly recommend to do an upgrade to TFS 0.3.6 or 0.4.
 
Back
Top