...
This commit is contained in:
parent
32ed4e9b0d
commit
ce7e060eb3
@ -1794,11 +1794,31 @@ class ShopController extends BaseAuthedController
|
||||
return $costItems;
|
||||
}
|
||||
|
||||
private function internalAddItem($propertyChgService, $itemMeta, $count, $sysAdd)
|
||||
private function internalAddItem($propertyChgService, $itemMeta, $count, $sysAdd, $grade)
|
||||
{
|
||||
switch ($itemMeta['type']) {
|
||||
case mt\Item::HERO_TYPE: {
|
||||
Hero::addHero($itemMeta);
|
||||
if (empty($grade)) {
|
||||
$grade = 0;
|
||||
}
|
||||
switch($grade) {
|
||||
case 1: {
|
||||
Hero::addHero1($itemMeta);
|
||||
}
|
||||
break;
|
||||
case 2: {
|
||||
Hero::addHero2($itemMeta);
|
||||
}
|
||||
break;
|
||||
case 3: {
|
||||
Hero::addHero3($itemMeta);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
Hero::addHero($itemMeta);
|
||||
}
|
||||
break;
|
||||
}
|
||||
$propertyChgService->addHeroChg();
|
||||
$propertyChgService->addUserChg();
|
||||
}
|
||||
@ -2164,6 +2184,7 @@ class ShopController extends BaseAuthedController
|
||||
}
|
||||
|
||||
$itemStore = mt\ShopChest::getRandomItemListByChestType($meta['sub_type']);
|
||||
$grade = $meta['sub_type'];
|
||||
$result = array();
|
||||
for ($i = 0; $i < $num; $i++) {
|
||||
$record = array();
|
||||
@ -2176,10 +2197,10 @@ class ShopController extends BaseAuthedController
|
||||
}
|
||||
$propertyChgService = new services\PropertyChgService();
|
||||
if ($item['item_type'] == 2) {
|
||||
$this->internalAddItem($propertyChgService, $itemMeta, $item['num'], 1);
|
||||
$this->internalAddItem($propertyChgService, $itemMeta, $item['num'], 1, $grade);
|
||||
} else {
|
||||
for ($j = 0; $j < $item['num']; $j++) {
|
||||
$this->internalAddItem($propertyChgService, $itemMeta, 1, 1);
|
||||
$this->internalAddItem($propertyChgService, $itemMeta, 1, 1, $grade);
|
||||
}
|
||||
}
|
||||
$record[$key] = array("item_id" => $item['item_id'], "item_num" => $item['num']);
|
||||
|
Loading…
x
Reference in New Issue
Block a user