From 552f4ce1704ee326eded21f56f032c7db0e11f4f Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 27 四月 2019 20:10:09 +0800
Subject: [PATCH] 6603 【后端】【2.0】增加新版的sp和被动技能  --  删除废弃效果

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py |   50 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 30 insertions(+), 20 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py
index 4736a3a..6019b4e 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerWishingWell.py
@@ -30,10 +30,11 @@
 import ItemControler
 import ItemCommon
 
+import datetime
 import time
 
 g_randomWellDict = {}
-g_specialMarkDict = {}
+
 
 (
 WellType_Select,  #可选库
@@ -73,16 +74,19 @@
         if actCostRebateInfo.get(ShareDefine.ActKey_State):
             SyncWishingWellInfo(curPlayer)
             SyncWishingWellPlayerInfo(curPlayer)
+        elif __GetItemInfoByData(curPlayer, WellType_Get, 0)[0]:
+            SyncWishingWellPlayerInfo(curPlayer)
     return
 
 def OnDay(curPlayer):
     actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
     if not actCostRebateInfo.get(ShareDefine.ActKey_State):
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellFreeTime, 0)
         __SendWishingWellMail(curPlayer, int(time.time()))
     return
 
 def RefreshWishingWellAction():
-    #__InitWishRateList()
+    __InitWishRateList()
     playerManager = GameWorld.GetPlayerManager()
     for i in xrange(playerManager.GetPlayerCount()):
         curPlayer = playerManager.GetPlayerByIndex(i)
@@ -95,7 +99,7 @@
 def __CheckPlayerWishingWellAction(curPlayer):
     ## 检查玩家许愿池活动数据信息
     global g_randomWellDict
-    global g_specialMarkDict
+
     playerID = curPlayer.GetPlayerID()
     
     actWishingWellInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
@@ -114,17 +118,20 @@
                        % (WishingWellID, playerWishingWellID, state, worldLV), playerID)
     
     # 未领取的奖励邮件发放
-    __SendWishingWellMail(curPlayer, WishingWellID or int(time.time()), state)
+    curDataTime = GameWorld.GetCurrentTime()
+    curDayTime = datetime.datetime(curDataTime.year, curDataTime.month, curDataTime.day, 0, 0, 0)
+    curDayTimeNum = GameWorld.ChangeTimeStrToNum(str(curDayTime))
+    __SendWishingWellMail(curPlayer, WishingWellID or curDayTimeNum, state)
         
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellID, WishingWellID)
     #每天开始随机一次免费盘
     if state:
-        g_randomWellDict = {}
-        g_specialMarkDict = {}
+        #g_randomWellDict = {}
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellRefreshCnt, 0)
         __DoActWishingRefresh(curPlayer, 1, True)
  
         SyncWishingWellInfo(curPlayer)
-        SyncWishingWellPlayerInfo(curPlayer)
+    SyncWishingWellPlayerInfo(curPlayer)
     return True
 
 
@@ -134,9 +141,10 @@
     if not lastAwardTime:
         if state != -1:
             PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellAwardTime, curTime)
+            GameWorld.DebugLog('__SendWishingWellMail curTime =%s'%curTime)
         return
     GameWorld.DebugLog('许愿池未领取的奖励邮件发放检查 lastAwardTime=%s,state=%s,pass=%s'%(lastAwardTime, state, curTime - lastAwardTime))
-    passDay = (curTime - lastAwardTime)/86400
+    passDay = (curTime - lastAwardTime)/86000
     if passDay <= 0:
         return
     isOver = True
@@ -162,18 +170,20 @@
             mailItemList.append([itemID, itemCnt, isBind])
         __SetItemData(curPlayer, WellType_Result, i, 0, 0, 0, 0)
         j +=1
-    
+    if state > 0:
+        isOver = False
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellAwardTime, 0 if isOver else curTime)
     if mailItemList:
         PlayerControl.SendMailByKey('WishPool', [curPlayer.GetID()], mailItemList)
