48 lines
919 B
PHP
48 lines
919 B
PHP
<?php
|
|
|
|
namespace mt;
|
|
|
|
use phpcommon;
|
|
|
|
class Item {
|
|
|
|
const SKIN_TYPE = 12;
|
|
|
|
public static function get($id)
|
|
{
|
|
return getXVal(self::getMetaList(), $id, null);
|
|
}
|
|
|
|
public static function isType($meta, $type)
|
|
{
|
|
return $meta['type'] == $type;
|
|
}
|
|
|
|
public static function getOldItem($id)
|
|
{
|
|
$meta = self::get($id);
|
|
if (!$meta) {
|
|
return null;
|
|
}
|
|
$item = array();
|
|
foreach ($meta as $key => $val) {
|
|
$item[$key] = $val;
|
|
}
|
|
$item['type'] = $item['fuction'];
|
|
$item['price'] = $item['gold'];
|
|
$item['dprice'] = $item['diamond_price'];
|
|
return $item;
|
|
}
|
|
|
|
protected static function getMetaList()
|
|
{
|
|
if (!self::$metaList) {
|
|
self::$metaList = getMetaTable('item@item.php');
|
|
}
|
|
return self::$metaList;
|
|
}
|
|
|
|
protected static $metaList;
|
|
|
|
}
|