From 12839a8310f6f42980c84ddd1d2e808022a5e6f1 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 08 五月 2019 15:14:47 +0800
Subject: [PATCH] 6687 【2.0】【后端】五行灵根界面功能优化

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini                                          |    6 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py                                  |   48 ++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py                              |   32 ++++++++++
 ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py                                                       |   48 ++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetAttrPoint.py             |    2 
 6 files changed, 135 insertions(+), 3 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
index 23ffbe5..7d73a4d 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChPyNetPack.py
@@ -14234,6 +14234,54 @@
 
 
 #------------------------------------------------------
+# B2 07 重置加点 #tagCMResetAttrPoint
+
+class  tagCMResetAttrPoint(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x07
+        return
+
+    def ReadData(self, stringData, _pos=0, _len=0):
+        self.Clear()
+        memmove(addressof(self), stringData[_pos:], self.GetLength())
+        return _pos + self.GetLength()
+
+    def Clear(self):
+        self.Cmd = 0xB2
+        self.SubCmd = 0x07
+        return
+
+    def GetLength(self):
+        return sizeof(tagCMResetAttrPoint)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 07 重置加点 //tagCMResetAttrPoint:
+                                Cmd:%s,
+                                SubCmd:%s
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd
+                                )
+        return DumpString
+
+
+m_NAtagCMResetAttrPoint=tagCMResetAttrPoint()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMResetAttrPoint.Cmd,m_NAtagCMResetAttrPoint.SubCmd))] = m_NAtagCMResetAttrPoint
+
+
+#------------------------------------------------------
 #B2 01 脱机挂状态 # tagCMLoginState
 
 class  tagCMLoginState(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index 506f7a4..73efa67 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -367,7 +367,7 @@
 Writer = hxp
 Releaser = hxp
 RegType = 0
-RegisterPackCount = 22
+RegisterPackCount = 23
 
 PacketCMD_1 = 0xA5
 PacketSubCMD_1 = 0x04
@@ -457,6 +457,10 @@
 PacketSubCMD_22=0x33
 PacketCallFunc_22=OnClientExitCustomScene
 
+PacketCMD_23=0xB2
+PacketSubCMD_23=0x07
+PacketCallFunc_23=OnResetAttrPoint
+
 ;购买相关的
 [BuySomething]
 ScriptName = Event\EventSrc\Operate_PlayerBuyZhenQi.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
index 23ffbe5..7d73a4d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChPyNetPack.py
@@ -14234,6 +14234,54 @@
 
 
 #------------------------------------------------------
+# B2 07 重置加点 #tagCMResetAttrPoint
+
+class  tagCMResetAttrPoint(Structure):
+    _pack_ = 1
+    _fields_ = [
+                  ("Cmd", c_ubyte),
+                  ("SubCmd", c_ubyte),
+                  ]
+
+    def __init__(self):
+        self.Clear()
+        self.Cmd = 0xB2
+        self.SubCmd = 0x07
+        return
+
+    def ReadData(self, stringData, _pos=0, _len=0):
+        self.Clear()
+        memmove(addressof(self), stringData[_pos:], self.GetLength())
+        return _pos + self.GetLength()
+
+    def Clear(self):
+        self.Cmd = 0xB2
+        self.SubCmd = 0x07
+        return
+
+    def GetLength(self):
+        return sizeof(tagCMResetAttrPoint)
+
+    def GetBuffer(self):
+        return string_at(addressof(self), self.GetLength())
+
+    def OutputString(self):
+        DumpString = '''// B2 07 重置加点 //tagCMResetAttrPoint:
+                                Cmd:%s,
+                                SubCmd:%s
+                                '''\
+                                %(
+                                self.Cmd,
+                                self.SubCmd
+                                )
+        return DumpString
+
+
+m_NAtagCMResetAttrPoint=tagCMResetAttrPoint()
+ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMResetAttrPoint.Cmd,m_NAtagCMResetAttrPoint.SubCmd))] = m_NAtagCMResetAttrPoint
+
+
+#------------------------------------------------------
 #B2 01 脱机挂状态 # tagCMLoginState
 
 class  tagCMLoginState(Structure):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py
index 34a90b4..180f860 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_KirinHome.py
@@ -143,7 +143,7 @@
 #  @param tick
 #  @return None
 def DoEnterFB(curPlayer, tick):
-    PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default * 2)
+    PlayerControl.SetSight(curPlayer, ChConfig.Def_PlayerSight_Default * 3)
     gameFB = GameWorld.GetGameFB()
     hadDelTicket = FBCommon.GetHadDelTicket(curPlayer)
     lineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqFBFuncLine)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetAttrPoint.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetAttrPoint.py
index 9e16f5d..301b850 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetAttrPoint.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Item/UseItem/Item_ResetAttrPoint.py
@@ -80,7 +80,7 @@
     freePoint = curPlayer.GetFreePoint()
     curPlayer.SetFreePoint(freePoint + resetPointTotal)
     ChPlayer.NotifyPlayerBasePoint(curPlayer, resetIDList)
-    DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_ResetPoint, {'resetAttrID':resetID, 'resetPoint':resetPoint})
+    DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_ResetPoint, {'resetIDList':resetIDList, 'resetPointTotal':resetPointTotal})
     
     #刷新人物所有状态
     playerControl = PlayerControl.PlayerControl(curPlayer)
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 021acb4..d7dee9c 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -105,6 +105,7 @@
 import PlayerNewFairyCeremony
 import PlayerFeastRedPacket
 import PlayerLuckyTreasure
+import Item_ResetAttrPoint
 import CrossRealmPlayer
 import ChNetSendPack
 import FamilyRobBoss
@@ -1775,6 +1776,37 @@
     playerControl.RefreshPlayerAttrState()
     return
 
+#// B2 07 重置加点 #tagCMResetAttrPoint
+#struct    tagCMResetAttrPoint
+#{
+#    tagHead         Head;
+#};
+def OnResetAttrPoint(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    ipyDataMgr = IpyGameDataPY.IPY_Data()
+    canResetIDList = [ipyDataMgr.GetRolePointByIndex(index).GetAttrID() for index in xrange(ipyDataMgr.GetRolePointCount())]
+    canReset = False
+    for attrID in canResetIDList:
+        curPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AddPointValue % attrID)
+        if curPoint:
+            canReset = True
+            break
+    if not canReset:
+        GameWorld.DebugLog('重置加点 没有点数需要重置')
+        return
+    isFree = curPlayer.GetLV() < IpyGameDataPY.GetFuncCfg('LVUPAddPoint', 4)
+    if not isFree:
+        needItemID = IpyGameDataPY.GetFuncCfg('LVUPAddPoint', 5)
+        itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
+        hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(needItemID, itemPack, 1)
+        if not hasEnough:
+            GameWorld.DebugLog("重置加点 item(%s) isn't enough" % (needItemID))
+            return
+        ItemCommon.ReduceItem(curPlayer, itemPack, itemList, 1, False, ChConfig.ItemDel_ResetAttrPoint)
+    
+    Item_ResetAttrPoint.DoResetAttrPoint(curPlayer, 0, 0, 0)
+    return
+
 def NotifyPlayerBasePoint(curPlayer, syncAttrIDList=[]):
     # 通知基础属性点,已分配的自由点数
     

--
Gitblit v1.8.0