File size: 22,350 Bytes
b6a38d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
-- ========== GENERATED BY CombatTask Editor DO NOT EDIT MANUALLY! ==========

PlaceObj('CombatTask', {
	competition = true,
	description = T(845938577236, --[[CombatTask DamageCompetition description]] "<Nick> should deal more damage than <Nick(otherUnitId)>"),
	group = "Competition",
	holdUntilEnd = true,
	id = "DamageCompetition",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "DamageDone",
			Handler = function (self, attacker, target, dmg, hit_descr)
				if IsMerc(attacker) and IsKindOf(target, "Unit") and target:IsOnEnemySide(attacker) then
					local task = FindActiveCombatTask(self.id)
					if dmg > 0 and task then
						if task.unitId == attacker.session_id then
							task:Update(dmg)
						elseif task.otherUnitId == attacker.session_id then
							task:Update(0, dmg)
						end
					end
				end
			end,
		}),
	},
	name = T(224628040381, --[[CombatTask DamageCompetition name]] "Damage Competition"),
	requiredProgress = 0,
})

PlaceObj('CombatTask', {
	competition = true,
	description = T(841992932482, --[[CombatTask KillCompetition description]] "<Nick> should make more kills than <Nick(otherUnitId)>"),
	group = "Competition",
	holdUntilEnd = true,
	id = "KillCompetition",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "Attack",
			Handler = function (self, action, results, attack_args, combat_starting, attacker, target)
				if IsMerc(attacker) then
					local kills = EnemiesKilled(attacker, results)
					local task = FindActiveCombatTask(self.id)
					if kills > 0 and task then
						if task.unitId == attacker.session_id then
							task:Update(kills)
						elseif task.otherUnitId == attacker.session_id then
							task:Update(0, kills)
						end
					end
				end
			end,
		}),
	},
	name = T(769258541854, --[[CombatTask KillCompetition name]] "Kill Competition"),
	requiredProgress = 0,
})

PlaceObj('CombatTask', {
	description = T(333205819142, --[[CombatTask AutomaticKills description]] "The team must kill <requiredProgress> opponents with assault rifles or SMGs"),
	group = "Default",
	id = "AutomaticKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and IsKindOfClasses(results.weapon, "AssaultRifle", "SubmachineGun") then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(kills) end
					end
				end
			end,
		}),
	},
	name = T(226845938375, --[[CombatTask AutomaticKills name]] "Automatic Kills"),
	requiredProgress = 3,
	selectionConditions = {
		PlaceObj('CheckOR', {
			Conditions = {
				PlaceObj('UnitHasWeaponKind', {
					TargetUnit = "current unit",
					weaponKind = "AssaultRifle",
				}),
				PlaceObj('UnitHasWeaponKind', {
					TargetUnit = "current unit",
					weaponKind = "SubmachineGun",
				}),
			},
		}),
	},
	statGainRolls = {
		"Marksmanship",
		"Dexterity",
	},
})

PlaceObj('CombatTask', {
	description = T(335291031338, --[[CombatTask DamageDealer description]] "<Nick> should inflict <requiredProgress> damage to the enemies"),
	favouredConditions = {
		PlaceObj('UnitHasPerk', {
			HasPerk = "Psycho",
			TargetUnit = "current unit",
		}),
	},
	group = "Default",
	id = "DamageDealer",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "DamageDone",
			Handler = function (self, attacker, target, dmg, hit_descr)
				if IsMerc(attacker) and IsKindOf(target, "Unit") and target:IsOnEnemySide(attacker) then
					local task = attacker:FirstCombatTaskById(self.id)
					if task then
						task:Update(dmg)
					end
				end
			end,
		}),
	},
	name = T(823186688823, --[[CombatTask DamageDealer name]] "Destruction Distributor"),
	requiredProgress = 150,
	statGainRolls = {
		"Strength",
	},
})

