hxp
2023-01-08 9e65b1227144d715b48bdac99290a292108bec53
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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.ClearStoreBuyCount
#
# @todo:Çå³ýÉ̵êÎïÆ·ÏÞ¹º´ÎÊý
# @author hxp
# @date 2018-05-09
# @version 1.0
#
# ÏêϸÃèÊö: Çå³ýÉ̵êÎïÆ·ÏÞ¹º´ÎÊý
#
#-------------------------------------------------------------------------------
#"""Version = 2018-05-09 15:00"""
#-------------------------------------------------------------------------------
 
import ChConfig
import IpyGameDataPY
import FunctionNPCCommon
import PlayerControl
import GameWorld
 
 
#---------------------------------------------------------------------
#Âß¼­ÊµÏÖ
## GMÃüÁîÖ´ÐÐÈë¿Ú
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param list ²ÎÊýÁбí [npcID]
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, paramList):
    syncIndexList = []
    ipyDataMgr = IpyGameDataPY.IPY_Data()
    for i in xrange(ipyDataMgr.GetStoreCount()):
        shopItem = ipyDataMgr.GetStoreByIndex(i)
        if not shopItem.GetLimitCnt():
            continue
        dayBuyCntKey = ChConfig.Def_PDict_ShopItemDayBuyCnt % shopItem.GetID()
        curDayBuyCnt = curPlayer.NomalDictGetProperty(dayBuyCntKey)
        if curDayBuyCnt <= 0:
            continue
        PlayerControl.NomalDictSetProperty(curPlayer, dayBuyCntKey, 0)
        syncIndexList.append(shopItem.GetID())
    if syncIndexList:
        FunctionNPCCommon.SyncShopItemTodayBuyCount(curPlayer, syncIndexList, True)
    GameWorld.DebugAnswer(curPlayer, "ÖØÖóɹ¦:%s" % syncIndexList)
    return