Paste #11905: Edit of P#11904 - Untitled Paste

Date: 2014/12/07 17:59:26 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


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
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276


# +----------------------------------
# |   List of fight flags
# +----------------------------------

# Target (The player you are attacking)
# Server_Fight_Number (the fight number)
# fight_CD (fight cooldown)
# Leader_Warning (a warning flag for trying to fight a leader - they get a chance to back off)
# Fight (fight ID for the players)
# Fight_Turn (Whoever has this flag has the turn in the fight)
# Fight_Unhealthy_Start (starting with less than full health)
# Fighters_<player.flag[Fight]> (number of fighters and their names in a list)
# Fight_Turn_Counter_<player.flag[Fight]> (Simple counter)

#              - flag player Target:!
#              - flag player Fight:!
#              - flag player Fight_Turn:!
#              - flag player Attack:!
#              - flag player Fight_Attack:!
#              - flag player Fight_Dodged:!
#              - flag player Fight_Blocked:!
#              - flag player Fight_Weapon:!
#              - flag player Fight_CD:!
#              - flag player Fight_Leader_Warning:!
#              - flag player Health:!
#              - flag player Fight_Unhealthy_Start:!
#              - flag player Weapon_Type:!
#              - flag player Defender_First_Turn:!
#              - flag player Fight_Winner:!
#              - flag player Fight_Cancel:!

Fight_Command:
    type: command
    name: fight
    description: Start a fight with another player
    usage: /fight <playername>
    script:
# +----------------------------------
# +- Conditions for a fight to begin
# +----------------------------------
# Checking that they have exactly 1 argument (hopefully a playername.)
      - if !<context.args.size.is[EQUALS].to[1]> {
        - narrate "<red>You need to specify the playername you wish to fight!"
        - queue clear
        }
      - define Target <context.args.get[1]>
# Checking that they aren't on a fight Cooldown
      - if <player.flag[Fight_CD]> {
        - run Fight_Cant_Fight
        - queue clear
        }
# Checking that the player they are trying to fight is online
      - if <server.match_player[%Target%].is_online||false> !true {
        - narrate "<red>The player you are trying to fight isn't online"
        - queue clear
        }
# Checking that they are close enough to the other player.
      - if <player.location.distance[<server.match_player[%Target%].location>]> > 10 {
        - narrate "<red>You're too far away to initiate a fight"
        - queue clear
        }
# Checking if player is already in a fight
      - if <player.flag[Fight]> != null {
        - narrate "<red>You're already in a fight! You have to finish it before you can start a new fight"
        - queue clear
        }
# Checking if the other player is in a fight. If he/she is, join the fight instead of starting a new one
      - if <server.match_player[%Target%].flag[Fight]> != null {
        - flag player Fight:<server.match_player[%Target%].flag[Fight]>
        - flag player health:<player.health.scale.as_int>
        - flag player Target:%Target%
        - if <player.flag[health]> < 20 {
          - flag player Fight_Unhealthy_Start
          }
        - narrate "<red>+-----------------------------------------------------+" targets:<player.location.find.players.within[10]>
        - narrate "<red>| <gold>%Player% has joined the fight against<&co> <red>%Target%" targets:<player.location.find.players.within[10]>
        - narrate "<red>+-----------------------------------------------------+" targets:<player.location.find.players.within[10]>
        - flag global Fighters_%Fight%:<-:<player.name>
        - if 1 > 2
        - narrate "<red>There's <gold><global.flag[Fighters_%Fight%].size> <red>players in this fight."
        - narrate "<red><global.flag[Fighters_%Fight%].as_list.formatted>"
        - queue clear
        }
      - if <player.flag[Fight_Leader_Warning]> && <server.match_player[%Target%].in_group[Leader]> {
        - flag global Fighters_%Fight%:<-:%Target%|%Target%|%Target%|%Target%
        - if 1 > 2
        }
# Checking if they are attempting to start a fight with a leader
      - if <server.match_player[%Target%].in_group[Leader]> {
        - narrate "<red>Leaders are always accompanied by <gold>4 royal guards. <red>If you are sure you want to start this fight. type the command one more time."
        - flag player Fight_Leader_Warning
        - queue clear
        }
# +----------------------------------


# Flagging server with Fight_Number (counts how many fights have been started.)
      - flag server Server_Fight_Number:++
      - narrate "<red>Fight number<&co> <gold><server.flag[Server_Fight_Number].as_int> has started"

# Assigning the players a target
      - flag player Target:%Target%
      - flag <server.match_player[%Target%]> Target:<player.name>

# assigning Unique fight name to the players
      - flag player Fight:<player.name>
      - flag <server.match_player[%Target%]> Fight:<player.name>

# Defining %Fight% for use inside tags
      - define Fight <player.flag[Fight]>

# Making a list of all the players in the fight
      - flag global Fighters_%Fight%:<-:<player.name>|<player.flag[Target]>
      - if 1 > 2

# Giving the players a health flag
      - flag player health:<player.health.scale>
      - if <player.flag[health]> < 20 {
        - flag player Fight_Unhealthy_Start
        }
      - flag <server.match_player[%Target%]> health:<player.health.scale>
      - if <server.match_player[%Target%].flag[health]> < 20 {
        - flag <server.match_player[%Target%]> Fight_Unhealthy_Start
        }

# Announcing the fight
      - narrate "<red>+-----------------------------------------------------+"
      - narrate "<red>| <blue>Starting fight with<&co> <red><player.flag[target]>"
      - narrate "<red>+-----------------------------------------------------+"

      - narrate "<red>+-----------------------------------------------------+" targets:<server.match_player[<player.flag[target]>]>
      - narrate "<red>| <blue>Starting fight with<&co> <red><player.name>" targets:<server.match_player[<player.flag[target]>]>
      - narrate "<red>+-----------------------------------------------------+" targets:<server.match_player[<player.flag[target]>]>

      - random {
        - run Fight_First_Turn_Attacker
        - run Fight_First_Turn_Attacker
        - run Fight_First_Turn_Defender
        }



# +----------------------------------
# |   Target
# +----------------------------------
Target_Command:
    type: command
    name: Target
    description: Target another player
    usage: /Target <playername>
    script:
# Checking if they chose a target
      - if !<context.args.size.is[EQUALS].to[1]> {
        - narrate "<red>You need to specify the playername you wish to target!"
        - queue clear
        }
# Checking if the target has the Fight flag
      - if !<server.match_player[<context.args.get[1]>].has_flag[Fight]> {
        - narrate "The player you are trying to target, isn't in a fight"
        - queue clear
        }
# Checking if they are in the same fight
      - if <server.match_player[<context.args.get[1]>].flag[Fight]> != <player.flag[Fight]> {
        - narrate "<red>The player you are trying to target is in a diferent fight."
        - queue clear
        }
# Setting new target
      - flag player Target:<context.parsed_args.get[1]>
      - narrate "<blue>You've targeted<&co> <gold><player.flag[Target]>."


# +----------------------------------
# |   Attack
# +----------------------------------
Attack_Command:
    type: command
    name: Attack
    description: Attack another player
    usage: /Attack
    script:
# Defining %Fight% for use inside tags
      - define Fight <player.flag[Fight]>
      - if !<player.flag[Fight]> {
        - narrate "<red>You need to be in a fight to use the /Attack command"
        - queue clear
        }

# If the player was attacked and he did nothing to try and avoid it. It deals the damage
      - if <player.flag[Attack]> != null {
        - run Fight_Damage
        }

# checks if they have a target
      - if <player.flag[Target]> == null {
        - narrate "<Red>You don't have a target to attack."
        - narrate "<Red>Please use /target <playername> to define a new target"
        - queue clear
        }

# checks if it's their turn
      - if <player.flag[Fight_Turn]> == null {
        - run Fight_Not_Your_Turn
        - queue clear
        }