PlaceObj('CombatTask', {
	description = T(171286303887, --[[CombatTask ElusiveKiller description]] "<Nick> should make a kill and never suffer damage in the conflict"),
	group = "Default",
	holdUntilEnd = true,
	id = "ElusiveKiller",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "Attack",
			Handler = function (self, action, results, attack_args, combat_starting, attacker, target)
				if IsMerc(attacker) and IsEnemyKill(attacker, results) then
					local task = attacker:FirstCombatTaskById(self.id)
					if task then task:Update(1) end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "DamageDone",
			Handler = function (self, attacker, target, dmg, hit_descr)
				if IsMerc(target) then
					local task = target:FirstCombatTaskById(self.id)
					if task then task:Fail() end
				end
			end,
		}),
	},
	name = T(996733824590, --[[CombatTask ElusiveKiller name]] "Elusive Killer"),
	statGainRolls = {
		"Agility",
	},
})

PlaceObj('CombatTask', {
	description = T(329933122394, --[[CombatTask ExplosiveKills description]] "The team should kill <requiredProgress> opponents in explosions"),
	favouredConditions = {
		PlaceObj('UnitHasPerk', {
			HasPerk = "Throwing",
			TargetUnit = "current unit",
		}),
	},
	group = "Default",
	id = "ExplosiveKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "UnitDieStart",
			Handler = function (self, unit, attacker)
				if IsMerc(attacker) then
					local task = FindActiveCombatTask(self.id)
					if task then
						if unit.on_die_hit_descr and unit.on_die_hit_descr.explosion and unit:IsOnEnemySide(attacker) and not unit.immortal then
							task:Update(1)
						end
					end
				end
			end,
		}),
	},
	name = T(327792067279, --[[CombatTask ExplosiveKills name]] "Explosive Kills"),
	requiredProgress = 2,
	selectionConditions = {
		PlaceObj('CheckOR', {
			Conditions = {
				PlaceObj('UnitHasWeaponKind', {
					TargetUnit = "current unit",
					weaponKind = "Grenade",
				}),
				PlaceObj('UnitHasWeaponKind', {
					TargetUnit = "current unit",
					weaponKind = "HeavyWeapon",
				}),
			},
		}),
	},
	statGainRolls = {
		"Explosives",
	},
})

PlaceObj('CombatTask', {
	description = T(927408184696, --[[CombatTask GroinKiller description]] "The team must kill <requiredProgress> enemies with attacks in the groin."),
	group = "Default",
	id = "GroinKiller",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and target and target.species == "Human" and attack_args.target_spot_group == "Groin" then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(1) end
					end
				end
			end,
		}),
	},
	name = T(639828499284, --[[CombatTask GroinKiller name]] "Make them Suffer"),
	requiredProgress = 3,
	statGainRolls = {
		"Dexterity",
		"Marksmanship",
	},
})

PlaceObj('CombatTask', {
	description = T(443919022423, --[[CombatTask HandgunKills description]] "The team must kill <requiredProgress> opponents with a handgun."),
	group = "Default",
	id = "HandgunKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and IsKindOfClasses(results.weapon, "Pistol", "Revolver") then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(kills) end
					end
				end
			end,
		}),
	},
	name = T(542106263178, --[[CombatTask HandgunKills name]] "Handgun Kills"),
	requiredProgress = 3,
	selectionConditions = {
		PlaceObj('CheckOR', {
			Conditions = {
				PlaceObj('UnitHasWeaponKind', {
					TargetUnit = "current unit",
					weaponKind = "Pistol",
				}),
				PlaceObj('UnitHasWeaponKind', {
					TargetUnit = "current unit",
					weaponKind = "Revolver",
				}),
			},
		}),
	},
	statGainRolls = {
		"Dexterity",
	},
})

PlaceObj('CombatTask', {
	description = T(205022452436, --[[CombatTask Headhunter description]] "The team must make <requiredProgress> headshots."),
	group = "Default",
	id = "Headhunter",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) then
					local headshots = 0
					for _, shot in ipairs(results.shots) do
						for _, hit in ipairs(shot.hits) do
							if hit.spot_group and hit.spot_group == "Head" then
								headshots = headshots + 1
							end
						end
					end
					if headshots > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(headshots) end
					end
				end
			end,
		}),
	},
	name = T(932478123102, --[[CombatTask Headhunter name]] "Headhunter"),
	requiredProgress = 5,
	statGainRolls = {
		"Marksmanship",
		"Dexterity",
	},
})

