xdh
2019-03-14 c68d28b333ae625e4a0fd0ebefa3ebb74d352d00
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/QuestRunner.py
@@ -59,6 +59,9 @@
import PlayerMagicWeapon
import PlayerBossReborn
import PlayerFairyCeremony
import PlayerNewFairyCeremony
import PlayerWeekParty
import PlayerActLogin
import PlayerHorse
import FBCommon
import PyGameData
@@ -1221,7 +1224,7 @@
def __RunAnswerAction(curPlayer, curMission, answersNode):
    actionsNode = __FindAnswerActionNode(curPlayer, curMission, answersNode)
    if actionsNode == None or actionsNode.IsEmpty():
        GameWorld.Log('__RunAnswerAction找不到回答节点')
        GameWorld.DebugLog('__RunAnswerAction找不到回答节点--%s'%curMission.GetMissionID())
        return
    
    __DoAnswerActionNode(curPlayer, curMission, actionsNode)
@@ -1276,7 +1279,7 @@
        #特殊清空处理, 如果没有任务, state为0
        curValue = 0
    elif tagMission == None:
        GameWorld.Log("没有目标任务 %s" % conditionID , curPlayer.GetPlayerID())
        GameWorld.DebugLog("没有目标任务 %s" % conditionID , curPlayer.GetPlayerID())
        return
    else:
        curValue = QuestRunnerValue.GetValue(curPlayer, tagMission, conditionName)
@@ -2531,7 +2534,7 @@
    totalPlusLV = 0
    for packType, equipPartIndexList in ChConfig.Pack_EquipPart_CanPlusStar.items():
        for i in equipPartIndexList:
            partStarLV = ChEquip.GetEquipPartStarLV(curPlayer, packType, i)
            partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, packType, i)
            totalPlusLV += partStarLV
    
    
@@ -2542,7 +2545,7 @@
#    equipPartIndexList = ChConfig.Pack_EquipPart_CanPlusStar.get(IPY_GameWorld.rptEquip, [])
#    for i in equipPartIndexList:
#        #统计全身强化等级
#        partStarLV = ChEquip.GetEquipPartStarLV(curPlayer, IPY_GameWorld.rptEquip, i)
#        partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, i)
#        if partStarLV >= star:
#            partCnt +=1 
    #GameWorld.Log('star=%s,conditionValue=%s,partCnt=%s,%s'%(star,conditionValue,partCnt,QuestRunnerValue.GetEval(conditionType, partCnt, conditionValue)))
@@ -2897,15 +2900,15 @@
        if equipIndex == 0:
            GameWorld.ErrLog("任务赠送装备位置错误 equipIndex=-1")
            return
        if ItemCommon.CheckHasEquip(curPlayer, IPY_GameWorld.rptEquip, equipIndex):
        equipPackIndex = ItemCommon.GetEquipPackIndex(curSingleItem)
        if ItemCommon.CheckHasEquip(curPlayer, IPY_GameWorld.rptEquip, equipPackIndex):
            #物品已存在直接给背包
            if not itemControl.PutInItem(IPY_GameWorld.rptItem, curSingleItem, event=["AddEventItem", False, {'MissionID':missionID}]):
                GameWorld.Log('###任务 = %s给予物品异常, %s, %s' % (missionID, itemID, itemCount), curPlayer.GetPlayerID())
                curSingleItem.Clear()
                return
        else:
            ChEquip.DoPlayerEquipItem(curPlayer, curSingleItem, equipIndex, 0)
            ChEquip.DoPlayerEquipItem(curPlayer, curSingleItem,equipPackIndex, 0)
    
    #ObtainRes01    <n>获得</n><Info Type="Item" Name="Name" ID="{%S1%}"/><n>×</n><n>{%S2%}!</n>
    elif not itemControl.PutInItem(packIndex, curSingleItem, event=["AddEventItem", False, {'MissionID':missionID}]):
@@ -4890,7 +4893,7 @@
# @return 无
# @remarks 跑环任务结束处理,删除或者随机下一个
def __RunAroundMission(curPlayer, missionID, curMissionData, curActionNode):
    GameWorld.Log("__RunAroundMission----%s"%missionID)
    GameWorld.Log("__RunAroundMission----%s"%missionID, curPlayer.GetID())
    #任务完成,触发随机跑环
    run_event = GameWorld.ToIntDef(curActionNode.GetAttribute("run_around"), 0)
    firstMissionID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
