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

Lua Problem with "Bigfoot's Burden Quest".

Kownikuzyt

Member
Joined
Feb 11, 2020
Messages
171
Solutions
1
Reaction score
8
I have a problem with "Bigfoot's Burden Quest" - Test # 6.
"Our last test will be to play gnome music on 4 crystals. We get the mission from NPC Gnomelvis"



Lua:
Player: Hi
Gnomelvis: Hello. Is it me you're looking for?
Player: looking
Gnomelvis: I'm the gnomish musical supervisor!
Player: musical
Gnomelvis: Ah well. Everyone has a very personal melody in his soul. Only if you know your soul melody then you know yourself. And only if you know yourself will you be admitted to the Bigfoot company. ...
Gnomelvis: So what you have to do is to find your soul melody. Do you see the huge crystals in this room? Those are harmonic crystals. Use them to deduce your soul melody. Simply use them to create a sound sequence. ...
Gnomelvis: Every soul melody consists of seven sound sequences. You will have to figure out your correct soul melody by trial and error. If you hit a wrong note, you will have to start over.



The problem is that "Gnomelvis" doesn't react to any of the words "looking and musical".

I am using the TFS 1.1 engine.



Kod: /data/npc/scripts/Gnomelvis.lua



Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                npcHandler:onThink()                    end

local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end
    local player = Player(cid)
    if msgcontains(msg, "looking") then
        if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 11 then
            npcHandler:say("I'm the gnomish musical supervisor!", cid)
            npcHandler.topic[cid] = 1
        elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 13 then
            npcHandler:say("I'm the gnomish musical supervisor!", cid)
            npcHandler.topic[cid] = 2
        end
    elseif msgcontains(msg, "musical") then
        if npcHandler.topic[cid] == 1 then
            npcHandler:say({
                "Ah well. Everyone has a very personal melody in his soul. Only if you know your soul melody then you know yourself. And only if you know yourself will you be admitted to the Bigfoot company. ...",
                "So what you have to do is to find your soul melody. Do you see the huge crystals in this room? Those are harmonic crystals. Use them to deduce your soul melody. Simply use them to create a sound sequence. ...",
                "Every soul melody consists of seven sound sequences. You will have to figure out your correct soul melody by trial and error. If you hit a wrong note, you will have to start over."
            }, cid)
            player:setStorageValue(Storage.BigfootBurden.QuestLine, 12)
            player:setStorageValue(Storage.BigfootBurden.MelodyStatus, 1)
            for i = 0, 6 do
                player:setStorageValue(Storage.BigfootBurden.MelodyTone1 + i, math.random(3124, 3127))
            end
        elseif npcHandler.topic[cid] == 2 then
            npcHandler:say({
                "Congratulations on finding your soul melody. And a pretty one as far as I can tell. Now you are a true recruit of the Bigfoot company! Commander Stone might have some tasks for you to do! ...",
                "Look for him in the central chamber. I marked your map where you will find him."
            }, cid)
            player:setStorageValue(Storage.BigfootBurden.QuestLine, 14)
            player:setStorageValue(Storage.BigfootBurden.Rank)
            player:addAchievement('Becoming a Bigfoot')
        end
        npcHandler.topic[cid] = 0
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())



Kod: /data/npc/Gnomelvis.xml



Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Gnomelvis" script="Gnomelvis.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100" />
    <look type="493" head="67" body="76" legs="105" feet="95" addons="0" />
    <parameters>
        <parameter key="message_greet" value="Hello. Is it me you're {looking} for??" />
    </parameters>
</npc>



Kod: /data/actions/scripts/quests/bigfoot burden/music.lua



