Spells/DetailPage

* display proc info for dummy auras
This commit is contained in:
Sarjuuk
2023-10-07 18:09:26 +02:00
parent a73d71b966
commit deba5325a7
2 changed files with 23 additions and 19 deletions

View File

@@ -878,7 +878,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.'Id'] == 155 && $this->curTpl['effect'.$i.'MiscValue'] > 0))
if ($this->curTpl['effect'.$i.'AuraId'] == 4 || $this->curTpl['effect'.$i.'TriggerSpell'] > 0 || ($this->curTpl['effect'.$i.'Id'] == 155 && $this->curTpl['effect'.$i.'MiscValue'] > 0))
$idx[] = $i;
return $idx;

View File

@@ -1557,9 +1557,15 @@ class SpellPage extends GenericPage
private function createEffects(&$infobox, &$redButtons)
{
// proc data .. maybe use more information..?
$procData = DB::World()->selectRow('SELECT IF(ProcsPerMinute > 0, -ProcsPerMinute, Chance) AS chance, Cooldown AS cooldown FROM spell_proc WHERE ABS(SpellId) = ?d', $this->firstRank);
if (!isset($procData['cooldown']))
$procData['cooldown'] = 0;
$procData = array(
'chance' => $this->subject->getField('procChance'),
'cooldown' => 0
);
if ($procCustom = DB::World()->selectRow('SELECT IF(ProcsPerMinute > 0, -ProcsPerMinute, Chance) AS chance, Cooldown AS cooldown FROM spell_proc WHERE ABS(SpellId) = ?d', $this->firstRank))
foreach ($procCustom as $k => $v)
if ($v)
$procData[$k] = $v;
$effects = [];
$spellIdx = array_unique(array_merge($this->subject->canTriggerSpell(), $this->subject->canTeachSpell()));
@@ -1635,19 +1641,22 @@ class SpellPage extends GenericPage
else if (in_array($i, $spellIdx) || in_array($effId, [133, 140, 141]))
{
if ($effId == 155)
$_ = $effMV;
$triggeredSpell = $effMV;
else
$_ = $this->subject->getField('effect'.$i.'TriggerSpell');
$triggeredSpell = $this->subject->getField('effect'.$i.'TriggerSpell');
$trig = new SpellList(array(['s.id', (int)$_]));
if ($triggeredSpell > 0) // Dummy Auras are probably scripted
{
$trig = new SpellList(array(['s.id', (int)$triggeredSpell]));
$foo['icon'] = array(
'id' => $_,
'name' => $trig->error ? Util::ucFirst(Lang::game('spell')).' #'.$_ : $trig->getField('name', true),
'count' => 0
);
$foo['icon'] = array(
'id' => $triggeredSpell,
'name' => $trig->error ? Util::ucFirst(Lang::game('spell')).' #'.$triggeredSpell : $trig->getField('name', true),
'count' => 0
);
$this->extendGlobalData($trig->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
$this->extendGlobalData($trig->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
}
}
// Effect Name
@@ -1670,16 +1679,11 @@ class SpellPage extends GenericPage
if ($_ = $this->subject->getField('effect'.$i.'Mechanic'))
$foo['mechanic'] = Lang::game('me', $_);
if (in_array($i, $this->subject->canTriggerSpell()) && !empty($procData['chance']))
if (in_array($i, $this->subject->canTriggerSpell()) && $procData['chance'])
$foo['procData'] = array(
$procData['chance'],
$procData['cooldown'] ? Util::formatTime($procData['cooldown'], true) : null
);
else if (in_array($i, $this->subject->canTriggerSpell()) && $this->subject->getField('procChance'))
$foo['procData'] = array(
$this->subject->getField('procChance'),
$procData['cooldown'] ? Util::formatTime($procData['cooldown'], true) : null
);
// parse masks and indizes
switch ($effId)