From 787c076b2fdc73a11b9b76e2ea928f3da1f5873e Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 19 十二月 2019 16:35:02 +0800
Subject: [PATCH] 8359 【主干】活跃兑换

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ActivityPlace.py  |   52 ++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py |   22 --
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini                        |    6 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py      |  286 ++++++++++++++++++++++++++++++++---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py              |   38 ++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py            |    6 
 PySysDB/PySysDBPY.h                                                                               |   13 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py   |    2 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py                   |   30 ++-
 9 files changed, 390 insertions(+), 65 deletions(-)

diff --git a/PySysDB/PySysDBPY.h b/PySysDB/PySysDBPY.h
index b7a92ee..f3d4730 100644
--- a/PySysDB/PySysDBPY.h
+++ b/PySysDB/PySysDBPY.h
@@ -888,6 +888,19 @@
 	list		ItemBind;	//是否绑定
 };
 
+//日常活跃放置表
+
+struct tagActivityPlaceReward
+{
+	BYTE		_ID;	//ID
+	BYTE		PlaceCount;	//放置定制次数
+	WORD		PlaceMaxLV;	//最大等级
+	list		FixedItemRewardList;	//固定奖励 [[物品ID, 个数], ...]
+	BYTE		RandItemCountA;	//饼图奖励次数A
+	list		RandItemRewardListA;	//饼图奖励库A [[饼图概率,物品ID], ...]  物品ID支持0
+	BYTE		RandItemCountB;	//饼图奖励次数B
+	list		RandItemRewardListB;	//饼图奖励库B [[饼图概率,物品ID], ...]  物品ID支持0
+};
 
 //炼丹炉等级表
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
index e58a32c..f048ca2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/PyNetPack.ini
@@ -1416,12 +1416,16 @@
 Writer = xdh
 Releaser = xdh
 RegType = 0
-RegisterPackCount = 1
+RegisterPackCount = 2
 
 PacketCMD_1=0xA5
 PacketSubCMD_1=0x25
 PacketCallFunc_1=OnDailyActionBuyCnt
 
+PacketCMD_2=0xB0
+PacketSubCMD_2=0x27
+PacketCallFunc_2=OnActivityPlaceStart
+
 ;协助
 [PlayerAssist]
 ScriptName = Player\PlayerAssist.py
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index ec439b6..72d7166 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3833,12 +3833,19 @@
 # 每日活跃度
 Def_PDict_Activity_FinishCnt = "Activity_FinishCnt_%s"  # 活跃度类型对应完成次数
 Def_PDict_Activity_TotalPoint = "Activity_TotalPoint"  # 当前总活跃值(不可消耗)
-Def_PDict_ActivityCanCostTotalPoint = "ActivityCanCostTotalPoint"  # 当前总活跃值(可消耗)
-Def_PDict_ActivityHistoryPoint = "ActivityHistoryPoint"  # 累积获得活跃值
 Def_PDict_ActivityAwardRecord = "ActivityAwardRecord"  # 活跃度奖励领取记录,按二进制位标识
-Def_PDict_Activity_AwardStage = "Activity_AwardStage"  # 当前活跃奖励阶段
-Def_PDict_Activity_RealmPoint = "Activity_RealmPoint"  # 当前可领修行点
+Def_PDict_Activity_AwardStage = "Activity_AwardStage"  # 当前活跃奖励阶段,对应不同境界段
 Def_PDict_Activity_ExtraRealmPoint = "Activity_ExtraRealmPoint"  # 多倍活动额外获得的修行点