# Removing the players turn
      - flag player Fight_Turn:!

# [Temporary] Confirmation that it worked.
      - narrate "<red>YOU ATTACK"


# checks what weapon they have on them.
      - if <player.item_in_hand> == i@wood_sword {
        - flag player Weapon_Type:wooden
        - run Fight_Attack_Wood_sword
        - queue clear
        } else if <player.item_in_hand> == i@stone_sword {
        - flag player Weapon_Type:stone
        - run Fight_Attack_Stone_sword
        - queue clear
        } else if <player.item_in_hand> == i@iron_sword {
        - flag player Weapon_Type:iron
        - run Fight_Attack_Iron_sword
        - queue clear
        } else if <player.item_in_hand> == i@gold_sword {
        - flag player Weapon_Type:golden
        - run Fight_Attack_Gold_sword
        - queue clear
        } else if <player.item_in_hand> == i@diamond_sword {
        - flag player Weapon_Type:diamond
        - run Fight_Attack_Diamond_sword
        - queue clear
        } else if <player.item_in_hand> == i@wood_axe {
        - flag player Weapon_Type:wooden
        - run Fight_Attack_Wood_Axe
        - queue clear
        } else if <player.item_in_hand> == i@stone_axe {
        - flag player Weapon_Type:stone
        - run Fight_Attack_Stone_Axe
        - queue clear
        } else if <player.item_in_hand> == i@iron_axe {
        - flag player Weapon_Type:iron
        - run Fight_Attack_Iron_Axe
        - queue clear
        } else if <player.item_in_hand> == i@gold_axe {
        - flag player Weapon_Type:gold
        - run Fight_Attack_Gold_Axe
        - queue clear
        } else if <player.item_in_hand> == i@diamond_axe {
        - flag player Weapon_Type:diamond
        - run Fight_Attack_Diamond_Axe
        - queue clear
        } else {
# If they don't have a weapon, normal attack is used.
        - run Fight_Attack
        }

# +----------------------------------
# |   Shoot
# +----------------------------------
Shoot_Command:
    type: command
    name: Shoot
    description: Shoot another player
    usage: /Shoot
    script:
# Defining %Fight% for use inside tags
      - define Fight <player.flag[Fight]>
      - define Player <player.flag[Character]>

      - if !<player.flag[Fight]> {
        - narrate "<red>You need to be in a fight to use the /Shoot command"
        - queue clear
        }

# If the player was attacked and he did nothing to try and avoid it. It deals the damage
      - if <player.flag[Attack]> != null {
        - run Fight_Damage
        }

# checks if they have a target
      - if <player.flag[Target]> == null {
        - narrate "<Red>You don't have a target to attack."
        - narrate "<Red>Please use /target <playername> to define a new target"
        - queue clear
        }

# checks if it's their turn
      - if <player.flag[Fight_Turn]> == null {
        - run Fight_Not_Your_Turn
        - queue clear
        }

# Removing the players turn
      - flag player Fight_Turn:!
      - if <player.item_in_hand> == i@bow {
        - if <player.inventory.contains[i@arrow]> {
          - flag player Weapon_Type:bow
          - run Fight_Shoot_Bow
          - take i@arrow
          } else {
          - narrate "<gold>%Player% <blue>reaches for an arrow in his quiver but finds it <red>empty."
          - run Fight_Turn_Chooser
          }
        }

# +----------------------------------
# |   Throw
# +----------------------------------
Throw_Command:
    type: command
    name: Throw
    description: Throw something at another player
    usage: /Throw
    script:
      - if !<player.flag[Fight]> {
        - narrate "<red>You need to be in a fight to use the /Throw command"
        - queue clear
        }

# +----------------------------------
# |   Dodge
# +----------------------------------
Dodge_Command:
    type: command
    name: Dodge
    description: Dodge an attack
    usage: /Dodge
    script:
# Checking if player is in a fight
      - if !<player.has_flag[Fight]> {
        - narrate "<red>You need to be in a fight to use the /Dodge command"
        - queue clear
        }
# Checking if it's their turn
      - if !<player.flag[Fight_Turn]> {
        - run Fight_Not_Your_Turn 
        - queue clear
        }
# Checking if they have been attacked
      - if !<player.has_flag[Attack]> {
        - narrate "<red>There's nothing to dodge."
        - queue clear
        }
# Defining a random number between 0 and 100
      - define Random <util.random.int[0].to[100]>
      - define Player <player.flag[Character]>
# Checking if the number is below or equal to 25(%). If it is, it's a succesful dodge
      - if %Random% <= 25 {
        - if 1 > 2
# Adding a dodged flag.
        - flag player Fight_Dodged
# Runs the Fight_Dodge script which narrates a random dodge message.
        - run Fight_Dodge
        } else if %Random% > 80 {
# Runs the Fight_Dodge_Fall script which narrates a random "fall" and skip the players turn
        - run Fight_Dodge_Fall
        } else {
# If the Dodge failed, say so.
        - narrate "<gold>%Player% <blue>attempted to dodge but failed." targets:<player.location.find.players.within[10]>
        - run Fight_Damage
        - random {
          - narrate "<blue>It's still <gold>%Player%'s <blue>turn" targets:<player.location.find.players.within[10]>
          - repeat 1 {
            - narrate "<gold>%Player% <blue>takes a hard blow and isn't able to attack" targets:<player.location.find.players.within[10]>
            - flag player Fight_Turn:!
            - run Fight_Turn_Chooser
            }
          }
        }

# +----------------------------------
# |   Block
# +----------------------------------
Block_Command:
    type: command
    name: Block
    description: Block an attack
    usage: /block
    script:
      - if !<player.flag[Fight]> {
        - narrate "<red>You need to be in a fight to use the /Block command"
        - queue clear
        }
# +----------------------------------
# |   Taunt
# +----------------------------------
Taunt_Command:
    type: command
    name: Taunt
    description: Taunt another player
    usage: /taunt
    script:
      - if !<player.flag[Fight]> {
        - narrate "<red>You need to be in a fight to use the /Taunt command"
        - queue clear
        }

# +----------------------------------
# |   Escape
# +----------------------------------
Escape_Command:
    type: command
    name: Escape
    description: Escape an attack
    usage: /escape
    script:
      - define Player <player.flag[Character]>
      - define Fight <player.flag[Fight]>
# Checking that they are in a fight
      - if !<player.has_flag[Fight]> {
        - narrate "<red>You need to be in a fight to use the /Escape command"
        - queue clear
        }
      - define random <util.random.int[0].to[100]>
# Checking if it's the defenders first turn
      - if <player.flag[Defender_First_Turn]> != true {
        - if %random% > 20 {
          - narrate "<gold>%Player% <blue>attempted to escape but <red>failed"
          } else {
          - narrate "<gold>%Player% <blue>Succesfully escaped the fight"
          - run Fight_Escape
          }
# If it is their first turn. Give them a lot higher chance to escape
        } else if %random% > 80 {
        - narrate "<gold>%Player% <blue>attempted to escape but <red>failed"
        } else {
        - narrate "<gold>%Player% <blue>succesfully escaped the fight"
        - run Fight_Escape
        }
























