hxp
2025-06-12 edc3910a9d090e5df4deb2dbc37709a740375938
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package GM.Commands.ClearInvest
#
# @todo:ÖØÖÃͶ×ÊÀí²Æ
# @author xdh
# @date 2014-08-19
# @version 1.0
#
# ÏêϸÃèÊö: ÖØÖÃͶ×ÊÀí²Æ
#
#---------------------------------------------------------------------
#"""Version = 2015-04-13 11:10"""
import ChConfig
import PlayerGoldInvest
import PlayerControl
import GameWorld
#---------------------------------------------------------------------
 
#Âß¼­ÊµÏÖ
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param list ²ÎÊýÁбí [npcID]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, msgList):
    
    if not msgList:
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃËùÓÐͶ×Ê: ClearInvest 0")
        GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÖ¸¶¨Í¶×Ê: ClearInvest ÀàÐÍ")
        GameWorld.DebugAnswer(curPlayer, "¼¤»îÖ¸¶¨Í¶×Ê: ClearInvest A ÀàÐÍ")
        GameWorld.DebugAnswer(curPlayer, "ÀàÐÍ:7-ÓÀ¾Ã¿¨;8-ÖÜ¿¨;9-µÇ¼¿¨;10-µÈ¼¶¿¨;11-boss¿¨;;12-ÖÕÉí¿¨;")
        return
    
    investType = msgList[0]
    if not investType:
        investTypeList = ChConfig.InvestTypeList
    elif investType == "A":
        investType = msgList[1] if len(msgList) > 1 else 0
        if investType not in ChConfig.InvestTypeList:
            GameWorld.DebugAnswer(curPlayer, "²»´æÔÚ¸ÃͶ×ÊÀàÐÍ!")
            return
        PlayerGoldInvest.__DoLogicInvest(curPlayer, investType)
        GameWorld.DebugAnswer(curPlayer, "¼¤»îͶ×Ê: %s" % investType)
        return
    
    elif investType not in ChConfig.InvestTypeList:
        GameWorld.DebugAnswer(curPlayer, "²»´æÔÚ¸ÃͶ×ÊÀàÐÍ!")
        return
    else:
        investTypeList = [investType]
        
    for itype in investTypeList:
        PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestTime % itype, 0)
        for keyNum in range(ChConfig.Def_PDict_InvestKeyCount):
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestReward % (itype, keyNum), 0)
            PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_InvestProgress % (itype, keyNum), 0)
        PlayerGoldInvest.Sync_InvestInfo(curPlayer, itype)
    PlayerControl.Sync_ExpRateChange(curPlayer)
    return