Paste #11808: Untitled Paste

Date: 2014/12/04 14:10:37 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


# +----------------------------------
# |   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)

# Attack
# Fight_Attack
# Fight_Dodged
# Fight_Blocked
# Fight_Weapon

#<li@list.size> (returns the size of the list)
#<li@list.include[...|...]>
#.include[three|four]
#<player.location.distance[<player2.location>]> < 5
#- adjust <player> health:1
#- queue delay:5t 

Fight_Script:
    type: world
    events:
# +----------------------------------
# |   Fight Start
# +----------------------------------
        on fight command:
        - determine passively fulfilled


# +- 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!"
          } else {
          - define Target <context.args.get[1]>
# Checking that they aren't on a fight Cooldown
          - if <player.flag[Fight_CD]> {
            - run Fight_Cant_Fight
            } else {
# 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"
              } else {
# 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"
                } else {

# 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"
                  } else {

                  - if <player.flag[Leader_Warning]> {
                    - narrate "<red>RUN LEADER THINGY"
                    }
# 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 Leader_Warning
                    } else {
# +----------------------------------


# 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]>

# 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
# +----------------------------------
        on Target command:
        - determine passively fulfilled
# 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!"
          } else {
# 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"
            } else {
# 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."
              } else {
# Setting new target
              - flag player Target:<context.parsed_args.get[1]>
              - narrate "<blue>You've targeted<&co> <gold><player.flag[Target]>."
              }
            }
          }

# +----------------------------------
# |   Attack
# +----------------------------------
        on attack command:
        - determine passively fulfilled
# Defining %Fight% for use inside tags
        - define Fight <player.flag[Fight]>

# 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"
          } else {

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

# Removing the players turn
            - flag player Fight_Turn:!

# 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
              } else if <player.item_in_hand> == i@stone_sword {
              - flag player Weapon_Type:stone
              - run Fight_Attack_Stone_sword
              } else if <player.item_in_hand> == i@iron_sword {
              - flag player Weapon_Type:iron
              - run Fight_Attack_Iron_sword
              } else if <player.item_in_hand> == i@gold_sword {
              - flag player Weapon_Type:golden
              - run Fight_Attack_Gold_sword
              } else if <player.item_in_hand> == i@diamond_sword {
              - flag player Weapon_Type:diamond
              - run Fight_Attack_Diamond_sword
              } else if <player.item_in_hand> == i@wood_axe {
              - flag player Weapon_Type:wooden
              - run Fight_Attack_Wood_Axe
              } else if <player.item_in_hand> == i@stone_axe {
              - flag player Weapon_Type:stone
              - run Fight_Attack_Stone_Axe
              } else if <player.item_in_hand> == i@iron_axe {
              - flag player Weapon_Type:iron
              - run Fight_Attack_Iron_Axe
              } else if <player.item_in_hand> == i@gold_axe {
              - flag player Weapon_Type:gold
              - run Fight_Attack_Gold_Axe
              } else if <player.item_in_hand> == i@diamond_axe {
              - flag player Weapon_Type:diamond
              - run Fight_Attack_Diamond_Axe
              } else {
# If they don't have a weapon, normal attack is used.
              - run Fight_Attack
              }
# [Temporary] Confirmation that it worked.
            - narrate "<red>YOU ATTACK"
            }
          }



# +----------------------------------
# |   Shoot
# +----------------------------------
        on Shoot command:
        - determine passively fulfilled
        - if <player.flag[Fight]> {
          - if <player.flag[Fight_Turn]> {
#Check for Bow
#Check for CrossBow
            } else {
            - run Fight_Not_Your_Turn
            }
          } else {
          - narrate "<red>You need to be in a fight to use the Shoot command"
          }
# +----------------------------------
# |   Throw
# +----------------------------------
        on Throw command:
        - determine passively fulfilled
        - if <player.flag[Fight]> {
          - if <player.flag[Fight_Turn]> {
#Check for Daggers
            } else {
            - run Fight_Not_Your_Turn
            }
          } else {
          - narrate "<red>You need to be in a fight to use the Throw command"
          }
# +----------------------------------
# |   Dodge
# +----------------------------------
        on Dodge command:
        - determine passively fulfilled
# Checking if player is in a fight
        - if <player.has_flag[Fight]> !true {
          - narrate "<red>You need to be in a fight to use the dodge command"
          } else {
# Checking if it's their turn
          - if !<player.flag[Fight_Turn]> {
            - run Fight_Not_Your_Turn 
            } else {
# Checking if they have been attacked
            - if !<player.has_flag[Attack]> {
              - narrate "<red>There's nothing to dodge."
              } else {
# Defining a random number between 0 and 100
              - define Random <util.random.int[0].to[100]>
              - define Player <player.name>
# 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:!
#                    - flag server Fight_Turn_Counter_%Fight%:++
                    - run Fight_Turn_Chooser
                    }
                  }
                }
              }
            }
          }

# +----------------------------------
# |   Block
# +----------------------------------
        on Block command:
        - determine passively fulfilled
        - if <player.flag[Target]> {
          - if <player.flag[Fight_Turn]> {

            } else {
            - run Fight_Not_Your_Turn
            }
          } else {
          - narrate "<red>You need to be in a fight to use the Block command"
          }
# +----------------------------------
# |   Taunt
# +----------------------------------
        on Taunt command:
        - determine passively fulfilled
        - if <player.flag[Target]> {
          - if <player.flag[Fight_Turn]> {

            } else {
            - run Fight_Not_Your_Turn
            }
          } else {
          - narrate "<red>You need to be in a fight to use the Taunt command"
          }

