| | |
| | | #注意2:
|
| | | #玩家移动的时候, 如果玩家有马匹 , 则允许玩家移动
|
| | | ################################################
|
| | | Def_HorseEquipIndex = 5
|
| | |
|
| | | ## 玩家骑马脚本(封包参数)
|
| | | # @param index 玩家索引
|
| | |
| | | # 未加载成功骑乘会导致模型加载失败报错
|
| | | 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")
|
| | |
| | |
|
| | | #---执行玩家换装逻辑---
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | if ChEquip.DoPlayerEquipItem(curPlayer, curHorse, ShareDefine.retHorse, tick):
|
| | | if ChEquip.DoPlayerEquipItem(curPlayer, curHorse, ItemCommon.GetEquipPackIndex(curHorse), tick):
|
| | | if isRideHorse:
|
| | | PlayerRideHorseUp(curPlayer, False)
|
| | |
|
| | |
| | | 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
|
| | |
| | | curItem = curItemPack.GetAt(itemIndex)
|
| | |
|
| | | #检查物品
|
| | | if not ItemCommon.CheckItemCanUse(curItem):
|
| | | if not ItemCommon.CheckItemCanUse(curItem) or ItemControler.GetIsAuctionItem(curItem):
|
| | | continue
|
| | |
|
| | | itemCnt = curItem.GetCount()
|
| | |
| | | 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)
|
| | |
| | | # @param curPlayer 玩家
|
| | | # @return None
|
| | | def PlayerHorseLogin(curPlayer):
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_Horse):
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_Horse, 1)
|
| | | #等级不能超上限,技能删了重新学
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | | delCnt = 0
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | dataIndex = i-delCnt
|
| | | skill = skillManager.GetSkillByIndex(dataIndex)
|
| | | if skill == None:
|
| | | continue
|
| | | if skill.GetFuncType() != ChConfig.Def_SkillFuncType_HorseSkill:
|
| | | continue
|
| | | skillTypeID = skill.GetSkillTypeID()
|
| | | skillManager.DeleteSkillBySkillTypeID(skillTypeID)
|
| | | delCnt += 1
|
| | | |
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetHorseCount()):
|
| | | ipyData = ipyDataMgr.GetHorseByIndex(i)
|
| | | horseID = ipyData.GetHorseID()
|
| | | curlv = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Horser_LV % horseID, 0, ChConfig.Def_PDictType_Horse)
|
| | | if not curlv:
|
| | | continue
|
| | | maxLV = ipyData.GetMaxLV()
|
| | | if curlv > maxLV:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_LV % horseID, maxLV, ChConfig.Def_PDictType_Horse)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Horser_Exp % horseID, 0, ChConfig.Def_PDictType_Horse)
|
| | | GameWorld.Log(' 老号坐骑等级超过上限,坐骑ID=%s,原LV=%s,重置为=%s'%(horseID, curlv, maxLV))
|
| | | curlv = maxLV
|
| | | |
| | | for lv in xrange(1, curlv + 1):
|
| | | upIpyData = IpyGameDataPY.GetIpyGameData("HorseUp", horseID, lv)
|
| | | if not upIpyData:
|
| | | break
|
| | | skillIDList = upIpyData.GetSkillID()
|
| | | if not skillIDList:
|
| | | continue
|
| | | for skillID in skillIDList:
|
| | | __GiveSkill(curPlayer, skillID, tick)
|
| | | # 重刷战力
|
| | | curControl = PlayerControl.PlayerControl(curPlayer)
|
| | | curControl.RefreshAllSkill()
|
| | | RefreshHorseAttr(curPlayer)
|
| | | |
| | | |
| | | Sync_HorseClassData(curPlayer)
|
| | | return
|
| | |
|
| | |
| | | # 记录开服活动马匹阶级
|
| | | 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)
|
| | |
|
| | |
|