| | |
| | | import PlayerTask
|
| | | import PlayerFace
|
| | | import PlayerMail
|
| | | import PlayerHero
|
| | | import ChPlayer
|
| | | import GameObj
|
| | |
|
| | |
| | | #轮回殿
|
| | | PlayerActLunhuidian.AddLunhuidianValue(curPlayer, PlayerActLunhuidian.AwardType_PayMoney, type_Price, price)
|
| | | if type_Price == ShareDefine.TYPE_Price_Xiantao:
|
| | | 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)
|
| | | #放在功能开启后面
|
| | |
| | | PlayerFamilyZhenfa.CalcZhenfaAttr(curPlayer)
|
| | | PlayerFace.CalcFaceAttr(curPlayer)
|
| | | PlayerFace.CalcFacePicAttr(curPlayer)
|
| | | PlayerHero.CalcHeroItemAddAttr(curPlayer)
|
| | | self.RefreshAllState(isForce=True)
|
| | | GameWorld.DebugLog("End ReCalcAllState!!!", playerID)
|
| | | return
|
| | |
| | | def __SetAtkInterval(self):
|
| | | curPlayer = self.__Player
|
| | |
|
| | | atkSpeed = GetAtkSpeed(curPlayer)
|
| | | atkSpeed = GameObj.GetAtkSpeed(curPlayer)
|
| | |
|
| | | formula = IpyGameDataPY.GetFuncCfg("AtkInterval")
|
| | | atkInterval = 0 if not formula else eval(FormulaControl.GetCompileFormula("AtkInterval", formula))
|
| | |
| | | #通知客户端
|
| | | curPack.Sync_PackCanUseCount()
|
| | | return
|
| | | |
| | |
|
| | | def Init_HeroPack(curPlayer):
|
| | | packType = ShareDefine.rptHero |
| | | #获取玩家背包
|
| | | curPack = curPlayer.GetItemManager().GetPack(packType)
|
| | | initCount = ItemCommon.GetPackInitCount(packType)
|
| | | if packType in ChConfig.Def_Type_CanBuyPack_PlayerDict.keys():
|
| | | keyName = ChConfig.Def_Type_CanBuyPack_PlayerDict.get(packType)[ChConfig.Def_PlayerPackDict_Index_Key]
|
| | | initCount += curPlayer.NomalDictGetProperty(keyName)
|
| | | curPack.SetCount(initCount)
|
| | | #通知客户端背包格子数目
|
| | | # curPlayer.Sync_ItemCount(curPack.GetCount())
|
| | | curPack.Sync_PackCanUseCount()
|
| | | return
|
| | |
|
| | |
|
| | | ##初始化寻宝背包
|
| | |
| | | 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
|
| | | def SetMainLevelPassInfo(curPlayer, chapterID, levelNum, wave=0):
|
| | | ## 设置主线关卡过关进度
|
| | | # @param chapterID: 章节ID
|
| | | # @param levelNum: 关卡编号
|
| | | # @param wave: 第x波
|
| | | value = ComMainLevelValue(chapterID, levelNum, wave)
|
| | | SetMainLevelPassValue(curPlayer, value)
|
| | | return value
|
| | | def GetMainLevelPassInfo(curPlayer):
|
| | | ## 获取主线关卡过关进度信息
|
| | | # @return: chapterID, levelNum, wave
|
| | | return GetMainLevelValue(GetMainLevelPassValue(curPlayer))
|
| | |
|
| | | ## 主线关卡当前进度值 = 章节*10000+关卡编号*100+第x波
|
| | | def GetMainLevelNowValue(curPlayer): return curPlayer.GetExAttr2()
|
| | | def SetMainLevelNowValue(curPlayer, value): curPlayer.SetExAttr2(value, False, False) # 不通知GameServer
|
| | | def SetMainLevelNowInfo(curPlayer, chapterID=1, levelNum=1, wave=1):
|
| | | ## 设置主线关卡当前进度
|
| | | # @param chapterID: 章节ID
|
| | | # @param levelNum: 关卡编号
|
| | | # @param wave: 第x波
|
| | | value = ComMainLevelValue(chapterID, levelNum, wave)
|
| | | SetMainLevelNowValue(curPlayer, value)
|
| | | return value
|
| | | def GetMainLevelNowInfo(curPlayer):
|
| | | ## 获取主线关卡当前进度信息
|
| | | # @return: chapterID, levelNum, wave
|
| | | return GetMainLevelValue(GetMainLevelNowValue(curPlayer))
|
| | |
|
| | | def ComMainLevelValue(chapterID, levelNum, wave=0): return chapterID * 10000 + levelNum * 100 + wave
|
| | | def GetMainLevelValue(value):
|
| | | chapterID = value / 10000
|
| | | levelNum = value % 10000 / 100
|
| | | wave = value % 100
|
| | | return chapterID, levelNum, wave
|
| | |
|
| | | ## 协助目标玩家ID
|
| | | def SetAssistTagPlayerID(curPlayer, value):
|
| | | curPlayer.SetExAttr1(value, True, False) # 不通知GameServer
|
| | | NPCHurtManager.OnSetAssistTagPlayerID(curPlayer, value)
|
| | | return
|
| | | def GetAssistTagPlayerID(curPlayer): return curPlayer.GetExAttr1()
|
| | | def GetAssistTagPlayerID(curPlayer): return 0
|
| | |
|
| | | ## 队伍相关审核开关状态, joinReqCheck-入队申请是否需要审核; inviteCheck-组队邀请是否需要审核;
|
| | | def SetTeamCheckStateEx(curPlayer, joinReqCheck, inviteCheck): return SetTeamCheckState(curPlayer, joinReqCheck * 10 + inviteCheck)
|
| | | def SetTeamCheckState(curPlayer, checkState): return curPlayer.SetExAttr2(checkState, False, True)
|
| | | def GetTeamCheckState(curPlayer): return curPlayer.GetExAttr2()
|
| | |
|
| | | def SetTeamCheckState(curPlayer, checkState): return
|
| | | ## 副本功能线路ID, 这里做db存储,防止在合并地图副本中掉线重上时前端无法加载正确的场景资源,登录加载场景时机为0102包
|
| | | def SetFBFuncLineID(curPlayer, mapID, funcLineID):
|
| | | value = mapID * 1000 + funcLineID
|
| | |
| | | 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):
|
| | | ## 获取玩家实际可升的最大等级
|
| | |
| | | def SetSpeedValue(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_SpeedValue, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_SpeedValue, value, True) # 移动速度值暂定广播周围玩家
|
| | |
|
| | | ##获取玩家攻击速度,用于计算攻击间隔
|
| | | # @param curPlayer 玩家实例
|
| | | # @return 玩家攻击速度
|
| | | def GetAtkSpeed(curPlayer):
|
| | | return curPlayer.GetBattleValEx1()
|
| | |
|
| | | ##设置玩家攻击速度,用于计算攻击间隔
|
| | | # @param curPlayer 玩家实例
|
| | | # @return None
|
| | | def SetAtkSpeed(curPlayer, value):
|
| | | curPlayer.SetBattleValEx1(value, True)
|
| | |
|
| | | #---攻击回复血量比率----
|
| | | ## 获取玩家攻击回复血量比率
|
| | |
| | | ## 卓越一击伤害减免
|
| | | def GetGreatHitReducePer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_GreatHitReducePer)
|
| | | def SetGreatHitReducePer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_GreatHitReducePer, value)
|
| | | ## 暴击伤害减免
|
| | | def GetSuperHitReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_SuperHitReduce)
|
| | | def SetSuperHitReduce(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_SuperHitReduce, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_SuperHitReduce, value)
|
| | |
|
| | | ## 无视防御伤害减免
|
| | | def GetIgnoreDefReducePer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_IgnoreDefReducePer)
|
| | | def SetIgnoreDefReducePer(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_IgnoreDefReducePer, value)
|
| | |
| | | ## 抗卓越一击概率
|
| | | def GetGreatHitRateReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_GreatHitRateReduce)
|
| | | def SetGreatHitRateReduce(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_GreatHitRateReduce, value)
|
| | | ## 抗暴击概率
|
| | | def GetSuperHitRateReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_SuperHitRateReduce)
|
| | | def SetSuperHitRateReduce(curPlayer, value): |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_SuperHitRateReduce, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_SuperHitRateReduce, value)
|
| | |
|
| | | ## 抗无视防御概率
|
| | | def GetIgnoreDefRateReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_IgnoreDefRateReduce)
|
| | | def SetIgnoreDefRateReduce(curPlayer, value):
|
| | |
| | | def SetBossFinalHurtPer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_BossFinalHurtPer, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_BossFinalHurtPer, value)
|
| | | |
| | | ## 最终伤害百分比
|
| | | def GetFinalHurtPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtPer)
|
| | | def SetFinalHurtPer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_FinalHurtPer, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FinalHurtPer, value)
|
| | | |
| | | ## 最终伤害减免百分比
|
| | | def GetFinalHurtReducePer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurtReducePer)
|
| | | def SetFinalHurtReducePer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_FinalHurtReducePer, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FinalHurtReducePer, value)
|
| | |
|
| | | ## 最终固定伤害增加
|
| | | def GetFinalHurt(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_FinalHurt)
|
| | |
| | | # @return None
|
| | | def SetReduceBackHPPer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ReduceBackHPPer, value)
|
| | |
|
| | | #---触发击晕----
|
| | | def GetFaintRate(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrFaintRate)
|
| | | def SetFaintRate(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrFaintRate, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FaintRate, value)
|
| | | #---击晕抵抗----
|
| | | def GetFaintDefRate(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrFaintDefRate)
|
| | | def SetFaintDefRate(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrFaintDefRate, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_FaintDefRate, value)
|
| | |
|
| | | #---触发定身----
|
| | | def GetAtkerFreezed(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrAtkerFreezed)
|
| | |
| | | def GetAddAngry(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrAddAngry)
|
| | | def SetAddAngry(curPlayer, value): curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrAddAngry, value)
|
| | |
|
| | | #---连击几率----
|
| | | def GetComboRate(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrComboRate)
|
| | | def SetComboRate(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrComboRate, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ComboRate, value)
|
| | | #---连击伤害----
|
| | | def GetComboDamPer(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_AttrComboDamPer)
|
| | | def SetComboDamPer(curPlayer, value):
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_AttrComboDamPer, value)
|
| | | SendPropertyRefresh(curPlayer, ShareDefine.CDBPlayerRefresh_ComboDamPer, value)
|
| | | |
| | | #---技能攻击比例减少----
|
| | | def GetSkillAtkRateReduce(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_SkillAtkRateReduce)
|
| | | def SetSkillAtkRateReduce(curPlayer, value):
|
| | |
| | | dict1[key] = aValue + value
|
| | | return
|
| | |
|
| | | def GetLordAttr(curPlayer):
|
| | | ## 获取主公属性汇总
|
| | | lordAttrDict = {"Atk":curPlayer.GetMaxAtk(), "Def":curPlayer.GetDef(), "MaxHP":GameObj.GetMaxHP(curPlayer), |
| | | "Hit":curPlayer.GetHit(), "Miss":curPlayer.GetMiss()}
|
| | | return lordAttrDict
|
| | |
|
| | | #-------------------------------------------------------------------------------
|
| | | ## 设置玩家字典值, 存库
|
| | | def NomalDictSetProperty(curPlayer, key, value, dType=0):
|