| | |
| | | import GameWorld
|
| | | import SkillShell
|
| | | import ChConfig
|
| | | import PlayerHorse
|
| | | import SkillCommon
|
| | | import GameMap
|
| | | import FBLogic
|
| | |
| | | import NetPackCommon
|
| | | import DataRecordPack
|
| | | import PlayerPrestigeSys
|
| | | import PlayerActivity
|
| | | import FBCommon
|
| | | import PassiveBuffEffMng
|
| | | import EventReport
|
| | |
| | | import PlayerActTurntable
|
| | | import PlayerCostRebate
|
| | | import PlayerActLunhuidian
|
| | | import PlayerActGarbageSorting
|
| | | import GY_Query_CrossRealmReg
|
| | | import PlayerTongTianLing
|
| | | import FunctionNPCCommon
|
| | | import PlayerGoldInvest
|
| | | import CrossRealmPlayer
|
| | | import CrossPlayerData
|
| | | import PlayerActivity
|
| | | import ChNetSendPack
|
| | | import PlayerState
|
| | | import PlayerGubao
|
| | | import PlayerOnline
|
| | | import PlayerTask
|
| | | import PlayerMail
|
| | | import PlayerLLMJ
|
| | | import ChPlayer
|
| | | import GameObj
|
| | |
|
| | |
| | | NotifyCode(curPlayer, "CrossMap10")
|
| | | return False
|
| | |
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | GameWorld.Log("客户端自定义场景下无法传送!", curPlayer.GetPlayerID())
|
| | | return False
|
| | | |
| | | return True
|
| | |
|
| | |
|
| | | ##地图特殊限制检查, 装备检查
|
| | | # @param curPlayer
|
| | | # @return bool
|
| | | def CheckEquipCanTrans(curPlayer, destMapID):
|
| | | if destMapID != 10060:
|
| | | return True
|
| | | |
| | | #有翅膀可以上天空
|
| | | playerEquip = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptEquip)
|
| | | curEquip = playerEquip.GetAt(IPY_GameWorld.retWing)
|
| | | if curEquip and not curEquip.IsEmpty():
|
| | | return True
|
| | | |
| | | #GeRen_lhs_861048
|
| | | NotifyCode(curPlayer, "GeRen_lhs_861048", [destMapID])
|
| | | return False
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##通知客户端, 玩家Loading开始
|
| | |
| | | return (curPlayerAction in ChConfig.Def_Player_Can_Transfer_State)
|
| | |
|
| | | #------------------------------玩家离开服务器的逻辑------------------------------------
|
| | | #---------------------------------------------------------------------
|
| | | ##骑马下线逻辑
|
| | | # @param curPlayer 玩家实例
|
| | | # @return 返回值无意义
|
| | | # @remarks 骑马下线逻辑
|
| | | def __RidingHorsePlayerDisconnect(curPlayer):
|
| | | #在骑马
|
| | | if curPlayer.GetPlayerVehicle() == IPY_GameWorld.pvHorse:
|
| | | #执行下马逻辑
|
| | | PlayerHorse.PlayerRideHorseDown(curPlayer, False)
|
| | | |
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | ##玩家下线/玩家切换地图公用逻辑
|
| | | # @param curPlayer 玩家实例
|
| | | # @param tick 时间戳
|
| | |
| | | playerID = curPlayer.GetPlayerID()
|
| | | if not isDisconnect:
|
| | | CrossPlayerData.ClearCrossSyncDataCache(curPlayer)
|
| | | PyGameData.g_fbBuyBuffTimeDict.pop(playerID, None)
|
| | | #清除地图玩家缓存
|
| | | PyGameData.g_playerReqEnterFBEx.pop(playerID, None)
|
| | | NPCCommon.ClearPriWoodPile(curPlayer)
|
| | | #移除地图缓存的境界难度玩家ID信息
|
| | | for playerIDList in PyGameData.g_realmDiffPlayerDict.values():
|
| | | if playerID in playerIDList:
|
| | |
| | |
|
| | | #玩家下线/玩家切换地图公用逻辑
|
| | | __PlayerLeaveServerLogic(curPlayer, tick, True)
|
| | | #骑马玩家下线逻辑
|
| | | __RidingHorsePlayerDisconnect(curPlayer)
|
| | | #召唤兽死亡
|
| | | KillPlayerSummonNPC(curPlayer)
|
| | | #更新从本地图离线信息
|
| | |
| | | #进入副本通用检查
|
| | | fbIpyData = FBCommon.GetFBIpyData(mapID)
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID)
|
| | | sceneMapID = mapID if not fbLineIpyData else fbLineIpyData.GetMapID()
|
| | | sceneMapID = mapID #if not fbLineIpyData else fbLineIpyData.GetMapID()
|
| | | #过滤封包地图ID
|
| | | if not GameWorld.GetMap().IsMapIDExist(sceneMapID):
|
| | | GameWorld.ErrLog('###非法地图数据,sceneMapID: %s' % (sceneMapID), curPlayer.GetID())
|
| | |
| | | GameWorld.Log("非队长,无法发起进入组队副本请求!", curPlayer.GetPlayerID())
|
| | | return
|
| | | isSendToGameServer = True
|
| | | if isSendToGameServer or mapID in ChConfig.Def_MapID_SendToGameServer \
|
| | | or mapID in ReadChConfig.GetEvalChConfig("MapID_SendToGameServer"):
|
| | | if isSendToGameServer:
|
| | | extendParamList = []
|
| | | if mapID in ChConfig.Def_MapID_LineIDToPropertyID:
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbEnterCnt % mapID)
|
| | | extendParamList = [enterCnt]
|
| | | elif mapID in ChConfig.MirrorBattleMapIDList:
|
| | | reqInfoEx["sceneMapID"] = sceneMapID
|
| | | extendParamList = [reqInfoEx]
|
| | | #elif mapID in ChConfig.MirrorBattleMapIDList:
|
| | | # reqInfoEx["sceneMapID"] = sceneMapID
|
| | | # extendParamList = [reqInfoEx]
|
| | | SendToGameServerEnterFB(curPlayer, mapID, lineID, tick, extendParamList)
|
| | | return
|
| | |
|
| | |
| | | if isNotify:
|
| | | NotifyCode(curPlayer, "Carry_lhs_697674")
|
| | | return ShareDefine.EntFBAskRet_Sit
|
| | | |
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | if isNotify:
|
| | | NotifyCode(curPlayer, "Carry_lhs_697674")
|
| | | GameWorld.Log("客户端自定义场景下无法进入副本!", curPlayer.GetPlayerID())
|
| | | return ShareDefine.EntFBAskRet_Other
|
| | |
|
| | | if playerAction in ChConfig.Def_Player_Cannot_TransState:
|
| | | #Carry_lhs_697674:您当前所处的状态不能进行传送!
|
| | |
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_TransTick, tick)
|
| | |
|
| | | mapID = FBCommon.GetRecordMapID(mapID)
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, funcLineID)
|
| | | sceneMapID = mapID if not fbLineIpyData else fbLineIpyData.GetMapID()
|
| | | sceneMapID = mapID #if not fbLineIpyData else fbLineIpyData.GetMapID()
|
| | |
|
| | | # 地图分流, 减少单地图压力
|
| | | FBMapShuntDict = ReadChConfig.GetEvalChConfig("FBMapShunt")
|
| | |
| | | return tagLineID
|
| | | tagLinePlayerCountDict = PyGameData.g_commMapLinePlayerCountDict[tagMapID] # 此分线包含所有分线,含未开放的及活动分线
|
| | |
|
| | | if bossID and tagMapID != ChConfig.Def_FBMapID_BossHome:
|
| | | tagLineID = 0 # Boss的话未分流前先强制1线,即为0
|
| | | #if bossID and tagMapID != ChConfig.Def_FBMapID_BossHome:
|
| | | # tagLineID = 0 # Boss的话未分流前先强制1线,即为0
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | playChangeLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PlayChangeLineID)
|
| | | funcChangeLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FuncChangeLineID)
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def GetUnXiantaoCntEquip(curPlayer):
|
| | | '''因为战锤对应装备是1个战锤可能对应多个装备掉落,所以分解装备的时候1个战锤需要支持可拆分
|
| | | 所以需要支持小数存储,暂定以支持3位小数存储
|
| | | '''
|
| | | return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) / 1000.0
|
| | | def AddUnXiantaoCntEquip(curPlayer, addCnt):
|
| | | unXiantaoCntEquip = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntEquip) + addCnt * 1000
|
| | | return NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip)
|
| | | def SetUnXiantaoCntEquip(curPlayer, unXiantaoCntEquip):
|
| | | ## 保存装备未结算战锤数,保留3位小数
|
| | | # @param unXiantaoCntEquip: 实际的未结算数量,支持小数
|
| | | unXiantaoCntEquip = int(round(unXiantaoCntEquip, 3) * 1000) # 保留3为小数
|
| | | return NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntEquip, unXiantaoCntEquip)
|
| | |
|
| | | ##玩家是否有钱款
|
| | | # @param curPlayer 玩家实例
|
| | | # @param TYPE_Price ,货币类型
|
| | |
| | | #银票支付
|
| | | elif type_Price == IPY_GameWorld.TYPE_Price_Silver_Paper:
|
| | | __PayMoneyAfterBySilverPaper(curPlayer, price)
|
| | | |
| | | #活跃度处理
|
| | | PlayerActivity.OnPayMoneyActivity(curPlayer, type_Price, price)
|
| | | |
| | | #转盘活动
|
| | | PlayerActTurntable.OnPlayerUseGold(curPlayer, type_Price, 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)
|
| | | AddUnXiantaoCntEquip(curPlayer, price)
|
| | | # 累加未结算战锤 - 战利品
|
| | | chapterID = GetMainLevelNowInfo(curPlayer)[0]
|
| | | chapterIpyData = IpyGameDataPY.GetIpyGameData("MainChapter", chapterID)
|
| | |
| | | unXiantaoCntBooty = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_UnXiantaoCntBooty % itemID)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_UnXiantaoCntBooty % itemID, unXiantaoCntBooty + price)
|
| | |
|
| | | PlayerLLMJ.AddUseZhanchui(curPlayer, price)
|
| | | PlayerPrestigeSys.AddRealmTaskValue(curPlayer, PlayerPrestigeSys.RealmTaskType_UseXiantao, price)
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_CutTree, price)
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_CutTree, price)
|
| | | |
| | | unitPrice = price if quantity == 1 else int(math.ceil(price * 1.0 / quantity)) # 单价
|
| | | #reason_name = "Unknown" if not costType else costType
|
| | | reason_name = costType
|
| | |
| | | if costType not in ChConfig.CostRebate_DisableType:
|
| | | PlayerCostRebate.AddCostRebateGold(curPlayer, costType, price, infoDict)
|
| | | PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_UseGold, price)
|
| | | PlayerActGarbageSorting.AddActGarbageTaskProgress(curPlayer, ChConfig.Def_GarbageTask_UseGold, price)
|
| | | else:
|
| | | GameWorld.DebugLog("不计入消费活动的消费类型!costType=%s" % costType, curPlayer.GetPlayerID())
|
| | |
|
| | |
| | | # @return 返回值真, 给钱成功
|
| | | # @param isSysHint 是否系统提示(默认是)
|
| | | # @remarks 玩家获得金钱
|
| | | def GiveMoney(curPlayer, priceType, value, giveType=ChConfig.Def_GiveMoney_Unknown, addDataDict={}, isSysHint=True, isGiveBourseMoney=True):
|
| | | def GiveMoney(curPlayer, priceType, value, giveType=ChConfig.Def_GiveMoney_Unknown, addDataDict={}, isSysHint=True, isGiveBourseMoney=True, notifyAward=False):
|
| | | if value == 0:
|
| | | return True
|
| | |
|
| | |
| | | msgInfo = {"PlayerID":curPlayer.GetPlayerID(), "MoneyType":priceType, "Value":value, "GiveType":giveType, "AddDataDict":addDataDict}
|
| | | GameWorld.SendMsgToClientServer(ShareDefine.CrossServerMsg_GiveMoney, msgInfo, [serverGroupID])
|
| | | return True
|
| | | |
| | | if priceType == ShareDefine.TYPE_Price_FamilyExp:
|
| | | return PlayerFamily.AddFamilyExp(curPlayer, value)
|
| | |
|
| | | befMoney = GetMoney(curPlayer, priceType)
|
| | | if priceType == IPY_GameWorld.TYPE_Price_Gold_Money:
|
| | |
| | | return
|
| | | updValue = min(ChConfig.Def_UpperLimit_DWord, curCurrency + value)
|
| | | SetPlayerCurrency(curPlayer, priceType, updValue)
|
| | | if priceType == ShareDefine.TYPE_Price_RealmPoint:
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_GetRealmPoint, value)
|
| | | else:
|
| | | GameWorld.ErrLog("金钱类型错误, priceType=%s,value=%s,giveType=%s" % (priceType, value, giveType), curPlayer.GetPlayerID())
|
| | | DataRecordPack.DR_GiveMoneyError(curPlayer, priceType, value, giveType, addDataDict)
|
| | |
| | | # NotifyCode(curPlayer, "GetMoney", [priceType, str(round(value/100.0, 2))])
|
| | | # else:
|
| | | # NotifyCode(curPlayer, "GetMoney", [priceType, value])
|
| | | if notifyAward:
|
| | | ItemControler.NotifyGiveAwardInfo(curPlayer, [], giveType, moneyInfo={priceType:value})
|
| | | |
| | | __GiveMoneyAfter(curPlayer, priceType, value, giveType, addDataDict)
|
| | |
|
| | | if befMoney == 0:
|
| | |
| | | # 除钻石及绑钻外,未指定操作类型的不记录
|
| | |
|
| | | PlayerTask.AddTaskValue(curPlayer, ChConfig.TaskType_GetMoney, value, [priceType])
|
| | | PlayerActivity.AddDailyTaskValue(curPlayer, ChConfig.DailyTask_GetMoney, value, [priceType])
|
| | |
|
| | | if priceType == ShareDefine.TYPE_Price_FamilyCoin:
|
| | | PlayerFamily.AddFamilyContrib(curPlayer, value) # 公会币同步增加公会贡献
|
| | | |
| | | if priceType not in [IPY_GameWorld.TYPE_Price_Gold_Money, IPY_GameWorld.TYPE_Price_Gold_Paper, ShareDefine.TYPE_Price_PayCoin] \
|
| | | and giveType == ChConfig.Def_GiveMoney_Unknown:
|
| | | #GameWorld.DebugLog("该货币没有指定来源类型不记录!priceType=%s,giveType=%s" % (priceType, giveType))
|
| | |
| | | return IpyGameDataPY.GetFuncCfg("PKConfig", 2)
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ##获得玩家升级, 获得的属性点
|
| | | # @param curPlayer 玩家实例
|
| | | # @return 返回值, 获得的属性点
|
| | | # @remarks 获得玩家升级, 获得的属性点
|
| | | def GetLvUp_AddPoint(curPlayer):
|
| | | curPlayerID = curPlayer.GetID()
|
| | | curLV = curPlayer.GetLV() # 当前等级
|
| | | |
| | | addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
|
| | | addPoint = GameWorld.GetDictValueByRangeKey(addPointDict, curLV, 0)
|
| | | |
| | | if addPoint == None:
|
| | | raise Exception('玩家获得升级属性点异常, curLV = %s PlayerID = %s' % (curLV, curPlayerID))
|
| | | return
|
| | | return int(addPoint+ GetFabaoAddPoint(curPlayer) + GetTitleAddExtraPoint(curPlayer))
|
| | |
|
| | | def GetAllPointByLV(curPlayer):
|
| | | ##获取当前等级可得到属性点数
|
| | | openLV = GameFuncComm.GetFuncLimitLV(ShareDefine.GameFuncID_AddPoint)
|
| | | curLV = curPlayer.GetLV()
|
| | | if curLV < openLV:
|
| | | return 0
|
| | | # 初始点+(升级点+法宝效果)*称号效果倍数+境界点
|
| | | setFreePoint = IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 2)
|
| | | fabaoAddPoint = GetFabaoAddPoint(curPlayer)
|
| | | titleAddPoint = GetTitleAddExtraPoint(curPlayer)
|
| | | addPointDict = IpyGameDataPY.GetFuncEvalCfg("LVUPAddPoint", 1, {})
|
| | | for rangLVs, point in addPointDict.items():
|
| | | if curLV < rangLVs[0]:
|
| | | continue
|
| | | setFreePoint += (point + fabaoAddPoint + titleAddPoint) * (min(curLV, rangLVs[1]) - rangLVs[0] + 1)
|
| | | |
| | | #境界提升点数
|
| | | setFreePoint += curPlayer.GetOfficialRank() * IpyGameDataPY.GetFuncCfg("LVUPAddPoint", 3)
|
| | | return setFreePoint
|
| | |
|
| | | def GetTitleAddExtraPoint(curPlayer):
|
| | | # 称号额外增加玩家每级获得的灵根点
|
| | |
| | | if titleID and curPlayer.GetDienstgradManager().GetDienstgrad(titleID):
|
| | | return IpyGameDataPY.GetFuncCfg("TitleAddPoint", 2)
|
| | | return 0
|
| | |
|
| | | def GetFabaoAddPoint(curPlayer):
|
| | | #法宝额外增加玩家每级获得的灵根点
|
| | | return 0
|
| | |
|
| | | def DoAddPointOpen(curPlayer):
|
| | | '''加点功能开启'''
|
| | | beforeFreePoint = curPlayer.GetFreePoint()
|
| | | |
| | | setFreePoint = GetAllPointByLV(curPlayer)
|
| | | curLV = curPlayer.GetLV()
|
| | | addDataDict = {'beforeFreePoint':beforeFreePoint}
|
| | | curPlayer.SetFreePoint(setFreePoint)
|
| | | DataRecordPack.DR_Freepoint(curPlayer, "AddPointOpen", setFreePoint, addDataDict)
|
| | | GameWorld.DebugLog(' 加点功能开启处理 beforeFreePoint=%s,curLV=%s, setFreePoint=%s'%(beforeFreePoint, curLV, setFreePoint), curPlayer.GetID())
|
| | | return
|
| | |
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | ###############################################################
|
| | |
| | | #aftFreePoint = curPlayer.GetFreePoint()
|
| | | if aftLV > befLV:
|
| | | curPlayer.SetLV(aftLV, False) # 这里不再通知GameServer
|
| | | PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_LVUp, aftLV - befLV)
|
| | | #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)
|
| | | PlayerGubao.DoGubaoAddFreePoint(curPlayer)
|
| | |
|
| | | # 升级需要执行的游戏功能处理
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|
| | |
| | | #if curPlayer.GetMaxMP() > 0:
|
| | | # curPlayer.SetMP(curPlayer.GetMaxMP())
|
| | |
|
| | | FBLogic.OnPlayerLVUp(curPlayer)
|
| | | # 记录开服活动冲级数据
|
| | | #OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_LV, curPlayer.GetLV())
|
| | | #神秘限购
|
| | | FunctionNPCCommon.MysticalLimitShopOpen(curPlayer, befLV, aftLV)
|
| | |
|
| | | #不需要做升级任务, 设置玩家经验
|
| | | SetPlayerTotalExp(curPlayer, curTotalExp)
|
| | | return
|
| | |
| | |
|
| | | if curPlayerAction == IPY_GameWorld.paPreparing:
|
| | | DoExitPreparing(curPlayer)
|
| | | |
| | | #---玩家交通工具处理---
|
| | | curPlayerVehicle = curPlayer.GetPlayerVehicle()
|
| | | |
| | | #玩家骑马中, 下马
|
| | | if curPlayerVehicle == IPY_GameWorld.pvHorse:
|
| | | #执行下马逻辑
|
| | | PlayerHorse.PlayerRideHorseDown(curPlayer, False)
|
| | |
|
| | | #---其他系统处理---
|
| | |
|
| | |
| | | if actExpIpyData and curPlayer.GetLV() >= actExpIpyData.GetLVLimit():
|
| | | fightExpRate += actExpIpyData.GetAddExpRate()
|
| | |
|
| | | if curPlayer.GetMapID() not in [ChConfig.Def_FBMapID_FamilyInvade]: #守卫人皇不加组队加成
|
| | | fightExpRate += curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TeamExpRate) # 组队
|
| | | #if curPlayer.GetMapID() not in [ChConfig.Def_FBMapID_FamilyInvade]: #守卫人皇不加组队加成
|
| | | # fightExpRate += curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TeamExpRate) # 组队
|
| | |
|
| | | #地图多倍经验加成,默认是1倍不加成
|
| | | mapExpAddMultiple = max(0, FBCommon.GetAreaRewardMultiple(curPlayer) - 1)
|
| | | mapExpAddMultiple = 0
|
| | | fightExpRate += mapExpAddMultiple * ChConfig.Def_MaxRateValue
|
| | |
|
| | | if totalExpRate != fightExpRate:
|
| | |
| | | totalExpRate -= effExpRate
|
| | |
|
| | | return totalExpRate
|
| | |
|
| | | ##外观额外数据: 其他 * 100 + 坐骑外观
|
| | | def GetHorseSkinID(curPlayer): return GameWorld.GetValue(curPlayer.GetEquipShowSwitch(), 2, 2)
|
| | | def SetHorseSkinID(curPlayer, horseSkinID):
|
| | | showValue = curPlayer.GetEquipShowSwitch()
|
| | | updShowValue = GameWorld.SetValue(showValue, 2, 2, min(horseSkinID, 99))
|
| | | curPlayer.SetEquipShowSwitch(updShowValue)
|
| | | GameWorld.DebugLog("使用坐骑外观: horseSkinID=%s,showValue=%s,updShowValue=%s" % (horseSkinID, showValue, updShowValue))
|
| | | return
|
| | |
|
| | | #===============================================================================
|
| | | #---玩家扩展字段---
|
| | |
| | |
|
| | | def IsMainLevelPass(curPlayer, lvID):
|
| | | ## 判断玩家是否过关某个主线关卡ID
|
| | | # @param lvID: 关卡唯一ID,与策划约定好 = 章节*100+关卡编号
|
| | | passChapterID, passLevelNum, _ = GetMainLevelPassInfo(curPlayer)
|
| | | passValue = passChapterID * 100 + passLevelNum # 因为pass的记录是带波数的,即当前关卡boss还没过关,所以只有大于该记录值的才算过关
|
| | | return passValue > lvID
|
| | | return GetPassMainLevelID(curPlayer) >= lvID
|
| | | def GetPassMainLevelID(curPlayer):
|
| | | ## 获取已过关主线关卡ID
|
| | | passChapterID, passLevelNum, _ = GetMainLevelPassInfo(curPlayer) # 当前过关进度包含波,所以需要取上一关的
|
| | | passLVID = 0 # 关卡唯一ID,与策划约定好 = 章节*100+关卡编号
|
| | | if passLevelNum > 1:
|
| | | preLevelNum = passLevelNum - 1
|
| | | passLVID = passChapterID * 100 + preLevelNum
|
| | | GameWorld.DebugLog("非某章节的第1关直接减1即可: passLVID=%s,passChapterID=%s,passLevelNum=%s" % (passLVID, passChapterID, passLevelNum))
|
| | | |
| | | elif passChapterID > 1: # 取上一章节
|
| | | preChapterID = passChapterID - 1
|
| | | levelDataList = IpyGameDataPY.GetIpyGameDataByCondition("MainLevel", {"ChapterID":preChapterID}, True)
|
| | | levelCount = len(levelDataList) if levelDataList else 0
|
| | | if levelCount:
|
| | | passLVID = preChapterID * 100 + levelCount
|
| | | GameWorld.DebugLog("取上一章节作为已过关关卡: passLVID=%s,preChapterID=%s,levelCount=%s,passChapterID=%s,passLevelNum=%s" |
| | | % (passLVID, preChapterID, levelCount, passChapterID, passLevelNum))
|
| | | return passLVID
|
| | |
|
| | | ## 主线关卡过关进度值 = 章节*10000+关卡编号*100+第x波
|
| | | def GetMainLevelPassValue(curPlayer): return curPlayer.GetExAttr1()
|
| | |
| | | # @param wave: 第x波
|
| | | value = ComMainLevelValue(chapterID, levelNum, wave)
|
| | | SetMainLevelPassValue(curPlayer, value)
|
| | | if wave == 0:
|
| | | lvID = GetPassMainLevelID(curPlayer)
|
| | | PlayerBillboard.UpdatePlayerBillboard(curPlayer, ShareDefine.Def_BT_MainLevel, lvID)
|
| | | PlayerTask.UpdTaskValue(curPlayer, ChConfig.TaskType_MainLevel)
|
| | | PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_MainLevel, lvID)
|
| | | return value
|
| | | def GetMainLevelPassInfo(curPlayer):
|
| | | ## 获取主线关卡过关进度信息
|
| | | # @return: chapterID, levelNum, wave
|
| | | return GetMainLevelValue(GetMainLevelPassValue(curPlayer))
|
| | | chapterID, levelNum, wave = GetMainLevelValue(GetMainLevelPassValue(curPlayer))
|
| | | if not chapterID and not levelNum:
|
| | | chapterID, levelNum, wave = 1, 1, 0
|
| | | SetMainLevelPassValue(curPlayer, ComMainLevelValue(chapterID, levelNum, wave))
|
| | | return chapterID, levelNum, wave
|
| | |
|
| | | ## 主线关卡当前进度值 = 章节*10000+关卡编号*100+第x波
|
| | | def GetMainLevelNowValue(curPlayer): return curPlayer.GetExAttr2()
|
| | |
| | | def GetMainLevelNowInfo(curPlayer):
|
| | | ## 获取主线关卡当前进度信息
|
| | | # @return: chapterID, levelNum, wave
|
| | | return GetMainLevelValue(GetMainLevelNowValue(curPlayer))
|
| | | chapterID, levelNum, wave = GetMainLevelValue(GetMainLevelNowValue(curPlayer))
|
| | | if not chapterID and not levelNum:
|
| | | chapterID, levelNum, wave = 1, 1, 1
|
| | | SetMainLevelNowInfo(curPlayer, chapterID, levelNum, wave)
|
| | | if not wave:
|
| | | wave = 1
|
| | | SetMainLevelNowInfo(curPlayer, chapterID, levelNum, wave)
|
| | | return chapterID, levelNum, wave
|
| | |
|
| | | def ComMainLevelValue(chapterID, levelNum, wave=0): return chapterID * 10000 + levelNum * 100 + wave
|
| | | def GetMainLevelValue(value):
|
| | |
| | | levelNum = value % 10000 / 100
|
| | | wave = value % 100
|
| | | return chapterID, levelNum, wave
|
| | |
|
| | | ## 获取佩戴的称号ID
|
| | | def GetTitleID(curPlayer): return curPlayer.GetExAttr3()
|
| | | def SetTitleID(curPlayer, titleID):
|
| | | curPlayer.SetExAttr3(titleID, False, False)
|
| | | PlayerFamily.RefreshFamilyMember(curPlayer)
|
| | | return
|
| | |
|
| | | ## 协助目标玩家ID
|
| | | def GetAssistTagPlayerID(curPlayer): return 0
|
| | |
| | | def SetTeamCheckState(curPlayer, checkState): return
|
| | | ## 副本功能线路ID, 这里做db存储,防止在合并地图副本中掉线重上时前端无法加载正确的场景资源,登录加载场景时机为0102包
|
| | | def SetFBFuncLineID(curPlayer, mapID, funcLineID):
|
| | | value = mapID * 1000 + funcLineID
|
| | | if value != curPlayer.GetExAttr3():
|
| | | curPlayer.SetExAttr3(value, False, True)
|
| | | return
|
| | | def GetFBFuncMapID(curPlayer): return curPlayer.GetExAttr3() / 1000
|
| | | def GetFBFuncLineID(curPlayer): return curPlayer.GetExAttr3() % 1000
|
| | | def GetFBFuncMapID(curPlayer): return 0
|
| | | def GetFBFuncLineID(curPlayer): return 0
|
| | |
|
| | | ## 跨服状态所在地图ID: 0-非跨服状态,非0-跨服状态对应的地图ID
|
| | | def GetCrossMapID(curPlayer): return curPlayer.GetExAttr5()
|
| | |
| | | curPlayer.SetExAttr5(value, False, True)
|
| | | if not value:
|
| | | CrossPlayerData.ClearCrossSyncDataCache(curPlayer)
|
| | | return
|
| | |
|
| | | ## 前端自定义场景
|
| | | def GetCustomMapID(curPlayer): return curPlayer.GetExAttr14() / 1000
|
| | | def GetCustomLineID(curPlayer): return curPlayer.GetExAttr14() % 1000
|
| | | ## 自定义场景后端判断已结算后需直接重置为0,防止前端没有退出场景直接下线导致数据没有重置,可能引发可以重复进
|
| | | def SetCustomMap(curPlayer, mapID, lineID):
|
| | | value = mapID * 1000 + lineID
|
| | | if value != curPlayer.GetExAttr14():
|
| | | curPlayer.SetExAttr14(value, False, True)
|
| | | return
|
| | |
|
| | | ## 铜钱点, 支持铜钱超20亿
|
| | |
| | | def SetVIPLVUpTime(curPlayer, lvUpTime): return
|
| | |
|
| | | ##聊天气泡框
|
| | | def GetChatBubbleBox(curPlayer): return curPlayer.GetExAttr10()
|
| | | def SetChatBubbleBox(curPlayer, value): return curPlayer.SetExAttr10(value, False, True)
|
| | | def GetChatBox(curPlayer): return curPlayer.GetExAttr10()
|
| | | def SetChatBox(curPlayer, value): return curPlayer.SetExAttr10(value, False, True)
|
| | |
|
| | | ##游戏充值支付代币
|
| | | def GetPayCoinTotal(curPlayer): return GetPayCoin(curPlayer) + GetPlayerCurrency(curPlayer, ShareDefine.TYPE_Price_PayCoinDay)
|
| | |
| | | if payCoinDay > 0:
|
| | | PayMoney(curPlayer, ShareDefine.TYPE_Price_PayCoin, payCoinDay, "PayCoinOnDay")
|
| | | return
|
| | |
|
| | | ## 获取佩戴的称号ID
|
| | | def GetTitleID(curPlayer):
|
| | | curDienstgradMgr = curPlayer.GetDienstgradManager()
|
| | | return curDienstgradMgr.GetCurGradID()
|
| | |
|
| | | ##伴侣
|
| | | def GetCoupleID(curPlayer):
|
| | |
| | | ## 获取玩家在本地图中的境界难度层级,必须在境界地图且有选择境界难度才算,否则为默认0;该难度值同时也是视野层级
|
| | | return 0
|
| | |
|
| | |
|
| | | ##玩家退出仙盟信息: 主动离开次数*100 + 被踢次数*10 + 最后一次是否主动离开的
|
| | | def GetLeaveFamilyInfo(curPlayer):
|
| | | # @return: 主动离开次数, 最后一次是否主动离开的
|
| | | value = curPlayer.GetExAttr12()
|
| | | leaveCnt = value / 100
|
| | | kickedCnt = value % 100 / 10
|
| | | lastVoluntarily = value % 10
|
| | | return leaveCnt, kickedCnt, lastVoluntarily
|
| | | def SetLeaveFamilyInfo(curPlayer, leaveCnt, kickedCnt, lastVoluntarily):
|
| | | value = min(9, leaveCnt) * 100 + min(9, kickedCnt) * 10 + lastVoluntarily
|
| | | curPlayer.SetExAttr12(value) # IPY_PlayerDefine.CDBPlayerRefresh_ExAttr12
|
| | | GameWorld.DebugLog(" SetLeaveFamilyInfo: value=%s" % (value))
|
| | | return value
|
| | | ##玩家离开仙盟时间(主动或被踢都算)
|
| | | def GetLeaveFamilyTimeEx(curPlayer):return curPlayer.GetExAttr19()
|
| | | def SetLeaveFamilyTimeEx(curPlayer, value):
|
| | | curPlayer.SetExAttr19(value)
|
| | | #curPlayer.SendGameServerRefreshState(ShareDefine.CDBPlayerRefresh_ExAttr19, value, 0)
|
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ExAttr19, value, 0, False)
|
| | | return
|
| | | return value
|
| | |
|
| | | ##总战斗力,支持超过20E = 各模块战力总和
|
| | | def GetFightPower(curPlayer): return curPlayer.GetFightPowerEx() * ChConfig.Def_PerPointValue + curPlayer.GetFightPower()
|
| | | def SetFightPower(curPlayer, value):
|
| | | beforeFightPower = GetFightPower(curPlayer)
|
| | | curPlayer.SetFightPower(value % ChConfig.Def_PerPointValue, value / ChConfig.Def_PerPointValue, False) # 不通知GameServer bNotifyGameServer False
|
| | | if value < beforeFightPower:
|
| | | DataRecordPack.DR_FightPowerChangeInfo(curPlayer, beforeFightPower)
|
| | | highestFightPower = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FightPower_Highest)
|
| | | highestFightPower += curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_FightPower_HighestEx) * ChConfig.Def_PerPointValue
|
| | | if value > highestFightPower:
|
| | | highestFightPower = value
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_Highest, highestFightPower % ChConfig.Def_PerPointValue)
|
| | | NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FightPower_HighestEx, highestFightPower / ChConfig.Def_PerPointValue)
|
| | | |
| | | GameWorld.DebugLog("总战力: %s, 历史最高战力: %s, beforeFightPower=%s" % (value, highestFightPower, beforeFightPower), curPlayer.GetPlayerID())
|
| | | PlayerBillboard.UpdatePlayerFPTotalBillboard(curPlayer)
|
| | | # 记录开服活动数据
|
| | | #OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_FightPower, totalFightPower)
|
| | | #if value < beforeFightPower:
|
| | | # DataRecordPack.DR_FightPowerChangeInfo(curPlayer, beforeFightPower)
|
| | | GameWorld.DebugLog("总战力: %s, beforeFightPower=%s" % (value, beforeFightPower), curPlayer.GetPlayerID())
|
| | | #PlayerBillboard.UpdatePlayerFPTotalBillboard(curPlayer)
|
| | | #if beforeFightPower != totalFightPower:
|
| | | # CrossPlayerData.OnPlayerFightPowerChange(curPlayer)
|
| | | return
|
| | |
| | | # @return 无意义
|
| | | def SetSight(curPlayer, sight):
|
| | | #外挂号 视野验证
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_AutoCheckHack_State) \
|
| | | == ChConfig.Def_AutoCheck_State_Danger:
|
| | | |
| | | if curPlayer.GetSight() > sight:
|
| | | curPlayer.SetSight(sight)
|
| | | |
| | | return
|
| | | |
| | | # if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_AutoCheckHack_State) \
|
| | | # == ChConfig.Def_AutoCheck_State_Danger:
|
| | | # |
| | | # if curPlayer.GetSight() > sight:
|
| | | # curPlayer.SetSight(sight)
|
| | | # |
| | | # return
|
| | | # |
| | | curPlayer.SetSight(sight)
|
| | |
|
| | | ##获取攻击间隔
|
| | |
| | | atkInterval = curPlayer.GetAtkInterval()
|
| | |
|
| | | #外挂号 攻击间隔验证
|
| | | if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_AutoCheckHack_State) \
|
| | | == ChConfig.Def_AutoCheck_State_Danger:
|
| | | atkInterval *= 100
|
| | | #if curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_AutoCheckHack_State) \
|
| | | # == ChConfig.Def_AutoCheck_State_Danger:
|
| | | # atkInterval *= 100
|
| | |
|
| | | return atkInterval
|
| | |
|
| | |
| | | if not lvIpyData:
|
| | | return 0
|
| | | return lvIpyData.GetExp()
|
| | |
|
| | | def GetOpenMaxLV():
|
| | | ## 获取游戏开放的最大等级
|
| | | maxLV = IpyGameDataPY.GetFuncCfg("PlayerMaxLV", 1)
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | realmIpyData = ipyDataMgr.GetRealmByIndex(ipyDataMgr.GetRealmCount() - 1)
|
| | | return min(maxLV, realmIpyData.GetLVMax())
|
| | |
|
| | | def GetPlayerMaxLV(curPlayer):
|
| | | ## 获取玩家实际可升的最大等级
|
| | |
| | | # 血瓶恢复效果
|
| | | def GetHPCureEnhance(curPlayer): return 0
|
| | |
|
| | | # 仙盟徽章ID
|
| | | def GetFamilyEmblemID(curPlayer): return curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FamilyEmblemID)
|
| | | def SetFamilyEmblemID(curPlayer, emblemID): NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FamilyEmblemID, emblemID)
|
| | |
|
| | | # 仙盟职位,使用 GetReceivedSalary,因为FamilyMemberLV没有入库
|
| | | def GetFamilyMemberLV(curPlayer): return curPlayer.GetReceivedSalary()
|
| | | def SetFamilyMemberLV(curPlayer, fmLV):
|
| | |
| | | ## 设置玩家字典值, 存库
|
| | | def NomalDictSetProperty(curPlayer, key, value, dType=0):
|
| | | if CrossPlayerData.IsNeedProcessCrossPlayer(curPlayer) and key not in \
|
| | | [ChConfig.Def_PDict_FightPower_Total, ChConfig.Def_PDict_FightPower_TotalEx, ChConfig.Def_PlayerKey_CrossRegisterMap]:
|
| | | [ChConfig.Def_PlayerKey_CrossRegisterMap]:
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | changeDict = PyGameData.g_crossPlayerDictChangeInfo.get(playerID, {})
|
| | | changeDict[(key, dType)] = value
|
| | |
| | |
|
| | | if value == 0:
|
| | | curPlayer.NomalDictDelProperty(key, dType)
|
| | | return
|
| | | return 0
|
| | | # 2^31 - 1
|
| | | curPlayer.NomalDictAddProperty(key, min(value, ChConfig.Def_UpperLimit_DWordEx), dType)
|
| | | return
|
| | | value = max(0, min(value, ChConfig.Def_UpperLimit_DWordEx))
|
| | | curPlayer.NomalDictAddProperty(key, value, dType)
|
| | | return value
|
| | |
|
| | | ## 通知祝福值
|
| | | def Sync_BlessValue(curPlayer, blessType, value, multiple=0):
|