| | |
| | | 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 PlayerCostRebate
|
| | | import PlayerActLunhuidian
|
| | | import GY_Query_CrossRealmReg
|
| | | import PlayerTongTianLing
|
| | | import FunctionNPCCommon
|
| | | import PlayerGoldInvest
|
| | | import CrossRealmPlayer
|
| | | import CrossPlayerData
|
| | | import PlayerActivity
|
| | | import ChNetSendPack
|
| | | import PlayerState
|
| | | import PlayerOnline
|
| | | import PlayerTask
|
| | | import PlayerMail
|
| | | import PlayerLLMJ
|
| | | import ChPlayer
|
| | | import GameObj
|
| | |
|
| | |
| | | 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 时间戳
|
| | |
| | |
|
| | | #玩家下线/玩家切换地图公用逻辑
|
| | | __PlayerLeaveServerLogic(curPlayer, tick, True)
|
| | | #骑马玩家下线逻辑
|
| | | __RidingHorsePlayerDisconnect(curPlayer)
|
| | | #召唤兽死亡
|
| | | KillPlayerSummonNPC(curPlayer)
|
| | | #更新从本地图离线信息
|
| | |
| | | #银票支付
|
| | | elif type_Price == IPY_GameWorld.TYPE_Price_Silver_Paper:
|
| | | __PayMoneyAfterBySilverPaper(curPlayer, price)
|
| | | |
| | | #活跃度处理
|
| | | PlayerActivity.OnPayMoneyActivity(curPlayer, type_Price, price)
|
| | | |
| | | #转盘活动
|
| | | PlayerActTurntable.OnPlayerUseGold(curPlayer, type_Price, price)
|
| | | #轮回殿
|
| | |
| | | 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
|
| | |
| | | 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)
|
| | |
| | | # 除钻石及绑钻外,未指定操作类型的不记录
|
| | |
|
| | | 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) # 公会币同步增加公会贡献
|
| | |
| | | #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)
|
| | |
| | | #if curPlayer.GetMaxMP() > 0:
|
| | | # curPlayer.SetMP(curPlayer.GetMaxMP())
|
| | |
|
| | | # 记录开服活动冲级数据
|
| | | #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)
|
| | |
|
| | | #---其他系统处理---
|
| | |
|
| | |
| | |
|
| | | 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
|
| | |
|
| | | #===============================================================================
|
| | | #---玩家扩展字段---
|
| | |
|
| | |
| | | lvID = chapterID * 100 + levelNum
|
| | | 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):
|
| | | ## 获取主线关卡过关进度信息
|
| | |
| | | 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()
|
| | |
| | | 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())
|
| | | #if value < beforeFightPower:
|
| | | # DataRecordPack.DR_FightPowerChangeInfo(curPlayer, beforeFightPower)
|
| | | GameWorld.DebugLog("总战力: %s, beforeFightPower=%s" % (value, beforeFightPower), curPlayer.GetPlayerID())
|
| | | #PlayerBillboard.UpdatePlayerFPTotalBillboard(curPlayer)
|
| | | # 记录开服活动数据
|
| | | #OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_FightPower, totalFightPower)
|
| | | #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
|
| | |
|
| | |
| | | ## 设置玩家字典值, 存库
|
| | | 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
|