diff --git a/includes/types/spell.class.php b/includes/types/spell.class.php index 486227aa..af64ba41 100644 --- a/includes/types/spell.class.php +++ b/includes/types/spell.class.php @@ -37,6 +37,7 @@ class SpellList extends BaseType 'trigger' => [ 3, 32, 64, 101, 142, 148, 151, 152, 155, 160, 164], // dummy, trigger missile, trigger spell, feed pet, force cast, force cast with value, unk, trigger spell 2, unk, dualwield 2H, unk, remove aura 'teach' => [36, 57, /*133*/ ] // learn spell, learn pet spell, /*unlearn specialization*/ ); + public static $auras = array( 'heal' => [ 4, 8, 62, 69, 97, 226 ], // Dummy, Periodic Heal, Periodic Health Funnel, School Absorb, Mana Shield, Periodic Dummy 'damage' => [ 3, 4, 15, 53, 89, 162, 226 ], // Periodic Damage, Dummy, Damage Shield, Periodic Health Leech, Periodic Damage Percent, Power Burn Mana, Periodic Dummy @@ -661,7 +662,7 @@ class SpellList extends BaseType $idx = []; for ($i = 1; $i < 4; $i++) if (in_array($this->curTpl['effect'.$i.'Id'], SpellList::$effects['trigger']) || in_array($this->curTpl['effect'.$i.'AuraId'], SpellList::$auras['trigger'])) - if ($this->curTpl['effect'.$i.'TriggerSpell'] > 0 || $this->curTpl['effect'.$i.'MiscValue'] > 0) + if ($this->curTpl['effect'.$i.'TriggerSpell'] > 0 || ($this->curTpl['effect'.$i.'Id'] == 155 && $this->curTpl['effect'.$i.'MiscValue'] > 0)) $idx[] = $i; return $idx; @@ -2004,7 +2005,7 @@ class SpellList extends BaseType // play sound effect for ($i = 1; $i < 4; $i++) - if ($this->getField('effect'.$i.'Id') == 132) + if ($this->getField('effect'.$i.'Id') == 131 || $this->getField('effect'.$i.'Id') == 132) $data[TYPE_SOUND][$this->getField('effect'.$i.'MiscValue')] = $this->getField('effect'.$i.'MiscValue'); } diff --git a/includes/utilities.php b/includes/utilities.php index 0efe3dbd..1f5c01c9 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -347,7 +347,7 @@ class Util 128 => 'Apply Area Aura Friend', 129 => 'Apply Area Aura Enemy', 130 => 'Redirect Threat', - 131 => 'Unknown Effect', + 131 => 'Play Sound', 132 => 'Play Music', 133 => 'Unlearn Specialization', 134 => 'Kill Credit2', diff --git a/pages/spell.php b/pages/spell.php index 3fcc82ea..40d40a02 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -502,6 +502,29 @@ class SpellPage extends GenericPage $this->extendGlobalData($saSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); } + // tab: used by - spell + if ($so = DB::Aowow()->selectCell('SELECT id FROM ?_spelloverride WHERE spellId1 = ?d OR spellId2 = ?d OR spellId3 = ?d OR spellId4 = ?d OR spellId5 = ?d', $this->subject->id, $this->subject->id, $this->subject->id, $this->subject->id, $this->subject->id)) + { + $conditions = array( + 'OR', + ['AND', ['effect1AuraId', 293], ['effect1MiscValue', $so]], + ['AND', ['effect2AuraId', 293], ['effect2MiscValue', $so]], + ['AND', ['effect3AuraId', 293], ['effect3MiscValue', $so]] + ); + $ubSpells = new SpellList($conditions); + if (!$ubSpells->error) + { + $this->lvTabs[] = ['spell', array( + 'data' => array_values($ubSpells->getListviewData()), + 'id' => 'used-by-spell', + 'name' => '$LANG.tab_usedby' + )]; + + $this->extendGlobalData($ubSpells->getJSGlobals(GLOBALINFO_SELF)); + } + } + + // tab: used by - itemset $conditions = array( 'OR', @@ -1566,9 +1589,10 @@ class SpellPage extends GenericPage // .. from spell else if (in_array($i, $spellIdx) || $effId == 133) { - $_ = $this->subject->getField('effect'.$i.'TriggerSpell'); - if (!$_) - $_ = $this->subject->getField('effect'.$i.'MiscValue'); + if ($effId == 155) + $_ = $effMV; + else + $_ = $this->subject->getField('effect'.$i.'TriggerSpell'); $trig = new SpellList(array(['s.id', (int)$_])); @@ -1748,8 +1772,9 @@ class SpellPage extends GenericPage $foo['name'] .= ' ('.$_.')'; break; + case 131: // Play Music case 132: // Play Sound - $foo['sound'] = $effMV; + $foo['markup'] = '[sound='.$effMV.']'; break; case 103: // Reputation $_ = Util::ucFirst(Lang::game('faction')).' #'.$effMV; @@ -1768,6 +1793,8 @@ class SpellPage extends GenericPage { if (($effMV || $effId == 97) && $effId != 155) $foo['name'] .= ' ('.$effMV.')'; + + break; } // Aura case 6: // Simple @@ -1999,6 +2026,21 @@ class SpellPage extends GenericPage $n = FactionList::getName($effMV); $bar = ' ('.($n ? ''.$n.'' : Util::ucFirst(Lang::game('faction')).' #'.$effMV).')'; break; // also breaks for 139 + case 293: // Override Spells + if ($so = DB::Aowow()->selectRow('SELECT spellId1, spellId2, spellId3, spellId4, spellId5 FROM ?_spelloverride WHERE id = ?d', $effMV)) + { + $buff = []; + for ($i = 1; $i < 6; $i++) + { + if ($x = $so['spellId'.$i]) + { + $this->extendGlobalData([TYPE_SPELL => [$x]]); + $buff[] = '[spell='.$x.']'; + } + } + $foo['markup'] = implode(', ', $buff); + } + break; } $foo['name'] .= strstr($bar, 'href') || strstr($bar, '#') ? $bar : ($bar ? ' ('.$bar.')' : null); diff --git a/setup/db_structure.sql b/setup/db_structure.sql index a9887cc2..73b7679b 100644 --- a/setup/db_structure.sql +++ b/setup/db_structure.sql @@ -2575,6 +2575,17 @@ CREATE TABLE `aowow_items_sounds` ( PRIMARY KEY (`soundId`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='actually .. its only weapon related sounds in here'; +DROP TABLE IF EXISTS `aowow_spelloverride`; +CREATE TABLE `aowow_spelloverride` ( + `id` smallint(5) unsigned NOT NULL, + `spellId1` mediumint(8) unsigned NULL DEFAULT NULL, + `spellId2` mediumint(8) unsigned NULL DEFAULT NULL, + `spellId3` mediumint(8) unsigned NULL DEFAULT NULL, + `spellId4` mediumint(8) unsigned NULL DEFAULT NULL, + `spellId5` mediumint(8) unsigned NULL DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; @@ -2668,7 +2679,7 @@ UNLOCK TABLES; LOCK TABLES `aowow_dbversion` WRITE; /*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */; -INSERT INTO `aowow_dbversion` VALUES (1490815302,0,NULL,NULL); +INSERT INTO `aowow_dbversion` VALUES (1490912250,0,NULL,NULL); /*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */; UNLOCK TABLES; diff --git a/setup/tools/dbc.class.php b/setup/tools/dbc.class.php index b6e3cd80..6777dbf9 100644 --- a/setup/tools/dbc.class.php +++ b/setup/tools/dbc.class.php @@ -96,6 +96,7 @@ class DBC 'mapdifficulty' => 'niixxxxxxxxxxxxxxxxxxis', 'material' => 'nxxii', 'npcsounds' => 'niiix', + 'overridespelldata' => 'niiiixixxxxx', 'powerdisplay' => 'nisbbb', 'questfactionreward' => 'niiiiiiiiii', 'questxp' => 'niiiiiiiiii', @@ -197,6 +198,7 @@ class DBC 'mapdifficulty' => 'Id,mapId,difficulty,nPlayer,nPlayerString', 'material' => 'Id,sheatheSoundId,unsheatheSoundId', 'npcsounds' => 'Id,greetSoundId,byeSoundId,angrySoundId', + 'overridespelldata' => 'Id,spellId1,spellId2,spellId3,spellId4,spellId5', 'powerdisplay' => 'Id,realType,globalString,r,g,b', 'questfactionreward' => 'Id,field1,field2,field3,field4,field5,field6,field7,field8,field9,field10', 'questxp' => 'Id,field1,field2,field3,field4,field5,field6,field7,field8,field9,field10', diff --git a/setup/tools/filegen/soundfiles.func.php b/setup/tools/filegen/soundfiles.func.php index 06ae33d2..8d41f83a 100644 --- a/setup/tools/filegen/soundfiles.func.php +++ b/setup/tools/filegen/soundfiles.func.php @@ -14,6 +14,7 @@ if (!CLI) $files = DB::Aowow()->selectCol('SELECT ABS(id) AS ARRAY_KEY, CONCAT(path, "/", `file`) FROM ?_sounds_files'); $nFiles = count($files); $itr = $i = 0; + $step = 1000; foreach ($files as $fileId => $filePath) { $i++; diff --git a/setup/tools/sqlGen.class.php b/setup/tools/sqlGen.class.php index 0a97b7f9..7fde2729 100644 --- a/setup/tools/sqlGen.class.php +++ b/setup/tools/sqlGen.class.php @@ -37,6 +37,7 @@ class SqlGen 'scalingstatdistribution' => ['scalingstatdistribution', true, null, null], 'scalingstatvalues' => ['scalingstatvalues', true, null, null], 'spellfocusobject' => ['spellfocusobject', false, null, null], + 'spelloverride' => ['overridespelldata', false, null, null], 'spellrange' => ['spellrange', false, null, null], 'spellvariables' => ['spelldescriptionvariables', false, null, null], 'totemcategory' => ['totemcategory', false, null, null], diff --git a/setup/updates/1490912249_01.sql b/setup/updates/1490912249_01.sql new file mode 100644 index 00000000..b666d7d9 --- /dev/null +++ b/setup/updates/1490912249_01.sql @@ -0,0 +1,11 @@ +CREATE TABLE `aowow_spelloverride` ( + `id` SMALLINT(5) UNSIGNED NOT NULL, + `spellId1` MEDIUMINT(8) UNSIGNED NULL DEFAULT NULL, + `spellId2` MEDIUMINT(8) UNSIGNED NULL DEFAULT NULL, + `spellId3` MEDIUMINT(8) UNSIGNED NULL DEFAULT NULL, + `spellId4` MEDIUMINT(8) UNSIGNED NULL DEFAULT NULL, + `spellId5` MEDIUMINT(8) UNSIGNED NULL DEFAULT NULL, + PRIMARY KEY (`id`) +) COLLATE='utf8_general_ci' ENGINE=InnoDB; + +UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' spelloverride'); diff --git a/template/pages/spell.tpl.php b/template/pages/spell.tpl.php index 1558f8df..e13b7c12 100644 --- a/template/pages/spell.tpl.php +++ b/template/pages/spell.tpl.php @@ -212,9 +212,9 @@ foreach ($this->effects as $i => $e): echo "".$smallBuf."\n"; endif; - if (isset($e['sound'])): - echo '
'; endif;