PlaceObj('CombatTask', {
	description = T(229072979907, --[[CombatTask LimbShots description]] "The team must make <requiredProgress> limb shots"),
	group = "Default",
	id = "LimbShots",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) then
					local limbShots = 0
					for _, shot in ipairs(results.shots) do
						for _, hit in ipairs(shot.hits) do
							if hit.spot_group and (hit.spot_group == "Legs" or hit.spot_group == "Arms") then
								limbShots = limbShots + 1
							end
						end
					end
					if limbShots > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(limbShots) end
					end
				end
			end,
		}),
	},
	name = T(205504297105, --[[CombatTask LimbShots name]] "Mutilator"),
	requiredProgress = 5,
	statGainRolls = {
		"Marksmanship",
	},
})

PlaceObj('CombatTask', {
	description = T(278405651391, --[[CombatTask MachineGunKills description]] "The team must kill <requiredProgress> opponents with a machine gun."),
	group = "Default",
	id = "MachineGunKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and IsKindOf(results.weapon, "MachineGun") then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(kills) end
					end
				end
			end,
		}),
	},
	name = T(349362366984, --[[CombatTask MachineGunKills name]] "Machine Gun Kills"),
	requiredProgress = 3,
	selectionConditions = {
		PlaceObj('UnitHasWeaponKind', {
			TargetUnit = "current unit",
			weaponKind = "MachineGun",
		}),
	},
	statGainRolls = {
		"Strength",
	},
})

PlaceObj('CombatTask', {
	description = T(721165610277, --[[CombatTask MeleeKills description]] "The team must kill <requiredProgress> opponents with melee attacks."),
	group = "Default",
	id = "MeleeKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and results.melee_attack then
					local kills =  EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(kills) end
					end
				end
			end,
		}),
	},
	name = T(557045464354, --[[CombatTask MeleeKills name]] "Melee Kills"),
	requiredProgress = 3,
	selectionConditions = {
		PlaceObj('UnitHasWeaponKind', {
			TargetUnit = "current unit",
			weaponKind = "MeleeWeapon",
		}),
	},
	statGainRolls = {
		"Agility",
		"Strength",
	},
})

PlaceObj('CombatTask', {
	description = T(956158880979, --[[CombatTask PointBlank description]] "<Nick> must kill <requiredProgress> enemies at point-blank range."),
	group = "Default",
	id = "PointBlank",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if not IsMerc(attacker) then
					return
				end
				local kills = 0
				local weapon = attack_args and attack_args.weapon
				for _, unit in ipairs(results.killed_units) do
					if attacker:IsOnEnemySide(unit) then
						if attacker:IsPointBlankRange(unit) then
							kills = kills + 1
						end
					end
				end
				if kills > 0 then
					local task = attacker:FirstCombatTaskById(self.id)
					if task then
						task:Update(kills)
					end
				end
			end,
		}),
	},
	name = T(282408867052, --[[CombatTask PointBlank name]] "Point-Blank"),
	requiredProgress = 2,
	statGainRolls = {
		"Health",
		"Strength",
	},
})

PlaceObj('CombatTask', {
	description = T(993385738600, --[[CombatTask PrecisionHeadshots description]] "<Nick> should hit <requiredProgress> enemies with headshots aimed 3+ times"),
	group = "Default",
	id = "PrecisionHeadshots",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and IsKindOf(target, "Unit") and target:IsOnEnemySide(attacker) then
					if attack_args.target_spot_group == "Head" and not results.miss and IsFullyAimedAttack(attack_args) then
						local task = attacker:FirstCombatTaskById(self.id)
						if task then task:Update(1) end
					end
				end
			end,
		}),
	},
	name = T(174050258256, --[[CombatTask PrecisionHeadshots name]] "Put this apple..."),
	requiredProgress = 3,
	statGainRolls = {
		"Dexterity",
		"Marksmanship",
	},
})

