mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Items/Block
* fixed formating of xml-export * fixed handling of block value (can have multiple sources per item (itemMods, spell, set individually) and is then displayed separately in tooltip, but summed for calculations)
This commit is contained in:
@@ -23,7 +23,7 @@ class ItemList extends BaseType
|
|||||||
private $vendors = [];
|
private $vendors = [];
|
||||||
private $jsGlobals = []; // getExtendedCost creates some and has no access to template
|
private $jsGlobals = []; // getExtendedCost creates some and has no access to template
|
||||||
|
|
||||||
protected $queryBase = 'SELECT i.*, i.id AS ARRAY_KEY, i.id AS id FROM ?_items i';
|
protected $queryBase = 'SELECT i.*, i.block AS tplBlock, i.id AS ARRAY_KEY, i.id AS id FROM ?_items i';
|
||||||
protected $queryOpts = array( // 3 => TYPE_ITEM
|
protected $queryOpts = array( // 3 => TYPE_ITEM
|
||||||
'i' => [['is', 'src', 'ic'], 'o' => 'i.quality DESC, i.itemLevel DESC'],
|
'i' => [['is', 'src', 'ic'], 'o' => 'i.quality DESC, i.itemLevel DESC'],
|
||||||
'ic' => ['j' => ['?_icons `ic` ON `ic`.`id` = -`i`.`displayId`', true], 's' => ', ic.iconString'],
|
'ic' => ['j' => ['?_icons `ic` ON `ic`.`id` = -`i`.`displayId`', true], 's' => ', ic.iconString'],
|
||||||
@@ -642,9 +642,9 @@ class ItemList extends BaseType
|
|||||||
else if (($this->curTpl['armor'] + $this->curTpl['armorDamageModifier']) > 0)
|
else if (($this->curTpl['armor'] + $this->curTpl['armorDamageModifier']) > 0)
|
||||||
$x .= '<span><!--amr-->'.sprintf(Lang::item('armor'), intVal($this->curTpl['armor'] + $this->curTpl['armorDamageModifier'])).'</span><br />';
|
$x .= '<span><!--amr-->'.sprintf(Lang::item('armor'), intVal($this->curTpl['armor'] + $this->curTpl['armorDamageModifier'])).'</span><br />';
|
||||||
|
|
||||||
// Block
|
// Block (note: block value from field block and from field stats or parsed from itemSpells are displayed independently)
|
||||||
if ($this->curTpl['block'])
|
if ($this->curTpl['tplBlock'])
|
||||||
$x .= '<span>'.sprintf(Lang::item('block'), $this->curTpl['block']).'</span><br />';
|
$x .= '<span>'.sprintf(Lang::item('block'), $this->curTpl['tplBlock']).'</span><br />';
|
||||||
|
|
||||||
// Item is a gem (don't mix with sockets)
|
// Item is a gem (don't mix with sockets)
|
||||||
if ($geId = $this->curTpl['gemEnchantmentId'])
|
if ($geId = $this->curTpl['gemEnchantmentId'])
|
||||||
|
|||||||
@@ -1054,8 +1054,8 @@ class ItemPage extends genericPage
|
|||||||
$this->subject->extendJsonStats();
|
$this->subject->extendJsonStats();
|
||||||
|
|
||||||
// json
|
// json
|
||||||
$fields = ["classs", "displayid", "dps", "id", "level", "name", "reqlevel", "slot", "slotbak", "source", "sourcemore", "speed", "subclass"];
|
$fields = ['classs', 'displayid', 'dps', 'id', 'level', 'name', 'reqlevel', 'slot', 'slotbak', 'source', 'sourcemore', 'speed', 'subclass'];
|
||||||
$json = '';
|
$json = [];
|
||||||
foreach ($fields as $f)
|
foreach ($fields as $f)
|
||||||
{
|
{
|
||||||
if (isset($this->subject->json[$this->subject->id][$f]))
|
if (isset($this->subject->json[$this->subject->id][$f]))
|
||||||
@@ -1064,33 +1064,33 @@ class ItemPage extends genericPage
|
|||||||
if ($f == 'name')
|
if ($f == 'name')
|
||||||
$_ = (7 - $this->subject->getField('quality')).$_;
|
$_ = (7 - $this->subject->getField('quality')).$_;
|
||||||
|
|
||||||
$json .= ',"'.$f.'":'.$_;
|
$json[$f] = $_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$xml->addChild('json')->addCData(substr($json, 1));
|
$xml->addChild('json')->addCData(substr(json_encode($json), 1, -1));
|
||||||
|
|
||||||
// jsonEquip missing: avgbuyout, cooldown, source, sourcemore
|
// jsonEquip missing: avgbuyout, cooldown, source, sourcemore
|
||||||
$json = '';
|
$json = [];
|
||||||
if ($_ = $this->subject->getField('sellPrice')) // sellprice
|
if ($_ = $this->subject->getField('sellPrice')) // sellprice
|
||||||
$json .= ',"sellprice":'.$_;
|
$json['sellprice'] = $_;
|
||||||
|
|
||||||
if ($_ = $this->subject->getField('requiredLevel')) // reqlevel
|
if ($_ = $this->subject->getField('requiredLevel')) // reqlevel
|
||||||
$json .= ',"reqlevel":'.$_;
|
$json['reqlevel'] = $_;
|
||||||
|
|
||||||
if ($_ = $this->subject->getField('requiredSkill')) // reqskill
|
if ($_ = $this->subject->getField('requiredSkill')) // reqskill
|
||||||
$json .= ',"reqskill":'.$_;
|
$json['reqskill'] = $_;
|
||||||
|
|
||||||
if ($_ = $this->subject->getField('requiredSkillRank')) // reqskillrank
|
if ($_ = $this->subject->getField('requiredSkillRank')) // reqskillrank
|
||||||
$json .= ',"reqskillrank":'.$_;
|
$json['reqskillrank'] = $_;
|
||||||
|
|
||||||
foreach ($this->subject->itemMods[$this->subject->id] as $mod => $qty)
|
foreach ($this->subject->itemMods[$this->subject->id] as $mod => $qty)
|
||||||
$json .= ',"'.$mod.'":'.$qty;
|
$json[$mod] = $qty;
|
||||||
|
|
||||||
foreach ($_ = $this->subject->json[$this->subject->id] as $name => $qty)
|
foreach ($this->subject->json[$this->subject->id] as $name => $qty)
|
||||||
if (in_array($name, Util::$itemFilter))
|
if (in_array($name, Util::$itemFilter))
|
||||||
$json .= ',"'.$name.'":'.$qty;
|
$json[$name] = $qty;
|
||||||
|
|
||||||
$xml->addChild('jsonEquip')->addCData(substr($json, 1));
|
$xml->addChild('jsonEquip')->addCData(substr(json_encode($json), 1, -1));
|
||||||
|
|
||||||
// jsonUse
|
// jsonUse
|
||||||
if ($onUse = $this->subject->getOnUseStats())
|
if ($onUse = $this->subject->getOnUseStats())
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ class ItemStatSetup extends ItemList
|
|||||||
{
|
{
|
||||||
$this->itemMods[$this->id] = [];
|
$this->itemMods[$this->id] = [];
|
||||||
|
|
||||||
|
// also occurs as seperate field (gets summed in calculation but not in tooltip)
|
||||||
|
if ($_ = $this->getField('block'))
|
||||||
|
$this->itemMods[$this->id][ITEM_MOD_BLOCK_VALUE] = $_;
|
||||||
|
|
||||||
// convert itemMods to stats
|
// convert itemMods to stats
|
||||||
for ($h = 1; $h <= 10; $h++)
|
for ($h = 1; $h <= 10; $h++)
|
||||||
{
|
{
|
||||||
|
|||||||
1
setup/updates/1452718627_01.sql
Normal file
1
setup/updates/1452718627_01.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
UPDATE `aowow_dbversion` SET `sql` = CONCAT(`sql`, ' item_stats');
|
||||||
Reference in New Issue
Block a user