File size: 60,230 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
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
-- ========== GENERATED BY Achievement Editor DO NOT EDIT MANUALLY! ==========

PlaceObj('Achievement', {
	description = T(577854314600, --[[Achievement PlatinumTrophy description (limited to 100 characters on XBOX)]] "Unlocked all trophies."),
	display_name = T(220715659890, --[[Achievement PlatinumTrophy display_name]] "Medal Of Honor"),
	group = "PlayStation",
	how_to = T(498691177443, --[[Achievement PlatinumTrophy how_to (limited to 100 characters on XBOX)]] "Unlock all trophies."),
	id = "PlatinumTrophy",
	ps4_grade = "platinum",
	ps4_id = 0,
	ps5_grade = "platinum",
	ps5_id = 0,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(810430241463, --[[Achievement BloodRain description (limited to 100 characters on XBOX)]] "Dealt 1000 damage to enemies in one turn."),
	display_name = T(907749527147, --[[Achievement BloodRain display_name]] "Blood Rain"),
	group = "Combat",
	how_to = T(431654490364, --[[Achievement BloodRain how_to (limited to 100 characters on XBOX)]] "Deal 1000 damage to enemies in one turn."),
	id = "BloodRain",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "DamageDone",
			Handler = function (self, attacker, target, dmg, hit_descr)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and attacker:IsOnEnemySide(target) and dmg > 0 then
					gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + dmg
					if gv_Achievements[self.id] >= self.target then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "TurnEnded",
			Handler = function (self, teamEnded)
				if GetAchievementFlags(self.id) then return end
				
				gv_Achievements[self.id] = 0
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "Attack",
			Handler = function (self, action, results, attack_args, combat_starting)
				if GetAchievementFlags(self.id) then return end
				
				if not combat_starting and not g_Combat then
					gv_Achievements[self.id] = 0
				end
			end,
		}),
	},
	ps4_id = 1,
	ps5_id = 1,
	target = 1000,
	xbox_id = 46,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(911958725547, --[[Achievement BornKiller description (limited to 100 characters on XBOX)]] "Killed 5 enemies in one turn with a single merc."),
	display_name = T(365161191013, --[[Achievement BornKiller display_name]] "Born Killer"),
	group = "Combat",
	how_to = T(152740288772, --[[Achievement BornKiller how_to (limited to 100 characters on XBOX)]] "Kill 5 enemies in one turn with a single merc."),
	id = "BornKiller",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				if g_CageFighting then return end
				
				if IsMerc(attacker) and attacker.ControlledBy == netUniqueId then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local state = GetAccountCurrentGameAchievementState(self.id) or {}
						local mercId = attacker.session_id
						state[mercId] = (state[mercId] or 0) + kills
						
						if state[mercId] >= self.target then
							AchievementUnlock(self.id)
						end
						
						SetAccountCurrentGameAchievementState(self.id, state)
					end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "TurnStart",
			Handler = function (self, teamEnded)
				if GetAchievementFlags(self.id) then return end
				
				SetAccountCurrentGameAchievementState(self.id, {})
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "Attack",
			Handler = function (self, action, results, attack_args, combat_starting)
				if GetAchievementFlags(self.id) then return end
				
				if not combat_starting and not g_Combat then
					SetAccountCurrentGameAchievementState(self.id, {})
				end
			end,
		}),
	},
	ps4_id = 2,
	ps5_id = 2,
	target = 5,
	xbox_id = 42,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(872847195726, --[[Achievement BulletProof description (limited to 100 characters on XBOX)]] "Finished the campaign without a single merc dying or getting downed."),
	display_name = T(725359206535, --[[Achievement BulletProof display_name]] "Bullet Proof"),
	group = "Combat",
	how_to = T(115567857703, --[[Achievement BulletProof how_to (limited to 100 characters on XBOX)]] "Finish the campaign without a single merc dying or getting downed."),
	id = "BulletProof",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "CampaignEnd",
			Handler = function (self, campaignId)
				if GetAchievementFlags(self.id) then return end
				
				if gv_Achievements[self.id] ~= "failed" then
					AchievementUnlock(self.id)
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "UnitDowned",
			Handler = function (self, unit)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(unit) then
					gv_Achievements[self.id] = "failed"
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "UnitDied",
			Handler = function (self, unit, killer, results)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(unit) then
					gv_Achievements[self.id] = "failed"
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 3,
	ps5_grade = "silver",
	ps5_id = 3,
	xbox_id = 15,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(119695960362, --[[Achievement FlawlessVictory description (limited to 100 characters on XBOX)]] "Conquered an Outpost without losing HP."),
	display_name = T(434089830814, --[[Achievement FlawlessVictory display_name]] "Flawless Victory"),
	group = "Combat",
	how_to = T(926544369717, --[[Achievement FlawlessVictory how_to (limited to 100 characters on XBOX)]] "Conquer an Outpost without losing HP."),
	id = "FlawlessVictory",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "DamageDone",
			Handler = function (self, attacker, target, dmg, hit_descr)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(target) and hit_descr.prev_hit_points and target.HitPoints < hit_descr.prev_hit_points then
					gv_Achievements[self.id] = false
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "SectorSideChanged",
			Handler = function (self, sectorId, oldSide, newSide)
				if GetAchievementFlags(self.id) then return end
				
				if gv_Achievements[self.id] == sectorId and IsPlayerSide(newSide) then
					AchievementUnlock(self.id)
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "EnterSector",
			Handler = function (self, game_start, load_game)
				if GetAchievementFlags(self.id) then return end
				
				if not game_start and not load_game then
					local sector = gv_Sectors[gv_CurrentSectorId]
					if sector.Guardpost and not IsPlayerSide(sector.Side) then
						gv_Achievements[self.id] = gv_CurrentSectorId
					end
				end
			end,
		}),
	},
	ps4_id = 4,
	ps5_id = 4,
	xbox_id = 49,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(855827054392, --[[Achievement MartialArtiste description (limited to 100 characters on XBOX)]] "Conquered an Outpost without using firearms."),
	display_name = T(330886195762, --[[Achievement MartialArtiste display_name]] "Martial Artiste"),
	group = "Combat",
	how_to = T(509509051660, --[[Achievement MartialArtiste how_to (limited to 100 characters on XBOX)]] "Conquer an Outpost without using firearms."),
	id = "MartialArtiste",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and not IsKindOf(results.weapon, "MeleeWeapon") then
					gv_Achievements[self.id] = false
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "SectorSideChanged",
			Handler = function (self, sectorId, oldSide, newSide)
				if GetAchievementFlags(self.id) then return end
				
				if gv_Achievements[self.id] == sectorId and IsPlayerSide(newSide) then
					AchievementUnlock(self.id)
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "EnterSector",
			Handler = function (self, game_start, load_game)
				if GetAchievementFlags(self.id) then return end
				
				if not game_start and not load_game then
					local sector = gv_Sectors[gv_CurrentSectorId]
					if sector.Guardpost and not IsPlayerSide(sector.Side) then
						gv_Achievements[self.id] = gv_CurrentSectorId
					end
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 5,
	ps5_grade = "silver",
	ps5_id = 5,
	xbox_id = 48,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(851738195780, --[[Achievement NaturalSprinter description (limited to 100 characters on XBOX)]] "Moved a merc 35 tiles away in a single turn."),
	display_name = T(729701469966, --[[Achievement NaturalSprinter display_name]] "Natural Sprinter"),
	group = "Combat",
	how_to = T(698490476872, --[[Achievement NaturalSprinter how_to (limited to 100 characters on XBOX)]] "Move a merc 35 tiles away in a single turn."),
	id = "NaturalSprinter",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "TurnStart",
			Handler = function (self, team)
				if GetAchievementFlags(self.id) then return end
				
				SetAccountCurrentGameAchievementState(self.id, {})
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "UnitMovementDone",
			Handler = function (self, unit, action_id, prev_pos)
				if not g_Combat or not prev_pos or not IsMerc(unit) or unit.ControlledBy ~= netUniqueId then return end
				
				local state = GetAccountCurrentGameAchievementState(self.id) or {}
				state[unit.session_id] = (state[unit.session_id] or 0) + (unit:GetDist(prev_pos) / const.SlabSizeX)
				
				if state[unit.session_id] >= self.target then
					AchievementUnlock(self.id)
				end
				
				SetAccountCurrentGameAchievementState(self.id, state)
			end,
		}),
	},
	ps4_id = 6,
	ps5_id = 6,
	target = 35,
	xbox_id = 43,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(164832430302, --[[Achievement Overwatchmen description (limited to 100 characters on XBOX)]] "Made 10 overwatch attacks in one turn."),
	display_name = T(996243104692, --[[Achievement Overwatchmen display_name]] "Overwatchmen"),
	group = "Combat",
	how_to = T(141359912587, --[[Achievement Overwatchmen how_to (limited to 100 characters on XBOX)]] "Make 10 overwatch attacks in one turn."),
	id = "Overwatchmen",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and attack_args.opportunity_attack and attack_args.opportunity_attack_type == "Overwatch" then
					gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + 1
					if gv_Achievements[self.id] >= self.target then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "TurnEnded",
			Handler = function (self, teamEnded)
				if GetAchievementFlags(self.id) then return end
				
				gv_Achievements[self.id] = 0
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "CombatEnd",
			Handler = function (self, teamEnded)
				if GetAchievementFlags(self.id) then return end
				
				gv_Achievements[self.id] = 0
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "Attack",
			Handler = function (self, action, results, attack_args, combat_starting, attacker, target)
				if GetAchievementFlags(self.id) then return end
				
				if not combat_starting and not g_Combat then
					gv_Achievements[self.id] = 0
				end
			end,
		}),
	},
	ps4_id = 7,
	ps5_id = 7,
	target = 10,
	xbox_id = 45,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(338728430601, --[[Achievement SilentAndDeadly description (limited to 100 characters on XBOX)]] "Killed 7 enemies in one sector without triggering combat."),
	display_name = T(490534628132, --[[Achievement SilentAndDeadly display_name]] "Silent And Deadly"),
	group = "Combat",
	how_to = T(669838096944, --[[Achievement SilentAndDeadly how_to (limited to 100 characters on XBOX)]] "Kill 7 enemies in one sector without triggering combat."),
	id = "SilentAndDeadly",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and not g_Combat then
					local kills = EnemiesKilled(attacker, results)
					gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + kills
					if gv_Achievements[self.id] >= self.target then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "EnterSector",
			Handler = function (self, game_start, load_game)
				if GetAchievementFlags(self.id) then return end
				
				if not game_start and not load_game then
					gv_Achievements[self.id] = 0
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "CombatStart",
			Handler = function (self, dynamic_data)
				if GetAchievementFlags(self.id) then return end
				
				gv_Achievements[self.id] = 0
			end,
		}),
	},
	ps4_id = 8,
	ps5_id = 8,
	target = 7,
	xbox_id = 47,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(704839762293, --[[Achievement TrueCrit description (limited to 100 characters on XBOX)]] "Made 10 critical hits in one turn."),
	display_name = T(868987388803, --[[Achievement TrueCrit display_name]] "True Crit"),
	group = "Combat",
	how_to = T(699334368445, --[[Achievement TrueCrit how_to (limited to 100 characters on XBOX)]] "Make 10 critical hits in one turn."),
	id = "TrueCrit",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				if not g_Combat or not IsKindOf(target, "Unit") then return end
				
				if IsMerc(attacker) then
					local crits = 0
					if results.shots and #results.shots > 0 then
						for _, shot in ipairs(results.shots) do
							for _, hit in ipairs(shot.hits) do
								if hit.critical and IsKindOf(hit.obj, "Unit") then
									crits = crits + 1
								end
							end
						end
					else
						if results.crit then
							crits = crits + 1
						end
					end
					
					gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + crits
					if gv_Achievements[self.id] >= self.target then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "TurnEnded",
			Handler = function (self, teamEnded)
				if GetAchievementFlags(self.id) then return end
				
				gv_Achievements[self.id] = 0
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "CombatEnd",
			Handler = function (self, test_combat, combat, anyEnemies)
				if GetAchievementFlags(self.id) then return end
				
				gv_Achievements[self.id] = 0
			end,
		}),
	},
	ps4_id = 9,
	ps5_id = 9,
	target = 10,
	xbox_id = 44,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(322312460334, --[[Achievement AFistfulOfDiamonds description (limited to 100 characters on XBOX)]] "Controlled all sectors with mines."),
	display_name = T(312797445218, --[[Achievement AFistfulOfDiamonds display_name]] "A Fistful Of Diamonds"),
	group = "Direction",
	how_to = T(762369019591, --[[Achievement AFistfulOfDiamonds how_to (limited to 100 characters on XBOX)]] "Control all sectors with mines."),
	id = "AFistfulOfDiamonds",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "SectorSideChanged",
			Handler = function (self, sectorId, oldSide, newSide)
				if GetAchievementFlags(self.id) then return end
				
				local sector = gv_Sectors[sectorId]
				if IsPlayerSide(newSide) and sector.Mine then
					local totalMines = 0
					local minesControlled = 0
					for _, s in pairs(gv_Sectors) do
						if s.Mine then
							totalMines = totalMines + 1
							if IsPlayerSide(s.Side) then
								minesControlled = minesControlled + 1
							end 
						end
					end
					if minesControlled >= totalMines then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
	},
	ps4_id = 10,
	ps5_id = 10,
	xbox_id = 1,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(290395589625, --[[Achievement AllYourBaseAreBelongToUs description (limited to 100 characters on XBOX)]] "Controlled 5 sectors with an Outpost."),
	display_name = T(144123582589, --[[Achievement AllYourBaseAreBelongToUs display_name]] "All Your Base Are Belong To Us"),
	group = "Direction",
	how_to = T(877212686494, --[[Achievement AllYourBaseAreBelongToUs how_to (limited to 100 characters on XBOX)]] "Control 5 sectors with an Outpost."),
	id = "AllYourBaseAreBelongToUs",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "SectorSideChanged",
			Handler = function (self, sectorId, oldSide, newSide)
				if GetAchievementFlags(self.id) then return end
				
				local sector = gv_Sectors[sectorId]
				if IsPlayerSide(newSide) and sector.Guardpost then
					local guardpostsControlled = 0
					for _, s in pairs(gv_Sectors) do
						if s.Guardpost and IsPlayerSide(s.Side) then
							guardpostsControlled = guardpostsControlled + 1
						end
					end
					if guardpostsControlled >= self.target then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
	},
	ps4_id = 11,
	ps5_id = 11,
	target = 5,
	xbox_id = 4,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(545503004820, --[[Achievement BreakingTheWall description (limited to 100 characters on XBOX)]] "Killed an enemy with a shot through an obstacle."),
	display_name = T(193951673209, --[[Achievement BreakingTheWall display_name]] "Breaking The Wall"),
	group = "Direction",
	how_to = T(810505979553, --[[Achievement BreakingTheWall how_to (limited to 100 characters on XBOX)]] "Kill an enemy with a shot through an obstacle."),
	id = "BreakingTheWall",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and attacker.ControlledBy == netUniqueId and results.shots and #results.shots > 0 and results.clear_attacks < #results.shots and EnemiesKilled(attacker, results) > 0 then
					local wallHit
					for _, shot in ipairs(results.shots) do
						for _, hit in ipairs(shot.hits) do
							if hit.obj and IsKindOf(hit.obj, "WallSlab") then
								wallHit = true
								break
							end
						end
						if wallHit then
							break
						end
					end
				
					if wallHit then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
	},
	ps4_id = 12,
	ps5_id = 12,
	xbox_id = 6,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(186518333537, --[[Achievement Bullseye description (limited to 100 characters on XBOX)]] "Killed 25 enemies with a headshot."),
	display_name = T(904913789519, --[[Achievement Bullseye display_name]] "Bullseye"),
	group = "Direction",
	how_to = T(865763504878, --[[Achievement Bullseye how_to (limited to 100 characters on XBOX)]] "Kill 25 enemies with a headshot."),
	id = "Bullseye",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and attacker.ControlledBy == netUniqueId then
					local kills = {}
					for _, shot in ipairs(results.shots) do
						for _, hit in ipairs(shot.hits) do
							if hit.obj and attacker:IsOnEnemySide(hit.obj) and hit.spot_group == "Head" and table.find(results.killed_units, hit.obj) then
								table.insert_unique(kills, hit.obj.session_id)
							end
						end
					end
				
					if #kills > 0 then
						local state = GetAccountCurrentGameAchievementState(self.id) or 0
						state = state + #kills
						if state >= self.target then
							AchievementUnlock(self.id)
						end
						SetAccountCurrentGameAchievementState(self.id, state)
					end
				end
			end,
		}),
	},
	ps4_id = 13,
	ps5_id = 13,
	target = 25,
	xbox_id = 3,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(523513735051, --[[Achievement DifferentWaysToDie description (limited to 100 characters on XBOX)]] "Killed an enemy with 5 different weapon types."),
	display_name = T(361303909436, --[[Achievement DifferentWaysToDie display_name]] "Different Ways To Die"),
	group = "Direction",
	how_to = T(203891626791, --[[Achievement DifferentWaysToDie how_to (limited to 100 characters on XBOX)]] "Kill an enemy with 5 different weapon types."),
	id = "DifferentWaysToDie",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and attacker.ControlledBy == netUniqueId and results.weapon and results.weapon.WeaponType then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						local state = GetAccountCurrentGameAchievementState(self.id) or {}
						table.insert_unique(state, results.weapon.WeaponType)
						
						if #state >= self.target then
							AchievementUnlock(self.id)
						end
						
						SetAccountCurrentGameAchievementState(self.id, state)
					end
				end
			end,
		}),
	},
	ps4_id = 14,
	ps5_id = 14,
	target = 5,
	xbox_id = 2,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(993435384871, --[[Achievement FieldTraining description (limited to 100 characters on XBOX)]] "Defended a sector with the help of militia without autoresolve."),
	display_name = T(231296917797, --[[Achievement FieldTraining display_name]] "Field Training"),
	group = "Direction",
	how_to = T(774529404226, --[[Achievement FieldTraining how_to (limited to 100 characters on XBOX)]] "Defend a sector with the help of militia without autoresolve."),
	id = "FieldTraining",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "ConflictEnd",
			Handler = function (self, sector, bNoVoice, playerAttacking, playerWon, isAutoResolve)
				if GetAchievementFlags(self.id) then return end
				
				if not playerAttacking and playerWon and #GetMilitiaSquads(sector) > 0 and not isAutoResolve then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 15,
	ps5_id = 15,
	xbox_id = 13,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(506831456489, --[[Achievement HotDiamonds description (limited to 100 characters on XBOX)]] "Ambushed a diamond shipment and got the case."),
	display_name = T(921919975685, --[[Achievement HotDiamonds display_name]] "Hot Diamonds"),
	group = "Direction",
	how_to = T(529510145610, --[[Achievement HotDiamonds how_to (limited to 100 characters on XBOX)]] "Ambush a diamond shipment and get the case."),
	id = "HotDiamonds",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "ItemAdded",
			Handler = function (self, unit, item, slotName, pos)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(unit) and item.class == "DiamondBriefcase" and item.extra_tag == "dynamic-db" then
					AchievementUnlock(self.id)
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "CashInItem",
			Handler = function (self, item)
				if GetAchievementFlags(self.id) then return end
				
				if item.class == "DiamondBriefcase" and item.extra_tag == "dynamic-db" then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 16,
	ps5_id = 16,
	xbox_id = 11,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(491484399853, --[[Achievement LethalWeapons description (limited to 100 characters on XBOX)]] "Killed 10 enemies in a single turn."),
	display_name = T(478171225920, --[[Achievement LethalWeapons display_name]] "Lethal Weapons"),
	group = "Direction",
	how_to = T(377131575653, --[[Achievement LethalWeapons how_to (limited to 100 characters on XBOX)]] "Kill 10 enemies in a single turn."),
	id = "LethalWeapons",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) then
					local kills = EnemiesKilled(attacker, results)
					if kills > 0 then
						gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + kills
						if gv_Achievements[self.id] >= self.target then
							AchievementUnlock(self.id)
						end
					end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "TurnEnded",
			Handler = function (self, teamEnded)
				if GetAchievementFlags(self.id) then return end
				
				gv_Achievements[self.id] = 0
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "Attack",
			Handler = function (self, action, results, attack_args, combat_starting)
				if GetAchievementFlags(self.id) then return end
				
				if not combat_starting and not g_Combat then
					gv_Achievements[self.id] = 0
				end
			end,
		}),
	},
	ps4_id = 17,
	ps5_id = 17,
	target = 10,
	xbox_id = 9,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(792959937717, --[[Achievement LivingLegend description (limited to 100 characters on XBOX)]] "Hired a Legendary merc."),
	display_name = T(872535188900, --[[Achievement LivingLegend display_name]] "Living Legend"),
	group = "Direction",
	how_to = T(147916492607, --[[Achievement LivingLegend how_to (limited to 100 characters on XBOX)]] "Hire a Legendary merc."),
	id = "LivingLegend",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "MercHired",
			Handler = function (self, mercId, price, days, alreadyHired)
				if GetAchievementFlags(self.id) then return end
				local merc = gv_UnitData[mercId]
				if merc and merc.Tier == "Legendary" then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 18,
	ps5_id = 18,
	xbox_id = 8,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(842369104667, --[[Achievement ModdingExpert description (limited to 100 characters on XBOX)]] "Installed 7 mods on a single weapon."),
	display_name = T(424158225526, --[[Achievement ModdingExpert display_name]] "Modding Expert"),
	group = "Direction",
	how_to = T(175006091972, --[[Achievement ModdingExpert how_to (limited to 100 characters on XBOX)]] "Install 7 mods on a single weapon."),
	id = "ModdingExpert",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "WeaponModifiedSuccessSync",
			Handler = function (self, weapon, owner, modAdded, mechanic)
				if GetAchievementFlags(self.id) then return end
				
				if mechanic.ControlledBy == netUniqueId and IsKindOf(weapon, "FirearmBase") and weapon:GetNumAttachedComponents() >= self.target then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 19,
	ps5_id = 19,
	target = 7,
	xbox_id = 10,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(268671993376, --[[Achievement NewKidOnTheBlock description (limited to 100 characters on XBOX)]] "Created an I.M.P. merc."),
	display_name = T(252968329296, --[[Achievement NewKidOnTheBlock display_name]] "New Kid On The Block"),
	group = "Direction",
	how_to = T(315702958489, --[[Achievement NewKidOnTheBlock how_to (limited to 100 characters on XBOX)]] "Create an I.M.P. merc."),
	id = "NewKidOnTheBlock",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "MercHired",
			Handler = function (self, mercId, price, days, alreadyHired)
				if GetAchievementFlags(self.id) then return end
				
				if IsImpUnit(gv_UnitData[mercId]) then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 20,
	ps5_id = 20,
	xbox_id = 7,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(921666624864, --[[Achievement Sabotage description (limited to 100 characters on XBOX)]] "Reduced all defense shields of an Outpost."),
	display_name = T(686488730003, --[[Achievement Sabotage display_name]] "Sabotage"),
	group = "Direction",
	how_to = T(257729471729, --[[Achievement Sabotage how_to (limited to 100 characters on XBOX)]] "Reduce all defense shields of an Outpost."),
	id = "Sabotage",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "GuardpostAllShieldsDone",
			Handler = function (self, sectorId)
				if GetAchievementFlags(self.id) then return end
				
				AchievementUnlock(self.id)
			end,
		}),
	},
	ps4_id = 21,
	ps5_id = 21,
	xbox_id = 12,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(960641119476, --[[Achievement TenOutOfTen description (limited to 100 characters on XBOX)]] "Have a Level 10 merc."),
	display_name = T(150219298467, --[[Achievement TenOutOfTen display_name]] "10 Out Of 10"),
	group = "Direction",
	how_to = T(148856160387, --[[Achievement TenOutOfTen how_to (limited to 100 characters on XBOX)]] "Have a Level 10 merc."),
	id = "TenOutOfTen",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "UnitLeveledUp",
			Handler = function (self, unit)
				if GetAchievementFlags(self.id) then return end
				
				if unit:GetLevel() >= 10 then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 22,
	ps5_id = 22,
	xbox_id = 5,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(119822047028, --[[Achievement ALongShot description (limited to 100 characters on XBOX)]] "Killed an enemy at extreme range."),
	display_name = T(750301231519, --[[Achievement ALongShot display_name]] "A Long Shot"),
	group = "Hidden",
	how_to = T(208023546436, --[[Achievement ALongShot how_to (limited to 100 characters on XBOX)]] "Kill an enemy at extreme range."),
	id = "ALongShot",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnKill",
			Handler = function (self, attacker, killedUnits)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and attacker.ControlledBy == netUniqueId then
					for _, unit in ipairs(killedUnits) do
						if IsValid(unit) and attacker:IsOnEnemySide(unit) and (attacker:GetDist(unit) / const.Scale.voxelSizeX) >= self.target then
							AchievementUnlock(self.id)
							break
						end
					end
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 23,
	ps5_grade = "silver",
	ps5_id = 23,
	secret = true,
	target = 40,
	xbox_id = 23,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(895686751734, --[[Achievement ApocalypseLater description (limited to 100 characters on XBOX)]] "Hired the Major."),
	display_name = T(480100937125, --[[Achievement ApocalypseLater display_name]] "Apocalypse Later"),
	group = "Hidden",
	how_to = T(137793487053, --[[Achievement ApocalypseLater how_to (limited to 100 characters on XBOX)]] "Hire the Major."),
	id = "ApocalypseLater",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "MercHireStatusChanged",
			Handler = function (self, unitData, oldStatus, newStatus)
				if GetAchievementFlags(self.id) then return end
				
				if unitData.session_id == "Spike" and newStatus == "Hired" then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 24,
	ps5_id = 24,
	secret = true,
	xbox_id = 32,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(610287284347, --[[Achievement FriendlyFire description (limited to 100 characters on XBOX)]] "Hurt your own merc with the bullet that killed an enemy."),
	display_name = T(278452667109, --[[Achievement FriendlyFire display_name]] "Friendly Fire"),
	group = "Hidden",
	how_to = T(508061852041, --[[Achievement FriendlyFire how_to (limited to 100 characters on XBOX)]] "Hurt your own merc with the bullet that killed an enemy."),
	id = "FriendlyFire",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and attacker.ControlledBy == netUniqueId and results.shots and #results.shots > 0 then
					for _, shot in ipairs(results.shots) do
						local killedEnemy
						local hitMerc
						for _, hit in ipairs(shot.hits) do
							if hit.obj and IsMerc(hit.obj) then
								hitMerc = true
							end
							
							if hit.obj and hit.enemy_hit and hit.damage and hit.prev_hit_points and hit.damage >= hit.prev_hit_points then
								killedEnemy = true
							end
						end
						
						if killedEnemy and hitMerc then
							AchievementUnlock(self.id)
							return
						end
					end
				end
			end,
		}),
	},
	ps4_id = 25,
	ps5_id = 25,
	secret = true,
	xbox_id = 26,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(963062406870, --[[Achievement Prizefighter description (limited to 100 characters on XBOX)]] "Defeated all fighters in the Night Club."),
	display_name = T(728458082058, --[[Achievement Prizefighter display_name]] "Prizefighter"),
	group = "Hidden",
	how_to = T(661685811383, --[[Achievement Prizefighter how_to (limited to 100 characters on XBOX)]] "Defeat all fighters in the Night Club."),
	id = "Prizefighter",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				if questId == "Landsbach" and varId == "AllFightersBeaten" and newVal == true then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 26,
	ps5_id = 26,
	secret = true,
	xbox_id = 24,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(892466364170, --[[Achievement Psycho description (limited to 100 characters on XBOX)]] "Chose a Psycho dialogue option 5 times."),
	display_name = T(984238767804, --[[Achievement Psycho display_name]] "Psycho"),
	group = "Hidden",
	how_to = T(902602620687, --[[Achievement Psycho how_to (limited to 100 characters on XBOX)]] "Choose a Psycho dialogue option 5 times."),
	id = "Psycho",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "PhraseExecuted",
			Handler = function (self, phraseId)
				if GetAchievementFlags(self.id) then return end
				
				local phrase = GetPhrase(phraseId)
				if phrase then
					local psycho = CheckExecutedPhraseForPsycho(phrase) and 1 or 0
					gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + psycho
					if (gv_Achievements[self.id] or 0) >= self.target then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
	},
	ps4_id = 27,
	ps5_id = 27,
	secret = true,
	target = 5,
	xbox_id = 28,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(239863007169, --[[Achievement ReadyWoody description (limited to 100 characters on XBOX)]] "Hired Gus."),
	display_name = T(580346307029, --[[Achievement ReadyWoody display_name]] "Ready, Woody!"),
	group = "Hidden",
	how_to = T(857345891615, --[[Achievement ReadyWoody how_to (limited to 100 characters on XBOX)]] "Hire Gus."),
	id = "ReadyWoody",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "MercHireStatusChanged",
			Handler = function (self, unitData, oldStatus, newStatus)
				if GetAchievementFlags(self.id) then return end
				
				if unitData.session_id == "Gus" and newStatus == "Hired" then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 28,
	ps5_grade = "silver",
	ps5_id = 28,
	secret = true,
	xbox_id = 31,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(318709322191, --[[Achievement Rehab description (limited to 100 characters on XBOX)]] "Helped Larry overcome his addiction."),
	display_name = T(953123524232, --[[Achievement Rehab display_name]] "Rehab"),
	group = "Hidden",
	how_to = T(898219595089, --[[Achievement Rehab how_to (limited to 100 characters on XBOX)]] "Help Larry overcome his addiction."),
	id = "Rehab",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OperationChanged",
			Handler = function (self, unit, oldOperation, newOperation, prevProfession, interrupted)
				if GetAchievementFlags(self.id) then return end
				
				if oldOperation.id == "AddictionTreatment" and not interrupted then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 29,
	ps5_id = 29,
	secret = true,
	xbox_id = 30,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(593813560963, --[[Achievement SayMyName description (limited to 100 characters on XBOX)]] "Did three morally bad things."),
	display_name = T(365562174003, --[[Achievement SayMyName display_name]] "Say My Name"),
	group = "Hidden",
	how_to = T(965690657000, --[[Achievement SayMyName how_to (limited to 100 characters on XBOX)]] "Do three morally bad things."),
	id = "SayMyName",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				-- "Hire Graaf as a mine foreman"
				if questId == "DiamondRed" and varId == "GraafForeman" and newVal == true then
					gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + 1
				end
				
				-- "kill Lurch and take his shotgun"
				if questId == "AyeMom" and varId == "GunTaken" and newVal == true then
					local lurch =  gv_UnitData.NPC_Lurch
					if lurch and lurch:IsDead() then
						gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + 1
					end
				end
				
				-- "Meet Bastien in Refugee Camp and make him give you money"
				if questId == "RefugeeBlues" and varId == "BastienShare" and newVal == true then
					gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + 1
				end
				
				-- "Be Boss Blaubert's partner"
				if questId == "Luigi" and varId == "BossPartnership" and newVal == true then
					gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + 1
				end
				
				if (gv_Achievements[self.id] or 0) >= self.target then
					AchievementUnlock(self.id)
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "SectorSideChanged",
			Handler = function (self, sectorId, oldSide, newSide)
				if GetAchievementFlags(self.id) or not gv_Quests["PantagruelRebels"] then return end
				
				-- "Take over Maquis mine by force"
				if sectorId == "C7_Underground" and IsPlayerSide(newSide) then
					if GetQuestVar("PantagruelRebels", "MaquieEnemies") then
						gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + 1
					end
				end
				
				if (gv_Achievements[self.id] or 0) >= self.target then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 30,
	ps5_id = 30,
	secret = true,
	target = 3,
	xbox_id = 29,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(785039187961, --[[Achievement TwoBirdsOneStone description (limited to 100 characters on XBOX)]] "Killed two enemies with a single shot."),
	display_name = T(899260696739, --[[Achievement TwoBirdsOneStone display_name]] "Two Birds One Stone"),
	group = "Hidden",
	how_to = T(345293348180, --[[Achievement TwoBirdsOneStone how_to (limited to 100 characters on XBOX)]] "Kill two enemies with a single shot."),
	id = "TwoBirdsOneStone",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and attacker.ControlledBy == netUniqueId and results.shots and #results.shots == 1 and EnemiesKilled(attacker, results) >= 2 then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 31,
	ps5_id = 31,
	secret = true,
	xbox_id = 25,
})

