hxp
4 天以前 ec68dabc97521a7706344e7d038e9f08462f4fe8
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerLLMJ.py
@@ -21,7 +21,6 @@
import ChPyNetSendPack
import PlayerControl
import GameWorld
import ObjPool
def OnPlayerLogin(curPlayer):
    if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LLMJLVInfo):
@@ -62,20 +61,34 @@
    mjLV, zhanchui = GetMJLVInfo(curPlayer)
    if not mjLV:
        return
    nextIpyData = IpyGameDataPY.GetIpyGameDataNotLog("LLMJ", mjLV + 1)
    if not nextIpyData:
        #GameWorld.DebugLog("历练秘笈已满级不再累加战锤: mjLV=%s" % (mjLV))
    maxIpyData = IpyGameDataPY.IPY_Data().GetLLMJByIndex(-1) # 最多累加到最后一级
    if not maxIpyData:
        return
    updZhanchui = zhanchui + addCnt
    maxZhanchui = maxIpyData.GetCostWarhammer()
    if zhanchui >= maxZhanchui:
        #GameWorld.DebugLog("历练秘笈累加战锤已达上限: mjLV=%s,zhanchui=%s >= %s" % (mjLV, zhanchui, maxZhanchui))
        return
    updZhanchui = min(zhanchui + addCnt, maxZhanchui)
    GameWorld.DebugLog("累加历练秘笈战锤: mjLV=%s,addCnt=%s,updZhanchui=%s,maxZhanchui=%s" % (mjLV, addCnt, updZhanchui, maxZhanchui))
    SetMJLVInfo(curPlayer, mjLV, updZhanchui)
    SyncLLMJInfo(curPlayer)
    return
def OnLLMJLVUp(curPlayer):
    ## 秘笈升级
    mjLV, zhanchui = GetMJLVInfo(curPlayer)
    if not mjLV:
        return
    nextIpyData = IpyGameDataPY.GetIpyGameData("LLMJ", mjLV + 1)
    if not nextIpyData:
        return
    nextZhanchui = nextIpyData.GetCostWarhammer()
    GameWorld.DebugLog("累加历练秘笈战锤: mjLV=%s,addCnt=%s,updZhanchui=%s,nextZhanchui=%s" % (mjLV, addCnt, updZhanchui, nextZhanchui))
    while nextIpyData and updZhanchui >= nextZhanchui:
    while nextIpyData and zhanchui >= nextZhanchui:
        mjLV += 1 # 升级
        nextIpyData = IpyGameDataPY.GetIpyGameDataNotLog("LLMJ", mjLV + 1)
        nextZhanchui = nextIpyData.GetCostWarhammer() if nextIpyData else 0
        GameWorld.DebugLog("历练秘笈升级: %s,nextZhanchui=%s" % (mjLV, nextZhanchui))
    SetMJLVInfo(curPlayer, mjLV, updZhanchui)
    SetMJLVInfo(curPlayer, mjLV, zhanchui)
    SyncLLMJInfo(curPlayer)
    return
@@ -129,7 +142,7 @@
def SyncLLMJInfo(curPlayer):
    mjLV, zhanchui = GetMJLVInfo(curPlayer)
    clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCLLMJInfo)
    clientPack = ChPyNetSendPack.tagSCLLMJInfo()
    clientPack.MJLV = mjLV
    clientPack.Zhanchui = zhanchui
    clientPack.ExpEx = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_LLMJExp)