From a6b6d774e4039fe551bfe2fbf82182ca1714479c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期六, 11 五月 2024 18:02:35 +0800
Subject: [PATCH] 10071 【后端】灵宠改版(升阶增加玩家属性)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py |   10 ++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py    |    6 +++++-
 PySysDB/PySysDBPY.h                                                                     |    2 ++
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index 54cb5e7..68e47cd 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -391,6 +391,8 @@
 	DWORD		_Class;	//灵兽阶数
 	DWORD		UpNeedExp;	//灵兽升阶所需经验数
 	DWORD		AtkAdd;	//每阶攻击力加成
+	list		AttrType;	//累计总属性类型
+	list		AttrValue;	//累计总属性值
 };
 
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index f823162..4517f08 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -330,6 +330,8 @@
                         ("DWORD", "Class", 1),
                         ("DWORD", "UpNeedExp", 0),
                         ("DWORD", "AtkAdd", 0),
+                        ("list", "AttrType", 0),
+                        ("list", "AttrValue", 0),
                         ),
 
                 "PetEatEquip":(
@@ -2732,7 +2734,9 @@
     def GetPetID(self): return self.attrTuple[0] # 灵兽NPCID DWORD
     def GetClass(self): return self.attrTuple[1] # 灵兽阶数 DWORD
     def GetUpNeedExp(self): return self.attrTuple[2] # 灵兽升阶所需经验数 DWORD
-    def GetAtkAdd(self): return self.attrTuple[3] # 每阶攻击力加成 DWORD
+    def GetAtkAdd(self): return self.attrTuple[3] # 每阶攻击力加成 DWORD
+    def GetAttrType(self): return self.attrTuple[4] # 累计总属性类型 list
+    def GetAttrValue(self): return self.attrTuple[5] # 累计总属性值 list
 
 # 灵兽吸收装备表
 class IPY_PetEatEquip():
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py
index 2abebb8..6e5f552 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py
@@ -825,6 +825,16 @@
                 attrValue = starAttrValue[i]
                 PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrListStar)
                 
+        #升阶
+        classlv = petItem.GetUserAttr(ShareDefine.Def_IudetPet_ClassLV) + 1
+        classIpyData = IpyGameDataPY.GetIpyGameDataNotLog("PetClassCost", petItemNPCID, classlv)
+        if classIpyData:
+            attrTypeList = classIpyData.GetAttrType()
+            attrValueList = classIpyData.GetAttrValue()
+            for i, attrID in enumerate(attrTypeList):
+                attrValue = attrValueList[i]
+                PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrListStar)
+                
     PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_PetSkin, allAttrListPetSkin)
     PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_PetStar, allAttrListStar)
     curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Pet, fpExTotal)

--
Gitblit v1.8.0