hxp
2023-07-31 495f9eed41e29b54672a767817c9cb11419dfa4c
ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Player/PlayerSuccess.py
@@ -245,6 +245,9 @@
        if not succInfoList:
            continue
        __DoCheckSuccessFinish(curPlayer, succType, succInfoList)
    if curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Success_ScoreAward):
        Sync_SuccessScoreAward(curPlayer)
    return
## 检查老玩家成就激活情况
@@ -1044,4 +1047,36 @@
    elif mapID == ChConfig.Def_FBMapID_IceLode:
        #冰晶矿脉
        DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_IceLode, addCount)
    return
    return
def GetSuccessScoreAward(curPlayer, awardIndex):
    playerID = curPlayer.GetPlayerID()
    awardDict = IpyGameDataPY.GetFuncEvalCfg("SucceeScore", 1, {})
    if str(awardIndex) not in awardDict:
        return
    awardInfo = awardDict[str(awardIndex)]
    if len(awardInfo) != 2:
        return
    needScore, awardItemList = awardInfo
    if not PlayerControl.HaveMoney(curPlayer, ShareDefine.TYPE_Price_SuccessSocre, needScore):
        GameWorld.Log("成就积分不足,无法领奖! awardIndex=%s,needScore=%s" % (awardIndex, needScore), playerID)
        return
    awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Success_ScoreAward)
    if awardState & pow(2, awardIndex):
        GameWorld.DebugLog("已领取过该成就积分奖励! awardIndex=%s" % awardIndex, playerID)
        return
    updAwardState = awardState | pow(2, awardIndex)
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Success_ScoreAward, updAwardState)
    GameWorld.DebugLog("领取成就积分奖励! awardIndex=%s,awardState=%s,updAwardState=%s" % (awardIndex, awardState, updAwardState), playerID)
    Sync_SuccessScoreAward(curPlayer)
    ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["SuccessScore", False, {}])
    return
def Sync_SuccessScoreAward(curPlayer):
    clientPack = ChPyNetSendPack.tagMCSuccessScoreInfo()
    clientPack.Clear()
    clientPack.ScoreAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Success_ScoreAward)
    NetPackCommon.SendFakePack(curPlayer, clientPack)
    return