From ac448ba660cafdba69ca409b45942dbad57f5732 Mon Sep 17 00:00:00 2001
From: hxp <ale99527@vip.qq.com>
Date: 星期五, 09 十月 2020 16:40:43 +0800
Subject: [PATCH] 8533 【BT】【后端】宗门试炼助战修(增加可配置至多机器人人数、是否出现非社交关系玩家)

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py |  311 +++++++++++++++++++++++++++++++--------------------
 1 files changed, 187 insertions(+), 124 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
index 2e4a833..d10e480 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -28,8 +28,6 @@
 # @change: "2013-09-18 17:00" Alee 退出锁定退出交易
 # @change: "2013-09-23 19:30" Alee 红名提示修改
 # @change: "2013-11-15 20:20" hxp 关闭07 3A购买背包封包功能,增加背包成功系统提示
-# @change: "2013-11-27 20:30" hxp 修改结束摆摊状态事件单独处理,不在结束事件中处理
-# @change: "2013-12-10 14:00" hxp 修改查看摆摊状态事件单独处理,不在结束事件中处理
 # @change: "2013-12-12 14:30" hxp 增加钻石购买背包计费点事件同步
 # @change: "2013-12-13 12:20" hxp 修改首登物品绑定设置
 # @change: "2013-12-27 16:00" Alee 删除多余代码
@@ -80,7 +78,6 @@
 import PlayerControl
 import FunctionNPCCommon
 import FBLogic
-import PlayerShopItem
 import ItemControler
 import ItemCommon
 import QuestCommon
@@ -101,7 +98,7 @@
 import EventReport
 import PlayerCoat
 import PlayerGatherSoul
-import PlayerArrestTask
+#import PlayerArrestTask
 import PlayerRune
 import IpyGameDataPY
 import FormulaControl
@@ -345,6 +342,7 @@
         return
     
     curPlayer.SetActionObj(curNPC)
+    PlayerControl.ChangePlayerAction(curPlayer, IPY_GameWorld.paNull)
     
     if NPCCommon.OnCollectNPCBegin(curPlayer, curNPC, tick):
         return
@@ -1335,15 +1333,6 @@
     RunQuestEvent(curPlayer, 'on_deactive', missionID, Def_RunQuestType_RunAll)
     return
 
-#---------------------------------------------------------------------
-##任务触发器_OnCoin 换取金钱事件
-#@param curPlayer 玩家实例
-#@return 返回值无意义
-#@remarks 任务触发器_OnCoin 换取金钱事件
-def EventResponse_OnCoin(curPlayer):
-    RunQuestEvent(curPlayer, 'on_coin', 'on_coin', Def_RunQuestType_RunAll)
-    curPlayer.DataServer_CheckPrizeItem()
-    return
 
 #---------------------------------------------------------------------
 ##任务触发器_OnDig 挖宝进度条结束后触发
@@ -1584,9 +1573,10 @@
         GameWorld.DebugLog("任务状态(%s)不可提交,不能完成任务!taskID=%s" % (missionState, taskID))
         return
     
+    curQuestData = QuestManager.FindQuest(taskID)
+    
     rewardPer = 100 if rewardPer <= 0 else rewardPer
     moneyType, moneyCnt = 0, 0
-    curQuestData = QuestManager.FindQuest(taskID)
     # 环任务支持多倍奖励领取
     if curQuestData != None and curQuestData.Type in QuestCommon.Def_RunTask_Type_List:
         if rewardPer != 100:
@@ -1694,6 +1684,14 @@
     RunQuestEvent(curPlayer, "on_trialtowercnt", cnt, Def_RunQuestType_Normal)
     return
 
+## 通关天星塔第X层
+#  @param curPlayer 玩家实例
+#  @param eventName 
+#  @return None
+def EventRespons_SkyTowerCnt(curPlayer, cnt):
+    RunQuestEvent(curPlayer, "skytowerpass", cnt, Def_RunQuestType_Normal)
+    return
+
 ##护送X次美女 
 # @param curPlayer 玩家实例
 # @param eventName 事件名
