| | |
| | | import GameWorld
|
| | | import PlayerControl
|
| | | import PlayerPrestigeSys
|
| | | import PlayerMagicWeapon
|
| | | import IpyGameDataPY
|
| | | import GameFuncComm
|
| | | import ChConfig
|
| | |
| | | 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())
|
| | |
|
| | |
| | | curPlayer.SetLV(preLV)
|
| | | PlayerControl.SetPlayerTotalExp(curPlayer, PlayerControl.GetTotalExpByPlayerLv(preLV))
|
| | | PlayerControl.PlayerControl(curPlayer).PlayerLvUp()
|
| | | |
| | | 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))
|
| | |
| | | GameFuncComm.DoFuncOpenLogic(curPlayer, needMissionIDList)
|
| | | return
|
| | |
|
| | | def __GetOpenFuncLimit(openFuncIDList):
|
| | | maxLV = IpyGameDataPY.GetFuncCfg("PlayerMaxLV")
|
| | | def __GetOpenFuncLimit(curPlayer, openFuncIDList):
|
| | | maxLV = PlayerControl.GetPlayerMaxLV(curPlayer)
|
| | | needLV = 0
|
| | | needRealmLV = 0
|
| | | needMissionIDList = []
|
| | | needMagicWeaponIDList = []
|
| | |
|
| | | ipyDataMgr = IpyGameDataPY.IPY_Data()
|
| | | funcOpenLVCount = ipyDataMgr.GetFuncOpenLVCount()
|
| | |
| | | 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
|
| | |
| | | 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)
|
| | | |
| | | |
| | | 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)
|
| | |
|
| | |
| | | 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)
|
| | |
|
| | | limitMissionID = ipyData.GetLimitMissionID()
|
| | | if limitMissionID:
|