hxp
2026-01-14 1ee5a1bc2efee571b23e2f4423bbd2aa94b7be75
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.Mingge
#
# @todo:Ãü¸ñ
# @author hxp
# @date 2026-01-13
# @version 1.0
#
# ÏêϸÃèÊö: Ãü¸ñ
#
#-------------------------------------------------------------------------------
#"""Version = 2026-01-13 11:00"""
#-------------------------------------------------------------------------------
 
import GameWorld
import ShareDefine
import PlayerMingge
import IpyGameDataPY
import PlayerControl
import ClearPack
import ChConfig
 
def OnExec(curPlayer, msgList):
    
    if not msgList:
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÃü¸ñ: Mingge 0 [ÊÇ·ñÖØÖÃØÔÓñ]")
        GameWorld.DebugAnswer(curPlayer, "ÉèÖøÐÎò: Mingge ¸ÐÎòµÈ¼¶ [¾­Ñé ÁéÓ¦Öµ]")
        return
    
    value1 = msgList[0]
    if value1 == 0:
        isResetItem = msgList[1] if len(msgList) > 1 else 0
        PlayerMingge.DoMinggeOpen(curPlayer)
        if isResetItem:
            ClearPack.OnExec(curPlayer, [ShareDefine.rptMGGuayu])
            ClearPack.OnExec(curPlayer, [ShareDefine.rptMGTuiyan])
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÃü¸ñ!")
    elif value1 > 0:
        ipyDataMgr = IpyGameDataPY.IPY_Data()
        maxGWLV = ipyDataMgr.GetMGGanwuLVByIndex(ipyDataMgr.GetMGGanwuLVCount() - 1).GetGanwuLV()
        gwLV = min(max(1, value1), maxGWLV)
        gwExp = msgList[1] if len(msgList) > 1 else curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MGGanwuExp)
        lingying = msgList[2] if len(msgList) > 2 else curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_MGLingying)
        
        gwLV = PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MGGanwuLV, gwLV)
        gwExp = PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MGGanwuExp, gwExp)
        lingying = PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_MGLingying, lingying)
        GameWorld.DebugAnswer(curPlayer, "ÉèÖøÐÎòLV=%s,Exp=%s,ÁéÓ¦=%s" % (gwLV, gwExp, lingying))
        
    PlayerMingge.RefreshMinggeAttr(curPlayer)
    PlayerMingge.Sync_MinggeInfo(curPlayer)
    return