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

HELP QUEST TFS 1.4

VagosClubTM

Active Member
Joined
Aug 16, 2019
Messages
219
Reaction score
32
Location
Chile
hi friends, i would like to know if you have any normal quest script for tibia tfs 1.4 (760-7.72)
other than that of ani, I want a normal one to make my prize chests.

TFS 1.4
 
Nice website ;)

Lua:
-- Made by GM Klaffen on AcidsOT
--[[
    itemUid = unique id of quest chest
    rewardItemId = itemid of reward
]]
function rewardChest(player, itemUid, rewardItemId) 
    local itemType = ItemType(rewardItemId)
    local itemWeight = itemType:getWeight()
    local playerCap = player:getFreeCapacity()

    local article = itemType:getArticle()
    article = (article ~= nil and #article > 0) and article .. " " or ""
    local itemName = article .. itemType:getName()
    
    if player:getStorageValue(itemUid) == -1 then
            if playerCap >= itemWeight then
            local item = Game.createItem(itemType:getId(), 1)

            player:addItemEx(item, false)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. itemName .. ".")
            player:setStorageValue(itemUid, 1)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. itemName .. " weighing " .. itemWeight / 100 .. " oz. it\'s too heavy.")
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
    end
end

--[[
    containerId = container for items to go into
    items = array of items. [{ itemId: 1234, count: 1 }]
]]
function multipleRewardsChest(player, itemUid, containerId, items)
    local containerType = ItemType(containerId)
    local requiredCap = containerType:getWeight()

    for _, item in ipairs(items) do
        requiredCap = requiredCap + ItemType(item.itemId):getWeight()
    end

    local playerCap = player:getFreeCapacity()

    if player:getStorageValue(itemUid) == -1 then
        if playerCap >= requiredCap then
            local container = Game.createItem(containerId, 1)

            for _, item in ipairs(items) do
                container:addItem(item.itemId, item.count)
            end

            player:addItemEx(container, false)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. containerType:getArticle() .. " " .. containerType:getName() .. ".")
            player:setStorageValue(itemUid, 1)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. containerType:getArticle() .. " " .. containerType:getName() .. " weighing " .. requiredCap / 100 .. " oz. it\'s too heavy.")
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
    end
end
 
Nice website ;)

Lua:
-- Made by GM Klaffen on AcidsOT
--[[
    itemUid = unique id of quest chest
    rewardItemId = itemid of reward
]]
function rewardChest(player, itemUid, rewardItemId)
    local itemType = ItemType(rewardItemId)
    local itemWeight = itemType:getWeight()
    local playerCap = player:getFreeCapacity()

    local article = itemType:getArticle()
    article = (article ~= nil and #article > 0) and article .. " " or ""
    local itemName = article .. itemType:getName()
   
    if player:getStorageValue(itemUid) == -1 then
            if playerCap >= itemWeight then
            local item = Game.createItem(itemType:getId(), 1)

            player:addItemEx(item, false)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. itemName .. ".")
            player:setStorageValue(itemUid, 1)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. itemName .. " weighing " .. itemWeight / 100 .. " oz. it\'s too heavy.")
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
    end
end

--[[
    containerId = container for items to go into
    items = array of items. [{ itemId: 1234, count: 1 }]
]]
function multipleRewardsChest(player, itemUid, containerId, items)
    local containerType = ItemType(containerId)
    local requiredCap = containerType:getWeight()

    for _, item in ipairs(items) do
        requiredCap = requiredCap + ItemType(item.itemId):getWeight()
    end

    local playerCap = player:getFreeCapacity()

    if player:getStorageValue(itemUid) == -1 then
        if playerCap >= requiredCap then
            local container = Game.createItem(containerId, 1)

            for _, item in ipairs(items) do
                container:addItem(item.itemId, item.count)
            end

            player:addItemEx(container, false)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. containerType:getArticle() .. " " .. containerType:getName() .. ".")
            player:setStorageValue(itemUid, 1)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. containerType:getArticle() .. " " .. containerType:getName() .. " weighing " .. requiredCap / 100 .. " oz. it\'s too heavy.")
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
    end
end
@Znote Thanks I'll try the code, hahaha if the best znote bro the best of the best thanks for supporting the community so much.
 
Nice website ;)

Lua:
-- Made by GM Klaffen on AcidsOT
--[[
    itemUid = unique id of quest chest
    rewardItemId = itemid of reward
]]
function rewardChest(player, itemUid, rewardItemId)
    local itemType = ItemType(rewardItemId)
    local itemWeight = itemType:getWeight()
    local playerCap = player:getFreeCapacity()

    local article = itemType:getArticle()
    article = (article ~= nil and #article > 0) and article .. " " or ""
    local itemName = article .. itemType:getName()
   
    if player:getStorageValue(itemUid) == -1 then
            if playerCap >= itemWeight then
            local item = Game.createItem(itemType:getId(), 1)

            player:addItemEx(item, false)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. itemName .. ".")
            player:setStorageValue(itemUid, 1)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. itemName .. " weighing " .. itemWeight / 100 .. " oz. it\'s too heavy.")
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
    end
