hxp
2025-11-24 47723b47452eadfaccd2a2813a2c8877a9ebbcf1
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerHorse.py
@@ -94,10 +94,10 @@
        costItemIndexList, bindCnt, unBindCnt = ItemCommon.GetPackItemBindStateIndexInfo(curPlayer, costItemID, costItemCount)
        lackCnt = costItemCount - bindCnt - unBindCnt
        if lackCnt > 0:
            GameWorld.DebugLog("消耗道具不足,无法升级坐骑! costItemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s"
            costItemCount -= lackCnt
            GameWorld.DebugLog("消耗道具不足,有多少消耗多少! costItemID=%s,costItemCount=%s,bindCnt=%s,unBindCnt=%s,lackCnt=%s"
                               % (costItemID, costItemCount, bindCnt, unBindCnt, lackCnt))
            return
        # 扣除消耗
        ItemCommon.DelCostItemByBind(curPlayer, costItemIndexList, bindCnt, unBindCnt, costItemCount, ChConfig.ItemDel_Horse)
        
@@ -185,6 +185,9 @@
    
    classLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
    horseLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseLV)
    if not classLV and not horseLV:
        #GameWorld.DebugLog("坐骑未开启")
        return
    
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for index in range(ipyDataMgr.GetHorseClassCount()):
@@ -257,7 +260,7 @@
#{
#    tagHead         Head;
#    BYTE        OPType;    // 操作 1-激活;2-佩戴;3-升星
#    BYTE        SkinID;    // 外观ID,佩戴时发0即为卸下
#    WORD        SkinID;    // 外观ID,佩戴时发0即为卸下
#};
def OnHorseSkinOP(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
@@ -305,21 +308,25 @@
    ipyData = IpyGameDataPY.GetIpyGameData("HorseSkin", horseSkinID)
    if not ipyData:
        return
    if ipyData.GetUnlockWay() != 2:
        GameWorld.DebugLog("非道具激活的不用添加: horseSkinID=%s" % (horseSkinID), playerID)
        return
    if not isFree:
        itemID = ipyData.GetUnlockValue()
        itemCount = ipyData.GetUnlockNeedCnt()
        if not itemID or not itemCount:
            return
        needItemList = [[itemID, itemCount]]
        itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
        lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)
        if lackItemDict:
            GameWorld.DebugLog("激活所需物品不足! horseSkinID=%s,lackItemDict=%s" % (horseSkinID, lackItemDict), playerID)
            return
        ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "AddHorseSkin")
        unlockWay = ipyData.GetUnlockWay()
        if unlockWay == 1:
            classLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
            if classLV < ipyData.GetUnlockValue():
                GameWorld.DebugLog("坐骑阶级不足无法解锁! classLV=%s < %s" % (classLV, ipyData.GetUnlockValue()), playerID)
                return
        elif unlockWay == 2:
            itemID = ipyData.GetUnlockValue()
            itemCount = ipyData.GetUnlockNeedCnt()
            if not itemID or not itemCount:
                return
            needItemList = [[itemID, itemCount]]
            itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
            lackItemDict, delInfoDict = ItemCommon.GetCostItemIndexList(needItemList, itemPack)
            if lackItemDict:
                GameWorld.DebugLog("激活所需物品不足! horseSkinID=%s,lackItemDict=%s" % (horseSkinID, lackItemDict), playerID)
                return
            ItemCommon.DelCostItem(curPlayer, itemPack, delInfoDict, "AddHorseSkin")
        
    ipyExpireSeconds = ipyData.GetExpireMinutes() * 60
    
@@ -385,6 +392,8 @@
    for index in range(ipyDataMgr.GetHorseSkinCount()):
        ipyData = ipyDataMgr.GetHorseSkinByIndex(index)
        horseSkinID = ipyData.GetSkinID()
        if horseSkinID <= 0:
            continue
        if ipyData.GetUnlockWay() != 1:
            continue
        if ipyData.GetUnlockValue() > 0:
@@ -399,14 +408,14 @@
    if state:
        return True
    
    if not ipyData:
        ipyData = IpyGameDataPY.GetIpyGameData("HorseSkin", horseSkinID)
    if ipyData:
        unlockWay = ipyData.GetUnlockWay()
        if unlockWay == 1:
            classLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
            if classLV >= ipyData.GetUnlockValue():
                return True
#    if not ipyData:
#        ipyData = IpyGameDataPY.GetIpyGameData("HorseSkin", horseSkinID)
#    if ipyData:
#        unlockWay = ipyData.GetUnlockWay()
#        if unlockWay == 1:
#            classLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_HorseClassLV)
#            if classLV >= ipyData.GetUnlockValue():
#                return True
            
    return False
@@ -434,7 +443,7 @@
    if ipyData.GetUnlockWay() != 2:
        return
    itemID = ipyData.GetUnlockValue()
    itemCount = ipyData.GetUnlockNeedCnt()
    itemCount = ipyData.GetUpNeedCnt()
    if not itemID or not itemCount:
        return
    needItemList = [[itemID, itemCount]]