From 49ff30c38b97398b69f3d0310a9484aa483e6b4c Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期日, 25 十一月 2018 13:49:56 +0800
Subject: [PATCH] 4762 助战NPC表增加助战NPC生命系数字段配置;

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py |   66 +++++++++++++++++++++++++++++++--
 1 files changed, 62 insertions(+), 4 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
index eef830d..b14d26d 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
@@ -192,6 +192,14 @@
 
 ## 登录
 def ShopItemOnLogin(curPlayer):
+    if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_SuperGift):
+        GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_SuperGift, 1)
+        isGet = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GoldGiftFirstRecord)
+        if isGet:#首充奖励已领取则代表超值礼包已开启过,
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftHasOpen, 1)
+            
+    
+    SyncMysticalShopInfo(curPlayer)
     SyncShopItemTodayBuyCount(curPlayer)
     SyncSuperGiftInfo(curPlayer)
     return
@@ -272,6 +280,49 @@
         syncIndexList.append(shopItem.GetID())
     if syncIndexList:
         SyncShopItemTodayBuyCount(curPlayer, syncIndexList, True)
+    return
+
+def MysticalShopOpen(curPlayer, befLV, aftLV):
+    ##神秘限购开启
+    ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('Store', {'ShopType':16}, True)
+    if not ipyDataList:
+        return
+    curTime = int(time.time())
+    syncGoodsList = []
+    for ipyData in ipyDataList:
+        limitLV = ipyData.GetLimitLV()
+        if befLV < limitLV and aftLV >= limitLV:
+            goodsID = ipyData.GetID()
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShopItemStartTime % goodsID, curTime)
+            syncGoodsList.append(goodsID)
+            GameWorld.DebugLog('神秘限购商品%s 开卖'%goodsID, curPlayer.GetID())
+    if syncGoodsList:
+        SyncMysticalShopInfo(curPlayer)
+    return
+
+def SyncMysticalShopInfo(curPlayer):
+    ##神秘限购通知
+    packData = ChPyNetSendPack.tagMCMysticalShopTimeInfo()
+    packData.ShopTimeList = []
+    ipyDataList = IpyGameDataPY.GetIpyGameDataByCondition('Store', {'ShopType':16}, True)
+    curTime = int(time.time())
+    for ipyData in ipyDataList:
+        goodsID = ipyData.GetID()
+        startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopItemStartTime % goodsID)
+        if not startTime:
+            continue
+        if curTime - startTime >= ipyData.GetLimitValue():
+            #超时的重置
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShopItemStartTime % goodsID, 0)
+        else:
+            goodsTime = ChPyNetSendPack.tagMCMysticalShopTime()
+            goodsTime.GoodsID = goodsID
+            goodsTime.StartTime = startTime
+            packData.ShopTimeList.append(goodsTime)
+    if not packData.ShopTimeList:
+        return
+    packData.Count = len(packData.ShopTimeList)
+    NetPackCommon.SendFakePack(curPlayer, packData)
     return
 
 ## 回购物品
@@ -541,8 +592,6 @@
     SyncShoppingResult(curPlayer, itemIndex, clientBuyCount)
     if itemIndex in IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 1, {}).values():
         PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_Fireworks, clientBuyCount)
-    if itemIndex in dict(IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList')):
-        UpdataSuperGiftTime(curPlayer)
     return
 
 def __GetShopJobItem(job, itemID, jobItemList):
@@ -588,8 +637,13 @@
     if itemIndex in IpyGameDataPY.GetFuncEvalCfg('CeremonyFireParty', 1, {}).values():
         return not PlayerFairyCeremony.IsCanBuyFireworks(curPlayer, itemIndex)
     
-    if itemIndex in dict(IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList')):
-        return not CheckSuperGiftBuy(curPlayer, itemIndex)
+#    if itemIndex in dict(IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList')):
+#        return not CheckSuperGiftBuy(curPlayer, itemIndex)
+    if shopNPCID == 16:#神秘限购
+        startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShopItemStartTime % itemIndex)
+        curTime = int(time.time())
+        return not startTime or curTime - startTime >= limitValue
+        
 #    
 #    limitPlusDict = {shopItem.GetLimitPlusType1():shopItem.GetLimitPlusValue1(),
 #                     shopItem.GetLimitPlusType2():shopItem.GetLimitPlusValue2(),
@@ -640,6 +694,10 @@
             #活动结束 重置
             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, 0)
     else:
+        if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_SuperGiftHasOpen):
+            #老号已开启过超值礼包则不再开启
+            return
+        
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_SuperGiftStartTime, curTime)
         addItemList = IpyGameDataPY.GetFuncEvalCfg('SuperGiftTimeList', 2)
         PlayerControl.SendMailByKey('SellMail2', [curPlayer.GetID()], addItemList)

--
Gitblit v1.8.0