From 7cbe12e27c113622f8315600059211ab37093731 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期二, 02 七月 2019 16:24:32 +0800
Subject: [PATCH] 7699 【2.0.200】【后端】VIP功能新BOSS之家购买次数 7724 【后端】【主干】分解获得仙丹材料的体验优化

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py |   57 +++++++++++++++++++++++++++++----------------------------
 1 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
index 13ea2ee..054ad18 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -6299,34 +6299,35 @@
 #};
 ## 购买BOSS可击杀次数
 def OnBuyKillBossCnt(index, clientData, tick):
-#    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
-#    killBossMark = clientData.KillBossMark
-#    killBossCntLimitDict = ReadChConfig.GetEvalChConfig("KillBossCntLimit")
-#    curBossLimitInfo = []
-#    for limitInfo in killBossCntLimitDict.values():
-#        if killBossMark == limitInfo[0]:
-#            curBossLimitInfo = limitInfo
-#            break
-#    if not curBossLimitInfo:
-#        return
-#    
-#    killBossMark, limitCnt, canBuyCnt, buyCost, sysMark1, sysMark2= curBossLimitInfo
-#    hasKillCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Boss_KillCnt%killBossMark, 0)
-#    hasBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Boss_KillCntBuyCnt%killBossMark, 0)
-#    playerID = curPlayer.GetPlayerID()
-#    if hasBuyCnt >= canBuyCnt:
-#        GameWorld.Log('购买BOSS可击杀次数, 已达到今日最大可购买次数,hasBuyCnt=%s, canBuyCnt=%s'%(hasBuyCnt, canBuyCnt), playerID)
-#        return
-#    costGold = eval(buyCost)
-#    infoDict = {"index":index, ChConfig.Def_Cost_Reason_SonKey:index}
-#    isOK = PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costGold, 
-#                                  ChConfig.Def_Cost_BuyKillBossCnt, infoDict)
-#    
-#    if not isOK:
-#        return
-#    # 增加购买次数
-#    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Boss_KillCntBuyCnt%killBossMark, hasBuyCnt + 1)
-#    BossHurtMng.NotifyAttackBossCnt(curPlayer)
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    killBossMark = clientData.KillBossMark
+    buyTimesVIPPriID = IpyGameDataPY.GetFuncEvalCfg("KillBossCntLimit1", 1, {}).get(killBossMark)
+    if not buyTimesVIPPriID:
+        return
+    canBuyCnt = PlayerVip.GetPrivilegeValue(curPlayer, buyTimesVIPPriID)
+    hasBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Boss_KillCntBuyCnt%killBossMark, 0)
+    playerID = curPlayer.GetPlayerID()
+    if hasBuyCnt >= canBuyCnt:
+        GameWorld.DebugLog('购买BOSS可击杀次数, 已达到今日最大可购买次数,hasBuyCnt=%s, canBuyCnt=%s'%(hasBuyCnt, canBuyCnt), playerID)
+        return
+    canKillCnt, dayTimesLimit = BossHurtMng.GetCanKillBossCnt(curPlayer, killBossMark)
+    if canKillCnt >= dayTimesLimit:
+        GameWorld.DebugLog('购买BOSS可击杀次数, 剩余次数已满!,canKillCnt=%s'%(canKillCnt), playerID)
+        return
+    
+    costGold = IpyGameDataPY.GetFuncEvalCfg("KillBossCntLimit1", 2, {}).get(killBossMark)
+    if not costGold:
+        return
+    
+    infoDict = {"index":killBossMark, ChConfig.Def_Cost_Reason_SonKey:killBossMark}
+    isOK = PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, costGold, 
+                                  ChConfig.Def_Cost_BuyKillBossCnt, infoDict)
+    
+    if not isOK:
+        return
+    # 增加购买次数
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Boss_KillCntBuyCnt%killBossMark, hasBuyCnt + 1)
+    BossHurtMng.NotifyAttackBossCnt(curPlayer, killBossMark)
     return
 
 #// A2 23 NPC秀结束 #tagCMNPCShowEnd

--
Gitblit v1.8.0