PlaceObj('CombatTask', {
	description = T(966001057856, --[[CombatTask SameTurnKills description]] "<Nick> should kill <requiredProgress> opponents in the same turn."),
	group = "Default",
	id = "SameTurnKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "Attack",
			Handler = function (self, action, results, attack_args, combat_starting, attacker, target)
				if IsMerc(attacker) then
					local task = attacker:FirstCombatTaskById(self.id)
					if not task then return end
					
					if not g_Combat and not combat_starting then
						-- reset progress if combat doesn't start
						task:Update(-task.currentProgress)
					else
						local kills = EnemiesKilled(attacker, results)
						if kills > 0 then
							task:Update(kills)
						end
					end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "TurnEnded",
			Handler = function (self, teamEnded, combatEnd)
				if g_Teams[teamEnded].player_team and not combatEnd then
					local task = FindActiveCombatTask(self.id)
					if task then task:Update(-task.currentProgress) end
				end
			end,
		}),
	},
	name = T(310758257957, --[[CombatTask SameTurnKills name]] "Killing Spree"),
	requiredProgress = 2,
	statGainRolls = {
		"Agility",
		"Dexterity",
	},
})

PlaceObj('CombatTask', {
	description = T(134640217789, --[[CombatTask ShotgunKills description]] "The team must kill <requiredProgress> opponents with a shotgun."),
	group = "Default",
	id = "ShotgunKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and IsKindOf(results.weapon, "Shotgun") then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(kills) end
					end
				end
			end,
		}),
	},
	name = T(313568472782, --[[CombatTask ShotgunKills name]] "Shotgun Kills"),
	requiredProgress = 3,
	selectionConditions = {
		PlaceObj('UnitHasWeaponKind', {
			TargetUnit = "current unit",
			weaponKind = "Shotgun",
		}),
	},
	statGainRolls = {
		"Strength",
		"Health",
	},
})

PlaceObj('CombatTask', {
	description = T(684260672157, --[[CombatTask SniperKills description]] "The team must kill <requiredProgress> opponents with a sniper rifle."),
	group = "Default",
	id = "SniperKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and IsKindOf(results.weapon, "SniperRifle") then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(kills) end
					end
				end
			end,
		}),
	},
	name = T(755273724300, --[[CombatTask SniperKills name]] "Sniper Rifle Kills"),
	requiredProgress = 3,
	selectionConditions = {
		PlaceObj('UnitHasWeaponKind', {
			TargetUnit = "current unit",
			weaponKind = "SniperRifle",
		}),
	},
	statGainRolls = {
		"Marksmanship",
		"Dexterity",
	},
})

PlaceObj('CombatTask', {
	description = T(154890444164, --[[CombatTask SpecialKills description]] "The team must make <requiredProgress> kills with special attacks."),
	group = "Default",
	id = "SpecialKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) then
					if not IsBasicAttack(action, attack_args) then
						local kills = EnemiesKilled(attacker, results)
						if kills > 0 then
							local task = FindActiveCombatTask(self.id)
							if task then task:Update(kills) end
						end
					end
				end
			end,
		}),
	},
	name = T(215882327453, --[[CombatTask SpecialKills name]] "Specialist"),
	requiredProgress = 3,
	statGainRolls = {
		"Wisdom",
		"Leadership",
	},
})

