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
¢M¦ec@sÂddlZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
ddl Z ddl Z ddl Z ddlZddlZddlZddlZejddƒejddƒd„Zd„Zd„Zd„Zd    „Zd
„Zd „Zd „Zd „Zd„Zd„Zd„Zd„Zd„Z d„Z!d„Z"d„Z#d„Z$d„Z%d„Z&d„Z'd„Z(dS(iÿÿÿÿNs Script\NPC\tNPCAItcCsMtjƒd}tj|dƒtjƒd}tj|dƒtt_dS(NsScript\NPC\NPCAIRs
Script\NPCR(tChConfigt
GetAppPatht    GameWorldt ReloadScripttOnNPCDiet    NPCCommon(ttickt
scriptPath((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyt    ReloadNPC;s     cCsKtjtd|jƒdfƒ}|dkr>tjtjfS|||ƒS(Ns AIType_%d.%stOnGetOwnerRelation(Rt GetExecFuncRt    GetAITypetNoneRtType_Relation_FriendtDef_PASysMessage_None(tcurNPCtownertcallFunc((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR Gs" cCs?tjtd|jƒdfƒ}|dkr2dS|||ƒS(Ns AIType_%d.%stGetNPCAttackTagLimit(RR RR R(RttagObjR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyROs" cCs¢tjtj|ƒ}|r\|jd|jƒƒtj|ddt    j
t j ƒj ƒƒnt jtd|jƒdfƒ}|dkrŽdS||||ƒdS(Nt    summondies AIType_%d.%stOnDie(RtGetSummonNPCOwnert IPY_GameWorldt    gotPlayertSetDicttGetNPCIDtPassiveBuffEffMngtOnPassiveSkillTriggerRRtTriggerType_SummonDieRt GetGameWorldtGetTickR RR (RtHurtTypetHurtIDRR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR[s" cCs@tjtd|jƒdfƒ}|dkr2dS||ƒdS(Ns AIType_%d.%st OnNPCSetDead(RR RR R(RR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR$ks
" 
cCsMtj|ƒtjtd|jƒdfƒ}|dkr?dS||ƒdS(Ns AIType_%d.%st OnNPCReborn(tFBLogictOnNPCRebornInFBRR RR R(RR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR%rs  " 
cCsotj||||ƒtjtd|jƒdfƒ}|dkrHdS|||||ƒtj||ƒdS(Ns AIType_%d.%st
OnAttacked(    Rt OnNPCAttackedRR RR RtPlayerActivitytOnAttackNPCActivity(tatkObjRtskillRR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR)€s" cCsEtjtd|jƒdfƒ}|dkr2tS|||||ƒS(Ns AIType_%d.%st OnCheckCanDie(RR RR RtTrue(R,RR-RR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR.‹s" cCstjtƒ|ƒdS(N(Rt GetPsycoFunct__Func_InitNPC(R((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pytInitNPC–sc
Csštt_tjƒjƒ}tjd|ƒtjƒjƒ}g}tj    ddiƒ}||kr±t
d||dƒ}||kr±tj    ddƒ}tjd|ƒq±ntj ƒ}|j ƒ}x½t |ƒD]¯}|j|ƒ}    |    jƒ|kr|    jtƒqÖntj|    ƒ|    jƒdkrÖ|    jƒdkrÖtjd|    jƒ|    jƒ|    jƒ|    jƒfƒtd    ƒ‚qÖqÖWtjd
ƒdS( NsNPC Initing...FB %dtMapLineiiiis    hideNPCIDList=%ss@###NPC²ß»®Ìî±í´íÎó£¬NPC = %s , %s , Ë¢Ðµã = %sºÍÖØÉúµã = %s´íÎós ###NPC ²ß»®Ìî´í±íÀ­ s NPC Init OK!(RRRR tGetCurGameWorldIndextLogtGetMaptGetMapIDt IpyGameDataPYtGetFuncEvalCfgtmaxt GetNPCManagert GetNPCCounttxranget GetNPCByIndexRt
SetVisibletFalseR2tGetRefreshPosCounttGetPatrolPosCounttGetNamet    Exception(
RtgameWorldIndextmapIDt hideNPCIDListtactivityMapLineDicttactivityLineIDtgameNPCtnpcCounttiR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR1Ÿs0          $5 cCstjtƒ|ƒdS(N(RR0t__Func_NormalNPCAI(R((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyt NormalNPCAIÄscCsÖtjƒ}g}xŸtd|jƒƒD]ˆ}|j|ƒ}|jƒdkrUq(n|jƒtjkr£tj    |ƒ}|dkr‹q(nt j |ƒr£q(q£n|j |ƒq(Wx|D]}t||ƒq»WdS(Ni(RR;trangetGetActiveNPCCounttGetActiveNPCByIndextGetIDtGetGameNPCObjTypeRt
gnotSummont GetObjDetailRRt
IsGameBosstappendt ProcessNPCAI(RRJtnormal_NPC_ListtindexR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyRMÎs        cCstjtƒ|ƒdS(N(RR0t__Func_BossSummonNPCAI(R((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pytBossSummonNPCAIýsc    Csñtjƒ}g}x–td|jƒƒD]}|j|ƒ}|jƒdkrUq(n|jƒtjkrpq(n|j    ƒdkrˆq(n|j ƒsšq(n|j |ƒq(Wx|D]}t ||ƒq²Wtjƒ}||jtjƒtjtjkrÿdS|jtj|ƒg}x¦td|jƒƒD]}|j|ƒ}|jƒdkr[q.n|jƒtjkrvq.n|j    ƒdkržtj|ƒ ržq.n|j ƒs°q.n|j |ƒq.Wx|D]}t ||ƒqÈWg}xQtd|jƒƒD]:}|j|ƒ}|jƒdkr(qûn|j |ƒqûWx|D]}t ||ƒq@Wg}x_t|jƒƒD]K}|j|ƒ}|j ƒs®tjd|jƒƒqpn|j |ƒqpWx|D]}t ||ƒqÆWt|||ƒdS(Nis###ïÚ³µËÀÍö , %s(RR;ROtGetSummonNPCCounttGetSummonNPCAtRRtGetTypeRtntElftGetOwnerRtIsAliveRWRXR t GetTickByTypeRtTYPE_Map_Tick_BossAITicktTYPE_Map_Tick_Timet SetTickByTypeRVt GetBossCountt    GetBossAtt GetTruckCountt
GetTruckAtR5RCt ProcessPetAI(    RRJt gameElf_ListRZRt    gameWorldtgameSummon_Listt gameBoss_ListtgameTruck_List((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR[sh    "     cCsÝ||jtjƒtjtjkr*dS|jtj|ƒg}xutd|jƒƒD]^}|j|ƒ}|jƒdkr†qYn|j    ƒs˜qYn|j
ƒsªqYn|j |ƒqYWx|D]}t ||ƒqÂWdS(Ni( RcRtTYPE_Map_Tick_PetAITickReRfROt GetPetCounttGetPetAtRRt GetIsSummonRbRWRX(RmRJRt gamePet_ListRZtcurPet((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyRkns"   cCstjtƒ|ƒdS(N(RR0t__Func_NPCRefreshPoint(R((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pytNPCRefreshPoint”scCstj|ƒdS(N(tNPCCustomRefreshtProcessAllNPCRefresh(R((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyRwœs cCs»|jƒ}tjƒjtj|ƒ}|rx||kr>dStjƒjtj|dƒtjd|||fƒntjt    dt
|ƒdfƒ}|dkrªdS|||ƒdS(Nis1NPCÐã½áÊø£¬¿ªÊ¼´¦ÀíAI!npcID=%s,tick=%s,endTick=%ss AIType_%s.%st    ProcessAI( RRt    GetGameFBtGetGameFBDictByKeyRtDef_FBDict_NPCShowEndTickt SetGameFBDicttDebugLogR Rt    GetAINameR(RRtnpcIDtendTickR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyRX§s      "  cCs,|jƒtjtjgkr"dS|jƒS(NtPriWood(R_RtntPriWoodPilePVEtntPriWoodPilePVPR (R((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyRÅscCs9tjtd|jƒdfƒ}|r5|||ƒSdS(Ns AIType_%d.%st OnCollectEnd(RR RR (t    curPlayerRR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR‡Òs" cCs||jƒ}|jƒtjkr%tStj|ƒtj|ƒdkrKtStj    |tj|ƒƒt
j d||ƒtS(Nis!²»ËÀbossѪÁ¿Îª0ÉèÖÃÂúѪ! npcID=%s( RR_Rt    ntUndeathR@tGameObjtGetHPtGetMaxHPR/tSetHPRR€(RR‚((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pytOnUndeathBossAttackeds "cCstjd||fƒtjƒj|ƒ}tj||ƒtjtd|jƒdfƒ}|dkrndS|||ƒdS(Ns----NPCAppearWarn:%s %ss AIType_%d.%st NPCAppearWarn(
RR€R;t FindNPCByIDt
SkillShelltNotifyNPCSkillWarnR RR R(RtobjIDRR((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyR s"  ()RRRRRRyt GameLogInfottimetmatht ReadChConfigR*t SkillCommont    BuffSkillRŠR‘R&RR8t    ImportAllR
R RRR$R%R)R.R2R1RNRMR\R[RkRxRwRXRR‡RŽR(((sbE:\SnxxServerCode\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\ChNPC.pyt<module> sR                                                                  %    
    /        i    &                      @