From 287774ecd0226704a0cc7b72038cbe462636a579 Mon Sep 17 00:00:00 2001 From: Tetardtek Date: Tue, 24 Mar 2026 19:02:43 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20kill=5Fany=20quests=20respect=20zone=20?= =?UTF-8?q?=E2=80=94=20=C3=A9gouts=20ne=20compl=C3=A8te=20plus=20les=20qu?= =?UTF-8?q?=C3=AAtes=20d=C3=A9sert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/combat/combat.service.ts | 4 ++-- src/quest/quest.service.ts | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/combat/combat.service.ts b/src/combat/combat.service.ts index 42f57a9..4b651d4 100644 --- a/src/combat/combat.service.ts +++ b/src/combat/combat.service.ts @@ -244,8 +244,8 @@ export class CombatService { this.eventEmitter.emit('achievement.check', { characterId: cid, type: 'gold_accumulated', increment: 0, absolute: txResult.response.rewards.gold }); this.eventEmitter.emit('community.contribute', { characterId: cid, type: 'total_monsters_killed', increment: 1 }); this.eventEmitter.emit('community.contribute', { characterId: cid, type: 'total_gold_earned', increment: txResult.response.rewards.gold }); - this.eventEmitter.emit('quest.progress', { characterId: cid, type: 'kill_any', increment: 1 }); - this.eventEmitter.emit('quest.progress', { characterId: cid, type: 'kill_monster', targetId: monster.id, increment: 1 }); + this.eventEmitter.emit('quest.progress', { characterId: cid, type: 'kill_any', increment: 1, zone: monster.zone }); + this.eventEmitter.emit('quest.progress', { characterId: cid, type: 'kill_monster', targetId: monster.id, increment: 1, zone: monster.zone }); if (txResult.lootedMaterialId) { this.eventEmitter.emit('quest.progress', { characterId: cid, type: 'gather_material', targetId: txResult.lootedMaterialId, increment: 1 }); } diff --git a/src/quest/quest.service.ts b/src/quest/quest.service.ts index 513571e..18bc7c1 100644 --- a/src/quest/quest.service.ts +++ b/src/quest/quest.service.ts @@ -256,13 +256,14 @@ export class QuestService { type: string; targetId?: string; increment: number; + zone?: string; }) { - const { characterId, type, targetId, increment } = event; + const { characterId, type, targetId, increment, zone } = event; // Find active quests matching this event const activeQuests = await this.playerQuestRepo.find({ where: { characterId, status: 'active' }, - relations: ['quest'], + relations: ['quest', 'quest.arc'], }); for (const pq of activeQuests) { @@ -272,6 +273,9 @@ export class QuestService { // For targeted objectives, check target matches if (q.objectiveTargetId && q.objectiveTargetId !== targetId) continue; + // Zone check: if quest belongs to an arc with a zone, only count kills from that zone + if (q.arc?.zone && zone && q.arc.zone !== zone) continue; + pq.progress = Math.min(pq.progress + increment, q.objectiveCount); if (pq.progress >= q.objectiveCount) {