TR_m4_NPC_Ibelard
TR_Mainland.esm
Variables
14
Local Variables
TR_Map
control
controlQ
T_Local_NPC
T_Local_NoLore
NoHello
NoIdle
NoLore
doOnce
OnPCHitMe
noHit
ConvinceConfront
ThankIbelard
timer
Source
1Begin TR_m4_NPC_Ibelard
2; This script controls the cursed miner in the Etana Egg Mine, part of Remnants of Resdayn quest.
3
4; Variables from the "NoLore" TR map4 script.
5short TR_Map
6short control
7short controlQ
8short T_Local_NPC
9short T_Local_NoLore
10short NoHello
11short NoIdle
12short NoLore
13short doOnce
14short OnPCHitMe
15float timer
16short noHit
17
18; Records if character has been convinced to confront the foreman.
19short ConvinceConfront
20
21; Records first greeting after Ibelard has been healed
22short ThankIbelard
23
24if ( MenuMode )
25 return
26endif
27
28if ( GetJournalIndex, "TR_m4_Om_RemnantsIbelard" >= 10 )
29 return
30endif
31
32if ( ThankIbelard == 1 )
33 if ( TR_m4_Om_ReRe_Ordinators )
34 return
35 endif
36 if ( timer > 1 )
37 ForceGreeting
38 endif
39 Set timer to ( timer + GetSecondsPassed )
40 return
41endif
42
43; Detect if dispel is cast, then make all aware that Ibelard is healed.
44if ( GetEffect, sEffectDispel == 1 )
45 StopCombat ; just in case
46 LoopGroup Idle 1 1
47 Set ThankIbelard to 1
48 Say, "Vo\b\m\Flw_BM003.mp3", "Thank you!"
49 ModDisposition, 50
50 "TR_m4_Kalmaron"->ModDisposition, 20
51 "TR_m4_Semmo"->ModDisposition, 20
52 "TR_m4_Meldresi"->ModDisposition, 20
53 ModPCFacRep 3 "Temple"
54 Set NoHello to -1 ; make him talk again
55 Set NoIdle to -1
56 SetAlarm 90
57 SetHello 30
58 return
59
60elseif ( TR_m4_Om_ReRe_Ordinators )
61 ; dispelled by Ordinators
62 StopCombat ; just in case
63 LoopGroup Idle 1 1
64 Set ThankIbelard to 1
65 Set NoHello to -1 ; make him talk again
66 Set NoIdle to -1
67 SetAlarm 90
68 SetHello 30
69 return
70
71elseif ( OnPCHitMe == 0 )
72 if ( noHit == 1 )
73 PlayGroup KnockOut 2 ; make him appear knocked out
74 else
75 PlayGroup Idle 1
76 endif
77endif
78
79if ( OnPCHitMe )
80 ; makes sure it works to initiate a fight with Ibelard
81 if ( doOnce == 0 )
82 LoopGroup Idle 1 1
83 Set doOnce to 1
84 elseif ( doOnce == 1 )
85 StartCombat Player
86 Set doOnce to 2
87 endif
88endif
89
90; From the TR map4 script
91if ( TR_Map == 4 )
92 return
93endif
94set TR_Map to 4
95set noHit to 1
96
97End