iets-dev 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/.claude/settings.local.json +59 -0
  2. package/.github/workflows/build.yml +33 -0
  3. package/.github/workflows/npm-publish.yml +24 -0
  4. package/CLAUDE.md +68 -0
  5. package/README.md +21 -0
  6. package/eslint.config.js +34 -0
  7. package/package.json +28 -0
  8. package/pnpm-workspace.yaml +5 -0
  9. package/scripts/barrel-generator.test.ts +155 -0
  10. package/scripts/barrel-generator.ts +207 -0
  11. package/scripts/ensure-iesdp.sh +20 -0
  12. package/scripts/ts-update.sh +15 -0
  13. package/scripts/ts-update.test.ts +136 -0
  14. package/scripts/ts-update.ts +457 -0
  15. package/scripts/utils.ts +32 -0
  16. package/src/CHANGELOG.md +45 -0
  17. package/src/README.md +23 -0
  18. package/src/ambient.d.ts +23 -0
  19. package/src/bg1/index.d.ts +6 -0
  20. package/src/bg2/actions.d.ts +3512 -0
  21. package/src/bg2/align.ids.d.ts +4 -0
  22. package/src/bg2/animate.ids.d.ts +326 -0
  23. package/src/bg2/areaflag.ids.d.ts +4 -0
  24. package/src/bg2/areatype.ids.d.ts +4 -0
  25. package/src/bg2/astyles.ids.d.ts +11 -0
  26. package/src/bg2/class.ids.d.ts +135 -0
  27. package/src/bg2/damages.ids.d.ts +4 -0
  28. package/src/bg2/difflev.ids.d.ts +4 -0
  29. package/src/bg2/dir.ids.ts +23 -0
  30. package/src/bg2/dmgtype.ids.d.ts +4 -0
  31. package/src/bg2/ea.ids.d.ts +5 -0
  32. package/src/bg2/gender.ids.d.ts +4 -0
  33. package/src/bg2/general.ids.d.ts +4 -0
  34. package/src/bg2/gtimes.ids.d.ts +4 -0
  35. package/src/bg2/happy.ids.d.ts +4 -0
  36. package/src/bg2/help.d.ts +42 -0
  37. package/src/bg2/hotkey.ids.d.ts +4 -0
  38. package/src/bg2/index.ts +1809 -0
  39. package/src/bg2/jourtype.ids.d.ts +4 -0
  40. package/src/bg2/kit.ids.d.ts +4 -0
  41. package/src/bg2/mflags.ids.d.ts +4 -0
  42. package/src/bg2/modal.ids.d.ts +14 -0
  43. package/src/bg2/npc.ids.d.ts +4 -0
  44. package/src/bg2/object.d.ts +366 -0
  45. package/src/bg2/object.ts +69 -0
  46. package/src/bg2/race.ids.d.ts +85 -0
  47. package/src/bg2/reaction.ids.d.ts +4 -0
  48. package/src/bg2/scrlev.ids.d.ts +4 -0
  49. package/src/bg2/scroll.ids.d.ts +4 -0
  50. package/src/bg2/seq.ids.d.ts +4 -0
  51. package/src/bg2/shoutids.ids.d.ts +15 -0
  52. package/src/bg2/slots.ids.d.ts +88 -0
  53. package/src/bg2/sndslot.ids.d.ts +4 -0
  54. package/src/bg2/soundoff.ids.d.ts +4 -0
  55. package/src/bg2/specific.ids.d.ts +4 -0
  56. package/src/bg2/spell.ids.d.ts +2008 -0
  57. package/src/bg2/state.ids.d.ts +124 -0
  58. package/src/bg2/stats.ids.d.ts +4 -0
  59. package/src/bg2/time.ids.d.ts +4 -0
  60. package/src/bg2/timeoday.ids.d.ts +4 -0
  61. package/src/bg2/triggers.d.ts +1082 -0
  62. package/src/bg2/weather.ids.d.ts +4 -0
  63. package/src/index.ts +107 -0
  64. package/src/package.json +21 -0
  65. package/src/tsconfig.json +11 -0
  66. package/tsconfig.json +19 -0
