From 6a4df1975beb435a9c712c508035eeecc9cc293d Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 14 五月 2021 10:49:51 +0800
Subject: [PATCH] 8921 【主干】【BT2】【后端】H.活动-节日活动-垃圾分类(同步主干冲突 提交)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py |    6 +++++-
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py           |   13 ++++++++-----
 ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py                                   |    1 +
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py     |    2 ++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py         |   13 ++++++++++---
 ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py                                |   13 ++++++++-----
 6 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
index 5224cac..802bc24 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ChConfig.py
@@ -591,6 +591,7 @@
             ShareDefine.Def_BT_NewFCCostGold            : 5,             #消费排行榜(仙界盛典)
             
             ShareDefine.Def_BT_Arena                    : 1000,          #竞技场榜
+            ShareDefine.Def_BT_Environment              : 20,            #环保榜 (垃圾分类活动)
             }
 
 #排行榜保存类型(和BillboardType匹配), 默认保存, 如果不保存,可配置进去
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index 26dac83..4f9ca84 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -236,6 +236,7 @@
 OperationActionName_SingleRecharge = "ActSingleRecharge" # 单笔累充活动
 OperationActionName_Turntable = "ActTurntable" # 转盘活动
 OperationActionName_HorsePetFeast = "ActHorsePetFeast" # 骑宠盛宴活动
+OperationActionName_GarbageSorting = "ActGarbageSorting" # 垃圾分类活动
 #节日活动类型列表 - 该类型无视开服天,日期到了就开启
 FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket,
                                 OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy,
@@ -253,7 +254,7 @@
                            OperationActionName_NewFairyCeremony, OperationActionName_LuckyTreasure,
                            OperationActionName_DailyGiftbag, OperationActionName_SingleRecharge,
                            OperationActionName_CollectWords, OperationActionName_ManyDayRecharge,
-                           OperationActionName_Turntable, OperationActionName_HorsePetFeast,
+                           OperationActionName_Turntable, OperationActionName_HorsePetFeast, OperationActionName_GarbageSorting,
                            ] + FeastOperationActionNameList
 #需要记录开启活动时的世界等级的运营活动
 NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell, 
@@ -263,7 +264,7 @@
                                    OperationActionName_SpringSale, OperationActionName_LuckyTreasure,
                                    OperationActionName_DailyGiftbag, OperationActionName_GrowupBuy,
                                    OperationActionName_WeekParty, OperationActionName_Turntable,
-                                   OperationActionName_CollectWords,
+                                   OperationActionName_CollectWords, OperationActionName_GarbageSorting,
                                    OperationActionName_FeastLogin,
                                    OperationActionName_FeastWish, OperationActionName_FeastTravel,
                                    OperationActionName_ManyDayRecharge, OperationActionName_SingleRecharge,
@@ -274,7 +275,7 @@
                                    OperationActionName_FlashGiftbag, OperationActionName_CostRebate,
                                    OperationActionName_SpringSale, OperationActionName_FlashSale,
                                    OperationActionName_ManyDayRecharge, OperationActionName_SingleRecharge,
-                                   OperationActionName_Turntable, OperationActionName_HorsePetFeast,
+                                   OperationActionName_Turntable, OperationActionName_HorsePetFeast, OperationActionName_GarbageSorting,
                                    ]
 
 #跨服运营活动表名定义
@@ -710,9 +711,10 @@
     
     Def_BT_SkyTower,                          #天星塔榜
     Def_BT_Arena,                             #竞技场榜
+    Def_BT_Environment,                       #环保榜 (垃圾分类活动)
     
     Def_BT_Max, #排行榜最大类型
