mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Spells/DetailPage
* display proc info for dummy auras
This commit is contained in:
@@ -878,7 +878,7 @@ class SpellList extends BaseType
|
|||||||
$idx = [];
|
$idx = [];
|
||||||
for ($i = 1; $i < 4; $i++)
|
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 (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;
|
$idx[] = $i;
|
||||||
|
|
||||||
return $idx;
|
return $idx;
|
||||||
|
|||||||
@@ -1557,9 +1557,15 @@ class SpellPage extends GenericPage
|
|||||||
private function createEffects(&$infobox, &$redButtons)
|
private function createEffects(&$infobox, &$redButtons)
|
||||||
{
|
{
|
||||||
// proc data .. maybe use more information..?
|
// 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);
|
$procData = array(
|
||||||
if (!isset($procData['cooldown']))
|
'chance' => $this->subject->getField('procChance'),
|
||||||
$procData['cooldown'] = 0;
|
'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 = [];
|
$effects = [];
|
||||||
$spellIdx = array_unique(array_merge($this->subject->canTriggerSpell(), $this->subject->canTeachSpell()));
|
$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]))
|
else if (in_array($i, $spellIdx) || in_array($effId, [133, 140, 141]))
|
||||||
{
|
{
|
||||||
if ($effId == 155)
|
if ($effId == 155)
|
||||||
$_ = $effMV;
|
$triggeredSpell = $effMV;
|
||||||
else
|
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(
|
$foo['icon'] = array(
|
||||||
'id' => $_,
|
'id' => $triggeredSpell,
|
||||||
'name' => $trig->error ? Util::ucFirst(Lang::game('spell')).' #'.$_ : $trig->getField('name', true),
|
'name' => $trig->error ? Util::ucFirst(Lang::game('spell')).' #'.$triggeredSpell : $trig->getField('name', true),
|
||||||
'count' => 0
|
'count' => 0
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->extendGlobalData($trig->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
$this->extendGlobalData($trig->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Effect Name
|
// Effect Name
|
||||||
@@ -1670,16 +1679,11 @@ class SpellPage extends GenericPage
|
|||||||
if ($_ = $this->subject->getField('effect'.$i.'Mechanic'))
|
if ($_ = $this->subject->getField('effect'.$i.'Mechanic'))
|
||||||
$foo['mechanic'] = Lang::game('me', $_);
|
$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(
|
$foo['procData'] = array(
|
||||||
$procData['chance'],
|
$procData['chance'],
|
||||||
$procData['cooldown'] ? Util::formatTime($procData['cooldown'], true) : null
|
$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
|
// parse masks and indizes
|
||||||
switch ($effId)
|
switch ($effId)
|
||||||
|
|||||||
Reference in New Issue
Block a user