@@ -0,0 +1,3512 @@
1
+ import type { Action, AreRef, CreRef, ItmRef, ObjectPtr, Point, Scope, SpellID, SplRef, StrRef } from "../index";
2
+
3
+ import type { Direction } from "./dir.ids";
4
+ import type { Align } from "./align.ids";
5
+ import type { Animate } from "./animate.ids";
6
+ import type { AreaFlag } from "./areaflag.ids";
7
+ import type { AreaTypeID as AreaType } from "./areatype.ids";
8
+ import type { CLASS } from "./class.ids";
9
+ import type { DMGtype } from "./dmgtype.ids";
10
+ import type { EA } from "./ea.ids";
11
+ import type { GenderID as Gender } from "./gender.ids";
12
+ import type { GeneralID as General } from "./general.ids";
13
+ import type { GTimes } from "./gtimes.ids";
14
+ import type { MFlags } from "./mflags.ids";
15
+ import type { JourType } from "./jourtype.ids";
16
+ import type { KitID as Kit } from "./kit.ids";
17
+ import type { RACE } from "./race.ids";
18
+ import type { ScrLev } from "./scrlev.ids";
19
+ import type { Scroll } from "./scroll.ids";
20
+ import type { Seq } from "./seq.ids";
21
+ import type { ShoutID } from "./shoutids.ids";
22
+ import type { Slots } from "./slots.ids";
23
+ import type { SndSlot } from "./sndslot.ids";
24
+ import type { SoundOff } from "./soundoff.ids";
25
+ import type { Specific } from "./specific.ids";
26
+ import type { TimeID as Time } from "./time.ids";
27
+ import type { WeatherID } from "./weather.ids";
28
+
29
+
30
+
31
+ /**
32
+ * This action can be used to do nothing - many characters walk around randomly or stand in one place doing nothing:
33
+
34
+ ```weidu-baf
35
+ IF
36
+ True()
37
+ THEN
38
+ RESPONSE #50
39
+ RandomWalk()
40
+ RESPONSE #50
41
+ NoAction()
42
+ END
43
+ ```
44
+
45
+ `NoAction()` is also commonly used as a hanging (dummy) action in targeting blocks. This is a matter of good practice rather than necessary. The `NoAction()` action will never be run since the block always returns false, but having an action in the scripting block allows scripting programs to accurately check for errors.
46
+
47
+ ```weidu-baf
48
+ IF
49
+ See(NearestEnemyOf(Myself))
50
+ False()
51
+ THEN
52
+ RESPONSE #100
53
+ NoAction()
54
+ END
55
+ ```
56
+ */
57
+ export declare function NoAction(): Action;
58
+
59
+ /**
60
+ * This action can be used to control another creature. A creature referenced as the result of [SetTokenObject()](../actions/bgeeactions.htm#248) is not a valid target for the ActionOverride() action. The following is from the Irenicus cutscene after leaving his abode in chapter 1.
61
+
62
+ ```weidu-baf
63
+ IF
64
+ True()
65
+ THEN
66
+ RESPONSE #100
67
+ CutSceneId(Player1)
68
+ Wait(1)
69
+ FadeToColor([20.0],0)
70
+ Wait(2)
71
+ JumpToPoint([869.340])
72
+ MoveViewPoint([909.346],INSTANT)
73
+ ActionOverride(Player2,JumpToPoint([825.370]))
74
+ ActionOverride(Player3,JumpToPoint([886.384]))
75
+ ActionOverride(Player4,JumpToPoint([952.386]))
76
+ ActionOverride(Player5,JumpToPoint([987.362]))
77
+ ActionOverride(Player6,JumpToPoint([1005.404]))
78
+ Face(10)
79
+ ActionOverride(Player2,Face(10))
80
+ ActionOverride(Player3,Face(10))
81
+ ActionOverride(Player4,Face(8))
82
+ ActionOverride(Player5,Face(6))
83
+ ActionOverride(Player6,Face(6))
84
+ ActionOverride("Anomen",JumpToPoint([909.346]))
85
+ ActionOverride("Anomen",Face(10))
86
+ Wait(1)
87
+ FadeFromColor([20.0],0)
88
+ Wait(2)
89
+ ActionOverride("Anomen",StartDialogueNoSet(Player1))
90
+ END
91
+ ```
92
+ */
93
+ export declare function ActionOverride(actor: ObjectPtr, action: Action): Action;
94
+
95
+ /**
96
+ * This action is used to change the allegiance of the active creature to enemy (making them hostile to the PC). This example script, from a peasant, will turn the creature hostile if it is attacked.
97
+
98
+ ```weidu-baf
99
+ IF
100
+ AttackedBy([GOODCUTOFF],DEFAULT)
101
+ Allegiance(Myself,NEUTRAL)
102
+ THEN
103
+ RESPONSE #100
104
+ Enemy()
105
+ END
106
+ ```
107
+ */
108
+ export declare function Enemy(): Action;
109
+
110
+ /**
111
+ * This action gives the appearance of flying - the active creature is able to pass over impassable areas. The example script is from randfly.bcs.
112
+
113
+ ```weidu-baf
114
+ IF
115
+ True()
116
+ THEN
117
+ RESPONSE #100
118
+ RandomFly()
119
+ END
120
+ ```
121
+ */
122
+ export declare function RandomFly(): Action;
123
+
124
+ /**
125
+ * This action is used internally by action 100 (RandomFly); it moves the active creature towards the given point for the specified amount of time.
126
+ */
127
+ export declare function FlyToPoint(point: Point, time: number): Action;
128
+
129
+ /**
130
+ * This action sets the morale of the active creature.
131
+ */
132
+ export declare function MoraleSet(target: ObjectPtr, morale: number): Action;
133
+
134
+ /**
135
+ * This action alters the morale of the target by the specified amount. The change amount can be positive or negative. The example script is from bardsh.bcs.
136
+
137
+ ```weidu-baf
138
+ IF
139
+ AttackedBy([GOODCUTOFF],DEFAULT)
140
+ Allegiance(Myself,NEUTRAL)
141
+ Global("PlayerAttackedActors","GLOBAL",0)
142
+ THEN
143
+ RESPONSE #100
144
+ SetGlobal("PlayerAttackedActors","GLOBAL",1)
145
+ MoraleInc(Myself,-5)
146
+ Enemy()
147
+ END
148
+ ```
149
+ */
150
+ export declare function MoraleInc(target: ObjectPtr, morale: number): Action;
151
+
152
+ /**
153
+ * This action alters the morale of the target by the specified amount. The change amount can be positive or negative.
154
+ */
155
+ export declare function MoraleDec(target: ObjectPtr, morale: number): Action;
156
+
157
+ /**
158
+ * This action instructs the active creature to attack the specified target for one round.
159
+
160
+ ```weidu-baf
161
+ IF
162
+ See(NearestEnemyOf())
163
+ THEN
164
+ RESPONSE #100
165
+ AttackOneRound(NearestEnemyOf())
166
+ END
167
+ ```
168
+ */
169
+ export declare function AttackOneRound(target: ObjectPtr): Action;
170
+
171
+ /**
172
+ * This action is used to shout the specified number. The action is used in conjunction with the
173
+ {% assign text = "<code>Heard()</code>" -%} {%- assign anchor = "0x002F" -%} {%- include trigger_link.html %}
174
+ trigger. Shouts can be heard within a radius of 1.5x the script runner's current visual range, which by default evaluates to 42 feet (672 pixels).
175
+
176
+ ```weidu-baf
177
+ IF
178
+ StateCheck(Myself,STATE_POISONED)
179
+ THEN
180
+ RESPONSE #100
181
+ Shout(4010)
182
+ END
183
+ ```
184
+
185
+ ```weidu-baf
186
+ IF
187
+ Heard([GOODCUTOFF],4010)
188
+ HaveSpell(CLERIC_SLOW_POISON)
189
+ THEN
190
+ RESPONSE #100
191
+ Spell(LastHeardBy(),CLERIC_SLOW_POISON)
192
+ END
193
+ ```
194
+ */
195
+ export declare function Shout(id: ShoutID): Action;
196
+
197
+ /**
198
+ * This action instructs the active creature to move a certain distance from its current location; i.e. the point is relative to the creatures current location.
199
+ */
200
+ export declare function MoveToOffset(offset: Point): Action;
201
+
202
+ /**
203
+ *
204
+ */
205
+ export declare function EscapeAreaMove(area: AreRef, x: number, y: number, face: Direction): Action;
206
+
207
+ /**
208
+ * This action, in its first form, instructs the active creature to leave the current area, either by walking, or, if the path is blocked, by simply disappearing. In the actions second form the action functions as a combination of EscapeAreaDestroy() and MoveBetweenAreas(). The parameters are similar to MoveBetweenAreas(), in that it takes in all the same information, but unlike MoveBetweenAreas(), the character will search for the nearest enabled travel trigger, move to that, then execute his movement to the specified area. If no travel trigger is found, the creature will just execute the movement.
209
+
210
+ The action is uninterruptable; actions listed this one in a script may not execute as intended.
211
+
212
+ ```weidu-baf
213
+ IF
214
+ HPPercentLT(Myself,35)
215
+ THEN
216
+ RESPONSE #100
217
+ EscapeArea()
218
+ END
219
+ ```
220
+ */
221
+ export declare function EscapeArea(): Action;
222
+
223
+ /**
224
+ * This action alters the specified variable, in the specified scope, by the amount indicated. The amount can be positive or negative. Variables in the local scope cannot be changed with this action.
225
+
226
+ ```weidu-baf
227
+ IF
228
+ See([EVILCUTOFF]
229
+ !Specifics(LastSeenBy(),160)
230
+ !Inparty(LastSeenBy())
231
+ !Allegiance(LastSeenBy([GOODCUTOFF])
232
+ THEN
233
+ RESPONSE #100
234
+ ChangeSpecifics(LastSeenBy(),160)
235
+ IncrementGlobal("KR_MONSTER_COUNTER_ALIVE","GLOBAL",1)
236
+ END
237
+ ```
238
+ */
239
+ export declare function IncrementGlobal(name: string, scope: Scope, value: number): Action;
240
+
241
+ /**
242
+ * This action instructs the active creature to equip the specified item.
243
+
244
+ {% capture note %}
245
+ - Item must be in the creature's inventory for the script action to function.
246
+ - Item's global effects (`timing_mode=2`) are applied to the creature each time the action is performed, and avatar animations are updated to reflect the new item.
247
+ {% endcapture %} {% include info.html %}
248
+ */
249
+ export declare function EquipItem(item: ItmRef): Action;
250
+
251
+ /**
252
+ * This action changes the current area. Parchment is the MOS image to use in the area transition loading screen. Only EE games support IDS symbols for `Face`.
253
+
254
+ ```weidu-baf
255
+ IF
256
+ Global("MissionPackSave","GLOBAL",0)
257
+ THEN
258
+ RESPONSE #100
259
+ TextScreen("toscst")
260
+ ActionOverride(Player1,LeaveAreaLUA("AR1000","",[3048.831],4))
261
+ ActionOverride(Player2,LeaveAreaLUA("AR1000","",[3055.917],4))
262
+ ActionOverride(Player3,LeaveAreaLUA("AR1000","",[2990.913],4))
263
+ ActionOverride(Player4,LeaveAreaLUA("AR1000","",[2992.812],4))
264
+ ActionOverride(Player5,LeaveAreaLUA("AR1000","",[3079.737],4))
265
+ ActionOverride(Player6,LeaveAreaLUA("AR1000","",[3005.742],4))
266
+ END
267
+ ```
268
+ */
269
+ export declare function LeaveAreaLUA(area: AreRef, parchment: string, point: Point, face: Direction): Action;
270
+
271
+ /**
272
+ * This action removes the active creature from the game. No death variable is set. Global creatures like
273
+ joinable NPCs, familiars and recipients of `MakeGlobal` are still accessible by script name and are not
274
+ fully removed. The example script is from the Irenicus cutscene at the beginning of the game.
275
+
276
+ ```weidu-baf
277
+ IF
278
+ True()
279
+ THEN
280
+ RESPONSE #100
281
+ CutSceneId("CSCowl7")
282
+ ForceSpell("CSIren",0)
283
+ Wait(1)
284
+ DestroySelf()
285
+ END
286
+ ```
287
+ */
288
+ export declare function DestroySelf(): Action;
289
+
290
+ /**
291
+ * This action is used by the engine internally. An object id is expected in the in1 parameter.
292
+ */
293
+ export declare function UseContainer(): Action;
294
+
295
+ /**
296
+ *
297
+ */
298
+ export declare function ForceSpellRES(spell: SplRef, target: ObjectPtr): Action;
299
+
300
+ /**
301
+ *
302
+ */
303
+ export declare function ForceSpellRES(spell: SplRef, target: ObjectPtr, castinglevel: number): Action;
304
+
305
+ /**
306
+ * This action causes the active creature to cast the specified spell at the target object. The spell need not currently be memorised by the caster, and will not be interrupted while being cast. The caster must meet the level requirements of the spell. For the RES version of the action, the spell name can not consist of only numbers, should be written in upper case and should be no more than 7 characters long. The example script is from suelfw9.bcs.
307
+
308
+ ```weidu-baf
309
+ IF
310
+ Global("Scene2","AR2800",2)
311
+ See([ENEMY])
312
+ Global("Fight","LOCALS",2)
313
+ THEN
314
+ RESPONSE #100
315
+ IncrementGlobal("Fight","LOCALS",1)
316
+ ForceSpell([ENEMY],WIZARD_POWER_WORD_SLEEP)
317
+ END
318
+ ```
319
+
320
+ {% capture note %}
321
+ - Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
322
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8<sup>th</sup> character isn't valid.
323
+ - If `CastingLevel = 0`, then the action will use Caster Level.
324
+ {% endcapture %} {% include note.html %}
325
+ */
326
+ export declare function ForceSpell(target: ObjectPtr, spell: SpellID): Action;
327
+
328
+ /**
329
+ *
330
+ */
331
+ export declare function ForceSpellPointRES(spell: SplRef, target: Point): Action;
332
+
333
+ /**
334
+ *
335
+ */
336
+ export declare function ForceSpellPointRES(spell: SplRef, target: Point, castinglevel: number): Action;
337
+
338
+ /**
339
+ * This action causes the active creature to cast the specified spell at the specified point ([x.y]). The spell need not currently be memorised by the caster, and will not be interrupted while being cast. The caster must meet the level requirements of the spell. For the RES version of the action, the spell name can not consist of only numbers, should be written in upper case and should be no more than 7 characters long.
340
+
341
+ ```weidu-baf
342
+ IF
343
+ Global("AndrisBehavior","AR1009",0)
344
+ See(NearestEnemyOf(Myself))
345
+ THEN
346
+ RESPONSE #100
347
+ ForceSpellPoint([2002.1554],WIZARD_DIMENSION_DOOR)
348
+ Wait(1)
349
+ SpellNoDec(NearestEnemyOf(Myself),WIZARD_CONFUSION)
350
+ SetGlobal("AndrisBehavior","AR1009",1)
351
+ END
352
+ ```
353
+
354
+ {% capture note %}
355
+ - Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
356
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8<sup>th</sup> character isn't valid.
357
+ - If `CastingLevel = 0`, then the action will use Caster Level.
358
+ {% endcapture %} {% include note.html %}
359
+ */
360
+ export declare function ForceSpellPoint(target: Point, spell: SpellID): Action;
361
+
362
+ /**
363
+ * This action sets a global timer. The timer is checked by the GlobalTimerExpired trigger or GlobalTimerNotExpired trigger.
364
+
365
+ ```weidu-baf
366
+ IF
367
+ GlobalTimerExpired("Areana","GLOBAL")
368
+ !Exists("TorLobo")
369
+ !Dead("TorLobo")
370
+ THEN
371
+ RESPONSE #100
372
+ ActionOverride("Areana",DestroySelf())
373
+ CreateCreature("TORLOB",[349.474],0)
374
+ END
375
+ ```
376
+ */
377
+ export declare function SetGlobalTimer(name: string, scope: Scope, time: GTimes): Action;
378
+
379
+ /**
380
+ * This action takes a single instance of the specified item from the party (unless the item exists in a stack, in which case the entire stack is taken). Characters are checked in current party order. The item is transferred to the inventory of the active creature. If there are multiple calls to TakePartyItem() in the same block, each with the same item specified, only one call will actually remove an item (on each execution of the block). If an item is found in a container on an earlier player and in the inventory of a later player, both item instances may be removed. All slots are checked; inventory slots are checked in the following order
381
+
382
+ ```weidu-baf
383
+ 0, 2, 4, 6, 8, 10, 12, 14
384
+ 1, 3, 5, 7, 9, 11, 13, 15
385
+ ```
386
+
387
+ The example is from AR0516.bcs.
388
+
389
+ ```weidu-baf
390
+ IF
391
+ Global("ThrallOrb","GLOBAL",2)
392
+ PartyHasItem("MISC7Y")
393
+ THEN
394
+ RESPONSE #100
395
+ TakePartyItem("MISC7Y")
396
+ END
397
+ ```
398
+ */
399
+ export declare function TakePartyItem(item: ItmRef): Action;
400
+
401
+ /**
402
+ * This action takes the specified amount of gold from the party. If performed by a party member, the gold is transferred to that characters gold stat (in the CRE file) and re-added to the party pot when the character re-joins the party.
403
+ The example script is from AR0602.bcs.
404
+
405
+ ```weidu-baf
406
+ IF
407
+ Global("TakeImportItems","AR0602",0)
408
+ THEN
409
+ RESPONSE #100
410
+ SetGlobal("TakeImportItems","AR0602",1)
411
+ SetGlobal("Chapter","GLOBAL",1)
412
+ ActionOverride("Malaaq",MoveBetweenAreas("AR0601",[345.591],14))
413
+ ActionOverride("DuegarClanChief",TakeItemListPartyNum("IMPORT01",1))
414
+ ActionOverride("Shelf1",TakeItemListPartyNum("IMPORT03";,1))
415
+ SmallWait(4)
416
+ TakePartyGold(2147483647)
417
+ (cut short for brevity)
418
+ ```
419
+ */
420
+ export declare function TakePartyGold(amount: number): Action;
421
+
422
+ /**
423
+ * This action gives the specified amount of gold to the party. The active creature must have the gold in its "money variable".
424
+
425
+ ```weidu-baf
426
+ IF
427
+ G("KRGIVEGOLD",0)
428
+ THEN
429
+ RESPONSE #100
430
+ GivePartyGold(500)
431
+ SG("KRGIVEGOLD",1)
432
+ END
433
+ ```
434
+ */
435
+ export declare function GivePartyGold(amount: number): Action;
436
+
437
+ /**
438
+ * This action causes the active creature to drop all its inventory items. The example script is from the cutscene with Mazzy fighting the ogre; cut16a.bcs.
439
+
440
+ ```weidu-baf
441
+ IF
442
+ True()
443
+ THEN
444
+ RESPONSE #100
445
+ CutSceneId(Player1)
446
+ FadeToColor([20.0],0)
447
+ Wait(1)
448
+ ActionOverride("mazzy",DropInventory())
449
+ Wait(2)
450
+ (cut short for brevity)
451
+ ```
452
+ */
453
+ export declare function DropInventory(): Action;
454
+
455
+ /**
456
+ * This action starts a cutscene; a cinematic sequence that removes the GUI and player control. The cutscene parameter is the script name to run.
457
+ The second variant can enable condition checking (trigger evaluation, off by default) when the second parameter is set to TRUE.
458
+
459
+ The example script is from cutscene BDCUT17B.bcs and shows how they can be reused. With `StartCutSceneEx("BDCUT17B",TRUE)` it executes
460
+ only one script block depending on the specified conditions. With `StartCutSceneEx("BDCUT17B",FALSE)` it will execute both blocks
461
+ regardless of condition.
462
+
463
+ ```weidu-baf
464
+ IF
465
+ GlobalLT("bd_cut17b_cycle","bd1000",10)
466
+ !NearLocation(Player1,4535,550,30)
467
+ THEN
468
+ RESPONSE #100
469
+ CutSceneId("bdcutid")
470
+ IncrementGlobal("bd_cut17b_cycle","bd1000",1)
471
+ Wait(1)
472
+ StartCutSceneEx("bdcut17b",TRUE)
473
+ END
474
+
475
+ IF
476
+ OR(2)
477
+ GlobalGT("bd_cut17b_cycle","bd1000",9)
478
+ NearLocation(Player1,4535,550,30)
479
+ THEN
480
+ RESPONSE #100
481
+ CutSceneId("bdcutid")
482
+ SmallWait(10)
483
+ SetCutSceneBreakable(FALSE)
484
+ SetGlobal("BD_CUTSCENE_BREAKABLE","GLOBAL",0)
485
+ SetAreaScript("",OVERRIDE)
486
+ SmallWait(5)
487
+ SetGlobalTimer("bd_mdd016b_timer","bd1000",TWO_ROUNDS)
488
+ ActionOverride("bdcaelar",StartDialogNoSet(Player1))
489
+ END
490
+ ```
491
+ */
492
+ export declare function StartCutScene(cutscene: string): Action;
493
+
494
+ /**
495
+ * This action starts a cutscene. Player control is removed, and scripts stop running. Note that actions already in the action list are not cleared without an explicit call to ClearAllActions. The example script is from are0507.bcs.
496
+
497
+ ```weidu-baf
498
+ IF
499
+ Global("AmsiHouse","GLOBAL",3)
500
+ !Dead("amsi")
501
+ THEN
502
+ RESPONSE #100
503
+ ClearAllActions()
504
+ StartCutSceneMode()
505
+ ActionOverride("amsi",StartDialogueNoSet(Player1))
506
+ END
507
+ ```
508
+ */
509
+ export declare function StartCutSceneMode(): Action;
510
+
511
+ /**
512
+ * This action ends a cutscene, and restores the GUI and player control. The example script is from ar0800.bcs.
513
+
514
+ ```weidu-baf
515
+ IF
516
+ GlobalGT("BodhiJob","GLOBAL",0)
517
+ Global("Movie02","GLOBAL",0)
518
+ THEN
519
+ RESPONSE #100
520
+ ClearAllActions()
521
+ SetGlobal("Movie02","GLOBAL",1)
522
+ StartCutSceneMode()
523
+ FadeToColor([30.0],0)
524
+ Wait(2)
525
+ EndCutSceneMode()
526
+ TextScreen("SCENE04")
527
+ SmallWait(1)
528
+ StartCutSceneMode()
529
+ StartCutScene("Movie02a")
530
+ END
531
+ ```
532
+ */
533
+ export declare function EndCutSceneMode(): Action;
534
+
535
+ /**
536
+ * This action clears any queued actions for all creatures in the area. The example script is from ar0507.bcs.
537
+
538
+ ```weidu-baf
539
+ IF
540
+ Global("AmsiHouse","GLOBAL",3)
541
+ !Dead("amsi")
542
+ THEN
543
+ RESPONSE #100
544
+ ClearAllActions()
545
+ StartCutSceneMode()
546
+ ActionOverride("amsi",StartDialogueNoSet(Player1))
547
+ END
548
+ ```
549
+ */
550
+ export declare function ClearAllActions(): Action;
551
+
552
+ /**
553
+ * This action deactivates the target creature. The creature remains in the area, but is removed from play - i.e. it is invisible and cannot be interacted with.
554
+ */
555
+ export declare function Deactivate(object: ObjectPtr): Action;
556
+
557
+ /**
558
+ * This action activates the target creature. The creature is returned to play - i.e. it is visible and can be interacted with.
559
+ */
560
+ export declare function Activate(object: ObjectPtr): Action;
561
+
562
+ /**
563
+ * This action is used internally in a cutscene to make the object with the specified death variable perform actions. The action appears to only work from a creature script. The example script is from cut01.bcs.
564
+
565
+ ```weidu-baf
566
+ IF
567
+ True()
568
+ THEN
569
+ RESPONSE #100
570
+ CutSceneId(Player1)
571
+ LeaveAreaLUAPanic("AR0700","",[2753.868],4)
572
+ LeaveAreaLUA("AR0700","",[2753.868],4)
573
+ (cut short for brevity)
574
+ ```
575
+ */
576
+ export declare function CutSceneId(object: ObjectPtr): Action;
577
+
578
+ /**
579
+ * This action is likely called directly by the engine, and is used to give ankegs give the appearance of emerging from the ground. Calling the action from script has no effect.
580
+ */
581
+ export declare function AnkhegEmerge(): Action;
582
+
583
+ /**
584
+ * This action is likely called directly by the engine, and is used to give ankegs give the appearance of burrowing into the ground. Calling the action from script has no effect.
585
+ */
586
+ export declare function AnkhegHide(): Action;
587
+
588
+ /**
589
+ * This action instructs the active creature to enter Detect Traps modal state. This action can be used for any creature (not just thieves) though success in detecting traps is dependent on points in the Find Traps skill.
590
+
591
+ ```weidu-baf
592
+ IF
593
+ ActionListEmpty()
594
+ !Exists([EVILCUTOFF])
595
+ !ModalState( Myself,DETECTTRAPS)
596
+ OR(2)
597
+ !StateCheck(Myself,STATE_INVISIBLE)
598
+ !StateChe ck(Myself,STATE_IMPROVEDINVISIBILITY)
599
+ THEN
600
+ RESPONSE #100
601
+ FindTraps()
602
+ END
603
+ ```
604
+ */
605
+ export declare function FindTraps(): Action;
606
+
607
+ /**
608
+ * This action causes the active creature to turn in a random direction. The example script is from waitturn.bcs.
609
+
610
+ ```weidu-baf
611
+ IF
612
+ True()
613
+ THEN
614
+ RESPONSE #100
615
+ RandomTurn()
616
+ END
617
+ ```
618
+
619
+ {% capture note %}
620
+ * This action will never stop, (unless interrupted in specific situations), and thus never leave the action list.
621
+ * Executes [Wait()](#63) for a random amount of time, (1–40 seconds), if the creature goes off-screen.
622
+ * Waits 1–10 seconds between each evaluation.
623
+
624
+ {% endcapture %} {% include note.html %}
625
+ */
626
+ export declare function RandomTurn(): Action;
627
+
628
+ /**
629
+ * This action causes the target creature to die, dropping any droppable items they are carrying.
630
+
631
+ ```weidu-baf
632
+ IF
633
+ Global("KillArntra04","AR0307",1)
634
+ THEN
635
+ RESPONSE #100
636
+ SetGlobal("KillArntra04","AR0307",2)
637
+ ActionOverride("arntra04",Face(10))
638
+ Wait(1)
639
+ ForceSpell("arntra04",CLERIC_FLAME_STRIKE)
640
+ Wait(1)
641
+ Kill("arntra04")
642
+ CreateCreature("Arntra05",[3213.485],0)
643
+ END
644
+ ```
645
+ */
646
+ export declare function Kill(object: ObjectPtr): Action;
647
+
648
+ /**
649
+ * This action plays a sound linked to the object.
650
+
651
+ ```weidu-baf
652
+ IF
653
+ Delay(2)
654
+ HPPercentLT(Myself,35)
655
+ THEN
656
+ RESPONSE #95
657
+ Shout(HURT)
658
+ Continue()
659
+ RESPONSE #5
660
+ VerbalConstant(Myself,HURT)
661
+ Shout(HURT)
662
+ Continue()
663
+ END
664
+ ```
665
+ */
666
+ export declare function VerbalConstant(object: ObjectPtr, constant: SoundOff): Action;
667
+
668
+ /**
669
+ * This action clears the action list of the specified object (including ModalActions). The example script is from ar2400.bcs.
670
+
671
+ ```weidu-baf
672
+ IF
673
+ GlobalTimerExpired("udWaitOgreDoor","GLOBAL")
674
+ Global("HaveOgreOpenDoor","AR2400",0)
675
+ Global("udGithDead","AR2400",0)
676
+ !Global("udMind","GLOBAL",30)
677
+ THEN
678
+ RESPONSE #100
679
+ SetInterrupt(FALSE)
680
+ SetGlobal("HaveOgreOpenDoor","AR2400",1)
681
+ ClearActions(Player1)
682
+ ClearActions(Player2)
683
+ ClearActions(Player3)
684
+ ClearActions(Player4)
685
+ ClearActions(Player5)
686
+ ClearActions(Player6)
687
+ SetInterrupt(TRUE)
688
+ StartCutSceneMode()
689
+ StartCutScene("Cut44i")
690
+ END
691
+ ```
692
+ */
693
+ export declare function ClearActions(object: ObjectPtr): Action;
694
+
695
+ /**
696
+ * This action instructs the active creature to attack the target for the specified time (ReevaluationPeriod) which is measured in AI updates (which default to 15 per second).The script will then run again, checking for other true conditions.
697
+
698
+ ```weidu-baf
699
+ IF
700
+ See([EVILCUTOFF])
701
+ Range(LastSeenBy(),4)
702
+ !InParty(LastSeenBy())
703
+ !Allegiance(LastSeenBy(Myself),GOODCUTOFF)
704
+ !Class(LastSeenBy(Myself),INNOCENT)
705
+ InWeaponRange(LastSeenBy())
706
+ HasWeaponEquiped()
707
+ THEN
708
+ RESPONSE #100
709
+ AttackReevaluate(LastSeenBy(),30)
710
+ END
711
+ ```
712
+ */
713
+ export declare function AttackReevaluate(target: ObjectPtr, reevaluationperiod: number): Action;
714
+
715
+ /**
716
+ * This action locks the screen on the active creature, preventing the screen from being scrolled away. The action only works when executed by a creature (its own script or via `ActionOverride`).
717
+
718
+ ```weidu-baf
719
+ IF
720
+ CombatCounter(0)
721
+ THEN
722
+ RESPONSE #100
723
+ LockScroll()
724
+ END
725
+ ```
726
+ */
727
+ export declare function LockScroll(): Action;
728
+
729
+ /**
730
+ * This action unlocks the screen if it has been locked.
731
+
732
+ ```weidu-baf
733
+ IF
734
+ OR(2)
735
+ HotKey(H)
736
+ !CombatCounter(0)
737
+ THEN
738
+ RESPONSE #100
739
+ UnlockScroll()
740
+ END
741
+ ```
742
+ */
743
+ export declare function UnlockScroll(): Action;
744
+
745
+ /**
746
+ *
747
+ */
748
+ export declare function StartDialogue(dialogfile: string, target: ObjectPtr): Action;
749
+
750
+ /**
751
+ * This action instructs the active creature to start the specified dialog with the specified target. The dialog can be initiated from a distance and must have at least one state with all its top level conditions true else it will not initiate. The active creature has its dialog file permanently set to the file specified by the DialogFile parameter.
752
+
753
+ ```weidu-baf
754
+ IF
755
+ See([PC])
756
+ NumTimesTalkedTo(0)
757
+ THEN
758
+ RESPONSE #100
759
+ StartDialog("andris",[PC])
760
+ END
761
+ ```
762
+ */
763
+ export declare function StartDialog(dialogfile: string, target: ObjectPtr): Action;
764
+
765
+ /**
766
+ *
767
+ */
768
+ export declare function SetDialogue(dialogfile: string): Action;
769
+
770
+ /**
771
+ * This action sets the dialog file of the active creature to the specified file. SetDialogue("") will set the dialog file to nothing.
772
+
773
+ ```weidu-baf
774
+ IF
775
+ AttackedBy([GOODCUTOFF],DEFAULT)
776
+ Global("KR_CHANGE_DIALOG","LOCALS",0)
777
+ THEN
778
+ RESPONSE #100
779
+ SetDialogue("")
780
+ SetGlobal("KR_CHANGE_DIALOG","LOCALS",1)
781
+ END
782
+ ```
783
+ */
784
+ export declare function SetDialog(dialogfile: string): Action;
785
+
786
+ /**
787
+ *
788
+ */
789
+ export declare function PlayerDialogue(target: ObjectPtr): Action;
790
+
791
+ /**
792
+ * This action instructs the active creature to start a dialog with the target creature, from any distance. If the target is invalid, no action will be taken.
793
+ */
794
+ export declare function PlayerDialog(target: ObjectPtr): Action;
795
+
796
+ /**
797
+ * This action creates the item specified by the resref parameter on the creature specified by the object parameter, with quantity/charges controlled by the usage parameters.
798
+
799
+ ```weidu-baf
800
+ IF
801
+ GlobalTimerExpired("dwVith","GLOBAL")
802
+ Global("dwVithal","GLOBAL",3)
803
+ THEN
804
+ RESPONSE #100
805
+ CreateVisualEffectObject("SPPLANAR","udvith")
806
+ Wait(2)
807
+ Activate("udvith")
808
+ GiveItemCreate("scrl8z","udvith",1,1,0)
809
+ GiveItemCreate("scrl9g","udvith",1,1,0)
810
+ GiveItemCreate("scrl9e","udvith",1,1,0)
811
+ GiveItemCreate("scrl9v","udvith",1,1,0)
812
+ GiveItemCreate("scrl9r","udvith",1,1,0)
813
+ SetGlobal("dwVithal","GLOBAL",4)
814
+ END
815
+ ```
816
+ */
817
+ export declare function GiveItemCreate(item: ItmRef, object: ObjectPtr, usage1: number, usage2: number, usage3: number): Action;
818
+
819
+ /**
820
+ * This action gives the party a sum of gold corresponding to the given global variable. The gold amount is deducted from the active creature. The example script will give the party 50gp.
821
+ ```weidu-baf
822
+ IF
823
+ Global("Cash","GLOBAL",50)
824
+ THEN
825
+ RESPONSE #100
826
+ GivePartyGoldGlobal("Cash","GLOBAL")
827
+ END
828
+ ```
829
+ */
830
+ export declare function GivePartyGoldGlobal(name: string, scope: Scope): Action;
831
+
832
+ /**
833
+ * This action is used by the engine internally. An object id is expected in the in1 parameter.
834
+ */
835
+ export declare function UseDoor(): Action;
836
+
837
+ /**
838
+ * This action will open the specified door. If the door is locked the creature must possess the correct key. Some doors central to the plot doors cannot be opened. The active creature can stick on this action if it fails.
839
+
840
+ ```weidu-baf
841
+ IF
842
+ See("Door01"
843
+ OpenState("Door01",FALSE)
844
+ !See([GOODCUTOFF])
845
+ !TargetUnreachable("Door01")
846
+ THEN
847
+ RESPONSE #100
848
+ MoveToObjectNoInterrupt("Door01")
849
+ Unlock("Door01" )
850
+ OpenDoor("Door01")
851
+ END
852
+ ```
853
+ */
854
+ export declare function OpenDoor(object: ObjectPtr): Action;
855
+
856
+ /**
857
+ * This action closes the specified door. The example script is from ar0300.bcs.
858
+
859
+ ```weidu-baf
860
+ IF
861
+ OR(2)
862
+ Global("LyrosJob","GLOBAL",3)
863
+ Dead("lyros")
864
+ Exists("Rylock")
865
+ Global("RylockLeavesHarperDoor","AR0300",0)
866
+ THEN
867
+ RESPONSE #100
868
+ SetGlobal("RylockLeavesHarperDoor","AR0300",1)
869
+ CloseDoor("DOOR0308")
870
+ Lock("DOOR0308")
871
+ ActionOverride("Rylock",EscapeArea())
872
+ END
873
+ ```
874
+ */
875
+ export declare function CloseDoor(object: ObjectPtr): Action;
876
+
877
+ /**
878
+ * This action instructs the active <a href="../../file_formats/ie_formats/cre_v1.htm">creature</a> to attempt to pick the lock of the specified object. This action can be used for any creature (not just thieves) though success in picking the lock depends on points in the <code><a href="../../file_formats/ie_formats/cre_v1.htm#CREV1_0_Header_0x67">Open Locks</a></code> skill.
879
+ */
880
+ export declare function PickLock(object: ObjectPtr): Action;
881
+
882
+ /**
883
+ * This action causes the active creature to change animation to the specified animation (values from [animate.ids]({{ ids }}/animate.htm))
884
+
885
+ ```weidu-baf
886
+ IF
887
+ !InPartyAllowDead("Aerie")
888
+ !Dead("Aerie")
889
+ !GlobalGT("AerieTransform","GLOBAL",0)
890
+ Global("Aerie","AR0607",0)
891
+ Global("KalahI","AR0607",0)
892
+ THEN
893
+ RESPONSE #100
894
+ MoveGlobal("Ar0607","Aerie",[318.378])
895
+ ChangeEnemyAlly("Aerie",NEUTRAL)
896
+ SetGlobal("Aerie","AR0607",1)
897
+ ActionOverride("Aerie",Polymorph(MAGE_FEMALE_ELF))
898
+ ActionOverride("Aerie",SetBeenInPartyFlags())
899
+ SetGlobal("AerieTransform","GLOBAL",2)
900
+ END
901
+ ```
902
+ */
903
+ export declare function Polymorph(animationtype: Animate): Action;
904
+
905
+ /**
906
+ *
907
+ */
908
+ export declare function RemoveSpellRES(spell: SplRef): Action;
909
+
910
+ /**
911
+ * This action removes one memorised indtance of the specified spell from the spellbook of the active creature. The spell can be an innate ability, a priest spell or a wizard spell, but must be listed in [spell.ids]({{ ids }}/spell.htm).
912
+
913
+ ```weidu-baf
914
+ IF
915
+ Global("KR_ANTI_PALADIN_CHANGE","LOCALS",1)
916
+ THEN
917
+ RESPONSE #100
918
+ RemoveSpell(PALADIN_LAY_ON_HANDS)
919
+ RemoveSpell(PALADIN_DETECT_EVIL)
920
+ RemoveSpell(PALADIN_PROTECTION_FROM_EVIL)
921
+ SetGlobal("KR_ANTI_PALADIN_CHANGE","LOCALS",2)
922
+ END
923
+ ```
924
+
925
+ {% capture note %}
926
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
927
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8<sup>th</sup> character isn't valid.
928
+ {% endcapture %} {% include note.html %}
929
+ */
930
+ export declare function RemoveSpell(spell: SpellID): Action;
931
+
932
+ /**
933
+ * This action is miscoded in the default action.ids file (the number 0 should be the capital letter O). When corrected, this action causes the active creature to attempt to bash the specified door.
934
+ */
935
+ export declare function BashDoor(object: ObjectPtr): Action;
936
+
937
+ /**
938
+ * This action instructs the active creature to equip the most damaging melee weapon from those available in the quickslots. Damage is calculated on the THAC0 bonus and damage - special bonuses versus creature types and elemental damages are not checked.
939
+
940
+ ```weidu-baf
941
+ IF
942
+ See([EVILCUTOFF])
943
+ THEN
944
+ RESPONSE #100
945
+ EquipMostDamagingMelee()
946
+ Attack([EVILCUTOFF])
947
+ END
948
+ ```
949
+ */
950
+ export declare function EquipMostDamagingMelee(): Action;
951
+
952
+ /**
953
+ * This action instructs the active creature to give the specified item (parameter 1) to the specified target (parameter 2). The active creature must possess the item to pass it (holding it within a container within the inventory is fine). The sample script makes uses of modified IDS files (action, instant, trigger and svtiobj) though such modification are not necessary to use the GiveItem action itself.
954
+
955
+ ```weidu-baf
956
+ IF
957
+ HPPercentLT(Myself,40)
958
+ !HasItem("potn52",Myself)
959
+ THEN
960
+ RESPONSE #100
961
+ GlobalShout(3015)
962
+ SetGlobal("KRNEEDITEM","GLOBAL",1)
963
+ END
964
+
965
+ IF
966
+ Heard([GOODCUTOFF],3015)
967
+ HasItem("potn52",Myself)
968
+ HPPercentGT(Myself,40)
969
+ Global("KRNEEDITEM","GLOBAL",1)
970
+ THEN
971
+ RESPONSE #100
972
+ MoveToObject(LastHeardBy())
973
+ GiveItem("potn52",LastHeardBy())
974
+ SetGlobal("KRNEEDITEM","GLOBAL",0)
975
+ END
976
+ ```
977
+ */
978
+ export declare function GiveItem(item: ItmRef, target: ObjectPtr): Action;
979
+
980
+ /**
981
+ * This action starts the specified store with the specified object.
982
+
983
+ ```weidu-baf
984
+ IF
985
+ Global("KRSTART_STORE","LOCALS",1)
986
+ THEN
987
+ RESPONSE #100
988
+ StartStore("Tem4802",LastTalkedToBy())
989
+ END
990
+ ```
991
+ */
992
+ export declare function StartStore(store: string, target: ObjectPtr): Action;
993
+
994
+ /**
995
+ * This action displays the strref specified by the StrRef parameter in the message window, attributing the text to the specified object.
996
+
997
+ ```weidu-baf
998
+ IF
999
+ HasItem("potn52",Myself)
1000
+ HPPercentLT((),50)
1001
+ THEN
1002
+ RESPONSE #100
1003
+ UseItem("potn52",Myself)
1004
+ DisplayString(Myself,46150)
1005
+ END
1006
+ ```
1007
+ */
1008
+ export declare function DisplayString(object: ObjectPtr, string: StrRef): Action;
1009
+
1010
+ /**
1011
+ * This action changes the IDS identifiers for the active creature to the values specified. The object parameter must be in the IDS object form (i.e [EA.GENERAL.RACE.CLASS.SPECIFIC.GENDER.ALIGN]). If parameters are missing, they will default to 0. If a symbolic object is passed, all identifiers will be cleared and the IDS identifier bytes will be filled. ChangeAIType(NearestEnemyOf(LastSeenBy(LastTalkedToBy(LastTrigger())))) would zero Allegiance, General, Race, Class, Specific, Gender, and Alignment, set spec 1 to "Myself" (the [object.ids]({{ ids }}/object.htm) value, 1), 2 to LastTrigger, 3 to LastTalkedToBy, 4 to LastSeenBy, and 5 to NearestEnemyOf.
1012
+ */
1013
+ export declare function ChangeAIType(object: ObjectPtr): Action;
1014
+
1015
+ /**
1016
+ * This action changes the EA status of the target creature to the specified value. Values are from [ea.ids]({{ ids }}/ea.htm).
1017
+
1018
+ ```weidu-baf
1019
+ IF
1020
+ Global"KR_ENEMYALLY_CHANGE","LOCALS",0)
1021
+ THEN
1022
+ RESPONSE #100
1023
+ SetGlobal"KR_ENEMYALLY_CHANGE","LOCALS",1)
1024
+ ChangeEnemyAlly(Myself,NEUTRAL)
1025
+ END
1026
+ ```
1027
+ */
1028
+ export declare function ChangeEnemyAlly(object: ObjectPtr, value: EA): Action;
1029
+
1030
+ /**
1031
+ * This action changes the general status of the target creature to the specified value. Values are from [general.ids]({{ ids }}/general.htm).
1032
+
1033
+ ```weidu-baf
1034
+ IF
1035
+ Global"KR_GENERAL_CHANGE","LOCALS" ,0)
1036
+ THEN
1037
+ RESPONSE #100
1038
+ SetGlobal"KR_GENERAL_CHANGE","LOCALS",1)
1039
+ ChangeGeneral(Myself,UNDEAD)
1040
+ END
1041
+ ```
1042
+ */
1043
+ export declare function ChangeGeneral(object: ObjectPtr, value: General): Action;
1044
+
1045
+ /**
1046
+ * This action changes the race of the target creature to the specified value. Values are from [race.ids]({{ ids }}/race.htm).
1047
+
1048
+ ```weidu-baf
1049
+ IF
1050
+ Global"KR_RACE_CHANGE","LOCALS",0)
1051
+ THEN
1052
+ RESPONSE #100
1053
+ SetGlobal"KR_RACE_CHANGE","LOCALS",1)
1054
+ ChangeRace(Myself,DRAGON)
1055
+ END
1056
+ ```
1057
+ */
1058
+ export declare function ChangeRace(object: ObjectPtr, value: RACE): Action;
1059
+
1060
+ /**
1061
+ * This action changes the class of the target creature to the specified value. Values are from [class.ids]({{ ids }}/class.htm).
1062
+
1063
+ ```weidu-baf
1064
+ IF
1065
+ Global"KR_CLASS_CHANGE","LOCALS",0)
1066
+ THEN
1067
+ RESPONSE #100
1068
+ SetGlobal"KR_CLASS_CHANGE","LOCALS",1)
1069
+ ChangeClass(Myself,FIGHTER)
1070
+ END
1071
+ ```
1072
+ */
1073
+ export declare function ChangeClass(object: ObjectPtr, value: CLASS): Action;
1074
+
1075
+ /**
1076
+ * This action changes the specific status of the target creature to the specified value. Values are from [specific.ids]({{ ids }}/specific.htm). The action produces inconsistent results when used on player characters in multiplayer games. The specific value is represented by one byte, and so is limited to values 0-255. The example script assigns a script to a newly created simulacrum.
1077
+
1078
+ ```weidu-baf
1079
+ IF
1080
+ See([ALLY])
1081
+ !InParty(LastSeenBy(Myself))
1082
+ !Gender(LastSeenBy(Myself),SUMMONED)
1083
+ !General(LastSeenBy(Myself),ANIMAL)
1084
+ !General(LastSeenBy(Myself),MONSTER)
1085
+ !General(LastSeenBy(Myself),UNDEAD)
1086
+ !General(LastSeenBy (Myself),GIANTHUMANOID)
1087
+ !Race(LastSeenBy(Myself),ELEMENTAL)
1088
+ !Race(LastSeenBy(Myself),MEPHIT)
1089
+ !Race(LastSeenBy(Myself),IMP)
1090
+ !HasItem("IMOENHP1&q uot;,LastSeenBy(Myself))
1091
+ !HasItem("MINHP1",LastSeenBy(Myself))
1092
+ !Specifics(LastSeenBy(Myself),100)
1093
+ THEN
1094
+ RESPONSE #100
1095
+ DisplayStringHead(LastSeenBy(Myself),26234) // 'Simulacrum'
1096
+ ActionOverride(LastSeenBy(Myself), ChangeAIScript("gbSim&quot;,DEFAULT))
1097
+ ChangeSpecifics(LastSeenBy(Myself),100)
1098
+ END
1099
+ ```
1100
+ */
1101
+ export declare function ChangeSpecifics(object: ObjectPtr, value: Specific): Action;
1102
+
1103
+ /**
1104
+ * This action changes the gender of the target creature to the specified value. Values are from [gender.ids]({{ ids }}/gender.htm). The example script changes the gender of summoned creatures to neither, to bypass the 5 concurrent summoned creatures limit.
1105
+
1106
+ ```weidu-baf
1107
+ IF
1108
+ See([ALLY])
1109
+ !InParty(LastSeenBy(Myself))
1110
+ Gender(LastS eenBy(Myself),SUMMONED)
1111
+ !Specifics(LastSeenBy(Myself),3001)
1112
+ THEN
1113
+ RESPONSE #100
1114
+ ChangeGender(LastSeenBy(),NEITHER)
1115
+ ChangeSpecifics(LastSeenBy(Myself), 3001)
1116
+ END
1117
+ ```
1118
+ */
1119
+ export declare function ChangeGender(object: ObjectPtr, value: Gender): Action;
1120
+
1121
+ /**
1122
+ * This action changes the alignment of the target creature to the specified value. Values are from [align.ids]({{ ids }}/align.htm).
1123
+
1124
+ ```weidu-baf
1125
+ IF
1126
+ Global("KR_ALIGN_CHANGE","LOCALS",0)
1127
+ THEN
1128
+ RESPONSE #100
1129
+ SetGlobal("KR_ALIGN_CHANGE","LOCALS",1)
1130
+ ChangeAlignment(LastSeenBy(Myself),CHAOTIC_GOOD)
1131
+ END
1132
+ ```
1133
+ */
1134
+ export declare function ChangeAlignment(object: ObjectPtr, value: Align): Action;
1135
+
1136
+ /**
1137
+ * This action is used in conjunction with the ReceivedOrder trigger, and works in a similar way to a global shout. The action passes a numeric order to the specified creature. Only one creature at a time responds to an order, and creatures to not detect their own orders.
1138
+
1139
+ ```weidu-baf
1140
+ IF
1141
+ See([EVILCUTOFF])
1142
+ OR(3)
1143
+ Class(Myself,FIGHTER_ALL)
1144
+ Class(Myself,RANGER_ALL)
1145
+ Class(Myse lf,PALADIN_ALL)
1146
+ THEN
1147
+ RESPONSE #100
1148
+ GiveOrder([PC.0.0.THIEF_ALL],100)
1149
+ END
1150
+
1151
+ IF
1152
+ ReceivedOrder(Myself,100)
1153
+ Class(Myself,THIEF_ALL)
1154
+ THEN
1155
+ RESPONSE #100
1156
+ RunAwayFrom([EVILCUTOFF],120)
1157
+ Hide()
1158
+ END
1159
+ ```
1160
+ */
1161
+ export declare function GiveOrder(object: ObjectPtr, order: number): Action;
1162
+
1163
+ /**
1164
+ *
1165
+ */
1166
+ export declare function ApplySpellRES(spell: SplRef, target: ObjectPtr): Action;
1167
+
1168
+ /**
1169
+ * This action causes the active creature to cast the specified spell at the target object. The spell is applied instantly; no casting animation is played. The spell cannot be interrupted. For the RES version of the action, the spell name can not consist of only numbers, should be written in upper case and should be no more than 7 characters long. Both actions apply the spell at the lowest casting level (they will even use a level `0` ability if the spell has one, which other actions cannot do) and ignore its projectile (i.e. they use projectile `#1|None`) - the casting level of the originating creature is ignored. Note that for normal spellcasting the probability dice values for effects are rolled for each spell, whereas spells applied in the same scripting block by `ApplySpell` use a single dice value. The example script is used to mimic a contingency from `"mage18y.bcs"`.
1170
+
1171
+ ```weidu-baf
1172
+ IF
1173
+ See(NearestEnemyOf(Myself))
1174
+ Global("Prep","LOCALS",0)
1175
+ THEN
1176
+ RESPONSE #100
1177
+ ApplySpell(Myself,WIZARD_STONE_SKIN)
1178
+ ApplySpell(Myself,WIZARD_SPELL_TRAP)
1179
+ ApplySpell(Myself,WIZARD_MIRROR_IMAGE)
1180
+ ApplySpell(Myself,WIZARD_SPELL_TURNING)
1181
+ ApplySpell(Myself,WIZARD_PROTECTION_FROM_MAGIC_WEAPONS)
1182
+ ApplySpell(SixthNearestEnemyOf(Myself),WIZARD_MONSTER_SUMMONING_4)
1183
+ SetGlobal("Prep","LOCALS",1)
1184
+ END
1185
+ ```
1186
+
1187
+ {% capture note %}
1188
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
1189
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8<sup>th</sup> character isn't valid.
1190
+ {% endcapture %} {% include note.html %}
1191
+ */
1192
+ export declare function ApplySpell(target: ObjectPtr, spell: SpellID): Action;
1193
+
1194
+ /**
1195
+ * This action is used to increment the chapter, and display a text screen (specified by the resref parameter - a 2DA file). The example script is from ar1803.bcs.
1196
+
1197
+ ```weidu-baf
1198
+ IF
1199
+ Dead("Davaeorn")
1200
+ Global("Chapter","GLOBAL",4)
1201
+ THEN
1202
+ RESPONSE #100
1203
+ RevealAreaOnMap("AR0900")
1204
+ IncrementChapter("Chptxt5")
1205
+ AddJournalEntry(15839,USER)
1206
+ END
1207
+ ```
1208
+ */
1209
+ export declare function IncrementChapter(resref: string): Action;
1210
+
1211
+ /**
1212
+ * This action sets the reputation to the specified value.
1213
+ ```weidu-baf
1214
+ IF
1215
+ Global("KRGOODDEED","GLOBAL",0)
1216
+ THEN
1217
+ RESPONSE #100
1218
+ ReputationSet(20)
1219
+ SG("KRGOODDEED",1)
1220
+ END
1221
+ ```
1222
+ */
1223
+ export declare function ReputationSet(reputation: number): Action;
1224
+
1225
+ /**
1226
+ * This action alters the reputation by the specified value (which can be either negative or positive). The example script is from baldur.bcs.
1227
+
1228
+ ```weidu-baf
1229
+ IF
1230
+ InParty("Viconia")
1231
+ Global("ViconiaJoinedParty","GLOBAL",0)
1232
+ THEN
1233
+ RESPONSE #100
1234
+ ReputationInc(-2)
1235
+ SetGlobal("ViconiaJoinedParty","GLOBAL",1)
1236
+ END
1237
+ ```
1238
+ */
1239
+ export declare function ReputationInc(reputation: number): Action;
1240
+
1241
+ /**
1242
+ * This action gives (or takes if negative) the specified amount of experience to the party. The XP amount is distributed among all current living party members. The example script is from ar1300.bcs.
1243
+ ```weidu-baf
1244
+ IF
1245
+ OpenState("Bridge01",TRUE)
1246
+ Global("BridgeOpen","GLOBAL",0)
1247
+ !Dead("Torgal")
1248
+ THEN
1249
+ RESPONSE #100
1250
+ SetGlobal("BridgeOpen","GLOBAL",1)
1251
+ DisplayString(Myself,'The drawbridge has been lowered.')
1252
+ CreateCreature("KPCAPT03",[2400.1592],6)
1253
+ CreateCreature("KPSOLD03",[2425.1676],6)
1254
+ CreateCreature("KPSOLD04",[2371.1754],6)
1255
+ CreateCreature("KPSOLD05",[2315.1805],6)
1256
+ CreateCreature("TROLGI01",[2391.1592],0)
1257
+ CreateCreature("TROLGI02",[2282.1742],0)
1258
+ CreateCreature("KPYUAN01",[2251.1731],0)
1259
+ AddexperienceParty(29750)
1260
+ (cut short for brevity)
1261
+ ```
1262
+ */
1263
+ export declare function AddExperienceParty(xp: number): Action;
1264
+
1265
+ /**
1266
+ * This action adds experience to the party, with the amount corresponding to a global variable.
1267
+
1268
+ ```weidu-baf
1269
+ IF
1270
+ Global("MyXP","GLOBAL",0)
1271
+ THEN
1272
+ RESPONSE #100
1273
+ SetGlobal("MyXP","GLOBAL",50)
1274
+ AddExperiencePartyGlobal("MyXP","GLOBAL")
1275
+ END
1276
+ ```
1277
+ */
1278
+ export declare function AddExperiencePartyGlobal(name: string, scope: Scope): Action;
1279
+
1280
+ /**
1281
+ * This action sets the number of times the active creature has been talked to (by player characters). The example script is from ar0103.bcs.
1282
+
1283
+ ```weidu-baf
1284
+ IF
1285
+ Global("BrielbaraMove","GLOBAL",1)
1286
+ !Exists("Brielbara")
1287
+ !Dead("Brielbara")
1288
+ THEN
1289
+ RESPONSE #100
1290
+ CreateCreature("BRIELB",[418.376],0)
1291
+ ActionOverride("Brielbara",SetNumTimesTalkedTo(1))
1292
+ END
1293
+ ```
1294
+ */
1295
+ export declare function SetNumTimesTalkedTo(num: number): Action;
1296
+
1297
+ /**
1298
+ * This action is used to a play a movie (MVE file). The example script is from ar108.bcs.
1299
+
1300
+ ```weidu-baf
1301
+ IF
1302
+ Global("EnteredPalace","GLOBAL",0)
1303
+ THEN
1304
+ RESPONSE #100
1305
+ StartMovie("PALACE")
1306
+ SetGlobal("EnteredPalace","GLOBAL",1)
1307
+ END
1308
+ ```
1309
+ */
1310
+ export declare function StartMovie(resref: string): Action;
1311
+
1312
+ /**
1313
+ * This action is used to initiate banter between NPCs. The example script is from edwin.bcs.
1314
+
1315
+ ```weidu-baf
1316
+ IF
1317
+ InParty(Myself)
1318
+ Gender(Myself,FEMALE)
1319
+ InParty("Aerie")
1320
+ See("Aerie")
1321
+ !Dead("Aerie")
1322
+ !StateCheck("Aerie",STATE_SLEEPING)
1323
+ Range("Aerie",10)
1324
+ CombatCounter(0)
1325
+ !Range(SecondNearest([PC]),10)
1326
+ Global("EdwinW1","LOCALS",0)
1327
+ THEN
1328
+ RESPONSE #100
1329
+ Interact("Aerie")
1330
+ END
1331
+ ```
1332
+ */
1333
+ export declare function Interact(object: ObjectPtr): Action;
1334
+
1335
+ /**
1336
+ * This action removes a single instance of the specified item from the active creature, unless the item exists in a stack, in which case the entire stack is removed. The example script is from ar1000.bcs.
1337
+
1338
+ ```weidu-baf
1339
+ IF
1340
+ Global("CerndBaby","GLOBAL",1)
1341
+ Global("CerndBabyTake","AR1000",0)
1342
+ THEN
1343
+ RESPONSE #100
1344
+ SetGlobal("CerndBabyTake","AR1000",1)
1345
+ TakePartyItem("misc8t")
1346
+ DestroyItem("misc8t")
1347
+ END
1348
+ ```
1349
+ */
1350
+ export declare function DestroyItem(item: ItmRef): Action;
1351
+
1352
+ /**
1353
+ * This action reveals an area on the worldmap, enabling travelling to it.
1354
+
1355
+ ```weidu-baf
1356
+ IF
1357
+ Dead("Davaeorn")
1358
+ Global("Chapter","GLOBAL",4)
1359
+ THEN
1360
+ RESPONSE #100
1361
+ RevealAreaOnMap("AR0900")
1362
+ IncrementChapter("Chptxt5")
1363
+ AddJournalEntry(15839,USER)
1364
+ END
1365
+ ```
1366
+ */
1367
+ export declare function RevealAreaOnMap(area: AreRef): Action;
1368
+
1369
+ /**
1370
+ * This action gives the specified amount of gold to the party. The active creature need not have the gold in its "money variable". A negative amount will remove gold from the active creature.
1371
+
1372
+ ```weidu-baf
1373
+ IF
1374
+ NumTimesTalkedTo(30)
1375
+ THEN
1376
+ RESPONSE #100
1377
+ SetNumTimesTalkedTo(31)
1378
+ GiveGoldForce(300)
1379
+ END
1380
+ ```
1381
+ */
1382
+ export declare function GiveGoldForce(amount: number): Action;
1383
+
1384
+ /**
1385
+ * This action sets the open/closed graphic of a tile in a WED file.
1386
+ */
1387
+ export declare function ChangeTileState(tile: ObjectPtr, state: boolean): Action;
1388
+
1389
+ /**
1390
+ * This action adds an entry into the journal. The entry parameter is the strref to add, and the JourType is the type of entry (i.e. the location within the journal to add the entry to) - values are from [jourtype.ids]({{ ids }}/jourtype.htm). The example script is from ar0511.bcs.
1391
+
1392
+ ```weidu-baf
1393
+ IF
1394
+ Dead("JanGith1")
1395
+ Dead("JanGith2")
1396
+ Global("ThumbSeeker","GLOBAL",2)
1397
+ Global("HiddenJournal","AR0511",0)
1398
+ THEN
1399
+ RESPONSE #100
1400
+ SetGlobal("HiddenJournal","AR0511",1)
1401
+ AddJournalEntry(34726,QUEST)
1402
+ END
1403
+ ```
1404
+ */
1405
+ export declare function AddJournalEntry(entry: StrRef, type: JourType): Action;
1406
+
1407
+ /**
1408
+ * This action instructs the active creature to a ranged weapon from the weapons available in the quickslots.
1409
+
1410
+ ```weidu-baf
1411
+ IF
1412
+ See([EVILCUTOFF])
1413
+ !Range([EVILCUTOFF],4)
1414
+ OR(28)
1415
+ !HasItemEquiped("Bow01",())
1416
+ !HasItemEquiped("Bow02",())
1417
+ !HasItemEquiped("Bow03",())
1418
+ !HasItemEquiped("Bow04",())
1419
+ !HasItemEquipedReal("Bow05",())
1420
+ !HasItemEquipedReal("Bow06",())
1421
+ !HasItemEquipedReal("Bow07",())
1422
+ !HasItemEquipedReal("Bow08",())
1423
+ !HasItemEquipedReal("Bow09",())
1424
+ !HasItemEquipedReal("Bow10",())
1425
+ !HasItemEquipedReal("Bow11",())
1426
+ !HasItemEquipedReal("Bow12",())
1427
+ !HasItemEquipedReal("Bow13",())
1428
+ !HasItemEquipedReal("Bow14",())
1429
+ !HasItemEquipedReal("Bow15",())
1430
+ !HasItemEquipedReal("Bow16",())
1431
+ !HasItemEquipedReal("Bow17",())
1432
+ !HasItemEquipedReal("Bow18",())
1433
+ !HasItemEquipedReal("Bow19",())
1434
+ !HasItemEquipedReal("Bow20",())
1435
+ !HasItemEquipedReal("Bow21",())
1436
+ !HasItemEquipedReal("Bow22",())
1437
+ !HasItemEquipedReal("Bow23",())
1438
+ !HasItemEquipedReal("Bow24",())
1439
+ !HasItemEquipedReal("Bow25",())
1440
+ !HasItemEquipedReal("Bow26",())
1441
+ !HasItemEquipedReal("Bow98",())
1442
+ !HasItemEquipedReal("Bow99",())
1443
+ THEN
1444
+ RESPONSE #100
1445
+ EquipRanged()
1446
+ AttackReevaluate([EVILCUTOFF],30)
1447
+ END
1448
+ ```
1449
+ */
1450
+ export declare function EquipRanged(): Action;
1451
+
1452
+ /**
1453
+ *
1454
+ */
1455
+ export declare function SetLeavePartyDialogueFile(): Action;
1456
+
1457
+ /**
1458
+ * This action sets the dialog for the active creature to their leave dialog.
1459
+
1460
+ ```weidu-baf
1461
+ IF
1462
+ !InParty(Myself)
1463
+ HPGT(Myself,0)
1464
+ THEN
1465
+ RESPONSE #100
1466
+ SetLeavePartyDialogFile()
1467
+ Dialogue(Player1)
1468
+ ChangeAIScript("",DEFAULT)
1469
+ END
1470
+ ```
1471
+ */
1472
+ export declare function SetLeavePartyDialogFile(): Action;
1473
+
1474
+ /**
1475
+ * This action instructs the active creature to search for the nearest travel trigger point for the specified time (measured in second) before giving up and just disappearing.
1476
+ */
1477
+ export declare function EscapeAreaDestroy(delay: number): Action;
1478
+
1479
+ /**
1480
+ * This action is used in conjunction with trigger region in ARE files. The action sets the activation state a trigger region (specified by the object parameter).
1481
+ */
1482
+ export declare function TriggerActivation(object: ObjectPtr, state: boolean): Action;
1483
+
1484
+ /**
1485
+ *
1486
+ */
1487
+ export declare function DialogueInterrupt(state: boolean): Action;
1488
+
1489
+ /**
1490
+ * This action sets the interrupt state of the active creature. When set to false the creature cannot receive dialog requests or issue verbal constants. The interrupt state of a creature is not saved.
1491
+ */
1492
+ export declare function DialogInterrupt(state: boolean): Action;
1493
+
1494
+ /**
1495
+ * This action instructs the active creature to attempt to Hide in Shadows. This action can be used for any creature (not just thieves) though success in hiding is dependent on points in the Stealth skill. A hidden creature is treated as STATE\_INVISIBLE.
1496
+
1497
+ ```weidu-baf
1498
+ IF
1499
+ !See([EVILCUTOFF])
1500
+ OR(2)
1501
+ !StateCheck(Myself,STATE_INVISIBLE)
1502
+ !StateCheck(Myself,STATE_IMPROVEDINVISIBLITY)
1503
+ THEN
1504
+ RESPONSE #100
1505
+ Hide()
1506
+ END
1507
+ ```
1508
+ */
1509
+ export declare function Hide(): Action;
1510
+
1511
+ /**
1512
+ * This action instructs the active creature to move to the specified object. Once the active creature reaches the object, it will follow the target if it moves. This behaviour continues until a different action is issued or until the target creature travels between areas.
1513
+ */
1514
+ export declare function MoveToObjectFollow(object: ObjectPtr): Action;
1515
+
1516
+ /**
1517
+ *
1518
+ */
1519
+ export declare function ReallyForceSpellRES(spell: SplRef, target: ObjectPtr): Action;
1520
+
1521
+ /**
1522
+ * This action causes the active creature to cast the specified spell at the target object. The spell need not currently be memorised by the caster, and will not be interrupted while being cast. The spell is cast instantly (i.e. with a casting time of 0). The caster must meet the level requirements of the spell. This action does not work in the script round where the active creature has died.
1523
+
1524
+ {% capture note %}
1525
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
1526
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8th character isn't valid.
1527
+ {% endcapture %} {% include note.html %}
1528
+ */
1529
+ export declare function ReallyForceSpell(target: ObjectPtr, spell: SpellID): Action;
1530
+
1531
+ /**
1532
+ * This action changes the active creature's selection circle to purple - making it unselectable. Creatures made unselectable stop processing scripts.
1533
+ */
1534
+ export declare function MakeUnselectable(time: number): Action;
1535
+
1536
+ /**
1537
+ * This action is used in multiplayer games to ensure that players are at the same point before continuing.
1538
+ */
1539
+ export declare function MultiPlayerSync(): Action;
1540
+
1541
+ /**
1542
+ * This action causes the active creature to run away from the specified creature, for the specified time. The time parameter is measured in AI updates, which default to 15 updates per second. Occasionally, fleeing creatures stop to attack another creature. Conditions are not checked until the time has expired.
1543
+ */
1544
+ export declare function RunAwayFromNoInterrupt(creature: ObjectPtr, time: number): Action;
1545
+
1546
+ /**
1547
+ * This action adds the specified area to the top of the area script processing stack. When the player enters an area that is not in the mastarea.2da the associated script is added to the bottom of the area script processing stack. When the player enters an area that is in mastarea.2da the associated script is added to the top of the area script processing stack.
1548
+ */
1549
+ export declare function SetMasterArea(name: string): Action;
1550
+
1551
+ /**
1552
+ * This action shows the ending credits.
1553
+ */
1554
+ export declare function EndCredits(): Action;
1555
+
1556
+ /**
1557
+ * This action starts playing a music track. The slot parameter refers to the music slots contained in the ARE header. The flags parameter indicates how the music should be played - values are from [mflags.ids]({{ ids }}/mflags.htm).
1558
+ */
1559
+ export declare function StartMusic(slot: number, flags: MFlags): Action;
1560
+
1561
+ /**
1562
+ * This action removes all instances of the specified item from the party. The items are placed in the inventory of the active creature. Items contained in containers (e.g. Bag of Holding) are not taken.
1563
+ */
1564
+ export declare function TakePartyItemAll(item: ItmRef): Action;
1565
+
1566
+ /**
1567
+ * This multiplayer-only action changes the current area. Parchment is the MOS image to use in the area transition loading screen. Only EE games support IDS symbols for `Face`.
1568
+ */
1569
+ export declare function LeaveAreaLUAPanic(area: AreRef, parchment: string, point: Point, face: Direction): Action;
1570
+
1571
+ /**
1572
+ * This action adds the active creature to the party. If the party is currently full the 'select party members' dialog is shown. JoinParty clears the ActionQueue of the active creature.
1573
+
1574
+ ```weidu-baf
1575
+ IF
1576
+ See([PC])
1577
+ Global("KRJOINPARTY","GLOBAL",0)
1578
+ THEN
1579
+ RESPONSE #100
1580
+ JoinParty()
1581
+ END
1582
+ ```
1583
+ */
1584
+ export declare function JoinParty(): Action;
1585
+
1586
+ /**
1587
+ * This action saves the game in the specified save slot.
1588
+ */
1589
+ export declare function SaveGame(slot: number): Action;
1590
+
1591
+ /**
1592
+ *
1593
+ */
1594
+ export declare function SpellNoDecRES(spell: SplRef, target: ObjectPtr): Action;
1595
+
1596
+ /**
1597
+ * This action causes the active creature to cast the specified spell at the target object. The spell need not be currently be memorised by the caster, and may be interrupted while being cast. The caster must meet the level requirements of the spell. The spell will not be removed from the casters memory after casting. For the RES version of the action, the spell name can not consist of only numbers, should be written in upper case and should be no more than 7 characters long.
1598
+
1599
+ {% capture note %}
1600
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
1601
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8th character isn't valid.
1602
+ {% endcapture %} {% include note.html %}
1603
+ */
1604
+ export declare function SpellNoDec(target: ObjectPtr, spell: SpellID): Action;
1605
+
1606
+ /**
1607
+ *
1608
+ */
1609
+ export declare function SpellPointNoDecRES(spell: SplRef, target: Point): Action;
1610
+
1611
+ /**
1612
+ * This action causes the active creature to cast the specified spell at the specified point (`[x.y]`). The spell must currently be memorised by the caster, and may be interrupted while being cast. The caster must meet the level requirements of the spell. The spell will be removed from the casters memory. For the RES version of the action, the spell name can not consist of only numbers, should be written in upper case and should be no more than 7 characters long. The example script is from `"andris.bcs"`.
1613
+
1614
+ {% capture note %}
1615
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
1616
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8th character isn't valid.
1617
+ {% endcapture %} {% include note.html %}
1618
+ */
1619
+ export declare function SpellPointNoDec(target: Point, spell: SpellID): Action;
1620
+
1621
+ /**
1622
+ * This action instructs the active creature to take the specified item from the party, if they are nearby. A range for the action cannot be specified.
1623
+ */
1624
+ export declare function TakePartyItemRange(item: ItmRef): Action;
1625
+
1626
+ /**
1627
+ * This action will change the animation of the active creature to match that of the specified CRE file. If the active creature is in the party, the action will create the specified creature.
1628
+ */
1629
+ export declare function ChangeAnimation(creature: CreRef): Action;
1630
+
1631
+ /**
1632
+ * This action will lock the specified door/container.
1633
+ */
1634
+ export declare function Lock(object: ObjectPtr): Action;
1635
+
1636
+ /**
1637
+ * This action will unlock the specified door/container.
1638
+ */
1639
+ export declare function Unlock(object: ObjectPtr): Action;
1640
+
1641
+ /**
1642
+ * This action will move the specified object to the target area, at the indicated point. The action will only work for creatures in the GAM file - i.e. NPCs or that have been added via MakeGlobal.
1643
+ */
1644
+ export declare function MoveGlobal(area: AreRef, object: ObjectPtr, point: Point): Action;
1645
+
1646
+ /**
1647
+ *
1648
+ */
1649
+ export declare function StartDialogNoSet(object: ObjectPtr): Action;
1650
+
1651
+ /**
1652
+ * This action instructs the active creature to initiate dialog with the target object, using its currently assigned dialog file. This action can be used from a distance and will work whether the target creature is in sight or not. Dialog will not be initiated if the creature using this action has been assigned a dialog that has all top level conditions returning false. If the target is invalid, the active creature will initiate dialog with Player1.
1653
+ */
1654
+ export declare function StartDialogueNoSet(object: ObjectPtr): Action;
1655
+
1656
+ /**
1657
+ * This action displays a textscreen, showing text and graphics from the specified 2DA file.
1658
+ */
1659
+ export declare function TextScreen(textlist: string): Action;
1660
+
1661
+ /**
1662
+ * This action causes the active creature to walk randomly, without pausing.
1663
+
1664
+ {% capture note %}
1665
+ It is the same as [RandomWalk()](#85), just with the offscreen-wait removed and no [RandomTurn()](#130) chance.
1666
+ {% endcapture %} {% include note.html %}
1667
+ */
1668
+ export declare function RandomWalkContinuous(): Action;
1669
+
1670
+ /**
1671
+ * This action will highlight the specified secret door in purple, to indicate it has been detected.
1672
+ */
1673
+ export declare function DetectSecretDoor(object: ObjectPtr): Action;
1674
+
1675
+ /**
1676
+ * This action will fade the screen. The point parameter is given in [x.y] format with the x coordinate specifying the number of AI updates (which default to 15 per second) to take to complete the fade action.
1677
+ */
1678
+ export declare function FadeToColor(point: Point, blue: number): Action;
1679
+
1680
+ /**
1681
+ * This action will unfade the screen. The point parameter is given in [x.y] format with the x coordinate specifying the number of AI updates (which default to 15 per second) to take to complete the fade action.
1682
+ */
1683
+ export declare function FadeFromColor(point: Point, blue: number): Action;
1684
+
1685
+ /**
1686
+ * This action will remove a number of instances (specified by the Num parameter) of the specified item from the party. The items will be removed from players in order, for example; Player1 has 3 instances of "MYITEM" in their inventory, Player2 has 2 instance of "MYITEM," and Player3 has 1 instance. If the action TakePartyItemNum("MYITEM", 4) is run, all 3 instances of "MYITEM" will be taken from Player1, and 1 instance will be taken from Player2. This leaves Player2 and Player3 each with one instance of "MYITEM." If the last item of an item type stored in a container STO file is removed by this action, the amount becomes zero. Items with zero quantities cannot be seen in-game, cannot be removed by TakePartyItem, and will not count toward a container's current item load. If the item to be taken is in a stack, and the stack is in a quickslot, the item will be removed, and the remaining stack will be placed in the inventory. If the inventory is full, the stack item will be dropped on the ground.
1687
+ */
1688
+ export declare function TakePartyItemNum(item: ItmRef, num: number): Action;
1689
+
1690
+ /**
1691
+ * This action functions the same as Wait.
1692
+ */
1693
+ export declare function WaitWait(time: number): Action;
1694
+
1695
+ /**
1696
+ * This action causes the active creature to move to the specified coordinates. The action will update the position of creatures as stored in ARE files (first by setting the coordinates of the destination point, then by setting the coordinates of the current point once the destination is reached). Conditions are not checked until the destination point is reached.
1697
+ */
1698
+ export declare function MoveToPointNoInterrupt(point: Point): Action;
1699
+
1700
+ /**
1701
+ * This action instructs the active creature to move to the specified object. The action does not update the current position of the actor, saved in ARE files. Conditions are not checked until the destination point is reached.
1702
+ */
1703
+ export declare function MoveToObjectNoInterrupt(object: ObjectPtr): Action;
1704
+
1705
+ /**
1706
+ * As it says, this action will activate a spawn point in an area. The Object should be the name of the spawn point as written in the ARE file.
1707
+ */
1708
+ export declare function SpawnPtActivate(object: ObjectPtr): Action;
1709
+
1710
+ /**
1711
+ * This action causes the active creature to leave the party. This action calls DropInventory() as part of its execution.
1712
+
1713
+ ```weidu-baf
1714
+ IF
1715
+ HappinessLT(Myself,-299)
1716
+ THEN
1717
+ RESPONSE #100
1718
+ ChangeAIScript("",DEFAULT)
1719
+ SetLeavePartyDialogFile()
1720
+ LeaveParty()
1721
+ EscapeArea()
1722
+ END
1723
+ ```
1724
+ */
1725
+ export declare function LeaveParty(): Action;
1726
+
1727
+ /**
1728
+ * This action is used in conjunction with spawn points in ARE files. The action sets the enabled state of a spawn point (specified by the object parameter).
1729
+ */
1730
+ export declare function SpawnPtDeactivate(object: ObjectPtr): Action;
1731
+
1732
+ /**
1733
+ * This action causes an activated spawn point to spawn creatures, regardless of whether the time for spawning has expired. The Object should be the name of the spawn point as written in the ARE file.
1734
+ */
1735
+ export declare function SpawnPtSpawn(object: ObjectPtr): Action;
1736
+
1737
+ /**
1738
+ * This action acts like <a href="#106"><code>Shout()</code></a> without the range limit.
1739
+ */
1740
+ export declare function GlobalShout(id: ShoutID): Action;
1741
+
1742
+ /**
1743
+ * This action is used in conjunction with animations in ARE files. The action will start the specified animation.
1744
+ */
1745
+ export declare function StaticStart(object: ObjectPtr): Action;
1746
+
1747
+ /**
1748
+ * This action is used in conjunction with animations in ARE files. The action will stop the specified animation.
1749
+ */
1750
+ export declare function StaticStop(object: ObjectPtr): Action;
1751
+
1752
+ /**
1753
+ * This action instructs the active creature to follow the target object, in the specified formation, taking up the specified position. The Formation parameter represents the formation type (e.g. two lines, arrowhead, single line). The position should be in the range [0,5]. The example script is from dlsctc02.bcs.
1754
+
1755
+ ```weidu-baf
1756
+ IF
1757
+ !Range("DLSCTC02",12)
1758
+ Global("DontFollow","DL0302",0)
1759
+ THEN
1760
+ RESPONSE #100
1761
+ FollowObjectFormation("DLSCTC02",1,6)
1762
+ RESPONSE #100
1763
+ FollowObjectFormation("DLSCTC02",1,5)
1764
+ RESPONSE #100
1765
+ FollowObjectFormation("DLSCTC02",2,6)
1766
+ RESPONSE #100
1767
+ FollowObjectFormation("DLSCTC02",2,5)
1768
+ END
1769
+
1770
+ IF
1771
+ Global("FollowTheLeader","LOCALS",1)
1772
+ Range("DLSCTC02",6)
1773
+ Global("DontFollow","DL0302",0)
1774
+ THEN
1775
+ RESPONSE #100
1776
+ SetGlobal("FollowTheLeader","LOCALS",0)
1777
+ END
1778
+
1779
+ IF
1780
+ OR(2)
1781
+ !Range("DLSCTC02",9)
1782
+ Range("DLSCTC02",1)
1783
+ Global("DontFollow","DL0302",0)
1784
+ THEN
1785
+ RESPONSE #100
1786
+ SetGlobal("FollowTheLeader","LOCALS",1)
1787
+ FollowObjectFormation("DLSCTC02",1,2)
1788
+ RESPONSE #100
1789
+ SetGlobal("FollowTheLeader","LOCALS",1)
1790
+ FollowObjectFormation("DLSCTC02",1,3)
1791
+ RESPONSE #100
1792
+ SetGlobal("FollowTheLeader","LOCALS",1)
1793
+ FollowObjectFormation("DLSCTC02",1,4)
1794
+ RESPONSE #100
1795
+ SetGlobal("FollowTheLeader","LOCALS",1)
1796
+ FollowObjectFormation("DLSCTC02",1,5)
1797
+ RESPONSE #100
1798
+ SetGlobal("FollowTheLeader","LOCALS",1)
1799
+ FollowObjectFormation("DLSCTC02",1,1)
1800
+ RESPONSE #100
1801
+ SetGlobal("FollowTheLeader","LOCALS",1)
1802
+ FollowObjectFormation("DLSCTC02",2,1)
1803
+ RESPONSE #100
1804
+ SetGlobal("FollowTheLeader","LOCALS",1)
1805
+ FollowObjectFormation("DLSCTC02",2,2)
1806
+ RESPONSE #100
1807
+ SetGlobal("FollowTheLeader","LOCALS",1)
1808
+ FollowObjectFormation("DLSCTC02",2,3)
1809
+ RESPONSE #100
1810
+ SetGlobal("FollowTheLeader","LOCALS",1)
1811
+ FollowObjectFormation("DLSCTC02",2,4)
1812
+ RESPONSE #100
1813
+ SetGlobal("FollowTheLeader","LOCALS",1)
1814
+ FollowObjectFormation("DLSCTC02",2,5)
1815
+ END
1816
+ ```
1817
+ */
1818
+ export declare function FollowObjectFormation(object: ObjectPtr, formation: number, position: number): Action;
1819
+
1820
+ /**
1821
+ * This action causes the active creature to become the players ally. The active creature does not act as a normal familiar (i.e. no HP bonus or Constitution loss on death).
1822
+ */
1823
+ export declare function AddFamiliar(): Action;
1824
+
1825
+ /**
1826
+ * This action removes the ally flag set by AddFamiliar.
1827
+ */
1828
+ export declare function RemoveFamiliar(): Action;
1829
+
1830
+ /**
1831
+ * This action pauses the game. Script processing is halted while the game is paused.
1832
+ */
1833
+ export declare function PauseGame(): Action;
1834
+
1835
+ /**
1836
+ * This action will change the animation of the active creature to match that of the specified CRE file. If the active creature is in the party, the action will create the specified creature. No lighting effects are played.
1837
+ */
1838
+ export declare function ChangeAnimationNoEffect(creature: CreRef): Action;
1839
+
1840
+ /**
1841
+ * This action instructs the active creature to move to the specified object. The action does not update the current position of the actor, saved in ARE files. The example script shows the creature moving towards the nearest enemy.
1842
+
1843
+ ```weidu-baf
1844
+ IF
1845
+ See(NearestEnemyOf())
1846
+ !Range(NearestEnemyOf(),4)
1847
+ THEN
1848
+ RESPONSE #100
1849
+ MoveToObject(NearestEnemyOf())
1850
+ END
1851
+ ```
1852
+ */
1853
+ export declare function MoveToObject(target: ObjectPtr): Action;
1854
+
1855
+ /**
1856
+ * This action removes the items listed in the specified 2DA file from the party.
1857
+ */
1858
+ export declare function TakeItemListParty(resref: string): Action;
1859
+
1860
+ /**
1861
+ * This action destroys all items on the active creature.
1862
+ */
1863
+ export declare function DestroyAllEquipment(): Action;
1864
+
1865
+ /**
1866
+ * This action causes the active creature to give all their items to the party.
1867
+ */
1868
+ export declare function GivePartyAllEquipment(): Action;
1869
+
1870
+ /**
1871
+ * This action will move the active creature to the specified point in the indicated area, facing the appropriate direction, and plays the specified graphics when the creature disappears.
1872
+ */
1873
+ export declare function MoveBetweenAreasEffect(area: AreRef, graphic: string, location: Point, face: Direction): Action;
1874
+
1875
+ /**
1876
+ * This action will move the active creature to the specified point in the indicated area, facing the appropriate direction.
1877
+ */
1878
+ export declare function MoveBetweenAreas(area: AreRef, location: Point, face: Direction): Action;
1879
+
1880
+ /**
1881
+ * This action will remove the specified number of items from the party, as listed in the specified 2DA file.
1882
+ */
1883
+ export declare function TakeItemListPartyNum(resref: string, num: number): Action;
1884
+
1885
+ /**
1886
+ *
1887
+ */
1888
+ export declare function CreateCreatureObjectEffect(creature: CreRef, effect: string, object: ObjectPtr): Action;
1889
+
1890
+ /**
1891
+ * This action will create the specified creature next to the specified object. The facing of the creature is controlled by the Usage1 parameter.
1892
+ */
1893
+ export declare function CreateCreatureObject(creature: CreRef, object: ObjectPtr, usage1: number, usage2: number, usage3: number): Action;
1894
+
1895
+ /**
1896
+ * This action creates the specified creature on a normally impassable surface (e.g. on a wall, on water, on a roof).
1897
+ */
1898
+ export declare function CreateCreatureImpassable(creature: CreRef, location: Point, face: Direction): Action;
1899
+
1900
+ /**
1901
+ * This action instructs the active creature to face the target object.
1902
+ */
1903
+ export declare function FaceObject(object: ObjectPtr): Action;
1904
+
1905
+ /**
1906
+ * This action causes the active creature to move to the specified coordinates. The action will update the position of creatures as stored in ARE files (first by setting the coordinates of the destination point, then by setting the coordinates of the current point once the destination is reached).
1907
+
1908
+ ```weidu-baf
1909
+ IF
1910
+ True()
1911
+ THEN
1912
+ RESPONSE #100
1913
+ MoveToPoint([526.1193])
1914
+ Wait(3)
1915
+ RandomWalk()
1916
+ Wait(5)
1917
+ RandomWalk()
1918
+ END
1919
+ ```
1920
+ */
1921
+ export declare function MoveToPoint(point: Point): Action;
1922
+
1923
+ /**
1924
+ * This action duplicates the effects of resting. Such resting is not interruptible, and functions even if enemies are nearby.
1925
+ */
1926
+ export declare function RestParty(): Action;
1927
+
1928
+ /**
1929
+ * This action creates the specified creature at the specified location, and plays the dimension door graphic. The creature appears after approximately 100 AI cycles (~3.5 seconds at the default of 30 frame/second).
1930
+ */
1931
+ export declare function CreateCreatureDoor(creature: CreRef, location: Point, face: Direction): Action;
1932
+
1933
+ /**
1934
+ * This action will create the specified creature next to the specified object, and plays the dimension door graphic. The facing of the creature is controlled by the Usage1 parameter. The creature appears after approximately 100 AI cycles (~3.5 seconds at the default of 30 frame/second).
1935
+ */
1936
+ export declare function CreateCreatureObjectDoor(creature: CreRef, object: ObjectPtr, usage1: number, usage2: number, usage3: number): Action;
1937
+
1938
+ /**
1939
+ * This action creates the specified creature just off-screen from the current viewpoint (the north/south/east/west direction is random). The facing of the creature is controlled by the Usage1 parameter.
1940
+ */
1941
+ export declare function CreateCreatureObjectOffScreen(creature: CreRef, object: ObjectPtr, usage1: number, usage2: number, usage3: number): Action;
1942
+
1943
+ /**
1944
+ * This action moves the object creature a screen away from the specified target creature. The target object must be stored in the GAM file (i.e. NPC or added explicitly via the MakeGlobal action.
1945
+ */
1946
+ export declare function MoveGlobalObjectOffScreen(object: ObjectPtr, target: ObjectPtr): Action;
1947
+
1948
+ /**
1949
+ * This action removes the specified strref from the quest section of the journal.
1950
+ */
1951
+ export declare function SetQuestDone(string: StrRef): Action;
1952
+
1953
+ /**
1954
+ * This action stores the current location of party members in the GAM file.
1955
+ */
1956
+ export declare function StorePartyLocations(): Action;
1957
+
1958
+ /**
1959
+ * This action moves the party to the stored locations (previously stored with StorePartyLocations). The action clears the stored locations from the GAM file.
1960
+ */
1961
+ export declare function RestorePartyLocations(): Action;
1962
+
1963
+ /**
1964
+ * This action creates the specified creature just offscreen from the active creature.
1965
+ */
1966
+ export declare function CreateCreatureOffScreen(creature: CreRef, face: Direction): Action;
1967
+
1968
+ /**
1969
+ * This action moves the active creature to the centre of the screen. Script conditions are not checked for the specified duration (measured in seconds) or until the creature has reached the screen centre.
1970
+ */
1971
+ export declare function MoveToCenterOfScreen(notinterruptablefor: number): Action;
1972
+
1973
+ /**
1974
+ * This action causes the active creature to move randomly around the screen.
1975
+
1976
+ ```weidu-baf
1977
+ IF
1978
+ HPPercentLT(Myself,15)
1979
+ THEN
1980
+ RESPONSE #100
1981
+ Panic()
1982
+ END
1983
+ ```
1984
+ */
1985
+ export declare function Panic(): Action;
1986
+
1987
+ /**
1988
+ *
1989
+ */
1990
+ export declare function ReallyForceSpellDeadRES(spell: SplRef, target: ObjectPtr): Action;
1991
+
1992
+ /**
1993
+ * This action causes the active creature to cast the specified spell at the target object. The spell need not currently be memorised by the caster, and will not be interrupted while being cast. The spell is cast instantly (i.e. with a casting time of 0). The caster must meet the level requirements of the spell. For the RES version of the action, the spell name can not consist of only numbers, should be written in upper case and should be no more than 7 characters long. This action works in the script round where the active creature has died.
1994
+
1995
+ ```weidu-baf
1996
+ IF
1997
+ Die()xx
1998
+ THEN
1999
+ RESPONSE #100
2000
+ ReallyForceSpellDead(Myself,ILLUSION_DEATH)
2001
+ Wait(1)
2002
+ DestroySelf()
2003
+ END
2004
+ ```
2005
+
2006
+ {% capture note %}
2007
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
2008
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8th character isn't valid.
2009
+ {% endcapture %} {% include note.html %}
2010
+ */
2011
+ export declare function ReallyForceSpellDead(target: ObjectPtr, spell: SpellID): Action;
2012
+
2013
+ /**
2014
+ * This action removes the berserking state and effect by applying the `Cure:Berserk` opcode.
2015
+ */
2016
+ export declare function Calm(object: ObjectPtr): Action;
2017
+
2018
+ /**
2019
+ * This action changes the active creature's allegiance to ALLY (i.e. a green selection circle).
2020
+ */
2021
+ export declare function Ally(): Action;
2022
+
2023
+ /**
2024
+ * This action rests the party, but doesn't force healing spells to be cast on injured party members.
2025
+ */
2026
+ export declare function RestNoSpells(): Action;
2027
+
2028
+ /**
2029
+ * This action is similar to StorePartyLocations() but with one object.
2030
+ */
2031
+ export declare function SaveLocation(scope: Scope, global: string, point: Point): Action;
2032
+
2033
+ /**
2034
+ * This action stores the location of the specified object in the named variable.
2035
+
2036
+ ```weidu-baf
2037
+ IF
2038
+ Global("SavedMyPos","LOCALS",0)
2039
+ THEN
2040
+ RESPONSE #50
2041
+ SetGlobal("SavedMyPos","LOCALS",1)
2042
+ SaveObjectLocation("LOCALS","DefaultLocation",Myself)
2043
+ END
2044
+ ```
2045
+ */
2046
+ export declare function SaveObjectLocation(scope: Scope, global: string, object: ObjectPtr): Action;
2047
+
2048
+ /**
2049
+ * This action creates the specified creature at the specified saved location.
2050
+ */
2051
+ export declare function CreateCreatureAtLocation(global: string, scope: Scope, creature: CreRef): Action;
2052
+
2053
+ /**
2054
+ * This action sets the specified token to the specified value. Whenever the token is then used within a strref, the current value of the token will be displayed. Values assigned by this action are not saved.
2055
+ */
2056
+ export declare function SetToken(token: string, string: StrRef): Action;
2057
+
2058
+ /**
2059
+ * This action sets the token specified by the string parameter (e.g. DAMAGER) to the name of the object specified in the object parameter. Values assigned by this action are not persisted to save games.
2060
+ */
2061
+ export declare function SetTokenObject(token: string, object: ObjectPtr): Action;
2062
+
2063
+ /**
2064
+ * This action updates various tokens based on the specified object.
2065
+ */
2066
+ export declare function SetGabber(object: ObjectPtr): Action;
2067
+
2068
+ /**
2069
+ * This action instructs the active creature to attempt to pickpocket the target. This action can be used for any creature (not just thieves) though success in pick pocketing is dependent on points in the Pickpocket skill. Note that a failed pickpocket attempt is treated as an attack, hence the Attacked() trigger will return true if a pickpocket attempt is failed.
2070
+
2071
+ ```weidu-baf
2072
+ IF
2073
+ See([ANYONE])
2074
+ OR(2)
2075
+ Class(Myself,THIEF_ALL)
2076
+ Class(Myself,BARD_ALL)
2077
+ THEN
2078
+ RESPONSE #100
2079
+ PickPockets([ANYONE])
2080
+ END
2081
+ ```
2082
+ */
2083
+ export declare function PickPockets(target: ObjectPtr): Action;
2084
+
2085
+ /**
2086
+ *
2087
+ */
2088
+ export declare function CreateCreatureObjectCopyEffect(creature: CreRef, effect: string, object: ObjectPtr): Action;
2089
+
2090
+ /**
2091
+ * This action creates the specified creature and sets its animation to that of the active creature.
2092
+ */
2093
+ export declare function CreateCreatureObjectCopy(creature: CreRef, object: ObjectPtr, usage1: number, usage2: number, usage3: number): Action;
2094
+
2095
+ /**
2096
+ * This action hides an area on the worldmap, preventing travelling to it.
2097
+ */
2098
+ export declare function HideAreaOnMap(area: AreRef): Action;
2099
+
2100
+ /**
2101
+ * This action creates the specified creature at a location offset from the target object point.
2102
+ */
2103
+ export declare function CreateCreatureObjectOffset(creature: CreRef, object: ObjectPtr, offset: Point): Action;
2104
+
2105
+ /**
2106
+ * This action is used in conjunction with containers in ARE files. The action sets the enabled state of a container (specified by the object parameter).
2107
+ */
2108
+ export declare function ContainerEnable(object: ObjectPtr, bool: boolean): Action;
2109
+
2110
+ /**
2111
+ * This action shakes the game view. The point parameter dictates how far to shake the screen along the x and y axis. The duration parameter dictates how long the shaking lasts.
2112
+ */
2113
+ export declare function ScreenShake(point: Point, duration: number): Action;
2114
+
2115
+ /**
2116
+ * This action will add the variable specified by parameter 2 onto the variable specified by parameter 1. It only works for variables in the "GLOBAL" scope. An example script is below.
2117
+
2118
+ ```weidu-baf
2119
+ IF
2120
+ Global("Var1","GLOBAL",0)
2121
+ THEN
2122
+ RESPONSE #100
2123
+ SetGlobal("Var1","GLOBAL",75) //Var1 = 75
2124
+ SetGlobal("Var2","GLOBAL",25) //Var2 = 25
2125
+ AddGlobals("Var1","Var2") //Var1 = 100
2126
+ END
2127
+ ```
2128
+ */
2129
+ export declare function AddGlobals(name: string, name2: string): Action;
2130
+
2131
+ /**
2132
+ *
2133
+ */
2134
+ export declare function CreateItemGlobal(global: string, scope: Scope, item: ItmRef): Action;
2135
+
2136
+ /**
2137
+ * This action creates a quantity of items equal to a global variable on the active creature. The example script will create 50 arrows.
2138
+
2139
+ ```weidu-baf
2140
+ IF
2141
+ Global("Arrows","LOCALS",0)
2142
+ THEN
2143
+ RESPONSE #100
2144
+ SetGlobal("Arrows","LOCALS",50)
2145
+ CreateItemNumGlobal("Arrows","LOCALS","AROW01")
2146
+ END
2147
+ ```
2148
+ */
2149
+ export declare function CreateItemNumGlobal(global: string, scope: Scope, item: ItmRef): Action;
2150
+
2151
+ /**
2152
+ * This action instructs the active creature remove the item from the area and put it in their inventory (assuming the inventory has enough room and the item exists).
2153
+ */
2154
+ export declare function PickUpItem(item: ItmRef): Action;
2155
+
2156
+ /**
2157
+ * This action will attempt to fill a slot in the active creature's inventory with the appropriate item type. Using FillSlot(SLOT\_WEAPON) will look for any weapon in the inventory, and move the first such item into the weapon slot. Any item already in the slot is destroyed.
2158
+ */
2159
+ export declare function FillSlot(slot: Slots): Action;
2160
+
2161
+ /**
2162
+ * This action adds the specified amount of XP onto the specified object.
2163
+ */
2164
+ export declare function AddXPObject(object: ObjectPtr, xp: number): Action;
2165
+
2166
+ /**
2167
+ * This action will cause the active creature to play the specified sound. Both WAV and WAVC files can be played by the action. Sound is played through the sound effects channel. Volume fades if the viewport is moved further away from the active creature.
2168
+
2169
+ ```weidu-baf
2170
+ IF
2171
+ True()
2172
+ THEN
2173
+ RESPONSE #100
2174
+ PlaySound("CAS_M06")
2175
+ END
2176
+ ```
2177
+ */
2178
+ export declare function PlaySound(sound: string): Action;
2179
+
2180
+ /**
2181
+ * This action removes the specified amount of gold from the party. DestroyGold(0) will remove all gold from current creature. Note that this action affects the gold stat of the creature (not Party Gold or MISC07 items).
2182
+ */
2183
+ export declare function DestroyGold(gold: number): Action;
2184
+
2185
+ /**
2186
+ * This action stores a "home" location into memory for a creature. The location is not saved.
2187
+ */
2188
+ export declare function SetHomeLocation(point: Point): Action;
2189
+
2190
+ /**
2191
+ * This action displays the strref specified by the StrRef parameter in the message window, without attributing the text to an object.
2192
+ */
2193
+ export declare function DisplayStringNoName(object: ObjectPtr, string: StrRef): Action;
2194
+
2195
+ /**
2196
+ * This action removes the specified strref from the journal, regardless of the journal section the entry is in - except the user section.
2197
+ */
2198
+ export declare function EraseJournalEntry(string: StrRef): Action;
2199
+
2200
+ /**
2201
+ * This action copies all items lying around on the ground in the current area to the specified point in the target area.
2202
+ */
2203
+ export declare function CopyGroundPilesTo(resref: string, location: Point): Action;
2204
+
2205
+ /**
2206
+ *
2207
+ */
2208
+ export declare function DialogForceInterrupt(object: ObjectPtr): Action;
2209
+
2210
+ /**
2211
+ * These actions work the same as their counterpart dialog actions. The only difference is that they are important enough to interrupt other dialogs already in action.
2212
+ */
2213
+ export declare function DialogueForceInterrupt(object: ObjectPtr): Action;
2214
+
2215
+ /**
2216
+ *
2217
+ */
2218
+ export declare function StartDialogueInterrupt(dialogfile: string, target: ObjectPtr): Action;
2219
+
2220
+ /**
2221
+ *
2222
+ */
2223
+ export declare function StartDialogInterrupt(dialogfile: string, target: ObjectPtr): Action;
2224
+
2225
+ /**
2226
+ *
2227
+ */
2228
+ export declare function StartDialogNoSetInterrupt(object: ObjectPtr): Action;
2229
+
2230
+ /**
2231
+ *
2232
+ */
2233
+ export declare function StartDialogueNoSetInterrupt(object: ObjectPtr): Action;
2234
+
2235
+ /**
2236
+ * This action sets a global timer measured in seconds (of real time).
2237
+ */
2238
+ export declare function RealSetGlobalTimer(name: string, scope: Scope, time: GTimes): Action;
2239
+
2240
+ /**
2241
+ * This action displays the specified string over the head on the specified object (on the game-screen). The string may also be shown in the message log, depending on options specified in baldur.ini.
2242
+
2243
+ ```weidu-baf
2244
+ IF
2245
+ HPPercentLT(Myself,50)
2246
+ HasItem("Potn52",Myself)
2247
+ THEN
2248
+ RESPONSE #100
2249
+ DisplayStringHead(Myself,46150)
2250
+ UseItem("Potn52",Myself)
2251
+ END
2252
+ ```
2253
+
2254
+ If the object's name is unset or set to an invalid strref, it will be attributed to the protagonist in the message log. To avoid that, use `DisplayStringNoNameHead()`, or `SAY` the creature's `NAME` to ~~ (empty string) when coding it in WeIDu.
2255
+ */
2256
+ export declare function DisplayStringHead(object: ObjectPtr, string: StrRef): Action;
2257
+
2258
+ /**
2259
+ * This action causes the active creature to guard the specified point, staying within the specified range.
2260
+
2261
+ ```weidu-baf
2262
+ IF
2263
+ True()
2264
+ THEN
2265
+ RESPONSE #100
2266
+ ProtectPoint([1738.543],10)
2267
+ END
2268
+ ```
2269
+ */
2270
+ export declare function ProtectPoint(target: Point, range: number): Action;
2271
+
2272
+ /**
2273
+ * This action changes the animation of the active creature to match the animation of the target object.
2274
+ */
2275
+ export declare function PolymorphCopy(object: ObjectPtr): Action;
2276
+
2277
+ /**
2278
+ * This action plays the specified sound from the character's soundset.
2279
+ */
2280
+ export declare function VerbalConstantHead(object: ObjectPtr, constant: SoundOff): Action;
2281
+
2282
+ /**
2283
+ * This action plays the animation specified by the object parameter at the specified location ([x.y]). Animation preference order is applied, i.e. the engine first looks to play a VVC file of the specified name, if no such a file exists, the engine looks to play a BAM file of the specified.
2284
+ */
2285
+ export declare function CreateVisualEffect(object: string, location: Point): Action;
2286
+
2287
+ /**
2288
+ * This action plays the animation specified by the (mis-named) DialogFile parameter on the specified object. Animation preference order is applied, i.e. the engine first looks to play a VVC file of the specified name, if no such a file exists, the engine looks to play a BAM file of the specified.
2289
+ */
2290
+ export declare function CreateVisualEffectObject(dialogfile: string, target: ObjectPtr): Action;
2291
+
2292
+ /**
2293
+ * This action removes the active creature's current kit and adds the specified kit. Abilities from any previous kit are removed. AddKit(0) can be used to remove a creatures current kit without adding a new one. Class restrictions apply for kits. When attempting adding an invalid kit, the existing kit (if any) will be replied.
2294
+ */
2295
+ export declare function AddKit(kit: Kit): Action;
2296
+
2297
+ /**
2298
+ * This action can be used to manually start the combat counter.
2299
+ */
2300
+ export declare function StartCombatCounter(): Action;
2301
+
2302
+ /**
2303
+ * This action instructs the active creature to leave the area by choosing the fastest ways out of the sight of the party. The creature disappears as soon as it is out of sight. Otherwise, it disappears after a set amount of time.
2304
+ */
2305
+ export declare function EscapeAreaNoSee(): Action;
2306
+
2307
+ /**
2308
+ * This action instructs the target object to leave the current area, either by walking, or, if the path is blocked, by simply disappearing. The action functions as a combination of EscapeAreaDestroy() and MoveBetweenAreas(). The parameters are similar to MoveBetweenAreas(), in that it takes in all the same information, but unlike MoveBetweenAras(), the character will search for the nearest travel trigger, move to that, then execute his movement to the specified area. If he cannot find a travel trigger, he will execute the movement.
2309
+ */
2310
+ export declare function EscapeAreaObjectMove(area: AreRef, object: ObjectPtr, x: number, y: number, face: Direction): Action;
2311
+
2312
+ /**
2313
+ * This action instructs the active creature to leave the area via the specified region.
2314
+ */
2315
+ export declare function EscapeAreaObject(object: ObjectPtr): Action;
2316
+
2317
+ /**
2318
+ * This action replaces the item in second parameter with the item in first parameter. If the target does not have the item in the second parameter, the item in the first parameter will still be created in the inventory. Note that this action will not automatically equip the item that's created.
2319
+ */
2320
+ export declare function TakeItemReplace(give: ItmRef, take: ItmRef, object: ObjectPtr): Action;
2321
+
2322
+ /**
2323
+ * This action adds the specified spell to the active creature. The message <creature\_name> has gained a special ability: "Ability" is displayed in the message log.
2324
+ */
2325
+ export declare function AddSpecialAbility(spell: SplRef): Action;
2326
+
2327
+ /**
2328
+ * This action causes the active creature to attempt to disarm the specified trap. This action can be used for any creature (not just thieves) though success in disarming is dependent on points in the Disarm Trap skill.
2329
+
2330
+ ```weidu-baf
2331
+ IF
2332
+ See("Trap01")
2333
+ Class(Myself,THIEF_ALL)
2334
+ THEN
2335
+ RESPONSE #100
2336
+ RemoveTraps("Trap01")
2337
+ END
2338
+ ```
2339
+ */
2340
+ export declare function RemoveTraps(trap: ObjectPtr): Action;
2341
+
2342
+ /**
2343
+ * This action destroys all destructible equipment on the active creature. Items flagged as indestructible (magical) will not be destroyed.
2344
+ */
2345
+ export declare function DestroyAllDestructableEquipment(): Action;
2346
+
2347
+ /**
2348
+ * This action changes a Paladin to a Fallen Paladin.
2349
+ */
2350
+ export declare function RemovePaladinHood(): Action;
2351
+
2352
+ /**
2353
+ * This action changes a Ranger to a Fallen Ranger.
2354
+ */
2355
+ export declare function RemoveRangerHood(): Action;
2356
+
2357
+ /**
2358
+ * This action restores a Fallen Paladin to normal Paladin status if reputation is 10 or more. Otherwise increments Reputation to 10 and nothing else.
2359
+ */
2360
+ export declare function RegainPaladinHood(): Action;
2361
+
2362
+ /**
2363
+ * This action restores a Fallen Ranger to normal Ranger status. If reputation is lower than 10 it is increased to 10.
2364
+ */
2365
+ export declare function RegainRangerHood(): Action;
2366
+
2367
+ /**
2368
+ * This action copies the base animation (i.e. no armour or colouring) of the target creature to the active creature.
2369
+ */
2370
+ export declare function PolymorphCopyBase(object: ObjectPtr): Action;
2371
+
2372
+ /**
2373
+ * This action hides the docking borders, menus, etc. on the sides of the screen.
2374
+ */
2375
+ export declare function HideGUI(): Action;
2376
+
2377
+ /**
2378
+ * This action restores the docking borders, menus etc. to the sides of the screen.
2379
+ */
2380
+ export declare function UnhideGUI(): Action;
2381
+
2382
+ /**
2383
+ * This action changes the name of the active creature to the specified strref.
2384
+ */
2385
+ export declare function SetName(string: StrRef): Action;
2386
+
2387
+ /**
2388
+ * This action sets the active creatures kit to the specified kit . Abilities from any previous kits are kept. Class restrictions apply for kits. When attempting adding an invalid kit, the existing kit (if any) will be replied.
2389
+ */
2390
+ export declare function AddSuperKit(kit: Kit): Action;
2391
+
2392
+ /**
2393
+ * This action causes the active creature to run away from the specified creature, for the specified time. The time parameter is measured in AI updates, which default to 15 updates per second. Occasionally, fleeing creatures stop to attack another creature.
2394
+
2395
+ ```weidu-baf
2396
+ IF
2397
+ HPPercentLT(Myself,30)
2398
+ THEN
2399
+ RESPONSE #100
2400
+ RunAwayFrom(LastAttackerOf(Myself),180)
2401
+ END
2402
+ ```
2403
+ */
2404
+ export declare function RunAwayFrom(creature: ObjectPtr, time: number): Action;
2405
+
2406
+ /**
2407
+ *
2408
+ */
2409
+ export declare function PlayDeadInterruptible(time: number): Action;
2410
+
2411
+ /**
2412
+ * This action instructs the active creature to "play dead", i.e. to lay on the ground, for the specified interval (measured in AI updates per second (AI updates default to 15 per second). If used on a PC, the player can override the action by issuing a standard move command. Other conditions are checked during the play dead period.
2413
+ */
2414
+ export declare function PlayDeadInterruptable(time: number): Action;
2415
+
2416
+ /**
2417
+ * This action says to jump the object in the first parameter to the object in the second parameter. The object in the first parameter does NOT have to be in the same area as the target, but must already be present in the saved game (as either an NPC or MakeGlobal()).
2418
+ */
2419
+ export declare function MoveGlobalObject(object: ObjectPtr, target: ObjectPtr): Action;
2420
+
2421
+ /**
2422
+ * This action displays the specified strref over the head of the creature with the specified item. The action only checks current party members.
2423
+ */
2424
+ export declare function DisplayStringHeadOwner(item: ItmRef, string: StrRef): Action;
2425
+
2426
+ /**
2427
+ *
2428
+ */
2429
+ export declare function StartDialogOverride(dialogfile: string, target: ObjectPtr, unused0: number, unused1: number, converseasitem: number): Action;
2430
+
2431
+ /**
2432
+ * This action instructs the active creature to start the specified dialog with the specified target. The dialog can be initiated from a distance and must have at least one state with all its top level conditions true else it will not initiate. The active creature will not have its dialog file permanently set to the file specified by the DialogFile parameter.
2433
+ The second signature of this action is not listed in the action.ids file provided with the game. When using this signature, the third integer paramter can be used to indicate the dialog is initiated by an item (e.g. Lilarcor) - if this is the case, the item name will be used as the creature name in the feedback window.
2434
+ */
2435
+ export declare function StartDialogOverride(dialogfile: string, target: ObjectPtr): Action;
2436
+
2437
+ /**
2438
+ * This action creates the specified creature at the specified point and sets its animation to that of the active creature.
2439
+ */
2440
+ export declare function CreateCreatureCopyPoint(creature: CreRef, object: ObjectPtr, dest: Point): Action;
2441
+
2442
+ /**
2443
+ * This action instructs the active creature to play their associated bard song.
2444
+ */
2445
+ export declare function BattleSong(): Action;
2446
+
2447
+ /**
2448
+ *
2449
+ */
2450
+ export declare function MoveToSavedLocationn(global: string, scope: Scope): Action;
2451
+
2452
+ /**
2453
+ * This action instructs the active creature to move to the previously saved specified location.
2454
+
2455
+ ```weidu-baf
2456
+ IF
2457
+ Global("MoveToLocation","LOCALS",0)
2458
+ THEN
2459
+ RESPONSE #50
2460
+ SetGlobal("MoveToLocation","LOCALS",1)
2461
+ MoveToSavedLocationn("DefaultLocation","LOCALS")
2462
+ END
2463
+ ```
2464
+ */
2465
+ export declare function MoveToSavedLocation(global: string, scope: Scope): Action;
2466
+
2467
+ /**
2468
+ * This action inflicts the specified amount of damage (of the specified type) on the target creature.
2469
+ */
2470
+ export declare function ApplyDamage(object: ObjectPtr, amount: number, type: DMGtype): Action;
2471
+
2472
+ /**
2473
+ * This action extends the time taken for the banter timer to expire. The banter timers are hardcoded and every time one expires an NPC's b****.dlg is called.
2474
+ */
2475
+ export declare function BanterBlockTime(time: number): Action;
2476
+
2477
+ /**
2478
+ * This action instructs the active creature to continually attack the target, i.e. the active creature will not switch targets until its target is dead.
2479
+
2480
+ ```weidu-baf
2481
+ IF
2482
+ See([EVILCUTOFF])
2483
+ Class(LastSeenBy(),MAGE_ALL)
2484
+ !InParty(LastSeenBy())
2485
+ THEN
2486
+ RESPONSE #100
2487
+ Attack(LastSeenBy())
2488
+ END
2489
+ ```
2490
+ */
2491
+ export declare function Attack(target: ObjectPtr): Action;
2492
+
2493
+ /**
2494
+ * This action sets a variable (specified by name) in the scope (specified by area) to the value (specified by value). See the [variable type](../../appendices/variables.htm) appendix for details on variables.
2495
+
2496
+ ```weidu-baf
2497
+ IF
2498
+ Global("KRINAREA","AR0400",0)
2499
+ THEN
2500
+ RESPONSE #100
2501
+ CreateCreature("ORC01",[1738.543],0)
2502
+ SetGlobal("KRINAR EA","AR0400",1)
2503
+ END
2504
+ ```
2505
+ */
2506
+ export declare function SetGlobal(name: string, scope: Scope, value: number): Action;
2507
+
2508
+ /**
2509
+ * This action dictates whether the banter timer can expire.
2510
+ */
2511
+ export declare function BanterBlockFlag(state: boolean): Action;
2512
+
2513
+ /**
2514
+ * This action is used in conjunction with animations in ARE files. The action sets the enabled state of an animation (specified by the object parameter).
2515
+ */
2516
+ export declare function AmbientActivate(object: ObjectPtr, state: boolean): Action;
2517
+
2518
+ /**
2519
+ * It is likely that the first parameter refers to a transition trigger and the second parameter refers to a door type in an area. In this manner, the trigger is activated and deactivated based on the open state of the door.
2520
+ */
2521
+ export declare function AttachTransitionToDoor(global: string, object: ObjectPtr): Action;
2522
+
2523
+ /**
2524
+ * This action applies a percentage damage (of the specified damage type) to the target object.
2525
+ */
2526
+ export declare function ApplyDamagePercent(object: ObjectPtr, amount: number, type: DMGtype): Action;
2527
+
2528
+ /**
2529
+ * This action acts as a shortcut for SetGlobal(). The action can only set global variables.
2530
+ */
2531
+ export declare function SG(name: string, num: number): Action;
2532
+
2533
+ /**
2534
+ * This action will add a map note onto the current area's mini-map at the specified position. The position is a location on the actual area map (not the minimap).
2535
+ */
2536
+ export declare function AddMapNote(position: Point, string: StrRef): Action;
2537
+
2538
+ /**
2539
+ * This action ends the demo and returns the player to the game selection screen.
2540
+ */
2541
+ export declare function DemoEnd(): Action;
2542
+
2543
+ /**
2544
+ *
2545
+ */
2546
+ export declare function SpellRES(spell: SplRef, target: ObjectPtr): Action;
2547
+
2548
+ /**
2549
+ * This action causes the active creature to cast the specified spell at the target object. The spell must currently be memorised by the caster, and may be interrupted while being cast. The caster must meet the level requirements of the spell. For the RES version of the action, the spell name can not consist of only numbers, should be written in upper case and should be no more than 7 characters long.
2550
+
2551
+ ```weidu-baf
2552
+ IF
2553
+ See([EVILCUTOFF])
2554
+ !InParty([EVILCUTOFF])
2555
+ !HasBounceEffects([ EVILCUTOFF])//like cloak of mirroring or spell deflection
2556
+ !HasImmunityEffects([EVILCUTOFF])//
2557
+ HaveSpell(WIZARD_MAGIC_MISSILE)
2558
+ OR(2)
2559
+ !StateCheck([EVILCUTOFF],STATE_INVISIBLE)
2560
+ !StateCheck([EVILCUTOFF],STATE_IMPROVEDINVISIBLITY)
2561
+ CheckStatLT([EVILCUTOFF], 30,RESISTMAGIC)
2562
+ !Race([EVILCUTOFF],LICH)
2563
+ !Race([EVILCUTOFF],RAKSHASA)
2564
+ THEN
2565
+ RESPONSE #100
2566
+ Spell([EVILCUTOFF],WIZARD_MAGIC_MISSILE)
2567
+ END
2568
+ ```
2569
+
2570
+ {% capture note %}
2571
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
2572
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console **IF** the 8<sup>th</sup> character isn't valid.
2573
+ {% endcapture %} {% include note.html %}
2574
+ */
2575
+ export declare function Spell(target: ObjectPtr, spell: SpellID): Action;
2576
+
2577
+ /**
2578
+ * It is likely to move all creatures present in the saved game that are currently in the FromArea parameter and move them to the Location in the ToArea parameter.
2579
+ */
2580
+ export declare function MoveGlobalsTo(fromarea: AreRef, toarea: AreRef, location: Point): Action;
2581
+
2582
+ /**
2583
+ * This action displays the specified string over the head on the specified object (on the game-screen). The text stays onscreen until the associated sound has completed playing.
2584
+ */
2585
+ export declare function DisplayStringWait(object: ObjectPtr, string: StrRef): Action;
2586
+
2587
+ /**
2588
+ * This action instructs all creatures in the current area(?) ignore the following states flags for the time specified, or until a save-game reload. The creatures still have the state flags set. This action mainly seems to be used to get player characters to look like they are "paying attention" to anything that is happening around them.
2589
+ The following states are overridden:
2590
+
2591
+ * state\_sleeping
2592
+ * state\_panic
2593
+ * state\_stunned
2594
+ * state\_helpless
2595
+ * state\_confused
2596
+
2597
+ The following states are not overridden:
2598
+
2599
+ * state\_invisible
2600
+ * state\_frozen\_death
2601
+ * state\_stone\_death
2602
+ * state\_dead
2603
+ * state\_silence
2604
+ * state\_charmed
2605
+ * state\_improved invisibility
2606
+ * state\_mirror\_image
2607
+
2608
+ Other states are untested.
2609
+ */
2610
+ export declare function StateOverrideTime(time: number): Action;
2611
+
2612
+ /**
2613
+ *
2614
+ */
2615
+ export declare function StateOverrideFlag(state: boolean): Action;
2616
+
2617
+ /**
2618
+ * This action modifies the probability of a daytime rest interruption (by modifying fields in the ARE file).
2619
+ */
2620
+ export declare function SetRestEncounterProbabilityDay(prob: number): Action;
2621
+
2622
+ /**
2623
+ * This action modifies the probability of a night-time rest interruption (by modifying fields in the ARE file).
2624
+ */
2625
+ export declare function SetRestEncounterProbabilityNight(prob: number): Action;
2626
+
2627
+ /**
2628
+ * This action is used in conjunction with ambient sounds in ARE files. The action sets the enabled state of an ambient sound (specified by the object parameter).
2629
+ */
2630
+ export declare function SoundActivate(object: ObjectPtr, state: boolean): Action;
2631
+
2632
+ /**
2633
+ * The action plays the specified song. Values are from [SONGLIST.2DA]({{ 2da }}/songlist.htm).
2634
+ */
2635
+ export declare function PlaySong(song: number): Action;
2636
+
2637
+ /**
2638
+ *
2639
+ */
2640
+ export declare function ForceSpellRangeRES(res: string, target: ObjectPtr): Action;
2641
+
2642
+ /**
2643
+ * It is likely that it will force the specified spell if the target is within range of the spell.
2644
+
2645
+ {% capture note %}
2646
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
2647
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8th character isn't valid.
2648
+ {% endcapture %} {% include note.html %}
2649
+ */
2650
+ export declare function ForceSpellRange(target: ObjectPtr, spell: SpellID): Action;
2651
+
2652
+ /**
2653
+ *
2654
+ */
2655
+ export declare function ForceSpellPointRangeRES(res: string, target: Point): Action;
2656
+
2657
+ /**
2658
+ * It is likely that it will force the specified spell if the point is within range of the spell.
2659
+
2660
+ {% capture note %}
2661
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
2662
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8th character isn't valid.
2663
+ {% endcapture %} {% include note.html %}
2664
+ */
2665
+ export declare function ForceSpellPointRange(target: Point, spell: SpellID): Action;
2666
+
2667
+ /**
2668
+ * This action changes the specified sound reference (SndSlot) on the specified creature to the specified value. It should be noted that the biography can be changed by this action, as it is listed as a SoundSlot (EXISTANCE5).
2669
+ */
2670
+ export declare function SetPlayerSound(object: ObjectPtr, string: StrRef, slotnum: SndSlot): Action;
2671
+
2672
+ /**
2673
+ * This action dictates whether resting is allowed in the current area.
2674
+ */
2675
+ export declare function SetAreaRestFlag(canrest: number): Action;
2676
+
2677
+ /**
2678
+ * This action removes effects with a duration timing mode from the specified object, if the remaining duration is below the ticks parameter. The action appears to only work from a creature script.
2679
+ */
2680
+ export declare function FakeEffectExpiryCheck(object: ObjectPtr, ticks: number): Action;
2681
+
2682
+ /**
2683
+ * This action creates the specified creature at the specified location, facing the specified direction. The creature will be created even if the searchmap is marked as impassable, or whether there are any other obstructions.
2684
+ */
2685
+ export declare function CreateCreatureImpassableAllowOverlap(creature: CreRef, location: Point, face: Direction): Action;
2686
+
2687
+ /**
2688
+ * This action sets the 'BeenInParty' flag in the [CRE](../../file_formats/ie_formats/cre_v1.htm#CREV1_0_Header) file of the active creature. This action also triggers appropriate dialog and script file changes (as referenced in [PDIALOG.2DA]({{ 2da }}/pdialog.htm)).
2689
+ */
2690
+ export declare function SetBeenInPartyFlags(): Action;
2691
+
2692
+ /**
2693
+ * This action returns the player to the game start screen.
2694
+ */
2695
+ export declare function GoToStartScreen(): Action;
2696
+
2697
+ /**
2698
+ * This action teleports the party to the area from which the "Area Switch: Pocket Plane" effect was last used. If this effect has never been used, or the party is not in the Pocket Plane this action has no effect.
2699
+ */
2700
+ export declare function ExitPocketPlane(): Action;
2701
+
2702
+ /**
2703
+ * This action gives a level dependent amount of XP to the party or a single party member. The XP amount is listed in [XPLIST.2DA]({{ 2da }}/xplist.htm) at the intersection of the party level (column) and quest row (the mis-named parameter). The file lists the same XP value for all quests for all levels.
2704
+ */
2705
+ export declare function AddXP2DA(column: string): Action;
2706
+
2707
+ /**
2708
+ * This will remove a map note from the current area's mini-map at the specified position. The position is a location on the actual area map (not the minimap).
2709
+ */
2710
+ export declare function RemoveMapNote(position: Point, string: StrRef): Action;
2711
+
2712
+ /**
2713
+ * This action turns any undead creatures within range of the active creature. This action can be used for any creature (not just paladins/clerics) though success in turning is dependent on the Turn Undead level of the creature, which is only calculated for paladins and clerics. The chance to successfully turn undead is based on creatures level and class. Paladins turn at 2 levels less than clerics of the same level. An undead creature will be destroyed/controlled if its level is more than 7 levels below the active creatures turn undead level. An undead creature may be turned (i.e. forced to flee) is its level is equal to, or up to 4 levels below, the active creatures turn undead level.
2714
+
2715
+ ```weidu-baf
2716
+ IF
2717
+ See([EVILCUTOFF])
2718
+ General([EVILCUTOFF],UNDEAD)
2719
+ LevelGT(Mysel f,12)
2720
+ OR(2)
2721
+ Class(Myself,PALADIN_ALL)
2722
+ Class(Myself,CLERIC_ALL)
2723
+ THEN
2724
+ RESPONSE #100
2725
+ Turn()
2726
+ END
2727
+ ```
2728
+ */
2729
+ export declare function Turn(): Action;
2730
+
2731
+ /**
2732
+ * This action will add area type flags (e.g. outdoor, dungeon) to the current area. The areatype value is OR'd, so multiple values can be set. Values are from [areatype.ids]({{ ids }}/areatype.htm)
2733
+ */
2734
+ export declare function AddAreaType(type: AreaType): Action;
2735
+
2736
+ /**
2737
+ * This action will remove area type flags (e.g. outdoor, dungeon) to the current area. Values are from [areatype.ids]({{ ids }}/areatype.htm)
2738
+ */
2739
+ export declare function RemoveAreaType(type: AreaType): Action;
2740
+
2741
+ /**
2742
+ * This action will add area flags (e.g. save enabled, tutorial) to the current area. The area flags value is OR'd, so multiple values can be set. Values are from [areaflag.ids]({{ ids }}/areaflag.htm).
2743
+ */
2744
+ export declare function AddAreaFlag(type: AreaFlag): Action;
2745
+
2746
+ /**
2747
+ * This action will remove area flags (e.g. save enabled, tutorial) to the current area. The area flags value is OR'd, so multiple values can be set. Values are from [areaflag.ids]({{ ids }}/areaflag.htm).
2748
+ */
2749
+ export declare function RemoveAreaFlag(type: AreaFlag): Action;
2750
+
2751
+ /**
2752
+ * This action instructs the active creature to start the specified dialog with the specified target. The dialog can be initiated from a distance and must have at least one state with all its top level conditions true else it will not initiate. The active creature name will not appear as the dialog attribution.
2753
+ */
2754
+ export declare function StartDialogNoName(dialogfile: string, target: ObjectPtr): Action;
2755
+
2756
+ /**
2757
+ * This action sets the specified token to the given variable (in the specified scope). The example script will display 100 over the head of the active creature.
2758
+
2759
+ ```weidu-baf
2760
+ IF
2761
+ Global("Value","GLOBAL",0)
2762
+ THEN
2763
+ RESPONSE #100
2764
+ SetGlobal("Value","GLOBAL",100)
2765
+ SetTokenGlobal("Value","GLOBAL","PPOINTS")
2766
+ DisplayStringHead(Myself,63037) //63037 is <PPOINTS> for me
2767
+ END
2768
+ ```
2769
+ */
2770
+ export declare function SetTokenGlobal(global: string, scope: Scope, token: string): Action;
2771
+
2772
+ /**
2773
+ * This action adds the active creature to the GAM file (if it isn't there already).
2774
+ */
2775
+ export declare function MakeGlobal(): Action;
2776
+
2777
+ /**
2778
+ *
2779
+ */
2780
+ export declare function ReallyForceSpellPointRES(spell: SplRef, target: Point): Action;
2781
+
2782
+ /**
2783
+ * This action causes the active creature to cast the specified spell at the target point. The spell need not currently be memorised by the caster, and will not be interrupted while being cast. The spell is cast instantly (i.e. with a casting time of 0). The caster must meet the level requirements of the spell. For the RES version of the action, the spell name can not consist of only numbers, should be written in upper case and should be no more than 7 characters long.
2784
+
2785
+ {% capture note %}
2786
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
2787
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8<sup>th</sup> character isn't valid.
2788
+ {% endcapture %} {% include note.html %}
2789
+ */
2790
+ export declare function ReallyForceSpellPoint(target: Point, spell: SpellID): Action;
2791
+
2792
+ /**
2793
+ *
2794
+ */
2795
+ export declare function CutAllowScripts(bool: boolean): Action;
2796
+
2797
+ /**
2798
+ *
2799
+ */
2800
+ export declare function SetCursorState(bool: boolean): Action;
2801
+
2802
+ /**
2803
+ * This action starts a cutscene. Player control is removed, though all scripts keep running. Note that actions already in the action list are not cleared without an explicit call to ClearAllActions. The example script is from are0507.bcs.
2804
+ */
2805
+ export declare function SetCutSceneLite(bool: boolean): Action;
2806
+
2807
+ /**
2808
+ * This action instructs the active creature to play the swing weapon animation once. Note that some objects do not have this animation.
2809
+ */
2810
+ export declare function SwingOnce(): Action;
2811
+
2812
+ /**
2813
+ *
2814
+ */
2815
+ export declare function UseItemSlot(target: ObjectPtr, slot: Slots): Action;
2816
+
2817
+ /**
2818
+ *
2819
+ */
2820
+ export declare function UseItemSlotAbility(target: ObjectPtr, slot: Slots, ability: number): Action;
2821
+
2822
+ /**
2823
+ * This action instructs the active creature to use the specified item (object) on the specified target (target). The ability number (i.e. extended header index) to use may be specified. This action is most often used to allow use of potions and wands. The item to be used must exist in the active creature's inventory (not in a container within the inventory) - though it need not be equipped.
2824
+
2825
+ ```weidu-baf
2826
+ IF
2827
+ HPPercentLT(Myself,50)
2828
+ HasItem("potn52",Myself)
2829
+ THEN
2830
+ RESPONSE #100
2831
+ DisplayStringHead(Myself,46150) //quaffs a potion
2832
+ UseItem("potn52",Myself)
2833
+ Continue()
2834
+ END
2835
+ ```
2836
+
2837
+ IWDEE supports also the `UseItemAbility` signature:
2838
+ ```weidu-baf
2839
+ IF
2840
+ !StateCheck(Myself,STATE_MIRRORIMAGE)
2841
+ GlobalLT("MO_UsedIlbratha","GLOBAL",1)
2842
+ HasItemEquiped("SW1H26",Myself) // Ilbratha +1
2843
+ THEN
2844
+ RESPONSE #100
2845
+ SetInterrupt(FALSE)
2846
+ UseItemAbility("SW1H26",Myself,SLOT_AMMO3,1) // Ilbratha +1
2847
+ SetInterrupt(TRUE)
2848
+ IncrementGlobal("MO_UsedIlbratha","GLOBAL",1)
2849
+ END
2850
+ ```
2851
+ */
2852
+ export declare function UseItem(item: ItmRef, target: ObjectPtr): Action;
2853
+
2854
+ /**
2855
+ * This action is used in conjunction with animations in ARE files. The action will start the specified animation sequence.
2856
+ */
2857
+ export declare function StaticSequence(object: ObjectPtr, sequence: number): Action;
2858
+
2859
+ /**
2860
+ * This action changes the palette (BMP file) of the specified animation object.
2861
+ */
2862
+ export declare function StaticPalette(palette: string, object: ObjectPtr): Action;
2863
+
2864
+ /**
2865
+ * This action displays the specified string over the head on the specified object (on the game-screen) even if the target is dead.
2866
+ */
2867
+ export declare function DisplayStringHeadDead(object: ObjectPtr, string: StrRef): Action;
2868
+
2869
+ /**
2870
+ * This action moves the party to ToB, changes the worldmap, and switches scripts and dialogs to the X25 versions.
2871
+ */
2872
+ export declare function MoveToExpansion(): Action;
2873
+
2874
+ /**
2875
+ * This action will immediately set the weather to raining, over the current overlay (rather than taking several seconds to darken the area before starting to rain).
2876
+ */
2877
+ export declare function StartRainNow(): Action;
2878
+
2879
+ /**
2880
+ * This action instructs the active creature to perform the specified animation sequence. Values are from [seq.ids]({{ ids }}/seq.htm).
2881
+ */
2882
+ export declare function SetSequence(sequence: Seq): Action;
2883
+
2884
+ /**
2885
+ * This action displays the specified string over the head on the specified object (on the game-screen), without displaying it in the message log.
2886
+ */
2887
+ export declare function DisplayStringNoNameHead(object: ObjectPtr, string: StrRef): Action;
2888
+
2889
+ /**
2890
+ * This action modifies the probability of a travel encounter (by modifying fields in the WMP file) between the specified areas.
2891
+ */
2892
+ export declare function SetEncounterProbability(fromarea: AreRef, toarea: AreRef, probability: number): Action;
2893
+
2894
+ /**
2895
+ * This action instructs the engine to use the specified column of [WISH.2DA]({{ 2da }}/wish.htm), randomly select 5 choices (rows; count appears hardcoded) and set the appropriate globals for those spells. Once the maximum "wish choices" have been selected, the dialog continues and casts the selected spell.
2896
+
2897
+ From a dialog:
2898
+ ```weidu-baf
2899
+ IF ~CheckStatGT(LastTalkedToBy,17,WIS)~ THEN DO ~SetupWish(4,1)~ GOTO 8
2900
+ IF ~Global("WishPower01","GLOBAL",1)~ THEN REPLY #72526 // ~'Breach' on everyone in the area, including the party.~
2901
+ DO ~ActionOverride(LastTalkedToBy,ForceSpellRES("spwish26",Myself)) ApplySpell(Myself,POOF_GONE)~ EXIT
2902
+ ```
2903
+
2904
+ The key is the `Global("WishPower**","GLOBAL",1)`. The highest is "WishPower37", and the highest number in the WISH.2DA is also 37. There are a total of 46 SPWISH\*\*.SPL files, but 9 are unused:
2905
+
2906
+ * SPWISH01 STR Bonus +1
2907
+ * SPWISH02 INT Bonus +1
2908
+ * SPWISH03 DEX Bonus +1
2909
+ * SPWISH04 CON Bonus +1
2910
+ * SPWISH05 WIS Bonus +1
2911
+ * SPWISH06 CHA Bonus +1
2912
+ * SPWISH07 Restoration
2913
+ * SPWISH09 Globe of Blades
2914
+ * SPWISH15 Gain 10,000 Gold (Party)
2915
+
2916
+ Looking at the spells that have a "WishPower\*\*" next to them, this list can be derived (sorted by Wisdom level (E=enemies, P=party, C=caster A=All)):
2917
+ ```weidu-baf
2918
+ Low (9-) Medium (10-14) High (15-17) Ultra (18+)
2919
+
2920
+ Heal E Heal E Heal E TS & IA (X2) P
2921
+ Improved Haste E Improved Haste E Improved Haste E Improved Haste E
2922
+ Dark Planetar E Silenced A Dark Planetar E Lose 10,000 gp P
2923
+ Level Drain P Level Drain P WIS (3) P Level Drain P
2924
+ Hit Points -50% C Hit Points -50% C TS & IA (X2) P Hit Points -50% C
2925
+ Hit Points -15% P Haste A Hit Points -15% P Mass Raise Dead P
2926
+ Lose Spells C Lose Spells C Lose Spells C WIS (3) P
2927
+ STR (3) P STR (3) P STR (3) P Haste A
2928
+ CON (3) P CON (3) P Stats (25) P Stats (25) P
2929
+ DEX (3) P DEX (3) P DEX (3) P Rest & Remem. P
2930
+ INT (3) P INT (3) P Silenced A Bad Luck A
2931
+ Slowed P Slowed P Rest & Remem. P Meteor Swarm C
2932
+ Restoration P Restoration P Improved Haste P Restoration P
2933
+ Gr. Deathblow P Gr. Deathblow P Gr. Deathblow P Gr. Deathblow P
2934
+ Hardiness P Hardiness P Breach E Hardiness P
2935
+ Create Wand C Create Wand C Create Wand C Create Wand C
2936
+ Create Potion C Create Potion C Create Potion C Create Potion C
2937
+ Breach A Breach A Breach A Improved Haste P
2938
+ Wing Buffet A Wing Buffet A Wing Buffet A Breach E
2939
+ Heal A Heal A Heal A Heal A
2940
+ STR (18) A STR (18) A STR (18) A STR (18) A
2941
+ Miscast Magic A Miscast Magic A Miscast Magic A Miscast Magic A
2942
+ Magic Resist A Magic Resist A Magic Resist A Magic Resist A
2943
+ Abi-Dalzim's A Abi-Dalzim's A Abi-Dalzim's A Abi-Dalzim's A
2944
+ Intoxicated A Intoxicated A Intoxicated A Intoxicated A
2945
+ Bad Luck A Bad Luck A Bad Luck A
2946
+ / Breach E Stats (25) P \
2947
+ OR < > OR
2948
+ \ Rest & Remem. P Mass Raise Dead P /
2949
+ ```
2950
+ */
2951
+ export declare function SetupWish(column: number, count: number): Action;
2952
+
2953
+ /**
2954
+ *
2955
+ */
2956
+ export declare function SetupWishObject(creature: ObjectPtr, count: number): Action;
2957
+
2958
+ /**
2959
+ * This action changes the current area. The active creature will move to the specified entry point (from [ENTRIES.2DA]({{ 2da }}/entries.htm)) before travelling. The action appears to only work from a creature script.
2960
+ */
2961
+ export declare function LeaveAreaLUAEntry(area: AreRef, entry: string, point: Point, face: Direction): Action;
2962
+
2963
+ /**
2964
+ * This multiplayer-only action changes the current area. The creature moves to the destination point (from [ENTRIES.2DA]({{ 2da }}/entries.htm)) before travelling (the point parameter is unused). Only EE games support IDS symbols for `Face`.
2965
+ */
2966
+ export declare function LeaveAreaLUAPanicEntry(area: AreRef, entry: string, point: Point, face: Direction): Action;
2967
+
2968
+ /**
2969
+ * This action instructs the script parser to continue looking for actions in the active creatures action list. This is mainly included in scripts for efficiency. Continue should also be appended to any script blocks added to the top of existing scripts, to ensure correct functioning of any blocks which include the OnCreation trigger. Continue may prevent actions being completed until the script parser has finished its execution cycle. Continue() must be the last command in an action list to function correctly. Use of continue in a script block will cause the parser to treater subsequent empty response blocks as though they contained a Continue() command - this parsing can be stopped by including a NoAction() in the empty response block.
2970
+
2971
+ ```weidu-baf
2972
+ IF
2973
+ See(NearestEnemyOf())
2974
+ !InParty(NearestEnemyOf())
2975
+ THEN
2976
+ RESPONSE #100
2977
+ AttackOneRound(NearestEnemyOf())
2978
+ Continue()
2979
+ END
2980
+ ```
2981
+ */
2982
+ export declare function Continue(): Action;
2983
+
2984
+ /**
2985
+ * This action instructs the active creature to play the swing weapon animation. Note that some objects do not have this animation.
2986
+
2987
+ ```weidu-baf
2988
+ IF
2989
+ True()
2990
+ THEN
2991
+ RESPONSE #100
2992
+ Swing()
2993
+ END
2994
+ ```
2995
+ */
2996
+ export declare function Swing(): Action;
2997
+
2998
+ /**
2999
+ * This action instructs the active creature to play the recoil animation. Note that some objects do not have this animation.
3000
+
3001
+ ```weidu-baf
3002
+ IF
3003
+ TookDamage()
3004
+ THEN
3005
+ RESPONSE #100
3006
+ Recoil()
3007
+ END
3008
+ ```
3009
+ */
3010
+ export declare function Recoil(): Action;
3011
+
3012
+ /**
3013
+ * This action instructs the active creature to "play dead", i.e. to lay on the ground, for the specified interval (measured in AI updates per second (AI updates default to 15 per second). If used on a PC, the player can override the action by issuing a standard move command.
3014
+
3015
+ ```weidu-baf
3016
+ IF
3017
+ HPPercentLT(Myself,30)
3018
+ THEN
3019
+ RESPONSE #100
3020
+ PlayDead(240)
3021
+ END
3022
+ ```
3023
+ */
3024
+ export declare function PlayDead(time: number): Action;
3025
+
3026
+ /**
3027
+ * This action can used to make the active creature follow the creature specified by the leader parameter, maintain a relative position determined by the offset parameter.
3028
+
3029
+ ```weidu-baf
3030
+ IF
3031
+ CombatCounter(0)
3032
+ Allegiance(Myself,NEUTRAL)
3033
+ THEN
3034
+ RESPONSE #100
3035
+ Formation("QSLMAGE1",[-2.-5])
3036
+ END
3037
+ ```
3038
+ */
3039
+ export declare function Formation(leader: ObjectPtr, offset: Point): Action;
3040
+
3041
+ /**
3042
+ * This action instantly moves the active creature to the specified point.
3043
+
3044
+ ```weidu-baf
3045
+ IF
3046
+ True()
3047
+ THEN
3048
+ RESPONSE #100
3049
+ ClearAllActions()
3050
+ FadeToColor([20.0],0)
3051
+ MoveViewPoint([1738.543],INSTANT)
3052
+ JumpToPoint([1738.543])
3053
+ Wait(1)
3054
+ CreateVisualEffectObject("SPCLOUD1",Player1)
3055
+ Wait(1)
3056
+ CreateVisualEffectObject("SPFLESHS",Player1)
3057
+ END
3058
+ ```
3059
+ */
3060
+ export declare function JumpToPoint(target: Point): Action;
3061
+
3062
+ /**
3063
+ * This action scrolls the view point (i.e. the area of the current map being displayed onscreen) to the target point ([x.y] at the specified speed. Speeds are taken from [scroll.ids]({{ ids }}/scroll.htm) (VERY\_FAST is equivalent to normal walking speed).
3064
+ */
3065
+ export declare function MoveViewPoint(target: Point, scrollspeed: Scroll): Action;
3066
+
3067
+ /**
3068
+ * This action scrolls the view point (i.e. the area of the current map being displayed onscreen) to the target object ([x.y] at the specified speed. Speeds are taken from [scroll.ids]({{ ids }}/scroll.htm) (VERY\_FAST is equivalent to normal walking speed). The example script is from a cutscene; CUT03C.bcs.
3069
+
3070
+ ```weidu-baf
3071
+ IF
3072
+ True()
3073
+ THEN
3074
+ RESPONSE #100
3075
+ CutSceneId(Player1)
3076
+ FadeToColor([20.0],0)
3077
+ Wait(1)
3078
+ ActionOverride("SPY406",DestroySelf())
3079
+ MoveViewObject(Myself,INSTANT)
3080
+ Wait(1)
3081
+ FadeFromColor([20.0],0)
3082
+ ActionOverride("cpchick1",DestroySelf())
3083
+ ActionOverride("cpchick2",DestroySelf())
3084
+ Wait(1)
3085
+ ActionOverride("Surly",StartDialogueNoSet(Player1))
3086
+ END
3087
+ ```
3088
+ */
3089
+ export declare function MoveViewObject(target: ObjectPtr, scrollspeed: Scroll): Action;
3090
+
3091
+ /**
3092
+ * This action changes the assigned script file for the active creature. The new script name is specified in the scriptfile parameter. The level parameter dictates the script level to change - values are from [scrlev.ids]({{ ids }}/scrlev.htm). Scripts can be set for any scriptable object (container, creature, door etc.), but are not persisted.
3093
+
3094
+ ```weidu-baf
3095
+ IF
3096
+ See([EVILCUTOFF.0.DOG])
3097
+ THEN
3098
+ RESPONSE #100
3099
+ ChangeAIScript("DOGFIGHT",DEFAULT)
3100
+ END
3101
+ ```
3102
+ */
3103
+ export declare function ChangeAIScript(scriptfile: string, level: ScrLev): Action;
3104
+
3105
+ /**
3106
+ * This action starts a timer local to the active creature. The timer is measured in seconds, and the timer value is not saved in save games. The timer is checked with the TimerExpired trigger.
3107
+
3108
+ ```weidu-baf
3109
+ IF
3110
+ Global("KRDEAD","LOCALS",0 )
3111
+ Dead("Shadra01")
3112
+ THEN
3113
+ RESPONSE #100
3114
+ StartTimer("SPAWNMON",12)
3115
+ SetGlobal("KRDEAD","LOCALS",1)
3116
+ END
3117
+
3118
+ IF
3119
+ Timer Expired("SPAWNMON")
3120
+ Global("KRDEAD","LOCALS",1)
3121
+ THEN
3122
+ RESPONSE #100
3123
+ CreateCreature("Grothgar",[700.700],0)
3124
+ END
3125
+ ```
3126
+ */
3127
+ export declare function StartTimer(id: number, time: number): Action;
3128
+
3129
+ /**
3130
+ * This action is used as a form of script communication, in conjunction with the Trigger() trigger. The action has the same range as GiveOrder and affects only one creature at a time. Note that the LastTrigger() object does not get set after receiving a trigger.
3131
+ */
3132
+ export declare function SendTrigger(target: ObjectPtr, triggernum: number): Action;
3133
+
3134
+ /**
3135
+ * This action causes a delay in script processing. The time is measured in seconds.
3136
+
3137
+ ```weidu-baf
3138
+ IF
3139
+ See(Player1)
3140
+ See(Player6)
3141
+ THEN
3142
+ RESPONSE #100
3143
+ MoveToObject(Player1)
3144
+ Wait(2)
3145
+ MoveToObject(Player6)
3146
+ Wait(4)
3147
+ END
3148
+ ```
3149
+ */
3150
+ export declare function Wait(time: number): Action;
3151
+
3152
+ /**
3153
+ * This action resets the fog of war for the area the active creature is in.
3154
+
3155
+ ```weidu-baf
3156
+ IF
3157
+ True()
3158
+ THEN
3159
+ RESPONSE #100
3160
+ UndoExplore()
3161
+ END
3162
+ ```
3163
+ */
3164
+ export declare function UndoExplore(): Action;
3165
+
3166
+ /**
3167
+ * This action removes the fog of war for the area the active creature is in.
3168
+
3169
+ ```weidu-baf
3170
+ IF
3171
+ True()
3172
+ THEN
3173
+ RESPONSE #100
3174
+ Explore()
3175
+ END
3176
+ ```
3177
+ */
3178
+ export declare function Explore(): Action;
3179
+
3180
+ /**
3181
+ * This action changes the time of day. The time parameter is taken from [time.ids]({{ ids }}/time.htm), though a direct number can be specified. The example script is from when Irenicus leaves his dungeon.
3182
+
3183
+ ```weidu-baf
3184
+ IF
3185
+ Global("AmaWaukeen","GLOBAL",1)
3186
+ THEN
3187
+ RESPONSE #100
3188
+ DayNight(MIDNIGHT)
3189
+ SetGlobal("AmaWaukeen","GLOBAL",2)
3190
+ FadeToColor([20.0],0)
3191
+ CreateCreature("shthass1",[877.898],7)
3192
+ StartCutSceneMode()
3193
+ StartCutScene("cut24a")
3194
+ END
3195
+ ```
3196
+ */
3197
+ export declare function DayNight(timeofday: Time): Action;
3198
+
3199
+ /**
3200
+ * This action changes the weather. The action only works in outdoors areas that have weather enabled in the ARE file. Values for the weather parameter are from [weather.ids]({{ ids }}/weather.htm). Note that the fog weather type does not work.
3201
+
3202
+ ```weidu-baf
3203
+ IF
3204
+ Global("KRSTORM","GLOBAL",0)
3205
+ THEN
3206
+ RESPONSE #100
3207
+ Weather(RAIN)
3208
+ SetGlobal("KRSTORM","GLOBAL",1)
3209
+ END
3210
+ ```
3211
+
3212
+ {% capture note %}
3213
+ In the EE's, the action has no effect if `Weather` has been disabled in the game options.
3214
+ In addition, Fog option needs `Enable Fog` to be enabled in the game options.
3215
+ {% endcapture %} {% include note.html %}
3216
+ */
3217
+ export declare function Weather(weather: WeatherID): Action;
3218
+
3219
+ /**
3220
+ * This action calls lightning from the sky against the specified target, causing immediate death (unless the target has the MinHP effect applied). The lightning does not always show, and if it does, it is not always in the expected location.
3221
+
3222
+ ```weidu-baf
3223
+ IF
3224
+ True()
3225
+ THEN
3226
+ RESPONSE #100
3227
+ CutSceneId("DRUID12a")
3228
+ CallLightning("Orc05")
3229
+ CallLightning("Orc06")
3230
+ END
3231
+ ```
3232
+ */
3233
+ export declare function CallLightning(target: ObjectPtr): Action;
3234
+
3235
+ /**
3236
+ * This action will sequentially change the visual representation of armour the active creature is wearing. The action cycles from the lowest (none) to the highest (plate mail) armour level.
3237
+ */
3238
+ export declare function VEquip(item: number): Action;
3239
+
3240
+ /**
3241
+ * This action is used to create a creature - either an NPC, a neutral creature or an enemy. NewObject is the filename of the creature to create, Location is the coordinates to create the creature at ([x.y] format) and direction being the direction the creature is facing (0-15, 0 being south and the facing values increasing as the character turns clockwise). Note that a coordinate of [-1.-1] will create the creature next to the active creature.
3242
+
3243
+ This script is from the area script for the Copper Coronet (AR0406) and creates extra guards when the Player is discovered in the off limits area.
3244
+
3245
+ ```weidu-baf
3246
+ IF
3247
+ Global("CopperGuards","GLOBAL",1)
3248
+ THEN
3249
+ RESPONSE #100
3250
+ CreateCreature("ccguard1",[2338.412],14)
3251
+ CreateCreature("ccguard2",[2318.457],14)
3252
+ CreateCreature("ccguard1",[2749.793],6)
3253
+ CreateCreature("ccguard2",[2791.831],6)
3254
+ CreateCreature("ccguard1",[1981.762],14)
3255
+ CreateCreature("ccguard1",[1286.1500],14)
3256
+ END
3257
+ ```
3258
+ */
3259
+ export declare function CreateCreature(creature: CreRef, location: Point, face: Direction): Action;
3260
+
3261
+ /**
3262
+ *
3263
+ */
3264
+ export declare function Dialog(object: ObjectPtr): Action;
3265
+
3266
+ /**
3267
+ * This action instructs the active creature to initiate dialog with the target creature. Dialog will not be initiated if the creature using this action has been assigned a dialog that has all top level conditions returning false.
3268
+
3269
+ ```weidu-baf
3270
+ IF
3271
+ GlobalTimerExpired("Yeslick","GLOBAL")
3272
+ Global("FLOODED","GLOBAL",0)
3273
+ THEN
3274
+ RESPONSE #100
3275
+ Dialogue([PC])
3276
+ END
3277
+ ```
3278
+ */
3279
+ export declare function Dialogue(object: ObjectPtr): Action;
3280
+
3281
+ /**
3282
+ * This action creates the specified item (resref) on the active creature. The usage parameters determine the number of items created or the number of charges on the item, depending on the item type being created. The example script is from AR0602.
3283
+
3284
+ ```weidu-baf
3285
+ IF
3286
+ Global("BG1Pantaloons","GLOBAL",0)
3287
+ PartyHasItem("MISC47")
3288
+ THEN
3289
+ RESPONSE #100
3290
+ SetGlobal("BG1Pantaloons","GLOBAL",1)
3291
+ ActionOverride("Picture1",CreateItem("MISC47",0,0,0))
3292
+ Continue()
3293
+ END
3294
+ ```
3295
+ */
3296
+ export declare function CreateItem(item: ItmRef, usage1: number, usage2: number, usage3: number): Action;
3297
+
3298
+ /**
3299
+ * This action is similar to [Wait()](#63), it causes a delay in script processing. The time is measured in AI updates (which default to 15 per second)
3300
+
3301
+ ```weidu-baf
3302
+ IF
3303
+ See(NearestEnemyOf())
3304
+ THEN
3305
+ RESPONSE #100
3306
+ DisplayStingHead(Myself,50712)// Attack!! Attack!!
3307
+ SmallWait(120)
3308
+ Attack(NearestEnemyOf())
3309
+ END
3310
+ ```
3311
+ */
3312
+ export declare function SmallWait(time: number): Action;
3313
+
3314
+ /**
3315
+ * This action instructs the active creature to face the specified direction. Directions run from 0-15 with 0 being south and moving clockwise. Negative values act as relative directions to the current direction.
3316
+
3317
+ ```weidu-baf
3318
+ IF
3319
+ Global("BeholderBehavior","LOCALS",0)
3320
+ See([PC])
3321
+ HPGT(Myself,65)
3322
+ THEN
3323
+ RESPONSE #100
3324
+ FaceObject([PC])
3325
+ ForceSpell([PC],BEHOLDER_CHARM_PERSON)
3326
+ Continue()
3327
+ END
3328
+ ```
3329
+ */
3330
+ export declare function Face(direction: Direction): Action;
3331
+
3332
+ /**
3333
+ * This action causes the active creature to walk randomly, staying within the current area. The example script is blbear.bcs; it instructs bears to walk rather than fight if the nearest enemy is a druid.
3334
+
3335
+ ```weidu-baf
3336
+ IF
3337
+ Delay(5)
3338
+ See(NearestEnemyOf(Myself))
3339
+ Class(NearestEnemyOf(Myself),DRUID)
3340
+ NumCreatureGT([ENEMY],1)
3341
+ THEN
3342
+ RESPONSE #100
3343
+ RandomWalk()
3344
+ END
3345
+ ```
3346
+ {% capture note %}
3347
+ * This action will never stop, (unless interrupted in specific situations), and thus never leave the action list.
3348
+ * Executes [Wait()](#63) for a random amount of time, (1–40 seconds), if the creature goes off-screen.
3349
+ * Has a 50/50 chance to [MoveToPoint()](#23), or do a pass of [RandomTurn()](#130), (including [RandomTurn()](#130)'s wait time).
3350
+
3351
+ {% endcapture %} {% include note.html %}
3352
+ */
3353
+ export declare function RandomWalk(): Action;
3354
+
3355
+ /**
3356
+ * This action sets whether a creature can be interrupted while carrying out script actions.
3357
+
3358
+ ```weidu-baf
3359
+ IF
3360
+ See(Player2)
3361
+ !Range(Player2,4)
3362
+ THEN
3363
+ RESPONSE #100
3364
+ SetInterrupt(FALSE)
3365
+ MoveToObject("Player2")
3366
+ SetInterrupt (TRUE)
3367
+ END
3368
+ ```
3369
+ */
3370
+ export declare function SetInterrupt(state: boolean): Action;
3371
+
3372
+ /**
3373
+ * This action instructs the active creature to protect the specified creature (i.e. attack any enemies of the creature), while staying within the specified range. The example script is from IWD, 4003bsg.bcs and controls the zombies guarding Presio.(4003BSG.bcs).
3374
+
3375
+ ```weidu-baf
3376
+ IF
3377
+ True()
3378
+ THEN
3379
+ RESPONSE #100
3380
+ ProtectObject("Presio",100)
3381
+ END
3382
+ ```
3383
+ */
3384
+ export declare function ProtectObject(target: ObjectPtr, range: number): Action;
3385
+
3386
+ /**
3387
+ * This action instructs the active creature to move to the specified point and marks the creature as a leader. The following example script sets Player1 walking to [3363.2954] and sets Player2 and Player3 to "follow" to [3363.2954] in a line and with minimal walking into each other. This action is not fully understood, and is not particularly reliable.
3388
+
3389
+ ```weidu-baf
3390
+ IF
3391
+ HotKey(E)
3392
+ THEN
3393
+ RESPONSE #100
3394
+ ActionOverride(Player1,Leader([3363.2954]))
3395
+ ActionOverride(Player2,Follow([3363.2954]))
3396
+ ActionOverride(Player3,Follow([3363.2954]))
3397
+ END
3398
+ ```
3399
+ */
3400
+ export declare function Leader(point: Point): Action;
3401
+
3402
+ /**
3403
+ * This action instructs the active creature to move to the specified point following the marked Leader.
3404
+ */
3405
+ export declare function Follow(point: Point): Action;
3406
+
3407
+ /**
3408
+ * This action instructs the active creature to drop the specified item at the specified location (relative to the active creature). The active creature must have the item to be dropped. Note that a coordinate of [-1.-1] will drop the item next to the active creature.
3409
+
3410
+ ```weidu-baf
3411
+ IF
3412
+ Clicked([ANYONE])
3413
+ Range(LastTrigger,12)
3414
+ THEN
3415
+ RESPONSE #100
3416
+ DropItem("SCRL1B",[345.1210])
3417
+ END
3418
+ ```
3419
+ */
3420
+ export declare function DropItem(item: ItmRef, location: Point): Action;
3421
+
3422
+ /**
3423
+ * This action instructs the active creature to leave the current area.
3424
+ */
3425
+ export declare function LeaveArea(area: AreRef, point: Point, face: Direction): Action;
3426
+
3427
+ /**
3428
+ * This action instructs the active creature to select the specified slot, and use the ability in the extended header specified by the ability parameter. The example script is from ankheg.bcs.
3429
+
3430
+ ```weidu-baf
3431
+ IF
3432
+ See(NearestEnemyOf(Myself))
3433
+ Range(NearestEnemyOf(Myself),5)
3434
+ Delay(12)
3435
+ THEN
3436
+ RESPONSE #40
3437
+ SelectWeaponAbility(SLOT_WEAPON,0)
3438
+ RunAwayFrom(NearestEnemyOf(Myself),45)
3439
+ AttackReevaluate(NearestEnemyOf(Myself),15)
3440
+ RESPONSE #60
3441
+ SelectWeaponAbility(SLOT_WEAPON1,0)
3442
+ AttackReevaluate(NearestEnemyOf(Myself),15)
3443
+ END
3444
+ ```
3445
+ */
3446
+ export declare function SelectWeaponAbility(weaponnum: Slots, abilitynum: number): Action;
3447
+
3448
+ /**
3449
+ * The signature of this action is not listed in the action.ids file provided with the game. This action causes the active creature to leave the area using the trigger region identified by the specified parameter. The parameter is the internal global ID of the region.
3450
+ */
3451
+ export declare function LeaveAreaName(target: number): Action;
3452
+
3453
+ /**
3454
+ * This action instructs the active creature to attack creatures with the same specific value as the target creature.
3455
+ */
3456
+ export declare function GroupAttack(target: ObjectPtr): Action;
3457
+
3458
+ /**
3459
+ *
3460
+ */
3461
+ export declare function SpellPointRES(spell: SplRef, target: Point): Action;
3462
+
3463
+ /**
3464
+ * This action causes the active creature to cast the specified spell at the specified point ([x.y]). The spell must currently be memorised by the caster, and may be interrupted while being cast. The caster must meet the level requirements of the spell. For the RES version of the action, the spell name can not consist of only numbers, should be written in upper case and should be no more than 7 characters long. The example script is from `"andris.bcs"`.
3465
+
3466
+ ```weidu-baf
3467
+ IF
3468
+ Global("AndrisBehavior","AR1009",0)
3469
+ See(NearestEnemyOf(Myself))
3470
+ THEN
3471
+ RESPONSE #100
3472
+ ForceSpellPoint([2002.1554],WIZARD_DIMENSION_DOOR)
3473
+ Wait(1)
3474
+ SpellNoDec(NearestEnemyOf(Myself),WIZARD_CONFUSION)
3475
+ SetGlobal("AndrisBehavior","AR1009",1)
3476
+ END
3477
+ ```
3478
+
3479
+ {% capture note %}
3480
+ Scripts can handle `RES` filenames with `+`, Dialogs and the console cannot. Same with the `~`, `` ` ``, `'`, `@`, `$`, `^`, and `&` characters, maybe some more.
3481
+ - This action will default to a spell matching the first 7 characters in Dialogs/Console *IF* the 8<sup>th</sup> character isn't valid.
3482
+ {% endcapture %} {% include note.html %}
3483
+ */
3484
+ export declare function SpellPoint(target: Point, spell: SpellID): Action;
3485
+
3486
+ /**
3487
+ * This action applies the benefits of resting (i.e. healing, restoring spells and restoring abilities) to the active creature. The action does not play the rest movie or advance game time. The example script is from cut28a.bcs.
3488
+
3489
+ ```weidu-baf
3490
+ IF
3491
+ True()
3492
+ THEN
3493
+ RESPONSE #100
3494
+ CutSceneId(Player1)
3495
+ StorePartyLocations()
3496
+ FadeToColor([30.0],0)
3497
+ Wait(1)
3498
+ Rest()
3499
+ ActionOverride(Player2,Rest())
3500
+ ActionOverride(Player3,Rest())
3501
+ ActionOverride(Player4,Rest())
3502
+ ActionOverride(Player5,Rest())
3503
+ ActionOverride(Player6,Rest())
3504
+ (cut short for brevity)
3505
+ ```
3506
+ */
3507
+ export declare function Rest(): Action;
3508
+
3509
+ /**
3510
+ * This action instructs the active creature to attack the target, without sounding a battlecry.
3511
+ */
3512
+ export declare function AttackNoSound(target: ObjectPtr): Action;