-) = range(0, 28 + 2) 
+) = range(0, 29 + 2) 
 
 ''' 跨服排行榜类型, 从 150 开始
 与本服榜单存储的是不一样的数据库表格,理论上类型可以和本服榜单类型重复,为了做下区分防误导,跨服榜单从 150 开始
@@ -1090,8 +1092,9 @@
 rptPet,             # 宠物背包(用物品存储宠物的数据) 31
 rptDogzItem,        # 神兽物品背包 32
 rptDogzEquip,       # 神兽装备背包 33
+rptGarbage,         # 垃圾分类背包 34
 rptMax,             # 最大背包类型数量,放在最后一个
-) = range(28, 28 + 7)  #C++定义的枚举到27
+) = range(28, 28 + 8)  #C++定义的枚举到27
 
 #虚拟背包类型, 从255递减
 Def_VPack_TypeList = (
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 68e2cd1..dc86d02 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/NPC/NPCCommon.py
@@ -53,6 +53,7 @@
 import PlayerActCollectWords
 import PlayerNewFairyCeremony
 import GameLogic_CrossGrassland
+import PlayerActGarbageSorting
 import CrossPlayerData
 import PlayerFeastWish
 import PlayerFeastTravel
@@ -2424,6 +2425,9 @@
     if mapID == ChConfig.Def_FBMapID_CrossPenglai:
         #跨服蓬莱仙境
         PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_CrossPenglai)
+        PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_CrossBoss)
+    else:
+        PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_KillBoss)
         
     # 个人首杀记录
     ipyData = IpyGameDataPY.GetIpyGameDataNotLog("BOSSFirstKill", npcID)
@@ -5035,6 +5039,7 @@
         else:
             if curNPC.GetLV()>=curPlayer.GetLV() - IpyGameDataPY.GetFuncCfg('DailyQuestKillMonster'):
                 PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_KillNPC)
+                PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_KillNPC)
             PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_KillSpecificNPC, 1, [npcID])
             
         if ChConfig.IsGameBoss(curNPC):
@@ -5765,7 +5770,7 @@
     npcID = msgData["NPCID"]
     collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID)
     if collectNPCIpyData:
-        DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData)
+        DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData, crossCollectOK=True)
     return
 
 #// A2 34 自定义场景中获取采集奖励 #tagCMGetCustomSceneCollectAward
@@ -5798,8 +5803,8 @@
         DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData)
     return
 
-def DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData, collectCnt=1):
-    GameWorld.DebugLog("给采集奖励: npcID=%s,collectCnt=%s" % (npcID, collectCnt))
+def DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData, collectCnt=1, crossCollectOK=False):
+    GameWorld.DebugLog("给采集奖励: npcID=%s,collectCnt=%s,crossCollectOK=%s" % (npcID, collectCnt, crossCollectOK))
     if collectCnt <= 0:
         return
 
@@ -5872,6 +5877,8 @@
         
     #采集成就
     PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_Collect, collectCnt, [npcID])
+    if crossCollectOK:
+        PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_CrossCollect)
     #SyncCollectionItemInfo(curPlayer, addExp, addMoney, addZhenQi, giveItemInfoList, npcID)
     
     GameLogic_CrossGrassland.DecCustomSceneNPCCount(curPlayer, npcID)
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 7cd5a7f..827fb21 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
@@ -36,6 +36,7 @@
 import time
 import FormulaControl
 import PlayerBossReborn
+import PlayerActGarbageSorting
 
 #关联类型
 (
@@ -292,6 +293,7 @@
     curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
     __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, curTotalPoint + addValue)
     __AddCanCostActivityPoint(curPlayer, addValue, isLVUp)
+    PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_Activity, addValue)
     PlayerControl.NotifyCode(curPlayer, "GetActivity", [addValue])
     SyncDailyActivityInfo(curPlayer)
     EventShell.EventRespons_AddActivityValue(curPlayer)
@@ -917,6 +919,7 @@
         GameWorld.DebugLog("没有活跃放置奖励,无法领取!")
         return
     
+    rewardCount = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ActivityPlaceRewardCount)
     isAppointItem = 0
     rewardItemList = []
     for i in xrange(rewardItemCount):
@@ -932,10 +935,11 @@
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardItem, 0)
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ActivityPlaceRewardCount, 0)
     
-    GameWorld.DebugLog("领取活跃放置奖励: rewardItemCount=%s,rewardItemList=%s" % (rewardItemCount, rewardItemList))
+    GameWorld.DebugLog("领取活跃放置奖励: rewardCount=%s,rewardItemCount=%s,rewardItemList=%s" % (rewardCount, rewardItemCount, rewardItemList))
     ItemControler.GivePlayerItemOrMail(curPlayer, rewardItemList)
     
     EventShell.EventRespons_ActivityPlace(curPlayer, "getreward")
+    PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_ActivityPlace, rewardCount)
     
     Sync_ActivityPlaceInfo(curPlayer)
     return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
index a9b7cd9..0919a57 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerCoin.py
@@ -48,6 +48,7 @@
 import PlayerNewFairyCeremony
 import PlayerGoldGift
 import PlayerActTotalRecharge
+import PlayerActGarbageSorting
 import PlayerActRechargeRebateGold
 import PlayerActManyDayRecharge
 import PlayerActSingleRecharge
@@ -452,6 +453,7 @@
     PlayerGoldGift.OnPlayerChargeGold(curPlayer)
     #累积充值X元
     PlayerActTotalRecharge.AddTotalRechargeGold(curPlayer, orderCoin)
+    PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_CTG, addVIPExp, coinType) # 垃圾分类
     PlayerActSingleRecharge.UpdSingleRechargeValue(curPlayer, orderCoin, coinType) # 单笔累充
     PlayerActTurntable.OnPlayerRecharge(curPlayer, orderCoin, coinType) # 转盘
     PlayerFairyCeremony.AddFCCTGRMB(curPlayer, orderCoin)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index 26dac83..4f9ca84 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -236,6 +236,7 @@
 OperationActionName_SingleRecharge = "ActSingleRecharge" # 单笔累充活动
 OperationActionName_Turntable = "ActTurntable" # 转盘活动
 OperationActionName_HorsePetFeast = "ActHorsePetFeast" # 骑宠盛宴活动
+OperationActionName_GarbageSorting = "ActGarbageSorting" # 垃圾分类活动
 #节日活动类型列表 - 该类型无视开服天,日期到了就开启
 FeastOperationActionNameList = [OperationActionName_FeastWeekParty, OperationActionName_FeastRedPacket,
                                 OperationActionName_RechargeRebateGold, OperationActionName_GrowupBuy,
@@ -253,7 +254,7 @@
                            OperationActionName_NewFairyCeremony, OperationActionName_LuckyTreasure,
                            OperationActionName_DailyGiftbag, OperationActionName_SingleRecharge,
                            OperationActionName_CollectWords, OperationActionName_ManyDayRecharge,
-                           OperationActionName_Turntable, OperationActionName_HorsePetFeast,
+                           OperationActionName_Turntable, OperationActionName_HorsePetFeast, OperationActionName_GarbageSorting,
                            ] + FeastOperationActionNameList
 #需要记录开启活动时的世界等级的运营活动
 NeedWorldLVOperationActNameList = [OperationActionName_FairyCeremony, OperationActionName_WishingWell, 
@@ -263,7 +264,7 @@
                                    OperationActionName_SpringSale, OperationActionName_LuckyTreasure,
                                    OperationActionName_DailyGiftbag, OperationActionName_GrowupBuy,
                                    OperationActionName_WeekParty, OperationActionName_Turntable,
-                                   OperationActionName_CollectWords,
+                                   OperationActionName_CollectWords, OperationActionName_GarbageSorting,
                                    OperationActionName_FeastLogin,
                                    OperationActionName_FeastWish, OperationActionName_FeastTravel,
                                    OperationActionName_ManyDayRecharge, OperationActionName_SingleRecharge,
@@ -274,7 +275,7 @@
                                    OperationActionName_FlashGiftbag, OperationActionName_CostRebate,
                                    OperationActionName_SpringSale, OperationActionName_FlashSale,
                                    OperationActionName_ManyDayRecharge, OperationActionName_SingleRecharge,
-                                   OperationActionName_Turntable, OperationActionName_HorsePetFeast,
+                                   OperationActionName_Turntable, OperationActionName_HorsePetFeast, OperationActionName_GarbageSorting,
                                    ]
 
 #跨服运营活动表名定义
@@ -710,9 +711,10 @@
     
     Def_BT_SkyTower,                          #天星塔榜
     Def_BT_Arena,                             #竞技场榜
+    Def_BT_Environment,                       #环保榜 (垃圾分类活动)
     
     Def_BT_Max, #排行榜最大类型
-) = range(0, 28 + 2) 
+) = range(0, 29 + 2) 
 
 ''' 跨服排行榜类型, 从 150 开始
 与本服榜单存储的是不一样的数据库表格,理论上类型可以和本服榜单类型重复,为了做下区分防误导,跨服榜单从 150 开始
@@ -1090,8 +1092,9 @@
 rptPet,             # 宠物背包(用物品存储宠物的数据) 31
 rptDogzItem,        # 神兽物品背包 32
 rptDogzEquip,       # 神兽装备背包 33
+rptGarbage,         # 垃圾分类背包 34
 rptMax,             # 最大背包类型数量,放在最后一个
-) = range(28, 28 + 7)  #C++定义的枚举到27
+) = range(28, 28 + 8)  #C++定义的枚举到27
 
 #虚拟背包类型, 从255递减
 Def_VPack_TypeList = (

--
Gitblit v1.8.0