Lua:
local cToneStorages = {
    Storage.BigfootBurden.MelodyTone1,
    Storage.BigfootBurden.MelodyTone2,
    Storage.BigfootBurden.MelodyTone3,
    Storage.BigfootBurden.MelodyTone4,
    Storage.BigfootBurden.MelodyTone5,
    Storage.BigfootBurden.MelodyTone6,
    Storage.BigfootBurden.MelodyTone7
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 12 then
        local value = player:getStorageValue(Storage.BigfootBurden.MelodyStatus)
        if player:getStorageValue(cToneStorages[value]) == item.uid then
            player:setStorageValue(Storage.BigfootBurden.MelodyStatus, value + 1)
            toPosition:sendMagicEffect(CONST_ME_FIREWORK_BLUE)
            if value + 1 == 8 then
                player:setStorageValue(Storage.BigfootBurden.QuestLine, 13)
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found your melody!")
            end
        else
            player:setStorageValue(Storage.BigfootBurden.MelodyStatus, 1)
            toPosition:sendMagicEffect(CONST_ME_SOUND_RED)
        end
    end
    return true
end

I saw that there was this thread once, but no one answered.
 
Maybe try this:

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)


function onCreatureAppear(cid)
npcHandler:onCreatureAppear(cid)
end

function onCreatureDisappear(cid)
npcHandler:onCreatureDisappear(cid)
end

function onCreatureSay(cid, type, msg)
npcHandler:onCreatureSay(cid, type, msg)
end

function onThink()
npcHandler:onThink()
end


local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end


    local player = Player(cid)

    if msgcontains(msg, "looking") then
        if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 11 or player:getStorageValue(Storage.BigfootBurden.QuestLine) <= 13 then
            npcHandler:say("I'm the gnomish {musical} supervisor!", cid)

        end


    elseif msgcontains(msg, "musical") then
        if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 12 then
            npcHandler:say({

                "Ah well. Everyone has a very personal melody in his soul. Only if you know your soul melody then you know yourself. And only if you know yourself will you be admitted to the Bigfoot company. ...",

                "So what you have to do is to find your soul melody. Do you see the huge crystals in this room? Those are harmonic crystals. Use them to deduce your soul melody. Simply use them to create a sound sequence. ...",

                "Every soul melody consists of seven sound sequences. You will have to figure out your correct soul melody by trial and error. If you hit a wrong note, you will have to start over."

            }, cid)

            player:setStorageValue(Storage.BigfootBurden.QuestLine, 12)

            player:setStorageValue(Storage.BigfootBurden.MelodyStatus, 1)

            if player:getStorageValue(Storage.BigfootBurden.MelodyTone1) < 1 then

                for i = 0, 6 do

                    player:setStorageValue(Storage.BigfootBurden.MelodyTone1 + i, math.random(3124, 3127))

                end

            end

        elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 13 then

            npcHandler:say("What you have to do is to find your soul melody. Use the harmonic crystals to deduce your soul melody. Every soul melody consists of seven sound sequences. ...", cid)

            npcHandler:say("You will have to figure out your correct soul melody by trial and error.", cid)

        elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 14 then

            npcHandler:say({

                "Congratulations on finding your soul melody. And a pretty one as far as I can tell. Now you are a true recruit of the Bigfoot company! Commander Stone might have some tasks for you to do! ...",

                "Look for him in the central chamber. I marked your map where you will find him."

            }, cid)

            player:setStorageValue(Storage.BigfootBurden.QuestLine, 14)

            player:setStorageValue(Storage.BigfootBurden.QuestLineComplete, 2)

            player:setStorageValue(Storage.BigfootBurden.Rank)

            player:addAchievement('Becoming a Bigfoot')


        elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 15 then

            npcHandler:say("Congratulations on finding your soul melody.", cid)

        end

    end


    return true

end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Lua:
local cToneStorages = {
    Storage.BigfootBurden.MelodyTone1,
    Storage.BigfootBurden.MelodyTone2,
    Storage.BigfootBurden.MelodyTone3,
    Storage.BigfootBurden.MelodyTone4,
    Storage.BigfootBurden.MelodyTone5,
    Storage.BigfootBurden.MelodyTone6,
    Storage.BigfootBurden.MelodyTone7
}

