宝箱开启公式修改
This commit is contained in:
parent
6a8d0d5806
commit
c3ce8b3602
@ -395,25 +395,17 @@ class BagController extends BaseAuthedController {
|
||||
// $lucky = Hero::getAccountLucky(myself()->_getAddress());
|
||||
$lucky = Hero::getAccountLuckyTemp();
|
||||
$luckyParam = \mt\Parameter::getVal('economy_account_luck_K',0);
|
||||
$luckyMaxPro = \mt\Parameter::getVal('economy_account_luck_E',0);
|
||||
$prob = $luckyMaxPro * ($lucky / ($lucky+$luckyParam));
|
||||
|
||||
$rangeArr = explode("|",\mt\Parameter::getVal('economy_account_luck_range',0));
|
||||
$rate = ($rangeArr[1]-$rangeArr[0]) * $lucky/($lucky+$luckyParam) + $rangeArr[0];
|
||||
$rnd = rand() / (mt_getrandmax() + 1);
|
||||
$items = array();
|
||||
for ($i=0;$i<$itemNum;$i++){
|
||||
$times = $this->proEffect($prob,1);
|
||||
if ($rnd <= $rate){
|
||||
$itemsTemp = \services\LootService::dropOutItem($itemMeta['loot']);
|
||||
if ($times > 0){
|
||||
foreach ($itemsTemp as $itemTemp){
|
||||
$itemTemp['item_num'] += $itemTemp['item_num']*$times;
|
||||
array_push($items,$itemTemp);
|
||||
}
|
||||
}else{
|
||||
foreach ($itemsTemp as $itemTemp){
|
||||
array_push($items,$itemTemp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else{
|
||||
$items = array();
|
||||
|
@ -270,21 +270,17 @@ END
|
||||
$lootMeta = mt\LootConfig::find($itemMeta['loot']);
|
||||
if ($lootMeta['isAffected']){
|
||||
$luckyParam = \mt\Parameter::getVal('economy_account_luck_K',0);
|
||||
$luckyMaxPro = \mt\Parameter::getVal('economy_account_luck_E',0);
|
||||
$prob = $luckyMaxPro * ($lucky / ($lucky+$luckyParam));
|
||||
$rangeArr = explode("|",\mt\Parameter::getVal('economy_account_luck_range',0));
|
||||
$rate = ($rangeArr[1]-$rangeArr[0]) * $lucky/($lucky+$luckyParam) + $rangeArr[0];
|
||||
$rnd = rand() / (mt_getrandmax() + 1);
|
||||
for ($i=0; $i<$itemNum; $i++){
|
||||
$times = $this->proEffect($prob,1);
|
||||
$temp = array(
|
||||
"prob" => $prob,
|
||||
"times" => $times
|
||||
);
|
||||
if ($rnd <= $rate){
|
||||
$items = \services\LootService::dropOutItem($itemMeta['loot']);
|
||||
if ($times > 0){
|
||||
foreach ($items as &$item){
|
||||
$item['item_num'] += $item['item_num']*$times;
|
||||
}
|
||||
}
|
||||
array_unshift($items,$temp);
|
||||
array_unshift($items,array(
|
||||
'rnd' => $rnd,
|
||||
'rate' => $rate,
|
||||
));
|
||||
TGLog::writeToLog("game_2006_api","loot",array(
|
||||
$itemId => $items
|
||||
));
|
||||
|
Loading…
x
Reference in New Issue
Block a user