# +----------------------------------
# |   Cancel
# +----------------------------------
Cancel_Command:
    type: command
    name: Cancel
    description: Cancel a fight
    usage: /cancel
    script:
      - if !<player.has_flag[Fight]> {
        - narrate "<red>You need to be in a fight to use the Cancel command"
        - queue clear
        }
      - define Player <player.flag[Character]>
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - define Fight <player.flag[Fight]>
      - define Cancel_Number <server.flag[Fight_Cancel_%Fight%].as_int> - 1
      - define First_Fighter <server.flag[Fighters_%Fight%].get[1]>

      - if <server.flag[Fight_Cancel_%Fight%]> == %Cancel_Number% {
        - repeat <server.flag[Fighters_%Fight%].size>
          - flag server Fighters_%Fight%:<-:%First_Fighter%
          - 1 > 2
          - flag <server.match_player[%First_Fighter%]> Fight:!
          - flag <server.match_player[%First_Fighter%]> Target:!
          - flag <server.match_player[%First_Fighter%]> Fight_Turn:!
          - flag <server.match_player[%First_Fighter%]> Attack:!
          - flag <server.match_player[%First_Fighter%]> Fight_Attack:!
          - flag <server.match_player[%First_Fighter%]> Fight_Dodged:!
          - flag <server.match_player[%First_Fighter%]> Fight_Blocked:!
          - flag <server.match_player[%First_Fighter%]> Fight_Weapon:!
          - flag <server.match_player[%First_Fighter%]> Fight_CD:!
          - flag <server.match_player[%First_Fighter%]> Fight_Leader_Warning:!
          - flag <server.match_player[%First_Fighter%]> Health:!
          - flag <server.match_player[%First_Fighter%]> Fight_Unhealthy_Start:!
          - flag <server.match_player[%First_Fighter%]> Weapon_Type:!
          - flag <server.match_player[%First_Fighter%]> Defender_First_Turn:!
          - flag <server.match_player[%First_Fighter%]> Fight_Winner:!
          - flag <server.match_player[%First_Fighter%]> Fight_Cancel:!
          }
        - flag global Fighters_<player.flag[Fight]>:!
        - flag server Fight_Turn_Counter_%Fight%:!
        - narrate "<red>Fight has been cancelled!"
        } else {
        - flag server Fight_Cancel_%Fight%:++
        - narrate "<gold>%Player% <blue>wants to <red>cancel <blue>the fight!"
        }


# +----------------------------------
# |   Roll
# +----------------------------------
Roll_Command:
    type: command
    name: roll
    description: Roll random numbers
    usage: /roll or /roll dice
    script:
      - define Player <player.flag[Character]>
      - if <context.args.size.is[EQUALS].to[0]> {
        - narrate "<gold>%Player% <blue>Rolled<&co> <gold><util.random.int[0].to[100]>" targets:<player.location.find.players.within[10]>
        - queue clear
        }
      - if <context.args.get[1]> == dice {
        - narrate "<gold>%Player% <blue>rolls the dice<&co> <gold><util.random.int[1].to[6]> & <gold><util.random.int[1].to[6]>" targets:<player.location.find.players.within[10]>
        }


























# +----------------------------------
# |   Winner Command - Kill
# +----------------------------------
Kill_Command:
    type: command
    name: Kill
    description: Kill another player
    usage: /kill
    script:
      - if !<player.flag[Fight_Winner]> {
        - narrate "<red>Only fight winners can use the kill command"
        - ^queue clear
        }
      - flag player Fight_Winner:!
      - define Fight <player.flag[Fight]>
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - define Player <player.flag[Character]>
      - run Fight_Kill
# Remove all of the loser's fight related flags
      - flag <server.match_player[%Target%]> Fight:!
      - flag <server.match_player[%Target%]> Fight_Turn:!
      - flag <server.match_player[%Target%]> Attack:!
      - flag <server.match_player[%Target%]> Fight_Attack:!
      - flag <server.match_player[%Target%]> Fight_Dodged:!
      - flag <server.match_player[%Target%]> Fight_Blocked:!
      - flag <server.match_player[%Target%]> Fight_Weapon:!
      - flag <server.match_player[%Target%]> Fight_CD:!
      - flag <server.match_player[%Target%]> Fight_Leader_Warning:!
      - flag <server.match_player[%Target%]> Health:!
      - flag <server.match_player[%Target%]> Fight_Unhealthy_Start:!
      - flag <server.match_player[%Target%]> Weapon_Type:!
      - flag <server.match_player[%Target%]> Defender_First_Turn:!
      - flag <server.match_player[%Target%]> Fight_Winner:!
      - flag <server.match_player[%Target%]> Fight_Cancel:!
      - flag player Target:!
# "Kill" the player physically causing them to respawn and lose most of their items.
      - adjust <server.match_player[%Target%]> health:0
      - if <global.flag[Fighters_%Fight%].size> > 1 {
        - queue clear
# Do nothing
        }
# Remove all of the rest of the fight related flags
      - flag global Fighters_<player.flag[Fight]>:!
      - flag server Fight_Turn_Counter_%Fight%:!
      - flag player Fight_Turn:!
      - flag player Attack:!
      - flag player Fight_Attack:!
      - flag player Fight_Dodged:!
      - flag player Fight_Blocked:!
      - flag player Fight_Weapon:!
      - flag player Fight_CD:!
      - flag player Fight_Leader_Warning:!
      - flag player Health:!
      - flag player Fight_Unhealthy_Start:!
      - flag player Weapon_Type:!
      - flag player Defender_First_Turn:!
      - flag player Fight:!
      - flag player Target:!
      - flag player Fight_Cancel:!
      }



# +----------------------------------
# |   Winner Command - Capture / Release
# +----------------------------------
Capture_Command:
    type: command
    name: Capture
    description: Capture another player
    usage: /Capture
    script:
      - if <player.flag[Fight_Winner]> {
        - narrate "<red>Only fight winners can use the mercy command"
        - queue clear
        }
      - define Fight <player.flag[Fight]>
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - define Player <player.flag[Character]>
      - flag player Fight_Winner:!
      - narrate "<gold>%Player% <blue>Ties <gold>%Target%<blue>'s hands behind %Gender% back." targets:<player.location.find.players.within[10]>
      - narrate "<gold>%Target%<blue>'s has been captured by <gold>%Player%" targets:<player.location.find.players.within[10]>
# Flag the player as having captured his/her target and the capured as captured.
      - flag player Captured:%Target%
      - flag <server.match_player[%Target%]> Captured_By:%Player%
      - flag <server.match_player[%Target%]> Fight:!
      - flag <server.match_player[%Target%]> Fight_Turn:!
      - flag <server.match_player[%Target%]> Attack:!
      - flag <server.match_player[%Target%]> Fight_Attack:!
      - flag <server.match_player[%Target%]> Fight_Dodged:!
      - flag <server.match_player[%Target%]> Fight_Blocked:!
      - flag <server.match_player[%Target%]> Fight_Weapon:!
      - flag <server.match_player[%Target%]> Fight_CD:!
      - flag <server.match_player[%Target%]> Fight_Leader_Warning:!
      - flag <server.match_player[%Target%]> Health:!
      - flag <server.match_player[%Target%]> Fight_Unhealthy_Start:!
      - flag <server.match_player[%Target%]> Weapon_Type:!
      - flag <server.match_player[%Target%]> Defender_First_Turn:!
      - flag <server.match_player[%Target%]> Fight_Winner:!
      - flag <server.match_player[%Target%]> Fight_Cancel:!
      - flag player Target:!
# "Kill" the player physically causing them to respawn and lose most of their items.
      - if <global.flag[Fighters_%Fight%].size> > 1 {
        - queue clear
# Do nothing
        }
