fix: kill_any quests respect zone — égouts ne complète plus les quêtes désert
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 33s

This commit is contained in:
2026-03-24 19:02:43 +01:00
parent bf896a797f
commit 287774ecd0
2 changed files with 8 additions and 4 deletions

View File

@@ -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 });
}

View File

@@ -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) {