• 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 with player StorageValue for quests

sforssen

New Member
Joined
Mar 15, 2021
Messages
1
Reaction score
1
First of all, I am completely new to this and I hope I have posted this in the correct sub forum.

I just started up my own Tibia server but I have run into a few issues regarding quests. From what I can understand the game does not always set the StorageValue for the player correctly meaning I cannot progress further. I know where to find .lua for both the NPC and the storage_set.lua files but I am having some issue understanding how to use them.

In my case I got a character namned Donut trying to progress the Yalahar quest line. What would be my GOD TalkAction to set the correct StorageValue for Donut?



The NPC.lua:
"player:getStorageValue(Storage.InServiceofYalahar.NotesPalimuth) == 1 and player:getStorageValue(Storage.InServiceofYalahar.Questline) == 16"



The storage_set.lua:
local storageSet = TalkAction("/set")

function storageSet.onSay(cid, words, param)
local player = Player(cid)
if not player:getGroup():getAccess() then
return true
end

if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end

local split = param:split(",")
if split[2] == nil then
player:sendCancelMessage("Insufficient parameters.")
return false
end

local target = Player(split[1])
if target == nil then
player:sendCancelMessage("A player with that name is not online.")
return false
end

-- Trim left
split[2] = split[2]:gsub("^%s*(.-)$", "%1")
split[3] = split[3]:gsub("^%s*(.-)$", "%1")
local ch = split[2]
local ch2 = split[3]
setPlayerStorageValue(getPlayerByName(split[1]), tonumber(ch), tonumber(ch2))
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "The storage with id: "..tonumber(ch).." from player "..split[1].." is now: "..ch2..".")
return false
end

storageSet:separator(" ")

storageSet:register()
 
Over in Support would have been a better place. xP
For the future, also make sure to post your code properly, or it won't show correctly.

You'll need to find where storages on your server are located..
Probably at data/lib/core/storages.lua
Storage.InServiceofYalahar.NotesPalimuth and
Storage.InServiceofYalahar.Questline

Then, you'd want to say...
/set Donut, 11111, 1
/set Donut, 22222, 16
But change 11111 and 22222 to whatever storage number is located in your yalahar storages.
 
Back
Top