+
+# 活跃放置
+Def_PDict_ActivityCanCostTotalPoint = "ActivityCanCostTotalPoint"  # 当前总活跃值(可消耗)
+Def_PDict_ActivityPlaceState = "ActivityPlaceState" # 活跃放置是否探索中
+Def_PDict_ActivityPlaceStartTime = "ActivityPlaceStartTime" # 活跃放置开始time值
+Def_PDict_ActivityPlaceRewardTotalCount = "ActivityPlaceRewardTotalCount" # 活跃放置总共累计奖励次数
+Def_PDict_ActivityPlaceRewardCount = "ActivityPlaceRewardCount" # 活跃放置累计奖励次数
+Def_PDict_ActivityPlaceRewardItem = "ActivityPlaceItem" # 奖励物品个数
+Def_PDict_ActivityPlaceRewardItemID = "ActivityPlaceItemID_%s" # 奖励物品ID,参数(index)
+Def_PDict_ActivityPlaceRewardItemCount = "ActivityPlaceItemCount_%s" # 奖励物品个数,参数(index)
 
 # 每日活动
 Def_PDict_DailyActionDayTimes = "DailyActionDayTimes_%s"  # 每日活动今日完成次数 参数每日活动ID
@@ -4681,6 +4688,7 @@
 Def_Cost_CreatFamily, # 创建仙盟
 Def_Cost_BuyKillBossCnt, #购买boss次数
 Def_Cost_EquipStar, #装备升星
+Def_Cost_ActivityPlace, #活跃放置 50
 #-----------以下为暂时没用的,先不删除,如有新增消费点则放在这些之前------------
 Def_Cost_RefreshArrestTask, # 刷新悬赏任务
 Def_Cost_OffLineExp, # 兑换离线经验
@@ -4693,7 +4701,7 @@
 Def_Cost_Trade, # 交易
 Def_Cost_Rename, # 改名
 Def_Cost_SkillLvUp, # 技能升级
-) = range(2000, 2000 + 61)
+) = range(2000, 2000 + 62)
 
 Def_Cost_Reason_SonKey = "reason_name_son" # 消费点原因子类说明key
 
@@ -4776,6 +4784,7 @@
 Def_Cost_CreatFamily:"CreatFamily",
 Def_Cost_BuyKillBossCnt:"BuyKillBossCnt",
 Def_Cost_EquipStar:"EquipStar",
+Def_Cost_ActivityPlace:"ActivityPlace",
 }
 ## -----------------------------------------------------
 
@@ -4937,14 +4946,15 @@
 ItemDel_AddKillBossCnt, # 增加BOSS可击杀次数 32
 ItemDel_DogzEquipPlus, # 神兽装备强化
 ItemDel_ChatBubbleBox, # 激活聊天气泡框
-ItemDel_GatherSoul, # 聚魂分解
+ItemDel_GatherSoul, # 聚魂分解 35
 ItemDel_CoatDecompose, # 时装分解
 ItemDel_EquipEvolve, # 装备进阶
 ItemDel_EquipStarUp, # 装备升星
 ItemDel_EquipPlus, # 装备强化进化
-ItemDel_LingQiEquipBreak, # 灵器突破
+ItemDel_LingQiEquipBreak, # 灵器突破 40
 ItemDel_HorsePetAwake, # 骑宠觉醒 
-) = range(2000, 2000 + 42)
+ItemDel_ActivityPlace, # 活跃放置
+) = range(2000, 2000 + 43)
 
 # 物品扣除类型对应信息 {类型:eventName, ...}
 ItemDelTypeDict = {
@@ -4990,6 +5000,7 @@
                    ItemDel_EquipPlus:"EquipPlus",
                    ItemDel_LingQiEquipBreak:"LingQiEquipBreak",
                    ItemDel_HorsePetAwake:"HorsePetAwake",
+                   ItemDel_ActivityPlace:"ActivityPlace",
                    }
 
 ##==================================================================================================
@@ -5285,7 +5296,8 @@
 Def_RewardType_FairyAdventuresAward, #缥缈奇遇领取27
 Def_RewardType_HistoryChargeAward, #历史累计充值领取28
 Def_RewardType_DayFreeGoldGift, #每日免费直购礼包29
