feat: zone field sur Quest — filtre zone direct, plus besoin de passer par l'arc
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 32s

This commit is contained in:
2026-03-24 19:05:27 +01:00
parent 287774ecd0
commit d77666c4cf
2 changed files with 7 additions and 3 deletions

View File

@@ -51,6 +51,10 @@ export class Quest {
@Column({ name: 'arc_order', default: 0 }) @Column({ name: 'arc_order', default: 0 })
arcOrder: number; // order within the arc arcOrder: number; // order within the arc
// Zone filter — kills from this zone only count for this quest
@Column({ name: 'zone', type: 'varchar', length: 50, nullable: true })
zone: string | null;
// Availability // Availability
@Column({ name: 'min_level', default: 1 }) @Column({ name: 'min_level', default: 1 })
minLevel: number; minLevel: number;

View File

@@ -263,7 +263,7 @@ export class QuestService {
// Find active quests matching this event // Find active quests matching this event
const activeQuests = await this.playerQuestRepo.find({ const activeQuests = await this.playerQuestRepo.find({
where: { characterId, status: 'active' }, where: { characterId, status: 'active' },
relations: ['quest', 'quest.arc'], relations: ['quest'],
}); });
for (const pq of activeQuests) { for (const pq of activeQuests) {
@@ -273,8 +273,8 @@ export class QuestService {
// For targeted objectives, check target matches // For targeted objectives, check target matches
if (q.objectiveTargetId && q.objectiveTargetId !== targetId) continue; if (q.objectiveTargetId && q.objectiveTargetId !== targetId) continue;
// Zone check: if quest belongs to an arc with a zone, only count kills from that zone // Zone check: if quest has a zone, only count actions from that zone
if (q.arc?.zone && zone && q.arc.zone !== zone) continue; if (q.zone && zone && q.zone !== zone) continue;
pq.progress = Math.min(pq.progress + increment, q.objectiveCount); pq.progress = Math.min(pq.progress + increment, q.objectiveCount);