mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Spell/Tooltips
* added an exception for a bugged tooltip * better handle refs to unknown spells
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
define('AOWOW_REVISION', 13);
|
define('AOWOW_REVISION', 14);
|
||||||
define('CLI', PHP_SAPI === 'cli');
|
define('CLI', PHP_SAPI === 'cli');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -825,6 +825,8 @@ class SpellList extends BaseType
|
|||||||
$this->refSpells[$lookup] = new SpellList(array(['s.id', $lookup]));
|
$this->refSpells[$lookup] = new SpellList(array(['s.id', $lookup]));
|
||||||
|
|
||||||
$srcSpell = $lookup ? $this->refSpells[$lookup] : $this;
|
$srcSpell = $lookup ? $this->refSpells[$lookup] : $this;
|
||||||
|
if ($srcSpell->error)
|
||||||
|
return $result;
|
||||||
|
|
||||||
switch ($var)
|
switch ($var)
|
||||||
{
|
{
|
||||||
@@ -1116,6 +1118,12 @@ class SpellList extends BaseType
|
|||||||
$formula = substr_replace($formula, $formOutStr, $formStartPos, ($formCurPos - $formStartPos));
|
$formula = substr_replace($formula, $formOutStr, $formStartPos, ($formCurPos - $formStartPos));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// note: broken tooltip on this one
|
||||||
|
// ${58644m1/-10} gets matched as a formula (ok), 58644m1 has no $ prefixed (not ok)
|
||||||
|
// the client scraps the m1 and prints -5864
|
||||||
|
if ($this->id == 58644)
|
||||||
|
$formula = '$'.$formula;
|
||||||
|
|
||||||
// step 2: resolve variables
|
// step 2: resolve variables
|
||||||
$pos = 0; // continue strpos-search from this offset
|
$pos = 0; // continue strpos-search from this offset
|
||||||
$str = '';
|
$str = '';
|
||||||
@@ -1304,7 +1312,7 @@ class SpellList extends BaseType
|
|||||||
$data = $this->handleFormulas($data, $scaling, true);
|
$data = $this->handleFormulas($data, $scaling, true);
|
||||||
|
|
||||||
// step 4: find and eliminate regular variables
|
// step 4: find and eliminate regular variables
|
||||||
$data = $this->handleVariables($data, $scaling/*, true*/);
|
$data = $this->handleVariables($data, $scaling, true);
|
||||||
|
|
||||||
// step 5: variable-dependant variable-text
|
// step 5: variable-dependant variable-text
|
||||||
// special case $lONE:ELSE;
|
// special case $lONE:ELSE;
|
||||||
@@ -1376,7 +1384,7 @@ class SpellList extends BaseType
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function handleVariables($data, &$scaling/*, $topLevel = false*/)
|
private function handleVariables($data, &$scaling, $topLevel = false)
|
||||||
{
|
{
|
||||||
$pos = 0; // continue strpos-search from this offset
|
$pos = 0; // continue strpos-search from this offset
|
||||||
$str = '';
|
$str = '';
|
||||||
@@ -1418,6 +1426,9 @@ class SpellList extends BaseType
|
|||||||
$resolved .= isset($var[3]) ? sprintf($var[3], $_) : $_;
|
$resolved .= isset($var[3]) ? sprintf($var[3], $_) : $_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($var[0] === null && $topLevel) // {Unknown}
|
||||||
|
$resolved .= '{'.Lang::game('sources', 0).'}';
|
||||||
|
|
||||||
$str .= $resolved;
|
$str .= $resolved;
|
||||||
}
|
}
|
||||||
$str .= substr($data, $pos);
|
$str .= substr($data, $pos);
|
||||||
|
|||||||
@@ -133,8 +133,8 @@ class SpellPage extends GenericPage
|
|||||||
|
|
||||||
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
|
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
|
||||||
|
|
||||||
// level
|
// level
|
||||||
if (!in_array($_cat, [-5, -6])) // not mount or vanity pet
|
if (!in_array($_cat, [-5, -6])) // not mount or vanity pet
|
||||||
{
|
{
|
||||||
if ($_ = $this->subject->getField('talentLevel'))
|
if ($_ = $this->subject->getField('talentLevel'))
|
||||||
$infobox[] = (in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::game('reqLevel'), $_) : Lang::game('level').Lang::main('colon').$_);
|
$infobox[] = (in_array($_cat, [-2, 7, -13]) ? sprintf(Lang::game('reqLevel'), $_) : Lang::game('level').Lang::main('colon').$_);
|
||||||
|
|||||||
Reference in New Issue
Block a user