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
é(š[c@s/ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZd„Zd„Zd„Zd„Zdd„Zd„Zd„Zd    „Z d
„Z!d „Z"d „Z#d „Z$e%d„Z&d„Z'd„Z(d„Z)d„Z*d„Z+e,e,d„Z-d„Z.d„Z/d„Z0d„Z1d„Z2d„Z3d„Z4d„Z5dS(iÿÿÿÿNcCsdS(N((t    curPlayer((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytDoLogic_PetInfo_OnDay0scCstjd|jƒƒtS(Ns DoPetOpen...(t    GameWorldtDebugLogt GetPlayerIDtTrue(R((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyt    DoPetOpen7scCsdS(N((R((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytDoLVUPLogic_PetTscCstjd|ƒS(NtPetInfo(t IpyGameDataPYtGetIpyGameData(tpetNPCID((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyt GetPetIpydataXsc Csntjƒ}|j|ƒ}|s6tjd|ƒdSt|ƒ}|s]tjd|ƒdStjtjƒ}|sydS|j    t
ƒ|j t j |ƒ|j t jt jƒ|dkrÇ|jƒn|}|j t jtd|dƒƒ|j t j|jƒƒ|jƒ}|jƒ}    xIt|ƒD];\}
} |    |
} || krSq+n|jt j| ƒq+W|S(Ns0FindNPCDataByID can not find npcData petNPCID=%ss/tagPetInfo.txt can not find petData petNPCID=%siÿÿÿÿii(Rt GetGameDatatFindNPCDataByIDtErrLogR t
ItemCommontCreateSingleItemtChConfigtDef_ItemID_PetDatat    SetIsBindRt SetUserAttrt ShareDefinetDef_IudetPet_NPCIDtDef_IudetPet_StatetDef_PetState_Nullt GetInitRanktDef_IudetPet_ClassLVtmaxtDef_IudetPet_QualityLVt
GetQualityt
GetSkillIDtGetSkillUnLockt    enumeratet AddUserAttrtDef_IudetPet_Skill( RR tclasslvtgameDatat
petNpcDatat
petIpyDatat
newPetItemt    initClasst petSkillListtpetSkillUnLockListtitskillidtlimitPetClassLV((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytGetNewPetDataItem[s4      
 cCs#|s
dSt|ƒ}t||ƒS(N(tGetPetObjItemIndextGetPetDataItemByIndex(t curPetOwnertrolePett packItemIndex((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytGetPetDataItem€s cCsX|jƒjtjƒ}|j|ƒ}tj|ƒsTtjd||j    ƒƒdS|S(Ns$PetDataItem is none! PetItemIndex=%s(
tGetItemManagertGetPackRtrptPettGetAtRtCheckItemCanUseRRR(Rt petItemIndext petDataPackt petDataItem((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyR1‡s cCsv|jƒjtjƒ}xWt|jƒƒD]C}|j|ƒ}|jƒrRq+n||jtj    ƒkr+|Sq+WdS(N(
R6R7RR8trangetGetCountR9tIsEmptyt GetUserAttrR(RR R<t petDataIndextpetItem((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytGetPetDataItemByNPCID’s cCs |jƒjS(N(t
GetRolePett Friendliness(R3((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyR0scCs ||_dS(N(RF(t    petStructR;((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytSetPetObjItemIndexžscCsv|jƒjtjƒ}xWt|jƒƒD]C}|j|ƒ}|jƒrRq+n||jtj    ƒkr+|Sq+WdS(Niÿÿÿÿ(
R6R7RR8R>R?R9R@RAR(RR R<RBRC((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytGetPetDataItemIndexByNPCID¡s cCsŠtjƒj|ƒ}tjƒ}|jƒ}|jƒ}||jtj    ƒtj
tj    krcdS|j tj    |ƒt |||ƒdS(N( RtGetPlayerManagertGetPlayerByIndext IPY_GameWorldtIPY_CPetStateChangetGetPetIDtGetStatet GetTickByTypeRtTYPE_Player_Tick_ChangePetStatetTYPE_Player_Tick_Timet SetTickByTypetDoChangePetState(tindexttickRtpackR;tstate((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytPetStateChange¿s   c Cs²|dkrdS|tjkr#dSt||ƒ}|s<dS|jtjƒ}|jtjƒ}t|ƒ}|svdS|jƒ}||dkr§tj    d|ƒdS|jtj
ƒ}    tj    d||    |fƒ|    tj krg|j ƒj ƒ}
|
rctj|jƒ|jƒtjƒ} |
j| jƒ| jƒƒtjƒj|
ƒtjƒj|
ƒndS|tjkryn|tj kr˜t||ƒn|r®t|tƒndS(Niis&    ÁéÊÞÇл»Íâ¹Û,½×¼¶²»×ã%s,²»¿ÉÇл»£¡s4³èÎï״̬±ä¸ü!petItemIndex=%s,curState=%s,tagState=%s(RtDef_PetStateListR1RARRR tGetUseNeedRankRRRtDef_PetState_Fightt    GetPetMgrt GetFightPettGameMaptGetEmptyPlaceInAreatGetPosXtGetPosYRtDef_SummonAppearDisttResetPostPassiveBuffEffMngtGetPassiveEffManagertRegistPassiveEfftRegistPassiveBuffRt__DoPetGoOutToFighttRefreshPetItemAddAttrR( RR;ttagStatet    isRefreshRCt
curClasslvR tipyDatat needClasslvtcurStatetcurPett    resultPos((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyRTÑsD       $c Csÿ|jtjƒ}tjƒj|ƒ}|sBtjd|ƒdS|jƒ}|j|ƒ}|dkr~tj
d|ƒdS|j ƒ}|j }|j ƒ|_t|j ƒ|_d|_|jƒ}t||ƒ|j|ƒt|ƒ\}    }
tj||    ƒtj|ƒ} | jdtƒtj||jƒtƒ|jƒtj||ƒs{tj d|ƒ|j!|ƒdStj"|ƒt#j$|j%ƒ|j&ƒt'j(ƒ} tj)|| j%ƒ| j&ƒƒ|j*tj+tj,ƒt-j.|t'j/|dƒt0S(Ns.PetStateChange FindNPCDataByID, pet npcID = %ss-PetStateChange PetList_Add, Ìí¼Ó³èÎï = %sʧ°Üit canSyncClients"²»¿É³öÕ½£¡PetList_SetFree petID=%s(1RARRRR RtLogR]t PetList_AddtNoneRREtPetIDt    GetIsBindtBindTypetstrtNametPostGetItemPlaceIndexRHt
SetRolePettGetPetLearnSkillt
PetControltDoLogic_PlayerPetLearnSkillListt    NPCCommont
NPCControltRefreshNPCStatetFalsetSetPetHPtGetMaxHPtSync_SkillListtCheckPetCanFightRtPetList_SetFreetReCallFightPetR_R`RaRbRRct    SummonPetRRR\t PlayerControltNomalDictSetPropertytDef_PDict_FightPetIndexR( RRCtnpcIDR&tpetMgrR3RGtpetIDR;tlearnSkillListtpassiveSkillListt
petControlRr((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyRisD              
  $cCs7|jtjƒ}|sdSt||dtjƒdS(Ni(tNomalDictGetPropertyRRRTRR\(Rt fightPetIndex((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyt AutoSummonPetVs
c CsKi}g}tj}|jƒj|ƒ}xït|jƒƒD]Û}|j|ƒ}|jƒrdq=nx±t|jtj    ƒƒD]—}|j
tj    |ƒ}t j ƒj |ƒ}|s¹q}ntj|ƒrÛ|j|ƒq}n|jƒ}    |    |kr||    j|ƒq}|g||    <q}Wq=Wg|jƒD]}
t|
ƒ^q)} | |fS(N(RR8R6R7R>R?R9R@tGetUserAttrCountR#tGetUserAttrByIndexRR tGetSkillBySkillIDt SkillCommont isPassiveAttrtappendtGetSkillTypeIDtvaluesR( RtlearnSkillDictR”t petPackIndextpetPackR,RCtskillIDt curSkilDatat skillTypeIDtatlearnSkillIDList((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyR_s,        %cCsétj}|jƒj|ƒ}d}x¤t|jƒƒD]}|j|ƒ}|jƒr^q7nxft|jtj    ƒƒD]L}|j
tj    |ƒ}t j ƒj |ƒ}|s³qwn||jƒ7}qwWq7W|jtjtj|ƒdS(Ni(RR8R6R7R>R?R9R@R™R#RšRR R›t GetFightPowertSetDictRtDef_PlayerKey_MFPSkilltDef_MFPType_Pet(RR¢R£t allFightPowerR,RCR¤R¥((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytSetPetSkillFightPower{s     cCs>tjƒj|ƒ}|j}|j}t|||tƒdS(N(RRJRKtPetNPCIDt    IsUseGoldt DoActivatePetR(RUt
clientDataRVRR t    isUseGold((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyt OnActivatePet–s
        cCsž|s
dSt}tj}|jƒj|ƒ}x}t|jƒƒD]i}|j|ƒ}|jƒrnt    }qAn|j
tj ƒ}    |    |krAt j d||    |fƒdSqAW|sÈtj|dƒdSt|ƒ}
|
sÞdS|
jƒ} |
jƒ} |jƒjtjƒ} tj| | | ƒ\}}|sJt j d| | fƒdSt||ƒ}|scdStj|ƒj||ƒs‚dStj|tjtt |ƒƒƒtj!|| || ttj"ƒt#j$||ƒ|
j%ƒpâd}tj&d||j'ƒ|gƒ|j(ƒj)ƒ}|sXt*||ƒ}t j d||fƒt+||tj,ƒn+|rƒt-|ƒ\}}t.j/||ƒnt0|t    ƒt1|ƒt    S(Ns1ÒѾ­ÓµÓиóèÎ i=%s,petItemNPCID=%s,petNPCID=%stPet_liubo_76326s)DoActivatePet() item(%s[%s]) isn't enoughtGetPetisEûÓгèÎï³öÕ½£¬»ñµÃгèÎĬÈϳöÕ½¸Ã³èÎpetNPCID=%s,petItemIndex=%s(2R…RR8R6R7R>R?R9R@RRARRRRt
NotifyCodeR tGetUnLockNeedItemIDtGetUnLockNeedItemCntRLtrptItemRtGetItem_FromPack_ByIDR/t ItemControlertPlayerItemControlert    PutInItemtPlayerMagicWeapontSetMWPrivilegeDataRtMWPrivilege_PettlentGetActivePetIDt
ReduceItemt ItemDel_Pett
EventShelltEventRespons_OnActivatePett GetUnlockSyst WorldNotifytGetNameR]R^RIRTR\RR€RRjR®(RR R³t    isUseItemthasSpaceR¢R£R,tpackItemt petItemNPCIDRnt
needItemIDt needItemCnttitemPackt    hasEnoughtitemListR(tsysMarkR3R;R“R”((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyR±s`         " 
cCsëtjƒ}|jƒ}|dks0||krKtjd||fƒdS|j|dƒjƒ}|j|dƒjƒ}tj    }|j
ƒj |ƒ}xªt |j ƒƒD]–}    |j|    ƒ}
|
jƒrÕq®n|
jtjƒ} | |kr®|
jtjtd|dƒƒ|
jtj|ƒtjd|    | |fƒdSq®Wt|||ƒ} | sddStj    }tj|ƒj|| ƒsŒdStj|tjtt |ƒƒƒt!|ƒt"||ƒ} t#|| tj$ƒt%|t&ƒdS(Nis2¼¤»î³èÎﳬ¹ý³èÎï±íÊý¾ÝÊý: index=%s,petInfoCount=%sis1ÒѾ­ÓµÓиóèÎ i=%s,petItemNPCID=%s,petNPCID=%s('R    tIPY_DatatGetPetInfoCountRRtGetPetInfoByIndextGetIDRRR8R6R7R>R?R9R@RARRRRRRR/R¼R½R¾R¿RÀRRÁRÂRÃR®RIRTR\RjR(RRUR$t
ipyDataMgrt petInfoCountR tqualityR¢R£R,RÍRÎR(R;((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyt DoPetActivateÛs>             "
 cCs…g}tj}|jƒj|ƒ}xZt|jƒƒD]F}|j|ƒ}|jƒr^q7n|jtj    ƒ}|j
|ƒq7W|S(N( RR8R6R7R>R?R9R@RARRž(Rt    petIDListR¢R£R,RÍRÎ((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyRÃs     c1
CsÙtjƒj|ƒ}tj|tjƒs;tjdƒdS|jƒ}|j    }|j
}d}t ||ƒ}|sxdS|j tj ƒ}    tjƒj|    ƒ}
|
sºtjd|    ƒdS|j tjƒ} t|    ƒ} | sâdS| jƒ} | d| krtjd| |ƒdStjd|    | dƒ}|s9dS|jƒ}|sOdS|j tjƒ}|jƒjtjƒ}g}tjdƒ}d}x¤|D]œ}tj||||ƒ\}}}}|j|ƒ|rÝPn|r›d}xK|D]@}|j |ƒ}tj!|ƒsqðn|j"ƒ}||7}qðWq›q›W| rZ| rZtjd    ƒdS|d}|r€|j |dƒ}ntjƒj#|ƒ}|sŸdS|dkr¯dS|j$ƒ}|j%dƒ}|j&dƒ|} || }!| }"xnt'| | dƒD]Y}#tjd|    |#dƒ}|s*Pn|jƒ}$|!|$krFPn|!|$8}!|"d7}"qWt(d||ƒ}%|r™tj)||||%t*t+j,ƒn|"d| kr²d}!n|j-tj|!ƒ|"| kro|j-tj|"ƒt|    ƒ} | j.ƒ}&| j/ƒ}'| j0ƒ}(g})xÔt1|&ƒD]Æ\}*}+|'|*},|"|,krOq'n|"d|,kreq'n|j2tj3|+ƒtjƒj4|+ƒ}-t5j6|-ƒs¬|)j7|+ƒn|*t8|(ƒkrÈ|(|*nd
}.t9j:d|.||    |,|+gƒq'W|) r$|"d| kr$t9j:dd ||    gƒn|j;ƒj<ƒ}/|)rU|/rUt=j>|/|)ƒnt?|ƒt@|t*ƒntAjB|tjCd|    |"dgƒi|d 6|    d 6}0|0jDtE|jFƒƒƒtGjH|d|"|0ƒdS(Ns ³èÎ﹦ÄÜ먦Æôiscan not found pet npcID = %sis³èÎïÉý½× ÒÑÂú¼¶¡£¡£¡£classLV=%st PetClassCostit    PetUpItemsPetClassUp Éý½×µÀ¾ß²»×ã¡£¡£¡£tPetUpLvt
PetUpLvMaxR;R t
PetClassUp(IRRJRKt GameFuncCommt GetFuncCanUseRtGameFuncID_PetRRt PetItemIndext
UseItemCntR1RARR RRRR t
GetMaxRankR    R
t GetUpNeedExptDef_IudetPet_ExpR6R7RLRºtGetFuncEvalCfgRtGetItem_FromPack_ByID_ExExtextendR9R:R?tGetItemByTypeIDRÊtGetEffectByIndextGetEffectValuetxrangeRRÄRRRÅRRR tGetSkillUnLockSysR!R"R#R›RœRRžRÂRRÉR]R^R€RR®Rjt PlayerSuccesstDoAddSuccessProgresstSuccType_PetClassLVtupdatetevalt GetUserDatatDataRecordPacktDR_ClassUpSystem(1RUR²RVRtplayerIDRæt costItemCountt    isAutoBuyR=R R&tclassLVR't
maxClassLVRntneedExptcurPetClassExpt curItemPackt itemIndexListtcostItemIDListtnowCnttitemIDRÒt    indexListtfindItemIsBindtlackCntt    itemIndextcurItemtitemCntt autoBuyItemIDt
playerNametcurEfftaddExptupdExpt
updClassLVtlvt    upNeedExptdelCntR*R+t sysMarkListR“R,R-R.R¥RÔtfightPett extraInfoDict((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyRâsÜ              %    
 
 
"         
 "# 
#cCszt|ƒ|r5tj|ƒjdtjdtƒntj|ƒjdtƒ|jƒjƒ}|rvtj    |ƒndS(Nt billboardFunctisForce(
tCalcPetItemAddPlayerAttrRtRefreshPlayerAttrStatetPlayerBillboardtUpdatePyPetBillboardRR]R^R€tRefurbishPetAttr(RtisUpdBillboardR((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyRj¹s
%c    Cs¢t|ƒ\}}x‰|D]}tjƒj|ƒ}|s@qnxWt|jƒƒD]C}|j|ƒ}|jƒtj    krƒqSnt
j |||ƒqSWqWdS(N( RRR R›RñtGetEffectCountt    GetEffectt GetEffectIDRtDef_SkillEffs_Pett
SkillShelltCalcBuffEffAttr(    RR3tallAttrListPetR“R”R¤tcurSkillt effectIndext    curEffect((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytCalcSkill_PetBattleEffectÇs cCsktj|ƒ}x'|D]\}}tj|||ƒqWtj||tjƒtj    ||tj
ƒdS(N( R‚tGetNPCBuffRefreshListR%tCalcCurBuffer_EffecttCalcNoLineEffecttChangeNPCAttrInNoLineEffectListRtCalcAttr_BattleNolinetCalcLineEffecttChangeNPCAttrInLineEffectListtCalcAttr_Battle(R3R'tbuffRefreshListt    buffStatet    canPileup((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pytCalcBuffer_PetBattleEffectÛs cCs gtdƒD] }i^q }gtdƒD] }i^q,}gtdƒD] }i^qK}gtdƒD] }i^qj}t|ƒ\}}tjtj||ƒtjtj||ƒ|jtj    ƒ}t
j ||tj ƒt |ƒ\}    }
x|
D]ú} tjƒj| ƒ} | s"qûn| jƒtjkr›x[t| jƒƒD]G} | j| ƒ}|jƒ}|jdƒ}tj||||ƒqJWqûnxWt| jƒƒD]C} | j| ƒ}|jƒtjkrÞq®ntj|||ƒq®WqûWtj|tj|ƒtj|tj|ƒtj|tj|ƒtj|tj|ƒd}tj }|j!ƒj"|ƒ}xut|j#ƒƒD]a}|j$|ƒ}|j%ƒr¯qˆn|j&tj'ƒ}t(|ƒ}|sÙqˆn||j)ƒ7}qˆW|j*tj+tj,|ƒdS(Nii(-R>tGetPetAtkValueRtCalcAttrDict_TypeRtDef_Effect_PetMinAtktDef_Effect_PetMaxAtkR–RtDef_PDict_TotalSignNumtPlayerAttrFruittCalcAttrFruitAddAtrrtDef_AttrFruitFunc_PetRRR R›RŸtDef_SkillID_PetSignDayRñR!R"R#RðR$R%R&tSetCalcAttrListValuetDef_CalcAttrFunc_PettDef_CalcAttrFunc_PetSoultDef_CalcAttrFunc_PetSigntDef_CalcAttrFunc_PetSkillR8R6R7R?R9R@RARR tGetInitFightPowerRªtDef_PlayerKey_MFPExR¬(Rt_R'tallAttrListPetSigntallAttrListPetSoult skillAttrListt totalMinAtkt totalMaxAtkt totalSignNumR“R”R¤R(R)R*teffIDteffValuet    initFPAddR¢R£R,RCRÎR'((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyRìsX        c Csêtj|tjƒsdSd}tj}|jƒj|ƒ}x”t|jƒƒD]€}|j    |ƒ}|j
ƒrwqPn|j tj ƒ}|j tj ƒ}tjd||dƒ}||rÉ|jƒnd7}qPW|}    |}
|    |
fS(NiRÞi(ii(RãRäRRåR8R6R7R>R?R9R@RARRR    R
t    GetAtkAdd( Rt classAddAtkR¢R£R,RÍRÎR$t classIpyDataRLRM((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyR8(s       (6RR‚RRLRùRR%R¼RRóRãRRœR€RÆRR    R=R_R¿ReR.R1trandomtmathRRRR R/R5R1RDR0RHRIRYRRTRiR˜RR®R´R…R±RÜRÃRâRjR+R7RR8(((sZ.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\Player\PlayerPet.pyt<module>sf                                          %                               ?    F                    >    (        £                <