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)