Structure/Types

* move distributed constant values to object
 * move reused iterators and checks to object
This commit is contained in:
Sarjuuk 2022-03-21 15:20:31 +01:00
parent e109a6deed
commit 33a870ef78
126 changed files with 970 additions and 885 deletions

View file

@ -67,7 +67,7 @@ if (!CLI)
// get locations
// again: caching will save you time and nerves
if (!isset($locations[$pet['id']]))
$locations[$pet['id']] = DB::Aowow()->SelectCol('SELECT DISTINCT areaId FROM ?_spawns WHERE type = ?d AND typeId = ?d', TYPE_NPC, $pet['id']);
$locations[$pet['id']] = DB::Aowow()->SelectCol('SELECT DISTINCT areaId FROM ?_spawns WHERE type = ?d AND typeId = ?d', Type::NPC, $pet['id']);
$petsOut[$pet['id']] = array(
'id' => $pet['id'],

View file

@ -52,19 +52,19 @@ if (!CLI)
switch ($questz->getField('reqSkillId'))
{
case 356:
$exAdd(TYPE_QUEST, $id, PR_EXCLUDE_GROUP_REQ_FISHING);
$exAdd(Type::QUEST, $id, PR_EXCLUDE_GROUP_REQ_FISHING);
break;
case 202:
$exAdd(TYPE_QUEST, $id, PR_EXCLUDE_GROUP_REQ_ENGINEERING);
$exAdd(Type::QUEST, $id, PR_EXCLUDE_GROUP_REQ_ENGINEERING);
break;
case 197:
$exAdd(TYPE_QUEST, $id, PR_EXCLUDE_GROUP_REQ_TAILORING);
$exAdd(Type::QUEST, $id, PR_EXCLUDE_GROUP_REQ_TAILORING);
break;
}
}
$_ = [];
$currencies = array_column($questz->rewards, TYPE_CURRENCY);
$currencies = array_column($questz->rewards, Type::CURRENCY);
foreach ($currencies as $curr)
foreach ($curr as $cId => $qty)
$_[] = $cId;
@ -110,7 +110,7 @@ if (!CLI)
// get titles for exclusion
foreach ($titlez->iterate() as $id => $__)
if (empty($titlez->sources[$id][4]) && empty($titlez->sources[$id][12]))
$exAdd(TYPE_TITLE, $id, PR_EXCLUDE_GROUP_UNAVAILABLE);
$exAdd(Type::TITLE, $id, PR_EXCLUDE_GROUP_UNAVAILABLE);
foreach (CLISetup::$localeIds as $l)
{
@ -159,9 +159,9 @@ if (!CLI)
foreach ($conditionSet as $mount => $skill)
{
if ($skill == 202)
$exAdd(TYPE_SPELL, $mount, PR_EXCLUDE_GROUP_REQ_ENGINEERING);
$exAdd(Type::SPELL, $mount, PR_EXCLUDE_GROUP_REQ_ENGINEERING);
else if ($skill == 197)
$exAdd(TYPE_SPELL, $mount, PR_EXCLUDE_GROUP_REQ_TAILORING);
$exAdd(Type::SPELL, $mount, PR_EXCLUDE_GROUP_REQ_TAILORING);
}
foreach (CLISetup::$localeIds as $l)

View file

@ -123,7 +123,7 @@ SqlGen::register(new class extends SetupScript
if ($criteria = DB::World()->selectCol('SELECT entry FROM disables WHERE sourceType = 4'))
DB::Aowow()->query('UPDATE aowow_achievement a JOIN aowow_achievementcriteria ac ON a.id = ac.refAchievementId SET a.cuFlags = ?d WHERE ac.id IN (?a)', CUSTOM_DISABLED, $criteria);
$this->reapplyCCFlags('achievement', TYPE_ACHIEVEMENT);
$this->reapplyCCFlags('achievement', Type::ACHIEVEMENT);
return true;
}

View file

@ -80,7 +80,7 @@ SqlGen::register(new class extends SetupScript
foreach ($addData as $id => $ad)
DB::Aowow()->query('UPDATE ?_areatrigger SET ?a WHERE id = ?d', $ad, $id);
$this->reapplyCCFlags('areatrigger', TYPE_AREATRIGGER);
$this->reapplyCCFlags('areatrigger', Type::AREATRIGGER);
return true;
}

View file

@ -37,7 +37,7 @@ SqlGen::register(new class extends SetupScript
foreach ($classes as $cl)
DB::Aowow()->query('REPLACE INTO ?_classes (?#) VALUES (?a)', array_keys($cl), array_values($cl));
$this->reapplyCCFlags('classes', TYPE_CLASS);
$this->reapplyCCFlags('classes', Type::CHR_CLASS);
return true;
}

View file

@ -182,7 +182,7 @@ SqlGen::register(new class extends SetupScript
// apply cuFlag: exCludeFromListview [for nameparts indicating internal usage]
DB::Aowow()->query('UPDATE ?_creature SET cuFlags = cuFlags | ?d WHERE name_loc0 LIKE "%[%" OR name_loc0 LIKE "%(%" OR name_loc0 LIKE "%visual%" OR name_loc0 LIKE "%trigger%" OR name_loc0 LIKE "%credit%" OR name_loc0 LIKE "%marker%"', CUSTOM_EXCLUDE_FOR_LISTVIEW);
$this->reapplyCCFlags('creature', TYPE_NPC);
$this->reapplyCCFlags('creature', Type::NPC);
return true;
}

View file

@ -75,7 +75,7 @@ SqlGen::register(new class extends SetupScript
c.itemId = ?d
', $iconId, $itemId);
$this->reapplyCCFlags('currencies', TYPE_CURRENCY);
$this->reapplyCCFlags('currencies', Type::CURRENCY);
return true;
}

View file

@ -95,7 +95,7 @@ SqlGen::register(new class extends SetupScript
}
}
$this->reapplyCCFlags('emotes', TYPE_EMOTE);
$this->reapplyCCFlags('emotes', Type::EMOTE);
return $allOK;
}

