Selaa lähdekoodia

神庙抽奖程序整理

cyzhao 4 vuotta sitten
vanhempi
commit
b85158b516

+ 1 - 1
Gameserver/Amfphp/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-05-11 17:36:30
+ // 日期: 2021-05-18 09:19:34
 ////////////////////
 
 /**

+ 1 - 1
Gameserver/Amfphp/model/Const/globalsettings.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-05-08 15:42:08
+ // 日期: 2021-05-13 10:00:20
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_drop.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-04-28 11:54:57
+ // 日期: 2021-05-13 14:21:35
 ////////////////////
 
 

+ 2 - 2
Gameserver/Amfphp/model/Const/sm_gate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-04-28 15:54:11
+ // 日期: 2021-05-14 10:38:02
 ////////////////////
 
 
@@ -194,7 +194,7 @@ class sm_gate
     public $passCondition;
 
     /**
-    * @var String 战斗类型(0普通 怪物全部创建 1Boss站 2引导剧情 3竞技场 4非战斗场景)  
+    * @var String 战斗类型(0普通 怪物全部创建 1Boss站 2引导剧情 3竞技场 4非战斗场景 5 材料副本
     */
     public $battleType;
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_hero.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-04-12 15:53:12
+ // 日期: 2021-05-13 14:20:44
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_base.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-05-11 15:51:59
+ // 日期: 2021-05-17 15:45:44
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_weapon.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-04-23 16:23:01
+ // 日期: 2021-05-17 15:45:09
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_plot.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-05-11 16:44:05
+ // 日期: 2021-05-12 10:09:13
 ////////////////////
 
 

+ 3 - 3
Gameserver/Amfphp/model/Const/sm_shenmiao.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-05-11 11:34:22
+ // 日期: 2021-05-12 09:50:20
 ////////////////////
 
 
@@ -88,12 +88,12 @@ class sm_shenmiao
     public $discount;
 
     /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
+    * @var UInt32 用途未知!!请到数据库中添加字段注释。 default(0) 
     */
     public $startTs;
 
     /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
+    * @var UInt32 用途未知!!请到数据库中添加字段注释。 default(0) 
     */
     public $endTs;
 

+ 3 - 3
Gameserver/Amfphp/model/Const/sm_shenmiaoTypeList.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-05-11 11:34:22
+ // 日期: 2021-05-12 09:50:20
 ////////////////////
 
 
@@ -88,12 +88,12 @@ class sm_shenmiaoTypeList
     public $discount;
 
     /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
+    * @var UInt32 用途未知!!请到数据库中添加字段注释。 default(0) 
     */
     public $startTs;
 
     /**
-    * @var Int32 用途未知!!请到数据库中添加字段注释。 default(0) 
+    * @var UInt32 用途未知!!请到数据库中添加字段注释。 default(0) 
     */
     public $endTs;
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_sysmail.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-04-30 10:51:52
+ // 日期: 2021-05-12 18:06:08
 ////////////////////
 
 

+ 56 - 14
Gameserver/Amfphp/process/ActiveProc.php

@@ -233,6 +233,30 @@ class ActiveProc {
         return $list;    
     }
     
+    public static function prizeTypeRand($str) {
+        if(strpos($str,';')){//包含;说明里面奖品类型不同获得的概率不同
+            $sList = explode(';',$str);
+            $dic= new \stdClass();   
+            
+            $rand = rand(1,100);
+            $start = 0; 
+            $end = 0;        
+            foreach ($sList as $val) {
+                $itemList = explode('-', $val); 
+                
+                $end = $itemList[1] + $start;
+                if($rand > $start && $rand <= $end){
+                    $id = self::randList(explode(',', $itemList[0]));                   
+                    break;
+                }           
+                $start = $end;
+            }                                       
+        } else {
+            $id = self::randList(explode(',',$str));
+        } 
+        return $id;
+    }
+    
     /**
      * 抽奖消耗
      */
@@ -268,6 +292,7 @@ class ActiveProc {
         }
         return $type;     
     }
