Mercenary_Calvus
Tribunal.esm
Variables
7
Local Variables
noLore
companion
contract_Calvus
distanceCheck
isdead
minimumProfit
timer
Source
1Begin Mercenary_Calvus
2
3;local script
4;note: make sure Mercenary has Hello 0
5
6
7short noLore
8short companion
9short contract_Calvus
10float minimumProfit
11float timer
12short distanceCheck
13short isdead
14
15
16
17if ( MenuMode == 1 )
18 Return
19endif
20
21
22if ( gethealth < 1 )
23 return
24endif
25
26if ( isdead == 1 )
27 return
28endif
29
30if ( ondeath == 1 )
31 set isdead to 1
32 set MercenaryNear to 0
33 return
34endif
35
36;this section handles getting rid of Calvus during the Karrod duel
37if ( MercenaryNear == 0 )
38 if ( GetDistance "King Hlaalu Helseth" <= 2080 )
39 set MercenaryNear to 1
40 endif
41elseif ( MercenaryNear == 1 )
42 if (GetDistance "King Hlaalu Helseth" > 2080 )
43 set MercenaryNear to 0
44 endif
45endif
46
47
48;this section handles changes in state when Calvus leaves a contract, either because the contract expires, or because the player has taken Calvus' stuff
49
50if ( GetJournalIndex Merc_Calvus_Quit < 1 ) ;if Calvus has already quit, don't do this
51
52 if ( Contract_Calvus == 1 ) ;if Calvus doesn't have a contract, don't do this
53
54 if ( minimumProfit < 0 ) ;handles Calvus quitting because player took his stuff
55
56 AiWander 128 6 0 40 30 20 0 0 0 0 0 0 ;pushing this AI package on removes the follow package
57 Set Companion to 0
58 StopScript Contract_Calvus
59 Set Contract_Calvus to 0
60 ForceGreeting
61 return
62 else
63
64 if ( Contract_Calvus == 0 ) ;handles Calvus after a contract expires
65
66 AiWander 128 6 0 40 30 20 0 0 0 0 0 0 ;pushing this AI package on removes the follow package
67 Set Companion to 0
68
69 if ( GetJournalIndex Merc_Calvus < 10 )
70 Journal Merc_Calvus 10 ;tells player the first mercenary contract is expired
71 else
72 Journal Merc_Calvus 20 ;tells player the most recent mercenary contract is expired
73 endif
74
75 endif
76
77 endif
78
79 endif
80
81endif
82
83if ( companion == 0 )
84 return
85endif
86
87
88if ( timer < 3 )
89 set timer to ( timer + GetSecondsPassed )
90 return
91endif
92
93if ( GetDistance Player < NPCVoiceDistance )
94 if ( GetDistance Player < 500 )
95 set distanceCheck to 0
96 endif
97 set timer to 0
98 return
99endif
100
101if ( distanceCheck == 0 )
102 Say "Vo\I\M\Flw_IM001.mp3" "Where are you going?"
103 set distanceCheck to 1
104endif
105
106
107end Mercenary_Calvus