cehua_ZWJ
2019-01-30 6afaa4408f4e09e3e95dbd92f0d1cd5a1fb2942b
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
f«\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|ƒ}
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    CanHappenRltGetSkillManagertFindSkillBySkillTypeIDtSetSkillRemainTimetGetSkillFireAimtDef_ST_CanNPCUseSkilltDef_UseSkillAim_Nonet NPCUseSkilltDef_UseSkillTag_PetMastert
PetControltIsPettErrLogt GetPetOwnerRt
GetRolePettPetIDtDef_UseSkillTag_SummonMasterRt IsSummonNPCRR tGetNPCIDRtNPCUseSkillTag(RtcurTagtuseSkillttagDistRtcurSkillUseTagtratet changeSkillt skillTypeIDt curNPCSkilltskillTagtskillAimtpetOwnertcurSummonOwner((s\.\\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ƒ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.      cCs†||jƒ|jƒkr2tj|ƒs2tSn|jƒ}tjdƒ}i}||krl||}nd}tjdƒ}||krž||d}n|jƒ}    |j    ƒ}
g} xYt
d|    j ƒƒD]B} |    j | ƒ} | s| j ƒdkrPn|r"|| jƒkr"qÒntj| ƒr7qÒntj| ƒtjkr£tj| ƒ}|tjkr£tjj|ƒ}|s‹qÒn|
|kr qÒq q£n|ikrÍt||| |ƒsÍqÒqÍnt|| ƒsâqÒn|jtj| j ƒƒ}| j|| | gƒqÒW| s"tS| jƒtj dt!| ƒ|j"ƒƒx3| D]+\}} } t#||| ||ƒrSt$SqSWtS(NtNPCLogic_AI186_TriggeritNPCLogic_AI_UseSkillOnDies¼¼ÄÜʹÓÃ˳Ðò = useSkillList%s(%t GetAttackTicktGetAtkIntervalR€RR<Rˆt ReadChConfigtGetEvalChConfigRxR
RJt GetSkillCounttGetSkillByIndexRmt
GetSkillIDRnRoRrR{RtDef_UseSkillAim_ObjRstDef_UseSkillTag_AppointNPCtDef_Dict_UseSkillTag_ObjTypetgettCheckSkillTriggerR¨t GetDictByKeytDef_NPC_Dict_SkillUseCntR`tsortR tDebugLogtstrRR–R™(RRŠRŒRtnpcIDt npcAITriggert triggerDicttuseSkillIDOnDietnpcUseSkillOnDieDictt skillManagert
tagObjTypet useSkillListtindexR‹Rt hurtTypeListtuseCnt((s\.\\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AICommon.pytDoAutoUseSkill¾s\             
 cCs˜|j|ƒ}|dkr”ttj|ƒttj|ƒƒdƒ}|d}|dkrm||krmtStj    ||d|d|ƒs”tSnt
S(Nidiii( RµRtinttGameObjRMtfloattGetMaxHPR<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 RºR-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.pytDoNPCSkillWarningProcessBs:
 
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ÛnscCs'|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.pytNPCMoveByPointListys*%
      (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            $     $    $    j    +    N        $    ,