ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerPet.py
@@ -41,6 +41,8 @@
import CalcNoLineEffect
import CrossPlayerData
import CalcLineEffect
import PlayerActivity
import PlayerHorse
import random
import math
@@ -321,6 +323,7 @@
    petID = petStruct.PetID
    petStruct.BindType = petItem.GetIsBind()
    petStruct.Name = str(petStruct.PetID)#petNpcData.GetName() 配表不是UTF8会导致报错,默认用ID当名字
    petStruct.DailyTrainCnt = PlayerHorse.GetHorsePetSkinIndex(curPlayer, 2, npcID)
    # 宠物lv 改为 阶级 用于客户端显示名字颜色用
#    classLV = petItem.GetUserAttr(ShareDefine.Def_IudetPet_ClassLV)
#    rolePet.SetLV(classLV)
@@ -370,6 +373,7 @@
    
    #记录出战的宠物索引 默认+1 0则代表没有
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPetIndex, petItemIndex + 1)
    rolePet.SetSightLevel(curPlayer.GetSightLevel())
    return True
def AutoSummonPet(curPlayer):
@@ -484,7 +488,6 @@
    if not ItemControler.PlayerItemControler(curPlayer).PutInItem(petPackIndex, newPetItem):
        return
    
    PlayerMagicWeapon.SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_Pet, len(GetActivePetID(curPlayer)))
    ItemCommon.ReduceItem(curPlayer, itemPack, itemList, needItemCnt, False, ChConfig.ItemDel_Pet)
        
    EventShell.EventRespons_OnActivatePet(curPlayer, petNPCID)
@@ -539,7 +542,6 @@
    
    if not ItemControler.PlayerItemControler(curPlayer).PutInItem(petPackIndex, newPetItem):
        return
    PlayerMagicWeapon.SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_Pet, len(GetActivePetID(curPlayer)))
    SetPetSkillFightPower(curPlayer)    # 技能战力重算
    petItemIndex = GetPetDataItemIndexByNPCID(curPlayer, petNPCID)
    DoChangePetState(curPlayer, petItemIndex, ShareDefine.Def_PetState_Fight)
@@ -709,7 +711,9 @@
            #广播
            sysMark = sysMarkList[i] if i < len(sysMarkList) else 'PetUpLv'
            PlayerControl.WorldNotify(0, sysMark, [playerName, petNPCID, limitPetClassLV, skillid])
            #增加升级活跃点效果
            PlayerActivity.AddActivityByLVOnLearnSkill(curPlayer, skillid)
        if not learnSkillList and updClassLV + 1 == maxClassLV:
            PlayerControl.WorldNotify(0, 'PetUpLvMax', [playerName, petNPCID])
        # 如果是当前出战的宠物, 则该宠物学习技能
@@ -747,6 +751,18 @@
            continue
        totalPetLV += classLV
    return totalPetLV
def IsPetMaxLV(curPlayer, petNPCID):
    petItem = GetPetDataItemByNPCID(curPlayer, petNPCID)
    if not petItem:
        return
    petNPCID = petItem.GetUserAttr(ShareDefine.Def_IudetPet_NPCID)
    classLV = petItem.GetUserAttr(ShareDefine.Def_IudetPet_ClassLV)
    petIpyData = GetPetIpydata(petNPCID)
    if not petIpyData:
        return
    maxClassLV = petIpyData.GetMaxRank()
    return classLV + 2 > maxClassLV
## 刷新宠物数据物品增加的属性
def RefreshPetItemAddAttr(curPlayer, isUpdBillboard):
@@ -805,7 +821,7 @@
    allAttrListPetSign = [{} for _ in range(4)] # 属性含 特殊的技能属性(因为签到技能属性成长,战力也是成长的,所以不能放技能中算战力,暂时放魂石中)
    allAttrListPetSoul = [{} for _ in range(4)]
    skillAttrList = [{} for _ in range(4)]
    allAttrListPetSkin = [{} for _ in range(4)]
    totalMinAtk, totalMaxAtk = GetPetAtkValue(curPlayer)
    PlayerControl.CalcAttrDict_Type(ShareDefine.Def_Effect_PetMinAtk, totalMinAtk, allAttrListPet)
    PlayerControl.CalcAttrDict_Type(ShareDefine.Def_Effect_PetMaxAtk, totalMaxAtk, allAttrListPet)
@@ -837,6 +853,7 @@
                continue
            SkillShell.CalcBuffEffAttr(curPlayer, curEffect, skillAttrList)
    
    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Pet, allAttrListPet)
    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_PetSoul, allAttrListPetSoul)
    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_PetSign, allAttrListPetSign)
@@ -856,6 +873,13 @@
        if not petIpyData:
            continue
        initFPAdd += petIpyData.GetInitFightPower()
        #觉醒战力
        skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (2, petItemNPCID), 0)
        skinIpyData = IpyGameDataPY.GetIpyGameDataNotLog('HorsePetSkin', 2, petItemNPCID, skinData/100)
        if skinIpyData:
            for attrID, attrValue in skinIpyData.GetAttrInfo().items():
                PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrListPetSkin)
    PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_PetSkin, allAttrListPetSkin)
    curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Pet, initFPAdd)
#    GameWorld.DebugLog("宠物榜NPCID: %s, petDict=%s" % (billPetNPCID, str(billPetDict)))
    return