#!/usr/bin/python # -*- coding: GBK -*- #------------------------------------------------------------------------------- # ##@package GM.Commands.Beauty # # @todo:ºìÑÕ # @author hxp # @date 2025-11-21 # @version 1.0 # # ÏêϸÃèÊö: ºìÑÕ # #------------------------------------------------------------------------------- #"""Version = 2025-11-21 17:00""" #------------------------------------------------------------------------------- import GameWorld import IpyGameDataPY import PlayerControl import PlayerBeauty import ChConfig def OnExec(curPlayer, msgList): if not msgList: GameWorld.DebugAnswer(curPlayer, "ÖØÖúìÑÕ: Beauty 0 [ºìÑÕID]") GameWorld.DebugAnswer(curPlayer, "ÉèÖúìÑÕ: Beauty ºìÑÕID [µÈ¼¶ ¾­Ñé Áì½±µÈ¼¶]") GameWorld.DebugAnswer(curPlayer, "ºìÑÕʱװ: Beauty s ʱװID [ÐǼ¶]") GameWorld.DebugAnswer(curPlayer, "ÑÝÎ䳡ʤÀûÊý: Arena w ʤÀûÊý") GameWorld.DebugAnswer(curPlayer, "¸±±¾¹ý¹Ø½ø¶È: FBPass") return beautyIDList, skinIDList = [], [] value1 = msgList[0] if value1 == 0: setBeautyID = msgList[1] if len(msgList) > 1 else 0 ipyDataMgr = IpyGameDataPY.IPY_Data() for index in range(ipyDataMgr.GetBeautyCount()): ipyData = ipyDataMgr.GetBeautyByIndex(index) beautyID = ipyData.GetBeautyID() if setBeautyID and setBeautyID != beautyID: continue if not PlayerBeauty.GetBeautyState(curPlayer, beautyID): continue beautyIDList.append(beautyID) ipyDataList = IpyGameDataPY.GetIpyGameDataList("BeautySkin", beautyID) if ipyDataList: for skinIpyData in ipyDataList: skinID = skinIpyData.GetSkinID() if not PlayerBeauty.GetBeautySkinState(curPlayer, skinID): continue skinIDList.append(skinID) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BeautySkinInfo % skinID, 0) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BeautyLVInfo % beautyID, 0) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BeautyAwardLV % beautyID, 0) GameWorld.DebugAnswer(curPlayer, "ÖØÖúìÑÕOK") elif value1 == "s": skinID = msgList[1] if len(msgList) > 1 else 0 star = msgList[2] if len(msgList) > 2 else 0 ipyData = IpyGameDataPY.GetIpyGameDataByCondition("BeautySkin", {"SkinID":skinID}, False) if not ipyData: GameWorld.DebugAnswer(curPlayer, "²»´æÔÚºìÑÕʱװskinID:%s" % skinID) return beautyID = ipyData.GetBeautyID() star = min(star, ipyData.GetStarMax()) PlayerBeauty.DoBeautyActivate(curPlayer, beautyID) PlayerBeauty.SetBeautySkinState(curPlayer, skinID, 1) PlayerBeauty.SetBeautySkinStar(curPlayer, skinID, star) beautyIDList, skinIDList = [beautyID], [skinID] GameWorld.DebugAnswer(curPlayer, "ºìÑÕID:%s,ʱװID:%s,ÐÇ:%s" % (beautyID, skinID, star)) elif value1 > 0: beautyID = value1 lv = msgList[1] if len(msgList) > 1 else None exp = msgList[2] if len(msgList) > 2 else 0 awardLV = msgList[3] if len(msgList) > 3 else None ipyData = IpyGameDataPY.GetIpyGameData("Beauty", beautyID) if not ipyData: GameWorld.DebugAnswer(curPlayer, "²»´æÔÚºìÑÕ! %s" % beautyID) return quality = ipyData.GetBeautyQuality() PlayerBeauty.DoBeautyActivate(curPlayer, beautyID) if lv == None: lv, exp, awardLV = 0, 0, 0 if not IpyGameDataPY.GetIpyGameData("BeautyQualityLV", quality, lv): GameWorld.DebugAnswer(curPlayer, "²»´æÔÚºìÑյȼ¶! ID:%s,Æ·ÖÊ:%s,LV:%s" % (beautyID, quality, lv)) return PlayerBeauty.SetBeautyLVInfo(curPlayer, beautyID, lv, exp) lv, exp = PlayerBeauty.GetBeautyLVInfo(curPlayer, beautyID) if awardLV != None: awardLV = min(lv, awardLV) PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_BeautyAwardLV % beautyID, awardLV) awardLV = curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_BeautyAwardLV % beautyID) GameWorld.DebugAnswer(curPlayer, "ºìÑÕID:%s, Æ·ÖÊ:%s, LV:%s-%s, ½±ÀøLV:%s" % (beautyID, quality, lv, exp, awardLV)) beautyIDList = [beautyID] PlayerBeauty.RefreshBeautyAttr(curPlayer) PlayerBeauty.SyncBeautyInfo(curPlayer, beautyIDList, skinIDList) return