Browse Source

装备bug

cyzhao 1 year ago
parent
commit
7993de54f7
2 changed files with 57 additions and 3 deletions
  1. 33 1
      Gameserver/App/configs/GameConfig.php
  2. 24 2
      Gameserver/App/process/StoreProc.php

+ 33 - 1
Gameserver/App/configs/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2023-08-24 16:38:15
+ // 日期: 2023-09-01 10:01:44
 ////////////////////
 
 namespace loyalsoft;
@@ -495,6 +495,38 @@ class GameConfig {
         return self::get_hash_item('evolveSpecific', $itemid);
     }
     /**
+    * 装备: 品阶表
+    * @return \equip_evolve
+    */
+    public static function equip_evolve()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'equip_evolve');
+    }
+    /**
+    * @return \sm_equip_evolve equip_evolve item数据 
+    */
+    public static function equip_evolve_getItem($qual, $posId)
+    { 
+        return self::get_hash_item('equip_evolve', $qual)->$posId;
+    }
+    /**
+    * 装备合成表
+    * @return \equip_compose
+    */
+    public static function equip_compose()
+    { 
+        static $a = null; 
+        return self::initValue($a, 'equip_compose');
+    }
+    /**
+    * @return \sm_equip_compose equip_compose item数据 
+    */
+    public static function equip_compose_getItem($itemid)
+    { 
+        return self::get_hash_item('equip_compose', $itemid);
+    }
+    /**
     * 当前版本(时间戳)
     * @return \ver
     */

+ 24 - 2
Gameserver/App/process/StoreProc.php

@@ -126,7 +126,16 @@ class StoreProc {
         $Mo = GameConfig::equip_levelupgrade_getItem($lv+1);         
         my_Assert($user->baseInfo->gold >= $Mo->needGold, ErrCode::notenough_gold_msg);                  
                  
-        $typeId = GameConfig::equip_getItem($user->store->equip->$uid->typeId)->needTuzhiId;//图纸
+        $position = GameConfig::equip_getItem($user->store->equip->$uid->typeId)->position;//图纸
+        $typeId = 0;
+        $strArr = explode(';', GameConfig::globalsettings()->equipLeveUpTuzhi);
+        foreach ($strArr as $str) {
+            $list = explode(',', $str);
+            if($list[0] == $position){
+                $typeId = $list[1];
+                break;
+            }
+        }              
         $num = $Mo->needItemNum;
         if (StlUtil::dictHasProperty($user->store->items,$typeId) && $user->store->items->$typeId >= $num)
         {
@@ -135,6 +144,7 @@ class StoreProc {
 
         $user->store->equip->$uid->level += 1;       
         
+        ctx($user);
         UserProc::updateUserInfo();
         return Resp::ok(array(
                     'gold' => $user->baseInfo->gold,                         
@@ -158,7 +168,18 @@ class StoreProc {
         $need_item = 0;
 
         $itemNum = 0;
-        $tuzhiId = GameConfig::equip_getItem($equip->typeId)->needTuzhiId;
+        $position = GameConfig::equip_getItem($equip->typeId)->position;       
+        $tuzhiId = 0;
+        $strArr = explode(';', GameConfig::globalsettings()->equipLeveUpTuzhi);
+        foreach ($strArr as $str) {
+            $list = explode(',', $str);
+            if($list[0] == $position){
+                $tuzhiId = $list[1];
+                break;
+            }
+        }  
+        
+        
         $needItem2 = 0;
         if (StlUtil::dictHasProperty($user->store->items,$tuzhiId))
         {
@@ -187,6 +208,7 @@ class StoreProc {
         $user->store->removeItem($tuzhiId, $need_item);             
         $user->store->equip->$uid->level += $ll;
                      
+        ctx($user);
         UserProc::updateUserInfo();
         return Resp::ok(array(
                     'gold' => $user->baseInfo->gold,