|
@@ -164,9 +164,10 @@ class ShopProc {
|
|
|
$str = explode(',', $value);
|
|
|
$allNum += $str[1];
|
|
|
}
|
|
|
- mt_srand((double)microtime()*1000000);
|
|
|
+
|
|
|
$allNum *= 10;
|
|
|
for ($i = 0; $i < $buyNum; $i++) {
|
|
|
+ mt_srand((double) microtime() * 1000000);
|
|
|
$buyCount = 0;
|
|
|
if ($mo->type == 1) {
|
|
|
$user->privateState->buyNum_ShopBoxCommon += 1;
|
|
@@ -197,6 +198,24 @@ class ShopProc {
|
|
|
$end += $str[1] * 10;
|
|
|
if ($randNum > $start && $randNum <= $end) {
|
|
|
$qual = $str[0];
|
|
|
+ if ($qual == 4) {//自己加的控制概率的代码 多个出的紫色宝石 降低概率
|
|
|
+ $descRand = mt_rand(1, 100);
|
|
|
+ if ($descRand > 20 && $descRand <= 100) {
|
|
|
+ $qual = 3;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($qual == 5) {//自己加的控制概率的代码 多个出的金色宝石 降低概率
|
|
|
+ $descRand = mt_rand(1, 100);
|
|
|
+ if ($descRand > 10 && $descRand <= 100) {
|
|
|
+ $qual = 4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ($qual == 6) {//自己加的控制概率的代码 多个出的金色宝石 降低概率
|
|
|
+ $descRand = mt_rand(1, 100);
|
|
|
+ if ($descRand > 8 && $descRand <= 100) {
|
|
|
+ $qual = 4;
|
|
|
+ }
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
$start = $end;
|
|
@@ -363,20 +382,20 @@ class ShopProc {
|
|
|
StoreProc::AddMultiItemInStore($mo->reward);
|
|
|
|
|
|
break;
|
|
|
-
|
|
|
+
|
|
|
case EnumShopGift::MonthCard_Shop:
|
|
|
$mo = GameConfig::shop_monthcard_getItem($typeId);
|
|
|
my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
-
|
|
|
+
|
|
|
//$user->privateState->monthCardShop_Received[] = $typeId;
|
|
|
- if($typeId == 1){
|
|
|
+ if ($typeId == 1) {
|
|
|
my_Assert($user->privateState->monthCardShop_ts == 0, ErrCode::err_const_no);
|
|
|
$user->privateState->monthCardShop_ts = now();
|
|
|
StoreProc::AddMultiItemInStore($mo->buy_reward);
|
|
|
} else {
|
|
|
my_Assert($user->privateState->honourCardShop_ts == 0, ErrCode::err_const_no);
|
|
|
$user->privateState->honourCardShop_ts = now();
|
|
|
- }
|
|
|
+ }
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -408,33 +427,32 @@ class ShopProc {
|
|
|
ctx()->privateState->junbeiShopNumRecord = new \stdClass();
|
|
|
|
|
|
ctx()->privateState->dailyShop_GuangGaoNum = 0;
|
|
|
- ctx()->privateState->dailyShop_GuangGaoTs = 0;
|
|
|
- self::ShopMonthClear();
|
|
|
+ ctx()->privateState->dailyShop_GuangGaoTs = 0;
|
|
|
+ self::ShopMonthClear();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 月卡按照时间记录的一个月后清理
|
|
|
*/
|
|
|
- public static function ShopMonthClear(){
|
|
|
- $monthTs = 30*24*60*60;
|
|
|
-
|
|
|
- if(ctx()->privateState->monthCardShop_ts > 0){
|
|
|
- if(now() - ctx()->privateState->monthCardShop_ts >= $monthTs){
|
|
|
+ public static function ShopMonthClear() {
|
|
|
+ $monthTs = 30 * 24 * 60 * 60;
|
|
|
+
|
|
|
+ if (ctx()->privateState->monthCardShop_ts > 0) {
|
|
|
+ if (now() - ctx()->privateState->monthCardShop_ts >= $monthTs) {
|
|
|
ctx()->privateState->monthCardShop_ts = 0;
|
|
|
} else {
|
|
|
EmailProc::SendMonthCardRewardMail($zoneid, $uid, $reward);
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
+ }
|
|
|
// if(ctx()->privateState->monthCardShop_ts >0 && now() - ctx()->privateState->monthCardShop_ts >= $monthTs){
|
|
|
// ctx()->privateState->monthCardShop_ts = 0;
|
|
|
// }
|
|
|
-
|
|
|
- if(ctx()->privateState->honourCardShop_ts >0 && now() - ctx()->privateState->honourCardShop_ts >= $monthTs){
|
|
|
+
|
|
|
+ if (ctx()->privateState->honourCardShop_ts > 0 && now() - ctx()->privateState->honourCardShop_ts >= $monthTs) {
|
|
|
ctx()->privateState->honourCardShop_ts = 0;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 每日商城随机6个道具
|
|
|
* @return type
|