xdh
2018-09-10 b58392bcbca98bfa2f9fd90fad8978f1ed77d8bc
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
#-------------------------------------------------------------------------------
#
##@package Player.PlayerGreatMaster
#
# @todo:´óʦϵͳ
# @author hxp
# @date 2015-2-27
# @version 1.8
#
# @change: "2015-03-05 11:00" hxp ¸ù¾Ý´óʦµÈ¼¶»ñÈ¡´óʦËùÐèÉý¼¶¾­Ñé
# @change: "2015-03-07 00:00" hxp Ì츳buffË¢ÊôÐÔʱ»úÐÞ¸Ä
# @change: "2015-03-07 04:10" ljd ±£´æ³É¹¦ÏµÍ³Ìáʾ
# @change: "2015-05-28 14:00" hxp Ë¢ÊôÐÔÓÅ»¯
# @change: "2015-07-29 15:20" xdh ´óʦ¸Ä³ÉµÈ¼¶¿ªÆô
# @change: "2015-08-24 14:40" zqx Ôö¼Ó·ÖÅäxµãÌ츳µã³É¾Í
# @change: "2016-01-26 15:00" hxp PY±íÖ§³ÖÖØ¶Á
# @change: "2016-06-02 20:00" hxp ¹¦ÄÜ¿ª·ÅÂß¼­ÐÞ¸Ä
#
# ÏêϸÃèÊö: ´óʦϵͳ
#
#---------------------------------------------------------------------
#"""Version = 2016-06-02 20:00"""
 
import GameWorld
import PyMapTable
import PlayerControl
import IPY_GameWorld
import PlayerBillboard
import ChPyNetSendPack
import DataRecordPack
import NetPackCommon
import ReadChConfig
import SkillCommon
import ShareDefine
import SkillShell
import BuffSkill
import ChConfig
import PlayerSuccess
import GameFuncComm
import IpyGameDataPY
 
## ´óʦ¹¦ÄÜÊÇ·ñ¿ªÆô
#  @param curPlayer
#  @return
def IsGreatMasterOpen(curPlayer):
#    curReinCnt = curPlayer.GetReincarnationLv() # µ±Ç°×ªÉú´ÎÊý
#    if curReinCnt < 3:
#        return False
    
    if not GameFuncComm.GetFuncCanUse(curPlayer, ShareDefine.GameFuncID_GreatMaster):
        return False
    
    return True
 
## Ôö¼Ó´óʦÌ츳µã
#  @param curPlayer
#  @return
def AddGreatMasterSkillPointByLV(curPlayer, addPoint):
    if not addPoint:
        return
    curFreeSkillPoint = GetGreatMasterFreeSkillPoint(curPlayer)
    #GameWorld.DebugLog("´óʦÌ츳µã£¡curFreeSkillPoint = %s"%curFreeSkillPoint)
    SetGreatMasterFreeSkillPoint(curPlayer, curFreeSkillPoint + addPoint)
    Sync_GreatMasterFreeSkillPoint(curPlayer)
    return
    
    
## ×ªÉú´¦Àí
#  @param curPlayer
#  @return
def OnReincarnation(curPlayer):
    #Èç¹ûÊÇÂú¼¶µÄ£¬Ôò¶àÓྭÑé×ªÒÆµ½´óʦ¾­Ñé
    isFullLV = curPlayer.GetLVEx() >= IpyGameDataPY.GetFuncCfg("PlayerMaxLV") # Íæ¼ÒÒÑÂú¼¶
    
    if not isFullLV:
        return
    
    curTotalExp = PlayerControl.GetPlayerTotalExp(curPlayer) # µ±Ç°¾­Ñé
    PlayerControl.SetPlayerTotalExp(curPlayer, 0)
    AddGreatMasterExp(curPlayer, curTotalExp)
    return
 
## µÇ¼´¦Àí
#  @param curPlayer
#  @return
def MasterOnLogin(curPlayer):
    if not IsGreatMasterOpen(curPlayer):
        return
    
    Sync_GreatMasterExp(curPlayer)
    Sync_GreatMasterFreeSkillPoint(curPlayer)
    return
 