end

--[[
    containerId = container for items to go into
    items = array of items. [{ itemId: 1234, count: 1 }]
]]
function multipleRewardsChest(player, itemUid, containerId, items)
    local containerType = ItemType(containerId)
    local requiredCap = containerType:getWeight()

    for _, item in ipairs(items) do
        requiredCap = requiredCap + ItemType(item.itemId):getWeight()
    end

    local playerCap = player:getFreeCapacity()

    if player:getStorageValue(itemUid) == -1 then
        if playerCap >= requiredCap then
            local container = Game.createItem(containerId, 1)

            for _, item in ipairs(items) do
                container:addItem(item.itemId, item.count)
            end

            player:addItemEx(container, false)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. containerType:getArticle() .. " " .. containerType:getName() .. ".")
            player:setStorageValue(itemUid, 1)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. containerType:getArticle() .. " " .. containerType:getName() .. " weighing " .. requiredCap / 100 .. " oz. it\'s too heavy.")
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
    end
end
@Znote excuse my ignorance but how does it work? where I put the items that I want to add to a chest, I come from the 760xml version where everything is in a script, more than anything I would miss that, thank you.
@Xikini
 
@Znote excuse my ignorance but how does it work? where I put the items that I want to add to a chest, I come from the 760xml version where everything is in a script, more than anything I would miss that, thank you.
@Xikini
Here is a sample quest from AcidsOT (TFS 1.4), I'm also a bit oldstyle and script quests (instead of using default quest system and RME).

Lua:
local uids = {
    chest1=13370,
    chest2=13371
}

local action = Action()
for _, uid in pairs(uids) do
    action:uid(uid)
end

function action.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.uid == uids.chest1 then
        rewardChest(player, item.uid, 2497) -- crusader helmet
        return true
    end

    if item.uid == uids.chest2 then
        rewardChest(player, item.uid, 2435) -- dwarven axe
        return true
    end

    return false
end
action:register(-1)

This is a revscript Lua file, you place it in data/scripts/ folder, and it will automatically boot up and load at startup, without using any XML at all.

You can read about Lua revscript here:
 
Last edited:
Here is a sample quest from AcidsOT (TFS 1.4), I'm also a bit oldstyle and script quests (instead of using default quest system and RME).

Lua:
local uids = {
    chest1=13370,
    chest2=13371
}

local action = Action()
for _, uid in pairs(uids) do
    action:uid(uid)
end

function action.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.uid == uids.chest1 then
        rewardChest(player, item.uid, 2497) -- crusader helmet
        return true
    end

    if item.uid == uids.chest2 then
        rewardChest(player, item.uid, 2435) -- dwarven axe
        return true
    end

    return false
end
action:register(-1)

This is a revscript Lua file, you place it in data/scripts/ folder, and it will automatically boot up and load at startup, without using any XML at all.

You can read about Lua revscript here:
It throws me the following error bro, it must be perhaps that those values are not in the source?

Lua Script Error: [Scripts Interface]
C:\Users\Administrator\Desktop\VagosClub\data\scripts\actions\others\quest1.lua:
callback
...Desktop\VagosClub\data\scripts\actions\others\quest1.lua:13: attempt to call
global 'rewardChest' (a nil value)
stack traceback:
[C]: in function 'rewardChest'
...Desktop\VagosClub\data\scripts\actions\others\quest1.lua:13: in funct
ion <...Desktop\VagosClub\data\scripts\actions\others\quest1.lua:11>
 
It throws me the following error bro, it must be perhaps that those values are not in the source?
You didnt add the rewardChest function I posted first on this thread? In data/scripts/lib/, create rewardchest.lua and add this code:

Nice website ;)

Lua:
-- Made by GM Klaffen on AcidsOT
--[[
    itemUid = unique id of quest chest
    rewardItemId = itemid of reward
]]
function rewardChest(player, itemUid, rewardItemId)
    local itemType = ItemType(rewardItemId)
    local itemWeight = itemType:getWeight()
    local playerCap = player:getFreeCapacity()

    local article = itemType:getArticle()
    article = (article ~= nil and #article > 0) and article .. " " or ""
    local itemName = article .. itemType:getName()
   
    if player:getStorageValue(itemUid) == -1 then
            if playerCap >= itemWeight then
            local item = Game.createItem(itemType:getId(), 1)

            player:addItemEx(item, false)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. itemName .. ".")
            player:setStorageValue(itemUid, 1)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. itemName .. " weighing " .. itemWeight / 100 .. " oz. it\'s too heavy.")
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
    end
end

