TR_m2_q_29_2_SelariScript
TR_Mainland.esm
Variables
9
Local Variables
TR_Map
control
controlQ
state
OnPCHitMe
checkParalysis
T_Local_NPC
NoLore
timer
Source
1Begin TR_m2_q_29_2_SelariScript
2
3short TR_Map
4short control
5short controlQ
6short state ;=1 to 9: she paralyses the PC and runs behind whilst invisible
7 ; =99: scriptery over and she just fights.
8short OnPCHitMe
9short checkParalysis
10float timer
11short T_Local_NPC
12short NoLore
13
14if ( OnDeath == 1 )
15 if ( GetJournalIndex "TR_m2_FG_Irano2" >= 10 )
16 if ( GetJournalIndex "TR_m2_FG_Irano2" == 80 )
17 Journal "TR_m2_FG_Irano2" 90
18 if ( player->GetSpell "TR_m2_q_29_2_paralyze" == 1 )
19 player->RemoveSpell "TR_m2_q_29_2_paralyze"
20 endif
21 elseif ( GetJournalIndex "TR_m2_FG_Irano2" < 80 )
22 Journal "TR_m2_FG_Irano2" 95
23 if ( player->GetSpell "TR_m2_q_29_2_paralyze" == 1 )
24 player->RemoveSpell "TR_m2_q_29_2_paralyze"
25 endif
26 endif
27 endif
28endif
29
30if ( GetJournalIndex "TR_m2_FG_Irano2" >= 105 )
31 if ( GetDisabled == 0 )
32 disable
33 endif
34endif
35
36if ( state <= 0 )
37 if ( OnPCHitMe == 1 ) ;this counts on the fact that it will trigger when SHE attacks the PC, if the PC doesn't attack first
38 set state to 1
39 endif
40elseif ( state == 1 )
41 if ( player->GetEffect, sEffectResistParalysis == 1 ) ; PC has any paralysis resistance: she just turns invisible and attacks
42 AddSpell "TR_m2_q_29_2_invisible"
43 PlaySound "illusion cast"
44 SetFight 100
45 set state to 99
46 elseif ( player->GetEffect, sEffectResistParalysis == 0 ) ; PC has no paralysis resistance: she paralyses the PC and runs
47 AddSpell "TR_m2_q_29_2_invisible"
48 player->AddSpell "TR_m2_q_29_2_paralyze"
49 PlaySound "illusion cast"
50 ForceRun
51 AddItem "T_Imp_Silver_Dart_DirePoisonCl" 8
52 StopCombat ;otherwise AiTravel below would have no effect
53 set state to 2
54 sethello 0
55 endif
56endif
57
58if ( state >= 1 ) ; if the PC is freed from paralysis while she's running: stop everything and just attack
59 if ( state <= 9 )
60 if ( player->GetEffect, sEffectCureParalyzation == 1 )
61 SetFight 100
62 StartCombat, player
63 set state to 99
64 elseif ( player->GetEffect, sEffectRemoveCurse == 1 )
65 SetFight 100
66 StartCombat, player
67 set state to 99
68 elseif ( player->GetParalysis <= 0 ) ; in case of scripted items freeing from paralysis...? (more likely player cheating paralysis away)
69 if ( checkParalysis <= 2 )
70 set checkParalysis to ( checkParalysis + 1 ) ; delay because the curse added above may take a frame to apply
71 else
72 player->RemoveSpell "TR_m2_q_29_2_paralyze"
73 player->SetParalysis 0
74 SetFight 100
75 StartCombat, player
76 set state to 99
77 endif
78 endif
79 endif
80endif
81
82if ( state == 2 ) ; travel positions: she runs around the tower till she's behind her initial position
83
84 AiTravel -28 43 2176 0 ;TR_m2_MARK_Selari
85 set state to 3
86
87elseif ( state == 3 )
88 if ( GetAiPackageDone == 1 )
89 set state to 4
90 set timer to 0
91 endif
92
93 ; now comes a failsafe, as otherwise state wouldn't increase to 4 when the player would taunt Selari into fighting.
94 if ( MenuMode == 0 )
95 set timer to ( timer + GetSecondsPassed )
96 endif
97 if ( timer > 8 )
98 set state to 4
99 set timer to 0
100 endif
101
102elseif ( state == 4 )
103
104 AiTravel -786 113 2178 0 ;TR_m2_MARK_Selari
105 set state to 5
106
107elseif ( state == 5 )
108 if ( GetAiPackageDone == 1 )
109 set state to 6
110 endif
111
112 ; now comes a failsafe, as otherwise state wouldn't increase to 6 when the player would taunt Selari into fighting.
113 if ( MenuMode == 0 )
114 set timer to ( timer + GetSecondsPassed )
115 endif
116 if ( timer > 8 )
117 set state to 6
118 set timer to 0
119 endif
120
121elseif ( state == 6 ) ; the paralysis spell on the PC fades mid-travel
122
123 AiTravel -532 -646 2178 0 ;TR_m2_MARK_Selari
124 setFight 100
125 player->RemoveSpell "TR_m2_q_29_2_paralyze"
126 set state to 7
127
128elseif ( state == 7 )
129 if ( GetAiPackageDone == 1 )
130 set state to 8
131 endif
132
133elseif ( state == 8 )
134
135 AiTravel 23 -292 2178 0 ;TR_m2_MARK_Selari
136 set state to 9
137
138elseif ( state == 9 )
139 if ( GetAiPackageDone == 1 )
140 set state to 99
141 StartCombat, player
142 endif
143endif
144
145if ( TR_Map == 2 )
146 return
147endif
148
149set TR_Map to 2
150
151End