mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Profiler/Completion
* apply factions from player_factionchange_spells to all spells * filter companion pets without suitable item source
This commit is contained in:
@@ -185,7 +185,7 @@ SqlGen::register(new class extends SetupScript
|
||||
// filter misc(class:15) junk(subclass:0) to appropriate categories
|
||||
|
||||
// assign pets and mounts to category
|
||||
DB::Aowow()->query('UPDATE ?_items i, dbc_spell s SET subClass = IF(effect1AuraId <> 78, 2, IF(effect2AuraId = 207 OR effect3AuraId = 207 OR (s.id <> 65917 AND effect2AuraId = 4 AND effect3Id = 77), -7, 5)) WHERE s.id = spellId2 AND class = 15 AND spellId1 IN (483, 55884)');
|
||||
DB::Aowow()->query('UPDATE ?_items i, dbc_spell s SET subClass = IF(effect1AuraId <> 78, 2, IF(effect2AuraId = 207 OR effect3AuraId = 207 OR (s.id <> 65917 AND effect2AuraId = 4 AND effect3Id = 77), -7, 5)) WHERE s.id = spellId2 AND class = 15 AND spellId1 IN (?a)', LEARN_SPELLS);
|
||||
|
||||
// more corner cases (mounts that are not actualy learned)
|
||||
DB::Aowow()->query('UPDATE ?_items i, dbc_spell s SET i.subClass = -7 WHERE (effect1Id = 64 OR (effect1AuraId = 78 AND effect2AuraId = 4 AND effect3Id = 77) OR effect1AuraId = 207 OR effect2AuraId = 207 OR effect3AuraId = 207) AND s.id = i.spellId1 AND i.class = 15 AND i.subClass = 5');
|
||||
|
||||
@@ -50,18 +50,17 @@ SqlGen::register(new class extends SetupScript
|
||||
private function taughtSpell(array $item) : int
|
||||
{
|
||||
# spelltrigger_X (0: onUse; 6: onLearnSpell)
|
||||
# spell: 483 & 55884 are learn spells
|
||||
|
||||
// should not be able to teach spells (recipe || mount || vanityPet)
|
||||
if ($item['class'] != ITEM_CLASS_RECIPE && ($item['class'] != ITEM_CLASS_MISC || ($item['subclass'] != 2 && $item['subclass'] != 5)))
|
||||
return 0;
|
||||
|
||||
// wotlk system
|
||||
if (($item['spellid_1'] == 483 || $item['spellid_1'] == 55884) && $item['spelltrigger_1'] == 0 && $item['spellid_2'] > 0 && $item['spelltrigger_2'] == 6)
|
||||
if (in_array($item['spellid_1'], LEARN_SPELLS) && $item['spelltrigger_1'] == 0 && $item['spellid_2'] > 0 && $item['spelltrigger_2'] == 6)
|
||||
return $item['spellid_2'];
|
||||
|
||||
// deprecated system
|
||||
if ($item['spellid_1'] != 483 && $item['spellid_1'] != 55884 && $item['spellid_1'] > 0 && $item['spelltrigger_1'] == 0)
|
||||
if (!in_array($item['spellid_1'], LEARN_SPELLS) && $item['spellid_1'] > 0 && $item['spelltrigger_1'] == 0)
|
||||
return $item['spellid_1'];
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user