@@ -1720,25 +1718,11 @@
     RunQuestEvent(curPlayer, "on_goldinvest", "on_goldinvest", Def_RunQuestType_Normal)
     RunQuestEvent(curPlayer, "on_goldinvest", investType, Def_RunQuestType_Normal)
     return
-    
-def EventRespons_OnBuyTeHuiItem(curPlayer, shopID, itemShopIndex):
-    # 购买特惠商店物品
-    RunQuestEvent(curPlayer, "on_buy_tehuiitem", "on_buy_tehuiitem", Def_RunQuestType_Normal)
-    RunQuestEvent(curPlayer, "on_buy_tehuiitem", shopID, Def_RunQuestType_Normal)
-    RunQuestEvent(curPlayer, "on_buy_tehuiitem", "%s_%s" % (shopID, itemShopIndex), Def_RunQuestType_Normal)
-    return
 
 def EventRespons_OnActivatePet(curPlayer, petID):
     # 激活宠物
     RunQuestEvent(curPlayer, "on_activatepet", "on_activatepet", Def_RunQuestType_Normal)
     RunQuestEvent(curPlayer, "on_activatepet", petID, Def_RunQuestType_Normal)
-    return
-
-def EventRespons_OnActiveMagicWeapon(curPlayer, mwID):
-    # 激活法宝
-    RunQuestEvent(curPlayer, "on_activemagicweapon", mwID, Def_RunQuestType_Normal)
-    RunQuestEvent(curPlayer, "on_activemagicweaponex", mwID, Def_RunQuestType_RunAll)
-    RunQuestEvent(curPlayer, "on_activemagicweaponex", 0, Def_RunQuestType_RunAll)
     return
 
 def EventRespons_MagicWeaponLV(curPlayer, mwID, lv):
@@ -1806,20 +1790,27 @@
     RunQuestEvent(curPlayer, "passiveset", "passiveset", Def_RunQuestType_Normal)
     return
 
-def EventRespons_PlusGodWeapon(curPlayer):
+def EventRespons_PlusGodWeapon(curPlayer, weaponType):
     #神兵锤炼
     RunQuestEvent(curPlayer, "plusgodweapon", "plusgodweapon", Def_RunQuestType_Normal)
+    RunQuestEvent(curPlayer, "plusgodweapon", weaponType, Def_RunQuestType_Normal)
+    return
+def EventRespons_GodWeaponUp(curPlayer, weaponType, attrLV):
+    # 神兵升级
+    RunQuestEvent(curPlayer, "godweaponup", "%s_%s"%(weaponType, attrLV), Def_RunQuestType_Normal)
     return
 
-def EventRespons_RefineItem(curPlayer, alchemyLV):
+def EventRespons_RefineItem(curPlayer, alchemyLV, alchemyItemID):
     #八卦炉炼丹
-    RunQuestEvent(curPlayer, "refineitem", alchemyLV, Def_RunQuestType_Normal)
-    RunQuestEvent(curPlayer, "refineitem", "refineitem", Def_RunQuestType_Normal)
+    #这两个接口策划暂时不用,先注释,使用新的连某个丹药接口
+    #RunQuestEvent(curPlayer, "refineitem", alchemyLV, Def_RunQuestType_Normal)
+    #RunQuestEvent(curPlayer, "refineitem", "refineitem", Def_RunQuestType_Normal)
+    RunQuestEvent(curPlayer, "refineitem", alchemyItemID, Def_RunQuestType_Normal)
     return
 
 def EventRespons_RefineStoveUp(curPlayer, alchemyLV):
     #八卦炉升至X级
-    RunQuestEvent(curPlayer, "refinestoveup", alchemyLV, Def_RunQuestType_Normal)
+    RunQuestEvent(curPlayer, "refinestoveup", alchemyLV, Def_RunQuestType_RunAll)
     return
 
 def EventRespons_GetRealmPoint(curPlayer):