local bigfootMusic = Action()
function bigfootMusic.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 12 then
        print('a')
        local value = player:getStorageValue(Storage.BigfootBurden.MelodyStatus)
        if player:getStorageValue(cToneStorages[value]) == item.uid then
            player:setStorageValue(Storage.BigfootBurden.MelodyStatus, value + 1)
            if value + 1 == 8 then
                toPosition:sendMagicEffect(CONST_ME_HEARTS)
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "That was the correct note! Now you know your soul melody!")
                player:setStorageValue(Storage.BigfootBurden.QuestLine, 13)
            else
                toPosition:sendMagicEffect(CONST_ME_SOUND_GREEN)
                player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
            end
        else
            player:setStorageValue(Storage.BigfootBurden.MelodyStatus, 1)
            toPosition:sendMagicEffect(CONST_ME_SOUND_RED)
        end
    end
    return true
end

bigfootMusic:uid(3124,3125,3126,3127)
bigfootMusic:register()

Just double check it matches with your quest log, and obviously this is untested.
 
Maybe try this:

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)


function onCreatureAppear(cid)
npcHandler:onCreatureAppear(cid)
end

function onCreatureDisappear(cid)
npcHandler:onCreatureDisappear(cid)
end

function onCreatureSay(cid, type, msg)
npcHandler:onCreatureSay(cid, type, msg)
end

function onThink()
npcHandler:onThink()
end


local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end


    local player = Player(cid)

    if msgcontains(msg, "looking") then
        if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 11 or player:getStorageValue(Storage.BigfootBurden.QuestLine) <= 13 then
            npcHandler:say("I'm the gnomish {musical} supervisor!", cid)

        end


    elseif msgcontains(msg, "musical") then
        if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 12 then
            npcHandler:say({

                "Ah well. Everyone has a very personal melody in his soul. Only if you know your soul melody then you know yourself. And only if you know yourself will you be admitted to the Bigfoot company. ...",

                "So what you have to do is to find your soul melody. Do you see the huge crystals in this room? Those are harmonic crystals. Use them to deduce your soul melody. Simply use them to create a sound sequence. ...",

                "Every soul melody consists of seven sound sequences. You will have to figure out your correct soul melody by trial and error. If you hit a wrong note, you will have to start over."

            }, cid)

            player:setStorageValue(Storage.BigfootBurden.QuestLine, 12)

            player:setStorageValue(Storage.BigfootBurden.MelodyStatus, 1)

            if player:getStorageValue(Storage.BigfootBurden.MelodyTone1) < 1 then

                for i = 0, 6 do

                    player:setStorageValue(Storage.BigfootBurden.MelodyTone1 + i, math.random(3124, 3127))

                end

            end

        elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 13 then

            npcHandler:say("What you have to do is to find your soul melody. Use the harmonic crystals to deduce your soul melody. Every soul melody consists of seven sound sequences. ...", cid)

            npcHandler:say("You will have to figure out your correct soul melody by trial and error.", cid)

        elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 14 then

            npcHandler:say({

                "Congratulations on finding your soul melody. And a pretty one as far as I can tell. Now you are a true recruit of the Bigfoot company! Commander Stone might have some tasks for you to do! ...",

                "Look for him in the central chamber. I marked your map where you will find him."

            }, cid)

            player:setStorageValue(Storage.BigfootBurden.QuestLine, 14)

            player:setStorageValue(Storage.BigfootBurden.QuestLineComplete, 2)

            player:setStorageValue(Storage.BigfootBurden.Rank)

            player:addAchievement('Becoming a Bigfoot')


        elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 15 then

            npcHandler:say("Congratulations on finding your soul melody.", cid)

        end

    end


    return true

