• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Fixed fetch quests do not expire

Hylie Pistof

Curmudgeon
QA Tester
Storm Modder
Pirate Legend
As the title says the fetch quests do not expire. What this means is that later in a game when there are 3 items locked out as contraband plus another 2-3 items locked out due to fetch quests there isn't much to choose from when trying to trade with a merchant.

It doesn't help to do the fetch quests because as soon as one is done another one starts. This forces one to only haul cargo for merchants instead of trading for meself.
 
I thought they did expire at some point?
With only one at a time per town?
 
Ah the fetch quests which exists do expire but once they are accepted the "cargo" can be removed but the quest itself wont expire and therefore it will keep blocked.
I can't change this now but in the different dialog files for the fetch quest at this point:
Code:
        case "agree fetch":
            d.Text = DLG_TEXT[8];
            Link.l1 = DLG_TEXT[9];
            Link.l1.go = "exit";
            if(!CheckAttribute(PChar,"fetchquestactive")) PChar.fetchquestactive = 0;
            //Questbook
            Preprocessor_AddQuestData("town",ctown.name);
            Preprocessor_AddQuestData("type","apothecary");
            Preprocessor_AddQuestData("amount",sti(NPChar.fetch_quest.amount));
            Preprocessor_AddQuestData("good",Goods[sti(NPChar.fetch_quest.good)].name);
            Preprocessor_AddQuestData("money",sti(NPChar.fetch_quest.money));
            Preprocessor_AddQuestData("date",NPChar.fetch_quest.expire);
            questbookname = "fetch&number="+NPChar.fetch_quest.cargoid+NPChar.index; //Set a questname
            SetQuestHeader(questbookname);
            AddQuestRecord(questbookname, 1);
            Preprocessor_Remove("town");
            Preprocessor_Remove("type");
            Preprocessor_Remove("amount");
            Preprocessor_Remove("good");
            Preprocessor_Remove("money");
            Preprocessor_Remove("date");
            PChar.fetchquestactive = sti(PChar.fetchquestactive) +1;
            NPChar.fetch_quest_active = TRUE;
        break;

a line should be added to call for a quest case which sets a timer something like this:
Code:
pchar.quest.generate_trade_quest.win_condition.l1 = "Timer";
            pchar.quest.generate_trade_quest.win_condition.l1.date.day = GetAddingDataDay(0, 1, 0);
            pchar.quest.generate_trade_quest.win_condition.l1.date.month = GetAddingDataMonth(0, 1, 0);
            pchar.quest.generate_trade_quest.win_condition.l1.date.year = GetAddingDataYear(0, 1, 0);
            pchar.quest.generate_trade_quest.win_condition = "generate_trade_quest";
but with the right questname etc the questname you probably want to be the "Questbookname" so you have to set this to the pchar to make sure the data is transfered to the quest, afterward you can remove it again. Same goest for the expire date. You could also sent the NPChar index to the quest and then get the data from the NPChar.
When the timer is up the quest should be stopped and everything should be set back again.
I remember this used to be in the game when I first made it. I don't know why it doesn't now ...
 
This should fix the problem.
I believe none of my other fixes edit these files. But probably some of the smuggling stuff isn't included in it yet so please winmerge it.
 

Attachments

  • Fix Fetch.zip
    53.1 KB · Views: 191
There was rather more than the fetch quest fix in "Fix Fetch.zip", but I've copied the relevant parts into my version of "quests_common.c" which also includes updated smuggling stuff, and also copied the updated dialog files. Thanks!
 
There was rather more than the fetch quest fix in "Fix Fetch.zip", but I've copied the relevant parts into my version of "quests_common.c" which also includes updated smuggling stuff, and also copied the updated dialog files. Thanks!
Just checking. You did add the part in the quest checks right? That's needed for it to work properly.
 
Back
Top