-)= range(30)
+Def_RewardType_ActivityPlace, #活跃放置奖励30
+)= range(31)
 
 
 #boss复活相关活动定义
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
index 4209422..54c80cd 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
@@ -7403,28 +7403,6 @@
     value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
     return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Activity_TotalPoint, 0) >= value
 
-
-##设置历史活跃度
-# @param curPlayer 玩家实例
-# @param curMission 任务实例
-# @param curActionNode节点信息
-# @return 返回值无意义
-# @remarks <Set_Historyactivity key=""/>
-def DoType_Set_Historyactivity(curPlayer, curMission, curActionNode):
-    key = curActionNode.GetAttribute("key")
-    questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
-    if questID != 0:
-        curMission = curPlayer.FindMission(questID)
-    curMission.SetProperty(key, curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityHistoryPoint, 0))
-    return
-
-##历史活跃度判断
-# @param None
-# @return None <Check_Historyactivity value="活跃度"/>
-def ConditionType_Check_Historyactivity(curPlayer, curMission, curActionNode):
-    value = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
-    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityHistoryPoint, 0) >= value
-
 ##设置仙宝寻主领奖进度
 # @param curPlayer 玩家实例
 # @param curMission 任务实例
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ActivityPlace.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ActivityPlace.py
new file mode 100644
index 0000000..5d94d5b
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/ActivityPlace.py
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+# -*- coding: GBK -*-
+#-------------------------------------------------------------------------------
+#
+##@package GM.Commands.ActivityPlace
+#
+# @todo:活跃放置
+# @author hxp
+# @date 2019-12-19
+# @version 1.0
+#
+# 详细描述: 活跃放置
+#
+#-------------------------------------------------------------------------------
+#"""Version = 2019-12-19 16:30"""
+#-------------------------------------------------------------------------------
+
+
+import GameWorld
+import PlayerActivity
+import ChConfig
+import PlayerControl
+
+#逻辑实现
+## GM命令执行入口
+#  @param curPlayer 当前玩家
+#  @param msgList 参数列表 [npcID]
+#  @return None
+#  @remarks 函数详细说明.
+def OnExec(curPlayer, msgList):
+    
+    if not msgList:
+        GameWorld.DebugAnswer(curPlayer, "重置放置: ActivityPlace 0")
+        return
+    
+    if len(msgList) == 1 and not msgList[0]:
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceState, 0)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, 0)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardTotalCount, 0)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardCount, 0)
+        
+        rewardItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItem)
+        for i in xrange(rewardItemCount):
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItemID % i, 0)
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItemCount % i, 0)
+            
+        GameWorld.DebugAnswer(curPlayer, "重置活跃放置成功!")
+        PlayerActivity.Sync_ActivityPlaceInfo(curPlayer)
+        return
+    
+    return
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
index eb6fca3..70374e4 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IpyGameDataPY.py
@@ -738,6 +738,17 @@
                         ("list", "ItemBind", 0),
                         ),
 
