TR_m4_NPC_Delvenu_Bavani
TR_Mainland.esm
Variables
7
Local Variables
TR_Map
control
controlQ
T_Local_NPC
T_Local_NoLore
NoLore
timer
Source
1Begin TR_m4_NPC_Delvenu_Bavani
2
3; control states
4; 1 = Unequip magic
5; 2 = Make no changes to skills (melee mode)
6; 3 = Switch to magic
7; 4 = Make no changes to skills (magic mode)
8
9; controlQ states
10; 1 = Sibling just died, begin fleeing
11; 2 = Wait 5 seconds to stop fleeing, stop combat with player
12; 3 = Will not begin fleeing again
13; 4 = Back at Monastery, remove equipment
14; 5 = post Monastery state
15
16float timer
17short TR_Map
18short control
19short controlQ
20short T_Local_NPC
21short T_Local_NoLore
22short NoLore
23
24
25if ( OnDeath == 1 )
26 set control to 4
27 set controlQ to 3
28 if ( GetJournalIndex "TR_m4_TT_StAralor_Q3" >= 10 )
29 if ( GetJournalIndex "TR_m4_TT_StAralor_Q3" < 100 )
30 Journal "TR_m4_TT_StAralor_Q3" 31
31 endif
32 endif
33endif
34
35if ( GetJournalIndex "TR_m4_TT_StAralor_Q3" >= 110 )
36 if ( controlQ == 3 )
37 set controlQ to 4
38 endif
39elseif ( GetJournalIndex "TR_m4_TT_StAralor_Q3" >= 30 )
40 if ( controlQ == 0 )
41 set controlQ to 1
42 endif
43endif
44
45if ( controlQ == 1 )
46 SetFlee 100
47 set controlQ to 2
48elseif ( controlQ == 2 )
49 set timer to ( timer + GetSecondsPassed )
50 if ( timer > 5 )
51 StopCombat
52 SetFlee 30
53 set controlQ to 3
54 SetFight 30
55 endif
56elseif ( controlQ == 4 )
57 RemoveItem "T_De_CanyonWatch_Cuirass_01" 1
58 RemoveItem "T_De_Chitin_PauldrL_01" 1
59 RemoveItem "T_De_Chitin_PauldrR_01" 1
60 RemoveItem "T_De_CanyonWatch_Greaves_01" 1
61 RemoveItem "T_De_CanyonWatch_Boots_01" 1
62 RemoveItem "chitin guantlet - right" 1
63 RemoveItem "T_De_CanyonWatch_BracerL_01" 1
64 RemoveItem "TR_m4_DelvenuBavani_shield" 1
65 RemoveItem "T_Com_Silver_Morningstar" 1
66 set controlQ to 5
67endif
68
69if ( GetHealthGetRatio >= 0.4 )
70 if ( control == 2 )
71 return
72 else
73 set control to 1
74 endif
75elseif ( GetHealthGetRatio < 0.4 )
76 if ( control == 4 )
77 return
78 else
79 set control to 3
80 endif
81endif
82
83if ( control == 1 )
84 ;MessageBox "Delvenu C1"
85 RemoveSpell "TR_m4_DelvenuBavani_D"
86 set control to 2
87elseif ( control == 3 )
88 ;MessageBox "Delvenu C3"
89 AddSpell "TR_m4_DelvenuBavani_D"
90 set control to 4
91endif
92
93if ( TR_Map == 4 )
94 return
95endif
96
97set TR_Map to 4
98
99End