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

Simple quest TFS 1.3 10.98

nowitsky

Member
Joined
Jun 26, 2016
Messages
88
Solutions
2
Reaction score
13
Hello.

Maybe somebody can show me how to do a simple quest for TFS 1.3 (Tibia 10.98)?

Can u make some examples how to do some quest if u want to get more than one rewards, or maybe experience, or outfit/addon (leave for everybody some functions).

Please :)
 
This one is a quest with multiple rewards inside a bag
You'll have to change
Lua:
player:getStorageValue(2600) == 2
to
Lua:
player:getStorageValue(2600) == 1
So it checks if player done this quest before and not doing it more than one time.
These 2 are mount quests examples
and this one for addons
XML:
<action uniqueid="45002" script="addon_from_chest.lua"/>
<action actionid="45002" script="addon_from_chest.lua"/>
Lua:
local addon_id = 128 -- data/XML/outfits.xml

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
   player:addOutfitAddon(addon_id)
   return true
end
This one for experience
Lua:
local exp = 1050779800
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getActionId(2700) and player:getStorageValue(2700) == 1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already received your reward.")
    elseif player:getStorageValue(2600) <= 1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Your message here like You have received  experience or whatever!")
               player:addExperience(exp)
        end
        player:setStorageValue(2700, 1)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Something went wrong.")
       end
end
 
This one is a quest with multiple rewards inside a bag
You'll have to change
Lua:
player:getStorageValue(2600) == 2
to
Lua:
player:getStorageValue(2600) == 1
So it checks if player done this quest before and not doing it more than one time.
These 2 are mount quests examples
and this one for addons
XML:
<action uniqueid="45002" script="addon_from_chest.lua"/>
<action actionid="45002" script="addon_from_chest.lua"/>
Lua:
local addon_id = 128 -- data/XML/outfits.xml

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
   player:addOutfitAddon(addon_id)
   return true
end
This one for experience
Lua:
local exp = 1050779800
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getActionId(2700) and player:getStorageValue(2700) == 1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already received your reward.")
    elseif player:getStorageValue(2600) <= 1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Your message here like You have received  experience or whatever!")
               player:addExperience(exp)
        end
        player:setStorageValue(2700, 1)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Something went wrong.")
       end
end

[TFS 1.X] Quest Container Reward with Multiple Items

actions.xml
Code:
    <action itemid="15000" script="quests/containerreward.lua" />

make containerreward.lua in actions/scripts/quests
Code:
local cfgItems = {{8849, 1}, {7378, 1}, {2516, 1}, {2160, 1}}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item:getActionId(2600) and player:getStorageValue(2600) == 1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have already chosen your reward.")
    elseif player:getStorageValue(2600) <= 1 then
        player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a modified cross bow, a royal spear, a dragon shield and 1 crystal coin!")
       
        local bag = player:addItem(1991) -- Bag id
        for i = 1, #cfgItems do
            bag:addItem(cfgItems[i][1], cfgItems[i][2])
        end
        player:setStorageValue(2600, 1)
    else
        player:sendTextMessage(MESSAGE_INFO_DESCR, "Something went wrong.")
       end
end

containerreward.png

chestreward.png

Same situation for Mount Quest.
I have just empty chest in game.
What am I doing wrong?
 
Back
Top