| | |
| | | import GameMap
|
| | | import OpenServerCampaign
|
| | | import PlayerMagicWeapon
|
| | | import PassiveBuffEffMng
|
| | | import PlayerWeekParty
|
| | | import CalcNoLineEffect
|
| | | import CrossPlayerData
|
| | | import CalcLineEffect
|
| | |
|
| | | import random
|
| | |
| | | if not newPetItem:
|
| | | return
|
| | |
|
| | | newPetItem.SetIsBind(True)
|
| | | newPetItem.SetUserAttr(ShareDefine.Def_IudetPet_NPCID, petNPCID)
|
| | | newPetItem.SetUserAttr(ShareDefine.Def_IudetPet_State, ShareDefine.Def_PetState_Null)
|
| | |
|
| | |
| | | # petItem.SetUserAttr(ShareDefine.Def_IudetPet_State, tagState)
|
| | | # GameWorld.DebugLog("切换宠物状态异常防范! curState=%s,tagState=%s" % (curState, tagState))
|
| | |
|
| | | if not GameWorld.IsCrossServer():
|
| | | dataList = [petNPCID, curClasslv, tagState]
|
| | | CrossPlayerData.SendDataToCrossServer(curPlayer, CrossPlayerData.CrossData_PetState, dataList)
|
| | | |
| | | return
|
| | |
|
| | | def CrossServer_DoChangePetState(curPlayer, dataList):
|
| | | ## 跨服处理 宠物战斗状态变更
|
| | | petNPCID, curClasslv, tagState = dataList
|
| | | petItem = GetPetDataItemByNPCID(curPlayer, petNPCID)
|
| | | if not petItem:
|
| | | newPetItem = GetNewPetDataItem(curPlayer, petNPCID)
|
| | | if not newPetItem:
|
| | | return
|
| | | if not ItemControler.PlayerItemControler(curPlayer).PutInItem(ShareDefine.rptPet, newPetItem):
|
| | | return
|
| | | petItem = GetPetDataItemByNPCID(curPlayer, petNPCID)
|
| | | if not petItem:
|
| | | return
|
| | | |
| | | curItemClasslv = petItem.GetUserAttr(ShareDefine.Def_IudetPet_ClassLV)
|
| | | # 处理技能问题,暂不处理
|
| | | if curClasslv > curItemClasslv:
|
| | | pass
|
| | | |
| | | curState = petItem.GetUserAttr(ShareDefine.Def_IudetPet_State) # 当前状态
|
| | | if curState == ShareDefine.Def_PetState_Fight:
|
| | | PetControl.ReCallFightPet(curPlayer)
|
| | | |
| | | if tagState == ShareDefine.Def_PetState_Fight:
|
| | | __DoPetGoOutToFight(curPlayer, petItem)
|
| | | |
| | | return
|
| | |
|
| | |
|
| | | ## 执行宠物出战逻辑
|
| | |
| | | #---通知客户端---
|
| | | #rolePet.Sync_PetInfo()
|
| | | #刷新技能栏
|
| | | rolePet.Sync_SkillList()
|
| | | #rolePet.Sync_SkillList()
|
| | |
|
| | | #---收到"宠物出战"请求---
|
| | | #检查是否可出战
|
| | |
| | |
|
| | | # 开服活动数据
|
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_PetLV, GetTotalPetLV(curPlayer))
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Pet, petNPCID, False)
|
| | | return True
|
| | |
|
| | |
|