| | |
| | | import SkillCommon
|
| | | import PlayerMagicWeapon
|
| | | import PassiveBuffEffMng
|
| | | import CrossPlayerData
|
| | | import PlayerWeekParty
|
| | | import PlayerPet
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | #注意2:
|
| | | #玩家移动的时候, 如果玩家有马匹 , 则允许玩家移动
|
| | | ################################################
|
| | | Def_HorseEquipIndex = 5
|
| | |
|
| | | ## 玩家骑马脚本(封包参数)
|
| | | # @param index 玩家索引
|
| | |
| | | pack = IPY_GameWorld.IPY_CRideHorse()
|
| | | #//1: 骑马 0: 下马
|
| | | curPlayerRideType = pack.GetRide()
|
| | | if PlayerControl.GetCrossMapID(curPlayer):
|
| | | # 暂只处理上马
|
| | | if curPlayerRideType:
|
| | | dataList = [curPlayerRideType]
|
| | | CrossPlayerData.SendDataToCrossServer(curPlayer, CrossPlayerData.CrossData_RideHorse, dataList)
|
| | | return
|
| | | #骑马行为状态, 客户端限制
|
| | | if not OperControlManager.IsObjCanDoAction(curPlayer,
|
| | | ChConfig.Def_Obj_ActState_ClientAct,
|
| | |
| | |
|
| | | #if curPlayer.IsMoving():
|
| | | # curPlayer.Move(curPlayer.GetDestPosX(), curPlayer.GetDestPosY())
|
| | | return
|
| | |
|
| | | def CrossServer_RideHorse(curPlayer, dataList):
|
| | | curPlayerRideType = dataList[0]
|
| | | |
| | | #骑马
|
| | | if curPlayerRideType == 1:
|
| | | PlayerRideHorseUp(curPlayer, True)
|
| | | |
| | | return
|
| | |
|
| | | #---------------------下马逻辑
|
| | |
| | | # 未加载成功骑乘会导致模型加载失败报错
|
| | | if not curPlayer.GetInitOK():
|
| | | return False
|
| | | |
| | | #地图不允许骑马 RideLimit_lhs_0
|
| | | if not GameWorld.GetMap().GetMapCanRide():
|
| | | PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
|
| | | return False
|
| | | |
| | | customMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | if customMapID:
|
| | | ipyMapData = IpyGameDataPY.GetIpyGameData("ChinMap", customMapID)
|
| | | if not ipyMapData or not ipyMapData.GetCanRide():
|
| | | PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
|
| | | return False
|
| | | else:
|
| | | #地图不允许骑马 RideLimit_lhs_0
|
| | | if not GameWorld.GetMap().GetMapCanRide():
|
| | | PlayerControl.NotifyCode(curPlayer, "RideLimit_lhs_0")
|
| | | return False
|
| | |
|
| | | #检查玩家状态,只有在空闲状态才能上马
|
| | | if curPlayer.GetPlayerVehicle() != IPY_GameWorld.pvNull :
|
| | |
| | |
|
| | | #检查是否装备指定ID物品
|
| | | playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | itemRideHorse = playerEquip.GetAt(ShareDefine.retHorse)
|
| | | itemRideHorse = playerEquip.GetAt(Def_HorseEquipIndex)
|
| | | #无指定道具
|
| | | if itemRideHorse.IsEmpty():
|
| | | #PlayerControl.NotifyCode(curPlayer, "NotPrepareSteed")
|
| | |
| | | horseIndex = packData.Index
|
| | |
|
| | | DoChangeHorse(curPlayer, horseIndex, tick)
|
| | | |
| | | if not GameWorld.IsCrossServer():
|
| | | dataList = [horseIndex]
|
| | | CrossPlayerData.SendDataToCrossServer(curPlayer, CrossPlayerData.CrossData_HorseChange, dataList)
|
| | | return
|
| | |
|
| | | def CrossServer_ChangeHorse(curPlayer, dataList):
|
| | | ## 跨服处理 坐骑变更
|
| | | horseIndex = dataList[0]
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Horse", horseIndex)
|
| | | if not ipyData:
|
| | | return
|
| | | |
| | | horseItemID = ipyData.GetItemID()
|
| | | |
| | | if ItemCommon.FindItemInPackByItemID(curPlayer, horseItemID, IPY_GameWorld.rptEquip):
|
| | | return
|
| | | |
| | | isOK = ItemControler.PutItemInTempSwap(curPlayer, horseItemID)
|
| | | if not isOK:
|
| | | return
|
| | | |
| | | curHorse = ItemCommon.FindItemInPackByItemID(curPlayer, horseItemID, ShareDefine.rptTempSwap)
|
| | | if not curHorse:
|
| | | return
|
| | | |
| | | isRideHorse = curPlayer.GetPlayerVehicle() == IPY_GameWorld.pvHorse
|
| | | if isRideHorse:
|
| | | PlayerRideHorseDown(curPlayer, False)
|
| | | |
| | | #---执行玩家换装逻辑---
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | if ChEquip.DoPlayerEquipItem(curPlayer, curHorse, ItemCommon.GetEquipPackIndex(curHorse), tick):
|
| | | if isRideHorse:
|
| | | PlayerRideHorseUp(curPlayer, False)
|
| | | |
| | | return
|
| | |
|
| | | def DoChangeHorse(curPlayer, horseIndex, tick):
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Horse", horseIndex)
|
| | |
| | | GameWorld.DebugLog("OnPlayerChangeHorse() pack(%s) no horse(%s) item" \
|
| | | % (ShareDefine.rptTempSwap, horseItemID))
|
| | | return
|
| | | |
| | | curHorse.SetUserAttr(ShareDefine.Def_IudetHorsePetSkinIndex, GetHorsePetSkinIndex(curPlayer, 1, horseIndex))
|
| | | #检查玩家状态是否可以换装
|
| | | if not ChEquip.CheckPlayerCanEquipItem(curPlayer):
|
| | | return
|
| | |
| | | PlayerRideHorseDown(curPlayer, False)
|
| | |
|
| | | #---执行玩家换装逻辑---
|
| | | if ChEquip.DoPlayerEquipItem(curPlayer, curHorse, ShareDefine.retHorse, tick):
|
| | | if ChEquip.DoPlayerEquipItem(curPlayer, curHorse, ItemCommon.GetEquipPackIndex(curHorse), tick):
|
| | | if isRideHorse:
|
| | | PlayerRideHorseUp(curPlayer, False)
|
| | | return
|
| | |
| | | #
|
| | | # #---执行玩家换装逻辑---
|
| | | # tick = GameWorld.GetGameWorld().GetTick()
|
| | | # ChEquip.DoPlayerEquipItem(curPlayer, curHorse, ShareDefine.retHorse, tick)
|
| | | # ChEquip.DoPlayerEquipItem(curPlayer, curHorse, Def_HorseEquipIndex, tick)
|
| | | #
|
| | | # __HorseLearnSkill(curPlayer, 0)
|
| | | # # 计算属性 防止给第一只坐骑后,客户端坐骑战斗力为0
|
| | |
| | | allAttrList = [{} for _ in range(4)]
|
| | | allAttrListHorseSoul = [{} for _ in range(4)]
|
| | | skillAttrList = [{} for _ in range(4)]
|
| | | allAttrListSkin = [{} for _ in range(4)]
|
| | | # 判断玩家是否可以升级马匹
|
| | | if isCheckOpen and not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_Horse):
|
| | | #对应的任务限制未完成
|
| | |
| | | maxSpeed = max(maxSpeed, attrValueList[i])
|
| | | continue
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValueList[i], allAttrList)
|
| | | skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (1, horseID), 0)
|
| | | skinIpyData = IpyGameDataPY.GetIpyGameDataNotLog('HorsePetSkin', 1, horseID, skinData/100)
|
| | | if skinIpyData:
|
| | | for attrID, attrValue in skinIpyData.GetAttrInfo().items():
|
| | | PlayerControl.CalcAttrDict_Type(attrID, attrValue, allAttrListSkin)
|
| | |
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_Horse, skillFPEx+initFPAdd)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSkill, skillAttrList)
|
| | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_SpeedHorse, maxSpeed)
|
| | |
|
| | | # 果实对坐骑的加成, 魂石果实算附加属性层,单独计算
|
| | | PlayerAttrFruit.CalcAttrFruitAddAtrr(curPlayer, allAttrListHorseSoul, ShareDefine.Def_AttrFruitFunc_Horse)
|
| | |
|
| | | fightPowerEx = PlayerAttrFruit.CalcAttrFruitAddAtrr(curPlayer, allAttrListHorseSoul, ShareDefine.Def_AttrFruitFunc_Horse)
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_MFPEx % ShareDefine.Def_MFPType_HorseSoul, fightPowerEx)
|
| | | |
| | | #PlayerControl.CalcFuncPackItem(curPlayer, ShareDefine.Def_Pack_Type_HorseSkill, allAttrList)
|
| | |
|
| | | # 保存计算值
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_Horse, allAttrList)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSoul, allAttrListHorseSoul)
|
| | | PlayerControl.SetCalcAttrListValue(curPlayer, ChConfig.Def_CalcAttrFunc_HorseSkin, allAttrListSkin)
|
| | | |
| | | return
|
| | |
|
| | | def __CalcHorseSkillAttr(curPlayer, allAttrList):
|
| | |
| | | curItem = curItemPack.GetAt(itemIndex)
|
| | |
|
| | | #检查物品
|
| | | if not ItemCommon.CheckItemCanUse(curItem):
|
| | | if not ItemCommon.CheckItemCanUse(curItem) or ItemControler.GetIsAuctionItem(curItem):
|
| | | continue
|
| | |
|
| | | itemCnt = curItem.GetCount()
|
| | |
| | |
|
| | | skillIDList = upIpyData.GetSkillID()
|
| | | if skillIDList:
|
| | | sysMark = upIpyData.GetSysMark() or 'MountUpLv'
|
| | | for skillID in skillIDList:
|
| | | __GiveSkill(curPlayer, skillID, tick)
|
| | | PlayerControl.WorldNotify(0, 'MountUpLv', [playerName, horseID, updClassLV, skillID])
|
| | | PlayerControl.WorldNotify(0, sysMark, [playerName, horseID, updClassLV, skillID])
|
| | | if not skillIDList and updClassLV == maxLV:
|
| | | PlayerControl.WorldNotify(0, 'MountUpLvMax', [playerName, horseID])
|
| | |
|
| | |
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_HorseAllLV, 1, [horseID, updClassLV])
|
| | |
|
| | | EventShell.EventRespons_HorseLV(curPlayer, updClassLV)
|
| | | |
| | | EventShell.EventRespons_HorseUp(curPlayer)
|
| | |
|
| | | addLV = updClassLV - horseLV
|
| | | if addLV:
|
| | |
| | | #EventReport.WriteEvent_horse_class(curPlayer, horseLV, curExp, delCnt, updClassLV, updExp)
|
| | | return
|
| | |
|
| | |
|
| | | ## 坐骑阶级提升
|
| | | # @param curPlayer
|
| | | # @param horseID: 坐骑id
|
| | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_LV%horseID, updateClassLV, ChConfig.Def_PDictType_Horse)
|
| | | #EventReport.WriteEvent_custom_mission_log(curPlayer, ChConfig.CME_Class_Horse, ChConfig.CME_Log_End, 1, cmeInfoEx=str(updateClassLV))
|
| | | sumLV = GetHorseSumLV(curPlayer)
|
| | | PlayerMagicWeapon.SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_Horse, sumLV)
|
| | |
|
| | | # 刷属性,更新排行榜
|
| | | RefreshHorseAttr(curPlayer)
|
| | | # 玩家马匹进阶
|
| | |
| | | # @return None
|
| | | def PlayerHorseLogin(curPlayer):
|
| | | Sync_HorseClassData(curPlayer)
|
| | | SyncHorsePetSkinData(curPlayer)
|
| | | return
|
| | |
|
| | |
|
| | |
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemList, needItemCnt, False, ChConfig.ItemDel_Horse)
|
| | | #设置初始等级
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_LV % horseID, ipyData.GetInitLV(), ChConfig.Def_PDictType_Horse)
|
| | | |
| | | for _ in xrange(ipyData.GetInitLV()):
|
| | | EventShell.EventRespons_HorseUp(curPlayer)
|
| | | # 记录开服活动马匹阶级
|
| | | sumLV = GetHorseSumLV(curPlayer)
|
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_HorseLV, sumLV)
|
| | | PlayerMagicWeapon.SetMWPrivilegeData(curPlayer, ChConfig.MWPrivilege_Horse, sumLV)
|
| | | PlayerWeekParty.AddWeekPartyActionCnt(curPlayer, ChConfig.Def_WPAct_Horse, horseID, False)
|
| | | |
| | | playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | itemRideHorse = playerEquip.GetAt(ShareDefine.retHorse)
|
| | | itemRideHorse = playerEquip.GetAt(Def_HorseEquipIndex)
|
| | | #无指定道具
|
| | | if itemRideHorse.IsEmpty():
|
| | | DoChangeHorse(curPlayer, horseID, tick)
|
| | |
| | | # tick = GameWorld.GetGameWorld().GetTick()
|
| | | # PlayerRideHorseDown(curPlayer, False)
|
| | | # # 执行玩家换装逻辑
|
| | | # if ChEquip.DoPlayerEquipItem(curPlayer, curHorseSkin, ShareDefine.retHorse, tick):
|
| | | # if ChEquip.DoPlayerEquipItem(curPlayer, curHorseSkin, Def_HorseEquipIndex, tick):
|
| | | # PlayerRideHorseUp(curPlayer, False)
|
| | |
|
| | |
|
| | |
| | |
|
| | | # 刷属性,更新排行榜
|
| | | RefreshHorseAttr(curPlayer)
|
| | | PlayerControl.WorldNotify(0, 'GetMount', [curPlayer.GetName(), ipyData.GetItemID()])
|
| | | sysMark = ipyData.GetUnlockSys() or 'GetMount'
|
| | | PlayerControl.WorldNotify(0, sysMark, [curPlayer.GetName(), ipyData.GetItemID()])
|
| | | #
|
| | | # HorseSkinNotifyDict = ReadChConfig.GetEvalChConfig("HorseSkinNotify")
|
| | | # if horseSkinID in HorseSkinNotifyDict:
|
| | |
| | | if horseLV > maxLV:
|
| | | maxLV = horseLV
|
| | | return maxLV
|
| | |
|
| | |
|
| | | def IsHorseMaxLV(curPlayer, horseID):
|
| | | horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
|
| | | if horseLV <= 0:
|
| | | return
|
| | | horseIpyData = IpyGameDataPY.GetIpyGameData("Horse", horseID)
|
| | | if not horseIpyData:
|
| | | return
|
| | | maxLV = horseIpyData.GetMaxLV()
|
| | | return horseLV >= maxLV
|
| | |
|
| | |
|
| | | #============================骑宠觉醒=============================
|
| | | #// A5 29 骑宠觉醒 #tagCMHorsePetAwake
|
| | | #
|
| | | #struct tagCMHorsePetAwake
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD Type; // 1-坐骑 2-灵宠
|
| | | # DWORD ID; // 对应坐骑表灵宠表ID
|
| | | # DWORD EatItemID; // 吞噬的物品ID
|
| | | #};
|
| | | def OnHorsePetAwake(index, curPackData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | skintype = curPackData.Type
|
| | | horsePetID = curPackData.ID
|
| | | eatItemID = curPackData.EatItemID
|
| | | if not IpyGameDataPY.GetIpyGameDataByCondition('HorsePetSkin', {'Type':skintype, 'ID':horsePetID}):
|
| | | return
|
| | | if skintype == 1:
|
| | | if not IsHorseMaxLV(curPlayer, horsePetID):
|
| | | GameWorld.DebugLog('骑宠觉醒 对应骑宠未满级 horsePetID=%s'%horsePetID)
|
| | | return
|
| | | else:
|
| | | if not PlayerPet.IsPetMaxLV(curPlayer, horsePetID):
|
| | | GameWorld.DebugLog('骑宠觉醒 对应骑宠未满级 horsePetID=%s'%horsePetID)
|
| | | return
|
| | | |
| | | skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), 0)
|
| | | curSkinLV, curSkinIndex = skinData/100, skinData%100
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('HorsePetSkin', skintype, horsePetID, curSkinLV)
|
| | | if not ipyData:
|
| | | return
|
| | | upNeedExp = ipyData.GetNeedExp()
|
| | | if not upNeedExp:
|
| | | GameWorld.DebugLog('骑宠觉醒 已满级')
|
| | | return
|
| | | curExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinExp % (skintype, horsePetID), 0)
|
| | | curItem = GameWorld.GetGameData().GetItemByTypeID(eatItemID)
|
| | | if not curItem:
|
| | | return
|
| | | curEff = curItem.GetEffectByIndex(4)
|
| | | curEffID = curEff.GetEffectID()
|
| | | if curEffID != ChConfig.Def_Effect_HorsePetSkinExp:
|
| | | return
|
| | | addExp = curEff.GetEffectValue(0)
|
| | | if not addExp:
|
| | | return
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | hasEnough, itemList = ItemCommon.GetItem_FromPack_ByID(eatItemID, itemPack, 1)
|
| | | if not hasEnough:
|
| | | GameWorld.DebugLog("OnHorsePetAwake() item(%s[%s]) isn't enough" % (eatItemID, 1))
|
| | | return
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, itemList, 1, False, ChConfig.ItemDel_HorsePetAwake)
|
| | | |
| | | updExp = curExp + addExp
|
| | | updSkinLV = curSkinLV
|
| | | updSkinIndex = curSkinIndex
|
| | | if updExp >= upNeedExp:
|
| | | for _ in xrange(10):
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('HorsePetSkin', skintype, horsePetID, updSkinLV+1)
|
| | | if not ipyData:
|
| | | break
|
| | | if updExp < upNeedExp:
|
| | | break
|
| | | updExp -= upNeedExp
|
| | | updSkinLV += 1
|
| | | updSkinIndex = ipyData.GetSkinIndex()
|
| | | upNeedExp = ipyData.GetNeedExp()
|
| | | |
| | | updSkinData = updSkinLV*100+updSkinIndex
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), updSkinData)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorsePetSkinExp % (skintype, horsePetID), updExp)
|
| | | if curSkinIndex != updSkinIndex:
|
| | | __DoHorsePetSkinChange(curPlayer, skintype, horsePetID, updSkinIndex)
|
| | | if updSkinLV != curSkinLV:
|
| | | if skintype == 1:
|
| | | RefreshHorseAttr(curPlayer)
|
| | | else:
|
| | | PlayerPet.RefreshPetItemAddAttr(curPlayer, True)
|
| | | |
| | | SyncHorsePetSkinData(curPlayer, [[skintype, horsePetID]])
|
| | | return
|
| | |
|
| | | #// A5 30 骑宠外观选择 #tagCMHorsePetSkinSelect
|
| | | #struct tagCMHorsePetSkinSelect
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD Type; // 1-坐骑 2-灵宠
|
| | | # DWORD ID; // 对应坐骑表灵宠表ID
|
| | | # BYTE SkinIndex; // 外观索引
|
| | | #};
|
| | | def OnHorsePetSkinSelect(index, curPackData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | skintype = curPackData.Type
|
| | | horsePetID = curPackData.ID
|
| | | skinIndex = curPackData.SkinIndex
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataByCondition('HorsePetSkin', {'Type':skintype, 'ID':horsePetID, 'SkinIndex':skinIndex})
|
| | | if not ipyData:
|
| | | return
|
| | | skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), 0)
|
| | | curSkinLV, curSkinIndex = skinData/100, skinData%100
|
| | | if skinIndex == curSkinIndex:
|
| | | return
|
| | | if curSkinLV < ipyData.GetSkinLV():
|
| | | return
|
| | | |
| | | updSkinData = curSkinLV*100+skinIndex
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), updSkinData)
|
| | | |
| | | __DoHorsePetSkinChange(curPlayer, skintype, horsePetID, skinIndex)
|
| | | |
| | | SyncHorsePetSkinData(curPlayer, [[skintype, horsePetID]])
|
| | | return
|
| | |
|
| | | def __DoHorsePetSkinChange(curPlayer, skinType, horsePetID, skinIndex):
|
| | | ##骑宠觉醒外观更换
|
| | | ChEquip.ChangeEquipfacadeByHorsePetSkin(curPlayer, skinType, skinIndex)
|
| | | if skinType == 1:#坐骑
|
| | | playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | itemRideHorse = playerEquip.GetAt(Def_HorseEquipIndex)
|
| | | #无指定道具
|
| | | if itemRideHorse.IsEmpty():
|
| | | return
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("Horse", horsePetID)
|
| | | if not ipyData:
|
| | | return
|
| | | horseItemID = ipyData.GetItemID()
|
| | | if itemRideHorse.GetItemTypeID() != horseItemID:
|
| | | return
|
| | | itemRideHorse.SetUserAttr(ShareDefine.Def_IudetHorsePetSkinIndex, skinIndex)
|
| | | elif skinType == 2:#灵宠
|
| | | pass
|
| | | return
|
| | |
|
| | | def GetHorsePetSkinIndex(curPlayer, skintype, horsePetID):
|
| | | # 获取骑宠觉醒外观索引
|
| | | skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), 0)
|
| | | return skinData%100
|
| | |
|
| | | def SyncHorsePetSkinData(curPlayer, skinList=None):
|
| | | if not skinList:
|
| | | skinList = []
|
| | | ipyMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyMgr.GetHorsePetSkinCount()):
|
| | | ipyData = ipyMgr.GetHorsePetSkinByIndex(i)
|
| | | if [ipyData.GetType(), ipyData.GetID()] not in skinList:
|
| | | skinList.append([ipyData.GetType(), ipyData.GetID()])
|
| | | |
| | | packData = ChPyNetSendPack.tagMCHorsePetSkinData()
|
| | | packData.Clear()
|
| | | packData.InfoList = []
|
| | | for skintype, horsePetID in skinList:
|
| | | skinInfo = ChPyNetSendPack.tagMCHorsePetSkinInfo()
|
| | | skinInfo.Type = skintype
|
| | | skinInfo.ID = horsePetID
|
| | | curExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinExp % (skintype, horsePetID), 0)
|
| | | skinData = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorsePetSkinData % (skintype, horsePetID), 0)
|
| | | if not curExp and not skinData:
|
| | | continue
|
| | | curSkinLV, curSkinIndex = skinData/100, skinData%100
|
| | | skinInfo.Exp = curExp
|
| | | skinInfo.SkinLV = curSkinLV
|
| | | skinInfo.SkinIndex = curSkinIndex
|
| | | packData.InfoList.append(skinInfo)
|
| | | packData.Num = len(packData.InfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | |
|
| | | |