mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Spells/Effects
* only use MiscValue as spellid for SpellEffect:155 * interpret and display SpellEffect 293 * SpellEffects 131 & 132 can both play audio
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
if ($effId == 155)
|
||||
$_ = $effMV;
|
||||
else
|
||||
$_ = $this->subject->getField('effect'.$i.'TriggerSpell');
|
||||
if (!$_)
|
||||
$_ = $this->subject->getField('effect'.$i.'MiscValue');
|
||||
|
||||
$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 ? '<a href="?faction='.$effMV.'">'.$n.'</a>' : 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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -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],
|
||||
|
||||
11
setup/updates/1490912249_01.sql
Normal file
11
setup/updates/1490912249_01.sql
Normal file
@@ -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');
|
||||
@@ -212,9 +212,9 @@ foreach ($this->effects as $i => $e):
|
||||
echo "<small>".$smallBuf."</small>\n";
|
||||
endif;
|
||||
|
||||
if (isset($e['sound'])):
|
||||
echo '<br/><div id="spelleffectsound-'.$i.'" style="display: inline-block"></div><script type="text/javascript">//<![CDATA[
|
||||
$WH.aE(window,\'load\',function(){$WH.ge(\'spelleffectsound-'.$i.'\').innerHTML = Markup.toHtml(\'[sound='.$e['sound'].']\');});
|
||||
if (isset($e['markup'])):
|
||||
echo '<br/><div id="spelleffectmarkup-'.$i.'" style="display: inline-block"></div><script type="text/javascript">//<![CDATA[
|
||||
$WH.aE(window,\'load\',function(){$WH.ge(\'spelleffectmarkup-'.$i.'\').innerHTML = Markup.toHtml(\''.$e['markup'].'\');});
|
||||
//]]></script>';
|
||||
endif;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user