cyzhao пре 9 месеци
родитељ
комит
32e4a58507

+ 2 - 0
Gameserver/App/model/User/Enum_StoreSourceType.php

@@ -16,5 +16,7 @@ namespace loyalsoft;
 class Enum_StoreSourceType extends Enum{
     
     const AddExp = 1;//加经验的奖励不统计
+    
+    const ShopBox = 2;//商城宝箱
   
 }

+ 4 - 38
Gameserver/App/process/ShopProc.php

@@ -164,7 +164,7 @@ class ShopProc {
 
                 break;
 
-            case EnumShopGift::GemBox_Shop ://宝石宝箱
+            case EnumShopGift::GemBox_Shop ://宝石宝箱---->2024.8.14 改为可能抽出宝石或是道具
                 $mo = GameConfig::shop_box_getItem($typeId);
                 my_Assert($mo != null, ErrCode::err_const_no);
                 
@@ -234,7 +234,7 @@ class ShopProc {
                     }
 
                     $bichu1 = explode(',', $mo->bichu1);
-                    $qual = 0;
+                    $qual = 0;//改成道具盒子了 但是这个变量不动了
                     if ($buyCount % $bichu1[0] == 0) {
                         $qual = $bichu1[1];
                     }
@@ -254,48 +254,14 @@ class ShopProc {
                             $end += $str[1] * 10;
                             if ($randNum > $start && $randNum <= $end) {
                                 $qual = $str[0];
-//                                if ($qual == 4) {//自己加的控制概率的代码 多个出的紫色宝石 降低概率
-//                                    $descRand = mt_rand(1, 100);
-//                                    if ($descRand > 40 && $descRand <= 100) {
-//                                        $qual = 3;
-//                                    }
-//                                }
-//                                if ($qual == 5) {//自己加的控制概率的代码 多个出的金色宝石 降低概率
-//                                    $descRand = mt_rand(1, 100);
-//                                    if ($descRand > 40 && $descRand <= 100) {
-//                                        $qual = 4;
-//                                    }
-//                                }
-//                                if ($qual == 6) {//自己加的控制概率的代码 多个出的金色宝石 降低概率
-//                                    $descRand = mt_rand(1, 100);
-//                                    if ($descRand > 8 && $descRand <= 100) {
-//                                        $qual = 4;
-//                                    }
-//                                }
                                 break;
                             }
                             $start = $end;
                         }
                     }
 
-                    if ($qual > 0) {
-                        $gemDic = GameConfig::gem();
-                        $gemList = array();
-                        foreach ($gemDic as $key => $value) {
-                            if ($value->qual == $qual && $value->isfixed_predicateId == 0) {
-                                $gemList[] = $value;
-                            }
-                        }
-
-                        $n = rand(0, count($gemList) - 1);
-                        $gem = StoreProc::initGem($gemList[$n]->typeId);
-
-                        if ($mo->type == 2) {
-                            SystemProc::GetGem_GreaterOrangeQual_ShopBox(req()->zoneid, ctx()->baseInfo->name, $gemList[$n]->typeId);
-                        }
-
-                        $resultArr[] = $gem->uid;
-                        StoreProc::PutGemInStore($gem);
+                    if ($qual > 0) {                                              
+                        StoreProc::AddMultiItemInStore($qual, Enum_StoreSourceType::ShopBox);
                     }
                 }
 

+ 4 - 1
Gameserver/App/process/StoreProc.php

@@ -799,7 +799,10 @@ class StoreProc {
                         if($src != 1){
                             self::$reward_Gem[] = $gem->uid;    
                         }                                                               
-                        self::PutGemInStore($gem);
+                        self::PutGemInStore($gem);                      
+                        if ($src == Enum_StoreSourceType::ShopBox) {
+                            SystemProc::GetGem_GreaterOrangeQual_ShopBox(req()->zoneid, ctx()->baseInfo->name, $gem->typeId);
+                        }                        
                     }
                                                          
                     break;