PlaceObj('Achievement', {
	Comment = "current player",
	SortKey = 1000,
	description = T(718694453555, --[[Achievement WinnerWinnerChickenDinner description (limited to 100 characters on XBOX)]] "Chicken murderer."),
	display_name = T(252119341614, --[[Achievement WinnerWinnerChickenDinner display_name]] "Winner, Winner, Chicken Dinner"),
	group = "Hidden",
	how_to = T(669885107481, --[[Achievement WinnerWinnerChickenDinner how_to (limited to 100 characters on XBOX)]] "Kill a chicken."),
	id = "WinnerWinnerChickenDinner",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "OnAttack",
			Handler = function (self, attacker, action, target, results, attack_args)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(attacker) and attacker.ControlledBy == netUniqueId then
					for _, hitData in ipairs(results) do
						local obj = hitData.obj
						if IsKindOf(obj, "Animal_Hen") and obj:IsDead() then
							AchievementUnlock(self.id)
						end
					end
				end
			end,
		}),
	},
	ps4_id = 32,
	ps5_id = 32,
	secret = true,
	xbox_id = 27,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(673543460181, --[[Achievement DieselPower description (limited to 100 characters on XBOX)]] "Solved the Diesel problem."),
	display_name = T(580828763361, --[[Achievement DieselPower display_name]] "Diesel Power"),
	group = "Quests",
	how_to = T(689846303069, --[[Achievement DieselPower how_to (limited to 100 characters on XBOX)]] "Solve the Diesel problem."),
	id = "DieselPower",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				if questId == "Landsbach" and varId == "GetRidOfDiesel" and newVal == true then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 33,
	ps5_grade = "silver",
	ps5_id = 33,
	xbox_id = 35,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(868668282301, --[[Achievement GreenDiamond description (limited to 100 characters on XBOX)]] "Obtained the Green Diamond."),
	display_name = T(168847895084, --[[Achievement GreenDiamond display_name]] "Green Diamond"),
	group = "Quests",
	how_to = T(149168865866, --[[Achievement GreenDiamond how_to (limited to 100 characters on XBOX)]] "Obtain the Green Diamond."),
	id = "GreenDiamond",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "ItemAdded",
			Handler = function (self, unit, item, slotName, pos)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(unit) and item.class == "TheGreenDiamond" then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 34,
	ps5_id = 34,
	xbox_id = 36,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(338667995652, --[[Achievement LoveCats description (limited to 100 characters on XBOX)]] "Made Maman and Chimurenga get together."),
	display_name = T(846246131029, --[[Achievement LoveCats display_name]] "Love Cats"),
	group = "Quests",
	how_to = T(100160794579, --[[Achievement LoveCats how_to (limited to 100 characters on XBOX)]] "Make Maman and Chimurenga get together."),
	id = "LoveCats",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				if questId == "PantagruelDramas" and varId == "YoungHearts" and newVal == true then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 35,
	ps5_id = 35,
	secret = true,
	xbox_id = 38,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(889771902479, --[[Achievement ProvenInnocent description (limited to 100 characters on XBOX)]] "Gathered enough evidence to clear your name."),
	display_name = T(259283301037, --[[Achievement ProvenInnocent display_name]] "Proven Innocent"),
	group = "Quests",
	how_to = T(291562539660, --[[Achievement ProvenInnocent how_to (limited to 100 characters on XBOX)]] "Gather enough evidence to clear your name."),
	id = "ProvenInnocent",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				if questId == "05_TakeDownCorazon" and varId == "Evidence" and newVal >= GetQuestVar(questId, "EvidenceRequired") then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 36,
	ps5_id = 36,
	secret = true,
	xbox_id = 39,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(657790232514, --[[Achievement SawItComing description (limited to 100 characters on XBOX)]] "Corazon betrayed you."),
	display_name = T(188253254182, --[[Achievement SawItComing display_name]] "Saw It Coming..."),
	group = "Quests",
	how_to = T(122883982105, --[[Achievement SawItComing how_to (limited to 100 characters on XBOX)]] "Corazon betrayed you."),
	id = "SawItComing",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				if questId == "04_Betrayal" and varId == "Completed" and newVal == true then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 37,
	ps5_id = 37,
	secret = true,
	xbox_id = 40,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(504681351963, --[[Achievement TruestDetective description (limited to 100 characters on XBOX)]] "Caught the Teddy Bear killer."),
	display_name = T(484366144845, --[[Achievement TruestDetective display_name]] "Truest Detective"),
	group = "Quests",
	how_to = T(610523312013, --[[Achievement TruestDetective how_to (limited to 100 characters on XBOX)]] "Catch the Teddy Bear killer."),
	id = "TruestDetective",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				if questId == "Ted" and varId == "Completed" and newVal == true then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 38,
	ps5_id = 38,
	secret = true,
	xbox_id = 41,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(547528613214, --[[Achievement TwelveChairs description (limited to 100 characters on XBOX)]] "Found Madam Lecoq's diamond necklace."),
	display_name = T(979859433082, --[[Achievement TwelveChairs display_name]] "Twelve Chairs"),
	group = "Quests",
	how_to = T(734069117003, --[[Achievement TwelveChairs how_to (limited to 100 characters on XBOX)]] "Find Madam Lecoq's diamond necklace."),
	id = "TwelveChairs",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				if questId == "TheTwelveChairs" and varId == "FoundNecklace" and newVal == true then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 39,
	ps5_id = 39,
	secret = true,
	xbox_id = 37,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(957788705095, --[[Achievement Unlockdown description (limited to 100 characters on XBOX)]] "Found a cure for the Red Rabies."),
	display_name = T(753539187750, --[[Achievement Unlockdown display_name]] "Unlockdown"),
	group = "Quests",
	how_to = T(833150760628, --[[Achievement Unlockdown how_to (limited to 100 characters on XBOX)]] "Find a cure for the Red Rabies."),
	id = "Unlockdown",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				if questId == "Sanatorium" and varId == "SamplesGiven" and newVal == true then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 40,
	ps5_grade = "silver",
	ps5_id = 40,
	xbox_id = 34,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(377566481789, --[[Achievement XMarksTheSpot description (limited to 100 characters on XBOX)]] "Found Lucky Veinard's secret treasures."),
	display_name = T(667944553137, --[[Achievement XMarksTheSpot display_name]] "X Marks The Spot"),
	group = "Quests",
	how_to = T(421408703447, --[[Achievement XMarksTheSpot how_to (limited to 100 characters on XBOX)]] "Find Lucky Veinard's secret treasures."),
	id = "XMarksTheSpot",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "QuestParamChanged",
			Handler = function (self, questId, varId, prevVal, newVal)
				if GetAchievementFlags(self.id) then return end
				
				if questId == "TreasureHunting" and varId == "foundcirclestreasure" and newVal == true then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 41,
	ps5_grade = "silver",
	ps5_id = 41,
	xbox_id = 33,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(545460392452, --[[Achievement DynamicDuo description (limited to 100 characters on XBOX)]] "Finished the campaign while having no more than two mercs at the same time."),
	display_name = T(277542343056, --[[Achievement DynamicDuo display_name]] "Dynamic Duo"),
	group = "Retention",
	how_to = T(471839901231, --[[Achievement DynamicDuo how_to (limited to 100 characters on XBOX)]] "Finish the campaign while having no more than two mercs at the same time."),
	id = "DynamicDuo",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "CampaignEnd",
			Handler = function (self, campaignId)
				if GetAchievementFlags(self.id) then return end
				
				if gv_Achievements[self.id] ~= "failed" then
					AchievementUnlock(self.id)
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "MercHired",
			Handler = function (self, mercId, price, days, alreadyHired)
				if GetAchievementFlags(self.id) then return end
				
				if #GetHiredMercIds() > 2 then
					gv_Achievements[self.id] = "failed"
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "UnitJoinedAsMerc",
			Handler = function (self, mercId, price, days, alreadyHired)
				if GetAchievementFlags(self.id) then return end
				
				if #GetHiredMercIds() > 2 then
					gv_Achievements[self.id] = "failed"
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 42,
	ps5_grade = "silver",
	ps5_id = 42,
	xbox_id = 18,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(313785946781, --[[Achievement GrittyDozen description (limited to 100 characters on XBOX)]] "Have at least 12 mercs."),
	display_name = T(639786242732, --[[Achievement GrittyDozen display_name]] "Gritty Dozen"),
	group = "Retention",
	how_to = T(857992386571, --[[Achievement GrittyDozen how_to (limited to 100 characters on XBOX)]] "Have at least 12 mercs."),
	id = "GrittyDozen",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "MercHired",
			Handler = function (self, mercId, price, days, alreadyHired)
				if GetAchievementFlags(self.id) then return end
				
				if #GetHiredMercIds() >= self.target then
					AchievementUnlock(self.id)
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "UnitJoinedAsMerc",
			Handler = function (self, mercId, price, days, alreadyHired)
				if GetAchievementFlags(self.id) then return end
				
				if #GetHiredMercIds() >= self.target then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 43,
	ps5_id = 43,
	target = 12,
	xbox_id = 21,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(103278828302, --[[Achievement Ironman description (limited to 100 characters on XBOX)]] 'Finished the game on "Mission Impossible", "Dead is Dead", "To The Bitter End" and "Lethal Weapons".'),
	display_name = T(452896945074, --[[Achievement Ironman display_name]] "Ironman"),
	group = "Retention",
	how_to = T(218540356017, --[[Achievement Ironman how_to (limited to 100 characters on XBOX)]] 'Finish the game on "Mission Impossible", "Dead is Dead", "To The Bitter End" and "Lethal Weapons".'),
	id = "Ironman",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "CampaignEnd",
			Handler = function (self, campaignId)
				if GetAchievementFlags(self.id) then return end
				
				if Game.game_difficulty == "VeryHard" and IsGameRuleActive("DeadIsDead") and IsGameRuleActive("Ironman") and IsGameRuleActive("LethalWeapons") and not IsGameRuleActive("ForgivingMode") and gv_Achievements[self.id] ~= "failed" then
					AchievementUnlock(self.id)
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "ChangeGameRule",
			Handler = function (self, rule, value)
				if GetAchievementFlags(self.id) then return end
				
				if rule == "ForgivingMode" and value then
					gv_Achievements[self.id] = "failed"
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "DifficultyChange",
			Handler = function (self)
				if GetAchievementFlags(self.id) then return end
				
				if Game.game_difficulty ~= "VeryHard" then
					gv_Achievements[self.id] = "failed"
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "NewGame",
			Handler = function (self, game)
				if GetAchievementFlags(self.id) then return end
				
				if IsGameRuleActive("ForgivingMode") and Game.game_difficulty ~= "VeryHard" then
					gv_Achievements[self.id] = "failed"
				end
			end,
		}),
	},
	ps4_grade = "gold",
	ps4_id = 44,
	ps5_grade = "gold",
	ps5_id = 44,
	xbox_id = 16,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(719266083045, --[[Achievement JustAFleshWound description (limited to 100 characters on XBOX)]] "Taken 300 damage in a single turn without any merc dying or getting downed."),
	display_name = T(434853556936, --[[Achievement JustAFleshWound display_name]] "Just A Flesh Wound"),
	group = "Retention",
	how_to = T(657003907968, --[[Achievement JustAFleshWound how_to (limited to 100 characters on XBOX)]] "Take 300 damage in a single turn without any merc dying or getting downed."),
	id = "JustAFleshWound",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "DamageDone",
			Handler = function (self, attacker, target, dmg, hit_descr)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(target) and dmg > 0 then
					gv_Achievements[self.id] = (gv_Achievements[self.id] or 0) + dmg
					
					if target.HitPoints == 0 then
						gv_Achievements[self.id] = 0
					end
					
					if gv_Achievements[self.id] >= self.target then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "UnitDied",
			Handler = function (self, unit, killer, results)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(unit) then
					gv_Achievements[self.id] = 0
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "UnitDowned",
			Handler = function (self, unit, killer, results)
				if GetAchievementFlags(self.id) then return end
				
				if IsMerc(unit) then
					gv_Achievements[self.id] = 0
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "TurnEnded",
			Handler = function (self, teamEnded)
				if GetAchievementFlags(self.id) then return end
				
				gv_Achievements[self.id] = 0
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "Attack",
			Handler = function (self, action, results, attack_args, combat_starting)
				if GetAchievementFlags(self.id) then return end
				
				if not combat_starting and not g_Combat then
					gv_Achievements[self.id] = 0
				end
			end,
		}),
	},
	ps4_id = 45,
	ps5_id = 45,
	target = 300,
	xbox_id = 50,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(157013389224, --[[Achievement Liberator description (limited to 100 characters on XBOX)]] "Earned at least 75 Loyalty in 5 towns."),
	display_name = T(360574911271, --[[Achievement Liberator display_name]] "Liberator"),
	group = "Retention",
	how_to = T(677038024683, --[[Achievement Liberator how_to (limited to 100 characters on XBOX)]] "Earn at least 75 Loyalty in 5 towns."),
	id = "Liberator",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "LoyaltyChanged",
			Handler = function (self, cityId, change)
				if GetAchievementFlags(self.id) then return end
				
				local highLoyaltyCities = 0
				for _, city in pairs(gv_Cities) do
					if city.Loyalty >= 75 then
						highLoyaltyCities= highLoyaltyCities + 1
					end
				end
				
				if highLoyaltyCities >= 5 then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_id = 46,
	ps5_id = 46,
	xbox_id = 20,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(950963933037, --[[Achievement LoneWolf description (limited to 100 characters on XBOX)]] "Finished the campaign while having no more than one merc at the same time."),
	display_name = T(422926797000, --[[Achievement LoneWolf display_name]] "Lone Wolf"),
	group = "Retention",
	how_to = T(987003129842, --[[Achievement LoneWolf how_to (limited to 100 characters on XBOX)]] "Finish the campaign while having no more than one merc at the same time."),
	id = "LoneWolf",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "CampaignEnd",
			Handler = function (self, campaignId)
				if GetAchievementFlags(self.id) then return end
				
				if gv_Achievements[self.id] ~= "failed" then
					AchievementUnlock(self.id)
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "MercHired",
			Handler = function (self, mercId, price, days, alreadyHired)
				if GetAchievementFlags(self.id) then return end
				
				if #GetHiredMercIds() > 1 then
					gv_Achievements[self.id] = "failed"
				end
			end,
		}),
		PlaceObj('MsgReaction', {
			Event = "UnitJoinedAsMerc",
			Handler = function (self, mercId, price, days, alreadyHired)
				if GetAchievementFlags(self.id) then return end
				
				if #GetHiredMercIds() > 1 then
					gv_Achievements[self.id] = "failed"
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 47,
	ps5_grade = "silver",
	ps5_id = 47,
	xbox_id = 17,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(151643533374, --[[Achievement Pacifist description (limited to 100 characters on XBOX)]] "Finished the campaign without killing any civilian."),
	display_name = T(194042060571, --[[Achievement Pacifist display_name]] "Pacifist"),
	group = "Retention",
	how_to = T(338716292182, --[[Achievement Pacifist how_to (limited to 100 characters on XBOX)]] "Finish the campaign without killing any civilian."),
	id = "Pacifist",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "CampaignEnd",
			Handler = function (self, campaignId)
				if GetAchievementFlags(self.id) then return end
				
				if gv_CiviliansKilled <= 0 then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_grade = "silver",
	ps4_id = 48,
	ps5_grade = "silver",
	ps5_id = 48,
	xbox_id = 19,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(838187958581, --[[Achievement Tactician description (limited to 100 characters on XBOX)]] "Controlled at least 50 sectors."),
	display_name = T(219959948272, --[[Achievement Tactician display_name]] "Tactician"),
	group = "Retention",
	how_to = T(996157707667, --[[Achievement Tactician how_to (limited to 100 characters on XBOX)]] "Control at least 50 sectors."),
	id = "Tactician",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "SectorSideChanged",
			Handler = function (self, sectorId, oldSide, newSide)
				if GetAchievementFlags(self.id) then return end
				
				if IsPlayerSide(newSide) then
					local controlled = 0
					for _, s in pairs(gv_Sectors) do
						if IsPlayerSide(s.Side) then
							controlled = controlled + 1
						end
					end
				
					if controlled >= self.target then
						AchievementUnlock(self.id)
					end
				end
			end,
		}),
	},
	ps4_id = 49,
	ps5_id = 49,
	target = 50,
	xbox_id = 22,
})

PlaceObj('Achievement', {
	SortKey = 1000,
	description = T(763203074646, --[[Achievement TimeIsMoney description (limited to 100 characters on XBOX)]] "Finished the campaign before 1 MAY, 2001."),
	display_name = T(622226557896, --[[Achievement TimeIsMoney display_name]] "Time Is Money"),
	group = "Retention",
	how_to = T(227445552899, --[[Achievement TimeIsMoney how_to (limited to 100 characters on XBOX)]] "Finish the campaign before 1 MAY, 2001."),
	id = "TimeIsMoney",
	msg_reactions = {
		PlaceObj('MsgReaction', {
			Event = "CampaignEnd",
			Handler = function (self, campaignId)
				if GetAchievementFlags(self.id) then return end
				-- target is in days
				if DivRound(Game.CampaignTime - Game.CampaignTimeStart, const.Scale.day) <= self.target then
					AchievementUnlock(self.id)
				end
			end,
		}),
	},
	ps4_grade = "gold",
	ps4_id = 50,
	ps5_grade = "gold",
	ps5_id = 50,
	target = 27,
	xbox_id = 14,
})