@@ -5234,14 +5237,21 @@
def OnAroundMissionFinish(curPlayer, missionType, addCnt=1):
    #跑环任务id列表
    # 活跃度
    GameWorld.Log('    跑环完成触发活跃度 missionType=%s'%missionType, curPlayer.GetPlayerID())
    if missionType == QuestCommon.Def_Mission_Type_RunDaily:
        PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_DailyRunMission, addCnt)
        PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_TaskCRun, addCnt)
        PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TaskCRun, addCnt)
        PlayerBossReborn.AddBossRebornActionCnt(curPlayer, ChConfig.Def_BRAct_RunTask, addCnt)
        PlayerFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RunTask, addCnt)
        PlayerNewFairyCeremony.AddFCPartyActionCnt(curPlayer, ChConfig.Def_PPAct_RunTask, addCnt)
        PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_RunTask, addCnt)
        PlayerActLogin.AddLoginAwardActionCnt(curPlayer, ChConfig.Def_LoginAct_RunTask, 1)
    elif missionType == QuestCommon.Def_Mission_Type_RunFamily:
        PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_FamilyRunMission, addCnt)
        PlayerFamily.AddFamilyActivity(curPlayer, ShareDefine.FamilyActive_Task, addCnt)
    else:
        GameWorld.Log('    跑环完成触发活跃度异常 missionType=%s'%missionType, curPlayer.GetPlayerID())
    return
@@ -5436,7 +5446,7 @@
# @remarks 设置跑环任务奖励 <set_run_around_reward multiple="指定倍数" id_name="任务ID存储key" /> 
def DoType_Set_Run_Around_Reward(curPlayer, curMission, curActionNode):
    curMissionID = curMission.GetMissionID()
    GameWorld.Log("DoType_Set_Run_Around_Reward---%s"%curMissionID)
    GameWorld.Log("DoType_Set_Run_Around_Reward---%s"%curMissionID, curPlayer.GetID())
    idNameStr = curActionNode.GetAttribute("id_name")
    if curMission and idNameStr != "":
        questID = GameWorld.ToIntDef(curMission.GetProperty(idNameStr), 0)
@@ -5536,8 +5546,14 @@
    #给物品奖励
    itemInfo = []
    if item_id and item_count:
        AddEventItem(curPlayer, curMission, item_id, item_count, bind=True)
        itemInfo = [[item_id, item_count, True]]
        packSpace = ItemCommon.GetItemPackSpace(curPlayer, IPY_GameWorld.rptItem, 1)
        if 1 > packSpace:
            PlayerControl.NotifyCode(curPlayer, "UnionTask_Reward")
            PlayerControl.SendMailByKey("UnionTaskReward", [curPlayer.GetID()], itemInfo)
        else:
            AddEventItem(curPlayer, curMission, item_id, item_count, bind=True)
    GameWorld.DebugLog("任务:%d  获得经验:%d,钱=%s,物品ID=%s,物品数量=%s" 
                       % (curMission.GetMissionID(), exp, money, item_id, item_count))
    
@@ -6100,11 +6116,11 @@
# @return 返回值无意义
# @remarks <Set_Equiptotalstar key="" />
def DoType_Set_Equiptotalstar(curPlayer, curMission, curActionNode):
    key = curActionNode.GetAttribute("key")
    questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
    if questID != 0:
        curMission = curPlayer.FindMission(questID)
    curMission.SetProperty(key, ChEquip.GetTotalEquipStars(curPlayer))
#    key = curActionNode.GetAttribute("key")
#    questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
#    if questID != 0:
#        curMission = curPlayer.FindMission(questID)
#    curMission.SetProperty(key, ChEquip.GetTotalEquipStars(curPlayer))
    return
#---------------------------------------------------------------------
##DoType_调度器
@@ -7216,21 +7232,7 @@
    totallv = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
    return PlayerHorse.GetHorseSumLV(curPlayer) >= totallv
##2阶强化防具套装件数
# @param None
# @return None <Suitplus value="cnt"/>
def ConditionType_Suitplus(curPlayer, curMission, curActionNode):
    needCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
    equipSuitTypeDict = IpyGameDataPY.GetFuncEvalCfg('EquipSuitType')
    groupCnt = 0 #2阶强化防具套装件数
    for groupType, equipIndexList in equipSuitTypeDict.items():
        for i in equipIndexList:
            suiteInfo = ChEquip.GetSuiteInfoByPlace(curPlayer, i)
            for suiteType, lv in suiteInfo.items():
                if lv >= 2 and int(groupType) == 1 and suiteType == 2:
                    groupCnt +=1
    return groupCnt >= needCnt
##法宝激活个数
# @param None
@@ -7251,7 +7253,7 @@
# @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