--[[
    containerId = container for items to go into
    items = array of items. [{ itemId: 1234, count: 1 }]
]]
function multipleRewardsChest(player, itemUid, containerId, items)
    local containerType = ItemType(containerId)
    local requiredCap = containerType:getWeight()

    for _, item in ipairs(items) do
        requiredCap = requiredCap + ItemType(item.itemId):getWeight()
    end

    local playerCap = player:getFreeCapacity()

    if player:getStorageValue(itemUid) == -1 then
        if playerCap >= requiredCap then
            local container = Game.createItem(containerId, 1)

            for _, item in ipairs(items) do
                container:addItem(item.itemId, item.count)
            end

            player:addItemEx(container, false)
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. containerType:getArticle() .. " " .. containerType:getName() .. ".")
            player:setStorageValue(itemUid, 1)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found " .. containerType:getArticle() .. " " .. containerType:getName() .. " weighing " .. requiredCap / 100 .. " oz. it\'s too heavy.")
        end
    else
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is empty.")
    end
end
 
You didnt add the rewardChest function I posted first on this thread? In data/scripts/lib/, create rewardchest.lua and add this code:
Thank you very much and sorry for my ignorance, now if it works, I have another question for example if I want the user to obtain 10 crystal coins, how do I make the script more than 1 single item?
 
Thank you very much and sorry for my ignorance, now if it works, I have another question for example if I want the user to obtain 10 crystal coins, how do I make the script more than 1 single item?
Looks like that functionality is missing from rewardChest but is available with multipleRewardsChest
Lua:
multipleRewardsChest(player, item.uid, 1987, {{itemId = 2160, count = 10}}) -- 1987 = brown bag
 
Looks like that functionality is missing from rewardChest but is available with multipleRewardsChest
Lua:
multipleRewardsChest(player, item.uid, 1987, {{itemId = 2160, count = 10}}) -- 1987 = brown bag
Hello bro, it worked perfect, thanks, the other thing I wanted to ask you is that I have a problem, what happens is that when the user levels up around 3 or 4 levels, the experience bar bugea and does not go up until Do you rewind this to what could be caused?

@Xikini @Znote
 
Looks like that functionality is missing from rewardChest but is available with multipleRewardsChest
Lua:
multipleRewardsChest(player, item.uid, 1987, {{itemId = 2160, count = 10}}) -- 1987 = brown bag
hello brother merry christmas. I wanted to know if you have any configurable rune mana there?
 
hello brother merry christmas. I wanted to know if you have any configurable rune mana there?
There's probably 1000 unique posts on the forum asking for a manarune script lol

Here's 3 random one's I pulled from the first page using the forum's search function.

 
There's probably 1000 unique posts on the forum asking for a manarune script lol

Here's 3 random one's I pulled from the first page using the forum's search function.

do these work for tfs 1.4? and in advance thank you very much bro
 
Hi bro, it works perfect, I just don't want the mana rune to be infinite if they cannot be spent. Is it possible to remove the bodies of the monster from having an owner? when I die, I want to keep the ancient essence where the body of the dead creature does not belong to anyone. I modify this in the true sources?

@Xikini
 
I just don't want the mana rune to be infinite if they cannot be spent.
Add charges to the rune.

Is it possible to remove the bodies of the monster from having an owner? when I die, I want to keep the ancient essence where the body of the dead creature does not belong to anyone. I modify this in the true sources?
 
Add charges to the rune.


thanks bro you are the best it worked perfect, I also have a problem I am trying to add new items to my server. but at the time of creating them these come out in another order and sometimes the image does not show. this must be where is tfs 1.4? With what program do I edit the items if it is version 772 and sorry for so much trouble, friend
 
thanks bro you are the best it worked perfect, I also have a problem I am trying to add new items to my server. but at the time of creating them these come out in another order and sometimes the image does not show. this must be where is tfs 1.4? With what program do I edit the items if it is version 772 and sorry for so much trouble, friend
Someone else would have to answer this. I've never edited or added items to a server before.
 
Someone else would have to answer this. I've never edited or added items to a server before.
ok bro I have another little problem, look I have this script that is from my old server 760 xml I would like to know if there is something similar for this version tfs 1.4 772

Lua:
  function onUse(cid, item, frompos, item2, topos)
setConditionParam(condition, CONDITION_PARAM_TICKS, 20000)
addOutfitCondition(condition, 0, 230, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 231, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 232, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 233, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 234, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 235, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 236, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 237, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 238, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 239, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 240, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 241, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 242, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 243, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 244, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 245, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 246, 0, 0, 0, 0)
addOutfitCondition(condition, 0, 247, 0, 0, 0, 0)
setCombatCondition(combat, condition)
                                          doSendMagicEffect(topos,12)
doPlayerSay(cid,"Good..",1)

      return 1
  end
 
Back
Top