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

Problem with quests and player:setStorageValue(Storage.Questname.MissionXX)

mxm

New Member
Joined
Apr 14, 2023
Messages
4
Reaction score
0
TLDR: Is there a way to change (in some file) or set playername:storageValue(Storage.Questname.MissionXX) using god account (or there would be a need for a new script)?

I'm using Windows 10, Canary capable of running 13.x client and 13.16 client (as one of the states will be concerning my brother he's using Windows too, but uses canary with 12.96 client)

Changing a lua script of NPC to have state 0 instead of 1 to trigger progression by talking to said NPC does not interest me.

As I was trying to check what works and what might be buggy, I have came across a few things that seems to be broken.
I accepted that Blood Brothers are not implemented to the fullest (It's my assumption due to lack of certain bosses and Julius' map not responding to any position; I'll probably try to pay sm to write a script for missions 4-till finale and post it here once I have it)
I tried doing "The secrets of Helheim"(part of the Ice islands quest) but the floor where the quest should trigger doesn't do anything (idk if I skipped some line and need to talk with sm in the city before going on a trip with my favourite barbarian sailor - or the trigger doesn't exist/work)
Now that I managed to end The New frontier questline I was super stoked to start "the children of the revolution" questline (as I never had a chance to) but once I have reached the second mission it got buggy, as I have seen all three trigger texts but only one room was acknowledged as finnished and I did them by the order in lua file... Fishery->barracs->armory, all three gave me a red text but questlog stays at 1 building was spied on...
My brother somehow managed to get through mission 2 in children of the revolution and got stuck at mission 4 where his character doesn't "see" strange symbols and the red text triggering further mission does not appear and without it a lot of content would be blocked
 
usage
/setstorage Xikini, storage, value
/setstorage Xikini, 45001, 4
XML:
<talkaction words="/setstorage" script="setstorage.lua" />
Lua:
function onSay(player, words, param)
    if not player:getGroup():getAccess() then
        return true
    end

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

    local params = string.split(param, ",")

    local targetPlayer = Player(params[1])
    if not targetPlayer then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
        return true
    end

    if not params[2] or not tonumber(params[2]) then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified. Second parameter must be a number.")
        return true
    end
    params[2] = tonumber(params[2])

    if not params[3] then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Get [" .. params[1] .. " - " .. params[2] .. "] = " .. targetPlayer:getStorageValue(params[2]))
    else
        if tonumber(params[3]) then
            params[3] = tonumber(params[3])
            targetPlayer:setStorageValue(params[2], params[3])
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Set [" .. params[1] .. " - " .. params[2] .. "] = " .. targetPlayer:getStorageValue(params[2]))
        else
            player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified. Third parameter must be a number.")
        end
    end

    return true
end
 
Awesome!!! Thank You, You're the boss, I was making a mistake of trying:
/set Warbringer Jaina:Storage.ChildrenoftheRevolution.SpyBuilding03, 1
I'll try changing it to
/set Warbringer Jaina, "proper number", 1
where proper number is 8009-8011
Lua:
[8009] = {
        storage = Storage.ChildrenoftheRevolution.SpyBuilding01,
    text = "An impressive ammount of fish is stored here."},
    [8010] = {
        storage = Storage.ChildrenoftheRevolution.SpyBuilding02,
    text = "A seemingly endless array of weapon stretches before you into the darkness."},
    [8011] = {
        storage = Storage.ChildrenoftheRevolution.SpyBuilding03,
    text = "These barracks seem to be home for quite a lot of soldiers."}

Once again Thank You!!!
Post automatically merged:

If anyone is interested 4th mission of Children of the Revolution has wrong coordinates in symbol.lua
YOUR DIRECTORY PATH\canary-main\data-otservbr-global\scripts\movements\quests\children_of_the_revolution\symbol.lua"
I personally changed 33349, 31123, 5 coordinate to 33350, 31123, 5 and now it triggers properly once character "stepin" on the ground next to the top lever
As I need to write my weekly report for my job I will try to create pull request on Github tomorrow (unless I won't figure out how - but that would be quite shameful not to as I am supposed to become a researcher in 1-2 years - I mean lua files are nothing like protein biochemistry/biophysical evaluation nor crystallization but it's better described...)
Post automatically merged:

