Paste #11608: Edit of P#11607 - Edit of P#11606 - Untitled Paste

Date: 2014/11/27 15:42:03 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


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

#<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 {
# 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 !p@<context.parsed_args.get[1]>.is_online {
            - if p@<context.parsed_args.get[1]>.is_online {
              - 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[<context.parsed_args.get[1].location>]> > 10 {
              - if <player.location.distance[<context.parsed_args.get[1].location>]> < 1 {
                - narrate "<red>You're too far away to initiate a fight"
                } else {

# Checking if player is already in a fight
                - if <player.flag[Fight]> {
                  - 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 <p@<context.parsed_args.get[1]>.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:<context.parsed_args.get[1]>
                    - flag p@<player.flag[Target]> Target:<player.name>

# assigning Unique fight name to the players
                    - flag player Fight:<player.name>
                    - flag p@<player.flag[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 p@<player.flag[Target]> health:<player.health.scale>
                    - if <p@<player.flag[Target]>.flag[health]> < 20 {
                      - flag p@<player.flag[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:p@<player.flag[target]>
                    - narrate "<red>| <blue>Starting fight with<&co> <red><player.name>" targets:p@<player.flag[target]>
                    - narrate "<red>+-----------------------------------------------------+" targets:p@<player.flag[target]>

# Assigning the turn counter.
                    - flag server Fight_Turn_Counter_%Fight%:1

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

# Giving the turn to the attacker- Allowing the fight to begin [Temporary]
                    - flag player Fight_Turn
                    }
                  }
                }
              }
            }
          }

# +----------------------------------
# |   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 !<p@<context.parsed_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 <p@<context.parsed_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]> {
          - if <player.flag[Fight_Attack]> {
            - if <player.flag[Fight_Attack]> == 1 {
              - flag player health:-:1
              - if <player.flag[health]> =< 0 {
                - narrate "<dark_red>YOU LOST"
                - run Fight_Dead
                - queue clear
                }
              - adjust <player> health:<player.flag[Health]>
              - narrate "<red>1 damage" targets:<player.location.find.players.within[10]>
              }
            - if <player.flag[Fight_Attack]> == 2 {
              - flag player health:-:2
              - if <player.flag[health]> =< 0 {
                - narrate "<dark_red>YOU LOST"
                - run Fight_Dead
                - queue clear
                }
              - adjust <player> health:<player.flag[Health]>
              - narrate "<red>2 damage" targets:<player.location.find.players.within[10]>
              }
            - if <player.flag[Fight_Attack]> == 3 {
              - flag player health:-:3
              - if <player.flag[health]> =< 0 {
                - narrate "<dark_red>YOU LOST"
                - run Fight_Dead
                - queue clear
                }
              - adjust <player> health:<player.flag[Health]>
              - narrate "<red>3 damage" targets:<player.location.find.players.within[10]>
              }
            - if <player.flag[Fight_Attack]> == 4 {
              - flag player health:-:4
              - if <player.flag[health]> =< 0 {
                - narrate "<dark_red>YOU LOST"
                - run Fight_Dead
                - queue clear
                }
              - adjust <player> health:<player.flag[Health]>
              - narrate "<red>4 damage" targets:<player.location.find.players.within[10]>
              }
            - if <player.flag[Fight_Attack]> == 5 {
              - flag player health:-:5
              - if <player.flag[health]> =< 0 {
                - narrate "<dark_red>YOU LOST"
                - run Fight_Dead
                - queue clear
                }
              - adjust <player> health:<player.flag[Health]>
              - narrate "<red>5 damage" targets:<player.location.find.players.within[10]>
              }
            - flag player Fight_Attack:!
            }
          - wait 2
          - flag player Attack:!
          } else {

# 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 {
                - run Fight_Attack_Wood_Sword
                } else {
                - if <player.item_in_hand> == i@stone_sword {
                  - run Fight_Attack_Stone_Sword
                  } else {
                  - if <player.item_in_hand> == i@iron_sword {
                    - run Fight_Attack_Iron_Sword
                    } else {
                    - if <player.item_in_hand> == i@gold_sword || i@diamond_sword {
                      - run Fight_Attack_Gold_Sword
                      } else {
                      - if <player.item_in_hand> == i@wood_axe {
                        - run Fight_Attack_Wood_Axe
                        } else {
                        - if <player.item_in_hand> == i@stone_axe {
                          - run Fight_Attack_Stone_Axe
                          } else {
                          - if <player.item_in_hand> == i@iron_axe {
                            - run Fight_Attack_Iron_Axe
                            } else {
                            - if <player.item_in_hand> == i@gold_axe || i@diamond_axe {
                              - run Fight_Attack_Gold_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"

# Adding one to the turn counter
              - flag server Fight_Turn_Counter_%Fight%:++

# Running the task script that determines who's turn it is.
              - run Fight_Turn_Chooser
              }
            }
          }



# +----------------------------------
# |   Shoot
# +----------------------------------
        on Shoot command:
        - determine passively fulfilled
        - if <player.flag[Target]> {
          - if <player.flag[Fight_Turn]> {
#Check for Bow
#Check for CrossBow
            } else {
            - run Fight_Not_Your_Turn
            }
          } else {
          - narrate "You need to be in a fight to use these commands"
          }
# +----------------------------------
# |   Throw
# +----------------------------------
        on Throw command:
        - determine passively fulfilled
        - if <player.flag[Target]> {
          - if <player.flag[Fight_Turn]> {
#Check for Daggers
            } else {
            - run Fight_Not_Your_Turn
            }
          } else {
          - narrate "You need to be in a fight to use these commands"
          }
# +----------------------------------
# |   Dodge
# +----------------------------------
        on Dodge command:
        - determine passively fulfilled
        - if <player.flag[Target]> {
          - if <player.flag[Fight_Turn]> {
            - run Fight_Dodge
            } else {
            - run Fight_Not_Your_Turn
            }
          } else {
          - narrate "You need to be in a fight to use these commands"
          }
# +----------------------------------
# |   Block
# +----------------------------------
        on Block command:
        - determine passively fulfilled
        - if <player.flag[Target]> {
          - if <player.flag[Fight_Turn]> {

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

            } else {
            - run Fight_Not_Your_Turn
            }
          } else {
          - narrate "You need to be in a fight to use these commands"
          }

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

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

          } else {
          - narrate "You need to be in a fight to use these commands"
          }
# +----------------------------------
# |   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

        on mame command:
        - determine passively fulfilled

        on knock out command:
        - determine passively fulfilled

        on leave command:
        - determine passively fulfilled

# +----------------------------------
# |   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
# [Temporary] Confirmation that it worked.
        - narrate "<red>Forcing a new turn"

# Adding one to the turn counter
        - flag server Fight_Turn_Counter_%Fight%:++

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

# 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:!
        - narrate "<red>All Fight information Deleted"
































# +----------------------------------
# |   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[1].to[100]> - 20
        - 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[1].to[100]> - 20 {
        - 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]>
        }

# Checking the random number, to determine the amount of damage it will hit for.
      - if %random% =< 20 {
        - narrate "rolled %random%"
        - run Fight_Attack_0

        } else if %random% > 20 && =< 40 {
        - narrate "rolled %random%"
        - run Fight_Attack_1

        } else if %random% > 40 && =< 60 {
        - narrate "rolled %random%"
        - run Fight_Attack_2

        } else if %random% > 60 && =< 80 {
        - narrate "rolled %random%"
        - run Fight_Attack_3

        } else if %random% > 80 && =< 100 {
        - narrate "rolled %random%"
        - run Fight_Attack_4
        }

#      - random {
#          - run Fight_Attack_0
#          - run Fight_Attack_0
#          - run Fight_Attack_1
#          - run Fight_Attack_1
#          - run Fight_Attack_1
#          - run Fight_Attack_1
#          - run Fight_Attack_2
#          - run Fight_Attack_2
#          - run Fight_Attack_2
#          - run Fight_Attack_2
#          - run Fight_Attack_3
#          - run Fight_Attack_3
#          }




        - narrate "<blue><player.name> Rolled<&co> <gold><util.random.int[1].to[100]>" targets:<player.location.find.players.within[10]>
Fight_Attack_Wood_sword:
    type: task
    Script:
      - narrate "Wood_Sword"
      - random {
          - run Fight_Attack_Wood_Sword_0
          - run Fight_Attack_Wood_Sword_0
          - run Fight_Attack_Wood_Sword_1
          - run Fight_Attack_Wood_Sword_1
          - run Fight_Attack_Wood_Sword_1
          - run Fight_Attack_Wood_Sword_1
          - run Fight_Attack_Wood_Sword_2
          - run Fight_Attack_Wood_Sword_2
          - run Fight_Attack_Wood_Sword_2
          - run Fight_Attack_Wood_Sword_2
          - run Fight_Attack_Wood_Sword_3
          - run Fight_Attack_Wood_Sword_3
          }

Fight_Attack_Stone_sword:
    type: task
    Script:
      - narrate "Stone_Sword"
      - random {
        - run Fight_Attack_Stone_Sword_0
        - run Fight_Attack_Stone_Sword_1
        - run Fight_Attack_Stone_Sword_1
        - run Fight_Attack_Stone_Sword_1
        - run Fight_Attack_Stone_Sword_1
        - run Fight_Attack_Stone_Sword_2
        - run Fight_Attack_Stone_Sword_2
        - run Fight_Attack_Stone_Sword_2
        - run Fight_Attack_Stone_Sword_2
        - run Fight_Attack_Stone_Sword_3
        - run Fight_Attack_Stone_Sword_3
        - run Fight_Attack_Stone_Sword_4
        }

Fight_Attack_Iron_sword:
    type: task
    Script:
      - narrate "Iron_Sword"
      - random {
        - run Fight_Attack_Iron_Sword_0
        - run Fight_Attack_Iron_Sword_1
        - run Fight_Attack_Iron_Sword_1
        - run Fight_Attack_Iron_Sword_1
        - run Fight_Attack_Iron_Sword_2
        - run Fight_Attack_Iron_Sword_2
        - run Fight_Attack_Iron_Sword_2
        - run Fight_Attack_Iron_Sword_3
        - run Fight_Attack_Iron_Sword_3
        - run Fight_Attack_Iron_Sword_4
        - run Fight_Attack_Iron_Sword_4
        - run Fight_Attack_Iron_Sword_5
        }

Fight_Attack_Gold_sword:
    type: task
    Script:
      - narrate "Gold_Sword"
      - random {
        - run Fight_Attack_Gold_Sword_0
        - run Fight_Attack_Gold_Sword_1
        - run Fight_Attack_Gold_Sword_1
        - run Fight_Attack_Gold_Sword_2
        - run Fight_Attack_Gold_Sword_2
        - run Fight_Attack_Gold_Sword_2
        - run Fight_Attack_Gold_Sword_3
        - run Fight_Attack_Gold_Sword_3
        - run Fight_Attack_Gold_Sword_4
        - run Fight_Attack_Gold_Sword_4
        - run Fight_Attack_Gold_Sword_5
        - run Fight_Attack_Gold_Sword_5
      }

Fight_Attack_Diamond_sword:
    type: task
    Script:
      - narrate "Diamond_Sword"
      - random {
        - run Fight_Attack_Diamond_Sword_0
        - run Fight_Attack_Diamond_Sword_1
        - run Fight_Attack_Diamond_Sword_1
        - run Fight_Attack_Diamond_Sword_2
        - run Fight_Attack_Diamond_Sword_2
        - run Fight_Attack_Diamond_Sword_2
        - run Fight_Attack_Diamond_Sword_3
        - run Fight_Attack_Diamond_Sword_3
        - run Fight_Attack_Diamond_Sword_4
        - run Fight_Attack_Diamond_Sword_4
        - run Fight_Attack_Diamond_Sword_5
        - run Fight_Attack_Diamond_Sword_5
      }

# +----------------------------------
# |   Attack Messages (no Weapon)
# +----------------------------------

Fight_Attack_0:
    type: task
    Script:
      - random {
        - narrate "NW miss0" targets:<player.location.find.players.within[10]>
        - narrate "NW miss1" targets:<player.location.find.players.within[10]>
        - narrate "NW miss2" targets:<player.location.find.players.within[10]>
        - narrate "NW miss3" targets:<player.location.find.players.within[10]>
        - narrate "NW miss4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_1:
    type: task
    Script:
      - flag p@<player.flag[target]> Attack:<player.name>
      - flag p@<player.flag[target]> Fight_attack:1
      - random {
        - narrate "NW 1" targets:<player.location.find.players.within[10]>
        - narrate "NW 1" targets:<player.location.find.players.within[10]>
        - narrate "NW 1" targets:<player.location.find.players.within[10]>
        - narrate "NW 1" targets:<player.location.find.players.within[10]>
        - narrate "NW 1" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_2:
    type: task
    Script:
      - flag p@<player.flag[target]> Attack:<player.name>
      - flag p@<player.flag[target]> Fight_attack:2
      - random {
        - narrate "NW 2" targets:<player.location.find.players.within[10]>
        - narrate "NW 2" targets:<player.location.find.players.within[10]>
        - narrate "NW 2" targets:<player.location.find.players.within[10]>
        - narrate "NW 2" targets:<player.location.find.players.within[10]>
        - narrate "NW 2" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_3:
    type: task
    Script:
      - flag p@<player.flag[target]> Attack:<player.name>
      - flag p@<player.flag[target]> Fight_attack:3
      - random {
        - narrate "NW 3" targets:<player.location.find.players.within[10]>
        - narrate "NW 3" targets:<player.location.find.players.within[10]>
        - narrate "NW 3" targets:<player.location.find.players.within[10]>
        - narrate "NW 3" targets:<player.location.find.players.within[10]>
        - narrate "NW 3" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_4:
    type: task
    Script:
      - flag p@<player.flag[target]> Attack:<player.name>
      - flag p@<player.flag[target]> Fight_attack:4
      - random {
        - narrate "NW 4" targets:<player.location.find.players.within[10]>
        - narrate "NW 4" targets:<player.location.find.players.within[10]>
        - narrate "NW 4" targets:<player.location.find.players.within[10]>
        - narrate "NW 4" targets:<player.location.find.players.within[10]>
        - narrate "NW 4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_5:
    type: task
    Script:
      - flag p@<player.flag[target]> Attack:<player.name>
      - flag p@<player.flag[target]> Fight_attack:5
      - random {
        - narrate "NW 5" targets:<player.location.find.players.within[10]>
        - narrate "NW 5" targets:<player.location.find.players.within[10]>
        - narrate "NW 5" targets:<player.location.find.players.within[10]>
        - narrate "NW 5" targets:<player.location.find.players.within[10]>
        - narrate "NW 5" targets:<player.location.find.players.within[10]>
        }

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

Fight_Attack_Wood_Sword_0:
    type: task
    Script:
      - random {
        - narrate "Wood_Sword miss0" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword miss1" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword miss2" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword miss3" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword miss4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Wood_Sword_1:
    type: task
    Script:
      - random {
        - narrate "Wood_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 1" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Wood_Sword_2:
    type: task
    Script:
      - random {
        - narrate "Wood_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 2" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Wood_Sword_3:
    type: task
    Script:
      - random {
        - narrate "Wood_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 3" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Wood_Sword_4:
    type: task
    Script:
      - random {
        - narrate "Wood_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Wood_Sword_5:
    type: task
    Script:
      - random {
        - narrate "Wood_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Wood_Sword 5" targets:<player.location.find.players.within[10]>
        }

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

Fight_Attack_Stone_Sword_0:
    type: task
    Script:
      - random {
        - narrate "Stone_Sword miss0" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword miss1" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword miss2" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword miss3" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword miss4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Stone_Sword_1:
    type: task
    Script:
      - random {
        - narrate "Stone_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 1" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Stone_Sword_2:
    type: task
    Script:
      - random {
        - narrate "Stone_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 2" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Stone_Sword_3:
    type: task
    Script:
      - random {
        - narrate "Stone_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 3" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Stone_Sword_4:
    type: task
    Script:
      - random {
        - narrate "Stone_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Stone_Sword_5:
    type: task
    Script:
      - random {
        - narrate "Stone_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Stone_Sword 5" targets:<player.location.find.players.within[10]>
        }
# +----------------------------------
# |   Attack Messages (Iron_Sword)
# +----------------------------------

Fight_Attack_Iron_Sword_0:
    type: task
    Script:
      - random {
        - narrate "Iron_Sword miss0" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword miss1" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword miss2" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword miss3" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword miss4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Iron_Sword_1:
    type: task
    Script:
      - random {
        - narrate "Iron_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 1" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Iron_Sword_2:
    type: task
    Script:
      - random {
        - narrate "Iron_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 2" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Iron_Sword_3:
    type: task
    Script:
      - random {
        - narrate "Iron_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 3" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Iron_Sword_4:
    type: task
    Script:
      - random {
        - narrate "Iron_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Iron_Sword_5:
    type: task
    Script:
      - random {
        - narrate "Iron_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Iron_Sword 5" targets:<player.location.find.players.within[10]>
        }

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

Fight_Attack_Gold_Sword_0:
    type: task
    Script:
      - random {
        - narrate "Gold_Sword miss0" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword miss1" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword miss2" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword miss3" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword miss4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Gold_Sword_1:
    type: task
    Script:
      - random {
        - narrate "Gold_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 1" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Gold_Sword_2:
    type: task
    Script:
      - random {
        - narrate "Gold_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 2" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Gold_Sword_3:
    type: task
    Script:
      - random {
        - narrate "Gold_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 3" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Gold_Sword_4:
    type: task
    Script:
      - random {
        - narrate "Gold_Sword Gold_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Gold_Sword_5:
    type: task
    Script:
      - random {
        - narrate "Gold_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Gold_Sword 5" targets:<player.location.find.players.within[10]>
        }

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

Fight_Attack_Diamond_Sword_0:
    type: task
    Script:
      - random {
        - narrate "Diamond_Sword miss0" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword miss1" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword miss2" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword miss3" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword miss4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Diamond_Sword_1:
    type: task
    Script:
      - random {
        - narrate "Diamond_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 1" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 1" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Diamond_Sword_2:
    type: task
    Script:
      - random {
        - narrate "Diamond_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 2" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 2" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Diamond_Sword_3:
    type: task
    Script:
      - random {
        - narrate "Diamond_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 3" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 3" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Diamond_Sword_4:
    type: task
    Script:
      - random {
        - narrate "Diamond_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 4" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 4" targets:<player.location.find.players.within[10]>
        }
Fight_Attack_Diamond_Sword_5:
    type: task
    Script:
      - random {
        - narrate "Diamond_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 5" targets:<player.location.find.players.within[10]>
        - narrate "Diamond_Sword 5" targets:<player.location.find.players.within[10]>
        }
























































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

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

Fight_First_Turn_Defender:
    type: task
    Script:
      - flag p@<context.parsed_args.get[1].as_player> Fight_Turn
      - random {
        - narrate "<gold><player.name> <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_Turn_Chooser:
    type: task
    Script:
# Defining %Fight% and %Fight_Turn_Counter% for use inside tags
      - define Fight <player.flag[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
# [Temporary] Confirmation that it worked.
        - narrate "<dark_red>Resetting Fight_Turn_Counter_%Fight% to 1"
# Flagging the first player with their turn
        - flag p@<global.flag[Fighters_%Fight%].get[1].as_list.formatted> Fight_Turn
# [Temporary] Confirmation that it worked.
        - narrate "<dark_red>Giving the turn to first player<&co> <global.flag[Fighters_%Fight%].get[1].as_list.formatted>"

# 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 p@<global.flag[Fighters_%Fight%].get[%Fight_Turn_Counter%].as_list.formatted> Fight_Turn
# [Temporary] Confirmation that it worked.
        - narrate "<dark_red>Giving the turn to<&co> <global.flag[Fighters_%Fight%].get[%Fight_Turn_Counter%].as_list.formatted>"
        }