4296 【后端】【1.2.0】220级开启加点功能(原加点功能不变)
| | |
| | | GameFuncID_FreeGoods = 130 # 极品白拿
|
| | | GameFuncID_OSSail = 132 # 开服特惠
|
| | | GameFuncID_HorsePetRobBoss = 139# 骑宠争夺
|
| | | GameFuncID_AddPoint = 145 # 加点功能
|
| | | # 以下为暂时无用的
|
| | | GameFuncID_Truck = 33 # 运镖
|
| | | GameFuncID_RunDaily = 34 # 日常跑环
|
| | |
| | | import PlayerEquipDecompose
|
| | | import PlayerFreeGoods
|
| | | import FunctionNPCCommon
|
| | | import PlayerGreatMaster
|
| | |
|
| | |
|
| | |
|
| | |
| | | ShareDefine.GameFuncID_EquipDecompose:lambda curObj:PlayerEquipDecompose.DoEquipDecomposeOpen(curObj),
|
| | | ShareDefine.GameFuncID_FreeGoods:lambda curObj:PlayerFreeGoods.DoFreeGoodsOpen(curObj),
|
| | | ShareDefine.GameFuncID_OSSail:lambda curObj:FunctionNPCCommon.OSSaleOpenMail(curObj),
|
| | | ShareDefine.GameFuncID_AddPoint:lambda curObj:PlayerControl.DoAddPointOpen(curObj),
|
| | | ShareDefine.GameFuncID_Talent:lambda curObj:PlayerGreatMaster.DoTalentOpen(curObj),
|
| | | #ShareDefine.GameFuncID_RunDaily:lambda curObj:FBCommon.DoFuncOpen_RunDaily(curObj),
|
| | | #ShareDefine.GameFuncID_RunFamily:lambda curObj:FBCommon.DoFuncOpen_RunFamily(curObj),
|
| | | #ShareDefine.GameFuncID_RefineExp:lambda curObj:Operate_PlayerBuyZhenQi.DoFuncOpen_RefineExp(curObj),
|
| | |
| | | # @remarks 获得玩家升级, 获得的属性点
|
| | | def GetLvUp_AddPoint(curPlayer):
|
| | | curPlayerID = curPlayer.GetID()
|
| | | curReinCnt = curPlayer.GetReincarnationLv() # 当前转生次数
|
| | | curLV = curPlayer.GetLV() # 当前等级
|
| | |
|
| | | addPointList = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1)
|
| | | |
| | | addPoint = addPointList[-1] if curReinCnt >= len(addPointList) else addPointList[curReinCnt]
|
| | | addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
|
| | | addPoint = GameWorld.GetDictValueByRangeKey(addPointDict, curLV, 0)
|
| | |
|
| | | if addPoint == None:
|
| | | raise Exception('玩家获得升级属性点异常, reincarnationLv = %s PlayerID = %s' % (curReinCnt, curPlayerID))
|
| | | raise Exception('玩家获得升级属性点异常, curLV = %s PlayerID = %s' % (curLV, curPlayerID))
|
| | | return
|
| | |
|
| | | return int(addPoint)
|
| | |
|
| | | def DoAddPointOpen(curPlayer):
|
| | | '''加点功能开启 处理给自由属性点及老号处理 |
| | | 清除老服玩家未加点的点数(清零),以前加的加点属性不清除,属性不变,战力不减, 根据最新的加点开启等级和老服玩家的当前等级,相差的差值给予玩家对应的加点点数'''
|
| | | beforeFreePoint = curPlayer.GetFreePoint()
|
| | | addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
|
| | | initFreePoint = IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 2)
|
| | | openLV = GameFuncComm.GetFuncLimitLV(ShareDefine.GameFuncID_AddPoint)
|
| | | setFreePoint = initFreePoint
|
| | | curLV = curPlayer.GetLV()
|
| | | for lv in xrange(openLV, curLV+1):
|
| | | setFreePoint += GameWorld.GetDictValueByRangeKey(addPointDict, lv, 0)
|
| | | addDataDict = {'beforeFreePoint':beforeFreePoint}
|
| | | DataRecordPack.DR_Freepoint(curPlayer, "AddPointOpen", setFreePoint, addDataDict)
|
| | | curPlayer.SetFreePoint(setFreePoint)
|
| | | GameWorld.DebugLog(' 加点功能开启处理 beforeFreePoint=%s,curLV=%s, setFreePoint=%s'%(beforeFreePoint, curLV, setFreePoint), curPlayer.GetID())
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ## 功能模块战斗力类
|
| | |
| | | return False
|
| | | return True
|
| | |
|
| | | def DoTalentOpen(curPlayer):
|
| | | '''天赋功能开启处理天赋点 '''
|
| | | curLV = curPlayer.GetLV()
|
| | | openLV = GameFuncComm.GetFuncLimitLV(ShareDefine.GameFuncID_Talent)
|
| | | setTalentPoint = 0
|
| | | for lv in xrange(openLV, curLV+1):
|
| | | lvIpyData = PlayerControl.GetPlayerLVIpyData(lv)
|
| | | addTalentPoint = lvIpyData.GetTalentPoint() if lvIpyData else 0
|
| | | setTalentPoint += addTalentPoint
|
| | | curFreeSkillPoint = GetGreatMasterFreeSkillPoint(curPlayer)
|
| | | if setTalentPoint != curFreeSkillPoint:
|
| | | SetGreatMasterFreeSkillPoint(curPlayer, setTalentPoint)
|
| | | Sync_GreatMasterFreeSkillPoint(curPlayer)
|
| | | GameWorld.Log(' 天赋功能开启处理天赋点 beforeTalentPoint=%s,setTalentPoint=%s, curLV=%s'%(curFreeSkillPoint, setTalentPoint, curLV), curPlayer.GetID())
|
| | | return
|
| | |
|
| | | ## 登录处理
|
| | | # @param curPlayer
|
| | | # @return
|
| | |
| | | def OnDay(curPlayer):
|
| | | actCostRebateInfo = PyGameData.g_operationActionDict.get(ShareDefine.OperationActionName_WishingWell, {})
|
| | | if not actCostRebateInfo.get(ShareDefine.ActKey_State):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellFreeTime, 0)
|
| | | __SendWishingWellMail(curPlayer, int(time.time()))
|
| | | return
|
| | |
|
| | |
| | | if state:
|
| | | g_randomWellDict = {}
|
| | | g_specialMarkDict = {}
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_WishingWellRefreshCnt, 0)
|
| | | __DoActWishingRefresh(curPlayer, 1, True)
|
| | |
|
| | | SyncWishingWellInfo(curPlayer)
|
| | |
| | | GameFuncID_FreeGoods = 130 # 极品白拿
|
| | | GameFuncID_OSSail = 132 # 开服特惠
|
| | | GameFuncID_HorsePetRobBoss = 139# 骑宠争夺
|
| | | GameFuncID_AddPoint = 145 # 加点功能
|
| | | # 以下为暂时无用的
|
| | | GameFuncID_Truck = 33 # 运镖
|
| | | GameFuncID_RunDaily = 34 # 日常跑环
|
| | |
| | | import ChItem
|
| | | import PlayerActivity
|
| | | import ShareDefine
|
| | | import PlayerGodWeapon
|
| | | import PlayerSuccess
|
| | | import PlayerGreatMaster
|
| | | import PlayerHorse
|
| | | import GameObj
|
| | |
| | | return False
|
| | |
|
| | | skillManager = curPlayer.GetSkillManager()
|
| | | #姿态需求
|
| | | #hasStateSkillReq = False
|
| | |
|
| | | #前置技能需求
|
| | | hasLearnSkillReq = False
|
| | | #分支点总和
|
| | | numLearnSkillPoint = 0
|
| | | #当前技能姿态需求,姿态等级需求
|
| | | #curSkillStateReq = curSkill.GetStateSkillReq()
|
| | | #lvCurSkillStateReq = curSkill.GetStateSkillLV()
|
| | | #当前技能前置技能需求,前置技能等级需求
|
| | | curSkillLearnReq = curSkill.GetLearnSkillReq()
|
| | | lvCurSkillLearnReq = curSkill.GetLearnSkillLV()
|
| | | #需要对应天赋系别点数
|
| | | learnSkillPointReq = curSkill.GetLearnSkillPointReq()
|
| | | learnSkillPointReq = curSkill.GetLearnSkillPointReq() #系别*10000+需要点数
|
| | | needSeries, needSeriesPoint= learnSkillPointReq/10000, learnSkillPointReq%10000
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('TalentSkill', curSkill.GetSkillTypeID())
|
| | | curSkillTypeID = curSkill.GetSkillTypeID()
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('TalentSkill', curSkillTypeID)
|
| | | curTalentType = ipyData.GetTalentType() if ipyData else 0
|
| | | #获取玩家目前所有技能
|
| | | for i in range(0, skillManager.GetSkillCount()):
|
| | | for i in xrange(skillManager.GetSkillCount()):
|
| | | skill = skillManager.GetSkillByIndex(i)
|
| | | if skill == None:
|
| | | continue
|
| | |
| | | skillTypeID = skill.GetSkillTypeID()
|
| | | lvSkill = skill.GetSkillLV()
|
| | |
|
| | | #满足姿态ID需求
|
| | | # if skillTypeID == curSkillStateReq and lvSkill >= lvCurSkillStateReq and not hasStateSkillReq:
|
| | | # hasStateSkillReq = True
|
| | |
|
| | | #满足前置技能需求
|
| | | if skillTypeID == curSkillLearnReq and lvSkill >= lvCurSkillLearnReq and not hasLearnSkillReq:
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_wjr_717982", [curSkillLearnReq, lvCurSkillLearnReq])
|
| | | return False
|
| | |
|
| | | # #有姿态ID需求
|
| | | # if curSkillStateReq != 0 and not hasStateSkillReq:
|
| | | # PlayerControl.NotifyCode(curPlayer, "UseMagicLost15", [ curSkillStateReq, lvCurSkillStateReq ])
|
| | | # return False
|
| | | |
| | | #有分支点总和要求
|
| | | if learnSkillPointReq != 0 and numLearnSkillPoint < needSeriesPoint:
|
| | | PlayerControl.NotifyCode( curPlayer, "UseMagicLost13",[ needSeriesPoint ] )
|
| | | return False
|
| | |
|
| | | #玩家属性点要求
|
| | | stateSkillLV = curSkill.GetStateSkillLV() #需要基础属性ID*10000+需要属性点
|
| | | needBaseAttrID, needBaseAttrValue = stateSkillLV /10000, stateSkillLV%10000
|
| | | if needBaseAttrID and needBaseAttrValue:
|
| | | baseAttrDict = {
|
| | | ShareDefine.Def_Effect_STR:curPlayer.GetSTR(),
|
| | | ShareDefine.Def_Effect_PHY:curPlayer.GetPHY(),
|
| | | ShareDefine.Def_Effect_CON:curPlayer.GetCON(),
|
| | | ShareDefine.Def_Effect_PNE:curPlayer.GetPNE(),
|
| | | }
|
| | | if needBaseAttrID not in baseAttrDict:
|
| | | GameWorld.ErrLog(' 天赋技能升级属性点条件配置错误,curSkillTypeID=%s,needBaseAttrID=%s'%(curSkillTypeID, needBaseAttrID))
|
| | | return False
|
| | | curBaseAttrValue = baseAttrDict.get(needBaseAttrID, 0)
|
| | | if curBaseAttrValue < needBaseAttrValue:
|
| | | GameWorld.DebugLog('升级技能%s需要属性点 %s达到%s, 当前点数=%s!'%(curSkillTypeID, needBaseAttrID, needBaseAttrValue, curBaseAttrValue))
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | | #---------------------------------------------------------------------
|