1
This commit is contained in:
parent
b6546f76d8
commit
00b4310f06
@ -5,6 +5,7 @@ namespace services;
|
||||
require_once('mt/MarketGoods.php');
|
||||
require_once('mt/MarketBatch.php');
|
||||
require_once('mt/Item.php');
|
||||
require_once('mt/BlindBox.php');
|
||||
require_once('mt/WhiteList.php');
|
||||
require_once('mt/Currency.php');
|
||||
require_once('mt/Hero.php');
|
||||
@ -265,9 +266,26 @@ class MarketService extends BaseService {
|
||||
{
|
||||
if ($itemMeta['type'] == mt\Item::BLIND_BOX_TYPE) {
|
||||
//group1:100|group2:100|group3:100
|
||||
$groups = StrHelper::parseList($meta['param1'], array('|', ':'));
|
||||
foreach ($groups as $group) {
|
||||
|
||||
$groups = StrHelper::parseList($itemMeta['param1'], array('|', ':'));
|
||||
foreach ($groups as $tuple) {
|
||||
$rndVal = rand() % 100;
|
||||
if ($rndVal <= $tuple[1]) {
|
||||
$boxMeta = mt\BlindBox::randItem($itemMeta['id'], $tuple[0]);
|
||||
if ($boxMeta) {
|
||||
$nftMeta = mt\Item::get($boxMeta['item_id']);
|
||||
if ($nftMeta) {
|
||||
$tokenType = Nft::getTokenType($nftMeta);
|
||||
if ($tokenType != Nft::NONE_TYPE) {
|
||||
$need = (empty($items) || $tuple[1] >= 100) ? 1 : 0;
|
||||
array_push($items, array(
|
||||
'need' => $need,
|
||||
'item_id' => $nftMeta['id'],
|
||||
'token_type' => $tokenType,
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$tokenType = Nft::getTokenType($itemMeta);
|
||||
|
Loading…
x
Reference in New Issue
Block a user