Skip to content

Commit

Permalink
Item/DetailPage
Browse files Browse the repository at this point in the history
 * alwaya display item level of gems regardless if cut or not
 * fixed similar item search result for items without class restrictions
  • Loading branch information
Sarjuuk committed Dec 27, 2020
1 parent baf4743 commit 302a0e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pages/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ protected function generateContent()
$_subClass = $this->subject->getField('subClass');
$_bagFamily = $this->subject->getField('bagFamily');
$_model = $this->subject->getField('displayId');
$_ilvl = $this->subject->getField('itemLevel');
$_visSlots = array(
INVTYPE_HEAD, INVTYPE_SHOULDERS, INVTYPE_BODY, INVTYPE_CHEST, INVTYPE_WAIST, INVTYPE_LEGS, INVTYPE_FEET, INVTYPE_WRISTS,
INVTYPE_HANDS, INVTYPE_WEAPON, INVTYPE_SHIELD, INVTYPE_RANGED, INVTYPE_CLOAK, INVTYPE_2HWEAPON, INVTYPE_TABARD, INVTYPE_ROBE,
Expand All @@ -134,8 +135,8 @@ protected function generateContent()
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));

// itemlevel
if (in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON, ITEM_CLASS_AMMUNITION]) || $this->subject->getField('gemEnchantmentId'))
$infobox[] = Lang::game('level').Lang::main('colon').$this->subject->getField('itemLevel');
if ($_ilvl && in_array($_class, [ITEM_CLASS_ARMOR, ITEM_CLASS_WEAPON, ITEM_CLASS_AMMUNITION, ITEM_CLASS_GEM]))
$infobox[] = Lang::game('level').Lang::main('colon').$_ilvl;

// account-wide
if ($_flags & ITEM_FLAG_ACCOUNTBOUND)
Expand Down Expand Up @@ -294,7 +295,7 @@ protected function generateContent()
{
$_ = $this->subject->getField('requiredDisenchantSkill');
if ($_ < 1) // these are some items, that never went live .. extremely rough emulation here
$_ = intVal($this->subject->getField('itemLevel') / 7.5) * 25;
$_ = intVal($_ilvl / 7.5) * 25;

$infobox[] = Lang::item('disenchantable').'&nbsp;([tooltip=tooltip_reqenchanting]'.$_.'[/tooltip])';
}
Expand Down Expand Up @@ -671,10 +672,10 @@ protected function generateContent()
['class', $_class],
['subClass', $_subClass],
['slot', $_slot],
['itemLevel', $this->subject->getField('itemLevel') - 15, '>'],
['itemLevel', $this->subject->getField('itemLevel') + 15, '<'],
['itemLevel', $_ilvl - 15, '>'],
['itemLevel', $_ilvl + 15, '<'],
['quality', $this->subject->getField('quality')],
['requiredClass', $this->subject->getField('requiredClass')]
['requiredClass', $this->subject->getField('requiredClass') ?: -1] // todo: fix db data in setup and not on fetch
]
]
);
Expand All @@ -683,6 +684,7 @@ protected function generateContent()
$conditions[1][] = ['AND', ['slot', $_slot], ['itemset', $_]];

$saItems = new ItemList($conditions);

if (!$saItems->error)
{
$this->extendGlobalData($saItems->getJSGlobals(GLOBALINFO_SELF));
Expand Down

0 comments on commit 302a0e8

Please sign in to comment.