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
ƒ:ic@s$ddlZddlZddlZddlZddlZddlZddlZddlZdZdZ    dZ
dZ dZ e gZ d„Zd„Zd„Zd„Zd    „Zd
„Zejiedd „Zd „Zd „Zd„Zd„Zded„Zgd„Zgd„ZdS(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
DoShopOpenHs cCs,t|ƒxtD]}t||ƒqWdS(N(tSyncShopItemBuyCntInfoRtSyncShopRefreshItemInfo(RR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnLoginMs
 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 ShopItemOnDaySs cCst|tgƒdS(N(RtResetType_Week(R((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnWeek]scCsç|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.pyRas&    cCsä|s
dSg}x·|D]¯}tjdi|d6ttƒ}|sHqnx{|D]s}|jƒsgqOn|jƒ}|jtj|ƒ}|dkr›qOntj    |tj|dƒ|j
|ƒqOWqW|ràt ||ƒndS(NtStoretShopTypei( RtGetIpyGameDataByConditionRRRR
R RR RRR(Rt shopTypeListRRt ipyDataListtipyDataR#R$((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytResetShopItemBuyCountByShopTypexs&     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#R*Rt    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(R-tGetPlayerManagertGetPlayerByIndextShopIDtBuyCountt    OnBuyItem(tindext
clientDatattickRR#tbuyCount((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt    PyBuyItemÖs
        c
CsJtjd||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ƒ}}||9}i| d    6|d
6|d 6|d 6|tj6}|r²|r²tj|||tj||ƒ r²dS|dkr!t||tjƒ}tj|tj    ||ƒtjd |||||fƒt||gƒntj|| 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&RMsN¸üÐÂÉ̳ÇÎïÆ·ÏÞ¹º´ÎÊý: shopID=%s,curBuyCnt=%s,clientBuyCount=%s,updBuyCnt=%s/%steventtBuyItemt notifyDataEx(!R-R:t IsCrossServerRR0R3RR
R RR6t    GetItemIDt
GetItemCntt GetItemListExRtlentErrLogR8tCheckBuyItemUnlockR7R4R5tDef_Cost_Reason_SonKeyR R;tDef_Cost_BuyStoreItemtmintDef_UpperLimit_DWordRRt ItemControlertGivePlayerItemOrMailtFalse(RR#tclientBuyCountR*RRHR$RIRDt    itemCounttisBindt
itemListExt totalItemListtitemExtitemIDExt itemCountExtisBindExt
mainItemIDR=t    itemPriceR?t    updBuyCnt((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyROÝsb          "  
.     %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 GetFamilyIDR-R:t GetFamilyLVR
R tDef_Player_Dict_FamilyLVtUnlockType_RandRefreshtGetDictValueByBittDef_PDict_ShopRandUnlockR(RRR#RqR*t
unlockTypet unlockValuet curFamilyLV((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR`s"        cCs/tjƒj|ƒ}|j}t||ƒdS(N(R-RKRLR&R(RPRQRRRR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt OnRefreshShop<s     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'RRtRzRRuRR-R_R
R R tShopType_HeroSoult
GetFuncCfgtGetFuncEvalCfgR:R^R R;tGetResultByWeightListtgettremovetSetDictValueByBitR|RRRR(RRtrandCntRR)tshopIDWeightDicttrandWeightListR*R#t
randWeightt
refreshCntt    moneyTypet
moneyValuetfreeCnttdoCnttrandShopIDListtsyncBuyCntIDListt_((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRBsp         # %
'
 
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'RRR-R{R R|RtChPyNetSendPackttagSCShopRefreshItemInfoR&RcR
R t
RefreshCntt
ShopIDListR^tCountt NetPackCommont SendFakePack(RRRR)R*R#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–ttagSCShopItemBuyCntRMR
R RtBuyCntRRRRRRRRttagSCShopItemBuyCntInfot
BuyCntListR^RšR›Rœ(
RRt
buyCntListR#tbuyInfoR R!R"tbuyCntR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR¡s6                        (R R-R›ReR–R RR1RRRvRzRƒRRR    RRRR+tDef_Cost_UnknownRgtNoneRJRTROR`R€RRR(((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt<module>2s6                        
            H        =    "    I