LandSandBoat / server

:sailboat: LandSandBoat - a server emulator for Final Fantasy XI
https://landsandboat.github.io/server/
GNU General Public License v3.0
299 stars 601 forks source link

San d’Oria Quest "To Cure a Cough" inability to progress #918

Open eyes-and-brain opened 3 years ago

eyes-and-brain commented 3 years ago

Additional Information (Steps to reproduce/Expected behavior) :

San d’Oria Quest "To Cure a Cough" inability to progress. When you read "Diary," "Page 3" will never appear as an option.

https://github.com/LandSandBoat/server/blob/b4f1925717f4eb8c09495fee782a193fb7a7941d/scripts/zones/Southern_San_dOria/npcs/Diary.lua#L15-L66

The if statement in line 28 will never be true.

https://github.com/LandSandBoat/server/blob/b4f1925717f4eb8c09495fee782a193fb7a7941d/scripts/zones/Southern_San_dOria/npcs/Amaura.lua#L23-L70

This quest is ACCEPTED in line 64. However, the condition in the if statement in line 40 conflicts with the condition in line 28 of Diary.lua.

RAIST5150 commented 3 years ago

Just to be sure, is medicine woman active? This is supposed to block progression of To Cure a Cough... specifically, prevents you from reading the diary. Looks like it also depends on A Squire's Test series as well (script references the second quest).

eyes-and-brain commented 3 years ago

Thank you for your comment. The quest "The Medicine Woman" has already been completed.

BTW, this is an existing bug. I saw it happening on other private servers, and asked the administrator to fix it, which he did.

RAIST5150 commented 3 years ago

What about Squire's Test II?

Looks like rhe script is set up for only false/false or true/true... no 50/50 states when it comes to those quests.

Just need to confirm the states of these conditions checked in the script. This way they have all the facts for about the environment in play.

It may technically be functioning properly as written.

Whether that is contextually correct or not is another question.

claywar commented 3 years ago

I think the easiest way to resolve this issue will be to convert those quests to interaction framework. I will work on those after completing Windurst.

eyes-and-brain commented 3 years ago

Thank you for your comment. I have already completed the "Squire's Test II" quest.

Yes, it is. I think the visibility will be much better if you convert it to "interaction framework".

eyes-and-brain commented 3 years ago

The following is a proposed amendment.

・Diary.lua Current implementation

    elseif diaryPage == 2 then
        if medicineWoman == QUEST_COMPLETED and aSquiresTestII == QUEST_COMPLETED then
            if toCureaCough == QUEST_ACCEPTED then
                player:startEvent(641)  -- reads page 3
            else
                player:startEvent(640)  -- reads page 2
            end

After correction

    elseif diaryPage == 2 then
        if medicineWoman == QUEST_COMPLETED and aSquiresTestII == QUEST_COMPLETED then
                player:startEvent(641)  -- reads page 3
        end

The conditional statement "if toCureaCough == QUEST_ACCEPTED then" is a conditional statement that can never be true, so it must not exist.

In fact, there are still bugs in the current implementation. This quest is a hidden quest and is not listed in the quest list until it is completed. Therefore, if this is the original specification, it is wrong to add "TO_CURE_A_COUGH" in addQuest or to use the "QUEST_ACCEPTED" condition of "TO_CURE_A_COUGH" as a conditional statement.

claywar commented 3 years ago

After investigating a bit more, agreed with your above assessment. "To Cure a Cough" is not added during the time that Diary Page 3 must be read. Also, Page 3 should not be accessible if Medicine Woman and Squires Test II are both available, and it appears that consensus on forums is that Medicine Woman must be completed before page 3 becomes available.

claywar commented 3 years ago

Looking at page 3 is required for the quest "To Cure a Cough", a follow-up quest of "The Medicine Woman". If you have > activated "The Medicine Woman", you cannot look at page 3 (and thus page 4) until you have completed it. If you have not activated "The Medicine Woman" you can look at page 3 (and 4) without problem, as long as you have fame 8 or better. I believe this is the reason why some people have problems getting this quest activated with max fame, while others do not.

I believe there are multiple conditions that need to be accounted for, but should be blocking depending on order. There are two separate quest lines that depend on pages, but can be blocked if a separate quest is active.

eyes-and-brain commented 3 years ago

@claywar Thanks for the explanation. I think I understand that there are multiple quests related to the progression of this quest. My concern is a bit simpler than that. It is my suspicion that there is an inconsistency in the script.

・Diary.lua

            if toCureaCough == QUEST_ACCEPTED then
                player:startEvent(641)  -- reads page 3

In my environment, "toCureaCough == QUEST_ACCEPTED" is not TRUE. So I tried to find out where "toCureaCough == QUEST_ACCEPTED" can be TRUE.

・Amaura.lua

    elseif csid == 645 then
        player:addQuest(xi.quest.log_id.SANDORIA, xi.quest.id.sandoria.TO_CURE_A_COUGH)

"toCureaCough == QUEST_ACCEPTED" becomes TRUE in the above process. Now, I tried to find out what are the conditions under which cs 645 is executed.

・Amaura.lua

    elseif player:getCharVar("DiaryPage") == 3 or toCureaCough == QUEST_ACCEPTED then
        if player:hasKeyItem(xi.ki.THYME_MOSS) == false and player:hasKeyItem(xi.ki.COUGH_MEDICINE) == false then
            player:startEvent(645) -- need thyme moss for cough med

・Amaura.lua

"toCureaCough == QUEST_ACCEPTED" can't be TRUE at this point, so the "player:getCharVar("DiaryPage") == 3" condition will be necessary. So, I looked into the conditions under which the "player:getCharVar("DiaryPage") == 3" is set.

・Diary.lua

        elseif csid == 641 and option == 3 then
            player:setCharVar("DiaryPage", 3)    -- has read page 3

"player:setCharVar("DiaryPage", 3)" is set in the above process. In the following example, we will set "csid == 641".

・Diary.lua

            if toCureaCough == QUEST_ACCEPTED then
                player:startEvent(641)  -- reads page 3

The process that triggers "csid == 641" is described above. In other words, it is the first script that does not become TRUE. I believe that this sequence of consistency is inconsistent. Maybe I'm not understanding it well enough.

eyes-and-brain commented 3 years ago

To put it in perspective, I suspect that the current logic is never going to work because of the contradictory condition that in order to read the third page of the diary, you need to have read the third page of the diary beforehand.