+                "ActivityPlaceReward":(
+                        ("BYTE", "ID", 1),
+                        ("BYTE", "PlaceCount", 0),
+                        ("WORD", "PlaceMaxLV", 0),
+                        ("list", "FixedItemRewardList", 0),
+                        ("BYTE", "RandItemCountA", 0),
+                        ("list", "RandItemRewardListA", 0),
+                        ("BYTE", "RandItemCountB", 0),
+                        ("list", "RandItemRewardListB", 0),
+                        ),
+
                 "RefineStove":(
                         ("BYTE", "StoveLV", 1),
                         ("DWORD", "UpNeedExp", 0),
@@ -3024,6 +3035,29 @@
     def GetItemCount(self): return self.ItemCount # 物品数量
     def GetItemBind(self): return self.ItemBind # 是否绑定
 
+# 日常活跃放置表
+class IPY_ActivityPlaceReward():
+    
+    def __init__(self):
+        self.ID = 0
+        self.PlaceCount = 0
+        self.PlaceMaxLV = 0
+        self.FixedItemRewardList = []
+        self.RandItemCountA = 0
+        self.RandItemRewardListA = []
+        self.RandItemCountB = 0
+        self.RandItemRewardListB = []
+        return
+        
+    def GetID(self): return self.ID # ID
+    def GetPlaceCount(self): return self.PlaceCount # 放置定制次数
+    def GetPlaceMaxLV(self): return self.PlaceMaxLV # 最大等级
+    def GetFixedItemRewardList(self): return self.FixedItemRewardList # 固定奖励 [[物品ID, 个数], ...]
+    def GetRandItemCountA(self): return self.RandItemCountA # 饼图奖励次数A
+    def GetRandItemRewardListA(self): return self.RandItemRewardListA # 饼图奖励库A [[饼图概率,物品ID], ...]  物品ID支持0
+    def GetRandItemCountB(self): return self.RandItemCountB # 饼图奖励次数B
+    def GetRandItemRewardListB(self): return self.RandItemRewardListB # 饼图奖励库B [[饼图概率,物品ID], ...]  物品ID支持0
+
 # 炼丹炉等级表
 class IPY_RefineStove():
     
@@ -4889,6 +4923,8 @@
         self.ipyDailyQuestLen = len(self.ipyDailyQuestCache)
         self.ipyDailyLivenessRewardCache = self.__LoadFileData("DailyLivenessReward", IPY_DailyLivenessReward)
         self.ipyDailyLivenessRewardLen = len(self.ipyDailyLivenessRewardCache)
+        self.ipyActivityPlaceRewardCache = self.__LoadFileData("ActivityPlaceReward", IPY_ActivityPlaceReward)
+        self.ipyActivityPlaceRewardLen = len(self.ipyActivityPlaceRewardCache)
         self.ipyRefineStoveCache = self.__LoadFileData("RefineStove", IPY_RefineStove)
         self.ipyRefineStoveLen = len(self.ipyRefineStoveCache)
         self.ipyAlchemyCache = self.__LoadFileData("Alchemy", IPY_Alchemy)
@@ -5365,6 +5401,8 @@
     def GetDailyQuestByIndex(self, index): return self.ipyDailyQuestCache[index]
     def GetDailyLivenessRewardCount(self): return self.ipyDailyLivenessRewardLen
     def GetDailyLivenessRewardByIndex(self, index): return self.ipyDailyLivenessRewardCache[index]
+    def GetActivityPlaceRewardCount(self): return self.ipyActivityPlaceRewardLen
+    def GetActivityPlaceRewardByIndex(self, index): return self.ipyActivityPlaceRewardCache[index]
     def GetRefineStoveCount(self): return self.ipyRefineStoveLen
     def GetRefineStoveByIndex(self, index): return self.ipyRefineStoveCache[index]
     def GetAlchemyCount(self): return self.ipyAlchemyLen
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
index b86ab85..98b18f8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/ChPlayer.py
@@ -5293,6 +5293,9 @@
     # 活跃度奖励
     if rewardType == ChConfig.Def_RewardType_Activity:
         PlayerActivity.GetActivityAward(curPlayer, dataEx)
+    # 活跃放置奖励
+    elif rewardType == ChConfig.Def_RewardType_ActivityPlace:
+        PlayerActivity.GetActivityPlaceReward(curPlayer)
     # 每日免费直购礼包
     elif rewardType == ChConfig.Def_RewardType_DayFreeGoldGift:
         PlayerCoin.OnGetDayFreeGoldGift(curPlayer)
@@ -5314,9 +5317,6 @@
     # 仙宝寻主奖励
     elif rewardType == ChConfig.Def_RewardType_XBXZ:
         PlayerMagicWeapon.OnGetXBXZAward(curPlayer, dataEx)
-    # 每日任务修行点奖励
-    elif rewardType == ChConfig.Def_RewardType_DayRealmPoint:
-        PlayerActivity.GetRealmPointAward(curPlayer)
     # 首充礼包奖励
     elif rewardType == ChConfig.Def_RewardType_GoldGiftFirst:
         PlayerGoldGift.GetPlayerGoldGiftFirst(curPlayer)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
index 6c610a3..416fb05 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
@@ -31,6 +31,7 @@
 import EventShell
 import PlayerPet
 import datetime
+import time
 
 #关联类型
 (
@@ -84,12 +85,6 @@
         __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint, 0)
         #重新计算奖励阶段
         __CalcAwardStage(curPlayer)
-        #重置可领取修行点,未领取的发邮件
-#        realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
-#        if realmPoint and GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Official):
-#            if GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_DailyQuest):
-#                PlayerControl.SendMailByKey('XXDForgetToPick', [curPlayer.GetID()], [(ChConfig.Def_ItemID_RealmPoint, realmPoint, 1)], [realmPoint])
-#            __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, 0)
         
         SyncDailyActivityInfo(curPlayer)
     else:
@@ -149,6 +144,8 @@
     SyncDailyActivityInfo(curPlayer)
     #同步日常活动次数
     SyncDailyActionInfo(curPlayer)
+    #活跃放置
+    Sync_ActivityPlaceInfo(curPlayer)
     return
 
 
@@ -279,17 +276,12 @@
         addValue = addValue + addExtraPoint
     curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
     __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, curTotalPoint + addValue)
