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
All checks were successful
CI/CD — Build & Deploy / Build & Deploy (push) Successful in 32s
This commit is contained in:
@@ -51,6 +51,10 @@ export class Quest {
|
||||
@Column({ name: 'arc_order', default: 0 })
|
||||
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
|
||||
@Column({ name: 'min_level', default: 1 })
|
||||
minLevel: number;
|
||||
|
||||
@@ -263,7 +263,7 @@ export class QuestService {
|
||||
// Find active quests matching this event
|
||||
const activeQuests = await this.playerQuestRepo.find({
|
||||
where: { characterId, status: 'active' },
|
||||
relations: ['quest', 'quest.arc'],
|
||||
relations: ['quest'],
|
||||
});
|
||||
|
||||
for (const pq of activeQuests) {
|
||||
@@ -273,8 +273,8 @@ 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;
|
||||
// Zone check: if quest has a zone, only count actions from that zone
|
||||
if (q.zone && zone && q.zone !== zone) continue;
|
||||
|
||||
pq.progress = Math.min(pq.progress + increment, q.objectiveCount);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user