From c11b1e8fb2707d12a7247e6b085c00660cf224cc Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期四, 10 一月 2019 14:08:52 +0800
Subject: [PATCH] 5798 子 【1.5】境界调整 / 【后端】【1.5】境界老号处理

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py                            |    5 +++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py |    2 +-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py                        |   35 ++++++++++++++++++++++++++++++++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                                        |    4 +++-
 4 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index c400c4e..df25ba9 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3676,6 +3676,7 @@
 Def_PDict_BossRebornTemplateID = "BossRebornTemplateID"  # 玩家身上的BOSS复活模板ID
 Def_PDict_BRActionCurTimes = "BRActionCurTimes_%s" #当前完成次数 参数BOSS复活活动ID
 Def_PDict_BRActionGotTimes = "BRActionGotTimes_%s" #当前已领次数 参数BOSS复活活动ID
+Def_PDict_BRActionWorldLV = "BRActionWorldLV_%s" #BOSS复活活动开启时世界等级
 
 #仙界盛典
 Def_PDict_FairyCeremonyID = "FairyCeremonyID"  # 玩家身上的仙界盛典活动ID,唯一标识,取活动开始日期time值
@@ -4527,7 +4528,8 @@
 Def_VerFix_Horse, # 坐骑等级上限修改,对应技能触发修改;
 Def_VerFix_Pet, # 灵宠等级上限修改,对应技能触发修改;
 Def_VerFix_AddPoint, # 老号属性点修复;
-) = range(8)
+Def_VerFix_ReamlvFix, # 老号境界等级变更;
+) = range(9)
 
 ##==================================================================================================
 #游戏消费点类型定义
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py
index 4834ca7..caff74d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/GameLogic_PersonalBoss.py
@@ -67,7 +67,7 @@
         return False
     needLV = ipyData.GetChanllengeLv()
     if curPlayer.GetLV() < needLV:
-        GameWorld.DebugLog('    检查可否进行挑战 bossID-%s  等级不足 %s'%(needLV))
+        GameWorld.DebugLog('    检查可否进行挑战 bossID-%s  等级不足 %s'%(bossID, needLV))
         return False
     delResult = FBCommon.DelFBEnterTicket(curPlayer, ChConfig.Def_FBMapID_PersonalBoss)
     isOK = delResult[0]
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py
index ad9471d..a971e45 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPrestigeSys.py
@@ -48,7 +48,35 @@
     return True
 
 def OnLogin(curPlayer):
-    
+    if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_ReamlvFix):
+        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_ReamlvFix, 1)
+        #计算老号当前境界修行点--折算修行点对应新境界--弥补多余修行点
+        oldRealmLV = curPlayer.GetOfficialRank()
+        if oldRealmLV:
+            givePoint = IpyGameDataPY.GetFuncEvalCfg('ReRealm', 1, {}).get(oldRealmLV, 0)
+            curPoint = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_RealmPoint)
+            givePoint += curPoint
+            newRealmLV = 0
+            ipyMgr = IpyGameDataPY.IPY_Data()
+            maxRealmLV = ipyMgr.GetRealmByIndex(ipyMgr.GetRealmCount()-1).GetLv()
+            for lv in xrange(maxRealmLV):
+                ipyData = GetRealmIpyData(lv)
+                if not ipyData:
+                    break
+                needPoint = ipyData.GetNeedPoint()
+                if givePoint < needPoint:
+                    break
+                givePoint -= needPoint
+                newRealmLV = lv + 1
+            
+            PlayerControl.PayMoney(curPlayer, ShareDefine.TYPE_Price_RealmPoint, curPoint, isNotify=False)
+            if newRealmLV > 0:
+                curPlayer.SetOfficialRank(newRealmLV-1)
+                DoRealmLVUpLogic(curPlayer, False)
+            PlayerControl.SendMailByKey('ReRealm', [curPlayer.GetID()], [(ChConfig.Def_ItemID_RealmPoint, givePoint, 1)], [newRealmLV, givePoint])
+            GameWorld.Log('老号境界处理 oldRealmLV=%s,newRealmLV=%s,givePoint=%s'%(oldRealmLV, newRealmLV, givePoint), curPlayer.GetID())
+        
+        
     SyncRealmFBState(curPlayer)
     return
 