# Remove all of the rest of the fight related flags
      - flag global Fighters_<player.flag[Fight]>:!
      - flag server Fight_Turn_Counter_%Fight%:!
      - flag player Fight_Turn:!
      - flag player Attack:!
      - flag player Fight_Attack:!
      - flag player Fight_Dodged:!
      - flag player Fight_Blocked:!
      - flag player Fight_Weapon:!
      - flag player Fight_CD:!
      - flag player Fight_Leader_Warning:!
      - flag player Health:!
      - flag player Fight_Unhealthy_Start:!
      - flag player Weapon_Type:!
      - flag player Defender_First_Turn:!
      - flag player Fight:!
      - flag player Target:!
      - flag player Fight_Cancel:!
      - repeat 10 {
        - wait 10
        - if <player.flag[Captured]> != null {
          - if <player.location.distance[<server.match_player[%Target%].location>]> > 10 {
            - narrate "<red>You've been captured by <gold>%Player%<red>, please follow this person until your release." targets:<server.match_player[%Target%]>
            - teleport <server.match_player[%Target%]> <player.location>
            }
          }

Free_Command:
    type: command
    name: Free
    description: Release another player
    usage: /free
    script:
      - if <player.flag[Captured]> != null {
        - define Target <server.match_player[<player.flag[Captured]>].flag[Character]>
        - define Player <player.flag[Character]>
        - flag <server.match_player[%Target%]> Captured_By:!
        - flag player Captured:!
        - narrate "<gold>%Player% <blue>releases <gold>%Target% <blue>from captivity" targets:<player.location.find.players.within[10]>
        - wait 2
        - narrate "<green>You've been released from <red>captivity" targets:<server.match_player[%Target%]>
        } else {
        - narrate "<red>You don't have anyone in your captivity."
        }






# +----------------------------------
# |   Winner Command - Mame
# +----------------------------------
Mame_Command:
    type: command
    name: Mame
    description: Mame another player
    usage: /mame
    script:
      - if !<player.flag[Fight_Winner]> {
        - narrate "<red>Only fight winners can use the mame command"
        - queue clear
        }
      - flag player Fight_Winner:!
      - define Fight <player.flag[Fight]>
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - define Player <player.flag[Character]>
      - run Fight_Mame
      - flag <server.match_player[%Target%]> Fight:!
      - flag <server.match_player[%Target%]> Fight_Turn:!
      - flag <server.match_player[%Target%]> Attack:!
      - flag <server.match_player[%Target%]> Fight_Attack:!
      - flag <server.match_player[%Target%]> Fight_Dodged:!
      - flag <server.match_player[%Target%]> Fight_Blocked:!
      - flag <server.match_player[%Target%]> Fight_Weapon:!
      - flag <server.match_player[%Target%]> Fight_CD:!
      - flag <server.match_player[%Target%]> Fight_Leader_Warning:!
      - flag <server.match_player[%Target%]> Health:!
      - flag <server.match_player[%Target%]> Fight_Unhealthy_Start:!
      - flag <server.match_player[%Target%]> Weapon_Type:!
      - flag <server.match_player[%Target%]> Defender_First_Turn:!
      - flag <server.match_player[%Target%]> Fight_Winner:!
      - flag <server.match_player[%Target%]> Fight_Cancel:!
# "Kill" the player physically causing them to respawn and lose most of their items.
      - adjust <server.match_player[%Target%]> health:0
      - if <global.flag[Fighters_%Fight%].size> > 1 {
        - queue clear
# Do nothing
        }
# Remove all of the rest of the fight related flags
      - flag global Fighters_<player.flag[Fight]>:!
      - flag server Fight_Turn_Counter_%Fight%:!
      - flag player Fight_Turn:!
      - flag player Attack:!
      - flag player Fight_Attack:!
      - flag player Fight_Dodged:!
      - flag player Fight_Blocked:!
      - flag player Fight_Weapon:!
      - flag player Fight_CD:!
      - flag player Fight_Leader_Warning:!
      - flag player Health:!
      - flag player Fight_Unhealthy_Start:!
      - flag player Weapon_Type:!
      - flag player Defender_First_Turn:!
      - flag player Fight:!
      - flag player Target:!
      - flag player Fight_Cancel:!

# +----------------------------------
# |   Winner Command - Knock Out
# +----------------------------------
Knockout_Command:
    type: command
    name: Knockout
    description: Knock out another player
    usage: /knockout
    script:
      - if <player.flag[Fight_Winner]> {
        - narrate "<red>Only fight winners can use the knockout command"
        - queue clear
        }
      - flag player Fight_Winner:!
      - define Fight <player.flag[Fight]>
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - define Player <player.flag[Character]>
      - narrate "<gold>%Player% knocks out <player.flag[Target]>" targets:<player.location.find.players.within[10]>
# Remove all of the loser's fight related flags
      - flag <server.match_player[%Target%]> Fight:!
      - flag <server.match_player[%Target%]> Fight_Turn:!
      - flag <server.match_player[%Target%]> Attack:!
      - flag <server.match_player[%Target%]> Fight_Attack:!
      - flag <server.match_player[%Target%]> Fight_Dodged:!
      - flag <server.match_player[%Target%]> Fight_Blocked:!
      - flag <server.match_player[%Target%]> Fight_Weapon:!
      - flag <server.match_player[%Target%]> Fight_CD:!
      - flag <server.match_player[%Target%]> Fight_Leader_Warning:!
      - flag <server.match_player[%Target%]> Health:!
      - flag <server.match_player[%Target%]> Fight_Unhealthy_Start:!
      - flag <server.match_player[%Target%]> Weapon_Type:!
      - flag <server.match_player[%Target%]> Defender_First_Turn:!
      - flag <server.match_player[%Target%]> Fight_Winner:!
      - flag <server.match_player[%Target%]> Fight_Cancel:!
      - flag player Target:!
# "Kill" the player physically causing them to respawn and lose most of their items.
      - adjust <server.match_player[%Target%]> health:0
      - if <global.flag[Fighters_%Fight%].size> > 1 {
        - queue clear
# Do nothing
        }
# Remove all of the rest of the fight related flags
      - flag global Fighters_<player.flag[Fight]>:!
      - flag server Fight_Turn_Counter_%Fight%:!
      - flag player Fight_Turn:!
      - flag player Attack:!
      - flag player Fight_Attack:!
      - flag player Fight_Dodged:!
      - flag player Fight_Blocked:!
      - flag player Fight_Weapon:!
      - flag player Fight_CD:!
      - flag player Fight_Leader_Warning:!
      - flag player Health:!
      - flag player Fight_Unhealthy_Start:!
      - flag player Weapon_Type:!
      - flag player Defender_First_Turn:!
      - flag player Fight:!
      - flag player Target:!
      - flag player Fight_Cancel:!


# +----------------------------------
# |   Winner Command - Mercy
# +----------------------------------
Mercy_Command:
    type: command
    name: Mercy
    description: Show mercy to another player
    usage: /Mercy
    script:
      - if <player.flag[Fight_Winner]> {
        - narrate "<red>Only fight winners can use the mercy command"
        - queue clear
        }
      - flag player Fight_Winner:!
      - define Fight <player.flag[Fight]>
      - define Player <player.flag[Character]>
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - narrate "<blue><player.name> shows <player.flag[Target]> mercy" targets:<player.location.find.players.within[10]>
      - flag <server.match_player[%Target%]> Fight:!
      - flag <server.match_player[%Target%]> Fight_Turn:!
      - flag <server.match_player[%Target%]> Attack:!
      - flag <server.match_player[%Target%]> Fight_Attack:!
      - flag <server.match_player[%Target%]> Fight_Dodged:!
      - flag <server.match_player[%Target%]> Fight_Blocked:!
      - flag <server.match_player[%Target%]> Fight_Weapon:!
      - flag <server.match_player[%Target%]> Fight_CD:!
      - flag <server.match_player[%Target%]> Fight_Leader_Warning:!
      - flag <server.match_player[%Target%]> Health:!
      - flag <server.match_player[%Target%]> Fight_Unhealthy_Start:!
      - flag <server.match_player[%Target%]> Weapon_Type:!
      - flag <server.match_player[%Target%]> Defender_First_Turn:!
      - flag <server.match_player[%Target%]> Fight_Winner:!
      - flag <server.match_player[%Target%]> Fight_Cancel:!
      - flag player Target:!
      - if <global.flag[Fighters_%Fight%].size> > 1 {
# Do nothing
        }
      - flag global Fighters_<player.flag[Fight]>:!
      - flag server Fight_Turn_Counter_%Fight%:!
      - flag player Fight_Turn:!
      - flag player Attack:!
      - flag player Fight_Attack:!
      - flag player Fight_Dodged:!
      - flag player Fight_Blocked:!
      - flag player Fight_Weapon:!
      - flag player Fight_CD:!
      - flag player Fight_Leader_Warning:!
      - flag player Health:!
      - flag player Fight_Unhealthy_Start:!
      - flag player Weapon_Type:!
      - flag player Defender_First_Turn:!
      - flag player Fight_Winner:!
      - flag player Fight:!
      - flag player Target:!
      - flag player Fight_Cancel:!


















# +----------------------------------
# |   Fight Debug
# +----------------------------------
        on Fight_Debug command:
# Helps with debugging
        - determine passively fulfilled
# Defining %Fight% for use inside tags
        - define Fight <player.flag[Fight]>
        - define Fight_Turn_Counter <server.flag[Fight_Turn_Counter_%Fight%].as_int>

        - narrate "<dark_red>Fight Debug"
        - narrate "<red>Your Fight flag ID is<&co> <gold>%Fight%"
        - narrate "<red>Turn counter is<&co> <gold><server.flag[Fight_Turn_Counter_%Fight%].as_int>"
#        - narrate "<red>It's<&co> <gold> <global.flag[Fighters_%Flag%].get[<server.flag[Fight_Turn_Counter_%Fight%]>]>"
        - narrate "<red>It's<&co> <gold> <global.flag[Fighters_%Fight%].get[%Fight_Turn_Counter%].as_list.formatted>'s turn"
        - narrate "<red>Number of players in fight<&co> <gold><global.flag[Fighters_%Fight%].size>"
        - narrate "<red>1<&co> <gold><global.flag[Fighters_%Fight%].get[1].as_list.formatted>"
        - narrate "<red>2<&co> <gold><global.flag[Fighters_%Fight%].get[2].as_list.formatted>"
        - narrate "<red>Your target is<&co> <gold><player.flag[Target]>"
        - narrate ""
        - if <player.flag[Fight_Turn]> {
          - narrate "<red> It's <gold>your <red>turn!"
          } else {
          - narrate "<red> It's <gold>NOT <red>your turn!"
          }

# +----------------------------------
# |   Fight Reset
# +----------------------------------
        on Fight_Reset command:
# Reset everything
        - determine passively fulfilled

# Defining %Fight% for use inside tags
        - define Fight <player.flag[Fight]>
        - define Target <server.match_player[<player.flag[Target]>].flag[Character]>

# general flags
        - flag global Fighters_%Fight%:!
        - flag server Fight_Turn_Counter_%Fight%:!

        - flag player Fight:!
        - flag player Fight_Turn:!
        - flag player Fight_Leader_Warning:!
        - flag player Target:!

# Attack Flags
        - flag player Attack:!
        - flag player Fight_Attack:!
        - flag player Fight_Dodged:!
        - flag player Fight_Blocked:!


# [Temporary for testing] Removing your Target's flags.

        - flag <server.match_player[%Target%]> Fight:!
        - flag <server.match_player[%Target%]> Fight_Turn:!
        - flag <server.match_player[%Target%]> Leader_Warning:!
        - flag <server.match_player[%Target%]> Target:!

# Attack Flags
        - flag <server.match_player[%Target%]> Attack:!
        - flag <server.match_player[%Target%]> Fight_Attack:!
        - flag <server.match_player[%Target%]> Fight_Dodged:!
        - flag <server.match_player[%Target%]> Fight_Blocked:!
        - narrate "<red>All Fight information Deleted"
































# +----------------------------------
# |  Unarmed Attack Damage
# +----------------------------------

Fight_Attack:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Unarmed
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - if 1 > 2
        - run Fight_Unarmed_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Unarmed_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Unarmed_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Unarmed_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Unarmed_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - if 1 > 2
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Unarmed_Attack_Messages
        - queue clear
        }

