From 1c39d19d2b49465cf8bd8bdea831f9adb012411c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期一, 25 十一月 2024 14:55:01 +0800
Subject: [PATCH] 1111 【越南】【砍树】【英文】【tqxbqy】【btgotq】背包相关初始格子数改为读配置

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py       |   18 +++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerExpandPackCfgMgr.py |    5 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py               |   12 +++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py              |   12 +----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py          |    6 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                      |   43 ++-------------------
 6 files changed, 37 insertions(+), 59 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index b8a890c..add97c8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -906,52 +906,18 @@
 #流向记录变更最小金币值(小于该值的暂不记录, 仅限金币)
 Def_DRRecord_Min_Silver = 500000
 Def_LargeTrade_Silver = 1000 * 1000
-#初始化装备背包格子数
-Def_PackCnt_Equip = 203
 #主角交易栏最大格数
 Def_PlayerTradeMaxItemCount = 20
-#主角刚登陆游戏开启背包格子数
-Def_PlayerFirstLoginOpenBackCnt = 60
-#新手登陆开启的仓库格子数
-Def_FirstLogin_OpenWareHouseCnt = 60
 #登陆初始储物柜格子数
 Def_PackCnt_Fashion = 1
 #登陆初始武器时装格子数
 Def_PackCnt_WeaponCoat = 8
-#初始化寻宝背包格子数
-Def_PackCnt_SeekTreasure = 0
-#初始化阶级马匹背包格子数
-Def_PackCnt_ClassHorses = 0
-#初始化马匹装备格子数
-Def_PackCnt_HorseEquip = 3
-#初始化阶级马匹技能背包格子数
-Def_PackCnt_HorseSkill = 0
-#初始化官爵技能背包格子数
-Def_PackCnt_OfficerSkill = 0
-#寻宝背包格子数
-Def_PackCnt_Treasure = 200
-#初始化神兽背包格子数
-Def_PackCnt_DogzItem = 100
-#初始化神兽装备格子数
-Def_PackCnt_DogzEquip = 150
-#初始化垃圾分类格子数
-Def_PackCnt_Garbage = 30
-#初始化装备栏2
-Def_PackCnt_Equip2 = 0
 #初始化回收站
 Def_PackCnt_Recycle = 6
 #初始化临时交换背包格子数
 Def_PackCnt_TempSwap = 1
 #初始化临时存放背包格子数
 Def_PackCnt_TempItem = 10
-#初始化鉴定背包格子数
-Def_PackCnt_Identify = 10
-#初始化宠物背包格子数
-Def_PackCnt_Pet = 70
-#初始化通用宠物装备背包格子数
-Def_PackCnt_PetEquip = 4
-#主角刚登陆游戏开启精魄槽格子数/符文
-Def_PlayerFirstLoginOpenFineSoulSlot = 0
 #玩家脱离战斗状态时间(6秒)
 Def_PlayerLeaveBattleTick = 3000
 #玩家PK多杀间隔
@@ -4597,11 +4563,10 @@
 #-------------------------------------------------------------------------------
 #可以从07 41封包购买的背包类型,和对应字典{背包类型:[字典key, 默认格子数]}
 
-#字典值列表枚举
+#字典值列表枚举,废弃默认格子数枚举,改为读配置
 [
 Def_PlayerPackDict_Index_Key,      # 字典可以
-Def_PlayerPackDict_Index_InitCnt,  # 默认格子数
-] = range(0, 2)
+] = range(0, 1)
 
 Def_Type_CanBuyPack_PlayerDict = {
                                   #IPY_GameWorld.rptPetCabinetPet:[
@@ -4622,11 +4587,11 @@
                                       
                                   IPY_GameWorld.rptItem:[
                                        Def_Player_Dict_PackCount_Item, 
-                                       Def_PlayerFirstLoginOpenBackCnt],
+                                       0],
                                       
                                   IPY_GameWorld.rptWarehouse:[
                                        Def_Player_Dict_PackCount_Warehouse, 
-                                       Def_FirstLogin_OpenWareHouseCnt],
+                                       0],
                                       
                                   #IPY_GameWorld.rptFineSoulSlot:[
                                   #     Def_PDict_PackCount_FineSoul, 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
index b13c1f9..d3344cf 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -859,11 +859,6 @@
     
     #按平台给首个称号
     #PlayerDienstgrad.GiveFirstLoginDienstgrad(curPlayer)