@@ -175,7 +203,7 @@
     DoRealmLVUpLogic(curPlayer)
     return
 
-def DoRealmLVUpLogic(curPlayer):
+def DoRealmLVUpLogic(curPlayer, needSys=True):
     curRealmLV = curPlayer.GetOfficialRank()
     nextRealmLv = curRealmLV + 1
     GameWorld.DebugLog('    升级境界nextRealmLv=%s'%nextRealmLv)
@@ -185,7 +213,8 @@
     
     curPlayer.SetOfficialRank(nextRealmLv)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmFBIsOpen, 0)
-    PlayerControl.WorldNotify(0, 'RealmUpSuccess', [curPlayer.GetName(), nextRealmLv])
+    if needSys:
+        PlayerControl.WorldNotify(0, 'RealmUpSuccess', [curPlayer.GetName(), nextRealmLv])
     RefreshOfficialAttr(curPlayer)
     GameFuncComm.DoFuncOpenLogic(curPlayer)
     SyncRealmFBState(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py
index bfbbed8..0597d42 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py
@@ -301,6 +301,7 @@
             passlv = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV)
             DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_PassRuneTower, 1, [passlv])
         elif succType == ShareDefine.SuccType_GodWeapon:
+            ResetSuccessByType(curPlayer, succType)
             maxType = ipyDataMgr.GetGodWeaponByIndex(ipyDataMgr.GetGodWeaponCount()-1).GetType()
             for i in xrange(1, maxType + 1):
                 weaponLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % i)
@@ -330,6 +331,7 @@
         elif succType in [ShareDefine.SuccType_InlayGatherSoul, ShareDefine.SuccType_GatherSoulLvUp]:
             PlayerGatherSoul.DoGatherSoulSuccessLogic(curPlayer)
         elif succType == ShareDefine.SuccType_RealmlvUp:
+            ResetSuccessByType(curPlayer, succType)
             UptateSuccessProgress(curPlayer, succType, curPlayer.GetOfficialRank())
         elif succType == ShareDefine.SuccType_PetClassLV:
             ResetSuccessByType(curPlayer, succType)
@@ -351,6 +353,7 @@
         elif succType in [ShareDefine.SuccType_EquipWashLV1,ShareDefine.SuccType_EquipWashLV2,ShareDefine.SuccType_EquipWashLV3]:
             Operate_EquipWash.EquipWashSuccess(curPlayer)
         elif succType == ShareDefine.SuccType_MWSkillUp:
+            ResetSuccessByType(curPlayer, succType)
             skillManager = curPlayer.GetSkillManager()
             for i in range(0, skillManager.GetSkillCount()):
                 curSkill = skillManager.GetSkillByIndex(i)
@@ -361,12 +364,14 @@
         elif succType == ShareDefine.SuccType_EquipSuit:
             Operate_EquipSuitCompose.DoSuiteSuccess(curPlayer)
         elif succType == ShareDefine.SuccType_FamilyTechLV:
+            ResetSuccessByType(curPlayer, succType)
             techNeedLVDict = IpyGameDataPY.GetFuncEvalCfg('FamilyTechNeedLV', 1, {})
             techIDList = techNeedLVDict.keys()
             for techID in techIDList:
                 techLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyTechLV % techID)
                 UptateSuccessProgress(curPlayer, succType, techLV, [techID])
         elif succType == ShareDefine.SuccType_AlchemyLV:
+            ResetSuccessByType(curPlayer, succType)
             alchemyLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AlchemyLV)
             UptateSuccessProgress(curPlayer, succType, alchemyLV)
         elif succType == ShareDefine.SuccType_VIPLV:

--
Gitblit v1.8.0