From 64a00ad79dbdf44eebca167038a0a278a75a6667 Mon Sep 17 00:00:00 2001
From: xdh <xiefantasy@qq.com>
Date: 星期一, 27 五月 2019 19:18:06 +0800
Subject: [PATCH] 6844 【2.0】【后端】缥缈仙域优化
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py | 7 ++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py | 20 ++++++++-
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py | 3 +
ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py | 3 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py | 2 +
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py | 27 ++++++-------
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py | 4 +
7 files changed, 44 insertions(+), 22 deletions(-)
diff --git a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
index 4566fe8..0ed47d8 100644
--- a/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
+++ b/ServerPython/CoreServerGroup/GameServer/Script/ShareDefine.py
@@ -1462,7 +1462,8 @@
DailyActionID_SkyTower, # 天星塔 23
DailyActionID_HorsePetBoss, # 骑宠BOSS 24
DailyActionID_FairyDomain, # 缥缈仙域 25
-) = range(1, 25 + 1)
+DailyActionID_LVUP, # 玩家等级提升 26
+) = range(1, 26 + 1)
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
index 795c1fc..6d279e2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ChConfig.py
@@ -3789,11 +3789,13 @@
# 每日活跃度
Def_PDict_Activity_FinishCnt = "Activity_FinishCnt_%s" # 活跃度类型对应完成次数
-Def_PDict_Activity_TotalPoint = "Activity_TotalPoint" # 当前总活跃值
+Def_PDict_Activity_TotalPoint = "Activity_TotalPoint" # 当前总活跃值(不可消耗)
+Def_PDict_ActivityCanCostTotalPoint = "ActivityCanCostTotalPoint" # 当前总活跃值(可消耗)
Def_PDict_ActivityAwardRecord = "ActivityAwardRecord" # 活跃度奖励领取记录,按二进制位标识
Def_PDict_Activity_AwardStage = "Activity_AwardStage" # 当前活跃奖励阶段
Def_PDict_Activity_RealmPoint = "Activity_RealmPoint" # 当前可领修行点
Def_PDict_Activity_ExtraRealmPoint = "Activity_ExtraRealmPoint" # 多倍活动额外获得的修行点
+
# 每日活动
Def_PDict_DailyActionDayTimes = "DailyActionDayTimes_%s" # 每日活动今日完成次数 参数每日活动ID
Def_PDict_DailyActionDayBuyTimes = "DADayBuyTimes_%s" # 每日活动今日购买次数 参数每日活动ID
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py
index 106d354..ed59550 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/AddFairyEvent.py
@@ -54,8 +54,11 @@
ipyData = IpyGameDataPY.InterpolationSearch('FairyAdventures', 'OpenServerDay', openServerDay, {'EventID':fdEventID})
if ipyData:
conditionList = ipyData.GetCondition()
- condition = random.choice(conditionList)
- index = conditionList.index(condition)
+ if conditionList:
+ condition = random.choice(conditionList)
+ index = conditionList.index(condition)
+ else:
+ index = 0
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyAdventuresData % fdEventID, ipyData.GetID() * 100 + index)
#设置寻访中
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 8148b50..4342383 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerActivity.py
@@ -245,8 +245,7 @@
addValue = addValue + addExtraPoint
curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
__SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, curTotalPoint + addValue)
- #realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
- #__SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, realmPoint+addValue)
+ AddCanCostActivityPoint(curPlayer, addValue)
SyncDailyActivityInfo(curPlayer)
GameWorld.DebugLog("增加活跃度任务次数,activityNum=%s,addPbCnt=%s,addValue=%s, multiple=%s, addExtraPoint=%s,curExtraPoint=%s"
@@ -268,6 +267,21 @@
return multiple, extraPointLimit
return actRealmPointIpyData.GetMultiple(), actRealmPointIpyData.GetPointLimit()
+def AddCanCostActivityPoint(curPlayer, addValue):
+ # 增加可消耗的活跃点
+ curPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint)
+ __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint, min(IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint'), curPoint + addValue))
+ return
+
+def CostActivityPoint(curPlayer, costPoint):
+ # 消耗活跃点
+ curPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint)
+ if curPoint < costPoint:
+ return
+ __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint,
+ curPoint - costPoint)
+ SyncDailyActivityInfo(curPlayer)
+ return True
## 同步活跃度信息
# @param curPlayer
@@ -279,7 +293,7 @@
sendPack.CurValue = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
sendPack.StageIndex = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_AwardStage)
sendPack.AwardRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityAwardRecord)
- sendPack.RealmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
+ sendPack.RealmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint)
sendPack.ExtraPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint)
NetPackCommon.SendFakePack(curPlayer, sendPack)
return
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
index 5d34763..d5dc3a8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerControl.py
@@ -4035,6 +4035,7 @@
if aftLV > befLV:
curPlayer.SetLV(aftLV, False) # 这里不再通知GameServer
PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_HeroLV, aftLV)
+ PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_LVUP, aftLV - befLV)
if aftFreePoint > befFreePoint:
curPlayer.SetFreePoint(aftFreePoint)
#NotifyCode(curPlayer, "ObtainAttributeDot", [aftFreePoint - befFreePoint])
@@ -4081,6 +4082,7 @@
OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_LV, curPlayer.GetLV())
#神秘限购
FunctionNPCCommon.MysticalLimitShopOpen(curPlayer, befLV, aftLV)
+
#不需要做升级任务, 设置玩家经验
SetPlayerTotalExp(curPlayer, curTotalExp)
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 a181345..e9a74cc 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerFairyDomain.py
@@ -135,9 +135,9 @@
if fairyDomainState == 1:
GameWorld.DebugLog(" 正在寻访仙域中!请先退出寻访")
return
-
- if fairyDomainState != 2 and not PlayerActivity.AddDailyActionFinishCnt(curPlayer, dailyID):
- GameWorld.DebugLog(" 寻访仙域次数不足!")
+ costPoint = IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint', 2)
+ if not PlayerActivity.CostActivityPoint(curPlayer, costPoint):
+ GameWorld.DebugLog(" 寻访仙域需要活跃点不足!costPoint=%s"%costPoint)
return
#随机事件 重置事件状态
@@ -196,10 +196,10 @@
continue
conditionList = ipyData.GetCondition()
if not conditionList:
- fdEventIDList.remove(fdEventID)
- continue
- condition = random.choice(conditionList)
- index = conditionList.index(condition)
+ index = 0
+ else:
+ condition = random.choice(conditionList)
+ index = conditionList.index(condition)
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyAdventuresData % fdEventID, ipyData.GetID() * 100 + index)
if not fdEventIDList:
@@ -444,15 +444,14 @@
gearAwardList = ipyData.GetGearAward()
if not gearAwardList:
return
- itemRateList = gearAwardList[index] if index < len(gearAwardList) else gearAwardList[-1]
- itemRateList = ItemCommon.GetWeightItemListByAlchemyDiffLV(curPlayer, itemRateList, 1)
- giveItemList = [GameWorld.GetResultByWeightList(itemRateList)]
+ giveItemList = []
+ itemRandomList = gearAwardList[index] if index < len(gearAwardList) else gearAwardList[-1]
+ for itemRateList in itemRandomList:
+ itemRateList = ItemCommon.GetWeightItemListByAlchemyDiffLV(curPlayer, itemRateList, 0)
+ giveItemList.append(GameWorld.GetResultByWeightList(itemRateList))
else:
giveItemList = [ipyData.GetBasicAward()]
-
- ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList)
- for itemInfo in giveItemList:
- NPCCommon.SendVirtualItemDrop(curPlayer, itemInfo[0], 0, 0, '')
+ NPCCommon.DoGiveItemByVirtualDrop(curPlayer, giveItemList, 0)
msgDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
FBCommon.Notify_FB_Over(curPlayer, msgDict)
GameWorld.DebugLog('缥缈奇遇领奖 msgDict=%s, fdeventID=%s' % (msgDict, fdeventID))
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
index 4566fe8..0ed47d8 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/ShareDefine.py
@@ -1462,7 +1462,8 @@
DailyActionID_SkyTower, # 天星塔 23
DailyActionID_HorsePetBoss, # 骑宠BOSS 24
DailyActionID_FairyDomain, # 缥缈仙域 25
-) = range(1, 25 + 1)
+DailyActionID_LVUP, # 玩家等级提升 26
+) = range(1, 26 + 1)
--
Gitblit v1.8.0