Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode
| | |
| | | DWORD CftBleedDamage; //流血伤害系数
|
| | | DWORD CftFaintRate; //击晕系数
|
| | | DWORD CftSuperHitReduce; //暴击抗性系数
|
| | | DWORD CftSuperHitRate; //暴击率系数
|
| | | DWORD CftLuckyHitRate; //会心一击率系数
|
| | | DWORD CftLuckyHitRateReduce; //会心一击抗性系数
|
| | | DWORD CftSkillAtkRate; //技能伤害系数
|
| | | DWORD CftSkillAtkRateReduce; //技能减伤系数
|
| | |
| | | BYTE AlchemyQuality; //秘方品级
|
| | | DWORD LearnNeedItemID; //丹方物品ID
|
| | | BYTE LearnNeedAlchemLV; //丹方需要炼丹等级
|
| | | WORD LearnNeedLuck; //丹方需要慧根
|
| | | WORD LearnNeedLingGenPoint; //丹方需要总灵根点数
|
| | | WORD NeedTime; //炼丹时间(秒)
|
| | | WORD AlchemyExp; //炼丹获得经验值
|
| | | dict Material; //炼丹材料
|
| | |
| | | DailyActionID_SkyTower, # 天星塔 23
|
| | | DailyActionID_HorsePetBoss, # 骑宠BOSS 24
|
| | | DailyActionID_FairyDomain, # 缥缈仙域 25
|
| | | ) = range(1, 25 + 1)
|
| | | DailyActionID_LVUP, # 玩家等级提升 26
|
| | | ) = range(1, 26 + 1)
|
| | |
|
| | |
|
| | |
|
| | |
| | |
|
| | | # 每日活跃度
|
| | | Def_PDict_Activity_FinishCnt = "Activity_FinishCnt_%s" # 活跃度类型对应完成次数
|
| | | Def_PDict_Activity_TotalPoint = "Activity_TotalPoint" # 当前总活跃值
|
| | | Def_PDict_Activity_TotalPoint = "Activity_TotalPoint" # 当前总活跃值(不可消耗)
|
| | | Def_PDict_ActivityCanCostTotalPoint = "ActivityCanCostTotalPoint" # 当前总活跃值(可消耗)
|
| | | Def_PDict_ActivityAwardRecord = "ActivityAwardRecord" # 活跃度奖励领取记录,按二进制位标识
|
| | | Def_PDict_Activity_AwardStage = "Activity_AwardStage" # 当前活跃奖励阶段
|
| | | Def_PDict_Activity_RealmPoint = "Activity_RealmPoint" # 当前可领修行点
|
| | | Def_PDict_Activity_ExtraRealmPoint = "Activity_ExtraRealmPoint" # 多倍活动额外获得的修行点
|
| | |
|
| | | # 每日活动
|
| | | Def_PDict_DailyActionDayTimes = "DailyActionDayTimes_%s" # 每日活动今日完成次数 参数每日活动ID
|
| | | Def_PDict_DailyActionDayBuyTimes = "DADayBuyTimes_%s" # 每日活动今日购买次数 参数每日活动ID
|
| | |
| | | # @return None <Classlvpluslv classLV="" plusLV="" value="cnt"/>
|
| | | def ConditionType_Classlvpluslv(curPlayer, curMission, curActionNode):
|
| | | classLV = GameWorld.ToIntDef(curActionNode.GetAttribute("classLV"), 0)
|
| | | if not classLV:
|
| | | return
|
| | | classLVList = [classLV] if classLV else xrange(1, IpyGameDataPY.GetFuncCfg('EquipMaxClasslv') + 1)
|
| | | needPlusLV = GameWorld.ToIntDef(curActionNode.GetAttribute("plusLV"), 0)
|
| | | totalCnt = 0
|
| | | equipPlaceList = ChConfig.Pack_EquipPart_CanPlusStar[IPY_GameWorld.rptEquip]
|
| | | for equipPlace in equipPlaceList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, ipyData.GetGridIndex())
|
| | | if partStarLV >= needPlusLV:
|
| | | totalCnt += 1
|
| | | for classLV in classLVList:
|
| | | ipyData = IpyGameDataPY.GetIpyGameData('EquipPlaceIndexMap', classLV, equipPlace)
|
| | | if not ipyData:
|
| | | continue
|
| | | partStarLV = ChEquip.GetEquipPartPlusLV(curPlayer, IPY_GameWorld.rptEquip, ipyData.GetGridIndex())
|
| | | if partStarLV >= needPlusLV:
|
| | | totalCnt += 1
|
| | | return totalCnt >= GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | |
|
| | | ##装备总星级
|
| | |
| | |
|
| | | ##已镶嵌X等级宝石数量
|
| | | # @param None
|
| | | # @return None <Equiptotalstone value="cnt" stoneLV=""/>
|
| | | # @return None <Equipstonecnt value="cnt" stoneLV=""/>
|
| | | def ConditionType_Equipstonecnt(curPlayer, curMission, curActionNode):
|
| | | totalCnt = GameWorld.ToIntDef(curActionNode.GetAttribute("value"), 0)
|
| | | stoneLV = GameWorld.ToIntDef(curActionNode.GetAttribute("lv"), 0)
|
| | | stoneLV = GameWorld.ToIntDef(curActionNode.GetAttribute("stoneLV"), 0)
|
| | | return Operate_EquipStone.GetStoneCntByLV(curPlayer, stoneLV) >= totalCnt
|
| | |
|
| | | ##设置已镶嵌X等级宝石数量
|
| | |
| | | # @param curMission 任务实例
|
| | | # @param curActionNode节点信息
|
| | | # @return 返回值无意义
|
| | | # @remarks <Set_Equiptotalstone key="" stoneLV="[]"/>
|
| | | def DoType_Set_Equiptotalstone(curPlayer, curMission, curActionNode):
|
| | | # @remarks <Set_Equipstonecnt key="" stoneLV="宝石等级"/>
|
| | | def DoType_Set_Equipstonecnt(curPlayer, curMission, curActionNode):
|
| | | key = curActionNode.GetAttribute("key")
|
| | | questID = GameWorld.ToIntDef(curActionNode.GetAttribute("id"), 0)
|
| | | stoneLV = GameWorld.ToIntDef(curActionNode.GetAttribute("lv"), 1)
|
| | | stoneLV = GameWorld.ToIntDef(curActionNode.GetAttribute("stoneLV"), 1)
|
| | | if questID != 0:
|
| | | curMission = curPlayer.FindMission(questID)
|
| | | curMission.SetProperty(key, Operate_EquipStone.GetStoneCntByLV(curPlayer, stoneLV))
|
| | |
| | | ipyData = IpyGameDataPY.InterpolationSearch('FairyAdventures', 'OpenServerDay', openServerDay, {'EventID':fdEventID})
|
| | | if ipyData:
|
| | | conditionList = ipyData.GetCondition()
|
| | | condition = random.choice(conditionList)
|
| | | index = conditionList.index(condition)
|
| | | if conditionList:
|
| | | condition = random.choice(conditionList)
|
| | | index = conditionList.index(condition)
|
| | | else:
|
| | | index = 0
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyAdventuresData % fdEventID, ipyData.GetID() * 100 + index)
|
| | |
|
| | | #设置寻访中
|
| | |
| | |
|
| | | return
|
| | |
|
| | | ## 自定义场景采集OK
|
| | | ## 自定义场景采集OK,需自带是否允许采集的判断
|
| | | def OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | | do_FBLogic_ID = __GetFBLogic_MapID(mapID)
|
| | |
|
| | | callFunc = GameWorld.GetExecFunc(FBProcess, "GameLogic_%s.%s" % (do_FBLogic_ID, "OnCustomSceneCollectOK"))
|
| | |
|
| | | if callFunc:
|
| | | callFunc(curPlayer, mapID, lineID, npcID)
|
| | | return callFunc(curPlayer, mapID, lineID, npcID)
|
| | |
|
| | | return
|
| | |
|
| | |
| | |
|
| | | return
|
| | |
|
| | | ## 自定义场景采集OK,需自带是否允许采集的判断
|
| | | def OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | | curState = PlayerFairyDomain.GetFairyDomainFBEventState(curPlayer, mapID, lineID)
|
| | | return curState == PlayerFairyDomain.FDEventState_Visiting
|
| | |
|
| | | def DecCustomSceneNPCCount(curPlayer, npcID):
|
| | | ## 减少草园自定义场景NPC,默认减少一个
|
| | | mapID = GetGrasslandMapID(curPlayer)[0]
|
| | |
| | | return
|
| | | return True
|
| | |
|
| | | ## 自定义场景采集OK
|
| | | ## 自定义场景采集OK,需自带是否允许采集的判断
|
| | | def OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | |
|
| | | curState = PlayerFairyDomain.GetFairyDomainFBEventState(curPlayer, mapID, lineID)
|
| | |
| | |
|
| | | overDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
|
| | | FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_FairyTreasure, lineID, 1, overDict)
|
| | | return
|
| | | return True
|
| | |
|
| | |
|
| | |
| | | maxCnt = FBCommon.GetEnterFBMaxCnt(curPlayer, mapID)
|
| | | if enterCnt + 2 > maxCnt:
|
| | | return False
|
| | | if lineID in newbielineList:
|
| | | hasEnter = GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_PlayerFBStar_MapId, lineID, False,
|
| | | [ChConfig.Def_FBMapID_SealDemon])
|
| | | if hasEnter:
|
| | | GameWorld.DebugLog(" 已进入过该新手线路 %s" % lineID)
|
| | | return False
|
| | | return True
|
| | |
|
| | |
|
| | |
| | | #for _ in xrange(addCnt):
|
| | | jsonItemList, totalExp, totalMoney = NPCCommon.GiveKillNPCDropPrize(curPlayer, ChConfig.Def_FBMapID_SealDemon, {bossID:addCnt},
|
| | | mailTypeKey="SealDemonMail", isMail=isMail, prizeMultiple=prizeMultiple,
|
| | | dropItemMapInfo=dropItemMapInfo)
|
| | | dropItemMapInfo=dropItemMapInfo,isVirtualDrop=isClientSend)
|
| | | for jsonItem in jsonItemList:
|
| | | if 'UserData' in jsonItem:
|
| | | equipList.append(jsonItem)
|
| | |
| | | if rank == 1:
|
| | | bossID = CurFBLineBOSSID(lineID)
|
| | | NPCCommon.GameServer_KillGameWorldBoss(bossID, curPlayer.GetName(), hurt, False)
|
| | | |
| | | if not prizeItemList:
|
| | | leaveTick = FBCommon.GetFBLineStepTime(mapID, lineID) * 1000
|
| | | GameWorld.Log("没有奖励,直接通知前端结算!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
| | | curPlayer.Sync_TimeTick(IPY_GameWorld.tttLeaveMap, 0, leaveTick, True)
|
| | | overDict = {FBCommon.Over_rank:rank, FBCommon.Over_itemInfo:prizeItemList}
|
| | | FBCommon.NotifyFBOver(curPlayer, ChConfig.Def_FBMapID_SealDemon, lineID, 1, overDict)
|
| | | return
|
| | | |
| | | gameFB = GameWorld.GetGameFB()
|
| | | tick = GameWorld.GetGameWorld().GetTick()
|
| | | gameFB.SetGameFBDict(FBDict_IsOver, tick)
|
| | | gameFB.SetPlayerGameFBDict(curPlayer.GetPlayerID(), FBPlayerDict_Rank, rank)
|
| | | curPlayer.Sync_TimeTick(ChConfig.tttPickupItem, 0, ChConfig.Def_FBPickupItemTime, True)
|
| | | return
|
| | |
|
| | | #GameWorld.Log("通知前端结算!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
| | | overDict = {FBCommon.Over_rank:rank, FBCommon.Over_itemInfo:prizeItemList}
|
| | | FBCommon.NotifyFBOver(curPlayer, mapID, lineID, 1, overDict)
|
| | | PlayerControl.SetCustomMap(curPlayer, 0, 0)
|
| | | return
|
| | | |
| | |
|
| | | def GetBossRemainHPPer(copyMapID, funcLineID, tick):
|
| | | bossID = CurFBLineBOSSID(funcLineID)
|
| | |
| | | packData.OldDouble = curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_FMTOldDouble)
|
| | | NetPackCommon.SendFakePack(curPlayer, packData)
|
| | | return
|
| | |
|
| | |
| | | ("DWORD", "CftBleedDamage", 0),
|
| | | ("DWORD", "CftFaintRate", 0),
|
| | | ("DWORD", "CftSuperHitReduce", 0),
|
| | | ("DWORD", "CftSuperHitRate", 0),
|
| | | ("DWORD", "CftLuckyHitRate", 0),
|
| | | ("DWORD", "CftLuckyHitRateReduce", 0),
|
| | | ("DWORD", "CftSkillAtkRate", 0),
|
| | | ("DWORD", "CftSkillAtkRateReduce", 0),
|
| | |
| | | ("BYTE", "AlchemyQuality", 0),
|
| | | ("DWORD", "LearnNeedItemID", 0),
|
| | | ("BYTE", "LearnNeedAlchemLV", 0),
|
| | | ("WORD", "LearnNeedLuck", 0),
|
| | | ("WORD", "LearnNeedLingGenPoint", 0),
|
| | | ("WORD", "NeedTime", 0),
|
| | | ("WORD", "AlchemyExp", 0),
|
| | | ("dict", "Material", 0),
|
| | |
| | | self.CftBleedDamage = 0
|
| | | self.CftFaintRate = 0
|
| | | self.CftSuperHitReduce = 0
|
| | | self.CftSuperHitRate = 0
|
| | | self.CftLuckyHitRate = 0
|
| | | self.CftLuckyHitRateReduce = 0
|
| | | self.CftSkillAtkRate = 0
|
| | | self.CftSkillAtkRateReduce = 0
|
| | |
| | | def GetCftBleedDamage(self): return self.CftBleedDamage # 流血伤害系数
|
| | | def GetCftFaintRate(self): return self.CftFaintRate # 击晕系数
|
| | | def GetCftSuperHitReduce(self): return self.CftSuperHitReduce # 暴击抗性系数
|
| | | def GetCftSuperHitRate(self): return self.CftSuperHitRate # 暴击率系数
|
| | | def GetCftLuckyHitRate(self): return self.CftLuckyHitRate # 会心一击率系数
|
| | | def GetCftLuckyHitRateReduce(self): return self.CftLuckyHitRateReduce # 会心一击抗性系数
|
| | | def GetCftSkillAtkRate(self): return self.CftSkillAtkRate # 技能伤害系数
|
| | | def GetCftSkillAtkRateReduce(self): return self.CftSkillAtkRateReduce # 技能减伤系数
|
| | |
| | | self.AlchemyQuality = 0
|
| | | self.LearnNeedItemID = 0
|
| | | self.LearnNeedAlchemLV = 0
|
| | | self.LearnNeedLuck = 0
|
| | | self.LearnNeedLingGenPoint = 0
|
| | | self.NeedTime = 0
|
| | | self.AlchemyExp = 0
|
| | | self.Material = {} |
| | |
| | | def GetAlchemyQuality(self): return self.AlchemyQuality # 秘方品级
|
| | | def GetLearnNeedItemID(self): return self.LearnNeedItemID # 丹方物品ID
|
| | | def GetLearnNeedAlchemLV(self): return self.LearnNeedAlchemLV # 丹方需要炼丹等级
|
| | | def GetLearnNeedLuck(self): return self.LearnNeedLuck # 丹方需要慧根
|
| | | def GetLearnNeedLingGenPoint(self): return self.LearnNeedLingGenPoint # 丹方需要总灵根点数
|
| | | def GetNeedTime(self): return self.NeedTime # 炼丹时间(秒)
|
| | | def GetAlchemyExp(self): return self.AlchemyExp # 炼丹获得经验值
|
| | | def GetMaterial(self): return self.Material # 炼丹材料 |
| | |
| | | #};
|
| | | def OnGetCustomSceneCollectAward(index, clientData, tick):
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | npcID = clientData.NPCID
|
| | | if not curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | GameWorld.DebugLog("非自定义场景中,无法获取定义采集奖励!")
|
| | | GameWorld.ErrLog("非自定义场景中,无法获取定义采集奖励!", playerID)
|
| | | return
|
| | | mapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | lineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | GameWorld.DebugLog("前端场景采集: mapID=%s,lineID=%s,npcID=%s" % (mapID, lineID, npcID))
|
| | | GameWorld.Log("前端场景采集: mapID=%s,lineID=%s,npcID=%s" % (mapID, lineID, npcID), playerID)
|
| | | if not mapID:
|
| | | GameWorld.ErrLog("无自定义场景地图ID,不允许采集!", playerID)
|
| | | return
|
| | |
|
| | | if mapID:
|
| | | #if FBCommon.GetCustomMapStep(curPlayer, mapID, lineID) != ChConfig.CustomMapStep_Fight:
|
| | | # return
|
| | | FBLogic.OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID)
|
| | | |
| | | if not FBLogic.OnCustomSceneCollectOK(curPlayer, mapID, lineID, npcID):
|
| | | GameWorld.ErrLog("自定义场景地图不允许采集! mapID=%s,lineID=%s,npcID=%s" % (mapID, lineID, npcID), playerID)
|
| | | return
|
| | | |
| | | collectNPCIpyData = IpyGameDataPY.GetIpyGameData("CollectNPC", npcID)
|
| | | if collectNPCIpyData:
|
| | | DoGiveCollectNPCAward(curPlayer, npcID, collectNPCIpyData)
|
| | |
| | | ''' 检查可否复活,为了逻辑统一,这里不适用玩家所在的地图,支持跨服状态下判断跨服地图
|
| | | 本函数不验证玩家死亡状态等,因为有可能前后端复活状态不一致,如果这里拦住可能导致前端躺尸复活不了
|
| | | '''
|
| | |
|
| | | if curPlayer.GetHP() > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie:
|
| | | # 当血量大于0收到复活请求时,一般是前后端复活状态不一致的情况下导致的
|
| | | # 由于前端需要根据复活状态判断复活界面相关逻辑,所以这里需要做一些特殊处理,防止某些情况下前后端复活状态不一致导致的一些异常问题
|
| | | # 后端非死亡状态的情况,补同步一次复活包给前端
|
| | | SyncPlayerReborn(curPlayer, rebornType)
|
| | | return
|
| | |
|
| | | if rebornType not in ChConfig.Def_RebornTypeList:
|
| | | return
|
| | |
| | |
|
| | | def __DoPlayerReborn(curPlayer, rebornType, tick, mapBornPlace=0, isAddSuperBuff=True):
|
| | | ## 执行玩家复活逻辑,该函数没有执行验证是否可复活等,不可直接调用
|
| | | |
| | | if curPlayer.GetHP() > 0 and curPlayer.GetPlayerAction() != IPY_GameWorld.paDie:
|
| | | # 当血量大于0收到复活请求时,一般是前后端复活状态不一致的情况下导致的
|
| | | # 由于前端需要根据复活状态判断复活界面相关逻辑,所以这里需要做一些特殊处理,防止某些情况下前后端复活状态不一致导致的一些异常问题
|
| | | # 后端非死亡状态的情况,补同步一次复活包给前端
|
| | | SyncPlayerReborn(curPlayer, rebornType)
|
| | | return
|
| | |
|
| | | resetHpPercent = ChConfig.Def_MaxRateValue
|
| | | isFBReborn = False
|
| | |
| | | addValue = addValue + addExtraPoint
|
| | | curTotalPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint, curTotalPoint + addValue)
|
| | | #realmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
|
| | | #__SetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint, realmPoint+addValue)
|
| | | AddCanCostActivityPoint(curPlayer, addValue)
|
| | | SyncDailyActivityInfo(curPlayer)
|
| | |
|
| | | GameWorld.DebugLog("增加活跃度任务次数,activityNum=%s,addPbCnt=%s,addValue=%s, multiple=%s, addExtraPoint=%s,curExtraPoint=%s"
|
| | |
| | | return multiple, extraPointLimit
|
| | | return actRealmPointIpyData.GetMultiple(), actRealmPointIpyData.GetPointLimit()
|
| | |
|
| | | def AddCanCostActivityPoint(curPlayer, addValue):
|
| | | # 增加可消耗的活跃点
|
| | | curPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint)
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint, min(IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint'), curPoint + addValue))
|
| | | return
|
| | |
|
| | | def CostActivityPoint(curPlayer, costPoint):
|
| | | # 消耗活跃点
|
| | | curPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint)
|
| | | if curPoint < costPoint:
|
| | | return
|
| | | __SetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint,
|
| | | curPoint - costPoint)
|
| | | SyncDailyActivityInfo(curPlayer)
|
| | | return True
|
| | |
|
| | | ## 同步活跃度信息
|
| | | # @param curPlayer
|
| | |
| | | sendPack.CurValue = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_TotalPoint)
|
| | | sendPack.StageIndex = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_AwardStage)
|
| | | sendPack.AwardRecord = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityAwardRecord)
|
| | | sendPack.RealmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_RealmPoint)
|
| | | sendPack.RealmPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_ActivityCanCostTotalPoint)
|
| | | sendPack.ExtraPoint = __GetPDictValue(curPlayer, ChConfig.Def_PDict_Activity_ExtraRealmPoint)
|
| | | NetPackCommon.SendFakePack(curPlayer, sendPack)
|
| | | return
|
| | |
| | | attrName = self.__AttrName % attrIndex
|
| | | setattr(self, attrName, getattr(self, attrName) + value)
|
| | |
|
| | | def GetModuleFightPower(self, fpParam, job):
|
| | | def GetModuleFightPower(self, fpParam, curPlayer):
|
| | | MaxHP = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrMaxHP) # 最大血量
|
| | | MinAtk = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrATKMin) # 最小攻击
|
| | | MaxAtk = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrATKMax) # 最大攻击
|
| | |
| | | Hit = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrHit) * fpParam.GetCftHit() # 命中值
|
| | | Miss = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrMiss) * fpParam.GetCftMiss() # 闪避值
|
| | | AtkSpeed = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_AttrAtkSpeed) # 攻击速度(数值非攻击间隔)
|
| | | SuperHitRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitRate) # 暴击率
|
| | | SuperHitRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitRate) * fpParam.GetCftSuperHitRate() # 暴击率
|
| | | SuperHitRateReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitRateReduce) # 暴击概率抗性
|
| | | SuperHit = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHit) # 暴击伤害固定值
|
| | | SuperHitReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_SuperHitReduce) * fpParam.GetCftSuperHitReduce() # 暴击固定减伤
|
| | | LuckyHitRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHitRate) # 会心一击
|
| | | LuckyHitRate = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHitRate) * fpParam.GetCftLuckyHitRate() # 会心一击
|
| | | LuckyHitRateReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHitRateReduce) * fpParam.GetCftLuckyHitRateReduce() # 会心一击概率抗性
|
| | | LuckyHit = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHit) # 会心一击伤害固定值
|
| | | LuckyHitReduce = getattr(self, self.__AttrName % ChConfig.TYPE_Calc_LuckyHitReduce) # 会心一击伤害固定减伤
|
| | |
| | | AtkSpeedParameter = fpParam.GetCftAtkSpeed()
|
| | | LuckyHitParameter = fpParam.GetCftLuckyHit()
|
| | |
|
| | | #取总属性的
|
| | | SuperHitRateTotal = curPlayer.GetSuperHitRate()
|
| | | LuckyHitRateTotal = curPlayer.GetLuckyHitRate()
|
| | | |
| | | job = curPlayer.GetJob()
|
| | | diffAttrDict = self.__GetAttrFightPowerParamDiff(job)
|
| | | for paramName, diffValue in diffAttrDict.items():
|
| | | exec("%s = max(0, %s - %s)" % (paramName, paramName, diffValue))
|
| | |
| | | if aftLV > befLV:
|
| | | curPlayer.SetLV(aftLV, False) # 这里不再通知GameServer
|
| | | PlayerSuccess.UptateSuccessProgress(curPlayer, ShareDefine.SuccType_HeroLV, aftLV)
|
| | | PlayerActivity.AddDailyActionFinishCnt(curPlayer, ShareDefine.DailyActionID_LVUP, aftLV - befLV)
|
| | | if aftFreePoint > befFreePoint:
|
| | | curPlayer.SetFreePoint(aftFreePoint)
|
| | | #NotifyCode(curPlayer, "ObtainAttributeDot", [aftFreePoint - befFreePoint])
|
| | |
| | | OpenServerCampaign.UpdOpenServerCampaignRecordData(curPlayer, ShareDefine.Def_Campaign_Type_LV, curPlayer.GetLV())
|
| | | #神秘限购
|
| | | FunctionNPCCommon.MysticalLimitShopOpen(curPlayer, befLV, aftLV)
|
| | |
|
| | | #不需要做升级任务, 设置玩家经验
|
| | | SetPlayerTotalExp(curPlayer, curTotalExp)
|
| | | return
|
| | |
| | | curLV = curPlayer.GetLV()
|
| | | fpParam = IpyGameDataPY.GetIpyGameData("FightPowerParam", curLV)
|
| | | mfpDict = {} # 模块战斗力
|
| | | mfpObjDict = {}
|
| | | for mfpType, attrFuncIndexList in ChConfig.MFPTypeAttrFuncIndexDict.items():
|
| | | mfpAttrList = [{} for _ in range(4)]
|
| | | mfpAttrExDict = {}
|
| | |
| | | mfpObj.SetCalcMFPBattleAttr(mfpAttrList)
|
| | | for attrIndex, value in mfpAttrExDict.items():
|
| | | mfpObj.AddCalcMFPAttr(attrIndex, value)
|
| | | |
| | | mfpValue = 0 if not fpParam else mfpObj.GetModuleFightPower(fpParam, curPlayer.GetJob())
|
| | | mfpObjDict[mfpType] = mfpObj
|
| | | |
| | | # 因为计算战力需要取到总属性,所以等各功能点属性累加完后再计算
|
| | | for mfpType, mfpObj in mfpObjDict.items():
|
| | | mfpValue = 0 if not fpParam else mfpObj.GetModuleFightPower(fpParam, curPlayer)
|
| | | mfpSkill = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MFPSkill % mfpObj.mfpType)
|
| | | mfpEx = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MFPEx % mfpObj.mfpType)
|
| | | mfpTotal = mfpValue + mfpSkill + mfpEx
|
| | |
| | | # addAttrList[ChConfig.CalcAttr_BattleNoline] = {}
|
| | | # return addAttrList
|
| | | #===============================================================================
|
| | |
|
| | | def GetTotalLingGenPoint(curPlayer):
|
| | | # 总灵根点数(金木水火土+自由点数)
|
| | | return GetMetal(curPlayer) + GetWood(curPlayer) + GetWater(curPlayer) + GetFire(curPlayer) + GetEarth(curPlayer) + curPlayer.GetFreePoint()
|
| | |
|
| | | # 灵根 - 金木水火土
|
| | | def GetMetal(curPlayer): return curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_Metal)
|
| | |
| | |
|
| | | def DoEnterCustomScene(curPlayer, mapID, lineID, tick):
|
| | | ## 进入自定义场景状态
|
| | | |
| | | resultPack = ChPyNetSendPack.tagMCStartCustomSceneResult()
|
| | | resultPack.MapID = mapID
|
| | | resultPack.FuncLineID = lineID
|
| | | playerID = curPlayer.GetPlayerID()
|
| | | GameWorld.Log("玩家请求进入自定义场景!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
|
| | | if curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_ClientCustomScene):
|
| | | curMapID = PlayerControl.GetCustomMapID(curPlayer)
|
| | | curLineID = PlayerControl.GetCustomLineID(curPlayer)
|
| | | if mapID == curMapID and lineID == curLineID:
|
| | | GameWorld.Log(" 玩家当前已经在自定义场景中!无需重新请求!", playerID)
|
| | | result = 1
|
| | | else:
|
| | | GameWorld.Log(" 玩家当前在不同的自定义场景中!不允许进入!curMapID=%s,curLineID=%s" |
| | | % (curMapID, curLineID), playerID)
|
| | | result = 0
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, result)
|
| | | return
|
| | |
|
| | | #进入副本通用检查
|
| | | if mapID:
|
| | | fbIpyData = FBCommon.GetFBIpyData(mapID)
|
| | | fbLineIpyData = FBCommon.GetFBLineIpyData(mapID, lineID)
|
| | | if PlayerControl.CheckMoveToFB(curPlayer, mapID, lineID, fbIpyData, fbLineIpyData, tick) != ShareDefine.EntFBAskRet_OK:
|
| | | resultPack.Result = 0
|
| | | NetPackCommon.SendFakePack(curPlayer, resultPack)
|
| | | PlayerControl.SetCustomMap(curPlayer, 0, 0)
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, 0)
|
| | | return
|
| | |
|
| | | PlayerControl.SetPlayerSightLevel(curPlayer, curPlayer.GetID())
|
| | |
|
| | | curPlayer.SetDict(ChConfig.Def_PlayerKey_ClientCustomScene, 1) # 由于前端不一定有发mapID,所以这里额外记录这个状态,不能直接用mapID判断
|
| | | PlayerControl.SetCustomMap(curPlayer, mapID, lineID)
|
| | | GameWorld.Log("玩家开始自定义场景!mapID=%s,lineID=%s" % (mapID, lineID), curPlayer.GetPlayerID())
|
| | | GameWorld.Log("玩家开始自定义场景!mapID=%s,lineID=%s" % (mapID, lineID), playerID)
|
| | | if mapID:
|
| | | FBLogic.OnEnterCustomScene(curPlayer, mapID, lineID)
|
| | |
|
| | | #通知进入状态
|
| | | resultPack.Result = 1
|
| | | StartCustomSceneResult(curPlayer, mapID, lineID, 1)
|
| | | return
|
| | |
|
| | | def StartCustomSceneResult(curPlayer, mapID, lineID, result):
|
| | | if result != 1:
|
| | | DoExitCustomScene(curPlayer)
|
| | | resultPack = ChPyNetSendPack.tagMCStartCustomSceneResult()
|
| | | resultPack.MapID = mapID
|
| | | resultPack.FuncLineID = lineID
|
| | | resultPack.Result = result
|
| | | NetPackCommon.SendFakePack(curPlayer, resultPack)
|
| | | return
|
| | |
|
| | |
| | | if fairyDomainState == 1:
|
| | | GameWorld.DebugLog(" 正在寻访仙域中!请先退出寻访")
|
| | | return
|
| | | |
| | | if fairyDomainState != 2 and not PlayerActivity.AddDailyActionFinishCnt(curPlayer, dailyID):
|
| | | GameWorld.DebugLog(" 寻访仙域次数不足!")
|
| | | costPoint = IpyGameDataPY.GetFuncCfg('ImmortalDomainActivePoint', 2)
|
| | | if not PlayerActivity.CostActivityPoint(curPlayer, costPoint):
|
| | | GameWorld.DebugLog(" 寻访仙域需要活跃点不足!costPoint=%s"%costPoint)
|
| | | return
|
| | |
|
| | | #随机事件 重置事件状态
|
| | |
| | | continue
|
| | | conditionList = ipyData.GetCondition()
|
| | | if not conditionList:
|
| | | fdEventIDList.remove(fdEventID)
|
| | | continue
|
| | | condition = random.choice(conditionList)
|
| | | index = conditionList.index(condition)
|
| | | index = 0
|
| | | else:
|
| | | condition = random.choice(conditionList)
|
| | | index = conditionList.index(condition)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_FairyAdventuresData % fdEventID, ipyData.GetID() * 100 + index)
|
| | |
|
| | | if not fdEventIDList:
|
| | |
| | | gearAwardList = ipyData.GetGearAward()
|
| | | if not gearAwardList:
|
| | | return
|
| | | itemRateList = gearAwardList[index] if index < len(gearAwardList) else gearAwardList[-1]
|
| | | itemRateList = ItemCommon.GetWeightItemListByAlchemyDiffLV(curPlayer, itemRateList, 1)
|
| | | giveItemList = [GameWorld.GetResultByWeightList(itemRateList)]
|
| | | giveItemList = []
|
| | | itemRandomList = gearAwardList[index] if index < len(gearAwardList) else gearAwardList[-1]
|
| | | for itemRateList in itemRandomList:
|
| | | itemRateList = ItemCommon.GetWeightItemListByAlchemyDiffLV(curPlayer, itemRateList, 0)
|
| | | giveItemList.append(GameWorld.GetResultByWeightList(itemRateList))
|
| | | else:
|
| | | giveItemList = [ipyData.GetBasicAward()]
|
| | | |
| | | ItemControler.GivePlayerItemOrMail(curPlayer, giveItemList)
|
| | | for itemInfo in giveItemList:
|
| | | NPCCommon.SendVirtualItemDrop(curPlayer, itemInfo[0], 0, 0, '')
|
| | | NPCCommon.DoGiveItemByVirtualDrop(curPlayer, giveItemList, 0)
|
| | | msgDict = {FBCommon.Over_itemInfo:FBCommon.GetJsonItemList(giveItemList)}
|
| | | FBCommon.Notify_FB_Over(curPlayer, msgDict)
|
| | | GameWorld.DebugLog('缥缈奇遇领奖 msgDict=%s, fdeventID=%s' % (msgDict, fdeventID))
|
| | |
| | | if alchemyLV < learnNeedAlchemLV:
|
| | | GameWorld.DebugLog('丹方学习需要炼丹等级 %s' % learnNeedAlchemLV)
|
| | | return
|
| | | learnNeedLuck = alchemyIpyData.GetLearnNeedLuck()
|
| | | if curLuckValue < learnNeedLuck:
|
| | | GameWorld.DebugLog('丹方学习需要慧根 %s' % learnNeedLuck)
|
| | | learnNeedLingGenPoint = alchemyIpyData.GetLearnNeedLingGenPoint()
|
| | | if PlayerControl.GetTotalLingGenPoint(curPlayer) < learnNeedLingGenPoint:
|
| | | GameWorld.DebugLog('丹方学习需要总灵根点 %s' % learnNeedLingGenPoint)
|
| | | return
|
| | | learnNeedItemID = alchemyIpyData.GetLearnNeedItemID()
|
| | | itemPack = curPlayer.GetItemManager().GetPack(IPY_GameWorld.rptItem)
|
| | |
| | | DailyActionID_SkyTower, # 天星塔 23
|
| | | DailyActionID_HorsePetBoss, # 骑宠BOSS 24
|
| | | DailyActionID_FairyDomain, # 缥缈仙域 25
|
| | | ) = range(1, 25 + 1)
|
| | | DailyActionID_LVUP, # 玩家等级提升 26
|
| | | ) = range(1, 26 + 1)
|
| | |
|
| | |
|
| | |
|