From 289d5062bd0a078f71f0292e8d46543f68d4f239 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sun, 28 Dec 2025 19:59:53 +0100 Subject: [PATCH] NPC/Objective * must test for KillCredit as there are cases where reqNpcOrGo is 0, but its required count is > 0 * amends d34765eed55884ce89e85705ef7a5357fba38ae5 * fixes #475 --- endpoints/npc/npc.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/endpoints/npc/npc.php b/endpoints/npc/npc.php index 27251fda..3133eb27 100644 --- a/endpoints/npc/npc.php +++ b/endpoints/npc/npc.php @@ -718,11 +718,15 @@ class NpcBaseResponse extends TemplateResponse implements ICache // tab: objective of quest $conditions = array( 'OR', - ['AND', ['reqNpcOrGo1', [$this->typeId, $this->subject->getField('KillCredit1'), $this->subject->getField('KillCredit2')]], ['reqNpcOrGoCount1', 0, '>']], - ['AND', ['reqNpcOrGo2', [$this->typeId, $this->subject->getField('KillCredit1'), $this->subject->getField('KillCredit2')]], ['reqNpcOrGoCount2', 0, '>']], - ['AND', ['reqNpcOrGo3', [$this->typeId, $this->subject->getField('KillCredit1'), $this->subject->getField('KillCredit2')]], ['reqNpcOrGoCount3', 0, '>']], - ['AND', ['reqNpcOrGo4', [$this->typeId, $this->subject->getField('KillCredit1'), $this->subject->getField('KillCredit2')]], ['reqNpcOrGoCount4', 0, '>']] + ['AND', ['reqNpcOrGo1', [$this->typeId]], ['reqNpcOrGoCount1', 0, '>']], + ['AND', ['reqNpcOrGo2', [$this->typeId]], ['reqNpcOrGoCount2', 0, '>']], + ['AND', ['reqNpcOrGo3', [$this->typeId]], ['reqNpcOrGoCount3', 0, '>']], + ['AND', ['reqNpcOrGo4', [$this->typeId]], ['reqNpcOrGoCount4', 0, '>']] ); + foreach ([1, 2] as $i) + if (($_ = $this->subject->getField('KillCredit'.$i)) > 0) + for ($j = 1; $j < 5; $j++) + $conditions[$j][1][1][] = $_; $objectiveOf = new QuestList($conditions); if (!$objectiveOf->error)