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

TFS 1.X+ QUEST SCRIPT REQUEST

jo31

New Member
Joined
May 24, 2010
Messages
70
Reaction score
1
Location
Sweden
I need a script for TFS 1.3 that makes all Chests with ActionID = 2000
works just as they would on TFS 0.4

Because ive been transfering my Map and Server from 0.4 8.6 to 1.3 10.98 :D

And my chests doesnt work.
Is there a way to make it Universal to work on all chests?
 
Have you tried this one? Posted in your thread.
 
How do i make it work without changing every quest in the map editor...?
Post automatically merged:

I Will pay for someone to make all my quests work, they all have a unique UniqueID and action id 2000.
 
Have you tried this one? Posted in your thread.
I can pay you to make it work, if u want to.
 
Please read Support board rules.
9. Monetary Offerings:
- Any offerings of money are not allowed in this section. If you want help, ask it but you don't have to offer anything in return other than thanks.
and about your request add this script to your actions and name it quests2.lua or whatever you need.
Lua:
local specialQuests = {
    [2001] = 30015 --Annihilator
}

local questsExperience = {
    [30015] = 10000
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)

    local storage = specialQuests[item:getActionId()]
    if not storage then
        storage = item:getUniqueId()
        if storage > 65535 then
            return false
        end
    end

    if player:getStorageValue(storage) > 0 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
        return true
    end


    if itemType:isContainer() == true then
        items = container:getItems()
        rewardWeight = items[2]
        local itemType = ItemType(item:getId())
        local container = Container(item.uid)
        local playerCap = player:getFreeCapacity() / 100
        local items = {}
        local rewardWeight = 0
    
        if playerCap < rewardWeight then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found ' .. items[1][1]:getArticle() .. ' ' .. items[1][1]:getName() .. ' weighing ' .. rewardWeight .. ' oz it\'s too heavy.')
            return true
        end

        items = items[1]
        size = table.maxn(items)

        if size == 1 then
            local item = items[1]
            local count = item:getCount()
            local rewardContainer = Container(item.uid)
        

            if rewardContainer ~= nil then
                bag = player:addItem(item:getId(), 1)
                local rewardItems = rewardContainer:getItems()[1]

                for i = 1, #rewardItems do
                    bag:addItem(rewardItems[i]:getId(), rewardItems[i]:getCount())
                end
            else
                player:addItem(item:getId(), count)
            end
    
            player:setStorageValue(storage, 1)
        
            if count > 1 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found ' .. count .. ' ' .. item:getPluralName() .. '.')
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. item:getName() .. '.')
            end

        end
    end

    return true
end
then add this to your actions.xml
XML:
<action itemid="2000" script="quests/quests2.lua" />
    <action itemid="2001" script="quests/quests2.lua" />
and if you have this in your main quests system script, remove it.
Lua:
    if quest == 2000 then
        return false
    end
If it didn't work then post your quest system script because I have tried the above on main/latest TFS and it worked.
 
On Annihilator quest in mapeditor i have set chest actionid=2000 and for uniqueid=2494 (demon armor) and for others i have different uniqueid and in game it will give me from the chest another chest in my backpack and cannot use or drop on the ground ;D whats wrong?

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

local questsExperience = {
    [30015] = 10000
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)

    local storage = specialQuests[item:getActionId()]
    if not storage then
        storage = item:getUniqueId()
        if storage > 65535 then
            return false
        end
    end

    if player:getStorageValue(storage) > 0 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "It is empty.")
        return true
    end


    if itemType:isContainer() == true then
        items = container:getItems()
        rewardWeight = items[2]
        local itemType = ItemType(item:getId())
        local container = Container(item.uid)
        local playerCap = player:getFreeCapacity() / 100
        local items = {}
        local rewardWeight = 0
  
        if playerCap < rewardWeight then
            player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found ' .. items[1][1]:getArticle() .. ' ' .. items[1][1]:getName() .. ' weighing ' .. rewardWeight .. ' oz it\'s too heavy.')
            return true
        end

        items = items[1]
        size = table.maxn(items)

        if size == 1 then
            local item = items[1]
            local count = item:getCount()
            local rewardContainer = Container(item.uid)
      

            if rewardContainer ~= nil then
                bag = player:addItem(item:getId(), 1)
                local rewardItems = rewardContainer:getItems()[1]

                for i = 1, #rewardItems do
                    bag:addItem(rewardItems[i]:getId(), rewardItems[i]:getCount())
                end
            else
                player:addItem(item:getId(), count)
            end
  
            player:setStorageValue(storage, 1)
      
            if count > 1 then
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found ' .. count .. ' ' .. item:getPluralName() .. '.')
            else
                player:sendTextMessage(MESSAGE_INFO_DESCR, 'You have found a ' .. item:getName() .. '.')
            end

        end
    end

    return true
end

Action.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<actions>
    <action itemid="2000" script="quests/quests2.lua" />
        <action itemid="2001" script="quests/quests2.lua" />
    <action itemid="11402" script="other/mountbox.lua"/>
    <action actionid="50133" script="other/daramratlever.lua" />
    <action actionid="50134" script="other/daramratlever1.lua" />
                          . . .

Whats wrong?
 
Last edited:
bump,
Reward from chest is another chest, the same chest with itemid 1740
For example:
if i have skeleton body and inside is a reward, when i click on him i get on my backpack skeleton body, if i click on chest i get chest on my backpack.
 
Last edited:
bump,
Reward from chest is another chest, the same chest with itemid 1740
For example:
if i have skeleton body and inside is a reward, when i click on him i get on my backpack skeleton body, if i click on chest i get chest on my backpack.
add the reward item into the container itself in RME. Unique id just acts as a storage id in later versions
 
Back
Top