| | |
| | | #轮回殿
|
| | | PlayerActLunhuidian.AddLunhuidianValue(curPlayer, PlayerActLunhuidian.AwardType_PayMoney, type_Price, price)
|
| | | if type_Price == ShareDefine.TYPE_Price_Xiantao:
|
| | | unXiantaoCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCnt)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCnt, unXiantaoCnt + price)
|
| | | unXiantaoCntExp = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntExp)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntExp, unXiantaoCntExp + price)
|
| | | unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip + price)
|
| | | PlayerPrestigeSys.AddRealmTaskValue(curPlayer, PlayerPrestigeSys.RealmTaskType_UseXiantao, price)
|
| | | unitPrice = price if quantity == 1 else int(math.ceil(price * 1.0 / quantity)) # 单价
|
| | | #reason_name = "Unknown" if not costType else costType
|
| | |
| | | msgInfo = {"PlayerID":curPlayer.GetPlayerID(), "MoneyType":priceType, "Value":value, "GiveType":giveType, "AddDataDict":addDataDict}
|
| | | GameWorld.SendMsgToClientServer(ShareDefine.CrossServerMsg_GiveMoney, msgInfo, [serverGroupID])
|
| | | return True
|
| | | |
| | | |
| | | befMoney = GetMoney(curPlayer, priceType)
|
| | | if priceType == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | | updPlayerGold = GetMoneyReal(curPlayer, priceType) + value
|
| | | if updPlayerGold > ChConfig.Def_PlayerTotalMoney_Gold:
|
| | |
| | | NotifyCode(curPlayer, "GetMoney", [priceType, value])
|
| | | __GiveMoneyAfter(curPlayer, priceType, value, giveType, addDataDict)
|
| | |
|
| | | if befMoney == 0:
|
| | | aftMoney = GetMoney(curPlayer, priceType)
|
| | | if aftMoney > 0:
|
| | | ItemControler.CheckGiveBindMoneyTypeItem(curPlayer, priceType)
|
| | | |
| | | return True
|
| | |
|
| | | def __GiveMoneyAfter(curPlayer, priceType, value, giveType, addDataDict):
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | |
|
| | | #副本获得经验, 无论获得多少经验均需通知, 有些副本逻辑需要通过获得经验时机处理
|
| | | if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
|
| | | FBLogic.OnGetExp(curPlayer, finalAddExp, expViewType)
|
| | | |
| | | #if GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
|
| | | # FBLogic.OnGetExp(curPlayer, finalAddExp, expViewType)
|
| | | |
| | | return finalAddExp
|
| | |
|
| | | # 参数 addSkillID 表示因什么技能杀死NPC获得经验
|
| | | def __AddExp(self, curPlayer, addExp, expViewType, isSysHint, addSkillID=0, expRateEx=0):
|
| | | if addExp == 0:
|
| | | if addExp <= 0:
|
| | | # 不进入计算
|
| | | return addExp, expViewType
|
| | |
|
| | | #取得人物当前经验
|
| | | #curTotalExp = GetPlayerTotalExp(curPlayer)
|
| | | curTotalExp = curPlayer.GetExpPoint() * ChConfig.Def_PerPointValue + curPlayer.GetTotalExp()
|
| | |
|
| | | maxLV = GetPlayerMaxLV(curPlayer)
|
| | | maxLVExpStore = IpyGameDataPY.GetFuncCfg("MaxLVExpStore", 1)
|
| | | curTotalExp = GetPlayerTotalExp(curPlayer)
|
| | |
|
| | | curLV = curPlayer.GetLV() |
| | | # # 检查转生等级
|
| | | # if curLV >= nextReinLV and curTotalExp >= maxLVExpStore:
|
| | | # self.__NotifyExpFull(curPlayer, "GeRen_liubo_260986")
|
| | | # GameWorld.DebugLog("经验已满!需先转生!curLV=%s,reinLV=%s" % (curLV, nextReinLV), curPlayer.GetPlayerID())
|
| | | # return 0
|
| | |
|
| | | maxLV = GetPlayerMaxLV(curPlayer)
|
| | | maxLVExpStore = IpyGameDataPY.GetFuncCfg("PlayerMaxLV", 2)
|
| | | |
| | | curLV = curPlayer.GetLV()
|
| | | |
| | | # 检查最大等级,maxLVExpStore -1时不限累计经验上限
|
| | | if curLV >= maxLV and curTotalExp >= maxLVExpStore and maxLVExpStore != -1:
|
| | | self.__NotifyExpFull(curPlayer, "GeRen_admin_825676")
|
| | |
| | | # 杀怪
|
| | | if expViewType == ShareDefine.Def_ViewExpType_KillNPC:
|
| | | exp_rate = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TotalExpRate)
|
| | | superRate = PassiveBuffEffMng.GetPassiveSkillValueByTriggerType(curPlayer, None, None, ChConfig.TriggerType_AddExpRate)
|
| | | if superRate:
|
| | | # 龙凤镯 经验
|
| | | expViewType = ShareDefine.Def_ViewExpType_KillNPCSuper
|
| | | if addSkillID == ChConfig.Def_SkillID_LXHY_AddExpRate:
|
| | | addSkill = GameWorld.GetGameData().GetSkillBySkillID(addSkillID)
|
| | | hasEffect = SkillCommon.GetSkillEffectByEffectID(addSkill, ChConfig.Def_Skill_Effect_AddExpRate)
|
| | | if hasEffect:
|
| | | #烈焰战神 经验
|
| | | superRate += hasEffect.GetEffectValue(0)
|
| | | expViewType = ShareDefine.Def_ViewExpType_LYZS
|
| | | exp_rate += superRate
|
| | | |
| | | elif expViewType in [ShareDefine.Def_ViewExpType_GameEvent, ShareDefine.Def_ViewExpType_Sit]:
|
| | | exp_rate = curPlayer.GetGameEventExpRate()
|
| | | exp_rate += GetFamilySitExpPer(curPlayer)
|
| | | else:
|
| | | exp_rate = max(GameWorld.GetGameWorld().GetExpRate(), ChConfig.Def_MaxRateValue)
|
| | | |
| | | |
| | | exp_rate += expRateEx
|
| | | #输入的经验有可能为long型
|
| | | addExp = int(addExp * exp_rate / float(ChConfig.Def_MaxRateValue))
|
| | |
|
| | | #防沉迷计算
|
| | | addExp = PlayerGameWallow.ChangeExpByWallow(curPlayer, addExp)
|
| | | |
| | | #===========================================================================================
|
| | | # #特殊地图杀怪经验外层加成
|
| | | # if expViewType == ShareDefine.Def_ViewExpType_KillNPC:
|
| | | # #mapID = GameWorld.GetMap().GetMapID()
|
| | | # #if mapID in ChConfig.Def_FBMapID_BZZDAll:
|
| | | # # nobleVIPOuterRate = ...
|
| | | # # #nobleVIPAddExp += 0 if not nobleVIPOuterRate else int(addExp * nobleVIPOuterRate / float(ChConfig.Def_MaxRateValue))
|
| | | # # nobleVIPAddExp += nobleVIPOuterRate
|
| | | # |
| | | # outerExpRate = FBLogic.OnGetOuterExpRate(curPlayer)
|
| | | # if outerExpRate > 0:
|
| | | # addExp = int(addExp * outerExpRate / float(ChConfig.Def_MaxRateValue))
|
| | | #===========================================================================================
|
| | | |
| | | # 不可再升级时,增加后的经验不可超过最大可存储经验
|
| | | #if curLV >= nextReinLV or curLV >= maxLV:
|
| | | if curLV >= maxLV and maxLVExpStore > 0:
|
| | | addExp = min(addExp, max(0, maxLVExpStore - curTotalExp))
|
| | |
|
| | | |
| | | if addExp <= 0:
|
| | | #无法获得经验
|
| | | GameWorld.DebugLog("无法获得经验")
|
| | | return 0, expViewType
|
| | |
|
| | | #addExp = min(addExp, ChConfig.Def_UpperLimit_DWord) # 单次加经验不超过20亿
|
| | |
|
| | | #缓存获取的经验值, 用于兑换家族荣誉
|
| | | #if curPlayer.GetFamilyID() != 0:
|
| | | # curPlayer.SetPerExp(min(curPlayer.GetPerExp() + addExp, ChConfig.Def_UpperLimit_DWord))
|
| | |
|
| | | #人物头顶提示
|
| | | #=======================================================================
|
| | | # viewExpCnt = min(2, addExp / ChConfig.Def_UpperLimit_DWord) # 最多飘两次20亿的
|
| | | # viewExp = addExp % ChConfig.Def_UpperLimit_DWord
|
| | | # for _ in range(viewExpCnt):
|
| | | # curPlayer.Notify_GetExpView(ChConfig.Def_UpperLimit_DWord, expViewType)
|
| | | # if viewExp:
|
| | | # curPlayer.Notify_GetExpView(viewExp, expViewType)
|
| | | # |
| | | # if isSysHint:
|
| | | # # 杀怪附加加成显示
|
| | | # if expViewType == ShareDefine.Def_ViewExpType_KillNPC:
|
| | | # nobleVIPAddExp = int(nobleVIPAddExp / 100.0)
|
| | | # #NotifyCode(curPlayer, "GeRen_liubo_74717", [addExp, nobleVIPAddExp])
|
| | | # elif expViewType in [ShareDefine.Def_ViewExpType_GameEvent,
|
| | | # ShareDefine.Def_ViewExpType_Sit]:
|
| | | # #小游戏事件特殊提示,打坐获取经验
|
| | | # NotifyCode(curPlayer, "ObtainExperience", [addExp])
|
| | | # elif expViewType == ShareDefine.Def_ViewExpType_MousePos:
|
| | | # #鼠标位置提示获得经验
|
| | | # NotifyCode(curPlayer, "GeRen_admin_887936", [addExp])
|
| | | # else:
|
| | | # #正常信息提示
|
| | | # NotifyCode(curPlayer, "GeRen_lhs_0", [addExp])
|
| | | #=======================================================================
|
| | | |
| | | #给人物经验 先设经验后升级
|
| | | #SetPlayerTotalExp(curPlayer, curTotalExp + addExp)
|
| | | totalExp = curTotalExp + addExp
|
| | | curExp = totalExp % ChConfig.Def_PerPointValue
|
| | | expPoint = totalExp / ChConfig.Def_PerPointValue
|
| | |
| | | curPlayer.SetExpPoint(expPoint)
|
| | | if curPlayer.GetTotalExp() != curExp:
|
| | | curPlayer.SetTotalExp(curExp)
|
| | | |
| | | #GameWorld.Log("玩家 = %s 得到经验 = %s ,当前经验倍率 = %s"%(curPlayer.GetName(), addExp,expRate ))
|
| | | #小于转生等级才可升级
|
| | | #if curLV < nextReinLV and curLV < maxLV:
|
| | | |
| | | if curLV < maxLV:
|
| | | self.PlayerLvUp()
|
| | | |
| | | |
| | | #添加经验成功
|
| | | return addExp, expViewType
|
| | |
|
| | |
| | | #玩家死亡不可升级
|
| | | return
|
| | |
|
| | | #lvIpyData = GetPlayerLVIpyData(curPlayer.GetLV())
|
| | | lvIpyData = IpyGameDataPY.GetIpyGameData("PlayerLV", curPlayer.GetLV())
|
| | | lvIpyData = GetPlayerLVIpyData(curPlayer.GetLV())
|
| | | if not lvIpyData:
|
| | | GameWorld.ErrLog("经验表异常 lv= %s" % curPlayer.GetLV())
|
| | | return
|
| | | |
| | | #lvUpNeedExp = GetLVUPTotalExpNeed(lvIpyData)
|
| | | lvUpNeedExp = lvIpyData.GetExpPoint() * ChConfig.Def_PerPointValue + lvIpyData.GetExp()
|
| | | |
| | | lvUpNeedExp = GetLVUPTotalExpNeed(lvIpyData)
|
| | | if lvUpNeedExp <= 0:
|
| | | return
|
| | |
|
| | | #增加经验
|
| | | #curTotalExp = GetPlayerTotalExp(curPlayer)
|
| | | curTotalExp = curPlayer.GetExpPoint() * ChConfig.Def_PerPointValue + curPlayer.GetTotalExp()
|
| | | curTotalExp = GetPlayerTotalExp(curPlayer)
|
| | | #未达到升级经验
|
| | | if curTotalExp < lvUpNeedExp:
|
| | | return
|
| | | needSyncTalentPoint = False
|
| | | playerNeedDoLVUp = False
|
| | | curLV = curPlayer.GetLV()
|
| | | maxLV = GetPlayerMaxLV(curPlayer)
|
| | |
| | | curPlayer.BeginRefreshState()
|
| | | #befXP = curPlayer.GetXP()
|
| | | befLV = curPlayer.GetLV()
|
| | | befFreePoint = curPlayer.GetFreePoint()
|
| | | befBaseSTR = curPlayer.GetBaseSTR()
|
| | | befBasePNE = curPlayer.GetBasePNE()
|
| | | befBasePHY = curPlayer.GetBasePHY()
|
| | | befBaseCON = curPlayer.GetBaseCON()
|
| | | |
| | | #升级前的世界等级经验
|
| | | #beforeExpRate = PlayerWorldAverageLv.GetWorldAverageLvExpRate(curPlayer)
|
| | | #befFreePoint = curPlayer.GetFreePoint()
|
| | |
|
| | | while curTotalExp >= lvUpNeedExp and curLV < maxLV:
|
| | |
|
| | |
| | | isNotifyServer = False
|
| | |
|
| | | curPlayer.SetLV(curLV, isNotifyServer)
|
| | | EventReport.WriteEvent_level_up(curPlayer)
|
| | | #EventReport.WriteEvent_level_up(curPlayer)
|
| | |
|
| | | # 记录玩家升级
|
| | | DataRecordPack.DR_PlayerUpgrade(curPlayer, curPlayer.GetLV(), GetPlayerTotalExp(curPlayer), lvUpNeedExp)
|
| | | DataRecordPack.Cache_FightPowerChangeInfo(curPlayer, ChConfig.PowerDownType_LVUP, {'lv':curLV})
|
| | | self.__GiveLVMailAward(curLV)
|
| | | self.__DoLVUPAddPoint() # 升级加点
|
| | | #self.__DoLVUPAddPoint() # 升级加点
|
| | | #self.__DoLvUpAddSkill() # 升级加技能
|
| | |
|
| | | lvIpyData = GetPlayerLVIpyData(curPlayer.GetLV())
|
| | | # 大师天赋点
|
| | | if lvIpyData:
|
| | | addTalentPoint = lvIpyData.GetTalentPoint()
|
| | | if addTalentPoint:
|
| | | needSyncTalentPoint = True
|
| | | PlayerGreatMaster.AddGreatMasterSkillPointByLV(curPlayer, addTalentPoint)
|
| | |
|
| | | PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_LVUp, 1)
|
| | | #---是否继续循环---
|
| | | curTotalExp = curTotalExp - lvUpNeedExp
|
| | |
|
| | |
| | | #有升级, 转生时刚好是转生等级会默认+1级
|
| | | if playerNeedDoLVUp:
|
| | | aftLV = curPlayer.GetLV()
|
| | | aftFreePoint = curPlayer.GetFreePoint()
|
| | | aftBaseSTR = curPlayer.GetBaseSTR()
|
| | | aftBasePNE = curPlayer.GetBasePNE()
|
| | | aftBasePHY = curPlayer.GetBasePHY()
|
| | | aftBaseCON = curPlayer.GetBaseCON()
|
| | | #aftFreePoint = curPlayer.GetFreePoint()
|
| | | if aftLV > befLV:
|
| | | curPlayer.SetLV(aftLV, False) # 这里不再通知GameServer
|
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_LV, aftLV)
|
| | | PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_LVUp, aftLV - befLV)
|
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_LV)
|
| | | PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_HeroLV, aftLV)
|
| | | PlayerActivity.DoAddActivityByLV(curPlayer, befLV, aftLV)
|
| | |
|
| | | if aftFreePoint > befFreePoint:
|
| | | curPlayer.SetFreePoint(aftFreePoint)
|
| | | #NotifyCode(curPlayer, "ObtainAttributeDot", [aftFreePoint - befFreePoint])
|
| | | if aftBaseSTR > befBaseSTR:
|
| | | curPlayer.SetBaseSTR(aftBaseSTR)
|
| | | if aftBasePNE > befBasePNE:
|
| | | curPlayer.SetBasePNE(aftBasePNE)
|
| | | if aftBasePHY > befBasePHY:
|
| | | curPlayer.SetBasePHY(aftBasePHY)
|
| | | if aftBaseCON > befBaseCON:
|
| | | curPlayer.SetBaseCON(aftBaseCON)
|
| | | #if aftFreePoint > befFreePoint:
|
| | | # curPlayer.SetFreePoint(aftFreePoint)
|
| | | PlayerGubao.DoGubaoAddFreePoint(curPlayer)
|
| | | #===================================================================
|
| | | # if curPlayer.GetXP() != befXP:
|
| | | # curPlayer.SetXP(curPlayer.GetXP())
|
| | | #===================================================================
|
| | | |
| | | #享受世界等级
|
| | | #===================================================================
|
| | | #curExpRate = PlayerWorldAverageLv.GetWorldAverageLvExpRate(curPlayer)
|
| | | #if beforeExpRate <= 0 and curExpRate > 0:
|
| | | # NotifyCode(curPlayer, "GeRen_liubo_127574")
|
| | |
|
| | | #===================================================================
|
| | | # 天赋点通知
|
| | | if needSyncTalentPoint:
|
| | | PlayerGreatMaster.Sync_GreatMasterFreeSkillPoint(curPlayer)
|
| | | # 升级需要执行的游戏功能处理
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|
| | | ChEquip.RefreshPlayerLingQiEquipAttr(curPlayer) # 灵器属性会随等级成长
|
| | | if aftLV%10 == 0:
|
| | | # 控制下刷新次数
|
| | | PlayerPet.CalcPetItemAddPlayerAttr(curPlayer) # 宠物有随等级变化的技能
|
| | | #if aftLV%10 == 0:
|
| | | # # 控制下刷新次数
|
| | | # PlayerPet.CalcPetItemAddPlayerAttr(curPlayer) # 宠物有随等级变化的技能
|
| | |
|
| | | self.RefreshPlayerAttrState(billboardFunc=PlayerBillboard.UpdatePlayerLVBillboard)
|
| | | #放在功能开启后面
|
| | |
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ForbidenTalk, 0)
|
| | | return
|
| | |
|
| | | def IsMainLevelPass(curPlayer, lvID):
|
| | | ## 判断玩家是否过关某个主线关卡ID
|
| | | # @param lvID: 关卡唯一ID,与策划约定好 = 章节*100+关卡编号
|
| | | passChapterID, passLevelNum, _ = GetMainLevelPassInfo(curPlayer)
|
| | | passValue = passChapterID * 100 + passLevelNum # 因为pass的记录是带波数的,即当前关卡boss还没过关,所以只有大于该记录值的才算过关
|
| | | return passValue > lvID
|
| | |
|
| | | ## 主线关卡过关进度值 = 章节*10000+关卡编号*100+第x波
|
| | | def GetMainLevelPassValue(curPlayer): return curPlayer.GetExAttr1()
|
| | | def SetMainLevelPassValue(curPlayer, value): curPlayer.SetExAttr1(value, False, False) # 不通知GameServer
|
| | |
| | | count += 1
|
| | | return count
|
| | |
|
| | |
|
| | |
|
| | | ## 获取节假日经验加成
|
| | | # @param curPlayer: 玩家实例
|
| | | # @return: 节假日经验加成
|
| | | def GetHolidayExpRate(curPlayer):
|
| | | return 0
|
| | |
|
| | |
|
| | | ## 获取世界boss经验加成
|
| | | # @param curPlayer: 玩家实例
|
| | | # @return: 世界boss经验加成
|
| | | def GetWorldBossExpRate(curPlayer):
|
| | | return 0
|
| | |
|
| | | ## 获取玩家当前等级升级所需总经验
|
| | | # @param playerLv 玩家等级
|
| | | # @return 返回值, 升级需要的总经验
|
| | | def GetLVUPTotalNeedExp(curPlayer):
|
| | | curLV = curPlayer.GetLV()
|
| | | #if curLV >= IpyGameDataPY.GetFuncCfg("PlayerMaxLV") and PlayerGreatMaster.IsGreatMasterOpen(curPlayer):
|
| | | # return PlayerGreatMaster.GetTotalExpByGreatMasterLV(curPlayer.GetLV2())
|
| | | |
| | | return GetTotalExpByPlayerLv(curLV)
|
| | |
|
| | | ## 根据等级获得升级需要的总经验
|
| | |
| | | def GetLVUPTotalExpNeed(lvIpyData):
|
| | | if not lvIpyData:
|
| | | return 0
|
| | | return lvIpyData.GetExpPoint() * ChConfig.Def_PerPointValue + lvIpyData.GetExp()
|
| | | return lvIpyData.GetExp()
|
| | |
|
| | | def GetPlayerMaxLV(curPlayer):
|
| | | ## 获取玩家实际可升的最大等级
|