1
This commit is contained in:
parent
6b0187869b
commit
8f22573e97
@ -221,10 +221,30 @@ class Hero extends BaseModel {
|
||||
public static function toDto($row)
|
||||
{
|
||||
$attr = emptyReplace(json_decode($row['rand_attr'], true), array());
|
||||
// if (!$attr){
|
||||
// $heroMeta = mt\Hero::get($row['hero_id']);
|
||||
// $attr = mt\Hero::getHeroAttr($heroMeta);
|
||||
// }
|
||||
if (!$attr){
|
||||
$heroMeta = mt\Hero::get($row['hero_id']);
|
||||
$baseAttr = mt\Hero::getHeroAttr($heroMeta);
|
||||
foreach ($baseAttr as $value){
|
||||
if (in_array($value['attr_id'],array(kHAT_Hp,kHAT_Atk,kHAT_Def))){
|
||||
array_push($attr,array(
|
||||
'attr_id' => $value['attr_id'],
|
||||
'val' => $value['val'] ,
|
||||
'quality' => rand(2,3),
|
||||
)
|
||||
);
|
||||
}else{
|
||||
array_push($attr,array(
|
||||
'attr_id' => $value['attr_id'],
|
||||
'val' => $value['val'] ,
|
||||
'quality' => 0,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
self::update($row['idx'],array(
|
||||
'rand_attr'=>json_encode($attr)
|
||||
));
|
||||
}
|
||||
|
||||
// $lockType = 0;
|
||||
// $unlockTime = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user