end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Lua:
local cToneStorages = {
    Storage.BigfootBurden.MelodyTone1,
    Storage.BigfootBurden.MelodyTone2,
    Storage.BigfootBurden.MelodyTone3,
    Storage.BigfootBurden.MelodyTone4,
    Storage.BigfootBurden.MelodyTone5,
    Storage.BigfootBurden.MelodyTone6,
    Storage.BigfootBurden.MelodyTone7
}

local bigfootMusic = Action()
function bigfootMusic.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 12 then
        print('a')
        local value = player:getStorageValue(Storage.BigfootBurden.MelodyStatus)
        if player:getStorageValue(cToneStorages[value]) == item.uid then
            player:setStorageValue(Storage.BigfootBurden.MelodyStatus, value + 1)
            if value + 1 == 8 then
                toPosition:sendMagicEffect(CONST_ME_HEARTS)
                player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "That was the correct note! Now you know your soul melody!")
                player:setStorageValue(Storage.BigfootBurden.QuestLine, 13)
            else
                toPosition:sendMagicEffect(CONST_ME_SOUND_GREEN)
                player:getPosition():sendMagicEffect(CONST_ME_FIREWORK_YELLOW)
            end
        else
            player:setStorageValue(Storage.BigfootBurden.MelodyStatus, 1)
            toPosition:sendMagicEffect(CONST_ME_SOUND_RED)
        end
    end
    return true
end

bigfootMusic:uid(3124,3125,3126,3127)
bigfootMusic:register()

Just double check it matches with your quest log, and obviously this is untested.
Lua:
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 11 or player:getStorageValue(Storage.BigfootBurden.QuestLine) <= 13 then

This is wrong.
Code:
>= 11 or <= 13
this means the player can have any storage value, and get past this check.

----

As far as I can tell, the script OP posted is perfectly fine.
Only problem they have is not getting the required storage to start mission #6.

The issue is somewhere earlier in the quest, where they should be getting the storage value required for mission 6, but aren't, for whatever reason.

We need to see mission #5 code.
 
Lua:
if player:getStorageValue(Storage.BigfootBurden.QuestLine) >= 11 or player:getStorageValue(Storage.BigfootBurden.QuestLine) <= 13 then

This is wrong.
Code:
>= 11 or <= 13
this means the player can have any storage value, and get past this check.

----

As far as I can tell, the script OP posted is perfectly fine.
Only problem they have is not getting the required storage to start mission #6.

The issue is somewhere earlier in the quest, where they should be getting the storage value required for mission 6, but aren't, for whatever reason.

We need to see mission #5 code.

@Xikini you asked for an earlier mission, here she is:

"Bigfoot's Burden Quest" - Test # 5.

Another test is the "endurance" test. We take the test from NPC Gnomewart.
Player: Hi
Gnomewart: Oh! Hi there! I guess you are here for the endurance test!
Player: endurance
Gnomewart: Ah, the test is a piece of mushroomcake! Just take the teleporter over there in the south and follow the hallway. ...
Gnomewart: You'll need to run quite a bit. It is important that you don't give up! Just keep running and running and running and ... I guess you got the idea. ...
Gnomewart: At the end of the hallway you'll find a teleporter. Step on it and you are done! I'm sure you'll do a true gnomerun! Afterwards talk to me.

After completing the task, report to NPC Gnomewart.

Player: Hi
Gnomewart: Oh! Hi there! I guess you are here for the endurance test!
Player: endurance
Gnomewart: You have passed the test and are ready to create your soul melody. Talk to Gnomelvis in the east about it.



Kod: /data/npc/scripts/Gnomewart.lua



Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                npcHandler:onThink()                    end