# +----------------------------------
# |  Sword Attack Damage
# +----------------------------------

Fight_Attack_Wood_sword:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Wood_Sword
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Sword_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - if 1 > 2
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Sword_Attack_Messages
        - queue clear
        }

Fight_Attack_Stone_sword:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Stone_Sword
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Sword_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Sword_Attack_Messages
        - queue clear
        - if 1 > 2
        }

Fight_Attack_Iron_sword:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Iron_Sword
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Sword_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Sword_Attack_Messages
        - queue clear
        - if 1 > 2
        }

Fight_Attack_Gold_sword:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Gold_Sword
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Sword_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Sword_Attack_Messages
        - queue clear
        - if 1 > 2
        }

Fight_Attack_Diamond_sword:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Diamond_Sword
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Sword_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Sword_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Sword_Attack_Messages
        - queue clear
        - if 1 > 2
        }

# +----------------------------------
# |  Axe Attack Damage
# +----------------------------------

Fight_Attack_Wood_Axe:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Wood_Axe
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Axe_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Axe_Attack_Messages
        - queue clear
        - if 1 > 2
        }

Fight_Attack_Stone_Axe:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Stone_Axe
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Axe_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Axe_Attack_Messages
        - queue clear
        - if 1 > 2
        }

Fight_Attack_Iron_Axe:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Iron_Axe
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Axe_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Axe_Attack_Messages
        - queue clear
        - if 1 > 2
        }

Fight_Attack_Gold_Axe:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Gold_Axe
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Axe_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Axe_Attack_Messages
        - queue clear
        - if 1 > 2
        }

Fight_Attack_Diamond_Axe:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Diamond_Axe
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Axe_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Axe_Attack_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Axe_Attack_Messages
        - queue clear
        - if 1 > 2
        }

Fight_Shoot_Bow:
    type: task
    Script:
# Check if the player attempted to Dodge
      - if <player.flag[Fight_Dodged]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Dodged:!
# Check if the player attempted to Block
        } else if <player.flag[Fight_Blocked]> {
# Lower chances of a good hit by 20
        - define random <util.random.int[-20].to[80]>
        - flag player Fight_Blocked:!
        } else {
# Check if the player didn't attempt to dodge or block, roll with full range
        - define random <util.random.int[1].to[100]>
        }
      - narrate "rolled %random%"
# Flagging the target with the attackers name and the weapon type
      - flag <server.match_player[<player.flag[target]>]> Attack:<player.name>
      - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:Bow
# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% <= 20 {
        - run Fight_Shoot_Bow_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!
        - queue clear

        } else if %random% > 20 && %random% <= 40 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:1
        - run Fight_Shoot_Bow_Messages
        - queue clear

        } else if %random% > 40 && %random% <= 60 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:2
        - run Fight_Shoot_Bow_Messages
        - queue clear

        } else if %random% > 60 && %random% <= 80 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:3
        - run Fight_Shoot_Bow_Messages
        - queue clear

        } else if %random% > 80 && %random% <= 95 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:4
        - run Fight_Shoot_Bow_Messages
        - queue clear

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Shoot_Bow_Messages
        - queue clear
        - if 1 > 2
        }


























# +----------------------------------
# |   Attack Messages (Unarmed)
# +----------------------------------

Fight_Unarmed_Miss_Messages:
    type: task
    Script:
      - define Player <player.flag[Character]>
      - random {
        - narrate "<gold>%Player% <red>Misses" targets:<player.location.find.players.within[10]>
        }
      - run Fight_Turn_Chooser