PlaceObj('CombatTask', {
	description = T(377620512670, --[[CombatTask StealthyApproach description]] "<Nick> should start the first combat in Stealth and the team should kill <requiredProgress> opponents before the end of the first turn."),
	favouredConditions = {
		PlaceObj('UnitHasPerk', {
			HasPerk = "Stealthy",
			TargetUnit = "current unit",
		}),
	},
	group = "Default",
	id = "StealthyApproach",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "Attack",
			Handler = function (self, action, results, attack_args, combat_starting, attacker, target)
				if IsMerc(attacker) then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(kills) end
					end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "TurnStart",
			Handler = function (self, team)
				if g_Teams[team].player_team and g_Combat.current_turn >= 2 then
					local task = FindActiveCombatTask(self.id)
					if task then task:Fail() end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "CombatStart",
			Handler = function (self, dynamic_data)
				local task = FindActiveCombatTask(self.id)
				if task then
					local fail = false
					if g_Combat.starting_unit and g_Combat.starting_unit.session_id ~= task.unitId then
						task:Fail()
						return
					end
					local unit = g_Units[task.unitId]
					if not unit:HasStatusEffect("Hidden") then task:Fail() end
				end
			end,
		}),
	},
	name = T(965484524496, --[[CombatTask StealthyApproach name]] "Stealthy Approach"),
	requiredProgress = 2,
	selectionConditions = {
		PlaceObj('UnitHasPerk', {
			HasPerk = "Stealthy",
			TargetUnit = "current unit",
		}),
	},
	statGainRolls = {
		"Agility",
		"Dexterity",
	},
})

PlaceObj('CombatTask', {
	description = T(170953530026, --[[CombatTask TakeLessDamage description]] "The team should take less than <requiredProgress> damage in the conflict."),
	group = "Default",
	id = "TakeLessDamage",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "DamageDone",
			Handler = function (self, attacker, target, dmg, hit_descr)
				if IsMerc(target) then
					local task = FindActiveCombatTask(self.id)
					if task then
						task:Update(dmg)
					end
				end
			end,
		}),
	},
	name = T(974373173731, --[[CombatTask TakeLessDamage name]] "Careful Combatant"),
	requiredProgress = 50,
	reverseProgress = true,
	statGainRolls = {
		"Medical",
		"Leadership",
	},
})

PlaceObj('CombatTask', {
	description = T(500135776127, --[[CombatTask TankWounds description]] "No merc other than <Nick> should take wounds from damage this combat"),
	group = "Default",
	hideProgress = true,
	holdUntilEnd = true,
	id = "TankWounds",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "StatusEffectAdded",
			Handler = function (self, obj, id, stacks)
				if IsMerc(obj) and id == "Wounded" then
					local task = FindActiveCombatTask(self.id)
					if task and task.unitId ~= obj.session_id then
						task:Fail()
					end
				end
			end,
		}),
	},
	name = T(437732136157, --[[CombatTask TankWounds name]] "Ardent Defender"),
	requiredProgress = 0,
	statGainRolls = {
		"Health",
	},
})

PlaceObj('CombatTask', {
	description = T(567465673654, --[[CombatTask ThrowKills description]] "<Nick> must kill <requiredProgress> opponent with a knife throw."),
	group = "Default",
	id = "ThrowKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and IsKindOf(results.weapon, "MeleeWeapon") and action.id == "KnifeThrow" then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = attacker:FirstCombatTaskById(self.id)
						if task then task:Update(kills) end
					end
				end
			end,
		}),
	},
	name = T(119727567879, --[[CombatTask ThrowKills name]] "Knife Juggler"),
	selectionConditions = {
		PlaceObj('UnitHasWeaponKind', {
			TargetUnit = "current unit",
			weaponKind = "ThrowableKnife",
		}),
	},
	statGainRolls = {
		"Dexterity",
	},
})

PlaceObj('CombatTask', {
	description = T(877038884070, --[[CombatTask UnarmedKills description]] "<Nick> must kill <requiredProgress> opponent with unarmed attacks."),
	group = "Default",
	id = "UnarmedKills",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if IsMerc(attacker) and IsKindOf(results.weapon, "Unarmed") then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local task = FindActiveCombatTask(self.id)
						if task then task:Update(kills) end
					end
				end
			end,
		}),
	},
	name = T(315709994208, --[[CombatTask UnarmedKills name]] "Brutalizer"),
	selectionConditions = {
		PlaceObj('UnitHasWeaponKind', {
			TargetUnit = "current unit",
			weaponKind = "Unarmed",
		}),
		PlaceObj('UnitHasStat', {
			Amount = 75,
			Stat = "Strength",
			TargetUnit = "current unit",
		}),
	},
	statGainRolls = {
		"Strength",
	},
})