Well I did figure out how to make the trigger work but the leavers do not seem to work, neither can I grease them using Greasy oil (id:10189) nor do they "transform" from id 9125 to 9126 (obviously I cannot check if I can "revert" the lever) on use
Screenshot 2023-05-06 190613 problem.png
below the lua files of Children of the Revolution​
Lua:
local childrenGrease = Action()
function childrenGrease.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if target.actionid ~= 8013 then
        return false
    end

    if player:getStorageValue(Storage.ChildrenoftheRevolution.Questline) == 13 then
        player:setStorageValue(Storage.ChildrenoftheRevolution.Questline, 14)
        player:setStorageValue(Storage.ChildrenoftheRevolution.Mission04, 4) --Questlog, Children of the Revolution "Mission 4: Zze Way of Zztonezz"
        item:remove()
        player:say("Due to being extra greasy, the leavers can now be moved.", TALKTYPE_MONSTER_SAY)
    end
    return true
end

childrenGrease:id(10189)
childrenGrease:register()

Lua:
local puzzlePositions = {
    [1] = Position(33352, 31126, 5),
    [2] = Position(33353, 31126, 5),
    [3] = Position(33354, 31126, 5),
    [4] = Position(33355, 31126, 5)
}
local function puzzle(position, itemId, itemTransform)
    if Tile(position):getItemById(itemId) then
        Tile(position):getItemById(itemId):transform(itemTransform)
    else
        Tile(position):getItemById(itemTransform):transform(itemId)
    end
end
local function revertLever(fromPosition)
    if Tile(fromPosition):getItemById(9126) then
        Tile(fromPosition):getItemById(9126):transform(9125)
    end
end
local childrenGrease = Action()
function childrenGrease.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(Storage.ChildrenoftheRevolution.Questline) == 14 then
        if fromPosition == Position(33349, 31123, 5) or fromPosition == Position(33349, 31124, 5) then
            puzzle(puzzlePositions[1], 9935, 9933)
            puzzle(puzzlePositions[2], 9936, 9937)
            puzzle(puzzlePositions[4], 9929, 9938)
        end
        if fromPosition == Position(33349, 31125, 5) then
            puzzle(puzzlePositions[3], 9939, 9934)
            puzzle(puzzlePositions[4], 9929, 9938)
        end
        if fromPosition == Position(33349, 31126, 5) then
            puzzle(puzzlePositions[2], 9936, 9937)
            puzzle(puzzlePositions[3], 9939, 9934)
        end
        if fromPosition == Position(33349, 31127, 5) then
            puzzle(puzzlePositions[1], 9935, 9933)
            puzzle(puzzlePositions[3], 9939, 9934)
        end
        if Tile(puzzlePositions[1]):getItemById(9933) and Tile(puzzlePositions[2]):getItemById(9936) and Tile(puzzlePositions[3]):getItemById(9939) and Tile(puzzlePositions[4]):getItemById(9938) then
            player:say("After a cracking noise a deep humming suddenly starts from somewhere below.", TALKTYPE_MONSTER_SAY)
            player:setStorageValue(Storage.ChildrenoftheRevolution.Questline, 17)
            player:setStorageValue(Storage.ChildrenoftheRevolution.Mission04, 5)
        end
        item:transform(item.itemid == 9125 and 9126 or 9125)
        if Tile(fromPosition):getItemById(9126) then
            addEvent(revertLever, 5000, fromPosition)
        end
        return true
    end
    return true
end
local positions = {
    {x = 33349, y = 31123, z = 5},
    {x = 33349, y = 31124, z = 5},
    {x = 33349, y = 31125, z = 5},
    {x = 33349, y = 31126, z = 5},
    {x = 33349, y = 31127, z = 5}
}

for index, value in pairs(positions) do
    childrenGrease:position(value)
end
childrenGrease:register()
 
Last edited:
Back
Top