@@ -1904,10 +1895,134 @@
     RunQuestEvent(curPlayer, "equipplus", '%s_%s'%(classLV, partPlusLV), Def_RunQuestType_Normal)
     return
 
-def EventRespons_EquipStar(curPlayer):
-    #装备总星级变化
-    RunQuestEvent(curPlayer, "equipstar", "equipstar", Def_RunQuestType_Normal)
+def EventRespons_EquipPlusEvolve(curPlayer, nextEvolveLV):
+    #强化进化
+    RunQuestEvent(curPlayer, "equipplusevolve", "equipplusevolve", Def_RunQuestType_Normal)
     return
+
+def EventRespons_Talk(curPlayer, eventName):
+    #频道发言
+    RunQuestEvent(curPlayer, "talk", eventName, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_FairyDomain(curPlayer, eventType):
+    #完成缥缈仙域事件
+    RunQuestEvent(curPlayer, "fairydomain", 'fairydomain', Def_RunQuestType_Normal)
+    RunQuestEvent(curPlayer, "fairydomain", eventType, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_AroundMission(curPlayer, missionType):
+    #完成跑环任务
+    RunQuestEvent(curPlayer, "aroundfinish", missionType, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_Pray(curPlayer, prayType):
+    #完成祈愿
+    RunQuestEvent(curPlayer, "pray", prayType, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_ThinkMagicWeapon(curPlayer):
+    #感应法宝
+    RunQuestEvent(curPlayer, "thinkfabao", 'thinkfabao', Def_RunQuestType_Normal)
+    return
+
+def EventRespons_ElementSkill(curPlayer, mainSkillID, skillElementType, updSelectSkillLV):
+    #激活五行专精 主技能ID_专精类型_激活等级.xml
+    RunQuestEvent(curPlayer, "elementskill", '%s_%s_%s'%(mainSkillID, skillElementType, updSelectSkillLV), Def_RunQuestType_Normal)
+    return
+
+def EventRespons_EquipStarUp(curPlayer):
+    #装备升星
+    RunQuestEvent(curPlayer, "equipstarup", 'equipstarup', Def_RunQuestType_Normal)
+    return
+
+def EventRespons_InlayStone(curPlayer):
+    #宝石镶嵌
+    RunQuestEvent(curPlayer, "inlaystone", 'inlaystone', Def_RunQuestType_Normal)
+    return
+
+def EventRespons_StoneChange(curPlayer):
+    # 宝石变更
+    RunQuestEvent(curPlayer, "stonechange", 'stonechange', Def_RunQuestType_Normal)
+    return
+
+def EventRespons_EquipItem(curPlayer):
+    #穿脱装备
+    RunQuestEvent(curPlayer, "equipitem", 'equipitem', Def_RunQuestType_Normal)
+    return
+
+def EventRespons_SkillUp(curPlayer, FuncType, skillLV):
+    #升级技能
+    RunQuestEvent(curPlayer, "skillup", FuncType, Def_RunQuestType_Normal)
+    RunQuestEvent(curPlayer, "skillup", '%s_%s' % (FuncType, skillLV), Def_RunQuestType_Normal)
+    return
+
+def EventRespons_LingGenQualityUP(curPlayer, attrID, qualityLV):
+    #灵根升品
+    RunQuestEvent(curPlayer, "linggenqualityup", '%s_%s' % (attrID, qualityLV), Def_RunQuestType_Normal)
+    return
+
+def EventRespons_AddPoint(curPlayer):
+    #灵根加点
+    RunQuestEvent(curPlayer, "addpoint", '0', Def_RunQuestType_Normal)
+    return
+
+def EventRespons_ActivityAward(curPlayer, awardIndex):
+    #活跃领奖
+    RunQuestEvent(curPlayer, "activityaward", awardIndex, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_AddActivityValue(curPlayer):
+    # 增加活跃度
+    RunQuestEvent(curPlayer, "addactivity", "addactivity", Def_RunQuestType_Normal)
+    return
+
+def EventRespons_HorsePetBoss(curPlayer):
+    #参加骑宠BOSS
+    RunQuestEvent(curPlayer, "horsepetboss", 'horsepetboss', Def_RunQuestType_Normal)
+    return
+
+def EventRespons_LingGenReset(curPlayer):
+    #灵根重置
+    RunQuestEvent(curPlayer, "linggenreset", 'linggenreset', Def_RunQuestType_Normal)
+    return
+
+def EventRespons_UseMissionItem(curPlayer, missionID):
+    # 使用物品触发任务
+    RunQuestEvent(curPlayer, "usemissionitem", missionID, Def_RunQuestType_RunAll)
+    return
+
+def EventRespons_XBXZ(curPlayer, MWID):
+    # 仙宝寻主领奖
+    RunQuestEvent(curPlayer, "xbxz", MWID, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_AddAuctionEquip(curPlayer, color):
+    # 上架装备拍品
+    RunQuestEvent(curPlayer, "addauctionequip", color, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_BuyAuctionEquip(curPlayer, color):
+    # 购买装备拍品
+    RunQuestEvent(curPlayer, "buyauctionequip", color, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_OnMoneyChange(curPlayer, moneyType):
+    # 货币变更时
+    
+    # 暂开放灵石
+    if moneyType not in [IPY_GameWorld.TYPE_Price_Gold_Paper]:
+        return
+    RunQuestEvent(curPlayer, "onmoneychange", moneyType, Def_RunQuestType_Normal)
+    return
+
+def EventRespons_ActivityPlace(curPlayer, event, runall=False):
+    ''' 活跃放置事件
+    @param event: 可启动 canstart、启动 start、可领奖 cangetreward、领奖 getreward
+    '''
+    RunQuestEvent(curPlayer, "activityplace", event, Def_RunQuestType_RunAll if runall else Def_RunQuestType_Normal)
+    return
+
 #---------------------------------------------------------------------
 
 #================================================================================
@@ -3743,8 +3858,6 @@
     ExitCreateFamily(curPlayer)
     ExitBillboard(curPlayer)
     #ExitEventLock(curPlayer)
-    #ExitShopItem(curPlayer) # 奇迹只在切地图及下线时关闭摆摊
-    #ExitWatchShopItem(curPlayer)
     #npc商店退出
     ExitNPCShop(curPlayer)
     
@@ -3784,85 +3897,6 @@
     PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_PyPlayerAction, 0)      
     return
 
-
-##结束摆摊事件
-#@param curPlayer 玩家实例
-#@return 返回值无意义
-#@remarks 自定义函数:结束摆摊事件
-def ExitShopItem(curPlayer):
-    GameWorld.DebugLog("ExitShopItem", curPlayer.GetPlayerID())
-    playerShop = curPlayer.GetPlayerShop()
-    #在摆摊状态
-    if playerShop.GetIsStartShop():
-        PlayerShopItem.DoExitShop(curPlayer , curPlayer.GetPlayerShop())
-        
-    return
-#---------------------------------------------------------------------
-##结束查看摆摊事件
-#@param curPlayer 玩家实例
-#@return 返回值无意义
-#@remarks 自定义函数:结束查看摆摊事件
-def ExitWatchShopItem(curPlayer):
-    curPlayerShop = curPlayer.GetPlayerShop()
-    
-    if not curPlayerShop.GetIsWatchingShop():
-        return
-
-    openShopPlayer = curPlayer.GetActionPlayer()
-    __DoExitWatchShopItem(curPlayer , openShopPlayer)
-    
-    curPlayerShop.SetIsWatchingShop(0) 
-    return
-#---------------------------------------------------------------------
-##结束查看摆摊事件
-#@param curPlayer 玩家实例
-#@return 返回值无意义
-#@remarks 自定义函数:结束查看摆摊事件
-def __DoExitWatchShopItem(curPlayer , openShopPlayer):
-    
-    if openShopPlayer == None:
-        return
-    
-    shop = openShopPlayer.GetPlayerShop()
-    #没有开店
-    if not shop.GetIsStartShop():
-        return
-    
-    #商店删除这个玩家
-    shop.DeleteWatchPlayer(curPlayer.GetPlayerID())
-    return
-
-#---------------------------------------------------------------------
-##结束事件锁
-#@param curPlayer 玩家实例
-#@return 返回值无意义
-#@remarks 自定义函数:结束事件锁
-#===============================================================================
-# def ExitEventLock(curPlayer):
-#    if not curPlayer.GetHaveSetEventLock() :
-#        return
-#    
-#    #在摆摊状态不解锁,奇迹摆摊物品解锁只在切地图/下线/玩家主动结束摆摊情况下解锁
-#    playerShop = curPlayer.GetPlayerShop()
-#    if playerShop.GetIsStartShop():
-#        return
-#    
-#    #获得玩家物品管理器
-#    ItemManager = curPlayer.GetItemManager()
-#    #获得背包
-#    curPack = ItemManager.GetPack(IPY_GameWorld.rptItem)
-#    for i in range(curPack.GetCount()):
-#        item = curPack.GetAt(i)
-#        if item == None or item.IsEmpty():
-#            continue
-#        
-#        if not item.GetIsEventLocked():
-#            continue
-#        
-#        #离开事件锁
-#        item.SetIsEventLocked(False)
-#===============================================================================
-        
 #---------------------------------------------------------------------
 ##结束查看排行榜
 #@param curPlayer 玩家实例
@@ -3953,15 +3987,18 @@
         PlayerControl.NotifyCode(curPlayer, "Task_cannot_Delete02")
         return
     
-    if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
-        PlayerControl.NotifyCode(curPlayer, "GeRen_hgg_880525")
+    #if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
+    #    PlayerControl.NotifyCode(curPlayer, "GeRen_hgg_880525")
+    #    return
+    
+    curQuestData = QuestManager.FindQuest(missionID)
+    if not curQuestData:
         return
     
     #放弃悬赏任务
-    if missionID == ChConfig.Def_ArrestMissionID:
-        PlayerArrestTask.OnDeleteArrestTask(curPlayer)
-        
-        
+    #if missionID == ChConfig.Def_ArrestMissionID:
+    #    PlayerArrestTask.OnDeleteArrestTask(curPlayer)
+    
     #先在任务表中找数据, 如果找到了, 就不遍历XML了
     if __DoLogic_DeleteMission(curPlayer, curMission):
         GameWorld.Log("在任务表中找数据, 删除任务 = %s, 状态 = %s"%(missionID, missionState), curPlayer.GetID())
@@ -4548,7 +4585,7 @@
     # 需要付钱
     costMoneyList = []
     if needMoney > 0:
-        costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Money, needMoney)
+        costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, IPY_GameWorld.TYPE_Price_Gold_Paper, needMoney)
         if costMoneyList == []:
             #金钱不足
             return False, costMoneyList
@@ -4870,6 +4907,32 @@
     RunQuestEvent(curPlayer, "on_revlogintype_event", "on_revlogintype_event", Def_RunQuestType_Normal)
     return
 
+#// A2 07 接受任务 #tagCMTakeTask
+#
+#struct    tagCMTakeTask
+#{
+#    tagHead        Head;
+#    DWORD        TaskID;
+#};
+def OnTakeTask(index, clientData, tick):
+    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
+    
+    missionID = clientData.TaskID
+    curMission = curPlayer.FindMission(missionID)
+    if not curMission:
+        return
+    
+    missionState = curMission.GetState()
+    if missionState != ChConfig.Def_Mission_State_NoAccept:
+        return
+    
+    curQuestData = QuestManager.FindQuest(missionID)
+    if not curQuestData:
+        return
+    
+    QuestCommon.SetPlayerMissionState(curPlayer, curMission, 1)
+    return
+
 #// A2 18 完成任务 #tagCMFinishTask
 #
 #struct tagCMFinishTask

--
Gitblit v1.8.0