cehua-TT
2018-08-23 e2bbfb92b85beec9a3674a390a9d8347f508adc3
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
c»~[c@s-ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z e d„Zd„Zd„Zd„Zd„Zdd„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((s\.\\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((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytNormalNPCFree_Movets   
cCsbtj|ƒ}|jƒs)|jƒdS|jƒjƒdkrQ|j|ƒn |j|ƒdS(Ni(RR(tIsInRefreshAreatMoveBackR)R*R0tProcessBattleHPRestore(RRR3((s\.\\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((s\.\\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((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyt GetPatrolPosÍs   cCs+|jƒ}xt|jƒƒD]ú}|j|ƒ}|dkrFqn|jƒ}tj|tj    ƒ}|dks|j
ƒdkr‹qn|r¯|j ƒ|j ƒkr¯qn|j ƒtj krÊqn|jƒ}|dkrèqn|j ƒ|j ƒkrqntj|tjƒqW|jƒdS(Ni(R)trangeR*t    GetHurtAtRt
GetValueIDR R RRtGetHPRtGetPlayerActiont paPreparingRRtChangePlayerActiontpaNullR>(Rt    srcPlayertcurNPC_HurtListtit    hurtValuet    hurtObjIDRthurtObjActionObj((s\.\\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 skillIDListteffectIDRTt    curEffectt curEffectIDtjtskillIDt
curSkillID((s\.\\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|ƒr¹tj|ƒ}
|
dkrbtjd|jƒjƒtStj|tjƒ} | r¹tj|
ƒtjtj |
ƒ| j!dƒkr¶tSq¹ntj|ƒ} tj"|ƒ} | tj#ksõ| tj$krtj%|||ƒS| tj&krytj|ƒs7tjdƒtStj|ƒ}
|
dkrptjd|jƒjƒtS|
}n˜| tj'krt(j)|ƒs¨tjdƒtSt(j*t j |ƒ}|dkrát(j*t j+|ƒ}n|dkrtjd|j,ƒƒdS|}n||j-ƒkr'tStj.||||ƒS(Nis³èÎ%s£©ÕÒ²»µ½Ö÷ÈËs!¸ÃNPC·Ç³èÎÎÞ·¨»ñµÃÖ÷ÈËÊͷż¼ÄÜs$³èÎ%s£©¶ÔÖ÷ÈËÊͷż¼ÄÜ£¬ÕÒ²»µ½Ö÷ÈËs#¸ÃNPC·ÇÕÙ»½ÊÞ£¬ÎÞ·¨»ñµÃÖ÷ÈËÊͷż¼ÄÜs&ÕÙ»½ÊÞ£¨%s£©¶ÔÖ÷ÈËÊͷż¼ÄÜ£¬ÕÒ²»µ½Ö÷ÈË(/tGetSkillTypeIDR<t SkillCommontisPassiveSkilltGetLastUseTicktGetCoolDownTimet
SkillShelltGetSkillAffectTagRtDef_UseSkillTag_CanAttackPlayerR
RRt GetHappenRatetDef_MaxRateValueR t    CanHappenRltGetSkillManagertFindSkillBySkillTypeIDtSetSkillRemainTimet
PetControltIsPett GetPetOwnerRtErrLogt
GetRolePettPetIDtGetSkillEffectByEffectIDtDef_Skill_Effect_HPPerLimittGameObjRMtGetMaxHPR_tGetSkillFireAimtDef_ST_CanNPCUseSkilltDef_UseSkillAim_Nonet NPCUseSkilltDef_UseSkillTag_PetMastertDef_UseSkillTag_SummonMasterRt IsSummonNPCRR tGetNPCIDRtNPCUseSkillTag(RtcurTagtuseSkillttagDistRtcurSkillUseTagtratet changeSkillt skillTypeIDt curNPCSkilltpetOwnerteffecttskillTagtskillAimtcurSummonOwner((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyt DoNPCUseSkill)sp %       2
             c
Cs|jƒtjkrtStj|ƒ}|jƒ}xátd|jƒƒD]Ê}|j    |ƒ}|dksJ|j ƒdkrƒqJn|j ƒ}|dkr¡qJn|j ƒr³qJn|j ƒ}|jƒ}|tjkràqJntj||ƒ}    |    sþqJn|    jƒ|krJtSqJWtS(Ni(t GetFuncTypeRtDef_SkillFuncType_RealmSuppresstTrueRt
GetRealmLVR=RJt GetAngryCounttGetAngryValueTagRtGetObjIDt GetAngryValuet GetIsDisablet
GetObjTypeRRR R tGetOfficialRankR<(
RRdt
npcRealmLVt angryManagerRTtcurAngryt curAngryValuetangryIDt angryObjTypeRŽ((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytGetCanUseRealmSuppressSklls.      cCsT||jƒ|jƒkr2tj|ƒs2tSn|jƒ}tjdƒ}i}||krl||}nd}tjdƒ}||krž||d}n|jƒ}    |j    ƒ}
g} xGt
d|    j ƒƒD]0} |    j | ƒ} | s| j ƒdkrPn|r"|| jƒkr"qÒntj| ƒr7qÒntj| ƒtjkr‘tj| ƒ}tjj|ƒ}|s|qÒn|
|kr‘qÒq‘n|ikr»t||| |ƒs»qÒq»nt|| ƒsÐqÒn|jtj| j ƒƒ}| j|| | gƒqÒW| stS| jƒx3| D]+\}} } t||| ||ƒr!tSq!WtS(NtNPCLogic_AI186_TriggeritNPCLogic_AI_UseSkillOnDie( t GetAttackTicktGetAtkIntervalR{R|R<RŒt ReadChConfigtGetEvalChConfigRxR
RJt GetSkillCounttGetSkillByIndexRmt
GetSkillIDRnRoRrR…RtDef_UseSkillAim_ObjRstDef_Dict_UseSkillTag_ObjTypetgettCheckSkillTriggerR­t GetDictByKeytDef_NPC_Dict_SkillUseCntR`tsortR›Rž(RRŽRRtnpcIDt npcAITriggert triggerDicttuseSkillIDOnDietnpcUseSkillOnDieDictt skillManagert
tagObjTypet useSkillListtindexRR‘t hurtTypeListtuseCnt((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytDoAutoUseSkill»sX                
cCs•|j|ƒ}|dkr‘t|jƒttj|ƒƒdƒ}|d}|dkrj||krjtStj    ||d|d|ƒs‘tSnt
S(Nidiii( R¹RtintRMtfloatRƒR„R<Rt&CheckCanAttackTagLimitCountInSight_NPCRž(RRÀt npcSkillindexRt    skillInfot    hpPercenttcheckHP((s\.\\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(RŒR²R³RxtFindSkillBySkillIDRR tFindNPCByNPCIDRRRt GetGameWorldtGetTickRƒtSetHPR›( RR¾RÂRjttagNPCIDRÃRRRŽRtisOK((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytDoNPCUseSkillOnDies,   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_SkillWarnSkillIDRxRÑR tDebugLogR-R.t__ClearNPCSkillWarntDef_NPC_Dict_SkillWarnTimetmaxt GetActionTickR,t GetSkillTypetDef_SkillType_SummonRrtDoLogic_UseSkilltDef_NPC_Dict_SkillWarnPosXtDef_NPC_Dict_SkillWarnPosYtDef_NPC_Dict_AtkMovePosXtDef_NPC_Dict_AtkMovePosYRt    ChangePostSetDict(RRt warnSkillIDRtwarnTimetpassTickRGRH((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytDoNPCSkillWarningProcess=s:
 
cCs”|jtjƒ}|jtjdƒ|jtjdƒ|jtjdƒxBt|ƒD]4}|jtj|dƒ|jtj|dƒqXWdS(Ni(    R»RtDef_NPC_Dict_SkillWarnPosCntRèRÚRÝRZRãRä(RtposCntRT((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyRÜiscCs'|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||ƒdSdS(Niii(R»RtDef_NPC_Dict_MovePointIndexRRR RtlenRèRRRtOperControlManagertIsObjCanDoActiontDef_Obj_ActState_ServerActtoalMovetMove(Rt movePointListt
pointIndextdestPosXtdestPosYtcurPosXtcurPosYtcurDis((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytNPCMoveByPointListts*%
      (RRR RRR@RRñRnRrR{R²RƒRžR%R5R9R1RIRRXRlR›R­RÉRºRØRìRÜRý(((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pyt<module>s6            
I            $     $    $    g    +    M        $    ,