Fight_Unarmed_Attack_Messages:
    type: task
    Script:
      - define Player <player.name>
      - define Target <player.flag[Target]>
      - define Lower_Body_Part_Li li@
      - define Upper_Body_Part_Li li@
      - define Lower_Body_Part_Li "<def[Lower_Body_Part_Li].include[buttocks|lower abdomen|right thigh|left thigh|right knee|left knee| right calf|left calf|right ankle|left ankle|groin]>"
      - define Upper_Body_Part_Li "<def[Upper_Body_Part_Li].include[buttocks|face|head|neck|right shoulder|left shoulder|right arm|left arm|right forearm|left forearm|right hand|left hand|chest|upper abdomen|lower abdomen|groin]>"
      - define Lower_Body_Part <def[Lower_Body_Part_Li].random>
      - define Upper_Body_Part <def[Upper_Body_Part_Li].random>
# The Gender flag doesn't exist yet!!!!
      - if <player.flag[Gender]> != Female {
        - define Gender his
        } else {
        - define Gender her
        }
      - random {
        - narrate "<gold>%Player% <blue>attempts to punch <gold>%Target% <blue>in the <red>%Upper_Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>tries to Strike at <gold>%Target%'s <red>%Upper_Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>attempts to Scratch <gold>%Target%'s <red>%Upper_Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>tries to kick <gold>%Target% <blue>in the <red>%Lower_Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>attempts to tackle <gold>%Target%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>tries to throttle <gold>%Target%'s <red>neck" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>attempts to slap <gold>%Target%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>tries to smack <gold>%Target% <blue>in the <red>%Upper_Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>attempts to headbutt <gold>%Target%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>tries to stomp on <gold>%Target%'s <red>foot" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>attempts to bite <gold>%Target%'s <red>%Upper_Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>tries to pound <gold>%Target%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>attempts to jab <gold>%Target% <blue>in the <red>%Upper_Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>tries to give <gold>%Target% <blue>a right hook to the <red>%Upper_Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>attempts to pull <gold>%Target%'s <red>hair" targets:<player.location.find.players.within[10]>
        }
# Gives the turn to the next player
      - run Fight_Turn_Chooser

# +----------------------------------
# |   Attack Messages (Swords)
# +----------------------------------

Fight_Sword_Miss_Messages:
    type: task
    Script:
      - define Player <player.flag[Character]>
      - random {
        - narrate "<gold>%Player% <red>Misses" targets:<player.location.find.players.within[10]>
        }
      - run Fight_Turn_Chooser

Fight_Sword_Attack_Messages:
    type: task
    Script:
      - define Player <player.name>
      - define Target <player.flag[Target]>
      - define Weapon_Type <player.flag[Weapon_Type]>
      - define Body_Part_Li li@
      - define Body_Part_Li "<def[Body_Part_Li].include[buttocks|face|head|neck|right shoulder|left shoulder|right arm|left arm|right forearm|left forearm|right hand|left hand|chest|upper abdomen|lower abdomen|right thigh|left thigh|right knee|left knee| right calf|left calf|right ankle|left ankle|groin]>"
      - define Body_Part <def[Body_Part_Li].random>
# The Gender flag doesn't exist yet!!!!
      - if <player.flag[Gender]> != Female {
        - define Gender his
        } else {
        - define Gender her
        }
      - random {
        - narrate "<gold>%Player% <blue>attempts to stab <gold>%Target% <blue>in the <red>%Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>tries to slash <gold>%Target% <blue>in the <red>%Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>attempts to slash %Gender% %Weapon_Type% sword at <gold>%Target%'s <red>%Body_Part%" targets:<player.location.find.players.within[10]>
        }
# Gives the turn to the next player
      - run Fight_Turn_Chooser
      - flag player Weapon_Type:!


# +----------------------------------
# |   Attack Messages (Axes)
# +----------------------------------

Fight_Axe_Miss_Messages:
    type: task
    Script:
      - define Player <player.flag[Character]>
      - random {
        - narrate "<gold>%Player% <red>Misses" targets:<player.location.find.players.within[10]>
        }
      - run Fight_Turn_Chooser

Fight_Axe_Attack_Messages:
    type: task
    Script:
      - define Player <player.flag[Character]>
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - define Weapon_Type <player.flag[Weapon_Type]>
      - define Body_Part_Li li@
      - define Body_Part_Li "<def[Body_Part_Li].include[buttocks|face|head|neck|right shoulder|left shoulder|right arm|left arm|right forearm|left forearm|right hand|left hand|chest|upper abdomen|lower abdomen|right thigh|left thigh|right knee|left knee| right calf|left calf|right ankle|left ankle|groin]>"
      - define Body_Part <def[Body_Part_Li].random>
# The Gender flag doesn't exist yet!!!!
      - if <player.flag[Gender]> != Female {
        - define Gender his
        } else {
        - define Gender her
        }
      - random {
        - narrate "<gold>%Player% <blue>tries to slash <gold>%Target% <blue>in the <red>%Body_Part%" targets:<player.location.find.players.within[10]>
        - narrate "<gold>%Player% <blue>attempts to slash %Gender% %Weapon_Type% axe at <gold>%Target%'s <red>%Body_Part%" targets:<player.location.find.players.within[10]>
        }
# Gives the turn to the next player
      - run Fight_Turn_Chooser
      - flag player Weapon_Type:!


# +----------------------------------
# |   Attack Messages (Bows)
# +----------------------------------

Fight_Shoot_Bow_Miss_Messages:
    type: task
    Script:
      - define Player <player.flag[Character]>
      - random {
        - narrate "<gold>%Player% <red>Misses" targets:<player.location.find.players.within[10]>
        }
      - run Fight_Turn_Chooser

Fight_Shoot_Bow_Messages:
    type: task
    Script:
      - define Player <player.flag[Character]>
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - define Weapon_Type <player.flag[Weapon_Type]>
      - define Body_Part_Li li@
      - define Body_Part_Li "<def[Body_Part_Li].include[buttocks|face|head|neck|right shoulder|left shoulder|right arm|left arm|right forearm|left forearm|right hand|left hand|chest|upper abdomen|lower abdomen|right thigh|left thigh|right knee|left knee| right calf|left calf|right ankle|left ankle|groin]>"
      - define Body_Part <def[Body_Part_Li].random>
# The Gender flag doesn't exist yet!!!!
      - if <player.flag[Gender]> != Female {
        - define Gender his
        } else {
        - define Gender her
        }
      - random {
        - narrate "<gold>%Player% <blue>attempts to shoot <gold>%Target%'s <blue>in the <red>%Body_Part%" targets:<player.location.find.players.within[10]>
        }
# Gives the turn to the next player
      - run Fight_Turn_Chooser
      - flag player Weapon_Type:!















# +----------------------------------
# |   Win and Lose Scripts
# +----------------------------------

Fight_Lost:
    type: task
    Script:
      - define Fight <player.flag[Fight]>
      - flag player Fight_Loser
      - flag <server.match_player[<player.flag[target]>]> Fight_Winner
      - narrate "<red>You Lost the fight."
      - narrate "<red>Please wait for the winner to choose what happens to you..."
      - if <player.flag[Fight_Turn]> {
        - flag player Fight_Turn:!
        - run Fight_Turn_Chooser
      }
      - flag global Fighters_%Fight%:<-:<player.flag[Target]>
      - if 1 > 2
      - run Fight_Won player:<player.flag[Target]>

Fight_Won:
    type: task
    Script:
      - define Fight <player.flag[Fight]>
      - narrate "<red>You Won the fight."
      - narrate "<red>Please choose what happens to the loser<&co>"
      - narrate "<gold>/Mercy"
      - narrate "<gold>/Mame"
      - narrate "<gold>/KnockOut"
      - if <player.flag[VA_Kill]> {
        - narrate "<gold>/Capture"
        }
      - if <player.flag[VA_Kill]> {
        - narrate "<red>/Kill  - This has serious consequences for the loser."
        }

