From 5605938972fbfb13e266d068e190e9ffae56fcc3 Mon Sep 17 00:00:00 2001 From: hxp <ale99527@vip.qq.com> Date: 星期四, 25 九月 2025 19:12:59 +0800 Subject: [PATCH] 129 【战斗】战斗系统-服务端(丁奉技能;觉醒1技能强化护盾,暂无反弹;) --- ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/OpenFunc.py | 62 ++++++++++++------------------ 1 files changed, 25 insertions(+), 37 deletions(-) diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/OpenFunc.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/OpenFunc.py index e0bec23..8cb4ac3 100644 --- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/OpenFunc.py +++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/GM/Commands/OpenFunc.py @@ -18,7 +18,6 @@ import GameWorld import PlayerControl import PlayerPrestigeSys -import PlayerMagicWeapon import IpyGameDataPY import GameFuncComm import ChConfig @@ -88,46 +87,48 @@ openFuncIDList = [openFuncID] if openFuncIDList: - needLV, needMagicWeaponIDList, needRealmLV, needMissionIDList = __GetOpenFuncLimit(openFuncIDList) - if needMagicWeaponIDList: - openFuncIDList.append(ShareDefine.GameFuncID_MagicWeapon) + needLV, needRealmLV, needMissionIDList = __GetOpenFuncLimit(curPlayer, openFuncIDList) if needRealmLV: openFuncIDList.append(ShareDefine.GameFuncID_Official) - needLV, needMagicWeaponIDList, needRealmLV, needMissionIDList = __GetOpenFuncLimit(openFuncIDList) + needLV, needRealmLV, needMissionIDList = __GetOpenFuncLimit(curPlayer, openFuncIDList) GameWorld.DebugLog("GM处理等级开启功能: openFuncID=%s,openFuncIDList=%s,needLV=%s" % (openFuncID, openFuncIDList, needLV), curPlayer.GetPlayerID()) # 优先处理升级 - if needLV: + if needLV > 1: preLV = needLV - 1 curPlayer.SetLV(preLV) PlayerControl.SetPlayerTotalExp(curPlayer, PlayerControl.GetTotalExpByPlayerLv(preLV)) PlayerControl.PlayerControl(curPlayer).PlayerLvUp() + + # 获取等级需要的境界 + ipyDataMgr = IpyGameDataPY.IPY_Data() + for index in range(ipyDataMgr.GetRealmCount()): + realmIpyData = ipyDataMgr.GetRealmByIndex(index) + if realmIpyData.GetLv() > needRealmLV: + needRealmLV = realmIpyData.GetLv() + if realmIpyData.GetLVMax() >= needLV: + break - GameWorld.DebugLog("GM处理法宝开启功能: needMagicWeaponIDList=%s" % needMagicWeaponIDList, curPlayer.GetPlayerID()) - for mwIDKey in needMagicWeaponIDList: - mwID, mwLV = mwIDKey/100, mwIDKey%100 - for lv in xrange(mwLV+1): - PlayerMagicWeapon.DoActiveMW(curPlayer, mwID, lv) - - GameWorld.DebugLog("GM处理境界开启功能: needRealmLV=%s" % needRealmLV, curPlayer.GetPlayerID()) if needRealmLV: - curPlayer.SetOfficialRank(max(1, needRealmLV - 1)) + curPlayer.SetOfficialRank(max(ChConfig.Def_InitOfficialRank, needRealmLV - 1)) PlayerPrestigeSys.DoRealmLVUpLogic(curPlayer) + for limitMissionID in needMissionIDList: + if not curPlayer.NomalDictGetProperty(ChConfig.Def_Player_Dict_MissionFinish % limitMissionID): + PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_MissionFinish % limitMissionID, 1) + GameWorld.DebugLog("GM处理任务开启功能: needMissionIDList=%s" % needMissionIDList, curPlayer.GetPlayerID()) #最后强制触发一次 - #if needMissionIDList: - GameFuncComm.DoFuncOpenLogic(curPlayer, needMissionIDList) + GameFuncComm.DoFuncOpenLogic(curPlayer) return -def __GetOpenFuncLimit(openFuncIDList): - maxLV = IpyGameDataPY.GetFuncCfg("PlayerMaxLV") +def __GetOpenFuncLimit(curPlayer, openFuncIDList): + maxLV = PlayerControl.GetOpenMaxLV() needLV = 0 needRealmLV = 0 needMissionIDList = [] - needMagicWeaponIDList = [] ipyDataMgr = IpyGameDataPY.IPY_Data() funcOpenLVCount = ipyDataMgr.GetFuncOpenLVCount() @@ -141,10 +142,6 @@ if limitLV and limitLV <= maxLV and needLV < limitLV: needLV = limitLV - limitMagicWeaponID = ipyData.GetLimitMagicWeapon() - if limitMagicWeaponID and limitMagicWeaponID not in needMagicWeaponIDList: - needMagicWeaponIDList.append(limitMagicWeaponID) - limitRealmLV = ipyData.GetLimiRealmLV() if limitRealmLV and needRealmLV < limitRealmLV: needRealmLV = limitRealmLV @@ -152,23 +149,19 @@ limitMissionID = ipyData.GetLimitMissionID() if limitMissionID and limitMissionID not in needMissionIDList: needMissionIDList.append(limitMissionID) - return needLV, needMagicWeaponIDList, needRealmLV, needMissionIDList + return needLV, needRealmLV, needMissionIDList def DoGMCloseFunc(curPlayer, closeFuncID): ## GM关闭功能 if not closeFuncID: curPlayer.SetLV(1) - curPlayer.SetOfficialRank(1) - ipyDataMgr = IpyGameDataPY.IPY_Data() - for i in xrange(ipyDataMgr.GetTreasureCount()): - ipyData = ipyDataMgr.GetTreasureByIndex(i) - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MagicWeaponLV % ipyData.GetID(), 0) - + curPlayer.SetOfficialRank(ChConfig.Def_InitOfficialRank) + for keyNum in xrange(8): PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_GameFuncFirstTouch % keyNum, 0) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_GameFuncAwardState % keyNum, 0) - needLV, needMagicWeaponIDList, needRealmLV, needMissionIDList = __GetOpenFuncLimit([]) + needLV, needRealmLV, needMissionIDList = __GetOpenFuncLimit(curPlayer, []) for missionID in needMissionIDList: PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_Player_Dict_MissionFinish % missionID, 0) @@ -191,12 +184,7 @@ limitRealmLV = ipyData.GetLimiRealmLV() if limitRealmLV and curPlayer.GetOfficialRank() >= limitRealmLV: - curPlayer.SetOfficialRank(max(1, limitRealmLV - 1)) - - limitMagicWeaponID = ipyData.GetLimitMagicWeapon() - if limitMagicWeaponID: - mwID = limitMagicWeaponID / 100 - PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MagicWeaponLV % mwID, 0) + curPlayer.SetOfficialRank(max(ChConfig.Def_InitOfficialRank, limitRealmLV - 1)) limitMissionID = ipyData.GetLimitMissionID() if limitMissionID: -- Gitblit v1.8.0