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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/python
# -*- coding: GBK -*-
#
#
##@package AIType_65.py
#
# @todo:SBÐÍNPCËÀÍö´¥·¢¼¼ÄÜ
#
# @author jiang
# @date 2014-09-02 12:00
# @version 1.0
# @note:
#
#------------------------------------------------------------------------------ 
"""Version = 2014-09-02 12:00"""
#------------------------------------------------------------------------------ 
# µ¼Èë
import GameWorld
import IPY_GameWorld
import ChConfig
import NPCCommon
import SkillShell
import GameObj
#------------------------------------------------------------------------------
 
#------------------------------------------------------------------------------ 
## ³õʼ»¯
#  @param curNPC µ±Ç°npc
#  @return None
#  @remarks 
def DoInit(curNPC):
    curNPC.GetNPCAngry().Init(ChConfig.Def_SummonNPC_Angry_Count)
    return
 
 
## Ö´ÐÐAI
#  @param curNPC µ±Ç°npc
#  @param tick µ±Ç°Ê±¼ä
#  @return None
#  @remarks 
def ProcessAI(curNPC, tick):
    
    #NPCÒÑËÀÍö£¬Ìø³ö
    if curNPC.IsAlive() != True:
        return
    
    #»ñµÃNPC¹ÜÀíÆ÷
    npcControl = NPCCommon.NPCControl(curNPC)
    if curNPC.GetLastTime() != 0 and tick - curNPC.GetBornTime() >= curNPC.GetLastTime():
        npcControl.SetKilled()
        return
    
    return
 
 
## NPCËÀÍö
#  @param curNPC µ±Ç°npc
#  @param hurtType É˺¦ÕßµÄobjÀàÐÍ
#  @param hurtID É˺¦ÕßµÄobjID
#  @return None
def OnDie(curNPC, hurtType, hurtID):
    
    #ËÀÍöNPC²»Äܹ¥»÷, ÕâÀïÉèÖÃNPCѪÁ¿Îª1
    GameObj.SetHP(curNPC, 1)
    
    #»ñµÃ¼¼ÄܹÜÀíÆ÷
    skillManager = curNPC.GetSkillManager()
    curSkill = skillManager.GetSkillByIndex(0)
    if not curSkill:
        return
    
    tick = GameWorld.GetGameWorld().GetTick()
    SkillShell.NPCUseSkill(curNPC, curSkill, tick)
    
    GameObj.SetHP(curNPC, 0)
    return