Correct mistake in sending repeatable data to client on quest accept

This commit is contained in:
Dev 2023-10-19 20:43:42 +01:00
parent d97beda4b7
commit 79dc3cca1b
3 changed files with 521 additions and 519 deletions

View File

@ -18,8 +18,7 @@
}, },
"conditions": { "conditions": {
"AvailableForStart": [], "AvailableForStart": [],
"AvailableForFinish": [ "AvailableForFinish": [{
{
"_props": { "_props": {
"id": "618c1de4d4cd91439f3de4ae", "id": "618c1de4d4cd91439f3de4ae",
"parentId": "", "parentId": "",
@ -32,8 +31,7 @@
"doNotResetIfCounterCompleted": false, "doNotResetIfCounterCompleted": false,
"counter": { "counter": {
"id": "618c1de4d4cd91439f3de4ac", "id": "618c1de4d4cd91439f3de4ac",
"conditions": [ "conditions": [{
{
"_props": { "_props": {
"target": "Savage", "target": "Savage",
"value": 1, "value": 1,
@ -62,8 +60,7 @@
"startedMessageText": "{templateId} startedMessageText {traderId} 0", "startedMessageText": "{templateId} startedMessageText {traderId} 0",
"changeQuestMessageText": "{templateId} changeQuestMessageText {traderId} 0", "changeQuestMessageText": "{templateId} changeQuestMessageText {traderId} 0",
"templateId": "{templateId}", "templateId": "{templateId}",
"changeCost": [ "changeCost": [{
{
"templateId": "5449016a4bdc2d6f028b456f", "templateId": "5449016a4bdc2d6f028b456f",
"count": 5000 "count": 5000
} }
@ -99,8 +96,7 @@
"startedMessageText": "{templateId} startedMessageText {traderId} 0", "startedMessageText": "{templateId} startedMessageText {traderId} 0",
"changeQuestMessageText": "{templateId} changeQuestMessageText {traderId} 0", "changeQuestMessageText": "{templateId} changeQuestMessageText {traderId} 0",
"templateId": "{templateId}", "templateId": "{templateId}",
"changeCost": [ "changeCost": [{
{
"templateId": "5449016a4bdc2d6f028b456f", "templateId": "5449016a4bdc2d6f028b456f",
"count": 5000 "count": 5000
} }
@ -125,8 +121,7 @@
}, },
"conditions": { "conditions": {
"AvailableForStart": [], "AvailableForStart": [],
"AvailableForFinish": [ "AvailableForFinish": [{
{
"_props": { "_props": {
"id": "618c1de4d4cd91439f3de4a5", "id": "618c1de4d4cd91439f3de4a5",
"parentId": "", "parentId": "",
@ -139,8 +134,7 @@
"doNotResetIfCounterCompleted": false, "doNotResetIfCounterCompleted": false,
"counter": { "counter": {
"id": "618c1de4d4cd91439f3de4a4", "id": "618c1de4d4cd91439f3de4a4",
"conditions": [ "conditions": [{
{
"_props": { "_props": {
"status": [ "status": [
"Survived" "Survived"
@ -149,8 +143,7 @@
"dynamicLocale": true "dynamicLocale": true
}, },
"_parent": "ExitStatus" "_parent": "ExitStatus"
}, }, {
{
"_props": { "_props": {
"target": [], "target": [],
"id": "618c1de4d4cd91439f3de4a2", "id": "618c1de4d4cd91439f3de4a2",
@ -174,9 +167,11 @@
"failMessageText": "{templateId} failMessageText {traderId} 0", "failMessageText": "{templateId} failMessageText {traderId} 0",
"startedMessageText": "{templateId} startedMessageText {traderId} 0", "startedMessageText": "{templateId} startedMessageText {traderId} 0",
"changeQuestMessageText": "{templateId} changeQuestMessageText {traderId} 0", "changeQuestMessageText": "{templateId} changeQuestMessageText {traderId} 0",
"acceptPlayerMessage": "{templateId} acceptPlayerMessage {traderId}",
"declinePlayerMessage": "{templateId} declinePlayerMessage {traderId}",
"completePlayerMessage": "{templateId} completePlayerMessage {traderId}",
"templateId": "{templateId}", "templateId": "{templateId}",
"changeCost": [ "changeCost": [{
{
"templateId": "5449016a4bdc2d6f028b456f", "templateId": "5449016a4bdc2d6f028b456f",
"count": 5000 "count": 5000
} }
@ -185,7 +180,7 @@
}, },
"Pickup": { "Pickup": {
"_id": "64cfb3818db9f48b3f0b0a759", "_id": "64cfb3818db9f48b3f0b0a759",
"traderId": "579dc571d53a0658a154fbec", "traderId": "{traderId}",
"location": "any", "location": "any",
"image": "/files/quest/icon/62bd61b1b818ff064405b827.jpg", "image": "/files/quest/icon/62bd61b1b818ff064405b827.jpg",
"type": "PickUp", "type": "PickUp",
@ -295,14 +290,15 @@
}, },
"data": { "data": {
"Completion": { "Completion": {
"itemsBlacklist": [ "itemsBlacklist": [{
{"minPlayerLevel": 1, "itemIds": [ "minPlayerLevel": 1,
"itemIds": [
"5485a8684bdc2da71d8b4567", "5485a8684bdc2da71d8b4567",
"543be5e94bdc2df1348b4568" "543be5e94bdc2df1348b4568"
]} ]
}
], ],
"itemsWhitelist": [ "itemsWhitelist": [{
{
"minPlayerLevel": 1, "minPlayerLevel": 1,
"itemIds": [ "itemIds": [
"544fb37f4bdc2dee738b4567", "544fb37f4bdc2dee738b4567",
@ -394,8 +390,7 @@
"5c06782b86f77426df5407d2", "5c06782b86f77426df5407d2",
"590a3efd86f77437d351a25b" "590a3efd86f77437d351a25b"
] ]
}, }, {
{
"minPlayerLevel": 15, "minPlayerLevel": 15,
"itemIds": [ "itemIds": [
"5d40412b86f7743cb332ac3a", "5d40412b86f7743cb332ac3a",
@ -442,8 +437,7 @@
"619cbf476b8a1b37a54eebf8", "619cbf476b8a1b37a54eebf8",
"590c651286f7741e566b6461" "590c651286f7741e566b6461"
] ]
}, }, {
{
"minPlayerLevel": 25, "minPlayerLevel": 25,
"itemIds": [ "itemIds": [
"590c621186f774138d11ea29", "590c621186f774138d11ea29",
@ -480,8 +474,7 @@
"590c645c86f77412b01304d9", "590c645c86f77412b01304d9",
"5e2aedd986f7746d404f3aa4" "5e2aedd986f7746d404f3aa4"
] ]
}, }, {
{
"minPlayerLevel": 40, "minPlayerLevel": 40,
"itemIds": [ "itemIds": [
"59e3647686f774176a362507", "59e3647686f774176a362507",

View File

@ -10,7 +10,7 @@ import { IPmcData } from "@spt-aki/models/eft/common/IPmcData";
import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase"; import { IQuestStatus } from "@spt-aki/models/eft/common/tables/IBotBase";
import { Item } from "@spt-aki/models/eft/common/tables/IItem"; import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { AvailableForConditions, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest"; import { AvailableForConditions, IQuest, Reward } from "@spt-aki/models/eft/common/tables/IQuest";
import { IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt-aki/models/eft/common/tables/IRepeatableQuests";
import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse"; import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEventRouterResponse";
import { IAcceptQuestRequestData } from "@spt-aki/models/eft/quests/IAcceptQuestRequestData"; import { IAcceptQuestRequestData } from "@spt-aki/models/eft/quests/IAcceptQuestRequestData";
import { ICompleteQuestRequestData } from "@spt-aki/models/eft/quests/ICompleteQuestRequestData"; import { ICompleteQuestRequestData } from "@spt-aki/models/eft/quests/ICompleteQuestRequestData";
@ -373,7 +373,6 @@ export class QuestController
} }
const questRewards = this.questHelper.getQuestRewardItems(<IQuest><unknown>repeatableQuestProfile, desiredQuestState); const questRewards = this.questHelper.getQuestRewardItems(<IQuest><unknown>repeatableQuestProfile, desiredQuestState);
this.mailSendService.sendLocalisedNpcMessageToPlayer( this.mailSendService.sendLocalisedNpcMessageToPlayer(
sessionID, sessionID,
this.traderHelper.getTraderById(repeatableQuestProfile.traderId), this.traderHelper.getTraderById(repeatableQuestProfile.traderId),
@ -382,7 +381,15 @@ export class QuestController
questRewards, questRewards,
this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime)); this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime));
acceptQuestResponse.profileChanges[sessionID].quests = this.questHelper.getNewlyAccessibleQuestsWhenStartingQuest(acceptedQuest.qid, sessionID); const repeatableSettings = pmcData.RepeatableQuests.find(x => x.name === repeatableQuestProfile.sptRepatableGroupName);
const responseData: IPmcDataRepeatableQuest = {
activeQuests: [repeatableQuestProfile],
name: repeatableSettings.name,
inactiveQuests: [],
endTime: repeatableSettings.endTime,
changeRequirement: repeatableSettings.changeRequirement
};
acceptQuestResponse.profileChanges[sessionID].repeatableQuests = [responseData];
return acceptQuestResponse; return acceptQuestResponse;
} }
@ -401,6 +408,7 @@ export class QuestController
if (matchingQuest) if (matchingQuest)
{ {
this.logger.debug(`Accepted repeatable quest ${acceptedQuest.qid} from ${repeatableQuest.name}`); this.logger.debug(`Accepted repeatable quest ${acceptedQuest.qid} from ${repeatableQuest.name}`);
matchingQuest.sptRepatableGroupName = repeatableQuest.name;
return matchingQuest; return matchingQuest;
} }

View File

@ -73,6 +73,7 @@ export interface IRepeatableQuest
templateId: string templateId: string
changeCost: IChangeCost[] changeCost: IChangeCost[]
changeStandingCost: number changeStandingCost: number
sptRepatableGroupName?: string;
} }
export interface IRewards export interface IRewards