135 【挑战】战锤秘境-服务端(白骨盈野;副本基础;副本扫荡;广告奖励支持;)
| | |
| | |
|
| | | //副本总表
|
| | |
|
| | | struct tagFBFunc
|
| | | struct FBFunc
|
| | | {
|
| | | DWORD _DataMapID; //数据地图ID
|
| | | BYTE DayTimes; //每日可挑战次数, 0为不限制
|
| | | BYTE DayResetType; //每日次数重置类型; 0-不重置,1-0点,2-5点
|
| | | BYTE WeekTimes; //每周可挑战次数, 0为不限制
|
| | | BYTE WeekResetType; //每周次数重置类型; 0-不重置,1-0点,2-5点
|
| | | list RewardRate; //评级奖励比例
|
| | | DWORD BuyTimesVIPPriID; //购买次数VIP权限ID
|
| | | DWORD ExtraTimesVIPPriID; //额外次数VIP权限ID
|
| | | DWORD ExtraTimesMWPriID; //额外次数法宝权限ID
|
| | | BYTE GuardPick; //该地图守护是否能拾取
|
| | | WORD OfflineTime; //离线多久退出副本(秒)
|
| | | WORD FBPoint; //副本过关仙缘币
|
| | | WORD HelpPoint; //助战仙缘币(0代表不可助战)
|
| | | BYTE DayHelpCountMax; //每日手动助战获得仙缘币次数(非镜像)
|
| | | BYTE DayTimes; //每日免费次数, 0为不限制
|
| | | BYTE PayCntMax; //额外付费次数
|
| | | BYTE PayMoneyType; //消耗货币类型
|
| | | list PayMoneyValues; //消耗货币值列表
|
| | |
|
| | | };
|
| | |
|
| | | //副本功能线路表
|
| | |
| | | {
|
| | | DWORD _DataMapID; //数据地图ID
|
| | | BYTE _LineID; //功能线路ID
|
| | | DWORD MapID; //场景地图ID
|
| | | WORD LVLimitMin; //最低等级限制, 0为不限制
|
| | | WORD LVLimitMax; //最高等级限制, 0为不限制
|
| | | DWORD TicketID; //门票ID
|
| | | list TicketCostCnt; //门票消耗数信息
|
| | | WORD TicketPrice; //门票单价(不能用钱抵的配0)
|
| | | WORD SweepLVLimit; //扫荡等级限制, 0为不限制
|
| | | DWORD SweepItemID; //扫荡所需道具ID
|
| | | BYTE SweepCostCnt; //扫荡所需道具个数
|
| | | eval EnterPosInfo; //进入坐标信息
|
| | | eval StepTime; //阶段时间
|
| | | eval RefreshNPC; //标试点刷怪配置
|
| | | eval GradeInfo; //评级规则
|
| | | eval RewardInfo; //奖励信息
|
| | | list PassAwardList; //过关奖励
|
| | | list SweepAwardList; //扫荡奖励
|
| | | list LineupIDList; //阵容ID列表
|
| | | };
|
| | |
|
| | | //广告奖励表
|
| | |
|
| | | struct ADAward
|
| | | {
|
| | | DWORD _ADID;
|
| | | BYTE ADCntMax; //每日次数
|
| | | list ADAwardItemList; //广告奖励物品列表
|
| | | DWORD ADMapID; //对应副本ID,默认给该副本1次次数
|
| | | };
|
| | |
|
| | | //副本通用养成表
|
| | |
| | | PacketSubCMD_3=0x23
|
| | | PacketCallFunc_3=OnUseItems
|
| | |
|
| | | PacketCMD_4=0xA3
|
| | | PacketSubCMD_4=0x12
|
| | | PacketCallFunc_4=OnGuardPickupItem
|
| | | PacketCMD_4=
|
| | | PacketSubCMD_4=
|
| | | PacketCallFunc_4=
|
| | |
|
| | | PacketCMD_5=0xA3
|
| | | PacketSubCMD_5=0x07
|
| | |
| | | import TurnPassive
|
| | | import TurnSkill
|
| | | import TurnBuff
|
| | | import FBCommon
|
| | | import CommFunc
|
| | | import ObjPool
|
| | | import FBLogic
|
| | |
| | | GameWorld.DebugLog("回合制战斗请求: mapID=%s,funcLineID=%s,tagType=%s,tagID=%s,valueList=%s"
|
| | | % (mapID, funcLineID, tagType, tagID, valueList), curPlayer.GetPlayerID())
|
| | |
|
| | | fbIpyData = FBCommon.GetFBIpyData(mapID)
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, funcLineID, False)
|
| | | if fbIpyData:
|
| | | if not fbLineIpyData:
|
| | | GameWorld.DebugLog("不存在该副本功能线路! mapID=%s,funcLineID=%s" % (mapID, funcLineID))
|
| | | return
|
| | | if FBCommon.CheckCanEnterFBComm(curPlayer, mapID, funcLineID, fbIpyData, fbLineIpyData) != ShareDefine.EntFBAskRet_OK:
|
| | | return
|
| | | |
| | | reqRet = FBLogic.OnTurnFightRequest(curPlayer, mapID, funcLineID, tagType, tagID, valueList)
|
| | | if not reqRet:
|
| | | return
|
| | |
| | |
|
| | | # NPC
|
| | | else:
|
| | | npcLineupIDList, strongerLV, difficulty = [], 0, 0
|
| | | if fbLineIpyData:
|
| | | npcLineupIDList = fbLineIpyData.GetLineupIDList()
|
| | | |
| | | if not npcLineupIDList:
|
| | | ret = FBLogic.GetFBNPCLineupInfo(curPlayer, mapID, funcLineID)
|
| | | if not ret:
|
| | | return
|
| | |
| | | Def_FBMapID_MainBoss = 2 # 主线Boss
|
| | | Def_FBMapID_ArenaBattle = 3 # 演武场
|
| | |
|
| | | #创角新手村地图ID列表
|
| | | Def_CreatRoleMapIDList = [10000]
|
| | | #PK周赛
|
| | | Def_FBMapID_WeedPK = 12040
|
| | | #战盟副本-异界入侵、守卫人皇
|
| | | Def_FBMapID_FamilyInvade = 31170
|
| | | Def_FBMapID_Zhanchui = 30010 # 白骨盈野/战锤秘境
|
| | | Def_FBMapID_Tianzi = 30020 # 天子考验
|
| | |
|
| | | # 战盟boss副本
|
| | | Def_FBMapID_FamilyBossMap = 31210
|
| | | # 仙盟联赛
|
| | | Def_FBMapID_FamilyWar = 31220
|
| | |
|
| | | # 百战之地
|
| | | Def_FBMapID_BZZD = 31080
|
| | |
|
| | | #试炼之塔(符印塔)
|
| | | Def_FBMapID_TrialTower = 31130
|
| | |
|
| | | #除魔卫道
|
| | | Def_FBMapID_ClearDevil = 31040
|
| | | #新手副本
|
| | | #Def_FBMapID_ClearDevil2 = 31090
|
| | | #法宝副本
|
| | | Def_FBMapID_MagicWeapon = 41110
|
| | |
|
| | | #BOSS之家
|
| | | Def_FBMapID_BossHome = 31270 #31020地图ID修改,不使用副本类型
|
| | |
|
| | | #古神禁地
|
| | | Def_FBMapID_GodArea = 31150
|
| | |
|
| | | #冰晶矿脉
|
| | | Def_FBMapID_IceLode = 31140
|
| | |
|
| | | #渡劫副本
|
| | | Def_FBMapID_DuJie = 31110
|
| | |
|
| | | #麒麟之府
|
| | | Def_FBMapID_KirinHome = 311900
|
| | |
|
| | | #个人BOSS
|
| | | Def_FBMapID_PersonalBoss = 31240
|
| | |
|
| | | #仙盟宴会
|
| | | Def_FBMapID_FamilyParty = 31230
|
| | |
|
| | | #宗门试炼
|
| | | Def_FBMapID_MunekadoTrial = 60010
|
| | |
|
| | | #混乱妖域
|
| | | Def_FBMapID_ChaosDemon = 31180
|
| | |
|
| | | #讨伐妖魔
|
| | | Def_FBMapID_KillDevil = 31280
|
| | |
|
| | | #娲皇遗迹
|
| | | Def_FBMapID_QueenRelics = 51010
|
| | |
|
| | | #上古战场
|
| | | Def_FBMapID_ElderBattlefield = 31160
|
| | |
|
| | | #守护副本
|
| | | Def_FBMapID_Guard = 31250
|
| | |
|
| | | #封魔坛
|
| | | Def_FBMapID_SealDemon = 52010
|
| | | #单人封魔坛
|
| | | Def_FBMapID_SealDemonEx = 52020
|
| | | #诛仙BOSS/雷罚BOSS
|
| | | Def_FBMapID_ZhuXianBoss = 31380
|
| | | #天星塔/丹塔
|
| | | Def_FBMapID_SkyTower = 31370
|
| | | #境界塔
|
| | | Def_FBMapID_RealmTower = 31310
|
| | | #仙魔之争
|
| | | Def_FBMapID_XMZZ = 31010
|
| | | #神兽副本
|
| | | Def_FBMapID_Dogz = 21110
|
| | | #聚魂副本
|
| | | Def_FBMapID_GatherSoul = 31340
|
| | | #跨服竞技场
|
| | | Def_FBMapID_CrossRealmPK = 32010
|
| | | #跨服排位
|
| | | Def_FBMapID_CrossChampionship = 32070
|
| | | #跨服蓬莱仙境
|
| | | Def_FBMapID_CrossPenglai = 32020
|
| | | #跨服魔化之地
|
| | | Def_FBMapID_CrossDemonLand = 32080
|
| | | #跨服妖王
|
| | | Def_FBMapID_CrossDemonKing = 32030
|
| | | #本服妖王
|
| | | Def_FBMapID_DemonKing = 22030
|
| | | #多仙盟Boss
|
| | | Def_FBMapID_AllFamilyBoss = 31260
|
| | | #骑宠Boss
|
| | | Def_FBMapID_HorsePetBoss = 31200
|
| | | #缥缈宝藏
|
| | | Def_FBMapID_FairyTreasure = 31190
|
| | | #跨服灵草园
|
| | | Def_FBMapID_CrossGrasslandLing = 32040
|
| | | #跨服仙草园
|
| | | Def_FBMapID_CrossGrasslandXian = 32050
|
| | | #跨服战场
|
| | | Def_FBMapID_CrossBattlefield = 32060
|
| | | #跨服仙盟夺旗战/逐鹿万界
|
| | | Def_FBMapID_CrossFamilyFlagwar = 32090
|
| | | #情缘副本
|
| | | Def_FBMapID_Love = 31300
|
| | | #镜像切磋
|
| | | Def_FBMapID_MirrorBattle = 100
|
| | |
|
| | | #镜像PK的地图ID列表
|
| | | MirrorBattleMapIDList = []
|
| | | #线路未过关时免费的地图
|
| | | UnPassFreeMapIDList = [Def_FBMapID_ArenaBattle]
|
| | | #按星级记录过关的地图
|
| | | PassByStarMapIDList = []
|
| | |
|
| | | #注册上传跨服服务器数据后直接进入跨服服务器的地图
|
| | | RegisterEnter_CrossServerMapIDList = [Def_FBMapID_CrossPenglai, Def_FBMapID_CrossDemonLand, Def_FBMapID_CrossDemonKing, |
| | | Def_FBMapID_CrossGrasslandLing, Def_FBMapID_CrossGrasslandXian, Def_FBMapID_CrossBattlefield,
|
| | | Def_FBMapID_CrossChampionship, Def_FBMapID_CrossFamilyFlagwar,
|
| | | ]
|
| | | RegisterEnter_CrossServerMapIDList = []
|
| | | #跨服地图
|
| | | Def_CrossMapIDList = RegisterEnter_CrossServerMapIDList + [Def_FBMapID_CrossRealmPK]
|
| | | Def_CrossMapIDList = RegisterEnter_CrossServerMapIDList + []
|
| | | #跨服分区类型配置, 没配置的默认 CrossZoneComm
|
| | | Def_CrossZoneTypeName = {0:"CrossZoneComm", # 特殊0,默认常规分区
|
| | | Def_FBMapID_CrossPenglai:"CrossZoneComm",
|
| | | Def_FBMapID_CrossDemonLand:"CrossZoneComm",
|
| | | Def_FBMapID_CrossRealmPK:"CrossZonePK",
|
| | | Def_FBMapID_CrossDemonKing:"CrossZonePK",
|
| | | Def_FBMapID_CrossGrasslandLing:"CrossZonePK",
|
| | | Def_FBMapID_CrossGrasslandXian:"CrossZonePK",
|
| | | Def_FBMapID_CrossBattlefield:"CrossZoneBattlefield",
|
| | | Def_FBMapID_CrossChampionship:"CrossZonePK",
|
| | | Def_FBMapID_CrossFamilyFlagwar:"CrossZoneComm",
|
| | | # Def_FBMapID_CrossPenglai:"CrossZoneComm",
|
| | | # Def_FBMapID_CrossDemonLand:"CrossZoneComm",
|
| | | # Def_FBMapID_CrossDemonKing:"CrossZonePK",
|
| | | # Def_FBMapID_CrossGrasslandLing:"CrossZonePK",
|
| | | # Def_FBMapID_CrossGrasslandXian:"CrossZonePK",
|
| | | # Def_FBMapID_CrossBattlefield:"CrossZoneBattlefield",
|
| | | # Def_FBMapID_CrossChampionship:"CrossZonePK",
|
| | | # Def_FBMapID_CrossFamilyFlagwar:"CrossZoneComm",
|
| | | }
|
| | | #跨服分区对应地图配置表名 - 仅适用于固定地图及虚拟分线的跨服玩法
|
| | | Def_CrossZoneMapTableName = {Def_FBMapID_CrossPenglai:"CrossPenglaiZoneMap",
|
| | | Def_FBMapID_CrossDemonLand:"CrossDemonLandZoneMap",
|
| | | Def_FBMapID_CrossFamilyFlagwar:"CrossFamilyFlagwarZoneMap",
|
| | | Def_CrossZoneMapTableName = {
|
| | | #Def_FBMapID_CrossPenglai:"CrossPenglaiZoneMap",
|
| | | #Def_FBMapID_CrossDemonLand:"CrossDemonLandZoneMap",
|
| | | #Def_FBMapID_CrossFamilyFlagwar:"CrossFamilyFlagwarZoneMap",
|
| | | }
|
| | | #需要动态分配线路的跨服地图
|
| | | Def_CrossDynamicLineMap = [Def_FBMapID_CrossDemonKing, Def_FBMapID_CrossGrasslandLing, Def_FBMapID_CrossGrasslandXian, Def_FBMapID_CrossBattlefield, Def_FBMapID_CrossChampionship]
|
| | | Def_CrossDynamicLineMap = []
|
| | |
|
| | | #副本关闭时未拾取的物品邮件发放给玩家
|
| | | #这里只有需要的副本才配置,不做默认逻辑,防止某些副本实际不能给导致刷物品,如麒麟之府
|
| | | Def_SendUnPickItemMailMapIDList = [Def_FBMapID_IceLode, Def_FBMapID_PersonalBoss, Def_FBMapID_MunekadoTrial, |
| | | Def_FBMapID_SealDemon, Def_FBMapID_SealDemonEx, Def_FBMapID_ZhuXianBoss, |
| | | Def_FBMapID_DemonKing, Def_FBMapID_CrossDemonKing, Def_FBMapID_KillDevil]
|
| | | Def_SendUnPickItemMailMapIDList = []
|
| | |
|
| | | #金钱不掉物品直接给玩家的地图
|
| | | Def_GiveMoneyMapIDList = []
|
| | |
| | | # 副本中玩家下线就被踢出
|
| | | Def_DisconnectExit_FBID = []
|
| | | #会有阵营的地图
|
| | | Def_MapID_NeedCamp = [Def_FBMapID_FamilyWar, Def_FBMapID_GatherSoul, Def_FBMapID_CrossBattlefield] + MirrorBattleMapIDList
|
| | | Def_MapID_NeedCamp = []
|
| | |
|
| | | # 进入副本需要根据请求lineID动态分配虚拟分线属性的地图
|
| | | Def_MapID_LineIDToPropertyID = [Def_FBMapID_ElderBattlefield]
|
| | | |
| | | # 进入副本需要发送到GameServer的地图
|
| | | Def_MapID_SendToGameServer = [Def_FBMapID_HorsePetBoss, Def_FBMapID_FamilyInvade, Def_FBMapID_SealDemon, Def_FBMapID_DemonKing,
|
| | | Def_FBMapID_FamilyWar, Def_FBMapID_ZhuXianBoss, Def_FBMapID_AllFamilyBoss] + \
|
| | | Def_MapID_LineIDToPropertyID + [Def_FBMapID_CrossChampionship] + MirrorBattleMapIDList
|
| | | |
| | | # 刷新标识点在无玩家的情况下也需要刷新的地图
|
| | | Def_NoPlayerNeedProcessRefreshPointMap = [Def_FBMapID_HorsePetBoss, Def_FBMapID_SealDemon, Def_FBMapID_GodArea, Def_FBMapID_BossHome, Def_FBMapID_GatherSoul, Def_FBMapID_ZhuXianBoss, Def_FBMapID_AllFamilyBoss]
|
| | |
|
| | | # 可重复进的副本
|
| | | Def_NoLimitEnterCntMap = [Def_FBMapID_AllFamilyBoss, Def_FBMapID_FamilyParty, Def_FBMapID_FamilyWar, Def_FBMapID_FamilyInvade, Def_FBMapID_ElderBattlefield, Def_FBMapID_SealDemon]
|
| | | Def_MapID_LineIDToPropertyID = []
|
| | |
|
| | | # 无玩家时不自动关闭的自伸缩副本
|
| | | Def_NoPlayerNotCloseAutoSizeMap = [Def_FBMapID_FamilyInvade, Def_FBMapID_GatherSoul]
|
| | | Def_NoPlayerNotCloseAutoSizeMap = []
|
| | | # 无玩家时自动关闭的非自伸缩副本
|
| | | Def_NoPlayerCloseNotAutoSizeMap = [Def_FBMapID_ZhuXianBoss]
|
| | |
|
| | | # 不可切换PK模式的地图
|
| | | Def_CanNotChangeAtkModelMap = []
|
| | | Def_NoPlayerCloseNotAutoSizeMap = []
|
| | |
|
| | | # 从副本退出时,可以返回进入前的副本ID
|
| | | Def_CanBackFBMap = []
|
| | |
| | | 'MainLevel':[Def_FBMapID_Main], # 主线关卡
|
| | | 'MainLevelBoss':[Def_FBMapID_MainBoss], # 主线关卡boss
|
| | | 'Arena':[Def_FBMapID_ArenaBattle],
|
| | | 'Zhanchui':[Def_FBMapID_Zhanchui],
|
| | | 'Tianzi':[Def_FBMapID_Tianzi],
|
| | | }
|
| | |
|
| | | #特殊副本ID, 由系统分配, 进入时候不验证IsMapCopyFull
|
| | |
| | | Def_Player_Dict_TeamFBPlayerCnt = "TeamFBPlayerCnt" # 请求进入的组队副本玩家个数, 临时用,进入副本设置完后删除
|
| | | Def_Player_Dict_ReqFBMissionID = "ReqFBMissionID" # 请求进入副本的任务ID
|
| | | Def_Player_Dict_ReqFBMissionType = "ReqFBMissionType" # 请求进入副本的任务类型
|
| | | Def_Player_Dict_PlayerFBStar_MapId = "FBStar_%s_%s" # 副本星级星级信息, 参数为[mapID, key编号], 按位存储每个lineID对应的星级
|
| | | Def_Player_Dict_FBStar = "FBStar_%s_%s" # 副本星级星级信息, 参数为[mapID, key编号], 按位存储每个lineID对应的星级
|
| | | Def_Player_Dict_FBPassLineID = "FBPassLineID_%s" # 副本已过关到的lineID, 参数为副本ID
|
| | | Def_Player_Dict_EnterFbCntTotal = "EnterFbCntTotal_%s" # 进入副本总累计次数, 参数为副本ID
|
| | | Def_Player_Dict_EnterFbCntDay = "EnterFbCntDay_%s" # 今日进入副本次数, 参数为副本ID
|
| | | Def_Player_Dict_BuyFbCntDay = "BuyFbCntDay_%s" # 今日购买副本进入次数, 参数为副本ID
|
| | | Def_Player_Dict_ItemAddFbCnt = "ItemAddFbCnt_%s" # 使用物品增加的副本次数, 参数为副本ID
|
| | | Def_Player_Dict_EnterFbCntWeek = "EnterFbCntWeek_%s" # 本周进入副本次数, 参数为副本ID
|
| | | Def_Player_Dict_FBHistoryMaxLine = "FBHistoryMaxLine_%s" # 副本历史最高通关, 参数为副本ID
|
| | | Def_Player_Dict_IceLoadLineID = "IceLoadLineID_%s" # 副本星级星级信息, 参数为[key编号], 按位存储每个lineID是否选中
|
| | | Def_Player_Dict_RefurbishGoodBookPlayerLv = "RefurbishGoodBookPlayerLv_97" # 刷新天书任务时的玩家等级
|
| | | Def_Player_Dict_FbEnterCnt = "FbEnterCnt_%s" # 今日进入副本次数(获得奖励次数), 参数为副本ID
|
| | | Def_Player_Dict_FBBuyCnt = "FBBuyCnt_%s" # 今日购买副本进入次数, 参数为副本ID
|
| | | Def_Player_Dict_FBItemCnt = "FBItemCnt_%s" # 今日使用物品增加的副本次数, 参数为副本ID
|
| | | Def_Player_Dict_FBADCnt = "FBADCnt_%s" # 今日已通过广告获得的次数, 参数为副本ID
|
| | | Def_Player_Dict_GameFuncFirstTouch = "GameFuncFirstTouch_%s" # 服务端功能首次触发开启状态; 参数, key编号
|
| | | Def_Player_Dict_GameFuncAwardState = "GameFuncAwardState_%s" # 服务端功能开启领奖状态; 参数, key编号
|
| | | Def_Player_Dict_MissionFinish = "MissionFinish_%s" # 任务是否完成; 参数, 任务ID, 只会记录部分需要记录的任务ID
|
| | |
| | | Def_PDict_GoodGameAwardState = "GoodGameAwardState" # 游戏好评领奖记录
|
| | | Def_PDict_LikeGameAwardState = "LikeGameAwardState" # 游戏点赞领奖记录
|
| | | Def_PDict_RechargeDayAward = "RechargeDayAward" # 累充每日奖励
|
| | | Def_PDict_ADCnt = "ADCnt_%s" # 今日已领取广告奖励次数,参数(广告ID)
|
| | | Def_PDict_EquipViewCacheState = "EquipViewCacheState" # 本次上线是否同步过装备缓存
|
| | | Def_PDict_PackDataSyncState = "PackDataSyncState" # 本次上线打包数据同步状态,按位存储是否同步 0-本服,1-跨服
|
| | | Def_PDict_PackDataSyncFightPower = "PackDataSyncFightPower" # 本次上线打包数据同步时的战力,用于对比,只对比求余亿部分即可
|
| | |
| | | FuncNoLinearAttrDict = {}
|
| | |
|
| | | # 指定地图生效的非线性属性配置
|
| | | MapAttrInfoDict_Noline = {
|
| | | Def_FBMapID_FamilyWar:{
|
| | | TYPE_Calc_FamilyWarAtkPer:[TYPE_Calc_AttrATKMin, TYPE_Calc_AttrATKMax],
|
| | | TYPE_Calc_FamilyWarHPPer:[TYPE_Calc_AttrMaxHP],
|
| | | }
|
| | | }
|
| | | MapAttrInfoDict_Noline = {}
|
| | |
|
| | | #属性线性索引
|
| | | CalcAttrIndexList = (
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 12 守护拾取物品 #tagCMGuardPickupItem
|
| | |
|
| | | class tagCMGuardPickupItem(Structure):
|
| | | Head = tagHead()
|
| | | ItemCount = 0 #(WORD ItemCount)
|
| | | MapItemID = list() #(vector<WORD> MapItemID)//size = ItemCount
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0x12
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ItemCount,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.ItemCount):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.MapItemID.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0x12
|
| | | self.ItemCount = 0
|
| | | self.MapItemID = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 2
|
| | | length += 2 * self.ItemCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.ItemCount)
|
| | | for i in range(self.ItemCount):
|
| | | data = CommFunc.WriteWORD(data, self.MapItemID[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ItemCount:%d,
|
| | | MapItemID:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ItemCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagCMGuardPickupItem=tagCMGuardPickupItem()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagCMGuardPickupItem.Head.Cmd,m_NAtagCMGuardPickupItem.Head.SubCmd))] = m_NAtagCMGuardPickupItem
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 13 物品拆解 #tagCMItemDecompound
|
| | |
|
| | | class tagCMItemDecompound(Structure):
|
| | |
| | | ("MapID", c_int),
|
| | | ("LineID", c_ushort),
|
| | | ("Cnt", c_ubyte), # 扫荡次数
|
| | | ("IsFinish", c_ubyte), # 是否立即完成; 0-否;1-花钱立即完成;2-客户端自行倒计时间到后发送2代表领取扫荡完成奖励
|
| | | ("DataEx", c_int), #附带信息
|
| | | ("IsLittleHelper", c_ubyte), # 是否小助手扫荡
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | |
| | | self.MapID = 0
|
| | | self.LineID = 0
|
| | | self.Cnt = 0
|
| | | self.IsFinish = 0
|
| | | self.DataEx = 0
|
| | | self.IsLittleHelper = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | |
| | | MapID:%d,
|
| | | LineID:%d,
|
| | | Cnt:%d,
|
| | | IsFinish:%d,
|
| | | DataEx:%d,
|
| | | IsLittleHelper:%d
|
| | | DataEx:%d
|
| | | '''\
|
| | | %(
|
| | | self.Cmd,
|
| | |
| | | self.MapID,
|
| | | self.LineID,
|
| | | self.Cnt,
|
| | | self.IsFinish,
|
| | | self.DataEx,
|
| | | self.IsLittleHelper
|
| | | self.DataEx
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 BD 通知玩家购买副本进入次数 #tagMCBuyEnterInfo
|
| | |
|
| | | class tagMCBuyInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("FBID", c_int), # 副本ID
|
| | | ("BuyCount", c_ubyte), # 已购买次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.FBID = 0
|
| | | self.BuyCount = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagMCBuyInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A3 BD 通知玩家购买副本进入次数 //tagMCBuyEnterInfo:
|
| | | FBID:%d,
|
| | | BuyCount:%d
|
| | | '''\
|
| | | %(
|
| | | self.FBID,
|
| | | self.BuyCount
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCBuyEnterInfo(Structure):
|
| | | Head = tagHead()
|
| | | FBCount = 0 #(BYTE FBCount)// 副本个数
|
| | | FBInfo = list() #(vector<tagMCBuyInfo> FBInfo)// 副本信息
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xBD
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.FBCount,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.FBCount):
|
| | | temFBInfo = tagMCBuyInfo()
|
| | | _pos = temFBInfo.ReadData(_lpData, _pos)
|
| | | self.FBInfo.append(temFBInfo)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0xBD
|
| | | self.FBCount = 0
|
| | | self.FBInfo = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.FBCount):
|
| | | length += self.FBInfo[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.FBCount)
|
| | | for i in range(self.FBCount):
|
| | | data = CommFunc.WriteString(data, self.FBInfo[i].GetLength(), self.FBInfo[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | FBCount:%d,
|
| | | FBInfo:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.FBCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCBuyEnterInfo=tagMCBuyEnterInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCBuyEnterInfo.Head.Cmd,m_NAtagMCBuyEnterInfo.Head.SubCmd))] = m_NAtagMCBuyEnterInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 B0 玩家购买魔魂铜钱经验额外奖励信息 #tagMCBuySomethingReward
|
| | |
|
| | | class tagMCBuySomethingReward(Structure):
|
| | |
| | |
|
| | | m_NAtagMCFaQiInfo=tagMCFaQiInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCFaQiInfo.Cmd,m_NAtagMCFaQiInfo.SubCmd))] = m_NAtagMCFaQiInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 20 玩家副本相关信息 #tagSCFBInfoList
|
| | |
|
| | | class tagSCFBInfo(Structure):
|
| | | MapID = 0 #(DWORD MapID)
|
| | | EnterCnt = 0 #(WORD EnterCnt)//今日累计进入次数
|
| | | ADAddCnt = 0 #(BYTE ADAddCnt)//广告增加次数
|
| | | BuyAddCnt = 0 #(BYTE BuyAddCnt)//购买增加次数
|
| | | ItemAddCnt = 0 #(WORD ItemAddCnt)//物品增加次数
|
| | | PassLineID = 0 #(DWORD PassLineID)//已过关到的lineID
|
| | | PassGradeCnt = 0 #(BYTE PassGradeCnt)//星级值对应个数, 每个key存9个lineID
|
| | | PassGrade = list() #(vector<DWORD> PassGrade)//副本线路对应星级值列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | self.MapID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.EnterCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.ADAddCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.BuyAddCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | self.ItemAddCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.PassLineID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.PassGradeCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.PassGradeCnt):
|
| | | value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
|
| | | self.PassGrade.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.MapID = 0
|
| | | self.EnterCnt = 0
|
| | | self.ADAddCnt = 0
|
| | | self.BuyAddCnt = 0
|
| | | self.ItemAddCnt = 0
|
| | | self.PassLineID = 0
|
| | | self.PassGradeCnt = 0
|
| | | self.PassGrade = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 4
|
| | | length += 2
|
| | | length += 1
|
| | | length += 1
|
| | | length += 2
|
| | | length += 4
|
| | | length += 1
|
| | | length += 4 * self.PassGradeCnt
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteDWORD(data, self.MapID)
|
| | | data = CommFunc.WriteWORD(data, self.EnterCnt)
|
| | | data = CommFunc.WriteBYTE(data, self.ADAddCnt)
|
| | | data = CommFunc.WriteBYTE(data, self.BuyAddCnt)
|
| | | data = CommFunc.WriteWORD(data, self.ItemAddCnt)
|
| | | data = CommFunc.WriteDWORD(data, self.PassLineID)
|
| | | data = CommFunc.WriteBYTE(data, self.PassGradeCnt)
|
| | | for i in range(self.PassGradeCnt):
|
| | | data = CommFunc.WriteDWORD(data, self.PassGrade[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | MapID:%d,
|
| | | EnterCnt:%d,
|
| | | ADAddCnt:%d,
|
| | | BuyAddCnt:%d,
|
| | | ItemAddCnt:%d,
|
| | | PassLineID:%d,
|
| | | PassGradeCnt:%d,
|
| | | PassGrade:%s
|
| | | '''\
|
| | | %(
|
| | | self.MapID,
|
| | | self.EnterCnt,
|
| | | self.ADAddCnt,
|
| | | self.BuyAddCnt,
|
| | | self.ItemAddCnt,
|
| | | self.PassLineID,
|
| | | self.PassGradeCnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagSCFBInfoList(Structure):
|
| | | Head = tagHead()
|
| | | FBDataCnt = 0 #(BYTE FBDataCnt)// 副本数据个数
|
| | | FBDataList = list() #(vector<tagSCFBInfo> FBDataList)// 副本数据列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0x20
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.FBDataCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.FBDataCnt):
|
| | | temFBDataList = tagSCFBInfo()
|
| | | _pos = temFBDataList.ReadData(_lpData, _pos)
|
| | | self.FBDataList.append(temFBDataList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0x20
|
| | | self.FBDataCnt = 0
|
| | | self.FBDataList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.FBDataCnt):
|
| | | length += self.FBDataList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.FBDataCnt)
|
| | | for i in range(self.FBDataCnt):
|
| | | data = CommFunc.WriteString(data, self.FBDataList[i].GetLength(), self.FBDataList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | FBDataCnt:%d,
|
| | | FBDataList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.FBDataCnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagSCFBInfoList=tagSCFBInfoList()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCFBInfoList.Head.Cmd,m_NAtagSCFBInfoList.Head.SubCmd))] = m_NAtagSCFBInfoList
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | | m_NAtagMCPackDownloadRecord=tagMCPackDownloadRecord()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPackDownloadRecord.Cmd,m_NAtagMCPackDownloadRecord.SubCmd))] = m_NAtagMCPackDownloadRecord
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A3 20 玩家副本相关信息 #tagMCPlayerFBInfoData
|
| | |
|
| | | class tagMCFBInfo(Structure):
|
| | | FBID = 0 #(DWORD FBID)//fbId
|
| | | EnterCnt = 0 #(WORD EnterCnt)//当日进入次数
|
| | | RecoverCnt = 0 #(WORD RecoverCnt)//找回次数
|
| | | ItemAddCnt = 0 #(WORD ItemAddCnt)//物品增加次数
|
| | | PassGradeCnt = 0 #(BYTE PassGradeCnt)//星级值对应个数, 每个key存9个lineID
|
| | | PassGrade = list() #(vector<DWORD> PassGrade)//副本线路对应星级值列表
|
| | | EnterCntTotal = 0 #(DWORD EnterCntTotal)//累计进入次数
|
| | | PassLineID = 0 #(DWORD PassLineID)//已过关到的lineID
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | self.FBID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.EnterCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.RecoverCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.ItemAddCnt,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | self.PassGradeCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.PassGradeCnt):
|
| | | value,_pos=CommFunc.ReadDWORD(_lpData,_pos)
|
| | | self.PassGrade.append(value)
|
| | | self.EnterCntTotal,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | self.PassLineID,_pos = CommFunc.ReadDWORD(_lpData, _pos)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.FBID = 0
|
| | | self.EnterCnt = 0
|
| | | self.RecoverCnt = 0
|
| | | self.ItemAddCnt = 0
|
| | | self.PassGradeCnt = 0
|
| | | self.PassGrade = list()
|
| | | self.EnterCntTotal = 0
|
| | | self.PassLineID = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += 4
|
| | | length += 2
|
| | | length += 2
|
| | | length += 2
|
| | | length += 1
|
| | | length += 4 * self.PassGradeCnt
|
| | | length += 4
|
| | | length += 4
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteDWORD(data, self.FBID)
|
| | | data = CommFunc.WriteWORD(data, self.EnterCnt)
|
| | | data = CommFunc.WriteWORD(data, self.RecoverCnt)
|
| | | data = CommFunc.WriteWORD(data, self.ItemAddCnt)
|
| | | data = CommFunc.WriteBYTE(data, self.PassGradeCnt)
|
| | | for i in range(self.PassGradeCnt):
|
| | | data = CommFunc.WriteDWORD(data, self.PassGrade[i])
|
| | | data = CommFunc.WriteDWORD(data, self.EnterCntTotal)
|
| | | data = CommFunc.WriteDWORD(data, self.PassLineID)
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | FBID:%d,
|
| | | EnterCnt:%d,
|
| | | RecoverCnt:%d,
|
| | | ItemAddCnt:%d,
|
| | | PassGradeCnt:%d,
|
| | | PassGrade:%s,
|
| | | EnterCntTotal:%d,
|
| | | PassLineID:%d
|
| | | '''\
|
| | | %(
|
| | | self.FBID,
|
| | | self.EnterCnt,
|
| | | self.RecoverCnt,
|
| | | self.ItemAddCnt,
|
| | | self.PassGradeCnt,
|
| | | "...",
|
| | | self.EnterCntTotal,
|
| | | self.PassLineID
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagMCPlayerFBInfoData(Structure):
|
| | | Head = tagHead()
|
| | | FBDataCnt = 0 #(BYTE FBDataCnt)// 副本数据个数
|
| | | FBDataList = list() #(vector<tagMCFBInfo> FBDataList)// 副本数据列表
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0x20
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.FBDataCnt,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.FBDataCnt):
|
| | | temFBDataList = tagMCFBInfo()
|
| | | _pos = temFBDataList.ReadData(_lpData, _pos)
|
| | | self.FBDataList.append(temFBDataList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA3
|
| | | self.Head.SubCmd = 0x20
|
| | | self.FBDataCnt = 0
|
| | | self.FBDataList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.FBDataCnt):
|
| | | length += self.FBDataList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.FBDataCnt)
|
| | | for i in range(self.FBDataCnt):
|
| | | data = CommFunc.WriteString(data, self.FBDataList[i].GetLength(), self.FBDataList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | FBDataCnt:%d,
|
| | | FBDataList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.FBDataCnt,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCPlayerFBInfoData=tagMCPlayerFBInfoData()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCPlayerFBInfoData.Head.Cmd,m_NAtagMCPlayerFBInfoData.Head.SubCmd))] = m_NAtagMCPlayerFBInfoData
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 22 广告信息列表 #tagSCADInfoList
|
| | |
|
| | | class tagSCADInfo(Structure):
|
| | | _pack_ = 1
|
| | | _fields_ = [
|
| | | ("ADID", c_ushort), #广告ID
|
| | | ("ADCnt", c_ubyte), #今日已领取广告奖励次数
|
| | | ]
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | return
|
| | |
|
| | | def ReadData(self, stringData, _pos=0, _len=0):
|
| | | self.Clear()
|
| | | memmove(addressof(self), stringData[_pos:], self.GetLength())
|
| | | return _pos + self.GetLength()
|
| | |
|
| | | def Clear(self):
|
| | | self.ADID = 0
|
| | | self.ADCnt = 0
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | return sizeof(tagSCADInfo)
|
| | |
|
| | | def GetBuffer(self):
|
| | | return string_at(addressof(self), self.GetLength())
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''// A7 22 广告信息列表 //tagSCADInfoList:
|
| | | ADID:%d,
|
| | | ADCnt:%d
|
| | | '''\
|
| | | %(
|
| | | self.ADID,
|
| | | self.ADCnt
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | class tagSCADInfoList(Structure):
|
| | | Head = tagHead()
|
| | | Count = 0 #(BYTE Count)
|
| | | ADInfoList = list() #(vector<tagSCADInfo> ADInfoList)
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x22
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.Count,_pos = CommFunc.ReadBYTE(_lpData, _pos)
|
| | | for i in range(self.Count):
|
| | | temADInfoList = tagSCADInfo()
|
| | | _pos = temADInfoList.ReadData(_lpData, _pos)
|
| | | self.ADInfoList.append(temADInfoList)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA7
|
| | | self.Head.SubCmd = 0x22
|
| | | self.Count = 0
|
| | | self.ADInfoList = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 1
|
| | | for i in range(self.Count):
|
| | | length += self.ADInfoList[i].GetLength()
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteBYTE(data, self.Count)
|
| | | for i in range(self.Count):
|
| | | data = CommFunc.WriteString(data, self.ADInfoList[i].GetLength(), self.ADInfoList[i].GetBuffer())
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | Count:%d,
|
| | | ADInfoList:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.Count,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagSCADInfoList=tagSCADInfoList()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagSCADInfoList.Head.Cmd,m_NAtagSCADInfoList.Head.SubCmd))] = m_NAtagSCADInfoList
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A7 04 通知世界Boss伤血列表 #tagMCBossHurtList
|
| | |
|
| | | class tagMCHurtPlayer(Structure):
|
| | |
| | |
|
| | | m_NAtagMCGiveAwardInfo=tagMCGiveAwardInfo()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGiveAwardInfo.Head.Cmd,m_NAtagMCGiveAwardInfo.Head.SubCmd))] = m_NAtagMCGiveAwardInfo
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | | # A8 12 守护成功拾取物品 #tagMCGuradPickupItemSucc
|
| | |
|
| | | class tagMCGuradPickupItemSucc(Structure):
|
| | | Head = tagHead()
|
| | | ItemCount = 0 #(WORD ItemCount)
|
| | | MapItemID = list() #(vector<WORD> MapItemID)//size = ItemCount
|
| | | data = None
|
| | |
|
| | | def __init__(self):
|
| | | self.Clear()
|
| | | self.Head.Cmd = 0xA8
|
| | | self.Head.SubCmd = 0x12
|
| | | return
|
| | |
|
| | | def ReadData(self, _lpData, _pos=0, _Len=0):
|
| | | self.Clear()
|
| | | _pos = self.Head.ReadData(_lpData, _pos)
|
| | | self.ItemCount,_pos = CommFunc.ReadWORD(_lpData, _pos)
|
| | | for i in range(self.ItemCount):
|
| | | value,_pos=CommFunc.ReadWORD(_lpData,_pos)
|
| | | self.MapItemID.append(value)
|
| | | return _pos
|
| | |
|
| | | def Clear(self):
|
| | | self.Head = tagHead()
|
| | | self.Head.Clear()
|
| | | self.Head.Cmd = 0xA8
|
| | | self.Head.SubCmd = 0x12
|
| | | self.ItemCount = 0
|
| | | self.MapItemID = list()
|
| | | return
|
| | |
|
| | | def GetLength(self):
|
| | | length = 0
|
| | | length += self.Head.GetLength()
|
| | | length += 2
|
| | | length += 2 * self.ItemCount
|
| | |
|
| | | return length
|
| | |
|
| | | def GetBuffer(self):
|
| | | data = ''
|
| | | data = CommFunc.WriteString(data, self.Head.GetLength(), self.Head.GetBuffer())
|
| | | data = CommFunc.WriteWORD(data, self.ItemCount)
|
| | | for i in range(self.ItemCount):
|
| | | data = CommFunc.WriteWORD(data, self.MapItemID[i])
|
| | | return data
|
| | |
|
| | | def OutputString(self):
|
| | | DumpString = '''
|
| | | Head:%s,
|
| | | ItemCount:%d,
|
| | | MapItemID:%s
|
| | | '''\
|
| | | %(
|
| | | self.Head.OutputString(),
|
| | | self.ItemCount,
|
| | | "..."
|
| | | )
|
| | | return DumpString
|
| | |
|
| | |
|
| | | m_NAtagMCGuradPickupItemSucc=tagMCGuradPickupItemSucc()
|
| | | ChNetPackDict[eval("0x%02x%02x"%(m_NAtagMCGuradPickupItemSucc.Head.Cmd,m_NAtagMCGuradPickupItemSucc.Head.SubCmd))] = m_NAtagMCGuradPickupItemSucc
|
| | |
|
| | |
|
| | | #------------------------------------------------------
|
| | |
| | | # if mapID not in allMapIDList:
|
| | | # GameWorld.DebugAnswer(curPlayer, "该地图ID不可设置!")
|
| | | # return
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, star, False, [mapID])
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_FBStar, lineID, star, False, [mapID])
|
| | | elif len(paramList) == 1:
|
| | | mapID = paramList[0]
|
| | | for keyNum in range(ChConfig.Def_FBStar_MaxKeyCnt):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId % (mapID, keyNum), 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBStar % (mapID, keyNum), 0)
|
| | | else:
|
| | | #GameWorld.DebugAnswer(curPlayer, "重置所有副本星级: SetFBStar 0")
|
| | | GameWorld.DebugAnswer(curPlayer, "设置指定副本lineID星级: SetFBStar 副本ID lineID 星级")
|
| | |
| | | playerZoneID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBZoneID)
|
| | | playerFuncLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ReqCrossFBFuncLine)
|
| | | # 跨服排位分区与玩家分区可能不一样
|
| | | if (fbZoneID != playerZoneID or fbFuncLineID != playerFuncLineID) and mapID not in [ChConfig.Def_FBMapID_CrossChampionship]:
|
| | | if (fbZoneID != playerZoneID or fbFuncLineID != playerFuncLineID) and mapID not in []:
|
| | | GameWorld.ErrLog("DoEnterFB 玩家与当前副本线路所属分区或功能分线不同,踢出玩家!fbZoneID=%s,playerZoneID=%s,fbFuncLineID=%s,playerFuncLineID=%s"
|
| | | % (fbZoneID, playerZoneID, fbFuncLineID, playerFuncLineID), curPlayerID)
|
| | | CrossRealmPlayer.PlayerExitCrossServer(curPlayer)
|
| | |
| | | for key, mapIDList in ChConfig.Def_FB_MapID.items():
|
| | | if not mapIDList:
|
| | | continue
|
| | | mapID = mapIDList[0]
|
| | | ipyData = FBCommon.GetFBIpyData(mapID)
|
| | | if ipyData and ipyData.GetDayResetType():
|
| | | if onDayType != ipyData.GetDayResetType():
|
| | | continue
|
| | | elif onDayType != ShareDefine.Def_OnEventTypeEx:
|
| | | continue
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (key, "OnFBPlayerOnDay"))
|
| | | if callFunc:
|
| | | callFunc(curPlayer)
|
| | |
| | | return callFunc(curPlayer, addExp, expViewType)
|
| | |
|
| | | ## 副本扫荡询问
|
| | | def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, cnt, isFinish, dataEx):
|
| | | def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, cnt, dataEx):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnPlayerFBSweepAsk"))
|
| | |
|
| | | # 没有额外条件判断默认返回True
|
| | | if callFunc == None:
|
| | | return True
|
| | | return
|
| | |
|
| | | return callFunc(curPlayer, mapID, lineID, cnt, isFinish, dataEx)
|
| | | return callFunc(curPlayer, mapID, lineID, cnt, dataEx)
|
| | |
|
| | | ## 副本扫荡结果
|
| | | def OnPlayerFBSweepResult(curPlayer, mapID, lineID, cnt, isFinish, dataEx):
|
| | | def OnPlayerFBSweepResult(curPlayer, mapID, lineID, cnt, dataEx):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnPlayerFBSweepResult"))
|
| | |
| | | if callFunc == None:
|
| | | return False
|
| | |
|
| | | return callFunc(curPlayer, mapID, lineID, cnt, isFinish, dataEx)
|
| | | return callFunc(curPlayer, mapID, lineID, cnt, dataEx)
|
| | |
|
| | | ## 开始公共CD副本扫荡
|
| | | def OnStartPubCDFBSweep(curPlayer, mapID, lineID, cnt, dataEx):
|
| | |
| | | if callFunc == None:
|
| | | return
|
| | | return callFunc()
|
| | |
|
| | | ## 是否需要做进入副本通用检查条件逻辑,默认需要检查
|
| | | def OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | | |
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnNeedCheckCanEnterFBComm"))
|
| | | |
| | | if callFunc == None:
|
| | | return True
|
| | | |
| | | return callFunc(curPlayer, mapID, lineID)
|
| | |
|
| | | def OnTurnFightRequest(curPlayer, mapID, funcLineID, tagType, tagID, valueList):
|
| | | ## 回合战斗请求 - 地图验证
|
| | |
| | | import IPY_GameWorld
|
| | | import PlayerControl
|
| | | import ItemCommon
|
| | | import GameMap
|
| | | import NPCCommon
|
| | | import ReadChConfig
|
| | | import BuffSkill
|
| | | import ChPyNetSendPack
|
| | | import NetPackCommon
|
| | | import SkillCommon
|
| | | import IpyGameDataPY
|
| | | import PlayerFB
|
| | | import ShareDefine
|
| | | import EventReport
|
| | | import PlayerFamily
|
| | | import PlayerActivity
|
| | | import ItemControler
|
| | | import PlayerSuccess
|
| | | import GameFuncComm
|
| | | import PyGameData
|
| | | import GameObj
|
| | | import FBLogic
|
| | | import ChConfig
|
| | | import PlayerGoldInvest
|
| | | import ObjPool
|
| | |
|
| | | import datetime
|
| | | import random
|
| | | import json
|
| | | import math
|
| | | import time
|
| | | import copy
|
| | | #---------------------------------------------------------------------
|
| | | #全局变量
|
| | | Def_VSFB_CanEnter = 'VSFB_CanEnter' #可以进入
|
| | |
| | |
|
| | | def GetFBLineEnterPosInfo(mapID, lineID, fbLineIpyData=None):
|
| | | # 坐标信息
|
| | | return [10,10]
|
| | | def GetPassAwardList(mapID, lineID):
|
| | | # 过关奖励
|
| | | fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | return [] if not fbLineIpyData else fbLineIpyData.GetPassAwardList()
|
| | | def GetSweepAwardList(mapID, lineID, sweepCnt):
|
| | | # 扫荡奖励
|
| | | fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | if not fbLineIpyData:
|
| | | fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | return None if not fbLineIpyData else fbLineIpyData.GetEnterPosInfo()
|
| | | def GetFBLineStepTime(mapID, lineID=0):
|
| | | # 阶段时间信息
|
| | | fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | return None if not fbLineIpyData else fbLineIpyData.GetStepTime()
|
| | | def GetFBLineRefreshNPC(mapID, lineID=0): |
| | | # 刷怪信息
|
| | | fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | return None if not fbLineIpyData else fbLineIpyData.GetRefreshNPC()
|
| | | def GetFBLineGrade(mapID, lineID=0):
|
| | | # 评级规则信息
|
| | | fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | return None if not fbLineIpyData else fbLineIpyData.GetGradeInfo()
|
| | | def GetFBLineReward(mapID, lineID):
|
| | | # 奖励信息;支持扫荡取奖励
|
| | | fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | return None if not fbLineIpyData else fbLineIpyData.GetRewardInfo()
|
| | | return []
|
| | | awardItemList = fbLineIpyData.GetSweepAwardList()
|
| | | if not awardItemList:
|
| | | awardItemList = fbLineIpyData.GetPassAwardList()
|
| | |
|
| | | def GetFBGradeRewardRateList(mapID):
|
| | | fbIpyData = GetFBIpyData(mapID)
|
| | | return [] if not fbIpyData else fbIpyData.GetRewardRate()
|
| | | sweepItemList = []
|
| | | for itemInfo in awardItemList:
|
| | | itemID, itemCount = itemInfo[:2]
|
| | | sweepItemList.append([itemID, itemCount * sweepCnt])
|
| | | return sweepItemList
|
| | |
|
| | | def GetFBFuncOpenState(dataMapID):
|
| | | ## 获取副本开启状态 @return: 0-关闭;1-开启
|
| | |
| | |
|
| | | def IsFBPass(curPlayer, mapID, lineID):
|
| | | ## 副本线路是否已过关
|
| | | passLineID = 0
|
| | | if mapID == ChConfig.Def_FBMapID_Main:
|
| | | return PlayerControl.IsMainLevelPass(curPlayer, lineID)
|
| | |
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('FBGeneralTrain', mapID, lineID)
|
| | | if ipyData:
|
| | | passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
|
| | | else:
|
| | | grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False, [mapID])
|
| | | if mapID in ChConfig.PassByStarMapIDList:
|
| | | grade = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_FBStar, lineID, False, [mapID])
|
| | | if grade:
|
| | | return True
|
| | | |
| | | else:
|
| | | passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
|
| | | if passLineID >= lineID:
|
| | | return True
|
| | |
|
| | | return False
|
| | |
|
| | | def SetFBPass(curPlayer, mapID, funcLineID, isNotify=True):
|
| | | passLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
|
| | | if funcLineID > passLineID:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBPassLineID % mapID, funcLineID)
|
| | | if isNotify:
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapID)
|
| | | return
|
| | |
|
| | | def CheckCanEnterFBComm(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, reqEnterCnt=1, isNotify=True, isTeamAsk=False):
|
| | | # 可否进入副本通用检查, 扫荡通用
|
| | | playerID = curPlayer.GetPlayerID()
|
| | |
|
| | | if not FBLogic.OnNeedCheckCanEnterFBComm(curPlayer, mapID, lineID):
|
| | | return ShareDefine.EntFBAskRet_OK
|
| | | |
| | | # 总表通用检查
|
| | | if fbIpyData:
|
| | | #开服天开放检查
|
| | | if not GetFBFuncOpenState(mapID):
|
| | | GameWorld.Log("当前时间未开放该副本!mapID=%s" % (mapID), playerID)
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "FBIsNotOpen")
|
| | | return ShareDefine.EntFBAskRet_FBClose
|
| | | #if not GetFBFuncOpenState(mapID):
|
| | | # GameWorld.Log("当前时间未开放该副本!mapID=%s" % (mapID), playerID)
|
| | | # if isNotify:
|
| | | # PlayerControl.NotifyCode(curPlayer, "FBIsNotOpen")
|
| | | # return ShareDefine.EntFBAskRet_FBClose
|
| | |
|
| | | #进入次数判断
|
| | | canEnter, notifyMark = __CheckCanEnterFBByTime(curPlayer, mapID, lineID, fbIpyData, reqEnterCnt, isTeamAsk)
|
| | |
| | | #等级判断
|
| | | curLV = curPlayer.GetLV()
|
| | | lvLimitMin = fbLineIpyData.GetLVLimitMin()
|
| | | lvLimitMax = fbLineIpyData.GetLVLimitMax()
|
| | | if lvLimitMin and curLV < lvLimitMin:
|
| | | GameWorld.Log("玩家等级不足, 无法进入副本!mapID=%s,lineID=%s,curLV(%s) < lvLimitMin(%s)"
|
| | | % (mapID, lineID, curLV, lvLimitMin), playerID)
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "FbLV", [mapID])
|
| | | return ShareDefine.EntFBAskRet_LVLimit
|
| | | if lvLimitMax and curLV > lvLimitMax:
|
| | | GameWorld.Log("玩家等级超过, 无法进入副本!mapID=%s,lineID=%s,curLV(%s) > lvLimitMax(%s)" |
| | | % (mapID, lineID, curLV, lvLimitMax), playerID)
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "FbLV", [mapID])
|
| | | return ShareDefine.EntFBAskRet_LVLimit
|
| | |
|
| | | #门票判断
|
| | | if not GetFBEnterTicket(curPlayer, mapID, lineID, fbLineIpyData, reqEnterCnt, isTeamAsk)[0]:
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_157069", [mapID])
|
| | | return ShareDefine.EntFBAskRet_NoTicket
|
| | | #if not GetFBEnterTicket(curPlayer, mapID, lineID, fbLineIpyData, reqEnterCnt, isTeamAsk)[0]:
|
| | | # if isNotify:
|
| | | # PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_157069", [mapID])
|
| | | # return ShareDefine.EntFBAskRet_NoTicket
|
| | |
|
| | | return ShareDefine.EntFBAskRet_OK
|
| | |
|
| | |
| | | return True, ""
|
| | |
|
| | | #playerID = curPlayer.GetPlayerID()
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbEnterCnt % mapID)
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
|
| | | if enterCnt + reqEnterCnt <= maxCnt:
|
| | | return True, ""
|
| | |
|
| | | ### 以下是到达次数上限后的处理
|
| | | fbType = GameWorld.GetMap().GetMapFBTypeByMapID(mapID)
|
| | | |
| | | # 单人副本达到次数后不可再进入
|
| | | if fbType == IPY_GameWorld.fbtSingle:
|
| | | #GameWorld.Log("已达到当日最大进入次数!单人副本 mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | return False, "GeRen_chenxin_268121"
|
| | | |
| | | # 组队副本
|
| | | if fbType == IPY_GameWorld.fbtTeam:
|
| | | # 无助战的不可再进入
|
| | | if not fbIpyData.GetHelpPoint():
|
| | | #GameWorld.Log("已达到当日最大进入次数!组队副本 mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | return False, "GeRen_chenxin_268121"
|
| | | |
| | | # 可助战的不可单人进入助战,可发起匹配
|
| | | if not isTeamAsk and (not curPlayer.GetTeamID() or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TeamMemCount) <= 1):
|
| | | #GameWorld.Log("已达到当日最大进入次数!组队副本不可单人助战! mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | return False, "TeamSingleEnter"
|
| | | |
| | | elif mapID not in ChConfig.Def_NoLimitEnterCntMap:
|
| | | #GameWorld.Log("已达到当日最大进入次数! mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | return False, "GeRen_chenxin_268121"
|
| | | |
| | | # 周进入次数暂不做,待扩展...
|
| | | |
| | | if mapID in ChConfig.UnPassFreeMapIDList and not IsFBPass(curPlayer, mapID, lineID):
|
| | | return True, ""
|
| | | |
| | | # ### 以下是到达次数上限后的处理
|
| | | # fbType = GameWorld.GetMap().GetMapFBTypeByMapID(mapID)
|
| | | # |
| | | # # 单人副本达到次数后不可再进入
|
| | | # if fbType == IPY_GameWorld.fbtSingle:
|
| | | # #GameWorld.Log("已达到当日最大进入次数!单人副本 mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | # return False, "GeRen_chenxin_268121"
|
| | | # |
| | | # # 组队副本
|
| | | # if fbType == IPY_GameWorld.fbtTeam:
|
| | | # # 可助战的不可单人进入助战,可发起匹配
|
| | | # if not isTeamAsk and (not curPlayer.GetTeamID() or curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_TeamMemCount) <= 1):
|
| | | # #GameWorld.Log("已达到当日最大进入次数!组队副本不可单人助战! mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | # return False, "TeamSingleEnter"
|
| | | # |
| | | # if mapID not in ChConfig.Def_NoLimitEnterCntMap:
|
| | | # #GameWorld.Log("已达到当日最大进入次数! mapID=%s,enterCnt=%s,reqEnterCnt=%s,maxTimes=%s,maxCnt=%s" |
| | | # # % (mapID, enterCnt, reqEnterCnt, maxTimes, maxCnt), playerID)
|
| | | # return False, "GeRen_chenxin_268121"
|
| | | |
| | | GameWorld.DebugLog("可进入次数不足: mapID=%s, lineID=%s, enterCnt(%s) + reqEnterCnt(%s) <= maxCnt=%s" |
| | | % (mapID, lineID, enterCnt, reqEnterCnt, maxCnt))
|
| | | return False, "GeRen_chenxin_268121"
|
| | |
|
| | | ## 获取副本进入门票信息
|
| | | # @param curPlayer 玩家实例
|
| | |
| | | # @return [是否可进, [[门票索引列表, delCnt], ...], 删除个数, 是否有绑定, 扣钱信息]
|
| | | def GetFBEnterTicket(curPlayer, mapID, lineID=0, fbLineIpyData=None, reqEnterCnt=1, isTeamAsk=False):
|
| | | #门票判断
|
| | | if not fbLineIpyData:
|
| | | fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | |
| | | ticketID = fbLineIpyData.GetTicketID()
|
| | | if not ticketID:
|
| | | return True, [], 0, False, []
|
| | | |
| | | ticketCostCntList = fbLineIpyData.GetTicketCostCnt()
|
| | | if not ticketCostCntList:
|
| | | GameWorld.ErrLog("没有配置门票消耗!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
| | | return False, [], 0, False, []
|
| | | |
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mapID)
|
| | | costCnt = ticketCostCntList[-1] if enterCnt >= len(ticketCostCntList) else ticketCostCntList[enterCnt]
|
| | | totalCostCnt = costCnt*reqEnterCnt
|
| | | if not totalCostCnt:
|
| | | GameWorld.ErrLog("没有配置门票消耗!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
| | | return False, [], 0, False, []
|
| | | |
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | enough, indexList, hasBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(ticketID, itemPack, totalCostCnt)
|
| | | if not enough:
|
| | | ticketPrice = fbLineIpyData.GetTicketPrice()
|
| | | if ticketPrice and not isTeamAsk: #组队进组队副本时必须要有门票道具
|
| | | costMoney = ticketPrice * lackCnt
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costMoney)
|
| | | return bool(costMoneyList), indexList, totalCostCnt, hasBind, costMoneyList
|
| | | GameWorld.DebugLog("门票不足, 无法进入副本!mapID=%s,lineID=%s,ticketID=%s,reqEnterCnt=%s,totalCostCnt=%s" |
| | | % (mapID, lineID, ticketID, reqEnterCnt, totalCostCnt), curPlayer.GetPlayerID())
|
| | | return False, [], 0, False, []
|
| | | |
| | | return enough, indexList, totalCostCnt, hasBind, []
|
| | | # if not fbLineIpyData:
|
| | | # fbLineIpyData = GetFBLineIpyData(mapID, lineID)
|
| | | # |
| | | # ticketID = fbLineIpyData.GetTicketID()
|
| | | # if not ticketID:
|
| | | # return True, [], 0, False, []
|
| | | # |
| | | # ticketCostCntList = fbLineIpyData.GetTicketCostCnt()
|
| | | # if not ticketCostCntList:
|
| | | # GameWorld.ErrLog("没有配置门票消耗!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
| | | # return False, [], 0, False, []
|
| | | # |
| | | # enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbEnterCnt % mapID)
|
| | | # costCnt = ticketCostCntList[-1] if enterCnt >= len(ticketCostCntList) else ticketCostCntList[enterCnt]
|
| | | # totalCostCnt = costCnt*reqEnterCnt
|
| | | # if not totalCostCnt:
|
| | | # GameWorld.ErrLog("没有配置门票消耗!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
| | | # return False, [], 0, False, []
|
| | | # |
| | | # itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | # enough, indexList, hasBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(ticketID, itemPack, totalCostCnt)
|
| | | # if not enough:
|
| | | # ticketPrice = fbLineIpyData.GetTicketPrice()
|
| | | # if ticketPrice and not isTeamAsk: #组队进组队副本时必须要有门票道具
|
| | | # costMoney = ticketPrice * lackCnt
|
| | | # costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costMoney)
|
| | | # return bool(costMoneyList), indexList, totalCostCnt, hasBind, costMoneyList
|
| | | # GameWorld.DebugLog("门票不足, 无法进入副本!mapID=%s,lineID=%s,ticketID=%s,reqEnterCnt=%s,totalCostCnt=%s" |
| | | # % (mapID, lineID, ticketID, reqEnterCnt, totalCostCnt), curPlayer.GetPlayerID())
|
| | | # return False, [], 0, False, []
|
| | | # |
| | | # return enough, indexList, totalCostCnt, hasBind, []
|
| | |
|
| | | ## 获取副本进入门票信息
|
| | | # @param curPlayer 玩家实例
|
| | |
| | |
|
| | | ## ---------------------------------- TD ---------------------------------------
|
| | | def GetEnterFBMaxCnt(curPlayer, mapID):
|
| | | ## 获取副本最大可进入次数: 基本次数 + 时间已恢复次数 + VIP额外次数 + 购买次数 + 找回次数 + 使用道具增加次数
|
| | | ## 获取副本最大可进入次数: 基本次数 + 广告次数 + 购买次数 + 使用道具增加次数 + 其他
|
| | | fbIpyData = GetFBIpyData(mapID)
|
| | | if not fbIpyData:
|
| | | return 0
|
| | | maxTimes = fbIpyData.GetDayTimes()
|
| | | |
| | | mwAddCnt = 0#wmpIpyData.GetEffectValue() if wmpIpyData else 0
|
| | | extraCnt = 0
|
| | | buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
|
| | | regainFbCnt = 0
|
| | | adCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBADCnt % mapID)
|
| | | buyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBBuyCnt % mapID)
|
| | | itemCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBItemCnt % mapID)
|
| | | investFBCnt = PlayerGoldInvest.GetAddFBCnt(curPlayer, mapID)
|
| | | maxCnt = maxTimes + regainFbCnt + extraCnt + buyCnt + mwAddCnt + itemAddCnt + investFBCnt
|
| | | maxCnt = maxTimes + adCnt + buyCnt + itemCnt + investFBCnt
|
| | | return maxCnt
|
| | |
|
| | | ## 玩家进入副本次数
|
| | | # @param curPlayer 玩家实例
|
| | | # @param fbID 副本id
|
| | | # @return bool
|
| | | def GetEnterFBCount(curPlayer, fbID, lineBit=-1):
|
| | | ## 玩家进入副本次数
|
| | | fbID = GetRecordMapID(fbID)
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % fbID)
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbEnterCnt % fbID)
|
| | | if lineBit >= 0:
|
| | | return GameWorld.GetDataByDigitPlace(enterCnt, lineBit)
|
| | | return enterCnt
|
| | |
| | | def AddFBCntByItem(curPlayer, itemID, mapID, addCnt):
|
| | | ## 物品增加副本次数
|
| | | mapID = GetRecordMapID(mapID)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID, itemAddCnt + addCnt)
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBItemCnt % mapID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBItemCnt % mapID, itemAddCnt + addCnt)
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapID)
|
| | | PlayerControl.NotifyCode(curPlayer, 'AddActivityCount_1', [itemID, mapID, addCnt])
|
| | | return
|
| | |
|
| | | ## 增加玩家进入副本次数
|
| | | # @param curPlayer 玩家实例
|
| | | # @param fbID 副本id
|
| | | # @param addCount 增加次数
|
| | | # @return 返回值无意义
|
| | | def AddEnterFBCount(curPlayer, fbID, addCount=1, lineBit=-1, isFree=False):
|
| | | ## 增加玩家进入副本次数
|
| | | ## @param isFree: 是否免费进入的,免费的不增加实际进入次数,但需要触发进入次数额外处理,如活跃、成就等
|
| | | addCountEx = addCount
|
| | | #addCountEx = addCount
|
| | | addCount = 0 if isFree else addCount
|
| | | fbID = GetRecordMapID(fbID)
|
| | | enterCntKey = ChConfig.Def_Player_Dict_EnterFbCntDay % fbID
|
| | | enterCntKey = ChConfig.Def_Player_Dict_FbEnterCnt % fbID
|
| | | enterCnt = curPlayer.NomalDictGetProperty(enterCntKey)
|
| | | if lineBit >= 0:
|
| | | curLineEnterCnt = GameWorld.GetDataByDigitPlace(enterCnt, lineBit)
|
| | |
| | | addCount = updCnt-enterCnt
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, updCnt)
|
| | |
|
| | | PlayerActivity.OnEnterFBActivity(curPlayer, fbID, updCnt, addCountEx)
|
| | | PlayerSuccess.AddEnterFBSuccess(curPlayer, fbID, addCountEx)
|
| | | #PlayerActivity.OnEnterFBActivity(curPlayer, fbID, updCnt, addCountEx)
|
| | | #PlayerSuccess.AddEnterFBSuccess(curPlayer, fbID, addCountEx)
|
| | | updValue = updCnt
|
| | | enterCntTotalKey = ChConfig.Def_Player_Dict_EnterFbCntTotal % fbID
|
| | | enterCntTotal = min(curPlayer.NomalDictGetProperty(enterCntTotalKey) + addCount, ChConfig.Def_UpperLimit_DWord)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, enterCntTotalKey, enterCntTotal)
|
| | | GameWorld.DebugLog(" AddEnterFBCount fbID=%s, addCount=%s, lineBit=%s, enterCnt=%s,updValue=%s,enterCntTotal=%s" |
| | | % (fbID, addCount, lineBit, enterCnt, updValue, enterCntTotal), curPlayer.GetPlayerID())
|
| | | GameWorld.DebugLog(" AddEnterFBCount fbID=%s, addCount=%s, lineBit=%s, enterCnt=%s,updValue=%s" |
| | | % (fbID, addCount, lineBit, enterCnt, updValue), curPlayer.GetPlayerID())
|
| | | Sync_FBPlayerFBInfoData(curPlayer, fbID)
|
| | | return True
|
| | |
|
| | | def FBOnWeek(curPlayer, onWeekType):
|
| | | |
| | | mapIDInfo = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetFBFuncCount()):
|
| | | ipyData = ipyDataMgr.GetFBFuncByIndex(i)
|
| | | mapID = ipyData.GetDataMapID()
|
| | | weekTimes = ipyData.GetWeekTimes()
|
| | | # 没有周次数限制的不处理
|
| | | if not weekTimes:
|
| | | continue
|
| | | # 重置类型不同的不处理
|
| | | if ipyData.GetWeekResetType() != onWeekType:
|
| | | continue
|
| | | |
| | | # 重置周次数
|
| | | enterCntWeekKey = ChConfig.Def_Player_Dict_EnterFbCntWeek % mapID
|
| | | if curPlayer.NomalDictGetProperty(enterCntWeekKey):
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, enterCntWeekKey, 0)
|
| | | mapIDInfo.append(mapID)
|
| | | |
| | | if mapIDInfo:
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapIDInfo)
|
| | | |
| | | return
|
| | |
|
| | | ## 玩家通用副本OnDay处理
|
| | | # @param curPlayer: 玩家实例
|
| | | # @return: None
|
| | | def FBOnDay(curPlayer, onDayType):
|
| | | GameWorld.Log("副本过天处理,FBOnDay...", curPlayer.GetPlayerID())
|
| | | if onDayType != ShareDefine.Def_OnEventType:
|
| | | return
|
| | | FBLogic.OnFBPlayerOnDay(curPlayer, onDayType) # 在重置次数之前,可用于处理资源找回
|
| | |
|
| | | mapIDInfo = []
|
| | |
| | | for i in xrange(ipyDataMgr.GetFBFuncCount()):
|
| | | ipyData = ipyDataMgr.GetFBFuncByIndex(i)
|
| | | mapID = ipyData.GetDataMapID()
|
| | | |
| | | dayTimes = ipyData.GetDayTimes()
|
| | | enterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbEnterCnt % mapID)
|
| | | # 没有日次数限制的不处理
|
| | | if not dayTimes and not ipyData.GetBuyTimesVIPPriID() and not ipyData.GetExtraTimesVIPPriID() and not ipyData.GetExtraTimesMWPriID():
|
| | | #GameWorld.DebugLog(" 不需要重置的副本,mapID=%s,dayTimes=%s,vipBuyPriID=%s,vipExtraTime=%s" |
| | | # % (mapID, dayTimes, ipyData.GetBuyTimesVIPPriID(), ipyData.GetExtraTimesVIPPriID()))
|
| | | if not enterCnt and not ipyData.GetDayTimes() and not ipyData.GetPayCntMax():
|
| | | continue
|
| | | |
| | | # 重置类型不同的不处理
|
| | | if ipyData.GetDayResetType() != onDayType:
|
| | | #GameWorld.DebugLog(" 重置时间点不同,不处理,mapID=%s" % mapID)
|
| | | continue
|
| | | |
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
|
| | | |
| | | # 进入次数
|
| | | enterCntKey = ChConfig.Def_Player_Dict_EnterFbCntDay % mapID
|
| | | enterCnt = curPlayer.NomalDictGetProperty(enterCntKey)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, enterCntKey, 0)
|
| | | |
| | | # 购买次数
|
| | | buyCntKey = ChConfig.Def_Player_Dict_BuyFbCntDay % mapID
|
| | | buyCnt = curPlayer.NomalDictGetProperty(buyCntKey)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, buyCntKey, 0)
|
| | | |
| | | # 物品增加次数
|
| | | itemAddCntKey = ChConfig.Def_Player_Dict_ItemAddFbCnt % mapID
|
| | | itemAddCnt = curPlayer.NomalDictGetProperty(itemAddCntKey)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, itemAddCntKey, 0)
|
| | | |
| | | GameWorld.DebugLog(" 重置:mapID=%s,dayTimes=%s,buyCnt=%s,itemAddCnt=%s,maxCnt=%s,enterCnt=%s" |
| | | % (mapID, dayTimes, buyCnt, itemAddCnt, maxCnt, enterCnt))
|
| | | |
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FbEnterCnt % mapID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBADCnt % mapID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBBuyCnt % mapID, 0)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBItemCnt % mapID, 0)
|
| | | mapIDInfo.append(mapID)
|
| | |
|
| | | if mapIDInfo:
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapIDInfo)
|
| | | Sync_FBPlayerFBBuyCount(curPlayer, mapIDInfo)
|
| | |
|
| | | return
|
| | |
|
| | |
| | | def FBOnLogin(curPlayer):
|
| | | FBLogic.OnFBPlayerOnLogin(curPlayer)
|
| | | Sync_FBPlayerFBInfoData(curPlayer)
|
| | | Sync_FBPlayerFBBuyCount(curPlayer)
|
| | | return
|
| | |
|
| | | #//A5 75 购买副本进入次数#tagCMBuyEnterCount
|
| | |
| | | # tagHead Head;
|
| | | # DWORD FBID; // 副本ID
|
| | | #};
|
| | |
|
| | | def BuyFBEnterCount(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | | mapID = clientData.FBID
|
| | | if mapID == ChConfig.Def_FBMapID_Love:
|
| | | coupleID = PlayerControl.GetCoupleID(curPlayer)
|
| | | if not coupleID:
|
| | | GameWorld.DebugLog("没有伴侣无法购买情缘副本次数!")
|
| | | return
|
| | | ipyData = GetFBIpyData(mapID)
|
| | | if not ipyData:
|
| | | return
|
| | | canBuyCnt = 0
|
| | | canBuyCnt = ipyData.GetPayCntMax()
|
| | | canBuyCnt += PlayerGoldInvest.GetAddFBBuyCnt(curPlayer, mapID)
|
| | | GameWorld.DebugLog("购买副本进入次数: mapID=%s,canBuyCnt=%s" % (mapID, canBuyCnt))
|
| | | if canBuyCnt <= 0:
|
| | | GameWorld.DebugLog("mapID:%s 不可以购买进入次数"%mapID)
|
| | | return
|
| | | |
| | | hasBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mapID)
|
| | | maxDayTimes = ipyData.GetDayTimes()
|
| | | maxCnt = GetEnterFBMaxCnt(curPlayer, mapID)
|
| | | enterCnt = GetEnterFBCount(curPlayer, mapID)
|
| | | if mapID == ChConfig.Def_FBMapID_SealDemon and maxDayTimes and maxCnt - enterCnt >= maxDayTimes:
|
| | | GameWorld.DebugLog('当前次数已满,无需购买。。')
|
| | | return
|
| | | |
| | | hasBuyCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBBuyCnt % mapID)
|
| | | GameWorld.DebugLog("购买副本进入次数: mapID=%s,canBuyCnt=%s,hasBuyCnt=%s" % (mapID, canBuyCnt, hasBuyCnt))
|
| | | if hasBuyCnt >= canBuyCnt:
|
| | | GameWorld.DebugLog("购买次数已经用完mapID=%s,hasBuyCnt=%s >= canBuyCnt=%s" % (mapID, hasBuyCnt, canBuyCnt))
|
| | | GameWorld.DebugLog("副本购买次数已经用完! mapID=%s,hasBuyCnt=%s >= canBuyCnt=%s" % (mapID, hasBuyCnt, canBuyCnt))
|
| | | return
|
| | | costGoldDict = IpyGameDataPY.GetFuncEvalCfg('BuyFBCntCost', 1, {})
|
| | | costGold = costGoldDict.get(str(mapID), '0')
|
| | | costGold = eval(costGold)
|
| | | costMoneyTypeInfo = IpyGameDataPY.GetFuncEvalCfg('BuyFBCntCost', 2, {})
|
| | | costType = costMoneyTypeInfo.get(str(mapID), ShareDefine.TYPE_Price_Gold_Paper_Money)
|
| | | if costGold <= 0:
|
| | | GameWorld.DebugLog("没有配置购买副本次数消耗货币数! mapID=%s,costType=%s,costGold=%s" % (mapID, costType, costGold))
|
| | | costType = ipyData.GetPayMoneyType()
|
| | | payMoneyList = ipyData.GetPayMoneyValues()
|
| | | if not costType or not payMoneyList:
|
| | | GameWorld.DebugLog("没有配置购买副本次数消耗货币数! mapID=%s,costType=%s,payMoneyList=%s" % (mapID, costType, payMoneyList))
|
| | | return
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, costType, costGold)
|
| | | #GameWorld.Log('costMoneyList=%s,costGold=%s'%(costMoneyList,costGold))
|
| | | if not costMoneyList:
|
| | | costMoney = payMoneyList[hasBuyCnt] if len(payMoneyList) > hasBuyCnt else payMoneyList[-1]
|
| | | if not PlayerControl.PayMoney(curPlayer, costType, costMoney, ChConfig.Def_Cost_BuyFBCnt, {"MapID":mapID}):
|
| | | return
|
| | | infoDict = {"MapID":mapID}
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBBuyCnt % mapID, hasBuyCnt + 1)
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapID)
|
| | | return
|
| | |
|
| | | for moneyType, moneyNum in costMoneyList:
|
| | | if not PlayerControl.PayMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_Cost_BuyFBCnt, infoDict):
|
| | | GameWorld.DebugLog("仙玉不足!costGold=%s" % costGold)
|
| | | def AddFBADCnt(curPlayer, mapID):
|
| | | fbIpyData = GetFBIpyData(mapID)
|
| | | if not fbIpyData:
|
| | | return
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_BuyFbCntDay % mapID, hasBuyCnt + 1)
|
| | | Sync_FBPlayerFBBuyCount(curPlayer, [mapID])
|
| | | PlayerControl.NotifyCode(curPlayer, 'FBEnterTimeBuy', [mapID])
|
| | | if mapID == ChConfig.Def_FBMapID_Love:
|
| | | coupleID = PlayerControl.GetCoupleID(curPlayer)
|
| | | if coupleID:
|
| | | addItemList = IpyGameDataPY.GetFuncEvalCfg("LoveFB", 3)
|
| | | paramList = [curPlayer.GetPlayerName()]
|
| | | PlayerControl.SendMailByKey("BuyLoveFBCntCoupleMail", [coupleID], addItemList, paramList)
|
| | | adCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBADCnt % mapID)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_FBADCnt % mapID, adCnt + 1)
|
| | | Sync_FBPlayerFBInfoData(curPlayer, mapID)
|
| | | return
|
| | |
|
| | | ## 获取记录值的mapID
|
| | |
| | | # @return
|
| | | # @remarks 一般用于几张地图公用一份存储记录,如组队副本进入次数,CD时间等数据需共享
|
| | | def GetRecordMapID(mapID):
|
| | | DataMapIDDict = IpyGameDataPY.GetConfigEx("DataMapIDDict")
|
| | | if not DataMapIDDict:
|
| | | mIDToDataMapIDDict = {} # 场景ID对应功能地图ID
|
| | | dMapIDDict = {}
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetFBLineCount()):
|
| | | ipyData = ipyDataMgr.GetFBLineByIndex(i)
|
| | | dMapID = ipyData.GetDataMapID()
|
| | | mID = ipyData.GetMapID()
|
| | | mIDList= dMapIDDict.get(dMapID, [])
|
| | | if mID not in mIDList:
|
| | | mIDList.append(mID)
|
| | | dMapIDDict[dMapID] = mIDList
|
| | | |
| | | dMIDList= mIDToDataMapIDDict.get(mID, [])
|
| | | if dMapID not in dMIDList:
|
| | | dMIDList.append(dMapID)
|
| | | mIDToDataMapIDDict[mID] = dMIDList
|
| | | |
| | | unMIDList = []
|
| | | for mID, dMIDList in mIDToDataMapIDDict.items():
|
| | | if len(dMIDList) > 1:
|
| | | unMIDList.append(mID)
|
| | | #GameWorld.DebugLog("----------- 同个场景对应到多个功能地图的,视为无意义的地图! mID=%s, to dMIDList=%s" % (mID, dMIDList))
|
| | | for dMapID, mIDList in dMapIDDict.items():
|
| | | for unMID in unMIDList:
|
| | | if unMID in mIDList:
|
| | | mIDList.remove(unMID)
|
| | | if len(mIDList) <= 1:
|
| | | dMapIDDict.pop(dMapID)
|
| | | DataMapIDDict = IpyGameDataPY.SetConfigEx("DataMapIDDict", dMapIDDict)
|
| | | #GameWorld.Log("加载DataMapIDDict=%s" % DataMapIDDict)
|
| | | |
| | | for dataMapID, mapIDList in DataMapIDDict.items():
|
| | | if mapID in mapIDList:
|
| | | return dataMapID
|
| | | # DataMapIDDict = IpyGameDataPY.GetConfigEx("DataMapIDDict")
|
| | | # if not DataMapIDDict:
|
| | | # mIDToDataMapIDDict = {} # 场景ID对应功能地图ID
|
| | | # dMapIDDict = {}
|
| | | # ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | # for i in xrange(ipyDataMgr.GetFBLineCount()):
|
| | | # ipyData = ipyDataMgr.GetFBLineByIndex(i)
|
| | | # dMapID = ipyData.GetDataMapID()
|
| | | # mID = ipyData.GetMapID()
|
| | | # mIDList= dMapIDDict.get(dMapID, [])
|
| | | # if mID not in mIDList:
|
| | | # mIDList.append(mID)
|
| | | # dMapIDDict[dMapID] = mIDList
|
| | | # |
| | | # dMIDList= mIDToDataMapIDDict.get(mID, [])
|
| | | # if dMapID not in dMIDList:
|
| | | # dMIDList.append(dMapID)
|
| | | # mIDToDataMapIDDict[mID] = dMIDList
|
| | | # |
| | | # unMIDList = []
|
| | | # for mID, dMIDList in mIDToDataMapIDDict.items():
|
| | | # if len(dMIDList) > 1:
|
| | | # unMIDList.append(mID)
|
| | | # #GameWorld.DebugLog("----------- 同个场景对应到多个功能地图的,视为无意义的地图! mID=%s, to dMIDList=%s" % (mID, dMIDList))
|
| | | # for dMapID, mIDList in dMapIDDict.items():
|
| | | # for unMID in unMIDList:
|
| | | # if unMID in mIDList:
|
| | | # mIDList.remove(unMID)
|
| | | # if len(mIDList) <= 1:
|
| | | # dMapIDDict.pop(dMapID)
|
| | | # DataMapIDDict = IpyGameDataPY.SetConfigEx("DataMapIDDict", dMapIDDict)
|
| | | # #GameWorld.Log("加载DataMapIDDict=%s" % DataMapIDDict)
|
| | | # |
| | | # for dataMapID, mapIDList in DataMapIDDict.items():
|
| | | # if mapID in mapIDList:
|
| | | # return dataMapID
|
| | | return mapID
|
| | |
|
| | | def GetGeneralTrainMapIDList():
|
| | |
| | |
|
| | | return GeneralTrainMapIDList
|
| | |
|
| | | ## 通知个人通用副本信息
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param runTime: 已经进行时间
|
| | | # @return: None
|
| | | def Sync_FBPlayerFBInfoData(curPlayer, mapIDInfo=None):
|
| | | ## 通知个人通用副本信息
|
| | | if not mapIDInfo:
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | mapIDList = [ipyDataMgr.GetFBFuncByIndex(i).GetDataMapID() for i in xrange(ipyDataMgr.GetFBFuncCount())]
|
| | |
| | | return
|
| | | mapIDList = [mapIDInfo] if type(mapIDInfo) == int else mapIDInfo
|
| | |
|
| | | fbInfoData = ChPyNetSendPack.tagMCPlayerFBInfoData()
|
| | | fbInfoData.Clear()
|
| | | fbInfoData.FBDataCnt = len(mapIDList)
|
| | | fbInfoData.FBDataList = []
|
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFBInfoList)
|
| | | clientPack.FBDataList = []
|
| | |
|
| | | for mID in mapIDList:
|
| | | mapInfo = ChPyNetSendPack.tagMCFBInfo()
|
| | | mapInfo.Clear()
|
| | | mapInfo.FBID = mID
|
| | | mapInfo.EnterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntDay % mID)
|
| | | mapInfo.EnterCntTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_EnterFbCntTotal % mID)
|
| | | mapInfo.RecoverCnt = 0
|
| | | mapInfo.ItemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_ItemAddFbCnt % mID)
|
| | | mapInfo.PassLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mID)
|
| | | |
| | | for mapID in mapIDList:
|
| | | fbInfo = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCFBInfo)
|
| | | fbInfo.MapID = mapID
|
| | | fbInfo.EnterCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FbEnterCnt % mapID)
|
| | | fbInfo.ADAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBADCnt % mapID)
|
| | | fbInfo.BuyAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBBuyCnt % mapID)
|
| | | fbInfo.ItemAddCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBItemCnt % mapID)
|
| | | fbInfo.PassLineID = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBPassLineID % mapID)
|
| | | for keyNum in range(ChConfig.Def_FBStar_MaxKeyCnt):
|
| | | gradeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_PlayerFBStar_MapId % (mID, keyNum))
|
| | | mapInfo.PassGrade.append(gradeValue)
|
| | | mapInfo.PassGradeCnt = len(mapInfo.PassGrade)
|
| | | #GameWorld.DebugLog("FBID:%s---:%s"%(mapInfo.FBID,mapInfo.EnterCnt))
|
| | | fbInfoData.FBDataList.append(mapInfo)
|
| | | gradeValue = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FBStar % (mapID, keyNum))
|
| | | fbInfo.PassGrade.append(gradeValue)
|
| | | fbInfo.PassGradeCnt = len(fbInfo.PassGrade)
|
| | | clientPack.FBDataList.append(fbInfo)
|
| | |
|
| | | NetPackCommon.SendFakePack(curPlayer, fbInfoData)
|
| | | return
|
| | |
|
| | | #// A3 BD 通知玩家购买副本进入次数 #tagMCBuyEnterInfo
|
| | | #
|
| | | #struct tagMCBuyEnterInfo
|
| | | #{
|
| | | # tagHead Head;
|
| | | # BYTE FBCount; // 副本个数
|
| | | # DWORD tagMCFBInfo[FBCount]; // 副本信息
|
| | | #};
|
| | | #
|
| | | #struct tagMCBuyInfo
|
| | | #{
|
| | | # tagHead Head;
|
| | | # DWORD FBID; // 副本ID
|
| | | # BYTE BuyCount; // 已购买次数
|
| | | #};
|
| | | ## 通知个人购买副本次数信息
|
| | | # @param curPlayer: 玩家实例
|
| | | # @param runTime: 已经进行时间
|
| | | # @return: None
|
| | | def Sync_FBPlayerFBBuyCount(curPlayer, mapIDList=[]):
|
| | | if not mapIDList:
|
| | | mapIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for i in xrange(ipyDataMgr.GetFBFuncCount()):
|
| | | ipyData = ipyDataMgr.GetFBFuncByIndex(i)
|
| | | if not ipyData.GetBuyTimesVIPPriID():
|
| | | continue
|
| | | mapIDList.append(ipyData.GetDataMapID())
|
| | | |
| | | |
| | | fbInfoData = ChPyNetSendPack.tagMCBuyEnterInfo()
|
| | | fbInfoData.Clear()
|
| | | fbInfoData.FBInfo = []
|
| | | for mID in mapIDList:
|
| | | mapInfo = ChPyNetSendPack.tagMCBuyInfo()
|
| | | mapInfo.Clear()
|
| | | mapInfo.FBID = mID
|
| | | mapInfo.BuyCount = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_BuyFbCntDay % mID)
|
| | | fbInfoData.FBInfo.append(mapInfo)
|
| | | #GameWorld.DebugLog("FBID:%s---BuyCount:%s"%(mapInfo.FBID,mapInfo.BuyCount))
|
| | | fbInfoData.FBCount = len(fbInfoData.FBInfo)
|
| | | if fbInfoData.FBCount > 0:
|
| | | NetPackCommon.SendFakePack(curPlayer, fbInfoData)
|
| | | clientPack.FBDataCnt = len(clientPack.FBDataList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | ## 根据人数分组
|
| New file |
| | |
| | | #!/usr/bin/python
|
| | | # -*- coding: GBK -*-
|
| | | #-------------------------------------------------------------------------------
|
| | | #
|
| | | ##@package GameWorldLogic.FBProcess.GameLogic_Zhanchui
|
| | | #
|
| | | # @todo:白骨盈野/战锤秘境
|
| | | # @author hxp
|
| | | # @date 2025-09-30
|
| | | # @version 1.0
|
| | | #
|
| | | # 详细描述: 白骨盈野/战锤秘境
|
| | | #
|
| | | #-------------------------------------------------------------------------------
|
| | | #"""Version = 2025-09-30 10:30"""
|
| | | #-------------------------------------------------------------------------------
|
| | |
|
| | | import GameWorld
|
| | | import ItemControler
|
| | | import FBCommon
|
| | |
|
| | | def OnTurnFightRequest(curPlayer, mapID, funcLineID, tagType, tagID, valueList):
|
| | | ## 回合战斗请求 |
| | | |
| | | if FBCommon.IsFBPass(curPlayer, mapID, funcLineID):
|
| | | GameWorld.DebugLog("已过关的不能不重复挑战! mapID=%s,funcLineID=%s" % (mapID, funcLineID))
|
| | | return
|
| | | |
| | | return True
|
| | |
|
| | | def OnTurnFightOver(curPlayer, turnFight, mapID, funcLineID, overMsg):
|
| | | ## 回合战斗结束
|
| | | |
| | | if not curPlayer:
|
| | | return
|
| | | |
| | | isWin = turnFight.isWin
|
| | | |
| | | if not isWin:
|
| | | return
|
| | | |
| | | if FBCommon.IsFBPass(curPlayer, mapID, funcLineID):
|
| | | GameWorld.DebugLog("已过关的不重复获得过关奖励! mapID=%s,funcLineID=%s" % (mapID, funcLineID))
|
| | | return
|
| | | |
| | | itemList = FBCommon.GetPassAwardList(mapID, funcLineID)
|
| | | GameWorld.DebugLog("过关奖励: mapID=%s,funcLineID=%s,itemList=%s" % (mapID, funcLineID, itemList))
|
| | | # 首通不扣次数
|
| | | FBCommon.SetFBPass(curPlayer, mapID, funcLineID)
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["Zhanchui", False, {}], isNotifyAward=False)
|
| | | overMsg.update({FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList)})
|
| | | |
| | | return
|
| | |
|
| | | def OnPlayerFBSweepAsk(curPlayer, mapID, lineID, sweepCnt, dataEx):
|
| | | ## 可否扫荡
|
| | | |
| | | return True
|
| | |
|
| | | def OnPlayerFBSweepResult(curPlayer, mapID, lineID, sweepCnt, dataEx):
|
| | | ## 扫荡结果,次数消耗已在外层处理扣除
|
| | | |
| | | itemList = FBCommon.GetSweepAwardList(mapID, lineID, sweepCnt)
|
| | | GameWorld.DebugLog("白骨盈野扫荡: mapID=%s,lineID=%s,sweepCnt=%s" % (mapID, lineID, sweepCnt))
|
| | | |
| | | ItemControler.GivePlayerItemOrMail(curPlayer, itemList, event=["Zhanchui", False, {}], isNotifyAward=False)
|
| | | |
| | | isPass = 1
|
| | | overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(itemList), FBCommon.Over_isSweep:1}
|
| | | FBCommon.NotifyFBOver(curPlayer, mapID, lineID, isPass, overDict)
|
| | | |
| | | return True
|
| | |
| | | "FBFunc":(
|
| | | ("DWORD", "DataMapID", 1),
|
| | | ("BYTE", "DayTimes", 0),
|
| | | ("BYTE", "DayResetType", 0),
|
| | | ("BYTE", "WeekTimes", 0),
|
| | | ("BYTE", "WeekResetType", 0),
|
| | | ("list", "RewardRate", 0),
|
| | | ("DWORD", "BuyTimesVIPPriID", 0),
|
| | | ("DWORD", "ExtraTimesVIPPriID", 0),
|
| | | ("DWORD", "ExtraTimesMWPriID", 0),
|
| | | ("BYTE", "GuardPick", 0),
|
| | | ("WORD", "OfflineTime", 0),
|
| | | ("WORD", "FBPoint", 0),
|
| | | ("WORD", "HelpPoint", 0),
|
| | | ("BYTE", "DayHelpCountMax", 0),
|
| | | ("BYTE", "PayCntMax", 0),
|
| | | ("BYTE", "PayMoneyType", 0),
|
| | | ("list", "PayMoneyValues", 0),
|
| | | ),
|
| | |
|
| | | "FBLine":(
|
| | | ("DWORD", "DataMapID", 1),
|
| | | ("BYTE", "LineID", 1),
|
| | | ("DWORD", "MapID", 0),
|
| | | ("WORD", "LVLimitMin", 0),
|
| | | ("WORD", "LVLimitMax", 0),
|
| | | ("DWORD", "TicketID", 0),
|
| | | ("list", "TicketCostCnt", 0),
|
| | | ("WORD", "TicketPrice", 0),
|
| | | ("WORD", "SweepLVLimit", 0),
|
| | | ("DWORD", "SweepItemID", 0),
|
| | | ("BYTE", "SweepCostCnt", 0),
|
| | | ("eval", "EnterPosInfo", 0),
|
| | | ("eval", "StepTime", 0),
|
| | | ("eval", "RefreshNPC", 0),
|
| | | ("eval", "GradeInfo", 0),
|
| | | ("eval", "RewardInfo", 0),
|
| | | ("list", "PassAwardList", 0),
|
| | | ("list", "SweepAwardList", 0),
|
| | | ("list", "LineupIDList", 0),
|
| | | ),
|
| | |
|
| | | "ADAward":(
|
| | | ("DWORD", "ADID", 1),
|
| | | ("BYTE", "ADCntMax", 0),
|
| | | ("list", "ADAwardItemList", 0),
|
| | | ("DWORD", "ADMapID", 0),
|
| | | ),
|
| | |
|
| | | "FBGeneralTrain":(
|
| | |
| | | return |
| | | |
| | | def GetDataMapID(self): return self.attrTuple[0] # 数据地图ID DWORD
|
| | | def GetDayTimes(self): return self.attrTuple[1] # 每日可挑战次数, 0为不限制 BYTE
|
| | | def GetDayResetType(self): return self.attrTuple[2] # 每日次数重置类型; 0-不重置,1-0点,2-5点 BYTE
|
| | | def GetWeekTimes(self): return self.attrTuple[3] # 每周可挑战次数, 0为不限制 BYTE
|
| | | def GetWeekResetType(self): return self.attrTuple[4] # 每周次数重置类型; 0-不重置,1-0点,2-5点 BYTE
|
| | | def GetRewardRate(self): return self.attrTuple[5] # 评级奖励比例 list
|
| | | def GetBuyTimesVIPPriID(self): return self.attrTuple[6] # 购买次数VIP权限ID DWORD
|
| | | def GetExtraTimesVIPPriID(self): return self.attrTuple[7] # 额外次数VIP权限ID DWORD
|
| | | def GetExtraTimesMWPriID(self): return self.attrTuple[8] # 额外次数法宝权限ID DWORD
|
| | | def GetGuardPick(self): return self.attrTuple[9] # 该地图守护是否能拾取 BYTE
|
| | | def GetOfflineTime(self): return self.attrTuple[10] # 离线多久退出副本(秒) WORD
|
| | | def GetFBPoint(self): return self.attrTuple[11] # 副本过关仙缘币 WORD
|
| | | def GetHelpPoint(self): return self.attrTuple[12] # 助战仙缘币(0代表不可助战) WORD
|
| | | def GetDayHelpCountMax(self): return self.attrTuple[13] # 每日手动助战获得仙缘币次数(非镜像) BYTE |
| | | def GetDayTimes(self): return self.attrTuple[1] # 每日免费次数, 0为不限制 BYTE
|
| | | def GetPayCntMax(self): return self.attrTuple[2] # 额外付费次数 BYTE
|
| | | def GetPayMoneyType(self): return self.attrTuple[3] # 消耗货币类型 BYTE
|
| | | def GetPayMoneyValues(self): return self.attrTuple[4] # 消耗货币值列表 list |
| | | |
| | | # 副本功能线路表 |
| | | class IPY_FBLine(): |
| | |
| | | |
| | | def GetDataMapID(self): return self.attrTuple[0] # 数据地图ID DWORD
|
| | | def GetLineID(self): return self.attrTuple[1] # 功能线路ID BYTE
|
| | | def GetMapID(self): return self.attrTuple[2] # 场景地图ID DWORD
|
| | | def GetLVLimitMin(self): return self.attrTuple[3] # 最低等级限制, 0为不限制 WORD
|
| | | def GetLVLimitMax(self): return self.attrTuple[4] # 最高等级限制, 0为不限制 WORD
|
| | | def GetTicketID(self): return self.attrTuple[5] # 门票ID DWORD
|
| | | def GetTicketCostCnt(self): return self.attrTuple[6] # 门票消耗数信息 list
|
| | | def GetTicketPrice(self): return self.attrTuple[7] # 门票单价(不能用钱抵的配0) WORD
|
| | | def GetSweepLVLimit(self): return self.attrTuple[8] # 扫荡等级限制, 0为不限制 WORD
|
| | | def GetSweepItemID(self): return self.attrTuple[9] # 扫荡所需道具ID DWORD
|
| | | def GetSweepCostCnt(self): return self.attrTuple[10] # 扫荡所需道具个数 BYTE
|
| | | def GetEnterPosInfo(self): return self.attrTuple[11] # 进入坐标信息 eval
|
| | | def GetStepTime(self): return self.attrTuple[12] # 阶段时间 eval
|
| | | def GetRefreshNPC(self): return self.attrTuple[13] # 标试点刷怪配置 eval
|
| | | def GetGradeInfo(self): return self.attrTuple[14] # 评级规则 eval
|
| | | def GetRewardInfo(self): return self.attrTuple[15] # 奖励信息 eval |
| | | def GetLVLimitMin(self): return self.attrTuple[2] # 最低等级限制, 0为不限制 WORD
|
| | | def GetPassAwardList(self): return self.attrTuple[3] # 过关奖励 list
|
| | | def GetSweepAwardList(self): return self.attrTuple[4] # 扫荡奖励 list
|
| | | def GetLineupIDList(self): return self.attrTuple[5] # 阵容ID列表 list |
| | | |
| | | # 广告奖励表 |
| | | class IPY_ADAward(): |
| | | |
| | | def __init__(self): |
| | | self.attrTuple = None |
| | | return |
| | | |
| | | def GetADID(self): return self.attrTuple[0] # DWORD
|
| | | def GetADCntMax(self): return self.attrTuple[1] # 每日次数 BYTE
|
| | | def GetADAwardItemList(self): return self.attrTuple[2] # 广告奖励物品列表 list
|
| | | def GetADMapID(self): return self.attrTuple[3] # 对应副本ID,默认给该副本1次次数 DWORD |
| | | |
| | | # 副本通用养成表 |
| | | class IPY_FBGeneralTrain(): |
| | |
| | | self.__LoadFileData("ChinMap", onlyCheck)
|
| | | self.__LoadFileData("FBFunc", onlyCheck)
|
| | | self.__LoadFileData("FBLine", onlyCheck)
|
| | | self.__LoadFileData("ADAward", onlyCheck)
|
| | | self.__LoadFileData("FBGeneralTrain", onlyCheck)
|
| | | self.__LoadFileData("DailyAction", onlyCheck)
|
| | | self.__LoadFileData("EquipGSParam", onlyCheck)
|
| | |
| | | self.CheckLoadData("FBLine") |
| | | return self.ipyFBLineCache[index]
|
| | | |
| | | def GetADAwardCount(self): |
| | | self.CheckLoadData("ADAward") |
| | | return self.ipyADAwardLen
|
| | | def GetADAwardByIndex(self, index): |
| | | self.CheckLoadData("ADAward") |
| | | return self.ipyADAwardCache[index]
|
| | | |
| | | def GetFBGeneralTrainCount(self): |
| | | self.CheckLoadData("FBGeneralTrain") |
| | | return self.ipyFBGeneralTrainLen
|
| | |
| | | # @param tick 当前时间
|
| | | # @return None or True
|
| | | # @remarks 函数详细说明.
|
| | | def __DoPickup(curPlayer, mapItemID, tick, isGuard):
|
| | | def __DoPickup(curPlayer, mapItemID, tick):
|
| | |
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | mapItemManager = GameWorld.GetMapItemManager()
|
| | |
| | | posX, posY, itemPosX, itemPosY = curPlayer.GetPosX(), curPlayer.GetPosY(), mapItem.GetPosX(), mapItem.GetPosY()
|
| | | pickDist = GameWorld.GetDist(posX, posY, itemPosX, itemPosY)
|
| | | # 守护拾取不验证拾取范围
|
| | | if not isGuard and pickDist > curPlayer.GetPickupDist():
|
| | | if pickDist > curPlayer.GetPickupDist():
|
| | | #距离过远, 不能捡起
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_805889")
|
| | | GameWorld.Log("当前距离过远, mapItemID=%s,dropItemNPCID=%s,玩家(%d,%d)-物品(%d,%d),pickDist=%s > playerPickupDist=%s"
|
| | |
| | | mapID = GameWorld.GetGameWorld().GetMapID()
|
| | | lineID = 0 if GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtNull else PlayerControl.GetFBFuncLineID(curPlayer)
|
| | | #合并地图的,使用前端lineID,即 FBID
|
| | | if mapID in [ChConfig.Def_FBMapID_BossHome]:
|
| | | lineID = curPlayer.GetClientLineID()
|
| | | #if mapID in [ChConfig.Def_FBMapID_BossHome]:
|
| | | # lineID = curPlayer.GetClientLineID()
|
| | | NPCCommon.SendGameServerGoodItemRecord(curPlayer, mapID, lineID, dropItemNPCID, curItemID, equipInfo)
|
| | |
|
| | | # 不需要队伍提示
|
| | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #// A3 12 守护拾取物品 #tagCMGuardPickupItem
|
| | | #
|
| | | #struct tagCMGuardPickupItem
|
| | | #{
|
| | | # tagHead Head;
|
| | | # WORD ItemCount;
|
| | | # WORD MapItemID[ItemCount]; //size = ItemCount
|
| | | #};
|
| | | def OnGuardPickupItem(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | mapItemIDList = clientData.MapItemID
|
| | | __DoPickupItem(curPlayer, mapItemIDList, tick, True)
|
| | | return
|
| | |
|
| | | ## 玩家拾取物品(封包参数)
|
| | | # @param index 当前玩家索引
|
| | | # @param tick 当前时间
|
| | |
| | | #玩家捡起物品
|
| | | pickPack = IPY_GameWorld.IPY_PickUpItem()
|
| | | mapItemID = pickPack.GetMapItemID()
|
| | | __DoPickupItem(curPlayer, [mapItemID], tick, False)
|
| | | __DoPickupItem(curPlayer, [mapItemID], tick)
|
| | | return
|
| | |
|
| | | def __DoPickupItem(curPlayer, mapItemIDList, tick, isGuard):
|
| | | # @param isGuard: 是否守护拾取
|
| | | |
| | | if isGuard and GameWorld.GetMap().GetMapFBType() != IPY_GameWorld.fbtNull:
|
| | | mapID = curPlayer.GetMapID()
|
| | | fbIpyData = FBCommon.GetFBIpyData(mapID)
|
| | | if fbIpyData and not fbIpyData.GetGuardPick():
|
| | | GameWorld.Log("该地图守护无法拾取物品! mapID=%s" % mapID, curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | # #单人副本一键拾取
|
| | | # if GameWorld.GetMap().GetMapFBType() == IPY_GameWorld.fbtSingle:
|
| | | # SingleFBTPickUP(curPlayer, mapItemID, tick)
|
| | | # return
|
| | | |
| | | def __DoPickupItem(curPlayer, mapItemIDList, tick):
|
| | | if not mapItemIDList:
|
| | | GameWorld.ErrLog("没有指定要拾取的地图物品ID!", curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | succMapItemIDList = [] # 成功拾取的地图物品
|
| | | for mapItemID in mapItemIDList:
|
| | | if __DoPickup(curPlayer, mapItemID, tick, isGuard):
|
| | | if __DoPickup(curPlayer, mapItemID, tick):
|
| | | succMapItemIDList.append(mapItemID)
|
| | |
|
| | | if succMapItemIDList:
|
| | | GameWorld.Log("成功拾取地图物品, succMapItemIDList=%s" % (succMapItemIDList), curPlayer.GetPlayerID())
|
| | | |
| | | # 守护拾取的,附加同步守护拾取结果
|
| | | if isGuard and succMapItemIDList:
|
| | | guradPickupSucc = ChPyNetSendPack.tagMCGuradPickupItemSucc()
|
| | | guradPickupSucc.MapItemID = succMapItemIDList
|
| | | guradPickupSucc.ItemCount = len(guradPickupSucc.MapItemID)
|
| | | NetPackCommon.SendFakePack(curPlayer, guradPickupSucc)
|
| | | |
| | | # 玩家拾取结果目前客户端暂时无用,不通知
|
| | | # if not __DoPickup(curPlayer, mapItemID, tick):
|
| | | # curPlayer.Notify_PickupItemResult(mapItemID, 0)
|
| | | # else:
|
| | | # curPlayer.Notify_PickupItemResult(mapItemID, 1)
|
| | | return
|
| | |
|
| | |
|
| | | ###单人副本一键拾取
|
| | | ## @param curPlayer mapItemID
|
| | | ## @return None
|
| | | #def SingleFBTPickUP(curPlayer, mapItemID, tick):
|
| | | # mapItemManager = GameWorld.GetMapItemManager()
|
| | | # curMapItem = mapItemManager.GetItemByID(mapItemID)
|
| | | # if curMapItem == None or curMapItem.IsEmpty():
|
| | | # return
|
| | | #
|
| | | # posX = curPlayer.GetPosX()
|
| | | # posY = curPlayer.GetPosY()
|
| | | # itemPosX = curMapItem.GetPosX()
|
| | | # itemPosY = curMapItem.GetPosY()
|
| | | # |
| | | # pickDist = GameWorld.GetDist(posX, posY, itemPosX, itemPosY)
|
| | | #
|
| | | # if pickDist > curPlayer.GetPickupDist():
|
| | | # #距离过远, 不能捡起
|
| | | # PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_805889")
|
| | | # return
|
| | | # |
| | | # mapItemIDList = [curMapItem.GetID()]
|
| | | # #拾取当前格子周围的物品
|
| | | # mapItemManager = GameWorld.GetMapItemManager()
|
| | | # for index in range(mapItemManager.GetMapItemCount()):
|
| | | # mapItem = mapItemManager.GetMapItemByIndex(index)
|
| | | # if not mapItem or mapItem.IsEmpty():
|
| | | # continue
|
| | | # |
| | | # mapItemObjID = mapItem.GetID()
|
| | | # if mapItemObjID in mapItemIDList:
|
| | | # continue
|
| | | # |
| | | # curItem = mapItem.GetItem()
|
| | | # # 只一键拾取金钱
|
| | | # if curItem.GetType() != ChConfig.Def_ItemType_Money:
|
| | | # continue
|
| | | # |
| | | # pickDist = GameWorld.GetDist(posX, posY, mapItem.GetPosX(), mapItem.GetPosY())
|
| | | # |
| | | # if pickDist > curPlayer.GetPickupDist():
|
| | | # continue
|
| | | # |
| | | # mapItemIDList.append(mapItemObjID)
|
| | | # |
| | | # for mapItemID in mapItemIDList:
|
| | | # if not __DoPickup(curPlayer, mapItemID, tick):
|
| | | # curPlayer.Notify_PickupItemResult(mapItemID, 0)
|
| | | # else:
|
| | | # curPlayer.Notify_PickupItemResult(mapItemID, 1)
|
| | | # |
| | | # return
|
| | | #---------------------------------------------------------------------
|
| | | ## 玩家使用物品 ->自身效果(封包参数)
|
| | | # @param index 当前玩家索引
|
| | |
| | | # 暗金boss
|
| | | if ChConfig.IsGameBoss(curNPC):
|
| | | # 通知GameServer boss状态 封魔坛在副本里单独处理
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog('BOSSInfo', npcid)
|
| | | if ipyData and ipyData.GetMapID() not in [ChConfig.Def_FBMapID_SealDemon, ChConfig.Def_FBMapID_ZhuXianBoss]:
|
| | | GameServe_GameWorldBossState(npcid, 0)
|
| | | #GameWorld.GetGameWorld().SetGameWorldDict(ChConfig.Map_NPC_WorldBossDeadTick % npcid, GameWorld.GetGameWorld().GetTick())
|
| | | #因为存在boss分流,所以用gameFB字典,但是存活状态还是用GameWorld字典
|
| | | GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_NPC_WorldBossDeadTick % npcid, GameWorld.GetGameWorld().GetTick())
|
| | | #ipyData = IpyGameDataPY.GetIpyGameDataNotLog('BOSSInfo', npcid)
|
| | | #if ipyData and ipyData.GetMapID() not in [ChConfig.Def_FBMapID_SealDemon, ChConfig.Def_FBMapID_ZhuXianBoss]:
|
| | | # GameServe_GameWorldBossState(npcid, 0)
|
| | | # #GameWorld.GetGameWorld().SetGameWorldDict(ChConfig.Map_NPC_WorldBossDeadTick % npcid, GameWorld.GetGameWorld().GetTick())
|
| | | # #因为存在boss分流,所以用gameFB字典,但是存活状态还是用GameWorld字典
|
| | | # GameWorld.GetGameFB().SetGameFBDict(ChConfig.Map_NPC_WorldBossDeadTick % npcid, GameWorld.GetGameWorld().GetTick())
|
| | |
|
| | | ChNPC.OnNPCSetDead(curNPC)
|
| | |
|
| | |
| | | PlayerFeastTravel.AddFeastTravelTaskValue(curPlayer, ChConfig.Def_FeastTravel_BossHome, 1)
|
| | | PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_BossHome, 1)
|
| | |
|
| | | if mapID == ChConfig.Def_FBMapID_CrossPenglai:
|
| | | #跨服蓬莱仙境
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_CrossPenglai)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillCrossPenglaiBoss, 1)
|
| | | PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_KillCrossPenglaiBoss, 1)
|
| | | PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_CrossPenglaiBoss, 1)
|
| | | elif mapID == ChConfig.Def_FBMapID_CrossDemonLand:
|
| | | #跨服魔化之地
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_CrossDemonLand)
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillCrossDemonLandBoss, 1)
|
| | | PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_KillCrossDemonLandBoss, 1)
|
| | | PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_CrossDemonLandBoss, 1)
|
| | | if mapID in [ChConfig.Def_FBMapID_CrossPenglai, ChConfig.Def_FBMapID_CrossDemonLand]:
|
| | | PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_CrossBoss, 1)
|
| | | # if mapID == ChConfig.Def_FBMapID_CrossPenglai:
|
| | | # #跨服蓬莱仙境
|
| | | # PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_CrossPenglai)
|
| | | # PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillCrossPenglaiBoss, 1)
|
| | | # PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_KillCrossPenglaiBoss, 1)
|
| | | # PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_CrossPenglaiBoss, 1)
|
| | | # elif mapID == ChConfig.Def_FBMapID_CrossDemonLand:
|
| | | # #跨服魔化之地
|
| | | # PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_CrossDemonLand)
|
| | | # PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_KillCrossDemonLandBoss, 1)
|
| | | # PlayerGubao.AddGubaoItemEffValue(curPlayer, PlayerGubao.GubaoEffType_KillCrossDemonLandBoss, 1)
|
| | | # PlayerActTask.AddActTaskValue(curPlayer, ChConfig.ActTaskType_CrossDemonLandBoss, 1)
|
| | | # if mapID in [ChConfig.Def_FBMapID_CrossPenglai, ChConfig.Def_FBMapID_CrossDemonLand]:
|
| | | # PlayerTongTianLing.AddTongTianTaskValue(curPlayer, ChConfig.TTLTaskType_CrossBoss, 1)
|
| | |
|
| | | # 个人首杀记录
|
| | | ipyData = IpyGameDataPY.GetIpyGameDataNotLog("BOSSFirstKill", npcID)
|
| | |
| | | #杀死NPC, 触发任务
|
| | | self.__EventKillNpc()
|
| | |
|
| | | mapID = GameWorld.GetMap().GetMapID()
|
| | | killerName = "" if not self.__Killer else self.__Killer.GetPlayerName()
|
| | | # 记录boss击杀信息的NPC
|
| | | bossIpyData = IpyGameDataPY.GetIpyGameDataListNotLog('BOSSInfo', npcID)
|
| | | if bossIpyData and mapID not in [ChConfig.Def_FBMapID_ZhuXianBoss, ChConfig.Def_FBMapID_SealDemon]:
|
| | | killerIDList = [player.GetPlayerID() for player in self.__ownerPlayerList]
|
| | | GameServer_KillGameWorldBoss(curNPC.GetNPCID(), killerName, 0, True, killerIDList)
|
| | | #mapID = GameWorld.GetMap().GetMapID()
|
| | | #killerName = "" if not self.__Killer else self.__Killer.GetPlayerName()
|
| | | ## 记录boss击杀信息的NPC
|
| | | #bossIpyData = IpyGameDataPY.GetIpyGameDataListNotLog('BOSSInfo', npcID)
|
| | | #if bossIpyData and mapID not in [ChConfig.Def_FBMapID_ZhuXianBoss, ChConfig.Def_FBMapID_SealDemon]:
|
| | | # killerIDList = [player.GetPlayerID() for player in self.__ownerPlayerList]
|
| | | # GameServer_KillGameWorldBoss(curNPC.GetNPCID(), killerName, 0, True, killerIDList)
|
| | |
|
| | | if npcID == IpyGameDataPY.GetFuncCfg("BossRebornServerBoss", 3):
|
| | | PlayerControl.WorldNotify(0, "BossRebornBossKilled", [curNPC.GetNPCID()])
|
| | |
| | | import PlayerHero
|
| | | import PlayerOnline
|
| | | import TurnAttack
|
| | | import ObjPool
|
| | |
|
| | | import datetime
|
| | | import time
|
| | |
| | | PlayerGoldRush.OnPlayerLogin(curPlayer)
|
| | | PlayerActFamilyGCZ.OnPlayerLogin(curPlayer)
|
| | | PlayerTalk.OnPlayerLogin(curPlayer)
|
| | | SyncADCntInfo(curPlayer)
|
| | |
|
| | | # 上线查询一次充值订单
|
| | | curPlayer.SendDBQueryRecharge()
|
| | |
| | | NetPackCommon.SendFakePack(curPlayer, awardReceiveState)
|
| | | return
|
| | |
|
| | | def PlayerOnDay(curPlayer):
|
| | | #玩法前瞻奖励
|
| | | gameNoticeAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GameNoticeAwardState)
|
| | | if gameNoticeAwardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GameNoticeAwardState, 0)
|
| | | Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_GameNotice, 0)
|
| | | #每日分享奖励重置
|
| | | shareGameAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShareGameAwardState)
|
| | | if shareGameAwardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShareGameAwardState, 0)
|
| | | Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_ShareGame, 0)
|
| | | #开服每日奖励
|
| | | awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OpenSererDailyAward)
|
| | | if awardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OpenSererDailyAward, 0)
|
| | | Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_OpenServerDailyAward, 0)
|
| | | #开服每日奖励
|
| | | awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RechargeDayAward)
|
| | | if awardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RechargeDayAward, 0)
|
| | | Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_RechargeDayAward, 0)
|
| | | ADCntOnDay(curPlayer)
|
| | | return
|
| | |
|
| | | #//A5 04 玩家领取奖励 #tagCMPlayerGetReward
|
| | | #
|
| | | #struct tagCMPlayerGetReward
|
| | |
| | | # 仙树免费减时
|
| | | elif rewardType == ChConfig.Def_RewardType_TreeFreeTime:
|
| | | PlayerTree.FreeReduceTreeLVTime(curPlayer)
|
| | | # 广告奖励
|
| | | elif rewardType == ChConfig.Def_RewardType_ADAward:
|
| | | OnGetADAward(curPlayer, dataEx)
|
| | | # 每日免费直购礼包
|
| | | elif rewardType == ChConfig.Def_RewardType_DayFreeGoldGift:
|
| | | PlayerDailyGiftbag.OnGetDailyFreeGiftbag(curPlayer)
|
| | |
| | | OnGetRechargeDayAward(curPlayer, rewardType)
|
| | | return
|
| | |
|
| | | def OnGetADAward(curPlayer, adID):
|
| | | ipyData = IpyGameDataPY.GetIpyGameData("ADAward", adID)
|
| | | if not ipyData:
|
| | | return
|
| | | adCntMax = ipyData.GetADCntMax()
|
| | | adCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADCnt % adID)
|
| | | if adCnt >= adCntMax:
|
| | | GameWorld.DebugLog("今日该广告奖励已达上限! adID=%s,adCnt=%s > %s" % (adID, adCnt, adCntMax))
|
| | | return
|
| | | adCnt += 1
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ADCnt % adID, adCnt)
|
| | | awardItemList = ipyData.GetADAwardItemList()
|
| | | adMapID = ipyData.GetADMapID()
|
| | | GameWorld.DebugLog("领取广告奖励! adID=%s,adCnt=%s,adMapID=%s,awardItemList=%s" % (adID, adCnt, adMapID, awardItemList))
|
| | | SyncADCntInfo(curPlayer, [adID])
|
| | | |
| | | if adMapID:
|
| | | FBCommon.AddFBADCnt(curPlayer, adMapID)
|
| | | |
| | | if awardItemList:
|
| | | ItemControler.GivePlayerItemOrMail(curPlayer, awardItemList, event=["ADAward", False, {}])
|
| | | |
| | | return
|
| | |
|
| | | def ADCntOnDay(curPlayer):
|
| | | syncADIDList = []
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | for index in xrange(ipyDataMgr.GetADAwardCount()):
|
| | | ipyData = ipyDataMgr.GetADAwardByIndex(index)
|
| | | adID = ipyData.GetADID()
|
| | | if not curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADCnt % adID):
|
| | | continue
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ADCnt % adID, 0)
|
| | | syncADIDList.append(adID)
|
| | | if syncADIDList:
|
| | | SyncADCntInfo(curPlayer, syncADIDList)
|
| | | return
|
| | |
|
| | | def SyncADCntInfo(curPlayer, syncADIDList=None):
|
| | | if not syncADIDList:
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | adIDList = [ipyDataMgr.GetADAwardByIndex(i).GetADID() for i in xrange(ipyDataMgr.GetADAwardCount())]
|
| | | else:
|
| | | adIDList = syncADIDList
|
| | | |
| | | adInfoList = []
|
| | | for adID in adIDList:
|
| | | adCnt = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ADCnt % adID)
|
| | | if not adCnt and syncADIDList == None:
|
| | | continue
|
| | | adInfo = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCADInfo)
|
| | | adInfo.ADID = adID
|
| | | adInfo.ADCnt = adCnt
|
| | | adInfoList.append(adInfo)
|
| | | |
| | | if not adInfoList:
|
| | | return
|
| | | |
| | | clientPack = ObjPool.GetPoolMgr().acquire(ChPyNetSendPack.tagSCADInfoList)
|
| | | clientPack.ADInfoList = adInfoList[:255]
|
| | | clientPack.Count = len(clientPack.ADInfoList)
|
| | | NetPackCommon.SendFakePack(curPlayer, clientPack)
|
| | | return
|
| | |
|
| | | def OnGetRechargeDayAward(curPlayer, rewardType):
|
| | | ## 领取累充每日奖励,取最高档
|
| | | realTotal = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_CTGRealTotal)
|
| | |
| | | return
|
| | |
|
| | | # 不需要处理的跨服地图
|
| | | if crossMapID in [ChConfig.Def_FBMapID_CrossRealmPK]:
|
| | | if crossMapID in []:
|
| | | return
|
| | |
|
| | | if not IpyGameDataPY.GetFuncCfg("CrossSyncPlayerData", 1):
|
| | |
| | | #进入副本通用检查
|
| | | 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
|
| | |
|
| | |
| | | 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)
|
| | |
| | | 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 = 0
|
| | |
| | | #仙宫
|
| | | PlayerXiangong.PlayerOnDay(curPlayer)
|
| | | PlayerControl.PayCoinOnDay(curPlayer)
|
| | | #玩法前瞻奖励
|
| | | gameNoticeAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_GameNoticeAwardState)
|
| | | if gameNoticeAwardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_GameNoticeAwardState, 0)
|
| | | ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_GameNotice, 0)
|
| | | #每日分享奖励重置
|
| | | shareGameAwardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_ShareGameAwardState)
|
| | | if shareGameAwardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_ShareGameAwardState, 0)
|
| | | ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_ShareGame, 0)
|
| | | #开服每日奖励
|
| | | awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_OpenSererDailyAward)
|
| | | if awardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_OpenSererDailyAward, 0)
|
| | | ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_OpenServerDailyAward, 0)
|
| | | #开服每日奖励
|
| | | awardState = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_RechargeDayAward)
|
| | | if awardState:
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RechargeDayAward, 0)
|
| | | ChPlayer.Sync_RewardGetRecordInfo(curPlayer, ChConfig.Def_RewardType_RechargeDayAward, 0)
|
| | | ChPlayer.PlayerOnDay(curPlayer)
|
| | | |
| | | # 特殊时间点X点过天
|
| | | elif onEventType == ShareDefine.Def_OnEventTypeEx:
|
| | | PlayerHero.PlayerOnDay(curPlayer)
|
| | |
| | | #------------------------------------------------------------------------------
|
| | | #"""Version = 2016-12-02 11:00"""
|
| | | #------------------------------------------------------------------------------
|
| | | import IPY_GameWorld
|
| | | import PlayerControl
|
| | | import GameWorld
|
| | | import FBCommon
|
| | | import ChConfig
|
| | | import FBLogic
|
| | | import PlayerSuccess
|
| | | import ItemCommon
|
| | | import IpyGameDataPY
|
| | | import ShareDefine
|
| | | import GameFuncComm
|
| | | import NPCCommon
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # DWORD MapID;
|
| | | # WORD LineID;
|
| | | # BYTE Cnt; // 扫荡次数
|
| | | # BYTE IsFinish; // 是否立即完成; 0-否;1-花钱立即完成;2-客户端自行倒计时间到后发送2代表领取扫荡完成奖励
|
| | | # DWORD DataEx; //附带信息
|
| | | # BYTE IsLittleHelper; // 是否小助手扫荡
|
| | | #};
|
| | | def OnPlayerFBWipeOut(playerIndex, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(playerIndex)
|
| | |
|
| | | #if not GameWorld.CheckPlayerTick(curPlayer, ChConfig.TYPE_Player_Tick_BeginFBWipeOut, tick):
|
| | | # GameWorld.DebugLog("玩家副本扫荡请求CD中...", curPlayer.GetPlayerID())
|
| | | # return
|
| | | |
| | | mapID = clientData.MapID
|
| | | lineID = clientData.LineID
|
| | | cnt = clientData.Cnt
|
| | | #isFinish = clientData.IsFinish
|
| | | isFinish = 1 # 暂时默认1,之后有需要扫荡等待的再说
|
| | | dataEx = clientData.DataEx
|
| | | isLittleHelper = clientData.IsLittleHelper
|
| | | if isLittleHelper:
|
| | | if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_LittleHelper):
|
| | | GameWorld.DebugLog("玩家没有小助手功能权限!", curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | if cnt <= 0:
|
| | | return
|
| | |
|
| | | fbIpyData = FBCommon.GetFBIpyData(mapID)
|
| | | if FBCommon.GetRecordMapID(GameWorld.GetMap().GetMapID()) == FBCommon.GetRecordMapID(mapID):
|
| | | if fbIpyData and fbIpyData.GetDayTimes():#没有限制进入次数的不限制在目标地图扫荡
|
| | | GameWorld.DebugLog("玩家在扫荡目标地图中,无法扫荡!mapID=%s" % mapID)
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID, False)
|
| | | if not fbIpyData or not fbLineIpyData:
|
| | | GameWorld.DebugLog("不存在该副本或线路无法扫荡!mapID=%s, lineID=%s" % (mapID, lineID))
|
| | | return
|
| | |
|
| | | |
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID)
|
| | | if not fbLineIpyData:
|
| | | GameWorld.DebugLog("找不到该副本线路,无法扫荡!mapID=%s, lineID=%s" % (mapID, lineID))
|
| | | if not FBCommon.IsFBPass(curPlayer, mapID, lineID):
|
| | | GameWorld.DebugLog("未过关无法扫荡!mapID=%s, lineID=%s" % (mapID, lineID))
|
| | | return
|
| | |
|
| | | if FBCommon.CheckCanEnterFBComm(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, cnt) != ShareDefine.EntFBAskRet_OK:
|
| | | return
|
| | | costMoneyList = []
|
| | | sweepCostindexList = []
|
| | | sweepCostCnt = 0
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | | |
| | | if fbLineIpyData:
|
| | | #扫荡等级判断
|
| | | sweepLVLimit = fbLineIpyData.GetSweepLVLimit()
|
| | | if sweepLVLimit and curPlayer.GetLV() < sweepLVLimit:
|
| | | GameWorld.DebugLog('玩家副本扫荡,等级不足!mapID=%s, lineID=%s, playerLV=%s, sweepLVLimit=%s' |
| | | % (mapID, lineID, curPlayer.GetLV(), sweepLVLimit), curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | #扫荡道具判断,小助手不消耗扫荡道具
|
| | | sweepItemID = fbLineIpyData.GetSweepItemID()
|
| | | if sweepItemID and not isLittleHelper:
|
| | | sweepItemCnt = fbLineIpyData.GetSweepCostCnt()
|
| | | sweepCostCnt = sweepItemCnt * cnt
|
| | | #isEnough, sweepCostindexList = ItemCommon.GetItem_FromPack_ByID(sweepItemID, itemPack, sweepCostCnt)
|
| | | isEnough, sweepCostindexList, hasBind, lackCnt = ItemCommon.GetItem_FromPack_ByID_ExEx(sweepItemID, itemPack, sweepCostCnt)
|
| | | if not isEnough:
|
| | | itemPrice = ItemCommon.GetShopItemPrice(sweepItemID, IPY_GameWorld.TYPE_Price_Gold_Money)
|
| | | if itemPrice:
|
| | | costMoney = itemPrice * lackCnt
|
| | | costMoneyList = PlayerControl.HaveMoneyEx(curPlayer, ShareDefine.TYPE_Price_Gold_Paper_Money, costMoney)
|
| | | if not costMoneyList:
|
| | | GameWorld.DebugLog("扫荡消耗道具不足, mapID=%s,lineID=%s,sweepItemID=%s,sweepCostCnt=%s" |
| | | % (mapID, lineID, sweepItemID, sweepCostCnt), curPlayer.GetPlayerID())
|
| | | return
|
| | |
|
| | | # 副本是否可扫荡, 这里只判断副本自身的特殊条件, 公共条件上面已经判断
|
| | | if not FBLogic.OnPlayerFBSweepAsk(curPlayer, mapID, lineID, cnt, isFinish, dataEx):
|
| | | if not FBLogic.OnPlayerFBSweepAsk(curPlayer, mapID, lineID, cnt, dataEx):
|
| | | GameWorld.DebugLog("该副本当前无法扫荡!mapID=%s, lineID=%s" % (mapID, lineID))
|
| | | return
|
| | |
|
| | | PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_FBSweep, 1, [mapID])
|
| | | |
| | | #扣除扫荡道具
|
| | | if sweepCostindexList and sweepCostCnt:
|
| | | ItemCommon.ReduceItem(curPlayer, itemPack, sweepCostindexList, sweepCostCnt, False, 'FBSweepCostItem')
|
| | | if costMoneyList:
|
| | | infoDict = {"MapID":mapID, "LineID":lineID, 'SweepCount':cnt}
|
| | | for moneyType, moneyNum in costMoneyList:
|
| | | if not PlayerControl.PayMoney(curPlayer, moneyType, moneyNum, ChConfig.Def_Cost_FBSweep, infoDict):
|
| | | return False, hasBind
|
| | | #PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_FeastRedPack_FBSweep, 1, [mapID])
|
| | |
|
| | | #需先扣除门票, 再增加次数, 否则可能导致扣除的数量错误
|
| | | FBCommon.DelFBEnterTicket(curPlayer, mapID, lineID, cnt)
|
| | | #FBCommon.DelFBEnterTicket(curPlayer, mapID, lineID, cnt)
|
| | |
|
| | | #增加副本进入次数
|
| | | if fbIpyData and fbIpyData.GetDayTimes():
|
| | | FBCommon.AddEnterFBCount(curPlayer, mapID, cnt)
|
| | |
|
| | | #扫荡结果给奖励等
|
| | | FBLogic.OnPlayerFBSweepResult(curPlayer, mapID, lineID, cnt, isFinish, dataEx)
|
| | | FBLogic.OnPlayerFBSweepResult(curPlayer, mapID, lineID, cnt, dataEx)
|
| | | return
|
| | |
|
| | | #// B1 08 快速一键过关副本 #tagCMFBQuickPass
|
| | |
| | | canCreate, notifyMark = CheckCanCreateFuncTeam(playerID, teamInfo, zoneID)
|
| | |
|
| | | # 某些功能创建前检查
|
| | | if funcMapID == ChConfig.Def_FBMapID_CrossBattlefield:
|
| | | pass
|
| | | #if funcMapID == ChConfig.Def_FBMapID_CrossBattlefield:
|
| | | # pass
|
| | |
|
| | | newTeam = None
|
| | | teamID = 0
|
| | |
| | | newTeamInfo = newTeam.GetSyncDict(True)
|
| | |
|
| | | # 某些功能创建后处理
|
| | | if funcMapID == ChConfig.Def_FBMapID_CrossBattlefield:
|
| | | pass
|
| | | #if funcMapID == ChConfig.Def_FBMapID_CrossBattlefield:
|
| | | # pass
|
| | |
|
| | | else:
|
| | | if not notifyMark:
|
| | |
| | | # GameWorld.DebugLog(" 创建新战盟家园: tagFamilyID=%s,tagFamilyHomeLV=%s,resultLineID=%s"
|
| | | # % (tagFamilyID, tagFamilyHomeLV, resultLineID))
|
| | | #===================================================================================================
|
| | | elif tagMapID in [ChConfig.Def_FBMapID_HorsePetBoss, ChConfig.Def_FBMapID_SealDemon, ChConfig.Def_FBMapID_ZhuXianBoss, ChConfig.Def_FBMapID_AllFamilyBoss, ChConfig.Def_FBMapID_DemonKing]:
|
| | | elif tagMapID in []:
|
| | | tagMapPropertyID = tagMapLineID + 1 # 因为PropertyID默认是0,所以使用时从1开始
|
| | | resultLineID = -1 # 结果lineID
|
| | |
|
| | |
| | | GameFuncID_GodWeapon = -1 # 神器 20
|
| | | GameFuncID_OSSail = -1 # 开服特惠 132
|
| | | GameFuncID_AddPoint = -1 # 加点功能/灵根功能 145
|
| | | GameFuncID_LittleHelper = -1 # 小助手 146
|
| | |
|
| | | #家族悬赏任务完成状态记录位标识
|
| | | Def_ArrestOverState_BitDic = {
|
| | |
| | | # 避免配表错误导致报错
|
| | | return False
|
| | |
|
| | | if GameWorld.GetMap().GetMapID() == ChConfig.Def_FBMapID_GatherSoul and curObj.GetGameObjType() == IPY_GameWorld.gotNPC:
|
| | | if curSkill.GetSkillTypeID() != 23052:
|
| | | #GameWorld.DebugLog('聚魂副本玩家不能对怪物上buff curSkill=%s,buffOwner=%s'%(curSkill.GetSkillTypeID(),buffOwner.GetID()))
|
| | | return True
|
| | | #GameWorld.DebugLog('聚魂副本对怪物上buff curSkill=%s,buffOwner=%s'%(curSkill.GetSkillTypeID(),buffOwner.GetID()))
|
| | | |
| | | if curObj.GetGameObjType() == IPY_GameWorld.gotNPC and curObj.GetIsBoss() not in ChConfig.Def_SkillAttack_NPCIsBoss \
|
| | | and SkillCommon.GetSkillBattleType(curSkill) == ChConfig.Def_BattleRelationType_CommNoBoss and SkillShell.IsNPCSkillResist(curObj):
|
| | | # 释放后 对指定BOSS无效的技能
|
| | |
| | | continue
|
| | | npcObj.StopMove()
|
| | | npcObj.ChangePos(npcPos.PosX, npcPos.PosY)
|
| | | BeatBackMove(curPlayer, npcObj)
|
| | | #BeatBackMove(curPlayer, npcObj)
|
| | | return
|
| | |
|
| | | # 针对NPC被推出远距离一直卡墙角问题,法宝挑战副本特殊处理为超过4米 NPC自动回退一些
|
| | | def BeatBackMove(curPlayer, npcObj):
|
| | | if GameWorld.GetMap().GetMapID() != ChConfig.Def_FBMapID_MagicWeapon:
|
| | | return
|
| | | if npcObj.GetCurAction() == IPY_GameWorld.laNPCSkillWarning:
|
| | | return
|
| | | |
| | | posMap = npcObj.GetRefreshPosAt(npcObj.GetCurRefreshPointIndex())
|
| | | if not posMap:
|
| | | return
|
| | | #范围校验
|
| | | posMapX = posMap.GetPosX()
|
| | | posMapY = posMap.GetPosY()
|
| | | if GameWorld.GetDist(npcObj.GetPosX(), npcObj.GetPosY(), posMapX, posMapY) < 8:
|
| | | # 单次位移不超过5米
|
| | | return
|
| | | npcControl = NPCCommon.NPCControl(npcObj)
|
| | | moveDestX, moveDestY = npcControl.GetMoveNearPosEx(posMapX, posMapY, 5)
|
| | | npcObj.Move(moveDestX, moveDestY)
|
| | | return
|
| | | ## 针对NPC被推出远距离一直卡墙角问题,法宝挑战副本特殊处理为超过4米 NPC自动回退一些
|
| | | #def BeatBackMove(curPlayer, npcObj):
|
| | | # if GameWorld.GetMap().GetMapID() != ChConfig.Def_FBMapID_MagicWeapon:
|
| | | # return
|
| | | # if npcObj.GetCurAction() == IPY_GameWorld.laNPCSkillWarning:
|
| | | # return
|
| | | # |
| | | # posMap = npcObj.GetRefreshPosAt(npcObj.GetCurRefreshPointIndex())
|
| | | # if not posMap:
|
| | | # return
|
| | | # #范围校验
|
| | | # posMapX = posMap.GetPosX()
|
| | | # posMapY = posMap.GetPosY()
|
| | | # if GameWorld.GetDist(npcObj.GetPosX(), npcObj.GetPosY(), posMapX, posMapY) < 8:
|
| | | # # 单次位移不超过5米
|
| | | # return
|
| | | # npcControl = NPCCommon.NPCControl(npcObj)
|
| | | # moveDestX, moveDestY = npcControl.GetMoveNearPosEx(posMapX, posMapY, 5)
|
| | | # npcObj.Move(moveDestX, moveDestY)
|
| | | # return
|
| | |
|
| | | #===============================================================================
|
| | | # //B4 03 吸引NPC仇恨 #tagNPCAttention
|