From 82a94e55b5710d50643b3d0bf8581afbb3f58cf2 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 18 六月 2019 16:15:05 +0800
Subject: [PATCH] 7339 子 【开发】【2.0】称号,灵宠,技能附带效果 / 【后端】【2.0】新增效果

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py         |    5 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py |   37 +++++++----
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py    |   37 +++++++++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py     |   17 ++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDienstgrad.py  |   27 ++++++++
 5 files changed, 99 insertions(+), 24 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
index 85a2f01..0546531 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
@@ -29,6 +29,7 @@
 import PyGameData
 import GameFuncComm
 import EventShell
+import PlayerPet
 
 #关联类型
 (
@@ -239,7 +240,31 @@
     DoAddActivity(curPlayer, addValue, True)
     return
 
-def DoAddActivity(curPlayer, addValue, isMultiple=False):
+def DoAddActivityByLV(curPlayer, befLV, aftLV):
+    ##升级增加活跃点
+    perLVAddPoint = IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint', 3)
+    skillTypeID, perAddLV, addPoint, maxPoint = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomainActivePoint', 4)
+    learnSkillList, passiveSkillList = PlayerPet.GetPetLearnSkill(curPlayer)
+    addValue = (aftLV-befLV)*perLVAddPoint
+    if skillTypeID in passiveSkillList:
+        for lv in xrange(befLV+1, aftLV+1):
+            addValue += min((lv-1)/perAddLV * addPoint, maxPoint)
+    DoAddActivity(curPlayer, addValue, False, True)
+    return
+
+def AddActivityByLVOnLearnSkill(curPlayer, skillID):
+    ## 获得技能时,处理增加升级获得活跃点效果
+    skillTypeID, perAddLV, addPoint, maxPoint = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomainActivePoint', 4)
+    if skillID != skillTypeID:
+        return
+    curLV = curPlayer.GetLV()
+    addValue = 0
+    for lv in xrange(2, curLV+1):
+        addValue += min((lv-1)/perAddLV * addPoint, maxPoint)
+    DoAddActivity(curPlayer, addValue, False, True)
+    return
+
+def DoAddActivity(curPlayer, addValue, isMultiple=False, isLVUp=False):
     if not addValue:
         return
     multiple = 1
@@ -253,7 +278,7 @@
         addValue = addValue + addExtraPoint
     curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
     __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, curTotalPoint + addValue)
-    AddCanCostActivityPoint(curPlayer, addValue)
+    AddCanCostActivityPoint(curPlayer, addValue, isLVUp)
     historyPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityHistoryPoint)
     __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityHistoryPoint,
                     min(ChConfig.Def_UpperLimit_DWord, historyPoint + addValue))
@@ -280,10 +305,14 @@
         return multiple, extraPointLimit
     return actRealmPointIpyData.GetMultiple(), actRealmPointIpyData.GetPointLimit()
 
-def AddCanCostActivityPoint(curPlayer, addValue):
+def AddCanCostActivityPoint(curPlayer, addValue, isLVUp):
     # 增加可消耗的活跃点
     curPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint)
-    __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint, min(IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint'), curPoint + addValue))
+    if isLVUp:
+        updPoint = min(ChConfig.Def_UpperLimit_DWord, curPoint + addValue)
+    else:
+        updPoint = min(IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint'), curPoint + addValue)
+    __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint, updPoint)
     return
 
 def CostActivityPoint(curPlayer, costPoint, isOnlyCheck=False):
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 ed073ad..2b5af45 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -3451,8 +3451,8 @@
     if addPoint == None:
         raise Exception('玩家获得升级属性点异常, curLV = %s PlayerID = %s' % (curLV, curPlayerID))
         return
-    
-    return int(addPoint) + GetFabaoAddPoint(curPlayer)
+    multiple = GetLVAddPointMultiple(curPlayer)
+    return int(addPoint+ GetFabaoAddPoint(curPlayer)) * multiple
 
 def GetAllPointByLV(curPlayer):
     ##获取当前等级可得到属性点数
@@ -3460,19 +3460,28 @@
     curLV = curPlayer.GetLV()
     if curLV < openLV:
         return 0
-    # 初始点+升级点+境界点
+    # 初始点+(升级点+法宝效果)*称号效果倍数+境界点
     setFreePoint = IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 2)
     fabaoAddPoint = GetFabaoAddPoint(curPlayer)
+    multiple = GetLVAddPointMultiple(curPlayer)
     addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
     for rangLVs, point in addPointDict.items():
         if curLV < rangLVs[0]:
             continue
-        setFreePoint += (point + fabaoAddPoint) * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
+        setFreePoint += (point + fabaoAddPoint) * multiple * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
     
     #境界提升点数
     setFreePoint += curPlayer.GetOfficialRank() * IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 3)
     return setFreePoint
 
+def GetLVAddPointMultiple(curPlayer):
+    # 获取等级加点的倍数
+    multiple = 1
+    titleID = IpyGameDataPY.GetFuncCfg("TitleAddPoint")
+    if titleID and curPlayer.GetDienstgradManager().GetDienstgrad(titleID):
+        multiple = IpyGameDataPY.GetFuncCfg("TitleAddPoint", 2) or 1
+    return multiple
+
 def GetFabaoAddPoint(curPlayer):
     #法宝额外增加玩家每级获得的灵根点
     mwID = IpyGameDataPY.GetFuncCfg('FabaoAddPoint', 1)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDienstgrad.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDienstgrad.py
index 66c8424..d13fe57 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDienstgrad.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerDienstgrad.py
@@ -26,6 +26,8 @@
 import PassiveBuffEffMng
 import DataRecordPack
 import CrossPlayerData
