TR_m7_Ns_IC3_Qawi_sc
TR_Mainland.esm
Variables
6
Local Variables
TR_Map
control
controlQ
T_Local_NPC
NoLore
DoOnce
Source
1Begin TR_m7_Ns_IC3_Qawi_sc
2;Quest will advance if restore luck cast on Qawi brings her back to base luck of 50
3
4short TR_Map
5short control
6short controlQ
7short T_Local_NPC
8short NoLore
9short DoOnce
10
11if ( GetJournalIndex TR_m7_Ns_IC3 >= 45 )
12 return
13endif
14
15;Ability added to Qawi that damages her luck
16if ( DoOnce == 0 )
17 if ( GetJournalIndex TR_m7_Ns_IC3 > 0 )
18 AddSpell TR_m7_q_Ns_IC3_BadLuck
19 set DoOnce to 1
20 endif
21endif
22
23if ( GetJournalIndex TR_m7_Ns_IC3 > 0 )
24 if ( getEffect sEffectRestoreAttribute == 1 )
25 ; base luck == 50
26 ; curse decreases 10
27 if ( control == 0 ) ; first check
28 if ( GetLuck > 49 ) ; sometimes "restore luck 10" spell restores 9.86 points
29 ; luck increased; either restore or fortify applied; we need only restore
30 ; remove all fortify effects
31 set control to 1
32 RemoveEffects 79
33 return
34 endif
35 else ; second check without fortify effects
36 set control to 0
37 if ( GetLuck > 49 )
38 ; now it's a restore spell, remove curse and update journal
39 set control to 0
40 RemoveSpell TR_m7_q_Ns_IC3_BadLuck
41 journal TR_m7_Ns_IC3 45
42 endif
43 endif
44 endif
45endif
46
47if ( TR_Map == 7 )
48 return
49endif
50
51set TR_Map to 7
52
53End