Fight_Mame:
    type: task
    Script:
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - define Player <player.flag[Character]>
      - flag player Target:!
# temporary, no need to list these every time. Just need to do it once.
      - flag global Common_Mame_Li:|:right ear|left ear|left nipple|right nipple|left thumb|right thumb|left index finger|right index finger|left middle finger|right middle finger|left ring finger|right ring finger|left pinky|right pinky|left little toe|right little toe|left big toe|right big toe
      - flag global Rare_Mame_Li:|:right arm|left arm|left forearm|right forearm|left hand|right hand|left calf|right calf|left ankle|right ankle|left eye|right eye|tounge
      - flag global Scar_Mame_Li:|:right cheek|left cheek|nose|forehead|left arm|right arm|left forearm|right forearm|left hand|right hand|chest|abdomen|back|across left eye|across right eye
      - define random <util.random.int[0].to[100]>



      - if %random% <= 45 {
        - if 1 > 2
        - define Common_Mame <global.flag[Common_Mame_Li].random>
# If the player already have that part mamed, run the mame script again.
        - if <server.match_player[%Target%].flag[Mamed].contains[%Common_Mame%]> {
          - run Fight_Mame
          } else {
          - flag <server.match_player[%Target%]> Common_Mamed:->:%Common_Mame%
          - random {
            - narrate "<gold>%Player% <blue>pulls out a small knife and cuts off <gold>%Target%<blue>'s <red>%Common_Mame%"
            }
          }



        } else if %random% > 50 {
        - define Scar_Mame <global.flag[Scar_Mame_Li].random>
# If the player already have that part mamed, run the mame script again.
        - if <server.match_player[%Target%].flag[Scared].contains[%Scar_Mame%]> {
          - run Fight_Mame
          } else {
          - flag <server.match_player[%Target%]> Rare_Mamed:->:%Scar_Mame%
          - random {
            - narrate "<gold>%Player% <blue>pulls out a small knife and cuts a deep wound over <gold>%Target%<blue>'s <red>%Scar_Mame%"
            }
          }



        }  else {
        - define Rare_Mame <global.flag[Rare_Mame_Li].random>
# If the player already have that part mamed, run the mame script again.
        - if <server.match_player[%Target%].flag[Mamed].contains[%Rare_Mame%]> {
          - run Fight_Mame
          } else {
          - flag <server.match_player[%Target%]> Rare_Mamed:->:%Rare_Mame%
          - random {
            - narrate "<gold>%Player% <blue>pulls out a small knife and cuts off <gold>%Target%<blue>'s <red>%Rare_Mame%"
            }
          }
        }

Fight_Kill:
    type: task
    Script:
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - define Player <player.flag[Character]>
      - flag player Target:!
      - if <player.flag[Gender]> != Female {
        - define Gender his
        } else {
        - define Gender her
        }
# Sword kill messages
      - if <player.item_in_hand> == i@wood_sword || <player.item_in_hand> == i@stone_sword || <player.item_in_hand> == i@iron_sword || <player.item_in_hand> == i@gold_sword || <player.item_in_hand> == i@diamond_sword {
        - random {
          - narrate "<gold>%Player% <red>chops off <gold>%Target%<red>’s head with %Gender% sword"
          - narrate "<gold>%Player% <red>decapitates <gold>%Target%<red> with %Gender% sword"
          - narrate "<gold>%Player% <red>stabs <gold>%Target%<red> in the heart with %Gender% sword"
          }
# Axe kill messages
        } else if <player.item_in_hand> == i@wood_axe || <player.item_in_hand> == i@stone_axe || <player.item_in_hand> == i@iron_axe || <player.item_in_hand> == i@gold_axe || <player.item_in_hand> == i@diamond_axe {
        - random {
          - narrate "<gold>%Player% <red>chops off <gold>%Target%<red>’s head with %Gender% axe"
          - narrate "<gold>%Player% <red>decapitates <gold>%Target%<red> with %Gender% axe"
          - narrate "<gold>%Player% <red>cleaves <gold>%Target%<red> with an axe"
          - narrate "<gold>%Player% <red>butchers <gold>%Target%<red> with %Gender% axe"
          }
# Bow kill messages
        } else if <player.item_in_hand> == i@bow {
        - random {
          - narrate "<gold>%Player% <red>pierces <gold>%Target%<red>'s heart with an arrow"
          - narrate "<gold>%Player% <red>peppers <gold>%Target%<red>'s body with arrows"
          }
# Unarmed kill messages
        } else {
        - random {
          - narrate "<gold>%Player% <red>asphyxiates <gold>%Target%<red>, leaving their body on the ground."
          - narrate "<gold>%Player% <red>strangles <gold>%Target%<red> until they are no longer moving."
          - narrate "<gold>%Player% <red>brutalizes <gold>%Target%<red> and leaves the lifeless body on the ground."
          - narrate "<gold>%Player% <red>forces <gold>%Target%<red>'s neck breaking their spine and allowing their body to slump to the ground."
          }
        }
      - adjust <server.match_player[%Target%]> health:0
      - flag player Murders:++
      - flag <server.match_player[%Target%]> Killed_By:%Player%







Fight_Escape:
    type: task
    Script:
      - define Fight <player.flag[Fight]>
      - define Target <server.match_player[<player.flag[Target]>].flag[Character]>
      - flag player Fight_Turn:!
      - flag player Attack:!
      - flag player Fight_Attack:!
      - flag player Fight_Dodged:!
      - flag player Fight_Blocked:!
      - flag player Fight_Weapon:!
      - flag player Fight_CD:!
      - flag player Fight_Leader_Warning:!
      - flag player Health:!
      - flag player Fight_Unhealthy_Start:!
      - flag player Weapon_Type:!
      - flag player Defender_First_Turn:!
      - flag player Fight_Winner:!
      - flag player Fight:!
      - flag player Target:!
# Check if there's anyone else left in the fight.
      - if <global.flag[Fighters_%Fight%].size> > 1 {
# Do nothing
        } else {
# If this concludes the end of the fight, remove your target's flags as well
        - flag global Fighters_<player.flag[Fight]>:!
        - flag server Fight_Turn_Counter_%Fight%:!
        - flag <server.match_player[%Target%]> Fight:!
        - flag <server.match_player[%Target%]> Fight_Turn:!
        - flag <server.match_player[%Target%]> Attack:!
        - flag <server.match_player[%Target%]> Fight_Attack:!
        - flag <server.match_player[%Target%]> Fight_Dodged:!
        - flag <server.match_player[%Target%]> Fight_Blocked:!
        - flag <server.match_player[%Target%]> Fight_Weapon:!
        - flag <server.match_player[%Target%]> Fight_CD:!
        - flag <server.match_player[%Target%]> Fight_Leader_Warning:!
        - flag <server.match_player[%Target%]> Health:!
        - flag <server.match_player[%Target%]> Fight_Unhealthy_Start:!
        - flag <server.match_player[%Target%]> Weapon_Type:!
        - flag <server.match_player[%Target%]> Defender_First_Turn:!
        - flag <server.match_player[%Target%]> Fight_Winner:!
        }











# +----------------------------------
# |   Other Task Scripts
# +----------------------------------

Fight_First_Turn_Attacker:
    type: task
    Script:
      - define Player <player.flag[Character]>
      - define Fight <player.flag[Fight]>
      - flag player Fight_Turn
      - flag server Fight_Turn_Counter_%Fight%:1
      - random {
        - narrate "<gold>%Player% <blue>gets the first turn" targets:<player.location.find.players.within[10]>
        }