-    AddCanCostActivityPoint(curPlayer, addValue, isLVUp)
-    historyPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityHistoryPoint)
-    __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityHistoryPoint,
-                    min(ChConfig.Def_UpperLimit_DWord, historyPoint + addValue))
-
+    __AddCanCostActivityPoint(curPlayer, addValue, isLVUp)
+    
     SyncDailyActivityInfo(curPlayer)
     EventShell.EventRespons_AddActivityValue(curPlayer)
-    GameWorld.DebugLog(
-        "增加活跃度,addValue=%s, multiple=%s, addExtraPoint=%s"
-        % (addValue, multiple, addExtraPoint), curPlayer.GetPlayerID())
-
+    GameWorld.DebugLog("增加活跃度,addValue=%s,multiple=%s,addExtraPoint=%s,isLVUp=%s" 
+                       % (addValue, multiple, addExtraPoint, isLVUp), curPlayer.GetPlayerID())
     return
 
 def __GetActionAddPer(curPlayer):
@@ -306,13 +298,13 @@
         return multiple, extraPointLimit
     return actRealmPointIpyData.GetMultiple(), actRealmPointIpyData.GetPointLimit()
 
-def AddCanCostActivityPoint(curPlayer, addValue, isLVUp):
+def __AddCanCostActivityPoint(curPlayer, addValue, isLVUp):
     # 增加可消耗的活跃点
     curPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint)
     if isLVUp:
         updPoint = min(ChConfig.Def_UpperLimit_DWord, curPoint + addValue)
     else:
-        maxPoint = IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint', 1)
+        maxPoint = IpyGameDataPY.GetFuncCfg('ActivityPlace', 1)
         if maxPoint and curPoint >= maxPoint:
             GameWorld.DebugLog("可消耗的活跃点超出上限,不增加! curPoint=%s,maxPoint=%s" % (curPoint, maxPoint))
             return
@@ -402,19 +394,6 @@
     GameWorld.DebugLog("领取活跃度奖励OK!awardStage=%s, index=%s,needActivity=%s,totalActivity=%s,awardRecord=%s" 
                        % (awardStage, awardIndex, needActivity, totalActivity, updAwardRecord))
     EventShell.EventRespons_ActivityAward(curPlayer, awardIndex)
