#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#-------------------------------------------------------------------------------
|
#
|
#-------------------------------------------------------------------------------
|
#
|
##@package SetMoney
|
#
|
# @todo:ÉèÖÃÍæ¼ÒµÄÇ®
|
# @author hxp
|
# @date 2013-12-10 14:00
|
# @version 1.1
|
#
|
# @change: "2016-07-20 14:30" hxp ͳһº¯Êý
|
#
|
# ÏêϸÃèÊö: ÉèÖÃÍæ¼ÒµÄÇ®
|
#
|
#---------------------------------------------------------------------
|
#"""Version = 2016-07-20 14:30"""
|
#---------------------------------------------------------------------
|
|
import PlayerControl
|
import Lang
|
import ChConfig
|
import ShareDefine
|
import GameWorld
|
## GMÃüÁîÖ´ÐÐÈë¿Ú
|
# @param curPlayer µ±Ç°Íæ¼Ò
|
# @param list ²ÎÊýÁбí [ <Ç®±ÒÀàÐÍ><ÊýÁ¿>]
|
# @return None
|
# @remarks º¯ÊýÏêϸ˵Ã÷.
|
def OnExec(curPlayer, List):
|
if len(List) != 2:
|
#²ÎÊý²»ÕýÈ·
|
GameWorld.DebugAnswer(curPlayer, Lang.GBText("²ÎÊý²»ÕýÈ·"))
|
GameWorld.DebugAnswer(curPlayer, "1-ÏÉÓñ;2-°óÓñ;3-ÍÇ®;6-Õ½Ã˹±Ï×¶È;10-Õ½Ã˲ֿâ»ý·Ö;13-¾³½çÐÞÐеã;14-·ûÓ¡ÈÚºÏʯ;15-ÏÉÃË»îÔ¾Áî")
|
GameWorld.DebugAnswer(curPlayer, "16-ÖúÕ½»ý·Ö;23-·ûÓ¡¾«»ª;24-·ûÓ¡Ë鯬;25-Ѱ±¦»ý·Ö;26-¼¯Êжî¶È;27-µ¤¾«;28-»ê³¾;")
|
GameWorld.DebugAnswer(curPlayer, "29-¾Û»êË鯬;30-ºËÐÄ»·")
|
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.TYPE_Price_CurrencyDict:
|
GameWorld.DebugAnswer(curPlayer, Lang.GBText("Ç®±ÒÀàÐͲ»ÕýÈ·"))
|
return
|
#0ÎIJ»´¦Àí
|
if moneyCount < 0:
|
return
|
playerMoney = PlayerControl.GetMoney(curPlayer, moneyType)
|
if playerMoney > moneyCount:
|
PlayerControl.PayMoney(curPlayer, moneyType, playerMoney - moneyCount, ChConfig.Def_Cost_GM, {ChConfig.Def_Cost_Reason_SonKey:"SetMoney"})
|
elif playerMoney < moneyCount:
|
PlayerControl.GiveMoney(curPlayer, moneyType, moneyCount - playerMoney, ChConfig.Def_GiveMoney_GM, {ChConfig.Def_Give_Reason_SonKey:"SetMoney"})
|
|
return
|
|
|