# +----------------------------------
# |   Escape
# +----------------------------------
        on escape command:
        - determine passively fulfilled
        - if <player.flag[Target]> {
          - if <player.flag[Fight_Turn]> {

            } else {
            - run Fight_Not_Your_Turn
            }
          } else {
          - narrate "<red>You need to be in a fight to use the Escape command"
          }
# +----------------------------------
# |   forfeit
# +----------------------------------
        on Cancel command:
        - determine passively fulfilled
        - if <player.flag[Target]> {

          } else {
          - narrate "<red>You need to be in a fight to use the Cancel command"
          }
# +----------------------------------
# |   Roll
# +----------------------------------
        on roll command:
        - determine passively fulfilled
        - narrate "<blue><player.name> Rolled<&co> <gold><util.random.int[1].to[100]>" targets:<player.location.find.players.within[10]>

# +----------------------------------
# |   Winner Commands
# +----------------------------------
        on kill command:
        - determine passively fulfilled
        - if <player.flag[Fight_Winner]> {
          - if <player.flag[VA_Kill]> {
            - execute as_server "kill <player.flag[Target]>"
            } else {
            - narrate "<red>You don't have an accepted VA to kill"
            }
          }


        on capture command:
        - determine passively fulfilled
        - if <player.flag[Fight_Winner]> {
          }
        on mame command:
        - determine passively fulfilled
        - if <player.flag[Fight_Winner]> {
          }
        on knockout command:
        - determine passively fulfilled
        - if <player.flag[Fight_Winner]> {
          }
        on mercy command:
        - determine passively fulfilled
        - if <player.flag[Fight_Winner]> {
          - define Fight <player.flag[Fight]>
          - if <player.flag[Fight_Winner]> {
            - narrate "<blue><player.name> shows <player.flag[Target]> mercy" targets:<player.location.find.players.within[10]>
            - flag <server.match_player[<player.flag[Target]>]> Fight:!
            - flag <server.match_player[<player.flag[Target]>]> Fight_Turn:!
            - flag <server.match_player[<player.flag[Target]>]> Target:!
            - flag player Target:!
            - flag player Fight_Winner:!
            - if 1 > 2
            - if <global.flag[Fighters_%Fight%].size> > 1 {
# Do nothing
            } else {
            - flag global Fighters_<player.flag[Fight]>:!
            - flag server Fight_Turn_Counter_%Fight%:!
            - flag player Fight:!
            }

# Check if there's more than 1 person left in the fight. If not end it. If there is, start new turn.
            }
          } else {
          - narrate "<red>Only fight winners can use the mercy command"
          }

# +----------------------------------
# |   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 Next_Turn
# +----------------------------------
        on Fight_Next_Turn command:
# Forces the next turn
        - determine passively fulfilled
# Defining %Fight% for use inside tags
        - define Fight <player.flag[Fight]>

# [Temporary] Confirmation that it worked.
        - narrate "<red>Forcing a new turn"
        - flag player Fight_Turn:!

# Running the task script that determines who's turn it is.
        - run Fight_Turn_Chooser
# +----------------------------------
# |   Fight Reset
# +----------------------------------
        on Fight_Reset command:
# Reset everything
        - determine passively fulfilled

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

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

        - flag player Fight:!
        - flag player Fight_Turn:!
        - flag player 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 {
        - run Fight_Unarmed_Miss_Messages
        - flag <server.match_player[<player.flag[target]>]> Attack:!
        - flag <server.match_player[<player.flag[target]>]> Fight_Weapon:!

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

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

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

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

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

# +----------------------------------
# |  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:!

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

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

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

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

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

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:!

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

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

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

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

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Sword_Attack_Messages
        - 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:!

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

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

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

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

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Sword_Attack_Messages
        - 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:!

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

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

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

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

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Sword_Attack_Messages
        - 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:!

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

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

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

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

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Sword_Attack_Messages
        - 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:!

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

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

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

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

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Axe_Attack_Messages
        - 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:!

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

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

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

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

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Axe_Attack_Messages
        - 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:!

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

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

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

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

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Axe_Attack_Messages
        - 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:!

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

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

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

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

        } else if %random% > 95 && %random% <= 100 {
        - flag <server.match_player[<player.flag[target]>]> Fight_Attack:5
        - run Fight_Axe_Attack_Messages
        - 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:!

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

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

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

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

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



























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

Fight_Unarmed_Miss_Messages:
    type: task
    Script:
      - define Player <player.name>
      - 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.name>
      - 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


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

Fight_Axe_Miss_Messages:
    type: task
    Script:
      - define Player <player.name>
      - 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.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>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


















# +----------------------------------
# |   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..."
      - flag global Fighters_%Fight%:<-:<player.flag[Target]>
      - if 1 > 2
      - if <player.flag[Fight_Turn]> {
        - flag player Fight_Turn:!
#        - flag server Fight_Turn_Counter_%Fight%:++
        - run Fight_Turn_Chooser
      }
      - 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."
        }



























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

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

Fight_First_Turn_Defender:
    type: task
    Script:
      - define Fight <player.flag[Fight]>
      - flag <server.match_player[<player.flag[target]>]> Fight_Turn
      - flag server Fight_Turn_Counter_%Fight%:2
      - 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.name>
      - 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.name>
      - 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.name>
      - 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]>
        }