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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
ó
OÊjc@s6ddlZddlZddlZddlZddlZddlZddlZddlZdZdZ    dZ
dZ dZ dZ e gZd„Zd„Zd„Zd„Zd    „Zd
„Zd d „Zejiedd „Zd„Zd„Zd„Zd„Zded„Zgd„Zgd„Z dS(iÿÿÿÿNiiicCs(x!tD]}t||dtƒqWdS(Nt
sysRefresh(tRefreshShopTypeListtDoRandRefreshShopItemtTrue(t    curPlayertshopType((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt
DoShopOpenIs cCs,t|ƒxtD]}t||ƒqWdS(N(tSyncShopItemBuyCntInfoRtSyncShopRefreshItemInfo(RR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnLoginNs
 cCshxQtD]I}|jtj|ƒs)qntj|tj|dƒt||ƒqWt|tgƒdS(Ni(    RtNomalDictGetPropertytChConfigtDef_PDict_ShopRefreshCntt PlayerControltNomalDictSetPropertyRtResetShopItemBuyCountt ResetType_Day(RR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt ShopItemOnDayTs cCst|tgƒdS(N(RtResetType_Week(R((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnWeek^scCst|tgƒdS(N(RtResetType_Month(R((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnMonthbscCsç|s
dSg}tjƒ}x®t|jƒƒD]š}|j|ƒ}|jƒsVq/n|jƒ|krnq/n|jƒ}|jt    j
|ƒ}|dkr¢q/nt j |t    j
|dƒ|j |ƒq/W|rãt||ƒndS(Ni(t IpyGameDataPYtIPY_Datatxranget GetStoreCounttGetStoreByIndext GetLimitCntt GetResetTypetGetIDR
R tDef_PDict_ShopBuyCntR RtappendR(Rt resetTypeListt
syncIDListt
ipyDataMgrtitshopItemtshopIDt    curBuyCnt((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRfs&    tc Cs1|s
dSg}g}xþ|D]ö}tjdi|d6ttƒ}|sNqnxÂ|D]º}|jƒ}|r¢|r¢||kr¢|j|ƒtj|||ƒn|jƒs´qUn|jƒ}    |j    t
j |    ƒ}
|
dkrèqUnt j |t
j |    dƒ|j|    ƒqUWqW|r-t||ƒndS(NtStoretShopTypei(RtGetIpyGameDataByConditionRt GetCostItemIDRt ItemControlert RecycleItemRRR
R RR RR( Rt shopTypeListtrecycleItemMailtrecycleCostItemIDListR!Rt ipyDataListtipyDatat
costItemIDR%R&((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytResetShopItemBuyCountByShopType}s0       c Cs[i}d}x]|jƒD]O\}    }
|
dkr7qntjƒj|    ƒ} | sVdS|r‡|    |kr‡||    } tjd| ƒ} ntj|    |ƒ} | s£dS| jƒ} | j    ƒ}| j
ƒ}| j ƒ}| j ƒ}|rZ|j tj| ƒ}td||ƒ}||
krMtjd|| |    ||||
f|jƒƒdS|
|| <n||
|7}qW|dkr|dS|r•tj|||ƒStjd|||||f|jƒƒtj|||||ƒsÝdS|rWg}x[|jƒD]M\} }
|j tj| ƒ}tj|tj| ||
ƒ|j| ƒqöWt||ƒntS(s/ Ö§¸¶×Ô¶¯¹ºÂòÎïÆ·ÏûºÄ£¬´ÓÉ̳ÇÖйºÂò£¬Ö±½Ó¿ÛÇ®£¬²»²úÉúÎïÆ·
            Ò»°ãÓÃÓÚ»ù´¡É̵ê×Ô¶¯¹ºÂòÎïÆ·£¬²»¿¼ÂǸ´ÔÓµÄÏÞ¹ºÂß¼­
    @param isCheck: ÊÇ·ñÖ»ÊǼì²é£¬²»Ö´ÐÐʵ¼ÊÏûºÄÂß¼­
    @param shopItemIndexDict: Ö¸¶¨¹ºÂòµÄÉÌÆ·¶ÔÓ¦É̳DZíÉÌÆ·IDË÷Òý×ֵ䣬Èç¹ûûÓÐÖ¸¶¨ÉÌÆ·Ë÷Òý£¬Ôò°´ÏûºÄµÄ¼Û¸ñÀàÐÍ×Ô¶¯ËÑË÷É̳DZí
    iNR(s_×Ô¶¯¹ºÂò´ÎÊý²»×㣡shopType=%s,shopID=%s,itemID=%s,limitBuyCnt=%s,curBuyCnt=%s,canBuyCnt=%s < %ss]¿Û³ý×Ô¶¯¹ºÂòÏûºÄ: lackItemDict=%s,priceType=%s,totalMoney=%s,costType=%s,addLimitCountInfo=%s(titemst    GameWorldt GetGameDatatGetItemByTypeIDRtGetIpyGameDatat
ItemCommontGetShopItemPriceIpyDataRt GetShopTypet GetMoneyTypet GetMoneyNumRR
R RtmaxtLogt GetPlayerIDR t    HaveMoneytDebugLogtPayMoneyRRRR(Rt lackItemDictt    priceTypetcostTypetinfoDicttisChecktshopItemIndexDicttaddLimitCountInfot
totalMoneytitemIDtlackCnttcurItemR%R2Rt    itemMoneyt limitBuyCntR&t    canBuyCntR!((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytPayAutoBuyItemœsX 
          &       cCs;tjƒj|ƒ}|j}|j}t|||ƒdS(N(R6tGetPlayerManagertGetPlayerByIndextShopIDtBuyCountt    OnBuyItem(tindext
clientDatattickRR%tbuyCount((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt    PyBuyItemäs
        c    Csàtjd||fƒtjƒr'dS|dks?|dkrCdStjd|ƒ}|s_dS|jƒ}|jƒ}|dkrñ|jtj    |ƒ}t
d||ƒ}|dkrÙtjd||||fƒdS||krñ|}qñn|j ƒ|j ƒd}}    }
|j ƒ} g} |rF| j||    ||
gƒnxZ| D]R} | d \}}t| ƒdkr| dnd}| j||||gƒqMW| sÍtjd||f|jƒƒdS| dd}tjd||| fƒt|||||ƒs1tjd||f|jƒƒdS|jƒ}|jƒ|jƒ}}||9}i| d    6|d
6|d 6|d 6|tj6}|rÁ|rHtj|||tj||ƒ rHdSn‡|rH|rH|}tj|||ƒ\}}}|||}|dkr)tjd |||fƒdStj|||||dƒn|dkr·t||tjƒ}tj |tj    ||ƒtjd|||||fƒt!||gƒnt"j#|| ddt$igd|ƒdS(Ns)¹ºÂòÉ̳ÇÎïÆ·: shopID=%s,clientBuyCount=%siR(s:ÉÌÆ·ÏÞ¹º´ÎÊýÒÑÂú ! shopType=%s,shopID=%s,curBuyCnt=%s < %sis,Store shop item error! shopType=%s,shopID=%ss&shopType=%s,shopID=%s,totalItemList=%ss)Store shop item lock! shopID=%s,shopID=%st TotalItemListtClientBuyCountR)RVs9ËùÐèÏûºÄµÀ¾ß²»×ã! costItemID=%s,needItemCnt=%s,lackCnt=%stBuyItemsN¸üÐÂÉ̳ÇÎïÆ·ÏÞ¹º´ÎÊý: shopID=%s,curBuyCnt=%s,clientBuyCount=%s,updBuyCnt=%s/%steventt notifyDataEx(%R6RCt IsCrossServerRR9R<RR
R RR?t    GetItemIDt
GetItemCntt GetItemListExRtlentErrLogRAtCheckBuyItemUnlockR@R+R=R>tDef_Cost_Reason_SonKeyR RDtDef_Cost_BuyStoreItemR:tGetPackItemBindStateIndexInfotDelCostItemByBindtmintDef_UpperLimit_DWordRRR,tGivePlayerItemOrMailtFalse(RR%tclientBuyCountR2RRQR&RRRMt    itemCounttisBindt
itemListExt totalItemListtitemExtitemIDExt itemCountExtisBindExt
mainItemIDR3RFt    itemPriceRHt needItemCnttcostItemIndexListtbindCntt    unBindCntRNt    updBuyCnt((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRXësv          "   
(       %cCsß|jƒ}|jƒ}|tkrŸ|jƒsEtjd|ƒdS|jƒ}|dkrr|jtj    ƒ}n||krÛtjd|||fƒdSn<|t
krÛtj |tj |ƒsÛtjd|ƒdSnt S(NsÎÞ¹«»áÎÞ·¨¹ºÂò! shopID=%sis3¹«»áµÈ¼¶²»×ãÎÞ·¨¹ºÂò! shopID=%s,curFamilyLV=%s < %ss%¸ÃÉÌÆ·Ã»ÓÐËæ»ú½âËøÎÞ·¨¹ºÂò! shopID=%s(t GetUnlockTypetGetUnlockValuetUnlockType_FamilyLVt GetFamilyIDR6RCt GetFamilyLVR
R tDef_Player_Dict_FamilyLVtUnlockType_RandRefreshtGetDictValueByBittDef_PDict_ShopRandUnlockR(RRR%R{R2t
unlockTypet unlockValuet curFamilyLV((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRi3s"        cCs/tjƒj|ƒ}|j}t||ƒdS(N(R6RTRUR)R(RYRZR[RR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt OnRefreshShopUs     ic Csntjdi|d6ttƒ}|s)dSi}g}x[|D]S}|jƒtkrZq<n|jƒ}|jƒ}    |j|    |gƒ|    ||<q<W|s®tj    d|ƒdS|j
t j |ƒ}
d\} } |t kr1tjddƒ}tjddƒ} | r1|
| kr1tjddƒ\} } q1ntjd    ||t|ƒ|
| | |fƒ|dkrmdS| r–| r–tj|| | d
ƒ r–dS|d }g}g}xí|r›t|ƒ|kr›|dkr›|d8}tj|ƒ}|søq¯n|j|ƒ|j|dƒ}    |    |g|kr?|j|    |gƒntj|t j|dƒ|j
t j|ƒr¯tj|t j|dƒ|j|ƒq¯q¯Wtjd t|ƒ|fƒtjd t|ƒ|fƒx-|D]%\}}tj|t j|dƒqÝW|sD|
d7}
tj|t j ||
ƒtjd|
ƒn|rZt||ƒnt|||ƒdS(NR(R)s+¸ÃÉ̵êûÓпÉËæ»úˢнâËøµÄÉÌÆ·! shopType=%sit StoreHeroSouliiisbËæ»úË¢ÐÂÉ̵êÉÌÆ·: shopType=%s,randCnt=%s/%s,refreshCnt=%s,moneyType=%s,moneyValue=%s,sysRefresh=%stRefreshShopItemi
sËæ»úË¢ÐÂÉÌÆ·Êý: %s,%ssÊ£ÓàËø¶¨ÉÌÆ·Êý: %s,%ss¸üÐÂË¢ÐÂÉ̵ê´ÎÊý=%s(ii(RR*RR‚RˆRRƒRR6RhR
R R tShopType_HeroSoult
GetFuncCfgtGetFuncEvalCfgRCRgR RDtGetResultByWeightListtgettremovetSetDictValueByBitRŠRRRR(RRtrandCntRR1tshopIDWeightDicttrandWeightListR2R%t
randWeightt
refreshCntt    moneyTypet
moneyValuetfreeCnttdoCnttrandShopIDListtsyncBuyCntIDListt_((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR[sp         # %
'
 
cCsð|s€g}tjdi|d6ttƒ}|s5dSxH|D]=}|jƒ}tj|tj|ƒslq<n|j|ƒq<Wn|sŠdSt    j
ƒ}||_ t |j tj|ƒdƒ|_||_t|jƒ|_tj||ƒdS(NR(R)iú(RR*RRR6R‰R RŠRtChPyNetSendPackttagSCShopRefreshItemInfoR)RnR
R t
RefreshCntt
ShopIDListRgtCountt NetPackCommont SendFakePack(RRR!R1R2R%t
clientPack((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR¤s&       "    c
CsIg}|r[xõ|D]A}tjƒ}||_|jtj|ƒ|_|j|ƒqWn©tj    ƒ}xšt
|j ƒƒD]†}|j |ƒ}|j ƒs¡qzn|jƒ}|jtj|ƒ}|dkrÕqzntjƒ}||_||_|j|ƒqzW|sdStjƒ}    ||    _t|    jƒ|    _tj||    ƒdS(Ni(R¤ttagSCShopItemBuyCntRVR
R RtBuyCntRRRRRRRRttagSCShopItemBuyCntInfot
BuyCntListRgR¨R©Rª(
RR!t
buyCntListR%tbuyInfoR"R#R$tbuyCntR«((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRºs6                        (!R R6R©R,R¤R RR:RRRR„RˆR‘RRR    RRRRR4tDef_Cost_UnknownRqtNoneRSR]RXRiRŽRRR(((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt<module>2s:                        
             H        H    "    I