TR_m1_FW_IC5_PotmanSc
TR_Mainland.esm
Variables
15
Local Variables
control
controlQ
doonce
topic1
topic2
topic3
state
move
range
stopfollow
nolore
dead
TR_map
T_local_npc
TR_m2_IC_Swordvalue
Source
1Begin TR_m1_FW_IC5_PotmanSc
2
3short control
4short controlQ
5short doonce
6short topic1
7short topic2
8short topic3
9short state
10short move
11short range
12short stopfollow
13short nolore
14short dead
15short TR_map
16short T_local_npc
17short TR_m2_IC_Swordvalue
18
19if ( dead == 1 )
20 return
21endif
22
23if ( OnDeath )
24 set dead to 1
25endif
26
27if ( TR_map == 0 )
28 set TR_map to 2
29endif
30
31if ( doonce == 0 )
32 if ( getinterior == 0 )
33 if ( getdistance player <= 128 )
34 forcegreeting
35 set doonce to 1
36 endif
37 endif
38endif
39
40if ( doonce == 2 )
41 if ( CellChanged )
42 disable
43 endif
44endif
45
46if ( stopfollow == 0 )
47 if ( CellChanged )
48 setfight 30
49 stopcombat
50 set state to 0
51 endif
52endif
53
54if ( state == 0 )
55 if ( GetEffect sEffectRestoreHealth == 1 )
56 setfight 100
57 startcombat player
58 set state to 1
59 endif
60endif
61
62if ( stopfollow == 0 )
63 if ( getdistance TR_m1_FW_IC_SwordAct <= 128 )
64 AIWander 0 0 0 0 0 0 0 50 0 0 0 0
65 set stopfollow to 1
66 endif
67elseif ( stopfollow == 1 )
68 if ( player->getitemcount T_Imp_UNI_TaldeusSword >= 1 )
69 if ( getdistance player <= 256 )
70 forcegreeting
71 set stopfollow to 2
72 endif
73 endif
74endif
75
76if ( TR_m1_FW_IC5_Topic1->GetDistance player <= 300 )
77 set topic1 to 1
78else
79 set topic1 to 0
80endif
81
82if ( TR_m1_FW_IC5_Topic2->GetDistance player <= 300 )
83 set topic2 to 1
84else
85 set topic2 to 0
86endif
87
88if ( TR_m1_FW_IC5_Topic3->GetDistance player <= 300 )
89 set topic3 to 1
90else
91 set topic3 to 0
92endif
93
94if ( GetInterior )
95 Return
96endif
97if ( range >= 0 )
98 if ( GetCurrentAIPackage == 3 )
99 if ( GetDistance TR_m1_FW_IC5_FollowRange >= 750 )
100 set range to 1
101 if ( GetDistance TR_m1_FW_IC5_FollowRange >= 1000 )
102 Forcegreeting
103 endif
104 endif
105 endif
106endif
107if ( GetAIPackageDone == 1 )
108 set move to 1
109 set doonce to 0
110 set range to 0
111endif
112
113end