hxp
2019-01-30 03f617028885a2e8840500bb520f3418d54eb791
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventShell.py
@@ -100,7 +100,7 @@
import PlayerExpandPackCfgMgr
import EventReport
import PlayerCoat
import PlayerSuccess
import PlayerGatherSoul
import PlayerArrestTask
import PlayerRune
import IpyGameDataPY
@@ -229,6 +229,63 @@
    EventLogic(curPlayer, sendPack_EventNPCID, tick)
    return
#// C1 06 跨服NPC对话 #tagCMCrossNPCTalk
#
#struct    tagCMCrossNPCTalk
#{
#    tagHead        Head;
#    WORD        ObjID;
#    DWORD        NPCID;
#    WORD        PosX;
#    WORD        PosY;
#};
def OnCrossNPCTalk(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    objID = clientData.ObjID
    npcID = clientData.NPCID
    #posX = clientData.PosX
    #posY = clientData.PosY
    if GameWorld.IsCrossServer():
        return
    lastTick = curPlayer.GetDictByKey("CrossNPCTalkTick")
    if tick - lastTick < 2000:
        return
    curPlayer.SetDict("CrossNPCTalkTick", tick)
    npcData = GameWorld.GetGameData().FindNPCDataByID(npcID)
    if not npcData:
        GameWorld.ErrLog("跨服NPCID不存在! npcID=%s" % npcID)
        return
    # 目前暂支持跨服采集
    if npcData.GetType() not in [IPY_GameWorld.ntCollection, IPY_GameWorld.ntMissionCollect]:
        return
    collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID)
    if collectNPCIpyData:
        if not NPCCommon.CheckCanCollectByNPCID(curPlayer, npcID, collectNPCIpyData):
            return
        msgDict = {"PlayerID":curPlayer.GetPlayerID(), "ObjID":objID, "NPCID":npcID}
        GameWorld.SendMsgToCrossServer(ShareDefine.ClientServerMsg_CollectNPC, msgDict)
    return
def ClientServerMsg_CollectNPC(curPlayer, msgData, serverGroupID, tick):
    ## 收到子服同步的采集NPC
    objID = msgData["ObjID"]
    npcID = msgData["NPCID"]
    curNPC = GameWorld.FindNPCByID(objID)
    if not curNPC:
        return
    if npcID !=  curNPC.GetNPCID():
        GameWorld.ErrLog("采集跨服NPC错误!npcID=%s != curNPCID=%s" % (npcID, curNPC.GetNPCID()))
        return
    EventLogic(curPlayer, objID, tick)
    return
##客户端//08 01封包响应 自定义函数: 事件处理
#@param curPlayer 当前玩家
#@param eventNPCID 事件NPCID
@@ -288,6 +345,9 @@
        return
    
    curPlayer.SetActionObj(curNPC)
    if NPCCommon.OnCollectNPCBegin(curPlayer, curNPC, tick):
        return
    
    prepareTime = FBLogic.GetFBPrepareTime(curPlayer, curNPC)
    
@@ -808,8 +868,8 @@
            giveItem.Clear()
            continue
    
    #---初始化装备显隐---
    curPlayer.SetEquipShowSwitch(IPY_GameWorld.revClothesCoat|IPY_GameWorld.revWeaponCoat|IPY_GameWorld.revMask)
    #---初始化装备显隐---前端自己设置
    #curPlayer.SetEquipShowSwitch(IPY_GameWorld.revClothesCoat|IPY_GameWorld.revWeaponCoat|IPY_GameWorld.revMask)
    
    #默认触发一次功能开启
    if curPlayer.GetLV() == 1:
@@ -1705,6 +1765,11 @@
def EventRespons_MagicWeaponLV(curPlayer, mwID, lv):
    # 法宝解锁进度
    RunQuestEvent(curPlayer, "magicweaponlv", '%s_%s'%(mwID, lv), Def_RunQuestType_RunAll)
    return
def EventRespons_MagicWeaponFBPassLV(curPlayer, mwID, lv):
    # 魔族法宝关卡进度
    RunQuestEvent(curPlayer, "mwfbpasslv", '%s_%s'%(mwID, lv), Def_RunQuestType_Normal)
    return
def EventRespons_SuccessFinish(curPlayer, succID):
@@ -3698,7 +3763,7 @@
    curPlayer.SetForbiddenResetItem(0)
    ExitCompose(curPlayer)
    ExitWarehouse(curPlayer)
    ExitRepair(curPlayer)
    #ExitRepair(curPlayer)
    ExitCreateFamily(curPlayer)
    ExitBillboard(curPlayer)
    #ExitEventLock(curPlayer)
@@ -3707,9 +3772,9 @@
    #npc商店退出
    ExitNPCShop(curPlayer)
    
    PlayerTrade.LeaveTrade(curPlayer, 0)
    #PlayerTrade.LeaveTrade(curPlayer, 0)
    # 清除py自定义状态
    ClearPyPlayerAction(curPlayer)
    #ClearPyPlayerAction(curPlayer)
    
    #调用底层结束事件
    #避免策划变更,导致其他退出锁定事件使任务1未接取就退出锁定
@@ -3939,7 +4004,7 @@
# @remarks 自定义函数, 读数据库任务删除表, 删除任务
def __DoLogic_DeleteMission(curPlayer, curMission):
    missionID = curMission.GetMissionID()
    GameWorld.Log("__DoLogic_DeleteMission---%s"%missionID)
    GameWorld.Log("__DoLogic_DeleteMission---%s"%missionID, curPlayer.GetID())
    delMissionData = GameWorld.GetGameData().GetMissionDeleteByID(missionID)
    #任务删除表中无此任务
    if not delMissionData:
@@ -4373,7 +4438,9 @@
    # 符印交换
    if PlayerRune.SwitchRune(curPlayer, pack_SrcBackpack, pack_DesBackPack, pack_SrcIndex, pack_DestIndex):
        return
    # 聚魂交换
    if PlayerGatherSoul.SwitchGatherSoul(curPlayer, pack_SrcBackpack, pack_DesBackPack, pack_SrcIndex, pack_DestIndex):
        return
    
    #ʱװ
    if PlayerCoat.SwitchCoat(curPlayer, pack_SrcBackpack, pack_DesBackPack, pack_SrcIndex, pack_DestIndex):