| | |
| | | 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
|
| | |
| | | return
|
| | |
|
| | | curPlayer.SetActionObj(curNPC)
|
| | | |
| | | if NPCCommon.OnCollectNPCBegin(curPlayer, curNPC, tick):
|
| | | return
|
| | |
|
| | | prepareTime = FBLogic.GetFBPrepareTime(curPlayer, curNPC)
|
| | |
|
| | |
| | | RunQuestEvent(curPlayer, "trialexange", costItemID, Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | def EventRespons_EquipByPlace(curPlayer, equipplace):
|
| | | def EventRespons_EquipByPlace(curPlayer, itemClassLV, equipplace):
|
| | | #穿戴某部位装备(非时效)
|
| | | RunQuestEvent(curPlayer, "equipbyplace", equipplace, Def_RunQuestType_Normal)
|
| | | RunQuestEvent(curPlayer, "equipbyplace", '%s_%s'%(itemClassLV, equipplace), Def_RunQuestType_Normal)
|
| | | return
|
| | |
|
| | | def EventRespons_CompoundEquip(curPlayer, itemColor, itemQuality):
|