+       
     /**
      * 
      * @param type $arr
@@ -287,14 +312,17 @@ class ActiveProc {
     public static function getActiveRandomItem($type,$mo) {            
         $id = 0;
         switch ($type) {
-            case Enum_ActiveItemType::Sr:         
-                $id = self::randList(explode(',', $mo->srList));                                   
+            case Enum_ActiveItemType::Sr:     
+                $id = self::prizeTypeRand($mo->srList);               
+                //$id = self::randList(explode(',', $mo->srList));                                   
                 break;
             case Enum_ActiveItemType::Ssr:
-                $id = self::randList(explode(',', $mo->ssrList));                           
+                $id = self::prizeTypeRand($mo->ssrList);          
+                //$id = self::randList(explode(',', $mo->ssrList));                           
                 break;
             case Enum_ActiveItemType::Ur:
-                $id = self::randList(explode(',', $mo->urList));                            
+                $id = self::prizeTypeRand($mo->urList);         
+                //$id = self::randList(explode(',', $mo->urList));                            
                 break;
             default:
                 break;
@@ -314,7 +342,8 @@ class ActiveProc {
         $id = 0;
         switch ($type) {
             case Enum_ActiveItemType::Sr:
-                $id = self::randList(explode(',', $mo->srList));                             
+                $id = self::prizeTypeRand($mo->srList);                       
+                //$id = self::randList(explode(',', $mo->srList));                             
                 break;
             case Enum_ActiveItemType::Ssr:
                 if($mo->ssrUp != null){
@@ -343,22 +372,28 @@ class ActiveProc {
                         $shenmiaoInfo->activeDic->$activeType->isUpSsr = 0;
                     } else {
                         $rand = rand(1,10000);      
-                        $start = 0;                                                         
+                        $start = 0;  
+                        $sNum = 0;
+                        $count = StlUtil::count($dic);
                         foreach ($dic as $k=>$val) {
+                            $sNum += 1;
                             $end = $val + $start;
                             if($rand > $start && $rand <= $end){//随机到Up得id
                                 $id = $k;                           
                                 break;
-                            } else {//随机到普通的id
+                            }                  
+                            if($sNum >= $count){ //随机到普通的id         
                                 $shenmiaoInfo->activeDic->$activeType->isUpSsr = 1;
-                                $id = self::randList(explode(',', $mo->ssrList));                           
+                                $id =self::prizeTypeRand($mo->ssrList);
+                                //$id = self::randList(explode(',', $mo->ssrList));                           
                                 break;
-                            }
+                            }                                                                                 
                             $start = $end;
                         }
                     }                                                           
                 } else {
-                    $id = self::randList(explode(',', $mo->ssrList));               
+                    $id =self::prizeTypeRand($mo->ssrList);                    
+                    //$id = self::randList(explode(',', $mo->ssrList));               
                 }                                                             
                 break;
             case Enum_ActiveItemType::Ur:
@@ -388,21 +423,28 @@ class ActiveProc {
                     } else {
                         $rand = rand(1,10000);      
                         $start = 0;
+                        
+                        $sNum = 0;
+                        $count = StlUtil::count($dic);
                         foreach ($dic as $k=>$val) {
+                            $sNum += 1;
                             $end = $val + $start;
                             if($rand > $start && $rand <= $end){
                                 $id = $k;
                                 break;
-                            } else { 
+                            } 
+                            if($sNum >= $count){
                                 $shenmiaoInfo->activeDic->$activeType->isUpUr = 1;
-                                $id = self::randList(explode(',', $mo->urList));         
+                                $id =self::prizeTypeRand($mo->urList);
+                                //$id = self::randList(explode(',', $mo->urList));         
                                 break;
-                            }
+                            }                                                          
                             $start = $end;
                         }
                     }                                                                                               
                 } else {         
-                    $id = self::randList(explode(',', $mo->urList));      
+                    //$id = self::randList(explode(',', $mo->urList));      
+                    $id =self::prizeTypeRand($mo->urList);
                 }                                                                     
                 break;
             default: