1
This commit is contained in:
parent
c3a9e20061
commit
a4111eabc9
@ -221,9 +221,24 @@ class HeroController extends BaseAuthedController {
|
|||||||
$propertyChgService->addBagChg();
|
$propertyChgService->addBagChg();
|
||||||
$propertyChgService->addUserChg();
|
$propertyChgService->addUserChg();
|
||||||
$currQualityMeta = mt\HeroQuality::getByQuality($heroDb['quality']);
|
$currQualityMeta = mt\HeroQuality::getByQuality($heroDb['quality']);
|
||||||
|
$nextQualityMeta = null;
|
||||||
if ($currQualityMeta) {
|
if ($currQualityMeta) {
|
||||||
$nextQualityMeta = mt\HeroQuality::getByQuality($heroDb['quality'] + 1);
|
$nextQualityMeta = mt\HeroQuality::getByQuality($heroDb['quality'] + 1);
|
||||||
if ($nextQualityMeta) {
|
if ($nextQualityMeta) {
|
||||||
|
$rnd = rand(1, 100);
|
||||||
|
if ($rand > $nextQualityMeta['success_rate']) {
|
||||||
|
Hero::update($heroUniId,
|
||||||
|
array(
|
||||||
|
'advanced_count' => $heroDb['advanced_count'] + 1,
|
||||||
|
'lock_type' => 0,
|
||||||
|
'unlock_time' => 0,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$this->_rspData(array(
|
||||||
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
|
));
|
||||||
|
return;
|
||||||
|
}
|
||||||
Hero::update($heroUniId,
|
Hero::update($heroUniId,
|
||||||
array(
|
array(
|
||||||
'quality' => $heroDb['quality'] + 1,
|
'quality' => $heroDb['quality'] + 1,
|
||||||
@ -237,6 +252,10 @@ class HeroController extends BaseAuthedController {
|
|||||||
$rankActivityService->heroUpgradeLevel($heroDb['quality'] + 1);
|
$rankActivityService->heroUpgradeLevel($heroDb['quality'] + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!$nextQualityMeta) {
|
||||||
|
$this->_rspErr(1, 'quality is full');
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'property_chg' => $propertyChgService->toDto(),
|
'property_chg' => $propertyChgService->toDto(),
|
||||||
'old_hero' => $oldHero,
|
'old_hero' => $oldHero,
|
||||||
@ -342,7 +361,7 @@ class HeroController extends BaseAuthedController {
|
|||||||
array(
|
array(
|
||||||
'hero_lv' => $heroDb['hero_lv'] + 1,
|
'hero_lv' => $heroDb['hero_lv'] + 1,
|
||||||
'lock_type' => Hero::LEVEL_LOCK,
|
'lock_type' => Hero::LEVEL_LOCK,
|
||||||
'unlock_time' => $this->_getNowTime() + $currLevelMeta['time'],
|
'unlock_time' => $this->_getNowTime() + $nextLevelMeta['time'],
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -452,7 +471,7 @@ class HeroController extends BaseAuthedController {
|
|||||||
array(
|
array(
|
||||||
'hero_lv' => $heroDb['hero_lv'],
|
'hero_lv' => $heroDb['hero_lv'],
|
||||||
'lock_type' => Hero::QUALITY_LOCK,
|
'lock_type' => Hero::QUALITY_LOCK,
|
||||||
'unlock_time' => $this->_getNowTime() + $currQualityMeta['time'],
|
'unlock_time' => $this->_getNowTime() + $nextQualityMeta['time'],
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$this->_setV(TN_HERO_QUALITY_UP, (int)$slotId, (int)$heroDb['idx']);
|
$this->_setV(TN_HERO_QUALITY_UP, (int)$slotId, (int)$heroDb['idx']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user