local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end

    local player = Player(cid)
    if msgcontains(msg, "endurance") then
        if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 9 then
            npcHandler:say({
                "Ah, the test is a piece of mushroomcake! Just take the teleporter over there in the south and follow the hallway. ...",
                "You'll need to run quite a bit. It is important that you don't give up! Just keep running and running and running and ... I guess you got the idea. ...",
                "At the end of the hallway you'll find a teleporter. Step on it and you are done! I'm sure you'll do a true gnomerun! Afterwards talk to me."
            }, cid)
            player:setStorageValue(Storage.BigfootBurden.QuestLine, 10)
        elseif player:getStorageValue(Storage.BigfootBurden.QuestLine) == 11 then
            npcHandler:say("You have passed the test and are ready to create your soul melody. Talk to Gnomelvis in the east about it.", cid)
            player:setStorageValue(Storage.BigfootBurden.QuestLine, 12)
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())



Kod: /data/npc/Gnomewart.xml



Lua:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Gnomewart" script="Gnomewart.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100" />
    <look type="493" head="41" body="100" legs="100" feet="95" addons="0" />
    <parameters>
        <parameter key="message_greet" value="Oh! Hi there! I guess you are here for the {endurance} test!" />
    </parameters>
</npc>



Kod: /data/movements/scripts/quests/bigfoot burden/endurance.lua



Lua:
local condition = Condition(CONDITION_PARALYZE)
condition:setParameter(CONDITION_PARAM_TICKS, 2000)
condition:setFormula(-0.9, 0, -0.9, 0)

function onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return true
    end

    if item.actionid == 7816 then
        local chance = math.random(5)
        if chance == 1 then
            player:teleportTo(fromPosition)
        elseif chance == 2 then
            position.y = position.y + 1
            player:teleportTo(position, true)
            player:setDirection(DIRECTION_SOUTH)
        elseif chance == 3 then
            player:addCondition(condition)
        end

    elseif item.actionid == 7817 then
        player:setStorageValue(Storage.BigfootBurden.QuestLine, 11)
        player:teleportTo(Position(32760, 31811, 10))
        player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'You passed endurance test.')

    elseif item.actionid == 7818 then
        if player:getStorageValue(Storage.BigfootBurden.QuestLine) == 10 then
            player:teleportTo(Position(32759, 31811, 11))
            player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
        else
            player:teleportTo(fromPosition)
        end
    end
    return true
end
 
Last edited:
If anyone still needs this, I was looking at the same issue and found the problem in data\npc\scripts\Gnomewart.lua (the npc of the endurance test before). It advances the BigfootBurden.QuestLine to 12 after you talk to him (not sure why). Either comment out, or remove the code and Gnomelvis will work correctly.

Gnomewart.lua

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)            end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)            end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)        end
function onThink()                npcHandler:onThink()                    end

local function creatureSayCallback(cid, type, msg)
    if not npcHandler:isFocused(cid) then
        return false
    end

    local player = Player(cid)
    if msgcontains(msg, "endurance") then
        if player:getStorageValue(PlayerStorageKeys.BigfootBurden.QuestLine) == 9 then
            npcHandler:say({
                "Ah, the test is a piece of mushroomcake! Just take the teleporter over there in the south and follow the hallway. ...",
                "You'll need to run quite a bit. It is important that you don't give up! Just keep running and running and running and ... I guess you got the idea. ...",
                "At the end of the hallway you'll find a teleporter. Step on it and you are done! I'm sure you'll do a true gnomerun! Afterwards talk to me."
            }, cid)
            player:setStorageValue(PlayerStorageKeys.BigfootBurden.QuestLine, 10)
        elseif player:getStorageValue(PlayerStorageKeys.BigfootBurden.QuestLine) == 11 then
            npcHandler:say("You have passed the test and are ready to create your soul melody. Talk to Gnomelvis in the east about it.", cid)
            --player:setStorageValue(PlayerStorageKeys.BigfootBurden.QuestLine, 12)
        end
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

If you need to correct storage keys for multiple players who attempted this quest already, just run this query on your sql database (MySQL) with the players logged out.
SQL:
UPDATE `player_storage`
SET `value` = 11
WHERE `key` = 900 AND `value` = 12
 
Back
Top