## »ñÈ¡µ±Ç°´óʦ¾­Ñé(²»Ëã¾­ÑéµãµÄ)
def GetCurGreatMasterExp(curPlayer):
    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Master_Exp, 0, ChConfig.Def_PDictType_GreatMaster)
 
## ÉèÖõ±Ç°´óʦ¾­Ñé(²»Ëã¾­ÑéµãµÄ)
def SetCurGreatMasterExp(curPlayer, value):
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Master_Exp, value, ChConfig.Def_PDictType_GreatMaster)
    return
 
## »ñÈ¡µ±Ç°´óʦ¾­Ñéµã
def GetGreatMasterExpPoint(curPlayer):
    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Master_ExpPoint, 0, ChConfig.Def_PDictType_GreatMaster)
 
## ÉèÖõ±Ç°´óʦ¾­Ñéµã
def SetGreatMasterExpPoint(curPlayer, value):
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Master_ExpPoint, value, ChConfig.Def_PDictType_GreatMaster)
    return
 
## »ñÈ¡µ±Ç°´óʦ×ܾ­Ñé(°üº¬¾­Ñéµã)
def GetTotalGreatMasterExp(curPlayer):
    masterExp = GetCurGreatMasterExp(curPlayer)
    masterExpPoint = GetGreatMasterExpPoint(curPlayer)
    totalMasterExp = masterExpPoint * ChConfig.Def_PerPointValue + masterExp
    return totalMasterExp
 
## ÉèÖõ±Ç°´óʦ×ܾ­Ñé(°üº¬¾­Ñéµã)
def SetTotalGreatMasterExp(curPlayer, totalExp):
    curExp = totalExp % ChConfig.Def_PerPointValue
    expPoint = totalExp / ChConfig.Def_PerPointValue
    
    # ¸üдóʦ¾­Ñé¡¢¾­Ñéµã
    SetCurGreatMasterExp(curPlayer, curExp)
    SetGreatMasterExpPoint(curPlayer, expPoint)
    #GameWorld.DebugLog("SetTotalGreatMasterExp totalExp=%s,expPoint=%s,curExp=%s" 
    #                   % (totalExp, expPoint, curExp), curPlayer.GetPlayerID())
    Sync_GreatMasterExp(curPlayer)
    return
 
## »ñÈ¡µ±Ç°Ê£Óà´óʦ¼¼Äܵã
def GetGreatMasterFreeSkillPoint(curPlayer):
    return curPlayer.NomalDictGetProperty(ChConfig.Def_PDict_Master_FreeSkillPoint, 0, ChConfig.Def_PDictType_GreatMaster)
 
## ÉèÖõ±Ç°Ê£Óà´óʦ¼¼Äܵã
def SetGreatMasterFreeSkillPoint(curPlayer, value):
    PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_Master_FreeSkillPoint, value, ChConfig.Def_PDictType_GreatMaster)
    return
 
## ¸ù¾Ý´óʦµÈ¼¶»ñÈ¡Éý¼¶ËùÐè¾­Ñé
#  @param masterLV: ´óʦµÈ¼¶
#  @return: -1-ÒÑÂú¼¶; >=0Éý¼¶ËùÐè¾­Ñé
def GetTotalExpByGreatMasterLV(masterLV):
    masterExpTable = PyMapTable.GetPyMapTable("GreatMasterExp")
    
    maxMasterLV = masterExpTable.GetRecordCount() - 1
    
    if masterLV >= maxMasterLV:
        return -1
 
    expInfoList = masterExpTable.GetRecordByIndex(masterLV)
    totalExp = int(expInfoList["Exp"])
    
    return totalExp
 
