TR_m7_NPC_Arniel_Duront
TR_Mainland.esm
Variables
10
Local Variables
TR_Map
control
controlQ
NoLore
T_Local_NPC
T_Local_NoLore
state
follow
sword
timer
Source
1Begin TR_m7_NPC_Arniel_Duront
2
3short TR_Map
4short control
5short controlQ
6short NoLore
7short T_Local_NPC
8short T_Local_NoLore
9
10short state
11float timer
12short follow
13short sword
14
15if ( MenuMode )
16 return
17endif
18
19if ( control == 10 )
20 return
21endif
22
23if ( OnDeath )
24 set control to 10
25 if ( GetJournalIndex TR_m7_Ns_RobbingAncestors == 55 )
26 additem Gold_001 1500
27 elseif ( GetJournalIndex TR_m7_Ns_RobbingAncestors == 50 )
28 if ( sword )
29 additem TR_m7_q_KrenSword 2
30 else
31 additem TR_m7_q_KrenSword 1
32 endif
33 endif
34 return
35endif
36
37if ( GetJournalIndex TR_m7_Ns_RobbingAncestors == 150 )
38 if ( GetDisabled == 0 )
39 disable
40 endif
41 return
42elseif ( GetDisabled )
43 enable
44endif
45
46; inside the tomb
47if ( GetJournalIndex TR_m7_Ns_RobbingAncestors == 30 )
48
49 ; stay or return if you left the tomb
50 if ( GetPCCell "Kren Ancestral Tomb" != 1 )
51 if ( control == 0 )
52 set control to 1
53 ForceGreeting
54 endif
55 endif
56
57 ; open a door
58 if ( controlQ )
59 ; skip casting if the player left the tomb
60 if ( CellChanged )
61 set state to 2
62 endif
63
64 if ( state == 0 )
65 ; remember if he follows you
66 if ( GetCurrentAIPackage == 3 )
67 set follow to 1
68 endif
69 AiWander 0 0 0
70 set timer to 0
71 Cast TR_m7_q_ArnielOpenSpell "TR_m7_Arniel Duront"
72 set state to 1
73 elseif ( state == 1 )
74 set timer to ( timer + GetSecondsPassed )
75 if ( timer >= 2 )
76 set state to 2
77 endif
78 elseif ( state == 2 )
79 if ( controlQ == 1 )
80 TR_m7_q_KrenSideRoomDoor->PlaySound3D "disarm trap"
81 TR_m7_q_KrenSideRoomDoor->PlaySound3D "alteration hit"
82 TR_m7_q_KrenSideRoomDoor->PlaceAtMe "T_Glb_Var_SummonFX" 1 0 0
83 TR_m7_q_KrenSideRoomDoor->disable
84 elseif ( controlQ == 2 )
85 TR_m7_q_KrenLowerChamberDoor->PlaySound3D "disarm trap"
86 TR_m7_q_KrenLowerChamberDoor->PlaySound3D "alteration hit"
87 TR_m7_q_KrenLowerChamberDoor->PlaceAtMe "T_Glb_Var_SummonFX" 1 0 0
88 TR_m7_q_KrenLowerChamberDoor->disable
89 endif
90 if ( follow )
91 AiFollow player 0 0 0 0
92 endif
93 set state to 0
94 set controlQ to 0
95 set follow to 0
96 endif
97 endif
98
99endif
100
101if ( TR_Map )
102 return
103endif
104
105set TR_Map to 7
106
107End