From 4ef8a162160e3028d4a8382304382872c79a44f9 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期四, 11 四月 2019 20:40:02 +0800
Subject: [PATCH] 6494 子 【开发】【2.0】战斗公式增加普攻伤害和技能伤害 / 【后端】【2.0】战斗公式增加普攻伤害和技能伤害属性

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py |   75 ++++++++++++++++++++++++++++++++-----
 1 files changed, 64 insertions(+), 11 deletions(-)

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 c0fb61a..135532a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py
@@ -42,7 +42,7 @@
 import PlayerRune
 import Operate_EquipStone
 import Operate_EquipWash
-import Operate_EquipSuitCompose
+import PlayerFeastRedPacket
 import PlayerDogz
 import QuestCommon
 import DataRecordPack
@@ -85,7 +85,6 @@
         SetSuccFinish(curPlayer, succID, 0)
         
         Sync_SuccTypeIndexAwardRecord(curPlayer, [succID], True) #设置成未领取的在外层同步
-        PlayerMagicWeapon.ActiveMagicWeapon(curPlayer, succID)
         EventShell.EventRespons_SuccessFinish(curPlayer, succID)
         
     return 
@@ -276,6 +275,7 @@
                             ShareDefine.SuccType_MainTaskNode,
                             ShareDefine.SuccType_InlayGatherSoul,
                             ShareDefine.SuccType_GatherSoulLvUp,
+                            ShareDefine.SuccType_UseStoveBylv,
                              ]
     
     curCheckVersion = GetPDictValue(curPlayer, ChConfig.Def_PDict_Success_CheckVersion)
@@ -300,6 +300,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)
@@ -318,7 +319,7 @@
             ResetSuccessByType(curPlayer, succType)
             for pType, indexList in ChConfig.Pack_EquipPart_CanPlusStar.items():
                 for i in indexList:
-                    equipPartStarLV = ChEquip.GetEquipPartStarLV(curPlayer, pType, i)
+                    equipPartStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, pType, i)
                     for pluslv in xrange(1, equipPartStarLV+1):
                         DoAddSuccessProgress(curPlayer, succType, 1, [pluslv])
                     
@@ -329,6 +330,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)
@@ -350,6 +352,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)
@@ -357,15 +360,17 @@
                     curSkillLV = curSkill.GetSkillLV()
                     UptateSuccessProgress(curPlayer, succType, curSkillLV, [curSkill.GetSkillTypeID()])
             
-        elif succType == ShareDefine.SuccType_EquipSuit:
-            Operate_EquipSuitCompose.DoSuiteSuccess(curPlayer)
+#        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:
@@ -392,6 +397,17 @@
                 missionID = succData.condition[0]
                 if QuestCommon.GetHadFinishMainMission(curPlayer, missionID):
                     DoAddSuccessProgress(curPlayer, succType, 1, [missionID])
+        elif succType == ShareDefine.SuccType_UseStoveBylv:
+            ResetSuccessByType(curPlayer, succType)
+            for i in xrange(ipyDataMgr.GetAttrFruitCount()):
+                ipyData = ipyDataMgr.GetAttrFruitByIndex(i)
+                fruitItemID = ipyData.GetID()
+                hasUseCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_AttrFruitEatCnt % fruitItemID)
+                if ipyData.GetFuncID() == ShareDefine.Def_AttrFruitFunc_Stove:
+                    itemData = GameWorld.GetGameData().GetItemByTypeID(fruitItemID)
+                    if not itemData:
+                        continue
+                    DoAddSuccessProgress(curPlayer, succType, hasUseCnt, [itemData.GetLV()])
                     
     DataRecordPack.DR_CheckOldPlayerSuccess(curPlayer)
     SetPDictValue(curPlayer, ChConfig.Def_PDict_Success_CheckVersion, initGameWorldTime)
@@ -418,6 +434,29 @@
             SetSuccHasGot(curPlayer, succID, False)
             resetList.append(succID)
             GameWorld.DebugLog("    OnWeek 重置成就类型: succID=%s" % (succID))