-
-# 2012-04-12 玩家初始化时已给予格子
-#    #---新手给仓库---
-#    if ChConfig.Def_FirstLogin_OpenWareHouseCnt > 0:
-#        ResetWarehouse(curPlayer, ChConfig.Def_FirstLogin_OpenWareHouseCnt, False)
     
     #玩家默认恶名值
     curPlayer.SetInfamyValue(ChConfig.Def_FirstLogin_InfamyValue)
@@ -3470,7 +3465,7 @@
     keyName = ChConfig.Def_Type_CanBuyPack_PlayerDict.get(packType)[ChConfig.Def_PlayerPackDict_Index_Key]
     
     #已经开启的背包格子数
-    packCount = ChConfig.Def_PlayerFirstLoginOpenBackCnt + curPlayer.NomalDictGetProperty(keyName)
+    packCount = ItemCommon.GetPackInitCount(packType) + curPlayer.NomalDictGetProperty(keyName)
     resetPackCnt = packCount + addPackCnt
 
     curPack = curPlayer.GetItemManager().GetPack(packType)
@@ -3502,8 +3497,7 @@
         return
     
     keyName = ChConfig.Def_Type_CanBuyPack_PlayerDict.get(packType)[ChConfig.Def_PlayerPackDict_Index_Key]
-    count = ChConfig.Def_Type_CanBuyPack_PlayerDict.get(packType)[ChConfig.Def_PlayerPackDict_Index_InitCnt] + \
-        curPlayer.NomalDictGetProperty(keyName) + addWarehouseCnt
+    count = ItemCommon.GetPackInitCount(packType) + curPlayer.NomalDictGetProperty(keyName) + addWarehouseCnt
 
     curPack = curPlayer.GetItemManager().GetPack(packType)
         
@@ -4514,7 +4508,7 @@
     curGridCnt = curPlayer.NomalDictGetProperty(keyName)  
     
     #默认格子数
-    initCnt = ChConfig.Def_Type_CanBuyPack_PlayerDict[packType][ChConfig.Def_PlayerPackDict_Index_InitCnt]  
+    initCnt = ItemCommon.GetPackInitCount(packType)
     
     curPack = curPlayer.GetItemManager().GetPack(packType)
     curPackMaxCnt = curPack.GetMaxCount()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
index 8ec8d15..4518299 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/ItemCommon.py
@@ -1011,6 +1011,24 @@
             
     return -1
 
+def GetPackInitCount(packType):
+    ## 获取背包类型对应初始格子数
+    if packType == IPY_GameWorld.rptItem:
+        initCount = IpyGameDataPY.GetFuncCfg("InitBagCellCount", 1)
+    elif packType == IPY_GameWorld.rptWarehouse:
+        initCount = IpyGameDataPY.GetFuncCfg("InitDepotCellCount", 1)
+    elif packType == ShareDefine.rptTreasure:
+        initCount = IpyGameDataPY.GetFuncCfg("TreasureSet", 3)
+    elif packType == ShareDefine.rptDogzItem:
+        initCount = IpyGameDataPY.GetFuncCfg("DogzPack", 1)
+    elif packType == ShareDefine.rptDogzEquip:
+        initCount = IpyGameDataPY.GetFuncCfg("DogzPack", 2)
+    else:
+        bagInitCntDict = IpyGameDataPY.GetFuncEvalCfg("InitBagCellCount", 2, {})
+        initCount = bagInitCntDict.get(str(packType), 0)
+    GameWorld.DebugLog("背包类型初始格子数: packType=%s,initCount=%s" % (packType, initCount))
+    return initCount
+
 ## 获得虚拟背包格子数
 #  @param packindex 背包索引
 #  @return 背包格子数
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index d03af62..f9bb8a7 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -1570,20 +1570,20 @@
     
     #初始化鉴定背包
     curPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptIdentify)
-    curPack.SetCount(ChConfig.Def_PackCnt_Identify)
+    curPack.SetCount(ItemCommon.GetPackInitCount(IPY_GameWorld.rptIdentify))
     curPack.Sync_PackCanUseCount()
     
     #初始化神兽物品背包
     curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzItem)
-    curPack.SetCount(ChConfig.Def_PackCnt_DogzItem)
+    curPack.SetCount(ItemCommon.GetPackInitCount(ShareDefine.rptDogzItem))
     curPack.Sync_PackCanUseCount()
     #初始化神兽装备背包
     curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptDogzEquip)
