From b965081066ea579c45c73f08cd9cd61bc157ac9f Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期四, 09 五月 2019 11:15:45 +0800
Subject: [PATCH] 6459 【后端】【2.0】缥缈仙域开发单(防范跨服妖王关闭线路时导致的报错)
---
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py | 138 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 124 insertions(+), 14 deletions(-)
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 13bf2af..af77405 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
@@ -55,11 +55,13 @@
import PlayerBossReborn
import PlayerFairyCeremony
import PlayerNewFairyCeremony
+import Operate_EquipStone
import PlayerWeekParty
import PlayerFairyDomain
import PlayerActLogin
import PlayerHorse
import FBCommon
+import NPCCommon
import math
import time
@@ -1414,15 +1416,17 @@
def DoType_Add_Player_Xp(curPlayer, curMission, curActionNode):
#增加玩家相关值<Add_Player_XP value="玩家xp值"/>
- xpValue = curActionNode.GetAttribute("value")
-
- if xpValue != "":
- #设置玩家xp值
- openLV, addXPValue, maxXPValue = ReadChConfig.GetEvalChConfig('PlayerXP')
- curXp = min(int(xpValue), maxXPValue)
- curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, curXp)
- curPlayer.SetXP(curXp)
-
+ #===========================================================================
+ # xpValue = curActionNode.GetAttribute("value")
+ #
+ # if xpValue != "":
+ # #设置玩家xp值
+ # openLV, addXPValue, maxXPValue = ReadChConfig.GetEvalChConfig('PlayerXP')
+ # curXp = min(int(xpValue), maxXPValue)
+ # curPlayer.SetDict(ChConfig.Def_PlayerKey_RecordXPValue, curXp)
+ # curPlayer.SetXP(curXp)
+ #
+ #===========================================================================
return
#---------------------------------------------------------------------
@@ -2566,6 +2570,18 @@
conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)
conditionType = curConditionNode.GetAttribute("type")
maxPassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_TrialTower_PassLV) # 历史最大过关数
+ return QuestRunnerValue.GetEval(conditionType, maxPassLV, conditionValue)
+
+##通关诛仙塔第X层
+# @param curPlayer 玩家实例
+# @param curMission 任务实例
+# @param curConditionNode 节点信息
+# @return 返回值, 是否判断成功
+# @remarks <Check_Zhuxiantower type="类型" value="值"/>
+def ConditionType_Check_Zhuxiantower(curPlayer, curMission, curConditionNode):
+ conditionValue = GameWorld.ToIntDef(curConditionNode.GetAttribute("value"), 0)
+ conditionType = curConditionNode.GetAttribute("type")
+ maxPassLV = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ZhuXianTowerPassLV) # 历史最大过关数
return QuestRunnerValue.GetEval(conditionType, maxPassLV, conditionValue)
def ConditionType_Get_Player_Coin(curPlayer, curMission, curConditionNode):
@@ -3785,7 +3801,7 @@
# @param curActionNode节点信息
# @return 返回值无意义
# @remarks <Drop_Item id="物品ID" count="物品数量" starLV="星级" bind="是否绑定" isAuctionItem="是否拍品"
-# suite="是否套装化" addAttrLV="追加等级",isLucky="是否有幸运"
+# suite="是否套装化" addAttrLV="追加等级",isLucky="是否有幸运" isFakeDrop="是否假掉落"
# skillBoostEff="[技能效果增强索引, 值]", holeCount="孔数", isGreat="1", effIndex="1" , dropDist="掉落范围默认3"
# aroundPlayer="1" baseAttrRate="可强化的装备基础属性随机加强比例默认10000" greatAttr="[卓越属性列表]" />
def DoType_Drop_Item(curPlayer, curMission, curActionNode):
@@ -3837,7 +3853,14 @@
if not curItem:
GameWorld.Log('###创建地上物品异常,无此ID物品 = %s' % (curItemID))
return
-
+ isFakeDrop = GameWorld.ToIntDef(curActionNode.GetAttribute("isFakeDrop"), 0)
+ if isFakeDrop:#假掉落表现
+ dropItemDataStr = ChItem.GetMapDropItemDataStr(curItem)
+ #通知客户端
+ NPCCommon.SendVirtualItemDrop(curPlayer, curItemID, 0, 0, dropItemDataStr)
+ ItemControler.GivePlayerItemOrMail(curPlayer, [[curItemID, count, isAuctionItem]])
+ curItem.Clear()
+ return
if curActionNode.GetAttribute("aroundPlayer") == "1" or not curNPC:
posX, posY = curPlayer.GetPosX(), curPlayer.GetPosY()
else:
@@ -5160,6 +5183,8 @@
PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Task, addCnt)
else:
GameWorld.Log(' 跑环完成触发活跃度异常 missionType=%s'%missionType, curPlayer.GetPlayerID())
+ return
+ EventShell.EventRespons_AroundMission(curPlayer, missionType)
return
@@ -7067,7 +7092,76 @@
totallv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
return PlayerHorse.GetHorseSumLV(curPlayer) >= totallv
+##已选择的专精技能数量是否达到
+# @param None
+# @return None <Elementskillcnt value="cnt"/>
+def ConditionType_Elementskillcnt(curPlayer, curMission, curActionNode):
+ cnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
+ return SkillShell.GetElementSkillCnt(curPlayer) >= cnt
+##设置已选择的专精技能数量
+# @param curPlayer 玩家实例
+# @param curMission 任务实例
+# @param curActionNode节点信息
+# @return 返回值无意义
+# @remarks <Set_Elementskillcnt key="" />
+def DoType_Set_Elementskillcnt(curPlayer, curMission, curActionNode):
+ key = curActionNode.GetAttribute("key")
+ questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
+ if questID != 0:
+ curMission = curPlayer.FindMission(questID)
+ curMission.SetProperty(key, SkillShell.GetElementSkillCnt(curPlayer))
+ return
+
+##设置符合条件的已穿基础装备数量
+# @param curPlayer 玩家实例
+# @param curMission 任务实例
+# @param curActionNode节点信息
+# @return 返回值无意义
+# @remarks <Set_Baseequipcnt key="" classlv="" color="" suite="[suiteID,..]"/>
+def DoType_Set_Baseequipcnt(curPlayer, curMission, curActionNode):
+ classLV = GameWorld.ToIntDef(curActionNode.GetAttribute("classlv"), 0)
+ color = GameWorld.ToIntDef(curActionNode.GetAttribute("color"), 0)
+ suite = curActionNode.GetAttribute("suite")
+ suiteIDList = eval(suite) if suite else []
+
+ haveCnt = __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList)
+
+ key = curActionNode.GetAttribute("key")
+ questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
+ if questID != 0:
+ curMission = curPlayer.FindMission(questID)
+ curMission.SetProperty(key, haveCnt)
+ return
+def __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList):
+ haveCnt = 0
+ equipPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
+ for place in ChConfig.EquipPlace_Base:
+ ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, place)
+ if not ipyData:
+ break
+ gridIndex = ipyData.GetGridIndex()
+ curEquip = equipPack.GetAt(gridIndex)
+ if not ItemCommon.CheckItemCanUse(curEquip):
+ continue
+ if curEquip.GetItemColor() < color:
+ continue
+ if suiteIDList and curEquip.GetSuiteID() not in suiteIDList:
+ continue
+ haveCnt += 1
+ return haveCnt
+
+##判断符合条件的已穿基础装备数量
+# @param None
+# @return None <Baseequipcnt cnt="cnt" classlv="" color="" suite="[suiteID,..]"/>
+def ConditionType_Baseequipcnt(curPlayer, curMission, curActionNode):
+ totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("cnt"), 0)
+ classLV = GameWorld.ToIntDef(curActionNode.GetAttribute("classlv"), 0)
+ color = GameWorld.ToIntDef(curActionNode.GetAttribute("color"), 0)
+ suite = curActionNode.GetAttribute("suite")
+ suiteIDList = eval(suite) if suite else []
+ haveCnt = __GetBaseequipcnt(curPlayer, classLV, color, suiteIDList)
+ return haveCnt >= totalcnt
##法宝激活个数
# @param None
@@ -7107,7 +7201,22 @@
# @return None <Equiptotalstar value="cnt"/>
def ConditionType_Equiptotalstar(curPlayer, curMission, curActionNode):
totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
- return #ChEquip.GetTotalEquipStars(curPlayer) >= totalcnt
+ return ChEquip.GetTotalEquipStars(curPlayer) >= totalcnt
+
+##装备宝石总等级
+# @param None
+# @return None <Equiptotalstone value="cnt"/>
+def ConditionType_Equiptotalstone(curPlayer, curMission, curActionNode):
+ totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
+ return Operate_EquipStone.GetTotalStoneLV(curPlayer) >= totalcnt
+
+##技能总等级
+# @param None
+# @return None <Totalskilllv value="" funcType=""/>
+def ConditionType_Totalskilllv(curPlayer, curMission, curActionNode):
+ totalcnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
+ funcType = GameWorld.ToIntDef(curActionNode.GetAttribute("funcType"), 0)
+ return SkillShell.GetAllSkillLV(curPlayer, funcType) >= totalcnt
##激活法宝,确认与成就逻辑后使用
# @param None
@@ -7145,8 +7254,9 @@
def DoType_Setfairydomain(curPlayer, curMission, curActionNode):
## 任务开启缥缈仙域 (做标记可寻访) <Setfairydomain/>
if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FairyDomainState):
- #若已在寻访中则不可设置
- return
+ #若已在寻访中则先结束寻访
+ PlayerFairyDomain.EndFairyDomain(curPlayer)
+
PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyDomainState, 2)
PlayerFairyDomain.NotifyVisitFairyDomainInfo(curPlayer)
return
\ No newline at end of file
--
Gitblit v1.8.0