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
#!/usr/bin/python
# -*- coding: GBK -*-
 
##@package MakeMoney
# ÖÆÔìÇ®±Ò<Ç®±ÒÀàÐÍ><ÊýÁ¿>
#
# @author kill
# @date 2010-4-23
# @version 1.1
#
# ÐÞ¸Äʱ¼ä ÐÞ¸ÄÈË ÐÞ¸ÄÄÚÈÝ
# VER = "2010-05-12 18:30" zhengyang Ìí¼Ó×¢ÊÍ
# @change: "2016-07-20 14:30" hxp Í³Ò»º¯Êý
#
# Ä£¿éÏêϸ˵Ã÷
 
import Lang
import PlayerControl
import ShareDefine
import ChConfig
import GameWorld
 
moneyNameDict = ShareDefine.MoneyNameDict
 
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param list ²ÎÊýÁбí [ <Ç®±ÒÀàÐÍ><ÊýÁ¿>]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer,List):
    if len(List) != 2:
        #²ÎÊý²»ÕýÈ·
        GameWorld.DebugAnswer(curPlayer, Lang.GBText("²ÎÊý²»ÕýÈ·"))
        return
    #Ç®±ÒÀàÐÍ
    moneyType =  List[0]
    #Ç®±ÒÊýÁ¿
    moneyCount = List[1]
    #ÊäÈëÀàÐͲ»¶ÔÌáʾǮ±ÒÀàÐÍ´í
    if type(moneyType) != int or type(moneyCount) not in [int, long] :
        GameWorld.DebugAnswer(curPlayer, Lang.GBText("²ÎÊý²»ÕýÈ·"))
        return
    #Ç®±ÒÀàÐÍ·¶Î§
    if moneyType not in [1, 2, 3, 4] and moneyType not in ShareDefine.MoneyNameDict:
        GameWorld.DebugAnswer(curPlayer, Lang.GBText("Ç®±ÒÀàÐͲ»ÕýÈ·"))
        return
    
    #0ÎIJ»´¦Àí
    if moneyCount <= 0 :
        return
    PlayerControl.GiveMoney(curPlayer, moneyType, moneyCount, ChConfig.Def_GiveMoney_GM, {ChConfig.Def_Give_Reason_SonKey:"MakeMoney"})
    GameWorld.DebugAnswer(curPlayer, "»õ±Ò%s%s=%s" % (moneyType, moneyNameDict.get(moneyType, moneyType), PlayerControl.GetMoneyReal(curPlayer, moneyType)))
    return