Fight_First_Turn_Defender:
    type: task
    Script:
      - define Player <player.flag[Character]>
      - define Fight <player.flag[Fight]>
      - flag <server.match_player[<player.flag[target]>]> Fight_Turn
      - flag server Fight_Turn_Counter_%Fight%:2
      - flag player First_Turn
      - random {
        - narrate "<gold><player.flag[Target]> <blue>gets the first turn" targets:<player.location.find.players.within[10]>
        }


Fight_Not_Your_Turn:
    type: task
    Script:
      - random {
        - narrate "<red>It's not your turn to fight, please wait."
        - narrate "<red>Please be patient and wait for your turn."
        }

Fight_Cant_Fight:
    type: task
    Script:
      - random {
        - narrate "<red>You're too wounded to fight. Please wait <player.flag[fight_CD]>"
        }

Fight_Damage:
    type: task
    Script:
# [Temporary] confirmation that you are going to be damaged
      - narrate "<red> You were damaged"
      - define Player <player.flag[Character]>
      - if <player.flag[Fight_Attack]> != null {
        - if <player.flag[Fight_Attack]> == 1 {
          - flag player health:-:1
          - if <player.flag[health]> <= 0 {
# This if statements just fixes a selecting error in sublime. Making it look nicer when editing
            - if 1 > 2
            - narrate "<dark_red>YOU LOST"
            - run Fight_Lost
            - queue clear
            }
# Setting the actual health of the player to how much health they are supposed to have left
            - adjust <player> health:<player.flag[Health]>
# Setting the hunger of the player to 10(half) -  so they don't regenerate health.
            - adjust <player> food_level:10
            - narrate "<red>%Player% lost <gold>1 <red>health" targets:<player.location.find.players.within[10]>
          }
        - if <player.flag[Fight_Attack]> == 2 {
          - flag player health:-:2
          - if <player.flag[health]> <= 0 {
            - if 1 > 2
            - narrate "<dark_red>YOU LOST"
            - run Fight_Lost
            - queue clear
            }
            - adjust <player> health:<player.flag[Health]>
            - adjust <player> food_level:10
            - narrate "<red>%Player% lost <gold>2 <red> health" targets:<player.location.find.players.within[10]>
          }
        - if <player.flag[Fight_Attack]> == 3 {
          - flag player health:-:3
          - if <player.flag[health]> <= 0 {
            - if 1 > 2
              - narrate "<dark_red>YOU LOST"
              - run Fight_Lost
              - queue clear
              }
            - adjust <player> health:<player.flag[Health]>
            - adjust <player> food_level:10
            - narrate "<red>%Player% lost <gold>3 <red> health" targets:<player.location.find.players.within[10]>
          }
        - if <player.flag[Fight_Attack]> == 4 {
          - flag player health:-:4
          - if <player.flag[health]> <= 0 {
            - if 1 > 2
            - narrate "<dark_red>YOU LOST"
            - run Fight_Lost
            - queue clear
            }
            - adjust <player> health:<player.flag[Health]>
            - adjust <player> food_level:10
            - narrate "<red>%Player% lost <gold>4 <red> health" targets:<player.location.find.players.within[10]>
          }
        - if <player.flag[Fight_Attack]> == 5 {
          - flag player health:-:5
          - if <player.flag[health]> <= 0 {
            - if 1 > 2
            - narrate "<dark_red>YOU LOST"
            - run Fight_Lost
            - queue clear
            }
            - adjust <player> health:<player.flag[Health]>
            - adjust <player> food_level:10
            - narrate "<red>%Player% lost <gold>5 <red> health" targets:<player.location.find.players.within[10]>
          }
        - flag player Fight_Attack:!
        }
      - flag player Attack:!


Fight_Dodge:
    type: task
    Script:
# Defining stuff, for narrates
      - define Player <player.flag[Character]>
      - define Attacker <player.flag[Attack]>
      - define Weapon <player.flag[Fight_Weapon]>
# Removing attack flags, so they won't get damaged
      - flag player Attack:!
      - flag player Fight_Attack:!
      - flag player Fight_Shoot:!
      - flag player Fight_Throw:!
      - flag player Fight_Weapon:!
      - if %Weapon% == Unarmed {
        - narrate "<gold>%Player% <blue>quickly moves out of reach as he was nearly struck by <gold>%Attacker%" targets:<player.location.find.players.within[10]>
        } else {
        - random {
          - narrate "<gold>%Player% <blue>quickly moves out of reach as he was nearly struck by <gold>%Attacker%’s <blue>%Weapon%" targets:<player.location.find.players.within[10]>
          }
        }
      - narrate "<blue>It's still <gold>%Player%'s <blue>turn" targets:<player.location.find.players.within[10]>

Fight_Dodge_Fall:
    type: task
    Script:
# Defining stuff, for narrates and flags
      - define Player <player.flag[Character]>
      - define Attacker <player.flag[Attack]>
      - define Weapon <player.flag[Fight_Weapon]>
      - define Fight <player.flag[Fight]>
      - if <player.flag[Gender]> == Male {
        - define Gender his
        } else {
        - define Gender her
        }
# Removing attack flags, so they won't get damaged
      - flag player Attack:!
      - flag player Fight_Attack:!
      - flag player Fight_Weapon:!
      - flag player Fight_Shoot:!
      - flag player Fight_Throw:!
# Explains what happened
      - random {
        - narrate "<gold>%Player% <blue>barely dodges the %Weapon%, but falls over, losing %Gender% turn" targets:<player.location.find.players.within[10]>
        }
      - define Random <util.random.int[1].to[100]>
      - if %Random% > 80 {
        } else {
        - random {
          - repeat 1 {
            - flag player health:-:1
            - define Fall_Damage 1
            }
          - repeat 1 {
            - flag player health:-:2
            - define Fall_Damage 2
            }
          }
        - if <player.flag[health]> <= 0 {
          - if 1 > 2
          - narrate "<dark_red>YOU LOST"
          - run Fight_Lost
          - queue clear
          }
          - adjust <player> health:<player.flag[Health]>
          - adjust <player> food_level:10
          - narrate "<gold>%Player% <blue>lost <red>%Fall_Damage% <blue>health from falling over" targets:<player.location.find.players.within[10]>
        }
# Player loses their turn.
      - flag player Fight_Turn:!
#      - flag server Fight_Turn_Counter_%Fight%:++
      - run Fight_Turn_Chooser

Fight_Turn_Chooser:
    type: task
    Script:
# Defining %Fight% and %Fight_Turn_Counter% for use inside tags
      - define Fight <player.flag[Fight]>
      - flag server Fight_Turn_Counter_%Fight%:++
      - define Fight_Turn_Counter <server.flag[Fight_Turn_Counter_%Fight%].as_int>

# Checking if the Fight_Turn_Counter number is bigger than the amount of players in the fight
      - if <server.flag[Fight_Turn_Counter_%Fight%]> > <global.flag[Fighters_%Fight%].size> {
# If it's bigger than the amount of players, resetting it to "1"
        - flag server Fight_Turn_Counter_%Fight%:1
# Flagging the first player with their turn
        - flag <server.match_player[<global.flag[Fighters_%Fight%].get[1].as_list.formatted>]> Fight_Turn
# [Temporary] Confirmation that it worked.
        - narrate "<blue>Giving the turn to first player<&co> <gold><global.flag[Fighters_%Fight%].get[1].as_list.formatted>" Targets:<player.location.find.players.within[10]>

# If there's more players in the fight than the current turn counter number. Find the next player
        } else {
# Flagging the next player with their Turn
        - flag <server.match_player[<global.flag[Fighters_%Fight%].get[%Fight_Turn_Counter%].as_list.formatted>]> Fight_Turn
# [Temporary] Confirmation that it worked.
        - narrate "<blue>Giving the turn to<&co> <gold><global.flag[Fighters_%Fight%].get[%Fight_Turn_Counter%].as_list.formatted>" Targets:<player.location.find.players.within[10]>
        }