hxp
2025-12-01 fd46c6afd9024b1739a449786c284461d0394d0b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/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