-    curPack.SetCount(ChConfig.Def_PackCnt_DogzEquip)
+    curPack.SetCount(ItemCommon.GetPackInitCount(ShareDefine.rptDogzEquip))
     curPack.Sync_PackCanUseCount()
     #初始化垃圾分类背包
     curPack = itemManager.GetPack(ShareDefine.rptGarbage)
-    curPack.SetCount(ChConfig.Def_PackCnt_Garbage)
+    curPack.SetCount(ItemCommon.GetPackInitCount(ShareDefine.rptGarbage))
     curPack.Sync_PackCanUseCount()
     
     #初始化临时交换背包
@@ -1596,7 +1596,7 @@
 
     #设置装备实际个数
     curPack = itemManager.GetPack(IPY_GameWorld.rptEquip)
-    curPack.SetCount(ChConfig.Def_PackCnt_Equip)
+    curPack.SetCount(ItemCommon.GetPackInitCount(IPY_GameWorld.rptEquip))
     
     #初始化垃圾桶
     #curPack = itemManager.GetPack(IPY_GameWorld.rptRecycle)
@@ -1608,7 +1608,7 @@
 
     #初始化宠物背包
     curPack = itemManager.GetPack(ShareDefine.rptPet)
-    curPack.SetCount(ChConfig.Def_PackCnt_Pet)
+    curPack.SetCount(ItemCommon.GetPackInitCount(ShareDefine.rptPet))
     #curPack.Sync_PackCanUseCount()
     return
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index e2c4e3a..54d66ec 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -6046,7 +6046,7 @@
     
     #默认14格子 + 开启的
     keyName = ChConfig.Def_Type_CanBuyPack_PlayerDict.get(packType)[ChConfig.Def_PlayerPackDict_Index_Key]
-    count = ChConfig.Def_PlayerFirstLoginOpenBackCnt + curPlayer.NomalDictGetProperty(keyName)
+    count = ItemCommon.GetPackInitCount(packType) + curPlayer.NomalDictGetProperty(keyName)
     curPack.SetCount(count)
         
     #通知客户端背包格子数目
@@ -6072,7 +6072,7 @@
     
     #默认42格子 + 开启的
     keyName = ChConfig.Def_Type_CanBuyPack_PlayerDict.get(packType)[ChConfig.Def_PlayerPackDict_Index_Key]
-    count = ChConfig.Def_FirstLogin_OpenWareHouseCnt + curPlayer.NomalDictGetProperty(keyName)
+    count = ItemCommon.GetPackInitCount(packType) + curPlayer.NomalDictGetProperty(keyName)
     
     curPack.SetCount(count)
     
@@ -6088,7 +6088,7 @@
 # @return None
 def Init_TreasurePack(curPlayer):
     curPack = curPlayer.GetItemManager().GetPack(ShareDefine.rptTreasure)
-    curPack.SetCount(ChConfig.Def_PackCnt_Treasure)
+    curPack.SetCount(ItemCommon.GetPackInitCount(ShareDefine.rptTreasure))
     
     #通知客户端
     curPack.Sync_PackCanUseCount()
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerExpandPackCfgMgr.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerExpandPackCfgMgr.py
index e3f763b..10f63d6 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerExpandPackCfgMgr.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerExpandPackCfgMgr.py
@@ -25,6 +25,7 @@
 import GameWorld
 import IPY_GameWorld
 import PlayerControl
+import ItemCommon
 import ChConfig
 import copy
 
@@ -185,12 +186,12 @@
     #@remarks 加载物品背包和仓库扩充格子时需要用的配置信息
     def Load(self, curPlayer):
         #默认物品背包格子数
-        defItemPackCount = ChConfig.Def_PlayerFirstLoginOpenBackCnt
+        defItemPackCount = ItemCommon.GetPackInitCount(IPY_GameWorld.rptItem)
         itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
         self.__expandPackCfgDict[IPY_GameWorld.rptItem] = ExpandPackCfg("ExpandItemPack", defItemPackCount, 
                                                                         itemPack.GetMaxCount())
         #默认仓库背包格子数
-        defItemPackCount = ChConfig.Def_FirstLogin_OpenWareHouseCnt
+        defItemPackCount = ItemCommon.GetPackInitCount(IPY_GameWorld.rptWarehouse)
         itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptWarehouse)
         self.__expandPackCfgDict[IPY_GameWorld.rptWarehouse] = ExpandPackCfg("ExpandWareHousePack", defItemPackCount, 
                                                                              itemPack.GetMaxCount())

--
Gitblit v1.8.0