diff --git a/includes/shared.php b/includes/shared.php
index a3eba74e..f71f7d8f 100644
--- a/includes/shared.php
+++ b/includes/shared.php
@@ -1,6 +1,6 @@
selectCol('SELECT perfectItemType FROM skill_perfect_item_template WHERE spellId IN (?a)', $this->getFoundIDs());
foreach ($this->iterate() as &$_curTpl)
{
// required for globals
diff --git a/pages/item.php b/pages/item.php
index 4c1f142a..9369bb18 100644
--- a/pages/item.php
+++ b/pages/item.php
@@ -422,6 +422,34 @@ class ItemPage extends genericPage
/* Extra Tabs */
/**************/
+ // tab: createdBy (perfect item specific)
+ if ($perfItem = DB::World()->select('SELECT *, spellId AS ARRAY_KEY FROM skill_perfect_item_template WHERE perfectItemType = ?d', $this->typeId))
+ {
+ $perfSpells = new SpellList(array(['id', array_column($perfItem, 'spellId')]));
+ if (!$perfSpells->error)
+ {
+ $lvData = $perfSpells->getListviewData();
+ $this->extendGlobalData($perfSpells->getJSGlobals(GLOBALINFO_RELATED));
+
+ foreach ($lvData as $sId => &$data)
+ {
+ $data['percent'] = $perfItem[$sId]['perfectCreateChance'];
+ $data['condition'][0][$this->typeId] = [[[CND_SPELL, $perfItem[$sId]['requiredSpecialization']]]];
+ $this->extendGlobalIDs(TYPE_SPELL, $perfItem[$sId]['requiredSpecialization']);
+ }
+
+ $this->lvTabs[] = array(
+ 'file' => 'spell',
+ 'data' => $lvData,
+ 'params' => [
+ 'name' => '$LANG.tab_createdby',
+ 'id' => 'created-by', // should by exclusive with created-by from spell_loot
+ 'extraCols' => '$[Listview.extraCols.percent, Listview.extraCols.condition]'
+ ]
+ );
+ }
+ }
+
// tabs: this item is contained in..
$lootTabs = new Loot();
$createdBy = [];
diff --git a/pages/spell.php b/pages/spell.php
index 8e0d16dd..af7c182e 100644
--- a/pages/spell.php
+++ b/pages/spell.php
@@ -1546,6 +1546,7 @@ class SpellPage extends GenericPage
$effects = [];
$spellIdx = array_unique(array_merge($this->subject->canTriggerSpell(), $this->subject->canTeachSpell()));
$itemIdx = $this->subject->canCreateItem();
+ $perfItem = DB::World()->selectRow('SELECT * FROM skill_perfect_item_template WHERE spellId = ?d', $this->typeId);
// Iterate through all effects:
for ($i = 1; $i < 4; $i++)
@@ -1582,6 +1583,24 @@ class SpellPage extends GenericPage
break;
}
+ // perfect Items
+ if ($perfItem && $this->subject->relItems->getEntry($perfItem['perfectItemType']))
+ {
+ $cndSpell = new SpellList(array(['id', $perfItem['requiredSpecialization']]));
+ if (!$cndSpell->error)
+ {
+ $foo['perfItem'] = array(
+ 'icon' => $cndSpell->getField('iconString'),
+ 'quality' => $this->subject->relItems->getField('quality'),
+ 'cndSpellId' => $perfItem['requiredSpecialization'],
+ 'cndSpellName' => $cndSpell->getField('name', true),
+ 'chance' => $perfItem['perfectCreateChance'],
+ 'itemId' => $perfItem['perfectItemType'],
+ 'itemName' => $this->subject->relItems->getField('name', true)
+ );
+ }
+ }
+
if ($effDS > 1)
$foo['icon']['count'] = "'".($effBP + 1).'-'.$foo['icon']['count']."'";
}
diff --git a/template/pages/spell.tpl.php b/template/pages/spell.tpl.php
index 6a7b73eb..a93f76cc 100644
--- a/template/pages/spell.tpl.php
+++ b/template/pages/spell.tpl.php
@@ -16,7 +16,7 @@
brick('redButtons'); ?>
-
name; ?>
+ =$this->name; ?>
brick('tooltip');
@@ -35,7 +35,7 @@ if ($this->reagents[1]):
echo " \n";
endif;
?>
-
+
=Lang::spell('tools'); ?>
tools as $i => $t):
@@ -69,7 +69,7 @@ if (!empty($this->transfer)):
endif;
?>
-
+ =Lang::spell('_spellDetails'); ?>
@@ -85,54 +85,54 @@ endif;
|
- |
- duration) ? $this->duration : ''.Lang::main('n_a').''; ?> |
+ =Lang::game('duration');?> |
+ =(!empty($this->duration) ? $this->duration : ''.Lang::main('n_a').'');?> |
- |
- school[1]) ? (User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, $this->school[0], $this->school[1]) : $this->school[1]) : ''.Lang::main('n_a').''; ?> |
+ =Lang::game('school'); ?> |
+ =(!empty($this->school[1]) ? (User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, $this->school[0], $this->school[1]) : $this->school[1]) : ''.Lang::main('n_a').'');?> |
- |
- mechanic) ? $this->mechanic : ''.Lang::main('n_a').''; ?> |
+ =Lang::game('mechanic');?> |
+ =(!empty($this->mechanic) ? $this->mechanic : ''.Lang::main('n_a').'');?> |
- |
- dispel) ? $this->dispel : ''.Lang::main('n_a').''; ?> |
+ =Lang::game('dispelType');?> |
+ =(!empty($this->dispel) ? $this->dispel : ''.Lang::main('n_a').'');?> |
- |
- gcdCat) ? $this->gcdCat : ''.Lang::main('n_a').''; ?> |
+ =Lang::spell('_gcdCategory');?> |
+ =(!empty($this->gcdCat) ? $this->gcdCat : ''.Lang::main('n_a').'');?> |
- |
- powerCost) ? $this->powerCost : Lang::spell('_none'); ?> |
+ =Lang::spell('_cost');?> |
+ =(!empty($this->powerCost) ? $this->powerCost : Lang::spell('_none'));?> |
- |
- range.' '.Lang::spell('_distUnit').' ('.$this->rangeName; ?>) |
+ =Lang::spell('_range');?> |
+ =$this->range.' '.Lang::spell('_distUnit').' ('.$this->rangeName;?>) |
- |
- castTime; ?> |
+ =Lang::spell('_castTime');?> |
+ =$this->castTime;?> |
- |
- cooldown) ? $this->cooldown : ''.Lang::main('n_a').''; ?> |
+ =Lang::spell('_cooldown');?> |
+ =(!empty($this->cooldown) ? $this->cooldown : ''.Lang::main('n_a').'');?> |
- | '.Lang::spell('_gcd'); ?> |
- gcd; ?> |
+ '.Lang::spell('_gcd');?> |
+ =$this->gcd;?> |
scaling), [[-1, -1, 0, 0], [0, 0, 0, 0]])):
?>
- |
+ =Lang::spell('_scaling');?> |
stances)):
?>
|
- |
- stances; ?> |
+ =Lang::spell('_forms');?> |
+ =$this->stances;?> |
items)):
?>
- |
- items[0]), $this->items[1]) : $this->items[1]; ?> |
+ =Lang::game('requires2');?> |
+ =(User::isInGroup(U_GROUP_STAFF) ? sprintf(Util::$dfnString, implode(' | ', $this->items[0]), $this->items[1]) : $this->items[1]);?> |
effects as $i => $e):
?>
- |
+ =Lang::spell('_effect').' #'.($i + 1);?> |
' .
@@ -200,7 +201,7 @@ foreach ($this->effects as $i => $e):
?>
+
+
+ =$e['perfItem']['cndSpellName'];?>=Lang::main('colon').' '.$e['perfItem']['chance'].'%';?>
+
+
+
@@ -224,7 +238,7 @@ endforeach;
?>
|
-
+
=Lang::main('related');?>