#!/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 = 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) 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 = PlayerActFamilyCTGAssist.GetFAActPlayerIDInfo(actionData) getAwardPlayerCountDict[str(needCTGPlayers)] = setGetCount PlayerActFamilyCTGAssist.SetFAActPlayerIDInfo(actionData, ctgPlayerIDList, getAwardPlayerCountDict) PlayerFamilyAction.SendFamilyActionInfo(None, familyID, ActionType) GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÁì½±ÈËÊý!actNum=%s,µµÎ»:%s,×ÜÈËÊý:%s" % (actNum, needCTGPlayers, setGetCount)) return