TR_m3_Kha_SY_Summon_sc
TR_Mainland.esm
Variables
3
Local Variables
OnPCEquip
PCSkipEquip
actionFlag
Source
1begin TR_m3_Kha_SY_Summon_sc
2
3short OnPCEquip
4short PCSkipEquip
5short actionFlag
6
7if ( GetDisabled )
8 SetDelete 1
9 return
10endif
11
12set PCSkipEquip to 0
13
14if ( actionFlag == 1 )
15
16 if ( GetPCCell, "Drothril Ancestral Tomb" == 0 )
17 MessageBox "Not here."
18 elseif ( Player->GetItemCount "tr_m3_kha_sy_hand" < 1 )
19 MessageBox "You can't begin the ritual without the hand."
20
21 elseif ( Player->GetPos X > 3364 )
22 MessageBox " Not here. "
23 elseif ( Player->GetPos X < 2800 )
24 MessageBox " Not here. "
25 elseif ( Player->GetPos Y > 2636 )
26 MessageBox " Not here. "
27 elseif ( Player->GetPos Y < 2087 )
28 MessageBox " Not here. "
29
30 else
31 MessageBox "You begin the ritual."
32 If ( Player->GetItemCount "TR_m3_Kha_SY_Summon" == 0 )
33 Disable ;remove from world if used outside of inventory
34 Endif
35 Player->StartScript TR_m3_Kha_SY_Ritual
36 endif
37
38 set actionFlag to 0
39endif
40
41; Activating from the inventory
42if ( MenuMode )
43
44 ; vanilla engine fails to set PCSkipEquip under certain conditions
45 set PCSkipEquip to 1
46
47 if ( OnPCEquip )
48
49 set actionFlag to 1
50
51 set OnPCEquip to 0
52 set PCSkipEquip to 0 ; OpenMW fails to open the book without this line
53 Activate
54 endif
55
56 ; never let OnActivate section happen in MenuMode
57 return
58endif
59
60; Activating in the world
61if ( OnActivate )
62
63 set actionFlag to 1
64
65 Activate
66endif
67
68end