From e990ceeb00e653f95308d0636245c412afd581b2 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期二, 28 五月 2024 17:06:16 +0800
Subject: [PATCH] 10170 【越南】【主干】【港台】终身卡

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py        |    2 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py           |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py                  |   26 +++++++++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py           |   34 +++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                          |    3 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py |    4 +
 6 files changed, 61 insertions(+), 10 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 64f234c..9308f44 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -5724,7 +5724,8 @@
 InvestType_Login, # 登录 9
 InvestType_LV, # 等级 10
 InvestType_Boss, # Boss 11
-) = range(7, 7 + 5)
+InvestType_Life, # 终身卡 12
+) = range(7, 7 + 6)
 
 
 #前端特殊新手引导存储标记
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
index 8cf0ca5..877ff44 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -106,6 +106,7 @@
 import NetPackCommon
 import NPCCommon
 import PlayerVip
+import PlayerGoldInvest
 import GameObj
 
 import math
@@ -4966,11 +4967,14 @@
     EventRespons_OnFinishTask(curPlayer, taskID, rewardPer)
     return
 
-## A2 06 快速完成任务#tagCMQuickFinishMission
-#  @param index 索引
-#  @param clientData 封包结构体
-#  @param tick 时间戳
-#  @return None
+#// A2 06 快速完成任务#tagCMQuickFinishMission
+#
+#struct tagCMQuickFinishMission
+#{
+#    tagHead         Head;
+#    DWORD        MissionID;
+#    BYTE        DoType; // 0-只完成本次;1-完成所有环任务
+#};
 def PlayerQuickFinishTask(index, clientData, tick):
     missionID = clientData.MissionID
     if missionID <= 0:
@@ -4980,8 +4984,16 @@
     doType = clientData.DoType
     if doType == 1:
         EventRespons_OnQuickFinishAllAround(curPlayer, missionID)
-    else:
-        EventRespons_OnQuickFinishTask(curPlayer, missionID)
+        return
+    
+    isFree = PlayerGoldInvest.CanQuickFinishMissionFree(curPlayer)
+    costMoneyInfo = IpyGameDataPY.GetFuncEvalCfg("QuickFinishMission", 1)
+    if costMoneyInfo and not isFree:
+        moneyType, moneyValue = costMoneyInfo
+        if not PlayerControl.PayMoney(curPlayer, moneyType, moneyValue, ChConfig.Def_Cost_MissionDel, {"MissionID":missionID}):
+            return
+        
+    EventRespons_OnQuickFinishTask(curPlayer, missionID)
     return
 
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py
index 7621542..c3ee276 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ClearInvest.py
@@ -32,7 +32,7 @@
     if not msgList:
         GameWorld.DebugAnswer(curPlayer, "重置所有投资: ClearInvest 0")
         GameWorld.DebugAnswer(curPlayer, "重置指定投资: ClearInvest 类型")
-        GameWorld.DebugAnswer(curPlayer, "类型:7-永久卡;8-周卡;9-登录卡;10-等级卡;11-boss卡;")
+        GameWorld.DebugAnswer(curPlayer, "类型:7-永久卡;8-周卡;9-登录卡;10-等级卡;11-boss卡;;12-终身卡;")
         return
     
     investType = msgList[0]
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py
index fa96457..1b427db 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/BossHurtMng.py
@@ -50,6 +50,7 @@
 import ChConfig
 import FBLogic
 import PlayerVip
+import PlayerGoldInvest
 
 import operator
 import json
@@ -571,6 +572,7 @@
         limitCnt = PlayerVip.GetPrivilegeValue(curPlayer, killLimitPrivilege)
     else:
         limitCnt = IpyGameDataPY.GetFuncEvalCfg('KillBossCntLimit', 2, {}).get(bossFuncIndex, 0)
+    limitCnt += PlayerGoldInvest.GetAddBossCnt(curPlayer, bossFuncIndex) # 投资卡加上限
     return max(0, limitCnt + itemAddKillCnt + hasBuyCnt - hasKillCnt), limitCnt
 
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
index f4dc653..207155a 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GameWorldLogic/FBProcess/FBCommon.py
@@ -38,6 +38,7 @@
 import GameObj
 import FBLogic
 import ChConfig
+import PlayerGoldInvest
 
 import datetime
 import random
@@ -1579,7 +1580,8 @@
     recoverFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RecoverFbCnt % mapID)
     itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
     regainFbCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_RegainFbCnt % mapID)
-    maxCnt = maxTimes + regainFbCnt + extraCnt + buyCnt + recoverFbCnt + mwAddCnt + itemAddCnt
+    investFBCnt = PlayerGoldInvest.GetAddFBCnt(curPlayer, mapID)
+    maxCnt = maxTimes + regainFbCnt + extraCnt + buyCnt + recoverFbCnt + mwAddCnt + itemAddCnt + investFBCnt
     return maxCnt
 
 def GetFBDetailCntInfo(curPlayer, mapID):
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
index 7591379..abbbfd2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerGoldInvest.py
@@ -88,6 +88,11 @@
                 PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestProgress % (investType, 0), progressValue)
                 GameWorld.DebugLog("更新登录投资可领奖天数进度: %s" % progressValue)
                 
+        # 终身卡
+        elif investType == ChConfig.InvestType_Life:
+            for keyNum in range(ChConfig.Def_PDict_InvestKeyCount):
+                PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestReward % (investType, keyNum), 0)
+                
         Sync_InvestInfo(curPlayer, investType)
     return
 
@@ -175,6 +180,31 @@
                 if itemID in [20, 30]: # 单位1的仙玉、灵石
                     totalGold += itemCount
     return totalGold
+
+def GetAddBossCnt(curPlayer, bossFuncIndex):
+    ## 获取增加的boss次数上限
+    addBossCnt = 0
+    if GetInvestState(curPlayer, ChConfig.InvestType_Life):
+        lifeCardAddBossCntDict = IpyGameDataPY.GetFuncEvalCfg("InvestPower", 1, {})
+        lifeCardAddCnt = lifeCardAddBossCntDict.get(str(bossFuncIndex), 0)
+        addBossCnt += lifeCardAddCnt
+    return addBossCnt
+
+def GetAddFBCnt(curPlayer, mapID):
+    ## 获取增加的副本次数上限
+    addFBCnt = 0
+    if GetInvestState(curPlayer, ChConfig.InvestType_Life):
+        lifeCardAddFBCntDict = IpyGameDataPY.GetFuncEvalCfg("InvestPower", 2, {})
+        lifeCardAddCnt = lifeCardAddFBCntDict.get(str(mapID), 0)
+        addFBCnt += lifeCardAddCnt
+    return addFBCnt
+
+def CanQuickFinishMissionFree(curPlayer):
+    ## 可否免费快速完成任务
+    for investType in IpyGameDataPY.GetFuncEvalCfg("InvestPower", 3):
+        if GetInvestState(curPlayer, investType):
+            return True
+    return False
 
 def OnKillBoss(curPlayer, npcID):
     ## 参与击杀boss
@@ -275,6 +305,10 @@
             GameWorld.DebugLog("    Boss投资无参与击杀该boss,无法领取! rewardIndex=%s" % (rewardIndex))
             return
         
+    # 终身卡
+    elif investType == ChConfig.InvestType_Life:
+        pass
+    
     else:
         return
     

--
Gitblit v1.8.0