## Ôö¼Ó´óʦµÈ¼¶¾­Ñé
#  @param curPlayer
#  @param addExp
#  @return ÊÇ·ñ³É¹¦
def AddGreatMasterExp(curPlayer, addExp):
    # È¡Ïû´óʦµÈ¼¶
    return
    if not IsGreatMasterOpen(curPlayer):
        return False
    
    #È¡µÃÈËÎﵱǰ¾­Ñé
    playerID = curPlayer.GetPlayerID()
    masterLV = curPlayer.GetLV2() # ´óʦµÈ¼¶, ´Ó0¼¶¿ªÊ¼
    
    masterExpTable = PyMapTable.GetPyMapTable("GreatMasterExp")
    
    maxMasterLV = masterExpTable.GetRecordCount() - 1
    
    #GameWorld.DebugLog("Ôö¼Ó´óʦµÈ¼¶¾­Ñé addExp=%s,masterLV=%s,maxMasterLV=%s" 
    #                   % (addExp, masterLV, maxMasterLV), playerID)
    
    if masterLV >= maxMasterLV:
        PlayerControl.NotifyCode(curPlayer, "GeRen_admin_825676")
        GameWorld.DebugLog("´óʦµÈ¼¶ÒÑÂú¼¶£¡", playerID)
        return False
    
    curTotalMasterExp = GetTotalGreatMasterExp(curPlayer) + addExp
    
    # ÏȼÓÔÙ´¦ÀíÉý¼¶
    SetTotalGreatMasterExp(curPlayer, curTotalMasterExp)
    
    expInfoList = masterExpTable.GetRecordByIndex(masterLV)
    needExp = int(expInfoList["Exp"])
    if needExp <= 0:
        GameWorld.ErrLog("´óʦÉý¼¶ËùÐè¾­ÑéÅäÖôíÎó£¡masterLV=%s,needExp=%s" % (masterLV, needExp), playerID)
        return True
    
    #GameWorld.DebugLog("    expInfoList=%s,needExp=%s,curTotalMasterExp=%s" 
    #                   % (str(expInfoList), needExp, curTotalMasterExp), playerID)
 
    isLVUP = False
    while curTotalMasterExp >= needExp:
        isLVUP = True
        masterLV += 1
        curPlayer.SetLV2(masterLV)
        curTotalMasterExp -= needExp
        #GameWorld.DebugLog("    ´óʦµÈ¼¶Éý¼¶needExp=%s,nextMasterLV=%s,curTotalMasterExp=%s" 
        #                   % (needExp, masterLV, curTotalMasterExp), playerID)
        
        # ¸ø´óʦÌ츳µã
        addSkillPoint = int(expInfoList["AddSkillPoint"])
        curFreeSkillPoint = GetGreatMasterFreeSkillPoint(curPlayer)
        SetGreatMasterFreeSkillPoint(curPlayer, curFreeSkillPoint + addSkillPoint)
        
        # Éý¼¶Á÷Ïò
        DataRecordPack.DR_PlayerMasterLVChange(curPlayer, curTotalMasterExp)
        
        # Ñ­»·Éý¼¶
        if masterLV >= maxMasterLV:
            GameWorld.DebugLog("    Ñ­»·Éý¼¶´óʦµÈ¼¶ÒÑÂú¼¶£¡", playerID)
            break
        
        expInfoList = masterExpTable.GetRecordByIndex(masterLV)
        needExp = int(expInfoList["Exp"])
        if needExp <= 0:
            GameWorld.DebugLog("    Ñ­»·Éý¼¶ÏÂÒ»¼¶¾­ÑéΪ0£¡masterLV=%s" % masterLV, playerID)
            break
        
    # Éý¼¶´¦Àí
    if isLVUP:
        #GameWorld.DebugLog("    ´óʦÉý¼¶´¦Àí£¡", playerID)
        PlayerBillboard.UpdatePlayerLVBillboard(curPlayer)
        
        #ÖØË¢ËùÓÐÊôÐÔ
        PlayerControl.PlayerControl(curPlayer).RefreshAllState()
        
        #½«ÑªÉèÖÃΪ×î´ó
        curPlayer.SetHP(curPlayer.GetMaxHP())
        curPlayer.SetMP(curPlayer.GetMaxMP())
        
        Sync_GreatMasterFreeSkillPoint(curPlayer)
        
        # ¸üÐÂÊ£Óà×ܾ­Ñé
        SetTotalGreatMasterExp(curPlayer, curTotalMasterExp)
    return True
 
## Í¬²½´óʦ¾­Ñé
#  @param curPlayer
#  @return 
def Sync_GreatMasterExp(curPlayer):
    masterExpPack = ChPyNetSendPack.tagMCGreatMasterExp()
    masterExpPack.Clear()
    masterExpPack.MasterExpPoint = GetGreatMasterExpPoint(curPlayer)
    masterExpPack.CurMasterEXP = GetCurGreatMasterExp(curPlayer)
    NetPackCommon.SendFakePack(curPlayer, masterExpPack)
    return
 
 