+import GameFuncComm
+import ShareDefine
 
 import time
 #-------------------------------------------------------------
@@ -132,7 +134,8 @@
         __GiveSkill(curPlayer, skillID)
         
     CrossPlayerData.OnDienstgradChange(curPlayer, dienstgradID, 1)
-    
+    if dienstgradID == IpyGameDataPY.GetFuncCfg("TitleAddPoint"):
+        __DoTitleAddPoint(curPlayer)
     #重新刷新角色属性
     if isRefreshAttr:
         CalcAllDienstgradAttr(curPlayer)
@@ -141,6 +144,28 @@
     return True
 
 
+# 获得称号加点
+def __DoTitleAddPoint(curPlayer):
+    if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_AddPoint):
+        # 未开启前不可加点,因为DoAddPointOpen会一次性补齐,避免意外情况多加了点数
+        return
+    addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
+    fabaoAddPoint = PlayerControl.GetFabaoAddPoint(curPlayer)
+    multiple = PlayerControl.GetLVAddPointMultiple(curPlayer)
+    curLV = curPlayer.GetLV()
+    addFreePoint = 0
+    for rangLVs, point in addPointDict.items():
+        if curLV < rangLVs[0]:
+            continue
+        addFreePoint += (fabaoAddPoint + point) * (multiple-1) * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
+    freePoint = curPlayer.GetFreePoint()
+    updFreePoint = freePoint + addFreePoint
+    curPlayer.SetFreePoint(updFreePoint)
+    GameWorld.DebugLog("获得称号增加自由属性点: freePoint=%s,addFreePoint=%s,curLV=%s,updFreePoint=%s" 
+                       % (freePoint, addFreePoint, curLV, updFreePoint))
+    
+    return
+
 # 从称号获得技能
 def __GiveSkill(curPlayer, skillResID):
     
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
index a0c2c21..fd87952 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerMagicWeapon.py
@@ -110,19 +110,8 @@
             sysMark = IpyGameDataPY.GetFuncEvalCfg('UnblockTreasure', 2, {}).get(mwID, 'UnblockTreasure')
             PlayerControl.WorldNotify(0, sysMark, [curPlayer.GetName(), mwID])
         if mwID == IpyGameDataPY.GetFuncCfg('FabaoAddPoint', 1):
-            addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
-            fabaoAddPoint = IpyGameDataPY.GetFuncCfg('FabaoAddPoint', 2)
-            curLV = curPlayer.GetLV()
-            addFreePoint = 0
-            for rangLVs, point in addPointDict.items():
-                if curLV < rangLVs[0]:
-                    continue
-                addFreePoint += fabaoAddPoint * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
-            freePoint = curPlayer.GetFreePoint()
-            updFreePoint = freePoint + addFreePoint
-            curPlayer.SetFreePoint(updFreePoint)
-            GameWorld.DebugLog("激活法宝增加自由属性点: freePoint=%s,addFreePoint=%s,curLV=%s,updFreePoint=%s" 
-                               % (freePoint, addFreePoint, curLV, updFreePoint))
+            __DoFabaoAddPoint(curPlayer)
+            
 
     EventShell.EventRespons_MagicWeaponLV(curPlayer, mwID, mwLV)
     #通知客户端等级
@@ -153,7 +142,27 @@
     DataRecordPack.DR_MagicWeaponActive(curPlayer, mwID, mwLV)
     return True
 
-
+# 获得法宝加点
+def __DoFabaoAddPoint(curPlayer):
+    if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_AddPoint):
+        # 未开启前不可加点,因为DoAddPointOpen会一次性补齐,避免意外情况多加了点数
+        return
+    addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
+    fabaoAddPoint = PlayerControl.GetFabaoAddPoint(curPlayer)
+    multiple = PlayerControl.GetLVAddPointMultiple(curPlayer)
+    curLV = curPlayer.GetLV()
+    addFreePoint = 0
+    for rangLVs, point in addPointDict.items():
+        if curLV < rangLVs[0]:
+            continue
+        addFreePoint += fabaoAddPoint * multiple * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
+    freePoint = curPlayer.GetFreePoint()
+    updFreePoint = freePoint + addFreePoint
+    curPlayer.SetFreePoint(updFreePoint)
+    GameWorld.DebugLog("获得法宝增加自由属性点: freePoint=%s,addFreePoint=%s,curLV=%s,updFreePoint=%s" 
+                       % (freePoint, addFreePoint, curLV, updFreePoint))
+    
+    return
 def GetWMIpyData(mwID):return IpyGameDataPY.GetIpyGameData('Treasure', mwID)
 
 
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 7d496a0..672e994 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py
@@ -41,6 +41,7 @@
 import CalcNoLineEffect
 import CrossPlayerData
 import CalcLineEffect
+import PlayerActivity
 
 import random
 import math
@@ -708,7 +709,9 @@
             #广播
             sysMark = sysMarkList[i] if i < len(sysMarkList) else 'PetUpLv'
             PlayerControl.WorldNotify(0, sysMark, [playerName, petNPCID, limitPetClassLV, skillid])
-
+            #增加升级活跃点效果
+            PlayerActivity.AddActivityByLVOnLearnSkill(curPlayer, skillid)
+            
         if not learnSkillList and updClassLV + 1 == maxClassLV:
             PlayerControl.WorldNotify(0, 'PetUpLvMax', [playerName, petNPCID])
         # 如果是当前出战的宠物, 则该宠物学习技能

--
Gitblit v1.8.0