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
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package GM.Commands.FamilyCTGAssiat
#
# @todo:ÏÉÃ˳äÖµ»¥Öú
# @author hxp
# @date 2024-06-21
# @version 1.0
#
# ÏêϸÃèÊö: ÏÉÃ˳äÖµ»¥Öú
#
#-------------------------------------------------------------------------------
#"""Version = 2024-06-21 19:30"""
#-------------------------------------------------------------------------------
 
import GameWorld
import PlayerActFamilyCTGAssist
import PlayerFamilyAction
 
# µ¼Èë
#------------------------------------------------------------------------------ 
 
## Ö´ÐÐÂß¼­
#  @param curPlayer µ±Ç°Íæ¼Ò
#  @param cmdList ²ÎÊýÁбí
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def OnExec(curPlayer, cmdList):
    if not cmdList:
        GameWorld.DebugAnswer(curPlayer, "ÖØÖóäÖµ»¥Öú: FamilyCTGAssiat 0 actNum")
        GameWorld.DebugAnswer(curPlayer, "Ôö¼Ó³äÖµ»¥Öú: FamilyCTGAssiat 1 actNum ÈËÊý")
        #GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÁì½±ÈËÊý: FamilyCTGAssiat 2 actNum µµÎ» ÈËÊý")
        return
    
    familyID = curPlayer.GetFamilyID()
    if not familyID:
        GameWorld.DebugAnswer(curPlayer, "ûÓÐÏÉÃË")
        return
    
    value1 = cmdList[0]
    actNum = cmdList[1] if len(cmdList) > 1 else 0
    if not actNum:
        GameWorld.DebugAnswer(curPlayer, "ûÓÐÖ¸¶¨actNum")
        return
    
    ActionType = PlayerActFamilyCTGAssist.ActionType
    actionData = PlayerActFamilyCTGAssist.GetFamilyCTGAssistActionData(familyID, actNum)
    
    if value1 == 0:
        PlayerActFamilyCTGAssist.ClearFAActPlayerIDInfo(actionData)
        PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType)
        GameWorld.DebugAnswer(curPlayer, "ÖØÖóäÖµ»¥ÖúOK!actNum=%s" % actNum)
        return
    
    if value1 == 1:
        addCTGPlayers = cmdList[2] if len(cmdList) > 2 else 0
        ctgPlayerIDList, getAwardPlayerCountDict, getAwardPlayerIDDict = PlayerActFamilyCTGAssist.GetFAActPlayerIDInfo(actionData)
        
        maxRotID = 0
        for pID in ctgPlayerIDList:
            if pID < 10000 and pID > maxRotID:
                maxRotID = pID
                
        for _ in range(addCTGPlayers):
            maxRotID += 1
            ctgPlayerIDList.append(maxRotID)
            
        PlayerActFamilyCTGAssist.SetFAActPlayerIDInfo(actionData, ctgPlayerIDList, getAwardPlayerCountDict, getAwardPlayerIDDict)
        PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType)
        GameWorld.DebugAnswer(curPlayer, "Ôö¼Ó»¥ÖúÈËÊý!actNum=%s,Ôö¼Ó:%s,×ÜÈËÊý:%s" % (actNum, addCTGPlayers, len(ctgPlayerIDList)))
        return
    
    #if value1 == 2:
    #    needCTGPlayers = cmdList[2] if len(cmdList) > 2 else 0
    #    setGetCount = cmdList[3] if len(cmdList) > 3 else 0
    #    ctgPlayerIDList, getAwardPlayerCountDict, getAwardPlayerIDDict = PlayerActFamilyCTGAssist.GetFAActPlayerIDInfo(actionData)
    #    getAwardPlayerCountDict[str(needCTGPlayers)] = setGetCount
    #    PlayerActFamilyCTGAssist.SetFAActPlayerIDInfo(actionData, ctgPlayerIDList, getAwardPlayerCountDict, getAwardPlayerIDDict)
    #    
    #    PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType)
    #    GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÁì½±ÈËÊý!actNum=%s,µµÎ»:%s,×ÜÈËÊý:%s" % (actNum, needCTGPlayers, setGetCount))
        
    return