hch
2019-03-20 3744bec3b23aa4840b1e7934b1c3378e32937912
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py
@@ -37,8 +37,9 @@
import GameMap
import OpenServerCampaign
import PlayerMagicWeapon
import PassiveBuffEffMng
import PlayerWeekParty
import CalcNoLineEffect
import CrossPlayerData
import CalcLineEffect
import random
@@ -105,7 +106,6 @@
    if not newPetItem:
        return
    
    newPetItem.SetIsBind(True)
    newPetItem.SetUserAttr(ShareDefine.Def_IudetPet_NPCID, petNPCID)
    newPetItem.SetUserAttr(ShareDefine.Def_IudetPet_State, ShareDefine.Def_PetState_Null)
    
@@ -266,8 +266,39 @@
#        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
## 执行宠物出战逻辑
@@ -474,6 +505,7 @@
    
    # 开服活动数据
    OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_PetLV, GetTotalPetLV(curPlayer))
    PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Pet, petNPCID, False)
    return True