TR_m4_NPC_Anbarnag
TR_Mainland.esm
Variables
10
Local Variables
TR_Map
control
controlQ
NoLore
disableOnce
T_Local_NoLore
T_Local_NPC
onPCHitMe
trackHealth
trackFatigue
Source
1Begin TR_m4_NPC_Anbarnag
2; This short script is there to allow dialogue to be filtered on the TR_Map local variable,
3; allowing for regional topics such as "Morrowind Lore" or "Geographic Regions" to be
4; appropriate to the location the NPC is. This version is for "NoLore" NPCs.
5
6short TR_Map
7short control
8short controlQ
9short NoLore
10short disableOnce
11short T_Local_NoLore
12short T_Local_NPC
13short onPCHitMe
14float trackHealth
15float trackFatigue
16
17if ( onPCHitMe )
18 set onPCHitMe to 0
19 StopCombat
20 SetFight 0
21 if ( trackHealth > GetHealth )
22 if ( controlQ < 5 )
23 if ( GetHealthGetRatio < 0.5 )
24 set controlQ to 5
25 else
26 set controlQ to ( controlQ + 1 )
27 set trackHealth to GetHealth
28 endif
29 endif
30 elseif ( trackFatigue > GetFatigue )
31 if ( controlQ < 5 )
32 set controlQ to ( controlQ + 1 )
33 endif
34 endif
35 if ( controlQ == 5 )
36 set controlQ to 6
37 ForceGreeting
38 endif
39endif
40
41if ( disableOnce == 0 )
42 disable
43 set disableOnce to 1
44endif
45
46if ( GetJournalIndex "TR_m4_FG_Map" >= 10 )
47 if ( GetJournalIndex "TR_m4_FG_Map" < 100 )
48 if ( GetDisabled == 1 )
49 enable
50 endif
51 endif
52 if ( MenuMode == 0 )
53 set trackFatigue to GetFatigue
54 endif
55endif
56
57if ( GetJournalIndex "TR_m4_FG_Map" >= 100 )
58 if ( GetDisabled == 0 )
59 disable
60 endif
61endif
62
63if ( OnDeath == 1 )
64 if ( GetJournalIndex "TR_m4_FG_Map" < 30 )
65 Journal "TR_m4_FG_Map" 40
66 elseif ( GetJournalIndex "TR_m4_FG_Map" == 30 )
67 Journal "TR_m4_FG_Map" 50
68 endif
69endif
70
71if ( TR_Map == 4 )
72 return
73endif
74
75set TR_Map to 4
76set trackHealth to GetHealth
77
78End