-    GameWorld.DebugLog('许愿池距离时间 passDay=%s,mailItemList=%s,saveItemList=%s,isOver=%s'%(passDay, mailItemList, saveItemList, isOver), curPlayer.GetID())
+        if state == -1:
+            SyncWishingWellPlayerInfo(curPlayer)
+    GameWorld.DebugLog('许愿池距离时间 passDay=%s,mailItemList=%s,saveItemList=%s,isOver=%s,curTime=%s'%(passDay, mailItemList, saveItemList, isOver, curTime), curPlayer.GetID())
     return
 
 
 def __InitWishRateList():
     ## 初始许愿池随机库
     global g_randomWellDict
-    global g_specialMarkDict
     actWishingWellInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
     state = actWishingWellInfo.get(ShareDefine.ActKey_State, 0)
     cfgID = actWishingWellInfo.get(ShareDefine.ActKey_CfgID, 0)
@@ -199,15 +209,14 @@
         isBind = ipyData.GetIsBind()
         weight = ipyData.GetWeight()
         mark = ipyData.GetMark()
+        rare = ipyData.GetRare()
         weightDict[isFree] = weightDict.get(isFree, 0) + weight
         if isFree not in g_randomWellDict:
             g_randomWellDict[isFree] = []
-        g_randomWellDict[isFree].append([weightDict[isFree], [itemID, itemCnt, isBind, mark]])
+        g_randomWellDict[isFree].append([weightDict[isFree], [itemID, itemCnt, isBind, mark, rare]])
         
-        groupID, rowID = mark / 100, mark % 100
-        if rowID > g_specialMarkDict.get(groupID, 0) % 100:
-            g_specialMarkDict[groupID] = mark
-    GameWorld.DebugLog('    初始许愿池随机库 g_randomWellDict=%s, g_specialMarkDict=%s' % (g_randomWellDict, g_specialMarkDict))
+        
+    GameWorld.DebugLog('    初始许愿池随机库 g_randomWellDict=%s' % (g_randomWellDict))
     return
 
 
@@ -275,8 +284,8 @@
         PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellFreeTime, int(time.time()))
         
     for i, info in enumerate(randomResultList):
-        itemID, itemCnt, isBind, mark = info
-        isSpecial = 1 if mark in g_specialMarkDict.values() else 0
+        itemID, itemCnt, isBind, mark, rare = info
+        isSpecial = rare
         __SetItemData(curPlayer, WellType_Select, i, itemID, itemCnt, isBind, isSpecial)
     GameWorld.DebugLog(' 许愿池活动刷新 isFree=%s, randomResultList=%s' % (isFree, randomResultList), playerID)
     return
@@ -351,7 +360,7 @@
         PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_998371")
         return
     for itemID, itemCnt, isBind in giveItemList:
-        ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, isBind, [IPY_GameWorld.rptItem])
+        ItemControler.GivePlayerItem(curPlayer, itemID, itemCnt, 0, [IPY_GameWorld.rptItem])
     for i in xrange(count):
         __SetItemData(curPlayer, WellType_Get, i, 0, 0, 0, 0)
     SyncWishingWellPlayerInfo(curPlayer)
@@ -379,12 +388,13 @@
     actInfo.WellItemInfo = []
     randomItemList = __GetRandomRateList(0)
     for itemInfo in randomItemList:
-        itemID, itemCnt, isBind, mark = itemInfo[1]
+        itemID, itemCnt, isBind, mark, rare = itemInfo[1]
         wellItemInfo = ChPyNetSendPack.tagMCWishingWellItem()
         wellItemInfo.ItemID = itemID
         wellItemInfo.ItemCnt = itemCnt
         wellItemInfo.IsBind = isBind
         wellItemInfo.Mark = mark
+        wellItemInfo.Rare = rare
         actInfo.WellItemInfo.append(wellItemInfo)
     actInfo.Count = len(actInfo.WellItemInfo)
     NetPackCommon.SendFakePack(curPlayer, actInfo)

--
Gitblit v1.8.0