mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Creature/DetailPage
* display school resistance under stats in infobox
This commit is contained in:
@@ -17,6 +17,7 @@ class NpcPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = ['swfobject.js'];
|
||||
protected $css = [['path' => 'Profiler.css']];
|
||||
|
||||
private $soundIds = [];
|
||||
private $powerTpl = '$WowheadPower.registerNpc(%d, %d, %s);';
|
||||
@@ -107,6 +108,9 @@ class NpcPage extends GenericPage
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/***********/
|
||||
/* Infobox */
|
||||
/***********/
|
||||
@@ -247,6 +251,23 @@ class NpcPage extends GenericPage
|
||||
$armor = $this->subject->getBaseStats('armor');
|
||||
$stats['armor'] = Lang::npc('armor').Lang::main('colon').($armor[0] < $armor[1] ? Lang::nf($armor[0]).' - '.Lang::nf($armor[1]) : Lang::nf($armor[0]));
|
||||
|
||||
// Resistances
|
||||
$resNames = [null, 'hol', 'fir', 'nat', 'fro', 'sha', 'arc'];
|
||||
$tmpRes = [];
|
||||
$stats['resistance'] = '';
|
||||
foreach ($this->subject->getBaseStats('resistance') as $sc => $amt)
|
||||
if ($amt)
|
||||
$tmpRes[] = '[span class="moneyschool'.$resNames[$sc].'"]'.$amt.'[/span]';
|
||||
|
||||
if ($tmpRes)
|
||||
{
|
||||
$stats['resistance'] = Lang::npc('resistances').Lang::main('colon');
|
||||
if (count($tmpRes > 3))
|
||||
$stats['resistance'] .= implode(' ', array_slice($tmpRes, 0, 3)).'[br]'.implode(' ', array_slice($tmpRes, 3));
|
||||
else
|
||||
$stats['resistance'] .= implode(' ', $tmpRes);
|
||||
}
|
||||
|
||||
// Melee Damage
|
||||
$melee = $this->subject->getBaseStats('melee');
|
||||
if ($_ = $this->subject->getField('dmgSchool')) // magic damage
|
||||
@@ -281,6 +302,22 @@ class NpcPage extends GenericPage
|
||||
$armor = $_altNPCs->getBaseStats('armor');
|
||||
$modes['armor'][] = sprintf($modeRow, $m, $armor[0] < $armor[1] ? Lang::nf($armor[0]).' - '.Lang::nf($armor[1]) : Lang::nf($armor[0]));
|
||||
|
||||
// Resistances
|
||||
$tmpRes = '';
|
||||
foreach ($_altNPCs->getBaseStats('resistance') as $sc => $amt)
|
||||
$tmpRes .= '[td]'.$amt.'[/td]';
|
||||
|
||||
if ($tmpRes)
|
||||
{
|
||||
if (!isset($modes['resistance'])) // init table head
|
||||
$modes['resistance'][] = '[td][/td][td][span class="moneyschoolhol"] [/span][/td][td][span class="moneyschoolfir"] [/span][/td][td][span class="moneyschoolnat"] [/span][/td][td][span class="moneyschoolfro"] [/span][/td][td][span class="moneyschoolsha"] [/span][/td][td][span class="moneyschoolarc"][/span][/td]';
|
||||
|
||||
if (!$stats['resistance']) // base creature has no resistance. -> display list item.
|
||||
$stats['resistance'] = Lang::npc('resistances').Lang::main('colon').'…';
|
||||
|
||||
$modes['resistance'][] = '[td]'.$m.' [/td]'.$tmpRes;
|
||||
}
|
||||
|
||||
// Melee Damage
|
||||
$melee = $_altNPCs->getBaseStats('melee');
|
||||
if ($_ = $_altNPCs->getField('dmgSchool')) // magic damage
|
||||
|
||||
Reference in New Issue
Block a user