Quests/Fixup

* rename columns of quests table to avoid name collisions
   and to match the dbc they are referencing
 * fixes #463
This commit is contained in:
Sarjuuk 2025-12-30 19:15:06 +01:00
parent c44bf4f575
commit eec21c2763
11 changed files with 35 additions and 29 deletions

View file

@ -33,7 +33,7 @@ class QuestList extends DBTypeList
// post processing
foreach ($this->iterate() as $id => &$_curTpl)
{
$_curTpl['cat1'] = $_curTpl['zoneOrSort']; // should probably be in a method...
$_curTpl['cat1'] = $_curTpl['questSortId']; // should probably be in a method...
$_curTpl['cat2'] = 0;
foreach (Game::QUEST_CLASSES as $k => $arr)
@ -138,7 +138,7 @@ class QuestList extends DBTypeList
// by TC definition
public function isSeasonal() : bool
{
return in_array($this->getField('zoneOrSortBak'), [-22, -284, -366, -369, -370, -376, -374]) && !$this->isRepeatable();
return in_array($this->getField('questSortIdBak'), [-22, -284, -366, -369, -370, -376, -374]) && !$this->isRepeatable();
}
public function getSourceData(int $id = 0) : array
@ -225,7 +225,7 @@ class QuestList extends DBTypeList
if ($_ = $this->curTpl['rewardTitleId'])
$data[$this->id]['titlereward'] = $_;
if ($_ = $this->curTpl['type'])
if ($_ = $this->curTpl['questInfoId'])
$data[$this->id]['type'] = $_;
if ($_ = $this->curTpl['reqClassMask'])
@ -548,9 +548,9 @@ class QuestListFilter extends Filter
};
}
// type [list]
// questInfoId [list]
if ($_v['ty'] !== null)
$parts[] = ['type', $_v['ty']];
$parts[] = ['questInfoId', $_v['ty']];
return $parts;
}
@ -650,9 +650,9 @@ class QuestListFilter extends Filter
return null;
if ($crs)
return ['AND', ['zoneOrSort', 0, '>'], [['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE, '&'], 0], [['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE | QUEST_FLAG_SPECIAL_MONTHLY, '&'], 0]];
return ['AND', ['questSortId', 0, '>'], [['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE, '&'], 0], [['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE | QUEST_FLAG_SPECIAL_MONTHLY, '&'], 0]];
else
return ['OR', ['zoneOrSort', 0, '<'], ['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE, '&'], ['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE | QUEST_FLAG_SPECIAL_MONTHLY, '&']];
return ['OR', ['questSortId', 0, '<'], ['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE, '&'], ['specialFlags', QUEST_FLAG_SPECIAL_REPEATABLE | QUEST_FLAG_SPECIAL_MONTHLY, '&']];
}
protected function cbSpellRewards(int $cr, int $crs, string $crv) : ?array

View file

@ -46,7 +46,7 @@ class Game
10 => [ 65, 66, 67, 210, 394, 495, 2817, 3537, 3711, 4024, 4197, 4395, 4742]
);
// zoneorsort for quests need updating
// questSortId for quests need updating
// partially points non-instanced area with identical name for instance quests
public static array $questSortFix = array(
-221 => 440, // Treasure Map => Tanaris