## Í¬²½´óʦʣÓàÌ츳µã
#  @param curPlayer
#  @return 
def Sync_GreatMasterFreeSkillPoint(curPlayer):
    #PlayerControl.NotifyPlayerDictValue(curPlayer, ChConfig.Def_PDict_Master_FreeSkillPoint)
    return
 
#// A5 48 ¶Ò»»´óʦµÈ¼¶¾­Ñé #tagCMExchangeMasterEXP
#
#struct    tagCMExchangeMasterEXP
#{
#    tagHead        Head;
#    BYTE        Multiples;        // 20ÒÚ¾­Ñé±¶Êý
#    DWORD        ExtraExp;    // ¶îÍ⸽¼Ó¾­Ñé(²»³¬¹ý20ÒÚ)
#};
## ¶Ò»»´óʦ¾­Ñé
#  @param index: Íæ¼ÒË÷Òý
#  @param clientData: ·â°ü½á¹¹Ìå
#  @param tick: Ê±¼ä´Á
#  @return: None
def OnExchangeMasterExp(index, clientData, tick):
    
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    
    if not IsGreatMasterOpen(curPlayer):
        GameWorld.ErrLog("´óʦ¹¦ÄÜ먦Æô£¡²»Äܶһ»´óʦµÈ¼¶¾­Ñ飡", curPlayer.GetPlayerID())
        return
    
    exchangeExp = clientData.Multiples * ChConfig.Def_PerPointValue + clientData.ExtraExp
    curTotalExp = PlayerControl.GetPlayerTotalExp(curPlayer) # µ±Ç°¾­Ñé
    
    actualExchangeExp = min(curTotalExp, exchangeExp)
    
    GameWorld.DebugLog("¶Ò»»´óʦµÈ¼¶¾­ÑéExchangeExp=%s" % actualExchangeExp, curPlayer.GetPlayerID())
    
    if actualExchangeExp <= 0:
        return
    
    updTotalExp = curTotalExp - actualExchangeExp
    PlayerControl.SetPlayerTotalExp(curPlayer, updTotalExp)
    AddGreatMasterExp(curPlayer, actualExchangeExp)
    return
 
 
