Spells/Effects

* also list affected spells directly in the spell effect
 * allow more spell auras to display affected spells
This commit is contained in:
Sarjuuk
2024-04-02 01:07:43 +02:00
parent 7b43739dbc
commit e09e3a7260
9 changed files with 154 additions and 21 deletions

View File

@@ -1476,6 +1476,10 @@ $lang = array(
'_collapseAll' => "Alle einklappen",
'_expandAll' => "Alle ausklappen",
'_transfer' => 'Dieser Zauber wird mit <a href="?spell=%d" class="q%d icontiny tinyspecial" style="background-image: url('.STATIC_URL.'/images/wow/icons/tiny/%s.gif)">%s</a> vertauscht, wenn Ihr zur <span class="icon-%s">%s</span> wechselt.',
'_affected' => "Betroffene Zauber",
'_seeMore' => "Mehr anzeigen",
'_rankRange' => "Rang:&nbsp;%d&nbsp;-&nbsp;%d",
'_showXmore' => "Zeige %d weitere",
'currentArea' => '&lt;Momentanes Gebiet&gt;',
'discovered' => "Durch Geistesblitz erlernt",
'ppm' => "(%s Auslösungen pro Minute)",

View File

@@ -1476,6 +1476,10 @@ $lang = array(
'_collapseAll' => "Collapse All",
'_expandAll' => "Expand All",
'_transfer' => 'This spell will be converted to <a href="?spell=%d" class="q%d icontiny tinyspecial" style="background-image: url('.STATIC_URL.'/images/wow/icons/tiny/%s.gif)">%s</a> if you transfer to <span class="icon-%s">%s</span>.',
'_affected' => "Affected Spells",
'_seeMore' => "See more",
'_rankRange' => "Rank:&nbsp;%d&nbsp;-&nbsp;%d",
'_showXmore' => "Show %d More",
'currentArea' => '&lt;current area&gt;',
'discovered' => "Learned via discovery",
'ppm' => "(%s procs per minute)",

View File

@@ -1476,6 +1476,10 @@ $lang = array(
'_collapseAll' => "Contraer todo",
'_expandAll' => "Expandier todo",
'_transfer' => 'Este hechizo será convertido a <a href="?spell=%d" class="q%d icontiny tinyspecial" style="background-image: url('.STATIC_URL.'/images/wow/icons/tiny/%s.gif)">%s</a> si lo transfieres a la <span class="icon-%s">%s</span>.',
'_affected' => "Hechizos affectados",
'_seeMore' => "[See more]",
'_rankRange' => "Rango:&nbsp;%d&nbsp;-&nbsp;%d",
'_showXmore' => "Mostrar %d más",
'currentArea' => '&lt;current area&gt;',
'discovered' => "Aprendido via descubrimiento",
'ppm' => "(%s procs por minuto)",

View File

@@ -1476,6 +1476,10 @@ $lang = array(
'_collapseAll' => "Replier Tout",
'_expandAll' => "Déplier Tout",
'_transfer' => 'Cet sort sera converti en <a href="?spell=%d" class="q%d icontiny tinyspecial" style="background-image: url('.STATIC_URL.'/images/wow/icons/tiny/%s.gif)">%s</a> si vous transférez en <span class="icon-%s">%s</span>.',
'_affected' => "Sorts affectés",
'_seeMore' => "[See more]",
'_rankRange' => "Rang&nbsp;:&nbsp;%d&nbsp;-&nbsp;%d",
'_showXmore' => "En afficher %d de plus",
'currentArea' => '&lt;current area&gt;',
'discovered' => "Appris via une découverte",
'ppm' => "(%s déclenchements par minute)",

View File

@@ -1476,6 +1476,10 @@ $lang = array(
'_collapseAll' => "Свернуть все",
'_expandAll' => "Развернуть все",
'_transfer' => 'Этот предмет превратится в <a href="?spell=%d" class="q%d icontiny tinyspecial" style="background-image: url('.STATIC_URL.'/images/wow/icons/tiny/%s.gif)">%s</a>, если вы перейдете за <span class="icon-%s">%s</span>.',
'_affected' => "Влияет на заклинания",
'_seeMore' => "[See more]",
'_rankRange' => "Ранг:&nbsp;%d&nbsp;-&nbsp;%d",
'_showXmore' => "Показать на %d больше",
'currentArea' => '&lt;current area&gt;',
'discovered' => "Изучается путём освоения местности",
'ppm' => "(Срабатывает %s раз в минуту)",

View File

@@ -1475,6 +1475,10 @@ $lang = array(
'_collapseAll' => "折叠全部",
'_expandAll' => "展开全部",
'_transfer' => '这个法术将被转换到<a href="?spell=%d" class="q%d icontiny tinyspecial" style="background-image: url('.STATIC_URL.'/images/wow/icons/tiny/%s.gif)">%s</a>,如果你转移到<span class="icon-%s">%s</span>。',
'_affected' => "受影响法术",
'_seeMore' => "[See more]",
'_rankRange' => "排名:&nbsp;%d&nbsp;-&nbsp;%d",
'_showXmore' => "[Show %d More]",
'currentArea' => '&lt;当前区域&gt;',
'discovered' => "通过发现学习",
'ppm' => "%s每分钟触发几率",

View File

@@ -44,10 +44,11 @@ class SpellPage extends GenericPage
private $firstRank = 0;
private $powerTpl = '$WowheadPower.registerSpell(%d, %d, %s);';
private static $modAuras = [SPELL_AURA_ADD_FLAT_MODIFIER, SPELL_AURA_ADD_PCT_MODIFIER, SPELL_AURA_NO_REAGENT_USE,
SPELL_AURA_ABILITY_PERIODIC_CRIT, SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL, SPELL_AURA_ABILITY_IGNORE_AURASTATE,
SPELL_AURA_ALLOW_ONLY_ABILITY, SPELL_AURA_IGNORE_MELEE_RESET, SPELL_AURA_ABILITY_CONSUME_NO_AMMO,
SPELL_AURA_MOD_IGNORE_SHAPESHIFT, SPELL_AURA_PERIODIC_HASTE /* SPELL_AURA_DUMMY ? */];
private static $modAuras = [SPELL_AURA_ADD_FLAT_MODIFIER, SPELL_AURA_ADD_PCT_MODIFIER, SPELL_AURA_NO_REAGENT_USE,
SPELL_AURA_ABILITY_PERIODIC_CRIT, SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL, SPELL_AURA_ABILITY_IGNORE_AURASTATE,
SPELL_AURA_ALLOW_ONLY_ABILITY, SPELL_AURA_IGNORE_MELEE_RESET, SPELL_AURA_ABILITY_CONSUME_NO_AMMO,
SPELL_AURA_MOD_IGNORE_SHAPESHIFT, SPELL_AURA_PERIODIC_HASTE, SPELL_AURA_OVERRIDE_CLASS_SCRIPTS,
SPELL_AURA_MOD_DAMAGE_FROM_CASTER, SPELL_AURA_ADD_TARGET_TRIGGER, /* SPELL_AURA_DUMMY ? */];
public function __construct($pageCall, $id)
{
@@ -296,7 +297,7 @@ class SpellPage extends GenericPage
$this->scaling = $this->createScalingData();
$this->items = $this->createRequiredItems();
$this->tools = $this->createTools();
$this->effects = $effects;
$this->effects = &$effects;
$this->attributes = $this->createAttributesList();
$this->powerCost = $this->subject->createPowerCostForCurrent();
$this->castTime = $this->subject->createCastTimeForCurrent(false, false);
@@ -383,12 +384,14 @@ class SpellPage extends GenericPage
}
// tab: [$this] modifies
$sub = ['OR'];
$sub = [];
$conditions = [
['s.typeCat', [-9], '!'], // GM (-9); also include uncategorized (0), NPC-Spell (-8)?; NPC includes totems, lightwell and others :/
['s.spellFamilyId', $this->subject->getField('spellFamilyId')],
&$sub
];
$modifiesData = [];
$hideSkillCol = true;
for ($i = 1; $i < 4; $i++)
{
@@ -402,30 +405,58 @@ class SpellPage extends GenericPage
if (!$m1 && !$m2 && !$m3)
continue;
$sub[] = ['s.spellFamilyFlags1', $m1, '&'];
$sub[] = ['s.spellFamilyFlags2', $m2, '&'];
$sub[] = ['s.spellFamilyFlags3', $m3, '&'];
}
$classSpells = $miscSpells = [];
$this->effects[$i]['modifies'] = [&$classSpells, &$miscSpells];
$sub = ['OR', ['s.spellFamilyFlags1', $m1, '&'], ['s.spellFamilyFlags2', $m2, '&'], ['s.spellFamilyFlags3', $m3, '&']];
if (count($sub) > 1)
{
$modSpells = new SpellList($conditions);
if (!$modSpells->error)
{
$tabData = array(
'data' => array_values($modSpells->getListviewData()),
'id' => 'modifies',
'name' => '$LANG.tab_modifies',
'visibleCols' => ['level'],
);
foreach ($modSpells->iterate() as $id => $__)
{
if (in_array($modSpells->getField('typeCat'), [-2, 7]))
$classSpells[$id] = [$id, $modSpells->getField('name', true), 0, 0];
else
$miscSpells[$id] = [$id, $modSpells->getField('name', true), 0, 0];
}
if (!$modSpells->hasSetFields(['skillLines']))
$tabData['hiddenCols'] = ['skill'];
if ($classSpells)
foreach (DB::World()->select('SELECT spell_id AS ARRAY_KEY, first_spell_id AS "0", `rank` AS "1" FROM spell_ranks WHERE spell_id IN (?a)', array_keys($classSpells)) as $spellId => [$firstSpellId, $rank])
{
$classSpells[$firstSpellId][2] = min($classSpells[$firstSpellId][2] ?: $rank, $rank);
$classSpells[$firstSpellId][3] = max($classSpells[$firstSpellId][3], $rank);
$this->lvTabs[] = [SpellList::$brickFile, $tabData];
if ($spellId != $firstSpellId)
unset($classSpells[$spellId]);
}
$modifiesData += $modSpells->getListviewData();
if ($modSpells->hasSetFields(['skillLines']))
$hideSkillCol = false;
$this->extendGlobalData($modSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
}
$classSpells = array_values($classSpells);
$miscSpells = array_values($miscSpells);
unset($classSpells, $miscSpells);
}
if ($modifiesData)
{
$tabData = array(
'data' => array_values($modifiesData),
'id' => 'modifies',
'name' => '$LANG.tab_modifies',
'visibleCols' => ['level'],
);
if ($hideSkillCol)
$tabData['hiddenCols'] = ['skill'];
$this->lvTabs[] = [SpellList::$brickFile, $tabData];
}
// tab: [$this is] modified by

View File

@@ -1494,6 +1494,14 @@ span.icon-instance8 {
margin-top: 4px;
}
.icontab.show-all tr {
display: table-row !important;
}
.icontab.show-all tr.icontab-revealer {
display: none !important;
}
.icontab tr {
background: none !important;
}
@@ -1532,6 +1540,19 @@ span.icon-instance8 {
border-radius: 3px;
}
.icontab-revealer a {
color: inherit;
display: block;
font-size: 14px;
height: 44px;
line-height: 44px;
text-align: center
}
.icontab-revealer a:hover {
color: #fff;
}
.lightbox-outer {
position: fixed;
left: 50%;

View File

@@ -251,6 +251,63 @@ $WH.aE(window,\'load\',function(){$WH.ge(\'spelleffectmarkup-'.$i.'\').innerHTML
<?php
endif;
if (isset($e['modifies'])):
?>
<br><small><?=Lang::spell('_affected').Lang::main('colon');?></small>
<?php
for ($type = 0; $type < 2; $type++):
if (!$e['modifies'][$type])
continue;
$folded = false;
$iconData = [];
if ($type && count($e['modifies'][0]))
echo '<a href="javascript:" class="disclosure-off" onclick="return g_disclose($(\'#effectspells-85645'.($i - 1).'\')[0], this);">'.Lang::spell('_seeMore').'</a><div id="effectspells-85645'.($i - 1).'" style="display: none">';
echo '<table class="icontab">';
foreach ($e['modifies'][$type] as $idx => [$id, $name, $minRank, $maxRank]):
if (!$idx || !($idx % 3))
echo "<tr".($folded ? ' style="display:none;"' : '').">";
$iconData[] = [++$iconTabIdx, $id];
echo "<th id=\"icontab-icon".$iconTabIdx."\"></th><td><a href=\"?spell=".$id."\">".($type ? $name : "<b>".$name."</b>")."</a>".($minRank != $maxRank ? "<br><small>(".Lang::spell('_rankRange', [$minRank, $maxRank]).")</small>" : '')."</td>\n";
if ($idx == count($e['modifies'][$type]) - 1 || !(($idx + 1) % 3))
echo "</tr>";
if ($idx == 17 && count($e['modifies'][$type]) > 21):
$folded = true;
?>
<tr class="icontab-revealer">
<td colspan="6">
<a onclick="$(this).closest('table').addClass('show-all')">
<?=Lang::spell('_showXmore', [count($e['modifies'][$type]) - 18]); ?>
</a>
</td>
</tr>
<?php
endif;
endforeach;
?>
</table>
<script type="text/javascript">//<![CDATA[
<?php
foreach ($iconData as [$icon, $spell])
echo sprintf(" \$WH.ge('icontab-icon%d').appendChild(g_spells.createIcon(%d, 0, \"0\"));\n", $icon, $spell);
?>
//]]></script>
<?php
if ($type && count($e['modifies'][0]))
echo '</div>';
endfor;
endif;
?>
</td>
</tr>