-    return
-
-
-def GetRealmPointAward(curPlayer):
-    #领取活跃修行点
-    realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
-    if not realmPoint:
-        return
-    PlayerControl.GiveMoney(curPlayer, ShareDefine.TYPE_Price_RealmPoint, realmPoint)
-    __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, 0)
-    #totalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
-    #__SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, totalPoint+realmPoint)
-    SyncDailyActivityInfo(curPlayer)
     return
 
 
@@ -641,3 +620,250 @@
     if activityNum: 
         AddActivityFinishCnt(curPlayer, activityNum, curDayTimes, addCount)
     return
+
+
+################################## 活跃放置 ##############################################
+
+#// B0 27 活跃放置启动 #tagCMActivityPlaceStart
+#
+#struct    tagCMActivityPlaceStart
+#{
+#    tagHead        Head;
+#    BYTE        RewardEndType;    //是否结算探索,后端处理奖励后自动启动下一次放置探索;0-无结算启动,1-倒计时结束结算,2-快速结算;
+#};
+def OnActivityPlaceStart(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    rewardEndType = clientData.RewardEndType
+    
+    rewardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardCount)
+    maxRewardCount = IpyGameDataPY.GetFuncCfg("ActivityPlace", 4) # 最大累计放置奖励次数
+    if rewardCount >= maxRewardCount:
+        GameWorld.ErrLog("活跃放置奖励累计次数已达上限,无法启动")
+        return
+    
+    placeState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceState)
+    
+    endCount, nextStartReduceSeconds = 1, 0
+    
+    # 无结算启动
+    if rewardEndType == 0:
+        if placeState:
+            GameWorld.DebugLog("已在放置探索中!")
+            return
+        __DoActivityPlaceStart(curPlayer)
+        
+    # 倒计时结束结算
+    elif rewardEndType == 1:
+        if not placeState:
+            GameWorld.DebugLog("非放置探索中,无法结算!")
+            return
+        startTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceStartTime)
+        if not startTime:
+            return
+        needSeconds = IpyGameDataPY.GetFuncCfg("ActivityPlace", 3) # 单次放置奖励持续时间,秒
+        curTime = int(time.time())
+        passTime = curTime - startTime
+        if passTime < needSeconds:
+            GameWorld.DebugLog("探索时间未到,无法结算! curTime=%s,startTime=%s,passTime=%s < %s" % (curTime, startTime, passTime, needSeconds))
+            return
+        endCount = passTime / needSeconds
+        nextStartReduceSeconds = passTime % needSeconds
+        __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds)
+        
+    # 快速结算
+    elif rewardEndType == 2:
+        if not placeState:
+            GameWorld.DebugLog("非放置探索中,无法快速结算!")
+            return
+        
+        costItemID, costGoldParper = IpyGameDataPY.GetFuncEvalCfg("ActivityPlace", 5)
+        costItemCount = 1
+        
+        costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID, costItemCount)
+        lackCnt = costItemCount - bindCnt - unBindCnt
+        if lackCnt > 0:
+            if not PlayerControl.PayMoney(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, costGoldParper, ChConfig.Def_Cost_ActivityPlace):
+                return
+        else:
+            ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, ChConfig.ItemDel_ActivityPlace)
+            
+        __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds)
+        
+    Sync_ActivityPlaceInfo(curPlayer)
+    return
+
+def __DoActivityPlaceRewardEnd(curPlayer, endCount, nextStartReduceSeconds):
+    ## 放置活跃奖励结算
+    
+    if not endCount:
+        return
+    countDataDict = {}
+    lvDataDict = {}
+    ipyDataMgr = IpyGameDataPY.IPY_Data()
+    for index in xrange(ipyDataMgr.GetActivityPlaceRewardCount()):
+        ipyData = ipyDataMgr.GetActivityPlaceRewardByIndex(index)
+        placeCount = ipyData.GetPlaceCount()
+        placeMaxLV = ipyData.GetPlaceMaxLV()
+        if placeCount:
+            countDataDict[placeCount] = ipyData
+        else:
+            lvDataDict[placeMaxLV] = ipyData
+            
+    lvRewardIpyData = None
+    playerLV = curPlayer.GetLV()
+    lvList = sorted(lvDataDict.keys())
+    for lv in lvList:
+        if playerLV <= lv:
+            lvRewardIpyData = lvDataDict[lv]
+            break
+    if not lvRewardIpyData:
+        lvRewardIpyData = lvDataDict[lvList[-1]]
+        
+    costPoint = IpyGameDataPY.GetFuncCfg("ActivityPlace", 2) # 单次放置消耗的活跃点数
+    maxRewardCount = IpyGameDataPY.GetFuncCfg("ActivityPlace", 4) # 最大累计放置奖励次数
+    maxAppointCount = max(countDataDict) # 最大定制奖励次数
+    rewardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardCount)
+    
+    isStop = False
+    rewardItemDict = {}
+    GameWorld.DebugLog("结算放置活跃奖励: rewardCount=%s,endCount=%s,maxRewardCount=%s,maxAppointCount=%s" % (rewardCount, endCount, maxRewardCount, maxAppointCount))
+    for endIndex in xrange(endCount):
+        #GameWorld.DebugLog("endIndex=%s" % endIndex)
+        
+        # 超过1次的需要补扣活跃消耗
+        if endCount > 1 and endIndex != 0:
+            if not CostActivityPoint(curPlayer, costPoint):
+                isStop = True
+                GameWorld.DebugLog("    可消耗的活跃不足,无法继续结算奖励!")
+                break
+            
+        rewardIpyData = None
+        rewardTotalCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardTotalCount)
+        
+        # 加奖励次数
+        rewardCount += 1
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardCount, rewardCount)
+        if rewardTotalCount < maxAppointCount:
+            rewardTotalCount += 1
+            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardTotalCount, rewardTotalCount)
+            if rewardTotalCount in countDataDict:
+                rewardIpyData = countDataDict[rewardTotalCount]
+                #GameWorld.DebugLog("    取定制次数奖励")
+                
+        if not rewardIpyData:
+            rewardIpyData = lvRewardIpyData
+            #GameWorld.DebugLog("    取等级奖励: maxLV=%s" % rewardIpyData.GetPlaceMaxLV())
+            
+        # 固定奖励
+        for itemID, itemCount in rewardIpyData.GetFixedItemRewardList():
+            rewardItemDict[itemID] = rewardItemDict.get(itemID, 0) + itemCount
+        # 饼图库A
+        for _ in xrange(rewardIpyData.GetRandItemCountA()):
+            itemID = GameWorld.GetResultByRandomList(rewardIpyData.GetRandItemRewardListA())
+            if itemID:
+                rewardItemDict[itemID] = rewardItemDict.get(itemID, 0) + 1
+        # 饼图库B
+        for _ in xrange(rewardIpyData.GetRandItemCountB()):
+            itemID = GameWorld.GetResultByRandomList(rewardIpyData.GetRandItemRewardListB())
+            if itemID:
+                rewardItemDict[itemID] = rewardItemDict.get(itemID, 0) + 1
+                
+        GameWorld.DebugLog("    rewardCount=%s,rewardTotalCount=%s, %s" % (rewardCount, rewardTotalCount, rewardItemDict))
+
+        if rewardCount >= maxRewardCount:
+            isStop = True
+            GameWorld.DebugLog("    放置活跃奖励次数已达上限!rewardCount=%s" % rewardCount)
+            break
+            
+    # 存储奖励
+    rewardItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItem)
+    for i in xrange(rewardItemCount):
+        itemID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItemID % i)
+        if itemID not in rewardItemDict:
+            continue
+        addCount = rewardItemDict.pop(itemID)
+        itemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItemCount % i)
+        updCount = itemCount + addCount
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItemCount % i, updCount)
+        #GameWorld.DebugLog("    更新探索奖励: itemID=%s,itemCount=%s,addCount=%s,updCount=%s" % (itemID, itemCount, addCount, updCount))
+        
+    for itemID, itemCount in rewardItemDict.items():
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItemID % rewardItemCount, itemID)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItemCount % rewardItemCount, itemCount)
+        rewardItemCount += 1
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItem, rewardItemCount)
+        #GameWorld.DebugLog("    新增探索奖励: itemID=%s,itemCount=%s,rewardItemCount=%s" % (itemID, itemCount, rewardItemCount))
+        
+    if isStop:
+        GameWorld.DebugLog("    停止探索!")
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceState, 0)
+    else:
+        __DoActivityPlaceStart(curPlayer, nextStartReduceSeconds)
+        
+    return
+
+def __DoActivityPlaceStart(curPlayer, reduceSeconds=0):
+    
+    costPoint = IpyGameDataPY.GetFuncCfg("ActivityPlace", 2) # 单次放置消耗的活跃点数
+    canUseActivityPoint = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityCanCostTotalPoint)
+    if canUseActivityPoint < costPoint:
+        GameWorld.DebugLog("活跃度不足,无法启动放置探索!canUseActivityPoint=%s" % canUseActivityPoint)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceState, 0)
+        return
+    startTime = int(time.time()) - reduceSeconds
+    GameWorld.DebugLog("    启动新一轮放置探索!reduceSeconds=%s" % reduceSeconds)
+    CostActivityPoint(curPlayer, costPoint)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceState, 1)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceStartTime, startTime)
+    return True
+
+def GetActivityPlaceReward(curPlayer):
+    ## 领取活跃放置奖励
+    
+    rewardItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItem)
+    if not rewardItemCount:
+        GameWorld.DebugLog("没有活跃放置奖励,无法领取!")
+        return
+    
+    isAppointItem = 0
+    rewardItemList = []
+    for i in xrange(rewardItemCount):
+        itemID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItemID % i)
+        itemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItemCount % i)
+        if not itemID or not itemCount:
+            break
+        rewardItemList.append([itemID, itemCount, isAppointItem])
+        
+        # 领取后需要重置为0
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItemID % i, 0)
+        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItemCount % i, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItem, 0)
+    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardCount, 0)
+    
+    GameWorld.DebugLog("领取活跃放置奖励: rewardItemCount=%s,rewardItemList=%s" % (rewardItemCount, rewardItemList))
+    ItemControler.GivePlayerItemOrMail(curPlayer, rewardItemList)
+    
+    Sync_ActivityPlaceInfo(curPlayer)
+    return
+
+def Sync_ActivityPlaceInfo(curPlayer):
+    ## 同步活跃放置信息
+    rewardItemInfo = []
+    rewardItemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItem)
+    for i in xrange(rewardItemCount):
+        itemID = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItemID % i)
+        itemCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardItemCount % i)
+        rewardItemInfo.append([itemID, itemCount])
+    placeInfo = ChPyNetSendPack.tagMCActivityPlaceInfo()
+    placeInfo.PlaceState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceState)
+    placeInfo.StartTime = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceStartTime)
+    placeInfo.RewardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardCount)
+    placeInfo.RewardInfo = str(rewardItemInfo)
+    placeInfo.RewardLen = len(placeInfo.RewardInfo)
+    NetPackCommon.SendFakePack(curPlayer, placeInfo)
+    return
+
+#########################################################################################
+
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
index 884bcff..622ab38 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
@@ -113,6 +113,8 @@
 #    BYTE        Type;    //0-开始寻访 1-结束寻访
 #};
 def OnVisitFairyDomain(index, clientData, tick):
+    # 活跃消耗改为放置,缥缈待修改,暂屏蔽
+    return
     curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
     
     otherCntRateList = IpyGameDataPY.GetFuncEvalCfg('ImmortalDomain', 2)

--
Gitblit v1.8.0