-
Notifications
You must be signed in to change notification settings - Fork 0
/
FPE_AdultResources.psc
353 lines (295 loc) · 13.1 KB
/
FPE_AdultResources.psc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
Scriptname FPE_AdultResources extends Quest
FPFP_BabyHandlerScript property FPFP_BabyHandler Auto Const Mandatory ; holds the handler for interactions and resetting
Actor property PlayerRef Auto Const Mandatory
MiscObject property Caps001 auto
GlobalVariable property FPFP_Global_ARReceiver Auto Const Mandatory
GlobalVariable property FPFP_Global_ARMessageType Auto Const Mandatory
GlobalVariable property FPFP_Global_AllowNONWDF Auto Const Mandatory
GlobalVariable property FPFP_Global_AllowSettlers Auto Const Mandatory
Actorbase property WorkshopNPC Auto Const Mandatory
Actorbase property WorkshopDog Auto Const Mandatory
Actorbase property WorkshopBrahmin Auto Const Mandatory
Faction Property FPFP_AdultResource Auto Const Mandatory
potion Property Pokeball_Settler_Female Auto const
potion Property Pokeball_Settler_Male Auto const
Actor Function GetActorUnderCrosshairs()
Actor ScannedActor = LL_FourPlay.LastCrossHairActor()
If ScannedActor == NONE || ScannedActor.GetDistance(PlayerRef) > 256.000
return None
EndIf
Return ScannedActor
EndFunction
Function GiveNPCUnderCrosshairs_Caged()
Actor akActor = GetActorUnderCrosshairs()
Caged(akActor)
EndFunction
Function GiveNPCUnderCrosshairs_LeavingHome()
Actor akActor = GetActorUnderCrosshairs()
LeavingHome(akActor)
EndFunction
Function GiveNPCUnderCrosshairs_Butchered()
Actor akActor = GetActorUnderCrosshairs()
Butchered(akActor)
EndFunction
Function GiveNPCUnderCrosshairs_SellasSlave()
Actor akActor = GetActorUnderCrosshairs()
SellasSlave(akActor)
EndFunction
Function Butchered(actor akActor)
form Object_Given
int int_Object_Given
String string_Message
bool Allowed = False
if (FPFP_BabyHandler.AdultAllowed(akActor.GetLeveledActorBase().GetRace())) && (akActor.IsInFaction(FPFP_AdultResource) || akActor.IsInFaction(Game.GetFormFromFile(0x01EA39, "INVB_Wasteland_Zoo.esp") as Faction))
Object_Given = FPFP_BabyHandler.WhatsmyStuff_Butcher(akActor.GetLeveledActorBase().GetRace())
int_Object_Given = FPFP_BabyHandler.HowMuch_Butcher(akActor.GetLeveledActorBase().GetRace())
string_Message = FPFP_BabyHandler.WhatsmyLine_Butcher(akActor.GetLeveledActorBase().GetRace())
Allowed = True
elseif FPFP_Global_AllowNONWDF.GetValue() == 1 && (akActor.GetLeveledActorBase() == WorkshopDog || akActor.GetLeveledActorBase() == WorkshopBrahmin)
Object_Given = FPFP_BabyHandler.WhatsmyStuff_Butcher(akActor.GetLeveledActorBase().GetRace())
int_Object_Given = FPFP_BabyHandler.HowMuch_Butcher(akActor.GetLeveledActorBase().GetRace())
string_Message = FPFP_BabyHandler.WhatsmyLine_Butcher(akActor.GetLeveledActorBase().GetRace())
Allowed = True
else
Allowed = False
endif
if (Allowed)
Game.FadeOutGame(true, true, 0, 1, true)
Utility.Wait(1)
;Show the message, if enabled
akActor.Disable() ; Disappear ourselves for smoother transition
if FPFP_Global_ARMessageType.GetValue() == 0
Debug.MessageBox(string_Message)
else
Debug.Notification(string_Message)
endif
if Object_Given != None
If FPFP_Global_ARReceiver.GetValue() == 1.0 ;Player
Game.GetPlayer().additem(Object_Given, int_Object_Given, true)
elseIf FPFP_Global_ARReceiver.GetValue() == 0.0 ;Workshop
Location workshopLocation = FPFP_BabyHandler.WorkshopParent.AddActorToWorkshopPlayerChoice(akActor) ; Assign NPC to workshop
WorkshopScript newWorkshop = FPFP_BabyHandler.WorkshopParent.GetWorkshopFromLocation(workshopLocation) ; Get the workshop
If newWorkshop
newWorkshop.additem(Object_Given, int_Object_Given, true)
else
Game.GetPlayer().additem(Object_Given, int_Object_Given, true)
endif
endif
endif
StartDelete(akActor)
Game.FadeOutGame(false, true, 0, 1)
else
if FPFP_Global_ARMessageType.GetValue() == 0
Debug.MessageBox("You are not allowed to Butcher "+ akActor.GetLeveledActorBase().GetName())
else
Debug.Notification("You are not allowed to Butcher "+ akActor.GetLeveledActorBase().GetName())
endif
endif
EndFunction
Function SellasSlave(actor akActor)
int int_Object_Given
String string_Message
bool Allowed = False
if (FPFP_BabyHandler.AdultAllowed(akActor.GetLeveledActorBase().GetRace())) && (akActor.IsInFaction(FPFP_AdultResource) || akActor.IsInFaction(Game.GetFormFromFile(0x01EA39, "INVB_Wasteland_Zoo.esp") as Faction))
int_Object_Given = FPFP_BabyHandler.HowMuch_Slave(akActor.GetLeveledActorBase().GetRace())
string_Message = FPFP_BabyHandler.WhatsmyLine_Slave(akActor.GetLeveledActorBase().GetRace())
Allowed = True
elseif FPFP_Global_AllowNONWDF.GetValue() == 1 && (akActor.GetLeveledActorBase() == WorkshopDog || akActor.GetLeveledActorBase() == WorkshopBrahmin)
int_Object_Given = FPFP_BabyHandler.HowMuch_Slave(akActor.GetLeveledActorBase().GetRace())
string_Message = FPFP_BabyHandler.WhatsmyLine_Slave(akActor.GetLeveledActorBase().GetRace())
Allowed = True
elseif FPFP_Global_AllowSettlers.GetValue() == 1 && akActor.GetLeveledActorBase() == WorkshopNPC
int_Object_Given = 100
string_Message = "Time to go, Slave"
Allowed = True
else
Allowed = False
endif
if (Allowed)
Game.FadeOutGame(true, true, 0, 1, true)
Utility.Wait(1)
;Show the message, if enabled
akActor.Disable() ; Disappear ourselves for smoother transition
if FPFP_Global_ARMessageType.GetValue() == 0
Debug.MessageBox(string_Message)
else
Debug.Notification(string_Message)
endif
if Caps001 != None
If FPFP_Global_ARReceiver.GetValue() == 1.0 ;Player
Game.GetPlayer().additem(Caps001, int_Object_Given, true)
elseIf FPFP_Global_ARReceiver.GetValue() == 0.0 ;Workshop
Location workshopLocation = FPFP_BabyHandler.WorkshopParent.AddActorToWorkshopPlayerChoice(akActor) ; Assign NPC to workshop
WorkshopScript newWorkshop = FPFP_BabyHandler.WorkshopParent.GetWorkshopFromLocation(workshopLocation) ; Get the workshop
If newWorkshop
newWorkshop.additem(Caps001, int_Object_Given, true)
else
Game.GetPlayer().additem(Caps001, int_Object_Given, true)
endif
endif
endif
StartDelete(akActor)
Game.FadeOutGame(false, true, 0, 1)
else
if FPFP_Global_ARMessageType.GetValue() == 0
Debug.MessageBox("You are not allowed to Sell "+ akActor.GetLeveledActorBase().GetName())
else
Debug.Notification("You are not allowed to Sell "+ akActor.GetLeveledActorBase().GetName())
EndIf
endif
EndFunction
Function LeavingHome(actor akActor)
form Object_Given
int int_Object_Given
String string_Message
bool Allowed = False
if (FPFP_BabyHandler.AdultAllowed(akActor.GetLeveledActorBase().GetRace())) && (akActor.IsInFaction(FPFP_AdultResource) || akActor.IsInFaction(Game.GetFormFromFile(0x01EA39, "INVB_Wasteland_Zoo.esp") as Faction))
Object_Given = FPFP_BabyHandler.WhatsmyStuff_Exile(akActor.GetLeveledActorBase().GetRace())
int_Object_Given = FPFP_BabyHandler.HowMuch_Exile(akActor.GetLeveledActorBase().GetRace())
string_Message = FPFP_BabyHandler.WhatsmyLine_Exile(akActor.GetLeveledActorBase().GetRace())
Allowed = True
elseif FPFP_Global_AllowNONWDF.GetValue() == 1 && (akActor.GetLeveledActorBase() == WorkshopDog || akActor.GetLeveledActorBase() == WorkshopBrahmin)
Object_Given = FPFP_BabyHandler.WhatsmyStuff_Exile(akActor.GetLeveledActorBase().GetRace())
int_Object_Given = FPFP_BabyHandler.HowMuch_Exile(akActor.GetLeveledActorBase().GetRace())
string_Message = FPFP_BabyHandler.WhatsmyLine_Exile(akActor.GetLeveledActorBase().GetRace())
Allowed = True
elseif FPFP_Global_AllowSettlers.GetValue() == 1 && akActor.GetLeveledActorBase() == WorkshopNPC
Object_Given = Caps001
int_Object_Given = 100
string_Message = "Leave Now and Never Come Back"
Allowed = True
else
Allowed = False
endif
if (Allowed)
Game.FadeOutGame(true, true, 0, 1, true)
Utility.Wait(1)
;Show the message, if enabled
akActor.Disable() ; Disappear ourselves for smoother transition
if FPFP_Global_ARMessageType.GetValue() == 0
Debug.MessageBox(string_Message)
else
Debug.Notification(string_Message)
EndIf
if Caps001 != None
If FPFP_Global_ARReceiver.GetValue() == 1.0 ;Player
Game.GetPlayer().additem(Caps001, int_Object_Given, true)
elseIf FPFP_Global_ARReceiver.GetValue() == 0.0 ;Workshop
Location workshopLocation = FPFP_BabyHandler.WorkshopParent.AddActorToWorkshopPlayerChoice(akActor) ; Assign NPC to workshop
WorkshopScript newWorkshop = FPFP_BabyHandler.WorkshopParent.GetWorkshopFromLocation(workshopLocation) ; Get the workshop
If newWorkshop
newWorkshop.additem(Caps001, int_Object_Given, true)
else
Game.GetPlayer().additem(Caps001, int_Object_Given, true)
endif
endif
endif
StartDelete(akActor)
Game.FadeOutGame(false, true, 0, 1)
else
if FPFP_Global_ARMessageType.GetValue() == 0
Debug.MessageBox("You are not allowed to Exile "+ akActor.GetLeveledActorBase().GetName())
else
Debug.Notification("You are not allowed to Exile "+ akActor.GetLeveledActorBase().GetName())
endif
endif
EndFunction
Function Caged(actor akActor)
form Object_Given
int int_Object_Given
String string_Message
bool Allowed = False
if (FPFP_BabyHandler.AdultAllowed(akActor.GetLeveledActorBase().GetRace())) && (akActor.IsInFaction(FPFP_AdultResource) || akActor.IsInFaction(Game.GetFormFromFile(0x01EA39, "INVB_Wasteland_Zoo.esp") as Faction))
Object_Given = FPFP_BabyHandler.WhatsmyStuff_Caged(akActor.GetLeveledActorBase().GetRace())
int_Object_Given = 1
string_Message = FPFP_BabyHandler.WhatsmyLine_Caged(akActor.GetLeveledActorBase().GetRace())
Allowed = True
elseif FPFP_Global_AllowNONWDF.GetValue() == 1 && (akActor.GetLeveledActorBase() == WorkshopDog || akActor.GetLeveledActorBase() == WorkshopBrahmin)
Object_Given = FPFP_BabyHandler.WhatsmyStuff_Caged(akActor.GetLeveledActorBase().GetRace())
int_Object_Given = 1
string_Message = FPFP_BabyHandler.WhatsmyLine_Caged(akActor.GetLeveledActorBase().GetRace())
Allowed = True
elseif FPFP_Global_AllowSettlers.GetValue() == 1 && akActor.GetLeveledActorBase() == WorkshopNPC
if akActor.GetLeveledActorBase().GetSex() == 0
Object_Given = Pokeball_Settler_Male
elseIf akActor.GetLeveledActorBase().GetSex() == 1
Object_Given = Pokeball_Settler_Female
endif
int_Object_Given = 1
string_Message = "Being Caged has a habit of changing people, so enjoy your looks while they last"
Allowed = True
else
Allowed = False
endif
if (Allowed)
Game.FadeOutGame(true, true, 0, 1, true)
Utility.Wait(1)
;Show the message, if enabled
akActor.Disable() ; Disappear ourselves for smoother transition
if FPFP_Global_ARMessageType.GetValue() == 0
Debug.MessageBox(string_Message)
else
Debug.Notification(string_Message)
endif
if Caps001 != None
If FPFP_Global_ARReceiver.GetValue() == 1.0 ;Player
Game.GetPlayer().additem(Caps001, int_Object_Given, true)
elseIf FPFP_Global_ARReceiver.GetValue() == 0.0 ;Workshop
Location workshopLocation = FPFP_BabyHandler.WorkshopParent.AddActorToWorkshopPlayerChoice(akActor) ; Assign NPC to workshop
WorkshopScript newWorkshop = FPFP_BabyHandler.WorkshopParent.GetWorkshopFromLocation(workshopLocation) ; Get the workshop
If newWorkshop
newWorkshop.additem(Caps001, int_Object_Given, true)
else
Game.GetPlayer().additem(Caps001, int_Object_Given, true)
endif
endif
endif
StartDelete(akActor)
Game.FadeOutGame(false, true, 0, 1)
elseIf akActor.IsInFaction(Game.GetFormFromFile(0x01EA39, "INVB_Wasteland_Zoo.esp") as Faction)
Debug.Notification("INVB_Wasteland_Zoo is not Supported")
else
if FPFP_Global_ARMessageType.GetValue() == 0
Debug.MessageBox("You are not allowed to Cage "+ akActor.GetLeveledActorBase().GetName())
else
Debug.Notification("You are not allowed to Cage "+ akActor.GetLeveledActorBase().GetName())
endif
endif
EndFunction
Function StartDelete(actor akActor)
UnregisterForAllEvents()
If akActor as WorkshopChildScript
(akActor as WorkshopChildScript).UnregisterForAllEvents()
EndIf
If IsBoundGameObjectAvailable()
akActor.Delete()
EndIf
EndFunction
;-- Debug/Logging Functions -------------------------
bool Function InDevelopmentMode() DebugOnly
return False
EndFunction
Function OpenLog() DebugOnly
Debug.OpenUserLog("FPE_AdultResources")
EndFunction
Function DisplayDebugMessage(string asMessage) DebugOnly
LogMessage(asMessage, 0)
If (InDevelopmentMode())
Debug.Notification(asMessage)
EndIf
EndFunction
Function LogMessage(string asMessage, int aiSeverity = 0)
If (InDevelopmentMode())
Debug.Trace(self + ": " + asMessage, aiSeverity)
EndIf
Debug.TraceUser("FPE_AdultResources", self + ": " + asMessage, aiSeverity);
EndFunction
Function LogInfo(string asMessage) DebugOnly
LogMessage(asMessage, 0)
EndFunction
Function LogWarning(string asMessage) DebugOnly
LogMessage(asMessage, 1)
EndFunction
Function LogError(string asMessage) DebugOnly
LogMessage(asMessage, 2)
EndFunction