| #!/usr/bin/python | 
| # -*- coding: GBK -*- | 
| #------------------------------------------------------------------------------- | 
| # | 
| ##@package GM.Commands.FamilyZhenfa | 
| # | 
| # @todo:ÏÉÃËÕó·¨ | 
| # @author hxp | 
| # @date 2023-10-11 | 
| # @version 1.0 | 
| # | 
| # ÏêϸÃèÊö: ÏÉÃËÕó·¨ | 
| # | 
| #------------------------------------------------------------------------------- | 
| #"""Version = 2023-10-11 16:30""" | 
| #------------------------------------------------------------------------------- | 
|   | 
| import GameWorld | 
| import ShareDefine | 
| import PlayerFamilyZhenfa | 
| import IpyGameDataPY | 
|   | 
| ## Ö´ÐÐÂß¼ | 
| #  @param curPlayer µ±Ç°Íæ¼Ò | 
| #  @param cmdList ²ÎÊýÁбí | 
| #  @return None | 
| #  @remarks º¯ÊýÏêϸ˵Ã÷. | 
| def OnExec(curPlayer, cmdList): | 
|     if not cmdList: | 
|         GameWorld.DebugAnswer(curPlayer, "ÖØÖÃÕó·¨: FamilyZhenfa 0") | 
|         GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÕó·¨: FamilyZhenfa ÀàÐÍ µÈ¼¶ ¾Ñé ¿ÉÑ¡ÏÉÃËID") | 
|         return | 
|      | 
|     playerID = curPlayer.GetPlayerID() | 
|     familyID = curPlayer.GetFamilyID() | 
|     if not familyID: | 
|         GameWorld.DebugAnswer(curPlayer, "ûÓÐÏÉÃË") | 
|         return | 
|      | 
|     value1 = cmdList[0] | 
|     if len(cmdList) == 1 and value1 == 0: | 
|         GameWorld.GetFamilyActionManager().DelFamilyAction(familyID, ShareDefine.Def_ActionType_FamilyZhenfa) | 
|         PlayerFamilyZhenfa.SyncMap_AllFamilyZhenfaInfo() | 
|         return | 
|      | 
|     if len(cmdList) == 3: | 
|         zhenfaType = value1 | 
|         zhenfaLV = cmdList[1] if len(cmdList) > 1 else 0 | 
|         zhenfaExp = cmdList[2] if len(cmdList) > 2 else 0 | 
|         ipyData = IpyGameDataPY.GetIpyGameData("FamilyZhenfa", zhenfaType, zhenfaLV) | 
|         if not ipyData: | 
|             GameWorld.DebugAnswer(curPlayer, "²»´æÔÚ¸ÃÕó·¨ÀàÐÍ: %s, LV:%s" % (zhenfaType, zhenfaLV)) | 
|             return | 
|         actionData = PlayerFamilyZhenfa.GetFamilyZhenfaData(familyID, zhenfaType) | 
|         PlayerFamilyZhenfa.SetZhenfaLV(actionData, zhenfaLV) | 
|         PlayerFamilyZhenfa.SetZhenfaExp(actionData, zhenfaExp) | 
|         PlayerFamilyZhenfa.SyncMap_FamilyZhenfaInfo(familyID, "GM", {"playerID":playerID, "refreshAttr":True}) | 
|         GameWorld.DebugAnswer(curPlayer, "ÉèÖÃÕó·¨ÀàÐÍ: %s, LV:%s, Exp:%s" % (zhenfaType, zhenfaLV, zhenfaExp)) | 
|          | 
|     return |