hxp
2025-05-29 f08058713e574c675579ca5ccbfabeb1e6702cf0
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
±8hc@s³ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZdZiad„Zd„Zd„Zged„Zd„Zd„Zd    „Zd
„Zd „Z d „Z!d „Z"d„Z#d„Z$d„Z%d„Z&d„Z'd„Z(d„Z)d„Z*ej+iedd„Z-d„Z.d„Z/d„Z0dd„Z1d„Z2d„Z3d„Z4d„Z5d„Z6d „Z7d!„Z8d"„Z9d#„Z:d$„Z;d%„Z<d&„Z=d'„Z>d(„Z?d)„Z@d*„ZAd+„ZBd,„ZCid-„ZDd.„ZEdS(/iÿÿÿÿNicCs|jƒ}|dkrdS|jƒtjkr5dStjƒj|jƒƒ}|j    ƒ}|j
t j |ƒ|j dƒ|jtjƒtS(Ni(t GetActionObjtNonetGetGameObjTypet IPY_GameWorldtgotNPCt    GameWorldt GetNPCManagert GetNPCByIndextGetIndextGetNPCIDtSetDicttChConfigtDef_PlayerKey_TradeTagNPCtSetForbiddenResetItemtBeginSpecialEventt ShareDefinetTYPE_Event_ShoptTrue(t    curPlayerttickt curActionObjt curActionNPCtcurActionNPCID((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt
StartTradeSs    cCsdS(Ni((((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytGetDirectNpcIDkscCs¡tjƒj|ƒ}||jtjƒtjtjkr?dS|jtj|ƒ|j}tj    ƒj
|ƒtj    ƒj ƒ}|dkrdS|j |ƒdS(Ni( RtGetPlayerManagertGetPlayerByIndext GetTickByTypeR tTYPE_Player_Tick_QueryFuncDatatTYPE_Player_Tick_Timet SetTickByTypet    NPCShopIDt GetGameDatatFilterShopItemByShopTypetGetFilterShopItemCountt BeginShopEx(t playerIndext
clientDataRRt tradeTagNPCt shopItemCount((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytQueryNPCShopItemss      c
Cstjƒ}g|_|rExÁ|D]}t|||j|ƒq"Wnštjƒ}x‹t|jƒƒD]w}|j|ƒ}|j    ƒs‹qdnt
j |j ƒ}|j |ƒ}    |    dkr¿qdnt||j ƒ|j|ƒqdWt|jƒ|_tj||ƒdS(Ni(tChPyNetSendPackttagMCShopItemDayBuyCntInfot DayBuyCntListt__AppendShopItemDayBuyCntInfot IpyGameDataPYtIPY_Datatxranget GetStoreCounttGetStoreByIndext GetLimitCntR tDef_PDict_ShopItemDayBuyCnttGetIDtNomalDictGetPropertytlentCountt NetPackCommont SendFakePack(
Rt itemIndexListtisResett dayBuyCntInfot    itemIndext
ipyDataMgrtitshopItemt dayBuyCntKeyt curDayBuyCnt((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytSyncShopItemTodayBuyCount•s$          cCsZtjƒ}||_tj|}|j|ƒ}||_t|ƒ|_|j    |ƒdS(N(
R)ttagMCShopItemDayBuyCntt    ItemIndexR R3R5tBuyCnttinttIsResettappend(RR=t dayBuyCntListR;t itemDayBuyCntRARB((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR,°s           cCsWt|ƒt|ƒ|jtjdƒsIt|ttjƒj    ƒƒnt
|ƒdS(Ni( tSyncMysticalLimitShopInfoRCR5R tDef_PDict_MysticalShopGoodst__DoMysticalShopRefreshRRt GetGameWorldtGetTicktSyncMysticalShopInfo(R((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnLogin»s 
 
 
cCs|tjkrEt|ƒdg}tj|tjdƒt|ƒn°|tjkrñdg}t    j
ƒj tj ƒ}t    j
ƒj tj ƒ}|rÎt    j
ƒj tjƒ}|ddkrî|jdƒqîqõ|ddkrõ|jdƒqõndSt||ƒdS(Niiii(RtDef_OnEventTypetOSSaleOpenMailt PlayerControltNomalDictSetPropertyR t Def_PDict_MysticalShopRefreshCntRQtDef_OnEventTypeExRROtGetGameWorldDictByKeytDef_Notify_WorldKey_ServerDaytDef_Notify_WorldKey_IsMixServert Def_Notify_WorldKey_MixServerDayRItResetShopItemBuyCount(Rt onEventTypet refreshTypet openServerDayt isMixServert mixServerDay((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt ShopItemOnDayÆs$
          cCsK|tjkrdg}n|tjkr6dg}ndSt||ƒdS(Nii(RRSRXR](RR^R_((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnWeekàs   cCsH|tjkrd}n|tjkr0d}ndSt||gƒdS(Nii(RRSRXR](RR^R_((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnMonthís        cCsd}t||gƒdS(Ni(R](RR_((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytShopItemOnCrossPKSeasonChange÷scCsû|s
dSg}tjƒ}x¿t|jƒƒD]«}|j|ƒ}|jƒsVq/n|jƒrhq/n|jƒ|kr€q/ntj    |j
ƒ}|j |ƒ}|dkr´q/nt j ||dƒ|j|j
ƒƒq/W|r÷t||tƒndS(Ni(R-R.R/R0R1R2tGetRefreshLimittGetRefreshTypeR R3R4R5RURVRIRCR(Rt resetTypeListt syncIndexListR>R?R@RARB((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR]ýs*    cCsû|s
dSg}tjƒ}x¿t|jƒƒD]«}|j|ƒ}|jƒsVq/n|jƒrhq/n|jƒ|kr€q/ntj    |j
ƒ}|j |ƒ}|dkr´q/nt j ||dƒ|j|j
ƒƒq/W|r÷t||tƒndS(Ni(R-R.R/R0R1R2Rgt GetShopTypeR R3R4R5RURVRIRCR(Rt shopTypeListRjR>R?R@RARB((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytResetShopItemBuyCountByShopTypes*    c    CsÚtjdidd6tƒ}|s&dSttjƒƒ}g}x‚|D]z}|jƒ}||krE||krE|jƒ}tj|t    j
||ƒ|j |ƒt j d||jƒƒqEqEW|rÖt|ƒndS(NtStoreitShopTypesÉñÃØÏÞ¹ºÉÌÆ·%s ¿ªÂô(R-tGetIpyGameDataByConditionRRGttimet
GetLimitLVR4RURVR tDef_PDict_ShopItemStartTimeRIRtDebugLogRL(    RtbefLVtaftLVt ipyDataListtcurTimet syncGoodsListtipyDatatlimitLVtgoodsID((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytMysticalLimitShopOpen0s    ! cCstjƒ}g|_tjdidd6tƒ}ttjƒƒ}x|D]•}|jƒ}|j    t
j |ƒ}|s~qJn|||j ƒkr±t j|t
j |dƒqJtjƒ}||_||_|jj|ƒqJW|jsðdSt|jƒ|_tj||ƒdS(NRniRoi(R)ttagMCMysticalShopTimeInfot ShopTimeListR-RpRRGRqR4R5R Rst GetLimitValueRURVttagMCMysticalShopTimetGoodsIDt    StartTimeRIR6R7R8R9(RtpackDataRwRxRzR|t    startTimet    goodsTime((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRLBs(                    cCs|jƒ}|sdStjƒtj|tjƒ}|jddd|j}tj    ddƒ}|rŒ||dkrŒt
|t |ƒndS(Nii<tMysteryShopRefreshii( tGetCreateRoleTimeRtGetCurrentTimetGetDateTimeByStrR tTYPE_Time_FormattdaystsecondsR-t
GetFuncCfgRNR(RRtcreateRoleTimetdiffTimet pastSecondst refreshTime((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytCheckMysticalShopRefresh[s cCs)tjƒj|ƒ}t|t|ƒdS(N(RRRRNtFalse(tindexR%RR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytOnMysticalShopRefreshlsc,    Csµtjddƒ}|sdS|jtjƒ}|rH||dkrHdS|jtj|ƒts…tjƒ}xt|j    ƒƒD]þ}|j
|ƒ}|j ƒ}|j ƒ}    tj d|    ƒ}
|
sËq€n|
jƒ} |
jƒ} t|ƒ} | tkr| digt| <i}n| t| dkrAgt| d| <n|j| dƒ| || <t| d| j|| |    gƒq€WntsdS|jƒ}tjt|ƒ\}}|s½dStjddƒ}tjtjddƒƒ}|sôdSd}|s|jƒjtjƒ}tjddƒ}tjddƒ}|jtjƒ}g|jƒD]}t|ƒ^q[}|j ƒ|t!|d    ƒ}x.|D]&}||kr˜|t!|ƒ}Pq˜q˜Wt"j#|||ƒ\}}}}d} |s*|tjdd
ƒ} t$j%|tj&| tj'ƒs*dSnt"j(||||t)dƒ|jtj*ƒ}!|!d |!d }"}#||#krdn|"d}$t+|$d |tj,ƒ}%t$j-|tj*|%ƒtjdd ƒ}&||&krü|$|&|dkrü|&|d}nt$j-|tj|dƒnt+||ƒ}||}'g}(|ri|(tj.|jtj&gƒ|gƒ7}(n|'rš|(tj.|jtj/gƒ|'gƒ7}(n|rÓ||(krÓ||(d<tj0d ||$|fƒntj0d|||'|(fƒg})x•t|ƒD]‡}|t1|(ƒkr%|(|nd}    t$j-|tj2||    ƒtj3|    }*|j|*ƒ}+|+rt$j-||*dƒ|)j|    ƒqqW|)r§t4||)t5ƒnt6|ƒdS(NR‡iièRniitMysteryShopGoodsiiÿÿÿÿii'isEÉñÃØÉ̵êË¢ÐÂÌØÊâ¹æÔò£¬µÈ¼¶¶Î£º%s,updLVRefreshCnt=%s,specialGoodsID=%ssJÉñÃØÉ̵êË¢ÐÂisFree=%s,goldGoodsCnt=%s,sliverGoodsCnt=%s,goodsResultList=%s(7R-RŽt GetDictByKeyR t"Def_PlayerKey_MysticalShopLastTimeR
tg_mysticalShopDictR.R/tGetMysteryShopCounttGetMysteryShopByIndext
GetLVRanget
GetGoodsIDtGetIpyGameDatat GetMoneyTypeR€ttupletgetRItGetLVRtGetDictValueByRangeKeytGetResultByRandomListtGetFuncEvalCfgtGetItemManagertGetPackRtrptItemR5RWtkeysRGtsorttstrt
ItemCommontGetItem_FromPack_ByID_ExExRUtPayMoneytTYPE_Price_Gold_MoneytDef_Cost_MysteryShopRefresht
ReduceItemR”t"Def_PDict_MysticalShopLVRefreshCnttmintDef_UpperLimit_DWordRVtGetResultByRandomListExtTYPE_Price_Silver_MoneyRtR6RMR3RCRRQ(,RtisFreeRR’tlastTimetipyMgrR?RztlvRangeR|t goodsIpyDatat    moneyTypetweighttlvkeyt
weightDicttplayerLVtcurLVDantshopDicttmaxCntt goldGoodsCnttspecialGoodsIDtitemPackt
costItemIDtcostItemCntDictt curRefreshCnttcnttcntListt costItemCnttenought    indexListthasBindtlackCnttcostGoldtcurLVRefreshDatatcurLVRefreshCnttlvDantupdLVRefreshCnttupdLVRefreshDatatspecialRefreshCfgtsliverGoodsCnttgoodsResultListRjRARB((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRNqs²           * %
  ! 
++
" 
cCs´tjƒ}|jtjƒ|_g|_tjddƒ}xOt    |ƒD]A}|jtj
|ƒ}tj ƒ}||_ |jj |ƒqIWt|jƒ|_tj||ƒdS(NR—i(R)ttagMCMysticalShopInfoR5R RWt
RefreshCntt    GoodsListR-RŽR/RMttagMCMysticalShopGoodsR‚RIR6R7R8R9(RR„RÄR?R|t    goodsInfo((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRQÔs          c     Cs¶|j}|jƒjtjƒ}||jƒkr7dS|j|ƒ}| sY|jƒr]dS|jƒ}tj    |ƒ}|j
tj |j ƒ||j ƒƒs¼tj|dtj gƒdSt||ƒ\}}    t|ƒ|}|     sï| ródSi|j ƒtj6}
tj||    |tj|
ƒs+dS|jtj |ddtigƒt|jtjƒƒ} | jt|dƒdƒ} | dkr–d} ntj|tjt| ƒƒdS(NtGeRen_chenxin_676165teventt BuyItemBackitt0(tIndexR§R¨Rt
rptRecycletGetCounttGetAttIsEmptyt ItemControlertPlayerItemControlert CanPutInItemR©t GetItemTypeIDt    GetIsBindRUt
NotifyCodet__GetItemSellPriceRGR tDef_Cost_Reason_SonKeyR¯tDef_Cost_BuyItemBackt    PutInItemR”R¬R5tDef_Player_Dict_DelPackIndextreplaceRV( Rt
clientPackRR•tbackPacktcurItemt realPutCountt itemControlt    itemPricet    priceTypetinfoDictt
itemIndexs((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRâæs:          "     c Csei}d}xg|jƒD]Y\}    }
|
dkr7qntjƒj|    ƒ} | sVdS|r‡|    |kr‡||    } tjd| ƒ} ntj|    |ƒ} | s£dS| jƒ} | j    ƒ}| j
ƒ}| j ƒ}| j ƒ}|rd|d}|j tj| ƒ}td||ƒ}||
krWtjd|| |    ||||
f|jƒƒdS|
|| <n||
|7}qW|dkr†dS|rŸtj|||ƒStjd|||||f|jƒƒtj|||||ƒsçdS|rag}x[|jƒD]M\} }
|j tj| ƒ}tj|tj| ||
ƒ|j| ƒqWt||ƒntS(s/ Ö§¸¶×Ô¶¯¹ºÂòÎïÆ·ÏûºÄ£¬´ÓÉ̳ÇÖйºÂò£¬Ö±½Ó¿ÛÇ®£¬²»²úÉúÎïÆ·
            Ò»°ãÓÃÓÚ»ù´¡É̵ê×Ô¶¯¹ºÂòÎïÆ·£¬²»¿¼ÂǸ´ÔÓµÄÏÞ¹ºÂß¼­
    @param isCheck: ÊÇ·ñÖ»ÊǼì²é£¬²»Ö´ÐÐʵ¼ÊÏûºÄÂß¼­
    @param shopItemIndexDict: Ö¸¶¨¹ºÂòµÄÉÌÆ·¶ÔÓ¦É̳DZíÉÌÆ·IDË÷Òý×ֵ䣬Èç¹ûûÓÐÖ¸¶¨ÉÌÆ·Ë÷Òý£¬Ôò°´ÏûºÄµÄ¼Û¸ñÀàÐÍ×Ô¶¯ËÑË÷É̳DZí
    iNRnse×Ô¶¯¹ºÂò´ÎÊý²»×㣡shopType=%s,itemIndex=%s,itemID=%s,limitBuyCnt=%s,curDayBuyCnt=%s,canBuyCnt=%s < %ss]¿Û³ý×Ô¶¯¹ºÂòÏûºÄ: lackItemDict=%s,priceType=%s,totalMoney=%s,costType=%s,addLimitCountInfo=%s(titemsRR tGetItemByTypeIDR-RŸR­tGetShopItemPriceIpyDataR4RkR t GetMoneyNumR2R5R R3tmaxtLogt GetPlayerIDRUt    HaveMoneyRtR¯RVRIRCR(Rt lackItemDictRütcostTypeRýtisChecktshopItemIndexDicttaddLimitCountInfot
totalMoneytitemIDRÑRøR=RztshopTypet    itemMoneyt limitCntListt limitBuyCntRBt    canBuyCntRj((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytPayAutoBuyItemsZ 
 
     &       cCs;tjƒj|ƒ}|j}|j}t|||ƒdS(N(RRRt BuyItemIndextBuyCountt    OnBuyItem(R•R%RRR=tbuyCount((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt    PyBuyItem[s
        cCs8tjƒ}|jƒ}|jƒ}t|||ƒdS(N(RtIPY_CBuyItemListtGetBuyItemIndext GetBuyCountR(RRt buyItemListR=tclientBuyCount((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytBuyItemfs
   c) Cstjd||f|jƒƒtjƒr0dS|dksH|dkrLdStjd|ƒ}|shdS|jƒ}|jƒ}|dkr¢tj    |ƒsÄdSn"|dkrÄt
j |ƒsÄdSn|j ƒ}|rì|j ƒ|krìdS|jƒ}|jƒ}d}    |s|rÐ|s(dg}n|s:dg}nt|ƒt|ƒkrctjdƒdS|jƒ}
d}    x4t|ƒD]&\} } |
| kržPn|| }    q‚W|    dkrÐtjd| ƒdSnd} tj|}|    dkrm|j|ƒ} td|    | ƒ}|dkr8tjd    ||fƒdS||krmtjd
||||fƒ|}qmn|jƒ}|dkr—t||ƒ}n|jƒ|jƒ|jƒ}}}|jƒ}|jƒ|jƒ}}||9}|j ƒ}|j!ƒ}g}|r?t"|||ƒ}|j#||||gƒnxC|D];\}}}t"|||ƒ}|j#||||gƒqFW|s©tj$d |||fƒdSd}i}x·t|ƒD]©\} } | d}| d}!tj%ƒj&|ƒ}"|"stj$d ||fƒdStj'|"ƒ}#t(j)|#|"|!ƒ}$|j*|#dƒ|$||#<| dkrÂ|}qÂqÂW|sydStjd ||||||f|jƒƒ|j+ƒ}%t,}&xu|j-ƒD]g\}#}$|$t.j/||#|$ƒkrÄt0}&|%rûPq+|j1|t2j3ƒt4j5|d|#gƒdSqÄqÄW|&rA|%rA|%nd}'t6|||||j7ƒ|ƒr•tjd|||j7ƒf|jƒƒdSt4j8|||ƒsÁ|j1|t2j9ƒdS|dkr^|j:tj;ƒdkrútjd|ƒdSd||||||    |'g}(tj<ƒj=|j>ƒddd|(t|(ƒƒ|j?tj;dƒdSt@||||||    |'|ƒdS(Ns,¹ºÂòÉ̳ÇÎïÆ·: itemIndex=%s,clientBuyCount=%siRniis)    ¹ºÂòÎïÆ·LimitVIPLV  LimitCnt ³¤¶È²»Í¬iÿÿÿÿs    vip%s²ÅÄܹºÂòs6BuyShopItem ½ñÈÕ¹ºÂò´ÎÊýÒÑÂú£¡shopType=%s,itemIndex=%ssQBuyShopItem ÐÞÕý¹ºÂò´ÎÊý£¡shopType=%s,itemIndex=%s,clientBuyCount=%s,canBuyCnt=%ss@Store shop item error! shopType=%s,totalItemList=%s,itemPrice=%ss,Store shop item error! shopType=%s,itemID=%ssh¹ºÂòÎïÆ·: shopType=%s,itemIndex=%s,clientBuyCount=%s,totalItemList=%s,mainItemID=%s,needPackSpaceDict=%sRàRãsAStore shop item buy limit! shopType=%s,itemIndex=%s,limitValue=%ss1È«·þ¹ºÂò´ÎÊýÒѾ­ÔÚ²éѯÖÐ, ²»Öظ´²éѯ itemIndex=%ss%stGetStoreServerBuyCnt(ARRtRt IsCrossServerR-RŸRktGetOperationActionShoptPlayerSpringSaletIsSpringSaleShopTypetPlayerFlashSaletIsFlashSaleShopTypeRrR£t GetLimitVIPLVR2R6RtGetVIPLvt    enumerateR R3R5RtGetServerLimitCntR´t    GetItemIDt
GetItemCntRît GetItemListExR RtGetJobt
GetJobItemtGetShopJobItemRItErrLogR RtGetItemPackTypeRêtGetItemNeedPackCountR¢t
GetMailKeyR”RÿR­tGetItemPackSpaceRt
ShopResultRt
tsrNoPlaceRURïtCheckBuyItemLimitExR€Rt
tsrNoMoneyR˜tDef_PlayerKey_StoreQueryStateRtGameServer_QueryPlayerResultR4R
tDoBuyStoreItem()RR=RRzRtoperationActionShopTypeR{tLimitVIPLVListt LimitCntListRtcurVIPlvR?tviplvRBRARtserverLimitCntR t    itemCounttisBindt
itemListExRüRûtjobt jobItemListt totalItemListt    jobItemIDtitemIDExt itemCountExtisBindExt
mainItemIDtneedPackSpaceDicttitemInfotitemCntRøtpackTypet    needSpacetmailKeyt
isLackPackt sendMailKeytcmdStr((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRmsê                           & 
 
 
      #  !      c
Csb|stjd|ƒ}n|jƒ|jƒ}}    |    |9}    |jƒ}
tj||ƒ} i|d6|d6|
d6|d6|tj6} tj    |||    tj
| |ƒsÊt j d||||    fƒdStj||ƒ} |dkritj |}|j|ƒ}t||tjƒ}tj|||ƒt jd|||||f|jƒƒt||gƒni|
d6|d6|d6|    d    6|d
6| d 6| d 6}|tjgk}x0|D](\}}}tj||td |ƒ}|sïq¹n|jƒ}|jƒ|s[tj||||dtj||gƒs[t j d||f|jƒƒq[n|jƒrž||kržtjd|jƒ|j ƒ||gƒn|dkr¹t!j"|dtj#ƒ}|rát!j$||dƒqáq¹q¹W|rtj%||j&ƒg|d|ƒntj'||tjd|
ƒt(|||ƒ|
t)kr^t*j+|||ƒndS(NRnt TotalItemListtClientBuyCountRot ShopItemIndexsX¹ºÂòÉ̳ÇÎïÆ·Êµ¼Ê¿Û³ý»õ±Òʱʧ°Ü: itemIndex=%s,clientBuyCount=%s,priceType=%s,itemPrice=%sisW¸üÐÂÉ̳ÇÎïÆ·ÏÞ¹º´ÎÊý: itemIndex=%s,curDayBuyCnt=%s,clientBuyCount=%s,updDayBuyCnt=%s/%st    ItemPricet    MoneyTypet BeforeMoneyt
AfterMoneyRRás1¹ºÂòÉ̳ÇÎïÆ··ÅÈë±³°üʧ°Ü! itemID=%s, itemCount=%sii    itdetailtdataEx(,R-RŸR RRkRUtGetMoneyR RñR¯tDef_Cost_BuyStoreItemRR0R3R5R´RµRVRtRRCRR·RêtGetOutPutItemObjR”t GetUserDatatCleartGivePlayerItemtItemGive_BuyItemt GetNotifyMarkt WorldNotifytGetNameR­tFindItemInPackByItemIDR©tDelItemt SendMailByKeyR4tNotifyGiveAwardInfotSyncShoppingResulttShopType_FairyCeremonytPlayerFairyCeremonytOnBuyFireworks(RR=RRGRLRRTRzRüRûRt beforeMoneyRýt
afterMoneyRARBt updDayBuyCnttdataDictt isForceEventR RBRCt
curItemObjtuserDatat delGuardItem((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR;÷s^
 !            
*&+ % cCs™x’|D]Š}t|ƒttgkr@tjd||fƒ|S||kr|dksj|t|ƒkr…tjd||fƒ|S||dSqW|S(Ns3É̳ÇÖ°ÒµÎïÆ·×é¸ñʽ´íÎó!shopItemID=%s,jobItemList=%sis>É̳ÇÖ°ÒµÎïÆ·ÅäÖôíÎó,ûÓиÃÖ°Òµ¶ÔÓ¦ÎïÆ·ID!shopItemID=%s,job=%si(ttypetlistR¡RR0R6(RER RFt jobItemIDList((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR/6s  cCs2tjƒ}||_||_tj||ƒdS(N(R)ttagMCShoppingResultREtItemCntR8R9(RR=ROt
resultInfo((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRmCs
         c
Cs|dkrtj||ƒ S|d    krv|jƒdkr?tS|jƒ}|dkrl|jtjƒ}n||kS|d
kr¨tj    ƒj
t j ƒd}||kS|t krÈtj|||ƒ S|dkr|jtj|ƒ}ttjƒƒ}    | p|    ||kStS( Niii    i
iiii(ii    i
(i(t
PlayerRunetGetIsOpenByRuneIDt GetFamilyIDRt GetFamilyLVR5R tDef_Player_Dict_FamilyLVRRORYRRZRnRotIsCanBuyFireworksRsRGRqR”(
Rt    shopNPCIDR=t    curItemIDt
limitValueRt curFamilyLVR`R…Rx((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR7Ns&    
 
  cCs€tj|tjƒsdStjƒjtjƒd}|tj    dƒkrNdStj    ddƒ}t
j d|j ƒg|ƒdS(NiRTit    SellMail1( t GameFuncCommt GetFuncCanUseRtGameFuncID_OSSailRRORYRZR-R¦RURkR4(RR`t addItemList((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRT…scCsVd}|jtjƒ}|s%tƒSt||ƒr8|Stjd||jƒƒ|S(Niÿÿÿÿs.GetCurStoreItemList:trade tag NPC not match:%s(R˜R R RtCheckTradeTagNPCRR0R(RRR&((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytGetCurTradeTagNPC”s  cCsd|jƒ}|stS|jƒtjkr/tStjƒj|jƒƒ}|j    ƒ|kr`tSt
S(N( RR”RRRRRRRR    R(RR&RR((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRŽ«s cCsCtjƒ}|jƒ}|jƒ}tj}t|||g|ƒS(N(RtIPY_CPlayerSellItemt GetPackTypet GetItemIndexR tDef_ShopType_NpcShopt SellPackItem(RRtsendDataRPR=R((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytSellItemÀs
       cCsotjƒj|ƒ}|j}|j}|s1dStj}t||||ƒ}|rk|jt    j
dƒndS(Ni( RRRtPackTypeRER R“R”tSync_MakeItemAnswerRtDef_mitKeySell(R•R%RRRPt ItemIndexListRtisOk((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytOnSellManyItemÒs            c
Csy|jƒj|ƒ}|dkr%tSi}t}ttjtjƒ}xÇ|D]¿}|j|ƒ}    t    ||    ƒswqMnt
}|    j ƒ}
t ||    ƒ\} } t | ƒ|
} |j| dƒ| || <|    jƒ|koçtj|    ƒ }tj||    |
ttjd|ƒqMW|stSxX|jƒD]J\}}i}tj|||tj|tƒtj|d||gƒq'Wt
S(Nit    isForceDRt
GetMoney01(R§R¨RR”trangeR tDef_ItemType_retWeapontDef_ItemType_retNeckRèt__CheckItemSellRRçRðRGR¢tGetTypeRêtItemNotNeedRecordR­RjtItemDel_SellPackItemRÿRUt    GiveMoneytDef_GiveMoney_SellPackItemRï(RRPR:RR÷ttotalSellPriceDictt    hasSellOKtnotForceRecordEquipTypeListR=Røt curItemCounttcurItemSellPricetcurItemSellTypetcurAllItemSellPriceRRüt
priceMoneyt addDataDict((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRӾs0   
"&cCsûdSt|jtjƒƒ}|jƒjtjƒ}tj    |tjƒ}|dkrt
|dƒd}|j |ƒ}|j ƒ|d}n+|j t|dƒdƒ}|j |ƒ}d||df}|j|ƒtj|tjt
|ƒƒdS(NiÿÿÿÿiiRãs%s%s(R¬R5R RôR§R¨RRæR­tGetEmptyIndexInPackRGRèRcRõtPutInRURV(RRøRþR÷t
emptyIndextitem((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytPutItemInBuyBackPacks 
  cCs³tj|ƒs#tj|dƒdS|jƒdkrItj|dƒdSt||ƒ\}}t|ƒ|jƒ}| s‚| r–tj|dƒdStj|||ƒs¯dSt    S(NtGeRen_chenxin_644055itGeRen_lhs_272921(
R­tCheckItemCanUseRURït
GetCanSellRðRGRçt CanGiveMoneyR(RRøRûRü((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyR¢3scCs4|jƒ}|stj}n|jƒ}||fS(N(tGetGoldPaperPriceRR·tGetSilverPrice(RRøRüt curItemPrice((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRðVs
   cCs-|jƒtjkr)tj|dƒtStS(NtGeRen_chenxin_740826(tGetPlayerActionR tDef_Player_DoEvent_StateRURïR”R(R((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytCheckPlayerCanStateEventhscCs|jƒtjkS(N(R£R tDef_Compose_Can_Put_List(Rø((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt__CheckItemCanPutInComposePackusc    Cs’t||||ƒ}|dkr%dStj|ƒ}|j||jƒ||jƒƒsrtj|d|gƒdStj    ||||||ƒdS(NRà(
t__GetBackPackOperateItemRRêRëRìRíRîRURïtDragItem(    Rt srcBackpackt desBackPacktsrcIndext    destIndext putItemCountRtscrItemRú((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytBackpackOperateƒs $cCsI|tjkrEt|ƒsEtjd|jƒ|jƒfƒtSntS(Ns+BackpackOperate ItemErr = %s, ItemType = %s(    R tDef_ComposePack_ListRÃRR0RíR£R”R(RËRÇ((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt__CheckBackPackOperate™s
 #cCsŠ|tjks|tjkrBtjd||f|jƒƒdS|jƒj|ƒj|ƒ}tj    |ƒssdSt
||ƒs†dS|S(NsHPackItemExchange packErr, srcBackpack = %s,             desBackPack = %s( R tDef_BackpackOperate_ListRR0R4R§R¨RèR­R¸RÎ(RRÆRÇRÈRË((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyRÄ©scCsyt||||ƒ}|dkr%dS|jƒj|ƒj|ƒ}|dks[|jƒr_dStj||||ƒdS(N(RÄRR§R¨Rèt GetIsLockedR­tDoLogicSwitchItem(RRÆt destBackPackRÈRÉRRËtdestItem((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytPackItemExchangeÆs cCs}t|ƒ}xjtd|dƒD]V}||}||d}|j|ƒ}|dkre|||<q||c|7<qW|S(Niii(R6RŸR¢R(t    moneyListt payMoneyDicttlengthR•R½tmoneytpayMoney((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pytGetPayMoneyDictÜs 
  cCs:x3|jƒD]%\}}tj|||ƒs tSq WtS(N(RÿRURR”R(RRÖR½RØ((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt CheckPayMoneyñs(FR)R8RRRêR RUR­RR$tChItemR-RRŠRotPlayerNewFairyCeremonyR"t
PyGameDatatrandomtmathRqRnRšRRR(R”RCR,RRRcRdReRfR]RmR}RLR“R–RNRQRâtDef_Cost_UnknownRRRRRR;R/RmR7RTRRŽR–RœR”RµR¢RðRÁRÃRÌRÎRÄRÔRÚRÛ(((sxD:\SG_ServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Event\EventSrc\FunctionNPCCommon.pyt<module>1s„                                 "                       
                                c        ,I             Š ?              7                        0        #