hwj35
2025-06-23 aa0f971ae9a59f0fd98d57b6c1d1663a270be92c
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
™Öoec@s<ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ed„Zd„Zd„Zd„Zd„Zddd„Zd    „Zd
„Zd „Zd „Zd „Zd„Zd„Zd„Zd„ZdS(iÿÿÿÿNc    CsÐ|jƒtjkrdStjtj|ƒ}|s8dStj|ƒsKdS|jƒ}| sk|j    ƒ rodS|j
ƒ}|tj kr¨t j |jƒtj ƒ}nW|tjkrÕt j |jƒtjƒ}n*t jd|jƒ|f|jƒƒdS|dkrdS|jƒsdStj||d|ƒd}|tjkrNdStj||d|ƒd}|tjkr}dS|rÌt j|jƒ|jƒ|jƒ|jƒƒ}||jƒkrÌdSn|S(Ns)###curNPC = %s ÎÞ·¨²éÕÒÖ÷È˹¥»÷¶ÔÏóÀàÐÍ%si(t GetCurActiont IPY_GameWorldt    laNPCMovet    NPCCommontGetSummonNPCOwnert    gotPlayert PlayerControltIsPlayerInFightt GetActionObjtIsAlivetGetGameObjTypetgotNPCt    GameWorldtGetObjtGetIDtLogtGetNamet GetPlayerIDtNonet GetCanAttackt
BaseAttacktGetTagRelationtChConfigtType_Relation_EnemytGetDisttGetPosXtGetPosYt
GetAtkDist(    tcurNPCtticktnoSpeedt    curPlayertmasterAttackObjt attackObjTypetattackObjDeteltrelationtatkDist((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytPlayerSummonAkObj,sD  &  cCsÂ|jƒtjkrdStj|ƒ}|jƒ}|jƒjƒdkrY|jƒne|tj    krˆ|j
tj ƒ|j dƒn6|tj kr¾|j |ƒt|ƒ|j|ƒndS(Ni(tGetTypeRt    ntMonsterRt
NPCControlRtGetPlayerHurtListt GetHurtCountt ResetNPC_Initt laNPCAttackt SetCurActiont    laNPCNullt SetActionTicktProcessHPRestoret__ReSetBattleStatetDoNormalNPCMove(RRt
npcControlt curNPCAction((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytNormalNPCFree_Moveus   
cCsbtj|ƒ}|jƒs)|jƒdS|jƒjƒdkrQ|j|ƒn |j|ƒdS(Ni(RR(tIsInRefreshAreatMoveBackR)R*R0tProcessBattleHPRestore(RRR3((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytNormalNPCFast_Move”s 
 cCs@|jƒsdS|jƒr<|jtƒ|jƒjƒndS(N(tGetIsNeedProcesstSetIsNeedProcesstFalset GetNPCAngrytClear(R((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyR1ªs    cCsƒ|jƒ}|dkrXtjd|dƒ}|j|ƒ}|jƒ}|jƒ}n!tj|ƒ}|jƒ\}}||fS(Nii(    tGetPatrolPosCounttrandomtrandinttGetPatrolPosAtRRRR(tGetRandPosInRefreshArea(Rt patrolCountt patrolIndext    patrolPostposXtposYR3((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyt GetPatrolPosÎs   tc    CsS|jƒ}x6t|jƒƒD]"}|j|ƒ}|dkrFqn|jƒ}tj|tj    ƒ}|dkst
j |ƒdkrŽqn|r²|j ƒ|j ƒkr²qn|j ƒtjkrÍqn|jƒ}|dkrëqn|j ƒ|j ƒkr    qntj|tjƒ|rtj|||jƒgƒqqW|jƒdS(Ni(R)trangeR*t    GetHurtAtRt
GetValueIDR R RRtGameObjtGetHPRtGetPlayerActiont paPreparingRRtChangePlayerActiontpaNullt
NotifyCodetGetNPCIDR>(    Rt    srcPlayert    notifyKeytcurNPC_HurtListtit    hurtValuet    hurtObjIDRthurtObjActionObj((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytClearPlayerPreparingâs,   !  #c    CsÙg}tj}x›td|jƒƒD]„}|j|ƒ}|jƒ}|sRq%n||krdq%nxBt|jƒƒD].}|j|ƒ}|s˜qwn|j|ƒqwWq%W|s·dSt    j
|ƒ}t j ƒj |ƒS(Ni(RtDef_Skill_Effect_RandSkilltxrangetGetEffectCountt    GetEffectt GetEffectIDtGetEffectValueCounttGetEffectValuetappendR@tchoiceR t GetGameDatatGetSkillBySkillID(    tcurSkillt skillIDListteffectIDRYt    curEffectt curEffectIDtjtskillIDt
curSkillID((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytGetPassiveRandomSkills$      cCsž| s|jƒdkrtStj|ƒr0tS||jƒ|jƒkrPtStj|ƒ}|tj    krŠ|j
ƒt j krŠtSn|j ƒ}|tjkr¿tj|tjƒ r¿tSt|ƒ}|r|jƒ}|jƒj|ƒ}    |    rtj|    d||ƒn|}ntj|ƒ}
tj|ƒ} |
tjksV| tjkritj|||ƒS|
tjkrÚtj|ƒs˜tjdƒtStj|ƒ} | dkrÑtjd|jƒj ƒtS| }n˜|
tj!krrt"j#|ƒs    tjdƒtSt"j$t j |ƒ} | dkrBt"j$t j%|ƒ} n| dkritjd|j&ƒƒdS| }n||j'ƒkrˆtStj(||||ƒS(Nis!¸ÃNPC·Ç³èÎÎÞ·¨»ñµÃÖ÷ÈËÊͷż¼ÄÜs$³èÎ%s£©¶ÔÖ÷ÈËÊͷż¼ÄÜ£¬ÕÒ²»µ½Ö÷ÈËs#¸ÃNPC·ÇÕÙ»½ÊÞ£¬ÎÞ·¨»ñµÃÖ÷ÈËÊͷż¼ÄÜs&ÕÙ»½ÊÞ£¨%s£©¶ÔÖ÷ÈËÊͷż¼ÄÜ£¬ÕÒ²»µ½Ö÷ÈË()tGetSkillTypeIDR<t SkillCommontisPassiveSkilltGetLastUseTicktGetCoolDownTimet
SkillShelltGetSkillAffectTagRtDef_UseSkillTag_CanAttackPlayerR
RRt GetHappenRatetDef_MaxRateValueR t    CanHappenRqtGetSkillManagertFindSkillBySkillTypeIDtSetSkillRemainTimetGetSkillFireAimtDef_ST_CanNPCUseSkilltDef_UseSkillAim_Nonet NPCUseSkilltDef_UseSkillTag_PetMastert
PetControltIsPettErrLogt GetPetOwnerRt
GetRolePettPetIDtDef_UseSkillTag_SummonMasterRt IsSummonNPCRR RURtNPCUseSkillTag(RtcurTagtuseSkillttagDistRtcurSkillUseTagtratet changeSkillt skillTypeIDt curNPCSkilltskillTagtskillAimtpetOwnertcurSummonOwner((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyt DoNPCUseSkill,s^ %                   c
Cs|jƒtjkrtStj|ƒ}|jƒ}xätd|jƒƒD]Í}|j    |ƒ}|dksJ|j ƒdkrƒqJnt j |ƒ}|dkr¤qJn|jƒr¶qJn|j ƒ}|jƒ}|tjkrãqJntj||ƒ}    |    sqJn|    jƒ|krJtSqJWtS(Ni(t GetFuncTypeRtDef_SkillFuncType_RealmSuppresstTrueRt
GetRealmLVR=RKt GetAngryCounttGetAngryValueTagRtGetObjIDRNt GetAngryValuet GetIsDisablet
GetObjTypeRRR R tGetOfficialRankR<(
RRit
npcRealmLVt angryManagerRYtcurAngryt curAngryValuetangryIDt angryObjTypeRŽ((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytGetCanUseRealmSuppressSkll–s.     cCsÎ||jƒ|jƒkr2tj|ƒs2tSn|jƒ}tjdƒ}i}||krl||}nd}tjdƒ}||krž||d}ni}    tjdƒ}
||
krÌ|
|}    n|jƒ} |j    ƒ} g} x“t
d| j ƒƒD]|}| j |ƒ}| s.|j ƒdkr2Pn|rP||jƒkrPqn|j ƒ}||    krŠ|    |}tj|ƒrŠqqŠntj|ƒrŸqntj|ƒtjkr tj|ƒ}|tjkr tjj|ƒ}|sóqn| |krqqq n|ikr5t||||ƒs5qq5nt||ƒsJqn|jtj|j ƒƒ}| j|||gƒqW| sŠtS| j ƒx3| D]+\}}}t!|||||ƒr›t"Sq›WtS(NtNPCLogic_AI186_TriggeritNPCLogic_AI_UseSkillOnDiet!NPCLogic_AI_UseSkillAfterOtherDie(#t GetAttackTicktGetAtkIntervalR…R†R<RUt ReadChConfigtGetEvalChConfigR}R
RKt GetSkillCounttGetSkillByIndexRrt
GetSkillIDR tFindNPCByNPCIDRsRtRwR€RtDef_UseSkillAim_ObjRxtDef_UseSkillTag_AppointNPCtDef_Dict_UseSkillTag_ObjTypetgettCheckSkillTriggerR¬t GetDictByKeytDef_NPC_Dict_SkillUseCntRetsortRšR(RRŽRRtnpcIDt npcAITriggert triggerDicttuseSkillIDOnDietnpcUseSkillOnDieDicttuseSkillAfterOtherDieDicttuseSkillAfterOtherDieNPCDictt skillManagert
tagObjTypet useSkillListtindexRR”tcheckIsDeadNPCIDR‘t hurtTypeListtuseCnt((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytDoAutoUseSkillÁsl          
           
cCs˜|j|ƒ}|dkr”ttj|ƒttj|ƒƒdƒ}|d}|dkrm||krmtStj    ||d|d|ƒs”tSnt
S(Nidiii( R»RtintRNROtfloattGetMaxHPR<Rt&CheckCanAttackTagLimitCountInSight_NPCR(RRÂt npcSkillindexRt    skillInfot    hpPercenttcheckHP((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyR¼s ,
 c Cs|jƒ}tjdƒ}||kr+dS||\}}|jƒ}|j|ƒ}|s`dSd}d}|rŽtj|ƒ}|sÇdSn9|rÇtj|j    ƒ|j
ƒ|j    ƒ|j
ƒƒ}ntj ƒj ƒ}    t j|dƒt|||||    ƒ}
t j|dƒdS(NR®ii(RUR²R³R}tFindSkillBySkillIDRR R·RRRt GetGameWorldtGetTickRNtSetHPRš( RRÀRÄRottagNPCIDRÇRRRŽRtisOK((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytDoNPCUseSkillOnDie.s,   3cCsä|jƒtjkrdS|jtjƒ}|jƒj|ƒ}|sutj    d|ƒ|j
tj ƒt |ƒdS|jtj ƒ}td||jƒƒ}||kr°dS|j
tjƒ|jƒtjkrîtj||||ƒnè|jtjdƒ}|jtjdƒ}||dkrQ|jtjƒ}|jtjƒ}ntj|d||||ƒ|jtjƒdkrÖ|j|jtjƒ|jtjƒƒ|jtjdƒ|jtjdƒnt |ƒdS(sUÔ¤¾¯¼¼ÄÜÕ½¶·´¦Àí
    @return: 0-·ÇÔ¤¾¯×´Ì¬£»1-Ô¤¾¯´¦Àí½áÊø£¬³É¹¦Ö´ÐУ»2-Ô¤¾¯ÖУ»
    is5    Ô¤¾¯×´Ì¬ÏÂÔ¤¾¯¼¼Äܲ»´æÔÚ, ÖØÖÃ״̬!warnSkillID=%siiN(RRtlaNPCSkillWarningR½RtDef_NPC_Dict_SkillWarnSkillIDR}R×R tDebugLogR-R.t__ClearNPCSkillWarntDef_NPC_Dict_SkillWarnTimetmaxt GetActionTickR,t GetSkillTypetDef_SkillType_SummonRwtDoLogic_UseSkilltDef_NPC_Dict_SkillWarnPosXtDef_NPC_Dict_SkillWarnPosYtDef_NPC_Dict_AtkMovePosXtDef_NPC_Dict_AtkMovePosYRt    ChangePostSetDict(RRt warnSkillIDRtwarnTimetpassTickRGRH((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytDoNPCSkillWarningProcessRs:
 
cCs”|jtjƒ}|jtjdƒ|jtjdƒ|jtjdƒxBt|ƒD]4}|jtj|dƒ|jtj|dƒqXWdS(Ni(    R½RtDef_NPC_Dict_SkillWarnPosCntRíRßRâR_RèRé(RtposCntRY((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyRá~sc    CsP|s
dS|jtjƒ}||\}}|jƒ|jƒ}}tj||||ƒ}xk|dkrÊ|t|ƒdkrÊ|d7}|jtj|ƒ||\}}tj||||ƒ}q`W|dkr#|j    ƒt
j krðdSt j |tjt
jƒsdS|j||ƒdS|t|ƒdkrLtj||ƒndS(Niii(R½RtDef_NPC_Dict_MovePointIndexRRR RtlenRíRRRtOperControlManagertIsObjCanDoActiontDef_Obj_ActState_ServerActtoalMovetMovetFBLogictOnTDNPCReachTheGoal(    Rt movePointListRt
pointIndextdestPosXtdestPosYtcurPosXtcurPosYtcurDis((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytNPCMoveByPointList‰s.%
      (RRR RRR@RRöRsRwR…R²RNRûRR%R5R9R1RIRR]RqRšR¬RÎR¼RÝRñRáR(((skE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyt<module>s8             
I            $    &    $    j    +    [        $    ,