From 4fe82776f183c8b42a48cccf24e09ca324a55078 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期三, 05 六月 2019 14:14:56 +0800
Subject: [PATCH] 3951 【BUG】【2.0】骑宠争夺没有排名奖励

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py |   67 +++++++++++++--------------------
 1 files changed, 26 insertions(+), 41 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py
index b4f9014..6010012 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGodWeapon.py
@@ -32,10 +32,11 @@
 import GameFuncComm
 import SkillCommon
 import BuffSkill
-import ItemControler
+import PlayerWeekParty
 #import EventReport
 import IpyGameDataPY
 import PassiveBuffEffMng
+import OpenServerCampaign
 
 import random
 
@@ -52,41 +53,26 @@
         return
     Sync_GodWeaponLVInfo(curPlayer)
     
-    #老号相关神兵场景特效等级同步支持
-    if curPlayer.GetExAttr15() == 0:
-        playerID = curPlayer.GetPlayerID()
-        ipyDataMgr = IpyGameDataPY.IPY_Data()
-        maxType = ipyDataMgr.GetGodWeaponByIndex(ipyDataMgr.GetGodWeaponCount()-1).GetType()
-        for setWeaponType in xrange(1, maxType + 1):
-            setLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % setWeaponType)
-            if not setLV:
-                continue
-            SetGodWeaponLV(curPlayer, setWeaponType, setLV)
-            
-            giveSkillList = []
-            for attrLV in xrange(1, setLV + 1):
-                godWeaponData = IpyGameDataPY.GetIpyGameData('GodWeapon', setWeaponType, attrLV)
-                if godWeaponData:
-                    giveSkillID = GodWeaponLVUP(curPlayer, godWeaponData, attrLV)
-                    if giveSkillID:
-                        giveSkillList.append(giveSkillID)
-            GameWorld.Log("老号设置神兵场景等级: setWeaponType=%s,setLV=%s, giveSkillList=%s" % (setWeaponType, setLV, giveSkillList), playerID)
-            
     return
 
 def SetGodWeaponLV(curPlayer, weaponType, lv):
     ## 设置神兵等级,同步设置场景神兵等级
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GodWeaponLV % weaponType, lv)
-    sceneEffectsDict = {Def_GodWeaponType_HP:[lambda curObj, value:curObj.SetExAttr15(value), ShareDefine.CDBPlayerRefresh_GodWeaponLV_1],
-                        Def_GodWeaponType_Atk:[lambda curObj, value:curObj.SetExAttr16(value), ShareDefine.CDBPlayerRefresh_GodWeaponLV_2],
-                        Def_GodWeaponType_SuperHit:[lambda curObj, value:curObj.SetExAttr17(value), ShareDefine.CDBPlayerRefresh_GodWeaponLV_3],
-                        Def_GodWeaponType_Def:[lambda curObj, value:curObj.SetExAttr18(value), ShareDefine.CDBPlayerRefresh_GodWeaponLV_4],
-                        }
-    if weaponType in sceneEffectsDict:
-        setFunc, notifyType = sceneEffectsDict[weaponType]
-        setFunc(curPlayer, lv)
-        curPlayer.SendPropertyRefresh(notifyType, lv, False)
+            
+    totalLV = GetGodWeaponTotalLV(curPlayer)
+    # 开服活动数据
+    OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_GodWeaponLV, totalLV)
+    PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_GodWeapon, totalLV, False, True)
     return
+
+def GetGodWeaponTotalLV(curPlayer):
+    ##获取神兵总等级
+    totalLV = 0
+    ipyDataMgr = IpyGameDataPY.IPY_Data()
+    maxType = ipyDataMgr.GetGodWeaponByIndex(ipyDataMgr.GetGodWeaponCount()-1).GetType()
+    for gwType in xrange(1, maxType + 1):
+        totalLV += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % gwType)
+    return totalLV
 
 ## 神器开启
 #  @return: 是否激活成功
@@ -133,8 +119,10 @@
             PlayerControl.CalcAttrDict_Type(attrID, attrValueList[i], allAttrList)
         
         fightPowerEx += IpyGameDataPY.GetFuncEvalCfg('MagicExterior').get(str(gwType), 0)
-        # 附加战力
-        curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_GodWeapon, fightPowerEx)
+        
+        
+    # 附加战力
+    curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_GodWeapon, fightPowerEx)
     GameWorld.DebugLog("神兵属性:%s" % allAttrList)
     # 保存计算值
     PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_GodWeapon, allAttrList)   
@@ -215,9 +203,9 @@
     
     #1.判断表中有没此类型,2.是否满级,3.判断是否有物品
     attrLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GodWeaponLV % weaponType)
-    if not attrLV and Def_GodWeaponType_SuperHit != weaponType:
-        GameWorld.DebugLog("神兵未解锁,无法升级!weaponType=%s,attrLV=%s" % (weaponType, attrLV))
-        return
+    # if not attrLV and Def_GodWeaponType_SuperHit != weaponType:
+    #     GameWorld.DebugLog("神兵未解锁,无法升级!weaponType=%s,attrLV=%s" % (weaponType, attrLV))
+    #     return  由配置表决定等级0是否可升级
       
     beforeAttrLV = attrLV   # 用于提示
     godWeaponData = IpyGameDataPY.GetIpyGameData('GodWeapon', weaponType, attrLV)
@@ -310,6 +298,7 @@
         RefreshGodWeaponAttr(curPlayer)
         #x神器达到X级成就
         PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_GodWeapon, attrLV, [weaponType])
+        EventShell.EventRespons_GodWeaponUp(curPlayer, weaponType, attrLV)
         if beforeAttrLV == 0:
             # 解封通知
             sysMark = IpyGameDataPY.GetFuncEvalCfg('GodWeaponSys', 1, {}).get(weaponType, 'GetGodWeapon')
@@ -324,17 +313,13 @@
         #            PlayerControl.WorldNotify(0, 'GodWeaponLv', [curPlayer.GetName(), weaponType, notifyLV])
         #=======================================================================
                 
-        # 神兵特效激活广播
-        godWeaponEffectData = IpyGameDataPY.GetIpyGameDataByCondition('GodWeaponEffect', {'GWType':weaponType, "Level":attrLV}, False, False)
-        if godWeaponEffectData:
-            PlayerControl.WorldNotify(0, godWeaponEffectData.GetNotifyCode(), [curPlayer.GetName(), attrLV])
-        
+
         totalExp = godWeaponData.GetExp()
         
         
     Sync_GodWeaponLVInfo(curPlayer, weaponType)
     #任务
-    EventShell.EventRespons_PlusGodWeapon(curPlayer)
+    EventShell.EventRespons_PlusGodWeapon(curPlayer, weaponType)
     return
 
 #神兵升级触发其他功能:技能

--
Gitblit v1.8.0