#// A5 49 ´óʦÌ츳¼¼Äܼӵã #tagCMAddMasterSkillPoint
#
#struct    tagCMMasterSkillPoint
#{
#    tagHead        Head;
#    DWORD        SkillID;        // Ì츳¼¼ÄÜID
#    BYTE        AddPoint;        // ¼ÓµÄµãÊý
#};
#
#struct    tagCMAddMasterSkillPoint
#{
#    tagHead        Head;
#    BYTE        SkillCnt;        // ±ä¸ü¼¼ÄܸöÊý
#    tagCMMasterSkillPoint        AddSkillPointList[SkillCnt];    // ¼ÓµÄ¼¼ÄܵãÊýÁбí
#}; 
## ´óʦÌ츳¼¼Äܼӵã
#  @param index: Íæ¼ÒË÷Òý
#  @param clientData: ·â°ü½á¹¹Ìå
#  @param tick: Ê±¼ä´Á
#  @return: None
def OnAddMasterSkillPoint(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    
    needAddSkillPointList = clientData.AddSkillPointList
    
    if not needAddSkillPointList:
        return
    
    reqTotalPointSkillDict = ReadChConfig.GetEvalChConfig("ReqTotalPointSkill")
    greatMasterSkillDict = ReadChConfig.GetEvalChConfig("GreatMasterSkill")
    jobType = ChConfig.JOB_TYPE_DICT[curPlayer.GetJob()]
    
    if jobType not in greatMasterSkillDict:
        return
     
    jobMasterSkillDict = greatMasterSkillDict[jobType] # ±¾Ö°ÒµÌ츳ϵ¶ÔÓ¦¼¼ÄÜ
    reqTotalPointSkillList = reqTotalPointSkillDict.get(jobType, []) # ±¾Ö°ÒµÐèÇó×ÜÌ츳µã¼¼ÄÜ
    
    skillTypeSeriesDict = {} # ¼¼ÄܶÔÓ¦Ì츳ϵ
    skillTypeLVDict = {} # ¼¼ÄܶÔÓ¦µÈ¼¶
    seriesTotalPointDict = {} # Ì츳ϵ¶ÔÓ¦×ܼ¼Äܵã
    allSeriesTotalPoint = 0 # ËùÓÐÌ츳ϵ×ܵãÊý
    
    # »ã×ÜÌ츳¼¼ÄÜËùÊôÌ츳ϵ
    for seriesType, skillTypeIDList in jobMasterSkillDict.items():
        for sTypeID in skillTypeIDList:
            skillTypeSeriesDict[sTypeID] = seriesType
            
    skillManager = curPlayer.GetSkillManager()
    
    # »ñÈ¡Íæ¼ÒĿǰËùÓм¼ÄÜ
    for i in range(skillManager.GetSkillCount()):
        playerSkill = skillManager.GetSkillByIndex(i)
        if playerSkill == None:
            continue
        
        playerSkillTypeID = playerSkill.GetSkillTypeID()
        
        for seriesType, skillTypeIDList in jobMasterSkillDict.items():
            if playerSkillTypeID not in skillTypeIDList:
                continue
            
            skillLV = playerSkill.GetSkillLV()
            skillTypeLVDict[playerSkillTypeID] = skillLV
            seriesTotalPointDict[seriesType] = seriesTotalPointDict.get(seriesType, 0) + skillLV
            allSeriesTotalPoint += skillLV
            break
    
    isAddSkill = True
    isRefreshAttr = False
    buffType = IPY_GameWorld.btPassiveBuf
    addPointDict = {} # ÇëÇó¼Óµã¼¼ÄÜÒÑÖ´ÐмӵãÊý
    
    GameWorld.DebugLog("¡¾Ì츳¼Óµã¡¿jobType=%s,¼¼ÄܶÔÓ¦µÈ¼¶=%s,Ì츳ϵ¶ÔÓ¦×ܼ¼Äܵã=%s,×ܵãÊý=%s" 
                       % (jobType, skillTypeLVDict, seriesTotalPointDict, allSeriesTotalPoint))
    
    while isAddSkill:
        # Ã¿´ÎÑ­»·ÖØÖÃ״̬£¬Ö±µ½ÎÞ·¨ÔÙ¼Ó¼¼ÄܲÅÌø³ö
        isAddSkill = False
        
        for addSkill in needAddSkillPointList:
            skillTypeID = addSkill.SkillID
            totalAddPoint = addSkill.AddPoint
            
            freeSkillPoint = GetGreatMasterFreeSkillPoint(curPlayer)
            if freeSkillPoint <= 0:
                GameWorld.DebugLog("    µ±Ç°ÎÞÊ£ÓàÌ츳µã£¡")
                break
            
            if skillTypeID not in skillTypeSeriesDict:
                GameWorld.ErrLog("¼¼Äܲ»ÔںϷ¨Ì츳ϵÀskillTypeID=%s" % skillTypeID)
                continue
            
            curSeriesType = skillTypeSeriesDict[skillTypeID]
            
            addPoint = addPointDict.get(skillTypeID, 0) # ¸Ã¼¼ÄÜÒÑÖ´ÐмӵãÊý
            
            # ÒѾ­´ïµ½ÇëÇó¼ÓµÄµãÊý£¬²»ÔÙ´¦Àí
            if addPoint >= totalAddPoint:
                #GameWorld.DebugLog("    ÒѾ­¼Óµ½ÇëÇó¼ÓµÄµãÊý£¬²»ÔÙ´¦Àí!skillTypeID=%s,addPoint=%s" % (skillTypeID, addPoint))
                continue
            
            curSkill = skillManager.FindSkillBySkillTypeID(skillTypeID)
            
            # Î´Ñ§Ï°
            if not curSkill:
                learnSkillLV = 1
            # ÒÑѧϰ
            else:
                curSkillLV = curSkill.GetSkillLV()
                curSkillMaxLV = curSkill.GetSkillMaxLV()
                if curSkillLV >= curSkillMaxLV:
                    GameWorld.DebugLog("    ¼¼ÄÜÒÑÂú¼¶£¡skillTypeID=%s" % (skillTypeID))
                    continue
                
                learnSkillLV = curSkillLV + 1
                
            learnSkillData = GameWorld.GetGameData().FindSkillByType(skillTypeID, learnSkillLV)
            
            if not learnSkillData:
                GameWorld.ErrLog("ÕÒ²»µ½Ñ§Ï°¼¼ÄÜÊý¾Ý£ºskillTypeID=%s,skillLV=%s" % (skillTypeID, learnSkillLV))
                continue
 
            learnSkillID = learnSkillData.GetSkillID()
            skillLearnReq = learnSkillData.GetLearnSkillReq()
            skillLearnReqLV = learnSkillData.GetLearnSkillLV()
            skillLearnSeriesPointReq = learnSkillData.GetLearnSkillPointReq()
                
            # Ç°Öü¼ÄܵãÊýÐèÇó
            reqSkillLV = skillTypeLVDict.get(skillLearnReq, 0)
            if skillLearnReq > 0 and skillTypeLVDict.get(skillLearnReq, 0) < skillLearnReqLV:
                #GameWorld.DebugLog("    Ç°Öü¼ÄܼӵãδÂú×㣡learnSkillID=%s,[ǰÖü¼ÄÜ%s µ±Ç°%sµã Ðè%sµã]" 
                #                   % (learnSkillID, skillLearnReq, reqSkillLV, skillLearnReqLV))
                continue
            
            # Ì츳ϵµãÊýÐèÇó
            if skillLearnSeriesPointReq > 0:
                isReqAllPoint = skillTypeID in reqTotalPointSkillList # ÊÇ·ñÐèÇóËùÓÐϵ×ܵãÊý
                
                # ÒѼÓ×ÜÌ츳µãÊý²»×ã
                if isReqAllPoint and allSeriesTotalPoint < skillLearnSeriesPointReq:
                    #GameWorld.DebugLog("    ×ÜÌ츳µãÊý²»×ã!learnSkillID=%s,curPoint=%s,reqPoint=%s" 
                    #                   % (learnSkillID, allSeriesTotalPoint, skillLearnSeriesPointReq))
                    continue
                
                # ÒѼӱ¾ÏµÌ츳µãÊý²»×ã
                curSeriesTotalPoint = seriesTotalPointDict.get(curSeriesType, 0)
                if not isReqAllPoint and curSeriesTotalPoint < skillLearnSeriesPointReq:
                    #GameWorld.DebugLog("    ±¾ÏµÌ츳µãÊý²»×ã!learnSkillID=%s,curSeriesType=%s,curPoint=%s,reqPoint=%s" 
                    #                   % (learnSkillID, curSeriesType, curSeriesTotalPoint, skillLearnSeriesPointReq))
                    continue
                
            # ¿É¼Óµã, ÏÂÃæÖ´Ðиü¼Äܼӵã
            skillManager.LVUpSkillBySkillTypeID(skillTypeID)
            DataRecordPack.DR_LearnORUPSkill(curPlayer, skillTypeID, learnSkillLV)   
            
            # ÊDZ»¶¯¼¼ÄÜÒªÖØË¢ÊôÐÔ
            #if SkillCommon.isPassiveBuffSkill(learnSkillData):
            #    BuffSkill.AddBuffNoRefreshState(curPlayer, buffType, learnSkillData, tick, [], curPlayer)
            #    isRefreshAttr = True
                
            isAddSkill = True
            
            addPointDict[skillTypeID] = addPoint + 1
            skillTypeLVDict[skillTypeID] = learnSkillLV
            seriesTotalPointDict[curSeriesType] = seriesTotalPointDict.get(curSeriesType, 0) + 1
            allSeriesTotalPoint += 1
            SetGreatMasterFreeSkillPoint(curPlayer, freeSkillPoint - 1)
            # ³É¾Í
            #successKey = ChConfig.Def_PDict_Success_CntValue%(ShareDefine.SuccType_TalentPoint, 0)
            #curSuccess = PlayerSuccess.GetPDictValue(curPlayer, successKey)
            #if curSuccess < allSeriesTotalPoint:
            #    PlayerSuccess.DoAddSuccessProgress(curPlayer, ShareDefine.SuccType_TalentPoint, 1)
            
            #GameWorld.DebugLog("    ¼ÓÌ츳¼¼ÄÜ learnSkillID=%s,skillTypeID=%s,skillLV=%s,doCnt=%s,needCnt=%s" 
            #                   % (learnSkillID, skillTypeID, learnSkillLV, addPoint + 1, totalAddPoint))
        
        #GameWorld.DebugLog("    isAddSkill=%s" % isAddSkill)
                
    if isRefreshAttr:
        curControl = PlayerControl.PlayerControl(curPlayer)
        #curControl.CalcPassiveBuffAttr()
        curControl.RefreshPlayerAttrByBuff()
        
    PlayerControl.NotifyCode(curPlayer, "GeRen_liubo_224510")
    Sync_GreatMasterFreeSkillPoint(curPlayer)
    return
 
 
#// A5 50 ÖØÖôóʦÌ츳¼¼ÄÜ #tagCMResetMasterSkill
#
#struct    tagCMResetMasterSkill
#{
#    tagHead        Head;
#}; 
## ÖØÖôóʦÌ츳¼¼ÄÜ
#  @param index: Íæ¼ÒË÷Òý
#  @param clientData: ·â°ü½á¹¹Ìå
#  @param tick: Ê±¼ä´Á
#  @return: None
def OnResetMasterSkill(index, clientData, tick):
    curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
    ResetMasterSkillCost = ReadChConfig.GetEvalChConfig("ResetMasterSkillCost")
    
    moneyType = IPY_GameWorld.TYPE_Price_Gold_Money
    
    if not PlayerControl.HaveMoney(curPlayer, moneyType, ResetMasterSkillCost):
        return
    
    if not DoResetMasterSkillPoint(curPlayer):
        return
    
    # ¿Û³ýÏûºÄ
    PlayerControl.PayMoney(curPlayer, moneyType, ResetMasterSkillCost, ChConfig.Def_Cost_ResetGreatMasterSkill)
    return
 
## ÖØÖôóʦÌ츳¼¼ÄÜ
#  @param curPlayer
#  @return: ÊÇ·ñ³É¹¦
def DoResetMasterSkillPoint(curPlayer):
    greatMasterSkillDict = ReadChConfig.GetEvalChConfig("GreatMasterSkill")
    jobType = ChConfig.JOB_TYPE_DICT[curPlayer.GetJob()]
    
    if jobType not in greatMasterSkillDict:
        return False
     
    jobMasterSkillDict = greatMasterSkillDict[jobType] # ±¾Ö°ÒµÌ츳ϵ¶ÔÓ¦¼¼ÄÜ
    
    freeSkillPoint = GetGreatMasterFreeSkillPoint(curPlayer)
    resetPoint = 0
    
    skillManager = curPlayer.GetSkillManager()
    
    isRefreshAttr = False
    
    # »ã×ÜÌ츳¼¼ÄÜËùÊôÌ츳ϵ
    for skillTypeIDList in jobMasterSkillDict.values():
        
        for skillTypeID in skillTypeIDList:
            curSkill = skillManager.FindSkillBySkillTypeID(skillTypeID)
            
            if not curSkill:
                continue
            
            curSkillLV = curSkill.GetSkillLV()
            
            # ±»¶¯¼¼ÄÜË¢ÊôÐÔ
            if SkillCommon.isPassiveSkill(curSkill):
                isRefreshAttr = True
            
            resetPoint += curSkillLV
            
            skillManager.DeleteSkillBySkillTypeID(skillTypeID)
            
    if resetPoint <= 0:
        GameWorld.DebugLog("²»ÐèÒªÖØÖü¼ÄÜÌ츳£¡")
        return False
            
    SetGreatMasterFreeSkillPoint(curPlayer, freeSkillPoint + resetPoint)
    Sync_GreatMasterFreeSkillPoint(curPlayer)
    
    if isRefreshAttr:
        curControl = PlayerControl.PlayerControl(curPlayer)
        #curControl.CalcPassiveBuffAttr()
        curControl.RefreshPlayerAttrByBuff()
    return True