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

@ -2047,13 +2047,13 @@ DROP TABLE IF EXISTS `aowow_quests`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `aowow_quests` (
`id` mediumint(8) unsigned NOT NULL DEFAULT 0,
`method` tinyint(3) unsigned NOT NULL DEFAULT 2,
`questType` tinyint(3) unsigned NOT NULL DEFAULT 2,
`level` smallint(6) NOT NULL DEFAULT 1,
`minLevel` tinyint(3) unsigned NOT NULL DEFAULT 0,
`maxLevel` tinyint(3) unsigned NOT NULL DEFAULT 0,
`zoneOrSort` smallint(6) NOT NULL DEFAULT 0,
`zoneOrSortBak` smallint(6) NOT NULL DEFAULT 0,
`type` smallint(5) unsigned NOT NULL DEFAULT 0,
`questSortId` smallint(6) NOT NULL DEFAULT 0,
`questSortIdBak` smallint(6) NOT NULL DEFAULT 0,
`questInfoId` smallint(5) unsigned NOT NULL DEFAULT 0,
`suggestedPlayers` tinyint(3) unsigned NOT NULL DEFAULT 0,
`timeLimit` int(10) unsigned NOT NULL DEFAULT 0,
`eventId` smallint(5) unsigned NOT NULL DEFAULT 0,

View file

@ -71,7 +71,7 @@ UNLOCK TABLES;
LOCK TABLES `aowow_dbversion` WRITE;
/*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */;
INSERT INTO `aowow_dbversion` VALUES (1767026730,0,NULL,NULL);
INSERT INTO `aowow_dbversion` VALUES (1767117347,0,NULL,NULL);
/*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */;
UNLOCK TABLES;

View file

@ -0,0 +1,6 @@
ALTER TABLE aowow_quests
CHANGE COLUMN `method` `questType` tinyint(3) unsigned NOT NULL DEFAULT 2,
CHANGE COLUMN `zoneOrSort` `questSortId` smallint(6) NOT NULL DEFAULT 0,
CHANGE COLUMN `zoneOrSortBak` `questSortIdBak` smallint(6) NOT NULL DEFAULT 0,
CHANGE COLUMN `type` `questInfoId` smallint(5) unsigned NOT NULL DEFAULT 0
;

View file

@ -67,7 +67,7 @@ CLISetup::registerSetup("build", new class extends SetupScript
if ($cat2 < 0)
continue;
$cond = array_merge($condition, [['zoneOrSort', $cat]]);
$cond = array_merge($condition, [['questSortId', $cat]]);
$questz = new QuestList($cond);
if ($questz->error)
continue;

View file

@ -29,8 +29,8 @@ CLISetup::registerSetup("sql", new class extends SetupScript
MinLevel,
IFNULL(qa.MaxLevel, 0),
QuestSortID,
QuestSortID AS zoneOrSortBak, -- ZoneOrSortBak
QuestInfoID, -- QuestType
QuestSortID AS questSortIdBak,
QuestInfoID,
SuggestedGroupNum,
TimeAllowed,
IFNULL(gesqr.eventEntry, 0) AS eventId,
@ -193,7 +193,7 @@ CLISetup::registerSetup("sql", new class extends SetupScript
// fix questSorts for instance quests
foreach (Game::$questSortFix as $child => $parent)
DB::Aowow()->query('UPDATE ?_quests SET `zoneOrSort` = ?d WHERE `zoneOrSortBak` = ?d', $parent, $child);
DB::Aowow()->query('UPDATE ?_quests SET `questSortId` = ?d WHERE `questSortIdBak` = ?d', $parent, $child);
// move quests linked to holidays into appropirate quests-sorts. create dummy sorts as needed
@ -207,14 +207,14 @@ CLISetup::registerSetup("sql", new class extends SetupScript
foreach ($holidaySorts as $hId => $sort)
if (!empty($eventSet[$hId]))
DB::Aowow()->query('UPDATE ?_quests SET `zoneOrSort` = ?d WHERE `eventId` = ?d{ AND `id` IN (?a)}', $sort, $eventSet[$hId], $ids ?: DBSIMPLE_SKIP);
DB::Aowow()->query('UPDATE ?_quests SET `questSortId` = ?d WHERE `eventId` = ?d{ AND `id` IN (?a)}', $sort, $eventSet[$hId], $ids ?: DBSIMPLE_SKIP);
// 'special' special cases
// fishing quests to stranglethorn extravaganza
DB::Aowow()->query('UPDATE ?_quests SET `zoneOrSort` = ?d WHERE `id` IN (?a){ AND `id` IN (?a)}', -101, [8228, 8229], $ids ?: DBSIMPLE_SKIP);
DB::Aowow()->query('UPDATE ?_quests SET `questSortId` = ?d WHERE `id` IN (?a){ AND `id` IN (?a)}', -101, [8228, 8229], $ids ?: DBSIMPLE_SKIP);
// dungeon quests to Misc/Dungeon Finder
DB::Aowow()->query('UPDATE ?_quests SET `zoneOrSort` = ?d WHERE (`specialFlags` & ?d OR `id` IN (?a)){ AND `id` IN (?a)}', -1010, QUEST_FLAG_SPECIAL_DUNGEON_FINDER, [24789, 24791, 24923], $ids ?: DBSIMPLE_SKIP);
DB::Aowow()->query('UPDATE ?_quests SET `questSortId` = ?d WHERE (`specialFlags` & ?d OR `id` IN (?a)){ AND `id` IN (?a)}', -1010, QUEST_FLAG_SPECIAL_DUNGEON_FINDER, [24789, 24791, 24923], $ids ?: DBSIMPLE_SKIP);
// flag internal/unsued quests as unsearchable