View file

@ -42,7 +42,7 @@ SqlGen::register(new class extends SetupScript
foreach ($events as $e)
DB::Aowow()->query('REPLACE INTO ?_events VALUES (?a)', array_values($e));
$this->reapplyCCFlags('events', TYPE_WORLDEVENT);
$this->reapplyCCFlags('events', Type::WORLDEVENT);
return true;
}

View file

@ -96,7 +96,7 @@ SqlGen::register(new class extends SetupScript
foreach ($pairs as $p)
DB::Aowow()->query($recursiveUpdateQuery, $p[0], $p[1], $p[0]);
$this->reapplyCCFlags('factions', TYPE_FACTION);
$this->reapplyCCFlags('factions', Type::FACTION);
return true;
}

View file

@ -34,7 +34,7 @@ SqlGen::register(new class extends SetupScript
DB::Aowow()->query($baseQuery);
$this->reapplyCCFlags('icons', TYPE_ICON);
$this->reapplyCCFlags('icons', Type::ICON);
return true;
}

View file

@ -102,7 +102,7 @@ class ItemStatSetup extends ItemList
// collect data and write to DB
foreach ($this->iterate() as $__)
{
$updateFields = ['type' => TYPE_ITEM, 'typeId' => $this->id];
$updateFields = ['type' => Type::ITEM, 'typeId' => $this->id];
foreach (@$this->json[$this->id] as $k => $v)
{
@ -228,7 +228,7 @@ SqlGen::register(new class extends SetupScript
Util::arraySumByKey($result[$eId], [$str => $val]);
}
$updateCols = ['type' => TYPE_ENCHANTMENT, 'typeId' => $eId];
$updateCols = ['type' => Type::ENCHANTMENT, 'typeId' => $eId];
foreach ($result[$eId] as $k => $v)
{
if (!in_array($k, $statCols) || !$v || $k == 'id')

View file

@ -34,7 +34,7 @@ SqlGen::register(new class extends SetupScript
DB::Aowow()->query('UPDATE ?_itemenchantment SET cuFlags = ?d WHERE type1 = 0 AND type2 = 0 AND type3 = 0', CUSTOM_EXCLUDE_FOR_LISTVIEW);
DB::Aowow()->query('UPDATE ?_itemenchantment SET cuFlags = ?d WHERE name_loc0 LIKE "%test%"', CUSTOM_EXCLUDE_FOR_LISTVIEW);
$this->reapplyCCFlags('itemenchantment', TYPE_ENCHANTMENT);
$this->reapplyCCFlags('itemenchantment', Type::ENCHANTMENT);
return true;
}

View file

@ -243,7 +243,7 @@ SqlGen::register(new class extends SetupScript
WHERE
durability > 0 AND ((classBak = 4 AND subClassBak IN (1, 2, 3, 4, 6)) OR (classBak = 2 AND subClassBak <> 9))');
$this->reapplyCCFlags('items', TYPE_ITEM);
$this->reapplyCCFlags('items', Type::ITEM);
return true;
}

View file

@ -318,7 +318,7 @@ SqlGen::register(new class extends SetupScript
}
}
$this->reapplyCCFlags('itemset', TYPE_ITEMSET);
$this->reapplyCCFlags('itemset', Type::ITEMSET);
return true;
}

View file

@ -120,7 +120,7 @@ SqlGen::register(new class extends SetupScript
// apply typeCat and reqSkill depending on locks
DB::Aowow()->query($updateQuery, $ids ?: DBSIMPLE_SKIP);
$this->reapplyCCFlags('objects', TYPE_OBJECT);
$this->reapplyCCFlags('objects', Type::OBJECT);
return true;
}

View file

@ -119,7 +119,7 @@ SqlGen::register(new class extends SetupScript
foreach ($res as $pId => $row)
DB::Aowow()->query('UPDATE ?_pet SET ?a WHERE id = ?d', $row, $pId);
$this->reapplyCCFlags('pet', TYPE_PET);
$this->reapplyCCFlags('pet', Type::PET);
return true;
}

View file

@ -260,7 +260,7 @@ SqlGen::register(new class extends SetupScript
// 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);
$this->reapplyCCFlags('quests', TYPE_QUEST);
$this->reapplyCCFlags('quests', Type::QUEST);
return true;
}

View file

@ -37,7 +37,7 @@ SqlGen::register(new class extends SetupScript
// add cuFlags
DB::Aowow()->query('UPDATE ?_races SET cuFlags = ?d WHERE flags & ?d', CUSTOM_EXCLUDE_FOR_LISTVIEW, 0x1);
$this->reapplyCCFlags('races', TYPE_RACE);
$this->reapplyCCFlags('races', Type::CHR_RACE);
return true;
}

View file

@ -58,7 +58,7 @@ SqlGen::register(new class extends SetupScript
DB::Aowow()->query('UPDATE ?_skillline sl, ?_icons ic SET sl.iconId = ic.id WHERE ic.name = ? AND sl.id = ?d', 'inv_misc_pelt_wolf_01', 393);
DB::Aowow()->query('UPDATE ?_skillline sl, ?_icons ic SET sl.iconId = ic.id WHERE ic.name = ? AND sl.id = ?d', 'inv_misc_key_03', 633);
$this->reapplyCCFlags('skillline', TYPE_SKILL);
$this->reapplyCCFlags('skillline', Type::SKILL);
return true;
}

View file

@ -422,7 +422,7 @@ SqlGen::register(new class extends SetupScript
subClassMask = subClassMask | (1 << isc.subClass)
');
$this->reapplyCCFlags('sounds', TYPE_SOUND);
$this->reapplyCCFlags('sounds', Type::SOUND);
return true;
}

View file

@ -161,9 +161,9 @@ SqlGen::register(new class extends SetupScript
foreach ($spellItems as $iId => $si)
{
if ($_ = $this->taughtSpell($si))
$spellBuff[$_] = [TYPE_SPELL, $_, 1, TYPE_SPELL, $itemSpells[$iId]];
$spellBuff[$_] = [Type::SPELL, $_, 1, Type::SPELL, $itemSpells[$iId]];
$itemBuff[$iId] = [TYPE_ITEM, $iId, 1, TYPE_SPELL, $itemSpells[$iId]];
$itemBuff[$iId] = [Type::ITEM, $iId, 1, Type::SPELL, $itemSpells[$iId]];
}
if ($itemBuff)
@ -205,18 +205,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : TYPE_NPC, $l['entry'] /*, $lootmode */);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : Type::NPC, $l['entry'] /*, $lootmode */);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : TYPE_NPC, $l['entry'] /*, $lootmode */);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : Type::NPC, $l['entry'] /*, $lootmode */);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_NPC, $l['entry'] /*, $lootmode */);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::NPC, $l['entry'] /*, $lootmode */);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : TYPE_NPC, $l['entry'] /*, $lootmode */);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : Type::NPC, $l['entry'] /*, $lootmode */);
}
$objectOT = [];
@ -247,20 +247,20 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : TYPE_OBJECT, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : Type::OBJECT, $l['entry']);
$objectOT[] = $iId;
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : TYPE_OBJECT, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : Type::OBJECT, $l['entry']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_OBJECT, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::OBJECT, $l['entry']);
$objectOT[] = $roi;
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : TYPE_OBJECT, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : Type::OBJECT, $l['entry']);
}
$itemOT = [];
@ -289,20 +289,20 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : TYPE_ITEM, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : Type::ITEM, $l['entry']);
$itemOT[] = $iId;
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : TYPE_ITEM, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : Type::ITEM, $l['entry']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_ITEM, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::ITEM, $l['entry']);
$itemOT[] = $roi;
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : TYPE_ITEM, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : Type::ITEM, $l['entry']);
}
if ($itemBuff)
@ -340,17 +340,17 @@ SqlGen::register(new class extends SetupScript
foreach (DB::World()->select($vendorQuery, $xCostA, $xCostA) as $iId => $v)
{
if ($_ = $this->taughtSpell($v))
$spellBuff[$_] = [TYPE_SPELL, $_, 1];
$spellBuff[$_] = [Type::SPELL, $_, 1];
$itemBuff[$iId] = [TYPE_ITEM, $iId, 1];
$itemBuff[$iId] = [Type::ITEM, $iId, 1];
}
foreach (DB::World()->select($vendorQuery, $xCostH, $xCostH) as $iId => $v)
{
if ($_ = $this->taughtSpell($v))
$spellBuff[$_] = [TYPE_SPELL, $_, 2];
$spellBuff[$_] = [Type::SPELL, $_, 2];
$itemBuff[$iId] = [TYPE_ITEM, $iId, 2];
$itemBuff[$iId] = [Type::ITEM, $iId, 2];
}
if ($itemBuff)
@ -386,9 +386,9 @@ SqlGen::register(new class extends SetupScript
foreach ($quests as $iId => $q)
{
if ($_ = $this->taughtSpell($q))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $q['qty'] > 1 ? 0 : TYPE_QUEST, $q['quest'], $q['side']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $q['qty'] > 1 ? 0 : Type::QUEST, $q['quest'], $q['side']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $q['qty'] > 1 ? 0 : TYPE_QUEST, $q['quest'], $q['side']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $q['qty'] > 1 ? 0 : Type::QUEST, $q['quest'], $q['side']);
}
$mailLoot = DB::World()->select('
@ -419,20 +419,20 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : TYPE_QUEST, $l['entry'], $l['side']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : Type::QUEST, $l['entry'], $l['side']);
$itemOT[] = $iId;
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : TYPE_QUEST, $l['entry'], $l['side']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : Type::QUEST, $l['entry'], $l['side']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_QUEST, $l['entry'], $l['side']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::QUEST, $l['entry'], $l['side']);
$itemOT[] = $roi;
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : TYPE_QUEST, $l['entry'], $l['side']);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : Type::QUEST, $l['entry'], $l['side']);
}
if ($itemBuff)
@ -464,9 +464,9 @@ SqlGen::register(new class extends SetupScript
foreach ($vendors as $iId => $v)
{
if ($_ = $this->taughtSpell($v))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $v['qty'] > 1 ? 0 : TYPE_NPC, $v['npc']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $v['qty'] > 1 ? 0 : Type::NPC, $v['npc']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $v['qty'] > 1 ? 0 : TYPE_NPC, $v['npc']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $v['qty'] > 1 ? 0 : Type::NPC, $v['npc']);
}
if ($itemBuff)
@ -481,11 +481,11 @@ SqlGen::register(new class extends SetupScript
###############
CLI::write(' * #10 Starter');
if ($pcii = DB::World()->select('SELECT ?d, itemid, 1 FROM playercreateinfo_item', TYPE_ITEM))
if ($pcii = DB::World()->select('SELECT ?d, itemid, 1 FROM playercreateinfo_item', Type::ITEM))
DB::Aowow()->query($this->queryfy($pcii, $insBasic), 10, 10, 10);
for ($i = 1; $i < 21; $i++)
DB::Aowow()->query($insSub, 10, DB::Aowow()->subquery('SELECT ?d, item?d, 1, NULL AS m, NULL AS mt FROM dbc_charstartoutfit WHERE item?d > 0', TYPE_ITEM, $i, $i), 10, 10);
DB::Aowow()->query($insSub, 10, DB::Aowow()->subquery('SELECT ?d, item?d, 1, NULL AS m, NULL AS mt FROM dbc_charstartoutfit WHERE item?d > 0', Type::ITEM, $i, $i), 10, 10);
###################
@ -517,9 +517,9 @@ SqlGen::register(new class extends SetupScript
foreach ($extraItems as $iId => $l)
{
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $xItems[$iId]['qty'] > 1 ? 0 : TYPE_ACHIEVEMENT, $xItems[$iId]['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $xItems[$iId]['qty'] > 1 ? 0 : Type::ACHIEVEMENT, $xItems[$iId]['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $xItems[$iId]['qty'] > 1 ? 0 : TYPE_ACHIEVEMENT, $xItems[$iId]['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $xItems[$iId]['qty'] > 1 ? 0 : Type::ACHIEVEMENT, $xItems[$iId]['entry']);
}
foreach ($rewItems as $iId => $l)
@ -529,18 +529,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_ACHIEVEMENT, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::ACHIEVEMENT, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $l['qty'] > 1 ? 0 : TYPE_ACHIEVEMENT, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $l['qty'] > 1 ? 0 : Type::ACHIEVEMENT, $l['entry']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_ACHIEVEMENT, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::ACHIEVEMENT, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $l['qty'] > 1 ? 0 : TYPE_ACHIEVEMENT, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $l['qty'] > 1 ? 0 : Type::ACHIEVEMENT, $l['entry']);
}
if ($itemBuff)
@ -582,18 +582,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_);
$this->pushBuffer($spellBuff, Type::SPELL, $_);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId);
$this->pushBuffer($itemBuff, Type::ITEM, $iId);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_);
$this->pushBuffer($spellBuff, Type::SPELL, $_);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi);
$this->pushBuffer($itemBuff, Type::ITEM, $roi);
}
if ($itemBuff)
@ -633,18 +633,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : TYPE_OBJECT, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : Type::OBJECT, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : TYPE_OBJECT, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : Type::OBJECT, $l['entry']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_OBJECT, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::OBJECT, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : TYPE_OBJECT, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : Type::OBJECT, $l['entry']);
}
if ($itemBuff)
@ -677,8 +677,8 @@ SqlGen::register(new class extends SetupScript
item_template it ON src.itemOrRef > 0 AND src.itemOrRef = it.entry
GROUP BY
ARRAY_KEY',
TYPE_NPC, NPC_TYPEFLAG_HERBLOOT,
TYPE_OBJECT, $herbLocks
Type::NPC, NPC_TYPEFLAG_HERBLOOT,
Type::OBJECT, $herbLocks
);
foreach ($herbLoot as $roi => $l)
@ -688,18 +688,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
}
if ($itemBuff)
@ -739,18 +739,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_);
$this->pushBuffer($spellBuff, Type::SPELL, $_);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId);
$this->pushBuffer($itemBuff, Type::ITEM, $iId);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_);
$this->pushBuffer($spellBuff, Type::SPELL, $_);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi);
$this->pushBuffer($itemBuff, Type::ITEM, $roi);
}
if ($itemBuff)
@ -783,8 +783,8 @@ SqlGen::register(new class extends SetupScript
item_template it ON src.itemOrRef > 0 AND src.itemOrRef = it.entry
GROUP BY
ARRAY_KEY',
TYPE_NPC, NPC_TYPEFLAG_MININGLOOT,
TYPE_OBJECT, $mineLocks
Type::NPC, NPC_TYPEFLAG_MININGLOOT,
Type::OBJECT, $mineLocks
);
foreach ($mineLoot as $roi => $l)
@ -794,18 +794,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : $l['srcType'], $l['entry']);
}
if ($itemBuff)
@ -845,18 +845,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_);
$this->pushBuffer($spellBuff, Type::SPELL, $_);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId);
$this->pushBuffer($itemBuff, Type::ITEM, $iId);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_);
$this->pushBuffer($spellBuff, Type::SPELL, $_);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi);
$this->pushBuffer($itemBuff, Type::ITEM, $roi);
}
if ($itemBuff)
@ -895,18 +895,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
}
if ($itemBuff)
@ -946,18 +946,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
}
if ($itemBuff)
@ -997,18 +997,18 @@ SqlGen::register(new class extends SetupScript
foreach ($refLoot[-$roi] as $iId => $r)
{
if ($_ = $this->taughtSpell($r))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $r['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $r['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $iId, $r['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $iId, $r['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
}
continue;
}
if ($_ = $this->taughtSpell($l))
$this->pushBuffer($spellBuff, TYPE_SPELL, $_, $l['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($spellBuff, Type::SPELL, $_, $l['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
$this->pushBuffer($itemBuff, TYPE_ITEM, $roi, $l['qty'] > 1 ? 0 : TYPE_NPC, $l['entry']);
$this->pushBuffer($itemBuff, Type::ITEM, $roi, $l['qty'] > 1 ? 0 : Type::NPC, $l['entry']);
}
if ($itemBuff)
@ -1020,7 +1020,7 @@ SqlGen::register(new class extends SetupScript
// flagging aowow_items for source (note: this is not exact! creatures dropping items may not be spawnd, quests granting items may be disabled)
DB::Aowow()->query('UPDATE ?_items SET cuFlags = cuFlags & ?d', ~CUSTOM_UNAVAILABLE);
DB::Aowow()->query('UPDATE ?_items i LEFT JOIN ?_source s ON s.typeId = i.id AND s.type = ?d SET i.cuFlags = i.cuFlags | ?d WHERE s.typeId IS NULL', TYPE_ITEM, CUSTOM_UNAVAILABLE);
DB::Aowow()->query('UPDATE ?_items i LEFT JOIN ?_source s ON s.typeId = i.id AND s.type = ?d SET i.cuFlags = i.cuFlags | ?d WHERE s.typeId IS NULL', Type::ITEM, CUSTOM_UNAVAILABLE);
/*********/
/* Spell */
@ -1045,7 +1045,7 @@ SqlGen::register(new class extends SetupScript
foreach ($qSpells as $sId => $spell)
for ($i = 1; $i <= 3; $i++)
if ($spell['effect'.$i.'Id'] == 36) // effect: learnSpell
$this->pushBuffer($buff, TYPE_SPELL, $spell['effect'.$i.'TriggerSpell'], $quests[$sId]['qty'] > 1 ? 0 : TYPE_QUEST, $quests[$sId]['qty'] > 1 ? 0 : $quests[$sId]['id'], $quests[$sId]['side']);
$this->pushBuffer($buff, Type::SPELL, $spell['effect'.$i.'TriggerSpell'], $quests[$sId]['qty'] > 1 ? 0 : Type::QUEST, $quests[$sId]['qty'] > 1 ? 0 : $quests[$sId]['id'], $quests[$sId]['side']);
DB::Aowow()->query($this->queryfy($buff, $insMore), 4, 4, 4);
}
@ -1068,9 +1068,9 @@ SqlGen::register(new class extends SetupScript
for ($i = 1; $i <= 3; $i++)
if ($effects['effect'.$i.'Id'] == 36) // effect: learnSpell
$this->pushBuffer($buff, TYPE_SPELL, $effects['effect'.$i.'TriggerSpell'], $trainerId ? TYPE_NPC : 0, $trainerId);
$this->pushBuffer($buff, Type::SPELL, $effects['effect'.$i.'TriggerSpell'], $trainerId ? Type::NPC : 0, $trainerId);
$this->pushBuffer($buff, TYPE_SPELL, $spellId, $trainerId ? TYPE_NPC : 0, $trainerId);
$this->pushBuffer($buff, Type::SPELL, $spellId, $trainerId ? Type::NPC : 0, $trainerId);
}
DB::Aowow()->query($this->queryfy($buff, $insMore), 6, 6, 6);
@ -1079,7 +1079,7 @@ SqlGen::register(new class extends SetupScript
# 7: Discovery
CLI::write(' * #7 Discovery');
// 61756: Northrend Inscription Research (FAST QA VERSION);
if ($disco = DB::World()->select('SELECT ?d, spellId, 1 FROM skill_discovery_template WHERE reqSpell <> ?d', TYPE_SPELL, 61756))
if ($disco = DB::World()->select('SELECT ?d, spellId, 1 FROM skill_discovery_template WHERE reqSpell <> ?d', Type::SPELL, 61756))
DB::Aowow()->query($this->queryfy($disco, $insBasic), 7, 7, 7);
# 9: Talent
@ -1109,7 +1109,7 @@ SqlGen::register(new class extends SetupScript
}
foreach ($tSpells as $tId => $__)
$buff[$tId] = [TYPE_SPELL, $tId, 1];
$buff[$tId] = [Type::SPELL, $tId, 1];
if (!$recurse)
break;
@ -1127,7 +1127,7 @@ SqlGen::register(new class extends SetupScript
*/
$pcis = DB::World()->selectCol('SELECT DISTINCT skill FROM playercreateinfo_skills');
$subSkills = DB::Aowow()->subquery('SELECT ?d, spellId, 1, NULL AS m, NULL AS mt FROM dbc_skilllineability WHERE {(skillLineId IN (?a) AND acquireMethod = 2) OR} (acquireMethod = 1 AND (reqSkillLevel = 1 OR skillLineId = 129)) GROUP BY spellId', TYPE_SPELL, $pcis ?: DBSIMPLE_SKIP);
$subSkills = DB::Aowow()->subquery('SELECT ?d, spellId, 1, NULL AS m, NULL AS mt FROM dbc_skilllineability WHERE {(skillLineId IN (?a) AND acquireMethod = 2) OR} (acquireMethod = 1 AND (reqSkillLevel = 1 OR skillLineId = 129)) GROUP BY spellId', Type::SPELL, $pcis ?: DBSIMPLE_SKIP);
DB::Aowow()->query($insSub, 10, $subSkills, 10, 10);
@ -1139,7 +1139,7 @@ SqlGen::register(new class extends SetupScript
# 4: Quest
CLI::write(' * #4 Quest');
if ($quests = DB::World()->select('SELECT ?d, RewardTitle, 1, ?d, ID FROM quest_template WHERE RewardTitle > 0', TYPE_TITLE, TYPE_QUEST))
if ($quests = DB::World()->select('SELECT ?d, RewardTitle, 1, ?d, ID FROM quest_template WHERE RewardTitle > 0', Type::TITLE, Type::QUEST))
DB::Aowow()->query($this->queryfy($quests, $insMore), 4, 4, 4);
# 12: Achievement
@ -1153,7 +1153,7 @@ SqlGen::register(new class extends SetupScript
);
foreach ($sets as $tId => $set)
{
DB::Aowow()->query($this->queryfy([[TYPE_TITLE, $tId, 1, TYPE_ACHIEVEMENT, $set['srcId']]], $insMore), 12, 12, 12);
DB::Aowow()->query($this->queryfy([[Type::TITLE, $tId, 1, Type::ACHIEVEMENT, $set['srcId']]], $insMore), 12, 12, 12);
if ($set['altSrcId'])
DB::Aowow()->query('UPDATE ?_titles SET src12Ext = ?d WHERE id = ?d', $set['altSrcId'], $tId);
@ -1164,7 +1164,7 @@ SqlGen::register(new class extends SetupScript
$src13 = [null, 42, 52, 71, 80, 157, 163, 167, 169, 177];
foreach ($src13 as $src => $tId)
if ($tId)
DB::Aowow()->query($this->queryfy([[TYPE_TITLE, $tId, $src]], $insBasic), 13, 13, 13);
DB::Aowow()->query($this->queryfy([[Type::TITLE, $tId, $src]], $insBasic), 13, 13, 13);
return true;
}

View file

@ -19,31 +19,31 @@ SqlGen::register(new class extends SetupScript
private $querys = array(
1 => ['SELECT c.guid, 1 AS "type", c.id AS typeId, c.spawntimesecs AS respawn, c.phaseMask, c.zoneId AS areaId, c.map, IFNULL(ca.path_id, 0) AS pathId, c.position_y AS `posX`, c.position_x AS `posY` ' .
'FROM creature c LEFT JOIN creature_addon ca ON ca.guid = c.guid',
' - assembling creature spawns', TYPE_NPC],
' - assembling creature spawns', Type::NPC],
2 => ['SELECT c.guid, 2 AS "type", c.id AS typeId, ABS(c.spawntimesecs) AS respawn, c.phaseMask, c.zoneId AS areaId, c.map, 0 as pathId, c.position_y AS `posX`, c.position_x AS `posY` ' .
'FROM gameobject c',
' - assembling gameobject spawns', TYPE_OBJECT],
' - assembling gameobject spawns', Type::OBJECT],
3 => ['SELECT id AS "guid", 19 AS "type", soundId AS typeId, 0 AS respawn, 0 AS phaseMask, 0 AS areaId, mapId AS "map", 0 AS pathId, posX, posY ' .
'FROM dbc_soundemitters',
' - assembling sound emitter spawns', TYPE_SOUND],
' - assembling sound emitter spawns', Type::SOUND],
4 => ['SELECT id AS "guid", 503 AS "type", id AS typeId, 0 AS respawn, 0 AS phaseMask, 0 AS areaId, mapId AS "map", 0 AS pathId, posX, posY ' .
'FROM dbc_areatrigger',
' - assembling areatrigger spawns', TYPE_AREATRIGGER],
' - assembling areatrigger spawns', Type::AREATRIGGER],
5 => ['SELECT c.guid, w.entry AS "npcOrPath", w.pointId AS "point", c.zoneId AS areaId, c.map, w.waittime AS "wait", w.location_y AS `posX`, w.location_x AS `posY` ' .
'FROM creature c JOIN script_waypoint w ON c.id = w.entry',
' - assembling waypoints from table script_waypoint', TYPE_NPC],
' - assembling waypoints from table script_waypoint', Type::NPC],
6 => ['SELECT c.guid, w.entry AS "npcOrPath", w.pointId AS "point", c.zoneId AS areaId, c.map, 0 AS "wait", w.position_y AS `posX`, w.position_x AS `posY` ' .
'FROM creature c JOIN waypoints w ON c.id = w.entry',
' - assembling waypoints from table waypoints', TYPE_NPC],
' - assembling waypoints from table waypoints', Type::NPC],
7 => ['SELECT c.guid, -w.id AS "npcOrPath", w.point, c.zoneId AS areaId, c.map, w.delay AS "wait", w.position_y AS `posX`, w.position_x AS `posY` ' .
'FROM creature c JOIN creature_addon ca ON ca.guid = c.guid JOIN waypoint_data w ON w.id = ca.path_id WHERE ca.path_id <> 0',
' - assembling waypoints from table waypoint_data', TYPE_NPC]
' - assembling waypoints from table waypoint_data', Type::NPC]
);
public function generate(array $ids = []) : bool
@ -202,9 +202,9 @@ SqlGen::register(new class extends SetupScript
{
$vehicles = [];
if ($data['guid']) // vehicle already spawned
$vehicles = DB::Aowow()->select('SELECT s.areaId, s.posX, s.posY, s.floor FROM ?_spawns s WHERE s.guid = ?d AND s.type = ?d', $data['guid'], TYPE_NPC);
$vehicles = DB::Aowow()->select('SELECT s.areaId, s.posX, s.posY, s.floor FROM ?_spawns s WHERE s.guid = ?d AND s.type = ?d', $data['guid'], Type::NPC);
else if ($data['entry']) // vehicle on unspawned vehicle action
$vehicles = DB::Aowow()->select('SELECT s.areaId, s.posX, s.posY, s.floor FROM ?_spawns s WHERE s.typeId = ?d AND s.type = ?d', $data['entry'], TYPE_NPC);
$vehicles = DB::Aowow()->select('SELECT s.areaId, s.posX, s.posY, s.floor FROM ?_spawns s WHERE s.typeId = ?d AND s.type = ?d', $data['entry'], Type::NPC);
if ($vehicles)
{
@ -213,7 +213,7 @@ SqlGen::register(new class extends SetupScript
for ($i = 0; $i < $data['nSeats']; $i++)
DB::Aowow()->query('
REPLACE INTO ?_spawns (`guid`, `type`, `typeId`, `respawn`, `spawnMask`, `phaseMask`, `areaId`, `floor`, `posX`, `posY`, `pathId`) VALUES
(?d, ?d, ?d, 0, 0, 1, ?d, ?d, ?f, ?f, 0)', --$vGuid, TYPE_NPC, $data['typeId'], $v['areaId'], $v['floor'], $v['posX'], $v['posY']);
(?d, ?d, ?d, 0, 0, 1, ?d, ?d, ?f, ?f, 0)', --$vGuid, Type::NPC, $data['typeId'], $v['areaId'], $v['floor'], $v['posX'], $v['posY']);
unset($accessories[$idx]);
}

View file

@ -726,7 +726,7 @@ SqlGen::register(new class extends SetupScript
// hide unused glyphs
DB::Aowow()->query('UPDATE ?_spell SET skillLine1 = 0, iconIdAlt = 0, cuFlags = cuFlags | ?d WHERE id IN (?a)', CUSTOM_EXCLUDE_FOR_LISTVIEW, [60460, 58166, 58239, 58240, 58261, 58262, 54910]);
$this->reapplyCCFlags('spell', TYPE_SPELL);
$this->reapplyCCFlags('spell', Type::SPELL);
return true;
}

View file

@ -94,7 +94,7 @@ SqlGen::register(new class extends SetupScript
DB::Aowow()->query('UPDATE ?_titles SET side = 2 WHERE id <= 28 OR id IN (118, 119, 116, 117, 110, 127)');
DB::Aowow()->query('UPDATE ?_titles SET side = 1 WHERE id <= 14 OR id IN (111, 115, 112, 114, 126)');
$this->reapplyCCFlags('titles', TYPE_TITLE);
$this->reapplyCCFlags('titles', Type::TITLE);
return true;
}

View file

@ -173,30 +173,30 @@ SqlGen::register(new class extends SetupScript
if ($req['reqItemN'] && ($entries = explode(' ', $req['reqItemN'])))
foreach ($entries as $_)
$aN[TYPE_ITEM][] = $_;
$aN[Type::ITEM][] = $_;
if ($req['reqItemH'] && ($entries = explode(' ', $req['reqItemH'])))
if ($entries = array_diff($entries, $aN[TYPE_ITEM] ?? []))
if ($entries = array_diff($entries, $aN[Type::ITEM] ?? []))
foreach ($entries as $_)
$aH[TYPE_ITEM][] = $_;
$aH[Type::ITEM][] = $_;
if ($req['reqQuestN'] && ($entries = explode(' ', $req['reqQuestN'])))
foreach ($entries as $_)
$aN[TYPE_QUEST][] = $_;
$aN[Type::QUEST][] = $_;
if ($req['reqQuestH'] && ($entries = explode(' ', $req['reqQuestH'])))
if ($entries = array_diff($entries, $aN[TYPE_QUEST] ?? []))
if ($entries = array_diff($entries, $aN[Type::QUEST] ?? []))
foreach ($entries as $_)
$aH[TYPE_QUEST][] = $_;
$aH[Type::QUEST][] = $_;
if ($req['reqAchievementN'] && ($entries = explode(' ', $req['reqAchievementN'])))
foreach ($entries as $_)
$aN[TYPE_ACHIEVEMENT][] = $_;
$aN[Type::ACHIEVEMENT][] = $_;
if ($req['reqAchievementH'] && ($entries = explode(' ', $req['reqAchievementH'])))
if ($entries = array_diff($entries, $aN[TYPE_ACHIEVEMENT] ?? []))
if ($entries = array_diff($entries, $aN[Type::ACHIEVEMENT] ?? []))
foreach ($entries as $_)
$aH[TYPE_ACHIEVEMENT][] = $_;
$aH[Type::ACHIEVEMENT][] = $_;
if ($aN)
{
@ -217,7 +217,7 @@ SqlGen::register(new class extends SetupScript
DB::Aowow()->query('UPDATE ?_zones SET ?a WHERE mapId = ?d', $update, $mapId);
}
$this->reapplyCCFlags('zones', TYPE_ZONE);
$this->reapplyCCFlags('zones', Type::ZONE);
return true;
}