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
x{[c@s”dZddlZddlZddlZddlZddlZddlZddlZddlZddl    Z    ddl
Z
dZ dZ e dƒ\ZZZe dƒ\ZZZZZZZZiae dƒ\ZZZZe dƒZ\ZZ Z!Z"Z#Z$Z%Z&d„Z'd    „Z(d
„Z)d „Z*d „Z+d „Z,d„Z-d„Z.d„Z/d„Z0d„Z1d„Z2d„Z3d„Z4d„Z5dS(sVersion = 2015-07-13 11:30iÿÿÿÿNtGoblin_AttackedTicktGoblin_MoveDiriiicCs4|jƒjtjƒ|jtdƒt|ƒdS(Ni(t GetNPCAngrytInittChConfigtDef_NormalNPCAngryCounttSetDicttDef_NPCKey_Goblin_AttackedTickt DoHideGoblin(tcurNPC((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pytDoInitXs
cCsìt|ƒrdStj|ƒ}|jƒtjksA|jƒ r]|j|ƒdkr]dSn|jt    ƒ}|dkr†t
|ƒdSt |j ƒƒ}|||t krºt|ƒdS|jƒ}|tjkrèt|||ƒndS(Ni(Rt    NPCCommont
NPCControlt GetCurActiont IPY_GameWorldtlaNPCDietIsAlivetDieTickt GetDictByKeyRt__CheckCorrectGoblinPost__GetGoblinConfigtGetNPCIDt Def_StopTimet __GoblinStopt    laNPCMovet    __Runaway(R    ttickt
npcControlt attackedTicktaiConfigt curNPCAction((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyt    ProcessAIes$ " 
 
 c
Cs|jƒ}|tjkrdStjƒ}|jƒ}|jƒ}t}tj    ||ƒtj
kr„t }tj d||fƒn|j ||ƒs¶t }tj d||fƒn|sÀdStjd}d\}}x­td||ƒD]˜}    tj||||ƒ}tj||||ƒ}|j ||ƒrítj    ||ƒtj
krí|j||ƒtjd||||fƒPqíqíWdS(Nsµ±Ç°´¦ÔÚ°²È«Çø!(%s,%s)sµ±Ç°Õϰ­µã²»¿ÉÒÆ¶¯!(%s,%s)iis2¸ç²¼ÁÖ´¦ÓÚ²»¿ÉÒÆ¶¯µã£¬ÖØÖÃλÖã¡(%s,%s) to (%s,%s)(ii(R Rt    laNPCNullt    GameWorldtGetMaptGetPosXtGetPosYtFalsetGameMaptGetAreaTypeByMapPostgatSafetTruetDebugLogtCanMoveRtDef_Screen_AreatrangetrandomtrandinttResetPostLog(
R    RtgameMaptposXtposYt isCorrectPostdisttcPosXtcPosYti((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyR‰s2      -cCs|jtdƒdS(Ni(RR(R    ((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyR­sc
CsÎ|jƒ}|jƒ}|jƒ}|jtƒ}d\}}xxtttƒƒD]d}    t||||ƒ\}}|dkr‹|dks£||krµ||krµt    ||ƒ}qRPqRW|j
||ƒdS(Ni(ii( R#R$t GetMoveAreaRtDef_NPCKey_Goblin_MoveDirR-tlent MoveDirListt__GetRandomPost__ChangeMoveDirtMove(
R    RRR3R4tmoveAreatmoveDirttagPosXttagPosYR9((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyR¸s    0cCss|tkr*tjttttgƒ}n5|tkrTtjtttt    gƒ}n |tkr~tjttt    tgƒ}ná|tkr¨tjttttgƒ}n·|tkrÒtjttt    tgƒ}n|tkrütjttttgƒ}nc|t    kr&tjttttgƒ}n9|tkrPtjtttt    gƒ}ntjt
ƒ}|j t |ƒ|S(N( tDef_MoveDir_UpR.tchoicetDef_MoveDir_LefttDef_MoveDir_RighttDef_MoveDir_LeftDowntDef_MoveDir_RightDowntDef_MoveDir_DowntDef_MoveDir_LeftUptDef_MoveDir_RightUpR=RR;(R    RBtnextDir((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyR?Ôs&        cCs|tkr!tjd|ƒdSxutd||ƒD]`}|tkrZ|}||}né|tkry|}||}nÊ|tkr˜||}|}n«|tkr·||}|}nŒ|tkrÚ||}||}ni|t    krý||}||}nF|t
kr ||}||}n#|t krC||}||}nt j ||ƒtjkr5tjƒj||||dƒ}|jƒ|jƒfSq5WdS(NsmoveDir=%s not in MoveDirListi(ii(ii(R=R!tErrLogR-RERKRGRHRLRIRMRJR&R'RR(R"t LineNearToPosR#R$(R3R4R6RBR9tresultXtresultYtnewPoint((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyR>ôsB      
     
     
 
 
 
  !cCs!|jt|ƒt||ƒdS(N(RRt__OnAttackedDropItem(tatkObjR    tskillR((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyt
OnAttacked"s c Csdtj|ƒ}tj}d}|jƒ}|tjkrQtj}|jƒ}nê|tj    kr;|j
ƒ}|tj krót j |ƒ}|dkr8|jƒ}t j |ƒ}    |    dkrð|    jƒtjkrítj}|    jƒ}qíqðq8q;|tjkr;tj|ƒ}
|
dkr8tj}|
jƒ}q8q;nt|jƒƒ} t j| tƒ} dS(Ni(R R RtDef_NPCHurtTypeAlltGetGameObjTypeRt    gotPlayertDef_NPCHurtTypePlayert GetPlayerIDtgotNPCtGetGameNPCObjTypet
gnotSummonR!t GetObjDetailtNonetGetOwnertgnotPett
PetControlt GetPetOwnerRRtGetResultByRandomListtDef_AttackedDropItemCountRate( RUR    RtdropTypetownerIDt
atkObjTypet
npcObjTypet curNPCDetailt curNPCOwnert summonOwnert    curPlayerRt    dropCount((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyRT.s4                      cCs}tj}d}tj|ƒ}|jƒdkrAtjdƒdSt|jƒƒ}g}tj|t    ƒ}x:t
|ƒD],}    tj|t ƒ}
|j |
dgƒqyWtj|t ƒ} x7t
| ƒD])}    t|tƒ} |j | dgƒqÉWtj|tƒ} tjƒjƒ}|dkrytjdƒ}|j|jƒƒ}|rytjd|tjƒjƒgƒqyndS(NisAIType_196 OnDie NPCID=0it GoblinNotify((RRXR R RR!RORRftDef_DieDropGoodsCountRateR-tDef_DropGoodsRatetappendtDef_DieDropEquipCountRatet__GetRadomDropEquipIDtDef_DropEquipModelNumtDef_DieDropCountRateR"tGetMapIDt ReadChConfigtGetEvalChConfigtgett PlayerControlt WorldNotify(R    tHurtTypetHurtIDRhRiRRtdropItemIDListtdropGoodsCountR9tgoodsIDtdropEquipCounttequipIDRptmapIDtnotifyMarkDictt
notifyMark((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pytOnDiens0      (cCstj|d|jƒƒdS(NtGoblin(tDataRecordPackt
DR_KillNPCR(R    RoRV((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pytOnAttackDieByPlayeršscCstjd|ƒS(Ns    Goblin_%s(RzR{(tnpcID((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyR¢sc    CsÔtjd|ƒ}tj|ƒ}|s‹tjd|ƒ|t}|td}|td}|t}t    ||||ƒ}|t|<ntj
|t ƒ}||}|sÇtj dd|ƒdSt j|ƒS(NsGoblinDropEquip_%ss,¼ÓÔØ¸ç²¼ÁÖµôÂä×°±¸Ä£°åGoblinDropEquip_%s.txtiis3__GetRadomDropEquipID() can not find filter equip£¬s&please check GoblinDropEquip_%s.txt!!!(RzR{tg_filterEquipDictR|R!R*tDef_EquipModel_EquipTypetDef_EquipModel_LVLimittDef_EquipModel_DropItemListt__FilterItemFromDBRftDef_EquipModel_QualityRateROR.RF(    tdropEquipModelNumtdropEquipModeltfilterItemListt itemTypeListt    itemMinLVt    itemMaxLVt
dropIDListtqualitytdropEquipIdList((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyRv©s"
 
 
     c
Csggg}xÔ|D]Ì}tjƒ}|j|ƒxªtd|jƒƒD]“}|j|ƒ}|jƒ}    |jƒ rˆ|    |krˆqHn|jƒ|ksH|jƒ|kr²qHn||j    ƒrÇdndj
|jƒƒqHWqWtj dt |dƒt |dƒfƒ|S(Niis*¸ç²¼ÁÖµôÂä×°±¸idÁбí=%s£¬×¿Ô½×°±¸idÁбí=%s( R!t GetGameDatatFilterItemByTypeR-tGetFilterItemCountt GetFilterItemt GetItemTypeIDt GetCanNPCDroptGetLVtGetItemQualityRtR*tstr(
R˜R™RšR›tfindItemIdListtitemTypetgameDataR9t curFindItemtitemID((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyR“Ìs     $1+c
Cstjƒjƒ}|dkr‹dddddddd    d
d g
}|jƒ}||kr‹|jƒr‹|jtƒtjd |ƒtSntS( Nii0ui1ui2ui3ui4ui5ui6ui7ui8ui9us·ÇÒ»Ïߣ¬Òþ²Ø¸ÃNPCID=%s£¡(    R!t GetGameWorldt    GetLineIDRt
GetVisiblet
SetVisibleR%R1R)(R    tlineIDtgoblinNPCIDListRŽ((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyRås $  (6t__doc__RR!R RRzRdR&R‹R}R.RR;R-tDef_DropItemType_MoneytDef_DropItemType_GoodstDef_DropItemType_EquipRRgtDef_AttackedDropItemTypeRateRrRuRxRsRwRRR‘R”R’R=RERKRGRHRLRIRMRJR
RRRRR?R>RWRTR‰RRRvR“R(((s].\ServerPython\ZoneServerGroup\map1_8G\MapServer\MapServerData\Script\NPC\NPCAI\AIType_196.pyt<module>s@           $ (             $    $                  .         @    ,            #