+    if resetList:
+        Sync_SuccTypeIndexAwardRecord(curPlayer, resetList, True)
+        Sync_SuccessInfo(curPlayer, resetList, True)
+    return
+
+def DoResetSuccessIDList(curPlayer, resetSuccIDList):
+    ## 重置成就相关数据
+    if not resetSuccIDList:
+        return
+    resetList = []
+    for succID in resetSuccIDList:
+        succData = GetSuccDataMng().GetSuccessData(succID)
+        if not succData:
+            continue
+        succType = succData.succType
+        condition = succData.condition
+        #if not GetSuccFinishValue(curPlayer, succType, condition):
+        #    continue
+        SetSuccFinishValue(curPlayer, succType, condition, 0)
+        SetSuccFinish(curPlayer, succID, False)
+        SetSuccHasGot(curPlayer, succID, False)
+        resetList.append(succID)
+        GameWorld.DebugLog("    重置成就类型: succType=%s,succID=%s" % (succType, succID))
     if resetList:
         Sync_SuccTypeIndexAwardRecord(curPlayer, resetList, True)
         Sync_SuccessInfo(curPlayer, resetList, True)
@@ -522,11 +561,11 @@
         
         itemQuality = curEquip.GetItemQuality()
         classLV = ItemCommon.GetItemClassLV(curEquip)
-        if equipIndex not in [ShareDefine.retWing,ShareDefine.retGuard,ShareDefine.retHorse]:
+        if equipIndex not in [ShareDefine.retWing,ShareDefine.retGuard1,ShareDefine.retGuard2,ShareDefine.retHorse]:
             DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipColorItem, 1, [classLV, itemColor])
-        if equipIndex in ChConfig.BaseEquipPlace_Weapon:
+        if equipIndex in ChConfig.EquipPlace_BaseWeapon:
             DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipWeapon, 1, [itemColor, itemQuality, classLV])
-        elif equipIndex in ChConfig.BaseEquipPlace_Armor:
+        elif equipIndex in ChConfig.EquipPlace_BaseArmor:
             DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_EquipArmor, 1, [itemColor, itemQuality, classLV])
         
         elif equipIndex == ShareDefine.retWing:
@@ -542,6 +581,9 @@
 def UptateSuccessProgress(curPlayer, successType, newCnt, condition=[]):
     if successType not in ShareDefine.SuccessTypeList:
         return
+    if successType in ShareDefine.FeastRedPackSuccessTypeList:
+        if not PlayerFeastRedPacket.GetFeastRedPacketState():
+            return
     succInfoList = GetSuccDataMng().GetSuccDataByType(successType)
     if not succInfoList:
         return
@@ -563,6 +605,11 @@
     succID = succDataObj.succID
     cond = succDataObj.condition
     
+    if successType in ShareDefine.FeastRedPackSuccessTypeList:
+        todayFeastSuccIDList = PlayerFeastRedPacket.GetTodayFeastSuccIDList()
+        if not todayFeastSuccIDList or succID not in todayFeastSuccIDList:
+            #GameWorld.DebugLog("    非今日节日红包成就,不增加进度! succID=%s,todayFeastSuccIDList=%s" % (succID, todayFeastSuccIDList))
+            return
     isUnDownCheck = successType in ShareDefine.UnDownCheckSuccessTypeList
     isContain = successType in ShareDefine.ContainSuccessTypeList
     # 已完成的不再检查
@@ -633,7 +680,14 @@
 def DoAddSuccessProgress(curPlayer, successType, addCnt, condition=[], delayCalc=True):
     #GameWorld.DebugLog("DoAddSuccessProgress type=%s,addCnt=%s,condition=%s" 
     #                   % (successType, addCnt, condition), curPlayer.GetPlayerID())
-
+    if GameWorld.IsCrossServer():
+        return
+    
+    if successType in ShareDefine.FeastRedPackSuccessTypeList:
+        if not PlayerFeastRedPacket.GetFeastRedPacketState():
+            #GameWorld.DebugLog("非节日红包活动时间,不增加成就!successType=%s" % successType)
+            return
+        
     playerID = curPlayer.GetID()
     if delayCalc and successType not in ShareDefine.NeedResetSuccessTypeList:
         if playerID not in PyGameData.g_delaySuccessDict:
@@ -956,8 +1010,7 @@
     # 给物品
     if isGiveItem:
         for itemID, itemCnt in itemDict.items():
-            isPutIn = ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 1,
-                                                   [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere], True)
+            isPutIn = ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem, IPY_GameWorld.rptAnyWhere])
        
     #给钱
     for moneyType, value in succData.moneyDict.items():

--
Gitblit v1.8.0