forked from MoogleX/MV_Plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMoogle_X_EquipSkillSystem.js
2706 lines (2431 loc) · 92.8 KB
/
Moogle_X_EquipSkillSystem.js
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
//=============================================================================
// Equip Skill System by Moogle_X
// Moogle_X_EquipSkillSystem.js
// Created on: November 18th 2015
//=============================================================================
var Imported = Imported || {};
Imported.Moogle_X_EQS = true;
var Moogle_X = Moogle_X || {};
Moogle_X.EQS = Moogle_X.EQS || {};
//=============================================================================
/*:
* @plugindesc v1.46 Adds equip skill system mechanic to actors.
* @author Moogle_X
*
* @param Default Max Limit
* @desc This is the default max skill equip limit for all actors.
* @default 10
*
* @param Default Equip Cost
* @desc This is the default skill equip cost for all skills.
* @default 1
*
* @param Party Based Skill Pool
* @desc Skill pool will show all party's skills instead of user's skills only. 1:Yes 0:No
* @default 0
*
* @param ---EQS Class Restriction---
* @default
*
* @param Apply EQS Class Restriction
* @desc Apply additional skill equip restriction based on class/subclass? 1:Yes 0:No
* @default 0
*
* @param Legal Skill List
* @desc This is the list of skill id(s) that always be "legal" for all classes. Example: 16 20 48 59
* @default 0
*
* @param ---Scene---
* @default
*
* @param Show in Skill Menu
* @desc Put "Equip Skill" command in skill menu. 1:Yes 0:No
* @default 1
*
* @param Skill Menu Switch ID
* @desc Turning on the in-game switch with this ID will put "Equip" command in skill menu. Put 0 to ignore this feature.
* @default 0
*
* @param Equip Skill Command Name
* @desc This is the "Equip" skill command name in Scene Skill.
* @default Equip
*
* @param Show in Main Menu
* @desc Put "Equip Skill" scene command in main menu. 1:Yes 0:No
* @default 0
*
* @param Main Menu Switch ID
* @desc Turning on the in-game switch with this ID will put scene command in main menu. Put 0 to ignore this feature.
* @default 0
*
* @param Menu Vocab
* @desc Change the "Equip Skill" command name in main menu.
* @default Equip Skill
*
* @param Empty Slot Text
* @desc This is the text shown when the skill slot is empty.
* @default <Empty>
*
* @param Empty Icon Index
* @desc This is the index of icon shown when the skill slot is empty.
* @default 16
*
* @param Remove Slot Text
* @desc This is the text shown for "remove" skill command.
* @default Remove
*
* @param Remove Icon Index
* @desc This is the index of icon shown for "remove" skill command.
* @default 16
*
* @param ---Equip Limit---
* @default
*
* @param Equip Limit Text
* @desc This is the text shown for "Equip Limit:" above all skill slots.
* @default Equip Limit:
*
* @param Equip Limit Text Color
* @desc This is the text color for "Equip Limit:" above all skill slots.
* @default 16
*
* @param Equip Limit Number Color
* @desc This is the number color for actor's equip limit above all skill slots.
* @default 0
*
* @param ---Skill Pool---
* @default
*
* @param Skill Pool Text
* @desc This is the text shown for "Skill Pool" above all skill list.
* @default Skill Pool
*
* @param Skill Pool Text Color
* @desc This is the text color for "Skill Pool" above all skill list.
* @default 16
*
* @param ---Equip Cost---
* @default
*
* @param Equip Cost Text
* @desc This is the text shown for "Equip Cost" above all skill list.
* @default Equip Cost
*
* @param Equip Cost Text Color
* @desc This is the text color for "Equip Cost" above all skill list.
* @default 17
*
* @param Equip Cost Number Color
* @desc This is the number color for skill equip cost.
* @default 17
*
* @param ---Equip Sound---
* @default
*
* @param Equip SE Name
* @desc This is the sound's file name when equipping skill.
* @default Equip1
*
* @param Equip SE Volume
* @desc This will be the volume of the SE played.
* @default 90
*
* @param Equip SE Pitch
* @desc This will be the pitch of the SE played.
* @default 100
*
* @param Equip SE Pan
* @desc This will be the pan of the SE played.
* @default 0
*
* @param ---Slot Types---
* @default
*
* @param Slot Type Name Rectangle Width
* @desc This is the rectangle width for slot type name.
* @default 120
*
* @param ---Slot Type 1---
* @default
*
* @param Slot Type 1 Name
* @desc This is the name for Slot Type 1.
* @default Type 1
*
* @param Slot Type 1 Color
* @desc This is the color for Slot Type 1 name.
* @default 16
*
* @param ---Slot Type 2---
* @default
*
* @param Slot Type 2 Name
* @desc This is the name for Slot Type 2.
* @default Type 2
*
* @param Slot Type 2 Color
* @desc This is the color for Slot Type 2 name.
* @default 16
*
* @param ---Slot Type 3---
* @default
*
* @param Slot Type 3 Name
* @desc This is the name for Slot Type 3.
* @default Type 3
*
* @param Slot Type 3 Color
* @desc This is the color for Slot Type 3 name.
* @default 16
*
* @param ---Slot Type 4---
* @default
*
* @param Slot Type 4 Name
* @desc This is the name for Slot Type 4.
* @default Type 4
*
* @param Slot Type 4 Color
* @desc This is the color for Slot Type 4 name.
* @default 16
*
* @param ---Slot Type 5---
* @default
*
* @param Slot Type 5 Name
* @desc This is the name for Slot Type 5.
* @default Type 5
*
* @param Slot Type 5 Color
* @desc This is the color for Slot Type 5 name.
* @default 16
*
* @param ---Slot Type 6---
* @default
*
* @param Slot Type 6 Name
* @desc This is the name for Slot Type 6.
* @default Type 6
*
* @param Slot Type 6 Color
* @desc This is the color for Slot Type 6 name.
* @default 16
*
* @param ---Slot Type 7---
* @default
*
* @param Slot Type 7 Name
* @desc This is the name for Slot Type 7.
* @default Type 7
*
* @param Slot Type 7 Color
* @desc This is the color for Slot Type 7 name.
* @default 16
*
* @param ---Slot Type 8---
* @default
*
* @param Slot Type 8 Name
* @desc This is the name for Slot Type 8.
* @default Type 8
*
* @param Slot Type 8 Color
* @desc This is the color for Slot Type 8 name.
* @default 16
*
* @param ---Slot Type 9---
* @default
*
* @param Slot Type 9 Name
* @desc This is the name for Slot Type 9.
* @default Type 9
*
* @param Slot Type 9 Color
* @desc This is the color for Slot Type 9 name.
* @default 16
*
* @param ---Slot Type 10---
* @default
*
* @param Slot Type 10 Name
* @desc This is the name for Slot Type 10.
* @default Type 10
*
* @param Slot Type 10 Color
* @desc This is the color for Slot Type 10 name.
* @default 16
*
* @param ---Slot Type 11---
* @default
*
* @param Slot Type 11 Name
* @desc This is the name for Slot Type 11.
* @default Type 11
*
* @param Slot Type 11 Color
* @desc This is the color for Slot Type 11 name.
* @default 16
*
* @param ---Slot Type 12---
* @default
*
* @param Slot Type 12 Name
* @desc This is the name for Slot Type 12.
* @default Type 12
*
* @param Slot Type 12 Color
* @desc This is the color for Slot Type 12 name.
* @default 16
*
* @param ---Slot Type 13---
* @default
*
* @param Slot Type 13 Name
* @desc This is the name for Slot Type 13.
* @default Type 13
*
* @param Slot Type 13 Color
* @desc This is the color for Slot Type 13 name.
* @default 16
*
* @param ---Slot Type 14---
* @default
*
* @param Slot Type 14 Name
* @desc This is the name for Slot Type 14.
* @default Type 14
*
* @param Slot Type 14 Color
* @desc This is the color for Slot Type 14 name.
* @default 16
*
* @param ---Slot Type 15---
* @default
*
* @param Slot Type 15 Name
* @desc This is the name for Slot Type 15.
* @default Type 15
*
* @param Slot Type 15 Color
* @desc This is the color for Slot Type 15 name.
* @default 16
*
* @param ---Slot Type 16---
* @default
*
* @param Slot Type 16 Name
* @desc This is the name for Slot Type 16.
* @default Type 16
*
* @param Slot Type 16 Color
* @desc This is the color for Slot Type 16 name.
* @default 16
*
* @param ---Slot Type 17---
* @default
*
* @param Slot Type 17 Name
* @desc This is the name for Slot Type 17.
* @default Type 17
*
* @param Slot Type 17 Color
* @desc This is the color for Slot Type 17 name.
* @default 16
*
* @param ---Slot Type 18---
* @default
*
* @param Slot Type 18 Name
* @desc This is the name for Slot Type 18.
* @default Type 18
*
* @param Slot Type 18 Color
* @desc This is the color for Slot Type 18 name.
* @default 16
*
* @param ---Slot Type 19---
* @default
*
* @param Slot Type 19 Name
* @desc This is the name for Slot Type 19.
* @default Type 19
*
* @param Slot Type 19 Color
* @desc This is the color for Slot Type 19 name.
* @default 16
*
* @param ---Slot Type 20---
* @default
*
* @param Slot Type 20 Name
* @desc This is the name for Slot Type 20.
* @default Type 20
*
* @param Slot Type 20 Color
* @desc This is the color for Slot Type 20 name.
* @default 16
*
* @param ---Slot Type 21---
* @default
*
* @param Slot Type 21 Name
* @desc This is the name for Slot Type 21.
* @default Type 21
*
* @param Slot Type 21 Color
* @desc This is the color for Slot Type 21 name.
* @default 16
*
* @param ---Slot Type 22---
* @default
*
* @param Slot Type 22 Name
* @desc This is the name for Slot Type 22.
* @default Type 22
*
* @param Slot Type 22 Color
* @desc This is the color for Slot Type 22 name.
* @default 16
*
* @param ---Slot Type 23---
* @default
*
* @param Slot Type 23 Name
* @desc This is the name for Slot Type 23.
* @default Type 23
*
* @param Slot Type 23 Color
* @desc This is the color for Slot Type 23 name.
* @default 16
*
* @param ---Slot Type 24---
* @default
*
* @param Slot Type 24 Name
* @desc This is the name for Slot Type 24.
* @default Type 24
*
* @param Slot Type 24 Color
* @desc This is the color for Slot Type 24 name.
* @default 16
*
* @param ---Slot Type 25---
* @default
*
* @param Slot Type 25 Name
* @desc This is the name for Slot Type 25.
* @default Type 25
*
* @param Slot Type 25 Color
* @desc This is the color for Slot Type 25 name.
* @default 16
*
* @param ---Slot Type 26---
* @default
*
* @param Slot Type 26 Name
* @desc This is the name for Slot Type 26.
* @default Type 26
*
* @param Slot Type 26 Color
* @desc This is the color for Slot Type 26 name.
* @default 16
*
* @param ---Slot Type 27---
* @default
*
* @param Slot Type 27 Name
* @desc This is the name for Slot Type 27.
* @default Type 27
*
* @param Slot Type 27 Color
* @desc This is the color for Slot Type 27 name.
* @default 16
*
* @param ---Slot Type 28---
* @default
*
* @param Slot Type 28 Name
* @desc This is the name for Slot Type 28.
* @default Type 28
*
* @param Slot Type 28 Color
* @desc This is the color for Slot Type 28 name.
* @default 16
*
* @param ---Slot Type 29---
* @default
*
* @param Slot Type 29 Name
* @desc This is the name for Slot Type 29.
* @default Type 29
*
* @param Slot Type 29 Color
* @desc This is the color for Slot Type 29 name.
* @default 16
*
* @param ---Slot Type 30---
* @default
*
* @param Slot Type 30 Name
* @desc This is the name for Slot Type 30.
* @default Type 30
*
* @param Slot Type 30 Color
* @desc This is the color for Slot Type 30 name.
* @default 16
*
* @help
* ============================================================================
* Introduction
* ============================================================================
* This plugin adds equip skill mechanic to all actors. Each time an actor
* learn a new skill, that skill will be added to his/her "Skill Pool".
* That actor can access all the skills in their Skill Pool and equip some of
* those skills into their "Skill Slots".
*
* All actors can only use the skills equipped in their own Skill Slots.
* Also, only those equipped skills will show up in their batlle skill window.
*
* ============================================================================
* Slot Types
* ============================================================================
* Each skill has their own Slot Type that decide the skill placement in the
* Equip Skill menu. Skill can only be equipped in the actor's Skill Slot with
* same Slot Type as the skill's Slot Type.
*
* There are 31 different Slot Types available in this plugin.
* It starts from Slot Type 0 to Slot Type 30.
* Each Slot Type has its own different name and color that you can customize
* in the plugin configuration.
*
* You must assign every skill in your database into a Slot Type.
* Simply insert this notetag into the skill's notebox.
*
* <EQS Type: x> // This skill's Slot Type will be x.
*
* Example:
* <EQS Type: 2> // This skill's Slot Type is Slot Type 2.
* <EQS Type: 30> // This skill's Slot Type is Slot Type 30.
*
* IMPORTANT!
* Slot Type 0 is a very special type!
* This is pretty much the default Slot Type for the skill if you do not use
* the above notetag. Also this Slot Type doesn't have a name.
* Any skill with Slot Type 0 will be shown differently in the scene compare to
* Slot Type 1 to 30. The skill will not show its Slot Type name (because it
* doesn't have any). The skill's name will be adjusted to the very left.
*
* ============================================================================
* Maximum Skill Slots and Maximum Equip Limit
* ============================================================================
* All actors now possess 2 new parameters, Maximum Skill Slots and Maximum
* Equip Limit.
*
* Maximum Skill Slots is the maximum amount of Skills that can be equipped by
* the actor. Each actor can have different Maximum Skill Slots for each Slot
* Types. Maximum Skill Slots is also level dependent. You can set up Maximum
* Skill Slots to increase alongside actor's level.
*
* To set up actor's Maximum Skill Slots, insert these notetags into actor's
* respective notebox:
*
* <EQS Max Slots x Level y: n> // Maximum Skill Slots for Slot Type x
* // during level y is n.
* <EQS Max Slots x Level y to z: n> // Maximum Skill Slots for Slot Type x
* // during level y to z is n.
*
* Example:
* <EQS Max Slots 12 Level 1: 4> // Maximum Skill Slots for Slot Type 12
* // during level 1 is 4.
* <EQS Max Slots 12 Level 2 to 99: 6> // Maximum Skill Slots for Slot Type 12
* // during level 2 until level 99 is 6.
*
* If you don't use any of those notetags, the actor won't have any Skill Slots
* available. Therefore, the actor cannot equip any skill.
*
* The next parameter is Maximum Equip Limit. Every skill has a special equip
* cost. In order to equip a skill, the actor's Maximum Equip Limit must be
* equal or greater than the skill's Equip Cost.
*
* The higher actor's Maximum Equip Limit means the actor is able to equip skill
* with higher Equip Cost.
*
* Similar to Maximum Skill Slots, Maximum Equip Limit is also level dependent.
* You can set up actor's Maximum Equip Limit to increase alongside actor's
* level.
*
* To set up actor's Maximum Equip Limit, insert these notetags into actor's
* respective notebox:
*
* <EQS Max Limit x: n> // Maximum Equip Limit at level x is n.
* <EQS Max Limit x to y: n> // Maximum Equip Limit at level x to
* // level y is n.
*
* Example:
* <EQS Max Limit 1: 10> // Maximum Equip Limit at level 1 is 10.
* <EQS Max Limit 2 to 5: 20> // Maximum Equip limit at level 2 to
* // level 5 is 20.
*
* If you don't use the above notetags (or there is incomplete data for certain
* levels), actor's Maximum Equip Limit will use the default value in the
* "Default Max Limit" plugin configuration.
*
* There are 2 other ways to increase the number of Skill Slots and Equip Limit.
* The first one is by equipping "Slot Plus" and/or "Limit Plus" traits to the
* actor. "Slot Plus" will increase Maximum Skill Slots while "Limit Plus" will
* increase Maximum Equip Limit.
*
* You can add these 2 new traits to Actors, Classes, Weapons, Armors, and
* States by using notetags:
*
* <EQS Slot Plus x: y> // Increase Maximum Skill Slots for Slot Type x
* // by y amount.
* <EQS Limit Plus: x> // Increase Maximum Equip Limit by x amount.
*
* Example:
* <EQS Slot Plus 3: 1> // Increase Maximum Skill Slots for Slot Type 3
* // by 1.
* <EQS Limit Plus: 5> // Increase Maximum Equip Limit by 5.
*
* For example, if you put <EQS Slot Plus 4: 2> to "Short Sword". Any actor that
* equips the "Short Sword" will receive 2 extra Skill Slots for Slot Type 4.
* If that actor unequips the sword, he/she will lose the 2 extra Skill Slots
* again.
*
* The other way to increase Maximum Skill Slots and Maximum Equip Limit is by
* using "Slot Grow" and/or "Limit Grow" effects. Both effects will increase
* Maximum Skill Slots and Maximum Equip Limit parameters permanently.
*
* Both effects can be assigned to Items and Skills by using notetags:
*
* <EQS Slot Grow x: y> // Permanently increase Maximum Skill Slots for
* // Slot Type x of Item/Skill's target by y.
* <EQS Limit Grow: x> // Permanently increase Maximum Equip Limit
* // of Item/Skill's target by x.
*
* Example:
* <EQS Slot Grow 0: 1> // The target of this Item/Skill will get 1 extra
* // slot for Slot Type 0. This effect is permanent.
* <EQS Limit Grow: 10> // The target of this Item/Skill will get 10 extra
* // Maximum Equip Limit permanently.
*
* You can use this notetag on some rare "one and only" item in the game to
* increase an actor's Maximum Skill Slots and/or Equip Limit.
*
* IMPORTANT!
* Each skill/item can only have 1 slot grow effect!
* Currently, you cannot make a skill/item have 2 or more <EQS Slot Grow x: y>
* notetags.
*
* Both above grow effects can be applied by using plugin command too!
*
* EQS Actor x Type y Grow n // Permanently increase Actor x's Maximum
* // Skill Slots for Slot Type y by n.
* EQS Actor x Limit Grow n // Permanently Increase Actor x's Maximum
* // Equip Limit by n.
* Example:
* EQS Actor 5 Type 3 Grow 2 // Actor 5 will get 2 extra slots for Slot
* // Type 3. This effect is permanent.
* EQS Actor 4 Limit Grow 5 // Actor 4 will get 5 extra Maximum Equip
* // Limit permanently.
*
* Use above plugin commands wisely.
*
* ============================================================================
* How to Equip Skills
* ============================================================================
* There are two methods to equip skills. The first one is equipping the skill
* directly in the Skill menu scene. There are multiple requirements to equip
* skill:
*
* 1. Actor must first learn the skill (NOT "add" the skill directly using
* trait!). All learned skills will be put inside Actor's Skill Pool for equip
* access.
*
* NOTE: Skills added by trait can be used directly without the need to
* equip them first.
*
* 2. Actor must have at least 1 free Skill Slot available. Each individual
* skill takes 1 Skill Slot from the actor's Maximum Skill Slots. An actor
* with 5 Maximum Skill Slots can equip up to 5 different skills.
*
* 3. Actor must be able to "pay" the skill's Equip Cost. It means that actor's
* remaining Equip Limit must be equal or greater than the skill's Equip Cost.
* Each skill has their own different Equip Cost that you can customize to your
* liking.
*
* 4. No duplicate skills are allowed! An actor cannot equip 2 of the same
* skills at the same time.
*
* The second method to equip skills is by using a plugin command:
*
* EQS Actor x Type y Slot z Skill n // Equip skill with id n to Actor x's
* // Slot number z of Slot Type y.
*
* Example:
* EQS Actor 6 Type 14 Slot 2 Skill 23 // Actor 6 will equip Skill 23 to his/her
* // Skill Slot of Slot Type 14 (at second
* // position).
*
* Keep in mind that any skill that you try to equip with this plugin command
* must follow ALL of the 4 rules above. Otherwise, nothing happens.
*
* ============================================================================
* Equip Cost
* ============================================================================
* Each skill can have different (or same) Equip Cost. You can assigned the
* skill's Equip Cost by adding this notetag into the skill's notebox:
*
* <EQS Cost: x> // Skill Equip Cost will be x.
*
* Example:
* <EQS Cost: 70> // This skill's Equip Cost is 70.
*
* If you don't add this notetag, the Equip Cost will use the default value in
* "Default Equip Cost" plugin configuration.
*
* ============================================================================
* Equip Skill Exception
* ============================================================================
* What if you want a certain skill to be able to be used freely without the
* need to equip it first? Yes, you can.
*
* You can make certain skill to be "immune" to the "must be equip first" rule
* of this plugin by inserting this notetag into the skill's notebox:
*
* <EQS Ignore> // This skill doesn't need to be equip.
*
* That skill can be used immediately after it is learned without the need to
* equip it. Also, you will not see that skill show up in the Skill Pool window.
*
* ============================================================================
* Hiding Equip Skill Menu
* ============================================================================
* If for some reason you want the Equip Skill menu to be hidden for certain
* actor or class, simply put this notetag into Actors or Classes notebox:
*
* <EQS Hide> // The Equip Skill Menu will be hidden for this actor/class.
*
* IMPORTANT!
* Hiding is NOT the same as disabling/removing/erasing!
* That actor/class is still "affected" by this plugin's "Equip Skill Rule".
* So, it's best to combine this notetag with <EQS Ignore> notetag for their
* skills.
*
* ============================================================================
* Unequipping Skill(s) Using Plugin Commands
* ============================================================================
* You can use plugin command to unequip some skills from certain actor.
* If you want to simply unequip every skills in actor's skill slots, simply
* use this plugin command:
*
* EQS Actor x Unequip All // Unequip all skills in actor x's
* // Skill Slots.
* Example:
* EQS Actor 6 Unequip All // Remove all skills in Actor 6's Skill
* // Slots.
*
* On the other hand, if you want to unequip skill from specific slot, you need
* to use this plugin command instead:
*
* EQS Actor x Type y Slot z Unequip // Unequip skill from Actor x's Slot
* // number z of Slot Type y.
*
* Example:
* EQS Actor 6 Type 14 Slot 2 Unequip // Actor 6 will unequip any skill in
* // his/her second (2nd) Skill Slot of
* // Slot Type 14.
*
* ============================================================================
* NEW Feature! "EQS Block"
* ============================================================================
* Let's say you want prevent the actor to equip skill A whenever they have
* skill B already equipped inside their Skill Slots.
*
* For example skill "Fire" (ID: 10) and skill "Blizzard" (ID: 20).
* Let's say you don't want the actor to be able to equip both of these at the
* same time.
*
* All you need to do is simply insert this notetag inside both "Fire" and
* "Blizzard" noteboxes:
*
* <EQS Block: x> // Actors cannot equip skill x whenever they
* // have this skill already equipped.
*
* In this case, you put <EQS Block: 20> inside "Fire" notebox. And then, you
* put <EQS Block: 10> inside "Blizzard" notebox.
*
* If you want to block multiple skills at the same time, simply use this
* notetag instead:
*
* <EQS Block: x, y, z> // Actors cannot equip skills x, y, z whenever
* // they have this skill already equipped.
*
* Example:
* <EQS Block: 5, 7, 8, 36, 90> // Actors cannot equip skills 5, 7, 8, 36, 90
* // whenever they have this skill already
* // equipped in one of their Skill Slots.
*
* ============================================================================
* NEW Feature! "EQS Class Restriction"
* ============================================================================
* Do you want to limit which skills can be equipped based on class/subclasses?
* With "EQS Class Restriction" feature, you can add extra layer of restriction
* on actor's skill equip.
*
* First, you need to turn on the plugin parameter "Apply EQS Class Restriction"
* before anything else. "EQS Class Restriction" cannot co-exist with parameter
* "Party Based Skill Pool"! If you turn on "Party Based Skill Pool" parameter,
* you cannot use "EQS Class Restriction" feature at all.
*
* Next, you need to define the list of Legal Skills for each available class.
* Legal Skills are the only skills that can be equipped at any given time
* when particular class is active.
*
* If you use YEP_X_Subclass plugin, Legal Skills from actor's main class will
* be "combined" with the actor's subclass.
*
* Only Legal Skills will show up on the Skill Pool Window. Any "illegal" skills
* will simply be hidden.
*
* Whenever the actor changes their main class or subclass, the actor will
* automatically unequip any "illegal" skills from their Skill Slots.
*
* To define class/subclass' Legal Skills, insert this notetag into the classes'
* notebox:
*
* <EQS Skills: x, y, z> // This class's Legal Skills are x, y, z.
*
* Example:
* <EQS Skills: 8, 35, 52, 80, 99> // The Legal Skills for this class/subclass
* // are skills 8, 35, 52, 80, 99.
*
* What if you want some skills to be always "legal" for all classes/subclasses?
* Just insert the skill id(s) into "Legal Skill List" parameter in the plugin
* configuration. Any skills inside that parameter will not be affected by
* "EQS Class Restriction".
*
* ============================================================================
* Notetags and Plugin Commands List
* ============================================================================
* Actors Notetags:
* <EQS Max Slots x Level y: n>
* <EQS Max Slots x Level y to z: n>
* <EQS Max Limit x: n>
* <EQS Max Limit x to y: n>
*
* Actors, Classes, Weapons, Armors, and States Notetags:
* <EQS Slot Plus x: y>
* <EQS Limit Plus: x>
*
* Skills Notetags:
* <EQS Cost: x>
* <EQS Type: x>
* <EQS Ignore>
* <EQS Block: x>
* <EQS Block: x, y, z>
*
* Items and Skills Notetags:
* <EQS Slot Grow x: y>
* <EQS Limit Grow: x>
*
* Actors and Classes Notetag:
* <EQS Hide>
*
* Classes Notetag:
* <EQS Skills: x, y, z>
*
* Plugin Commands:
* EQS Actor x Type y Slot z Skill n
* EQS Actor x Type y Slot z Unequip
* EQS Actor x Unequip All
* EQS Actor x Type y Grow n
* EQS Actor x Limit Grow n
* EQS Open // Open "Equip Skill" scene (Main Menu version).
*
* SPECIAL Plugin Command!
*
* EQS Switch x Actor y Skill z
* "The engine will check Actor y's Skill Slots for any skill z. If skill z is
* equipped, in-game switch with ID x will be ON, otherwise the switch will be
* OFF instead. This is useful if you want to check whether actor has certain
* skill equipped or not."
*
* ============================================================================
* Compatibility
* ============================================================================
* If you use Moogle_X_EquipSkillSystem_JpAddOn plugin, position this plugin
* above it.
* If you use Moogle_X_PassiveSkill plugin, position this plugin above it.
* If you use YEP_AutoPassiveStates, position this plugin below it.
* If you use Moogle_X_EquipmentLearning, position this plugin above it.
* If you use YEP_ClassChangeCore or YEP_X_Subclass, position this plugin below
* those plugins.
*
* ============================================================================
* Terms of Use
* ============================================================================
* Free to use in both commercial and non-commercial project as long as credit
* is given.
*
* ============================================================================
* Change Log
* ============================================================================
* Version 1.46:
* - Added waynee95's bug fix for crashing during skill equip.
*
* Version 1.45:
* - Added optional "EQS Class Restriction" feature.
*
* Version 1.44:
* - Added "Party Based Skill Pool" parameter.
*
* Version 1.43:
* - Added "blocked skills" feature.
* - Added new plugin commands for unequipping skill(s).
*
* Version 1.42:
* - Added compatibility with Moogle_X_EquipmentLearning.
* - Fixed <EQS Ignore> bug regarding YEP_AutoPassiveStates compatibility.
* - Fixed bug regarding skill type window not refreshing after equipping skill.
* - Added standalone EQS scene just for equipping skill.
* - Added option to change equip skill sound effect.
*
* Version 1.41:
* - Added compatibility with YEP_AutoPassiveStates v1.05a.
*
* Version 1.4:
* - Added equip slot types functionality.
* - Added option to hide Equip Skill menu for certain actor/class.
*
* Version 1.0:
* - Completed plugin.
*
*/
//=============================================================================
(function() { // IIFE
//=============================================================================
// Parameter Variables
//=============================================================================
Moogle_X.EQS.parameters = PluginManager.parameters('Moogle_X_EquipSkillSystem');
Moogle_X.EQS.defMaxLimit = Number(Moogle_X.EQS.parameters['Default Max Limit'] || 10);
Moogle_X.EQS.defEquipCost = Number(Moogle_X.EQS.parameters['Default Equip Cost'] || 0);
Moogle_X.EQS.eqsVocab = String(Moogle_X.EQS.parameters['Equip Skill Command Name'] || 'Equip');
Moogle_X.EQS.emptyText = String(Moogle_X.EQS.parameters['Empty Slot Text'] || '');
Moogle_X.EQS.emptyIcon = Number(Moogle_X.EQS.parameters['Empty Icon Index'] || 0);
Moogle_X.EQS.removeText = String(Moogle_X.EQS.parameters['Remove Slot Text'] || '');
Moogle_X.EQS.removeIcon = Number(Moogle_X.EQS.parameters['Remove Icon Index'] || 0);
Moogle_X.EQS.limitText = String(Moogle_X.EQS.parameters['Equip Limit Text'] || '');
Moogle_X.EQS.limitColor = Number(Moogle_X.EQS.parameters['Equip Limit Text Color'] || 0);
Moogle_X.EQS.limitNumberColor = Number(Moogle_X.EQS.parameters['Equip Limit Number Color'] || 0);
Moogle_X.EQS.poolText = String(Moogle_X.EQS.parameters['Skill Pool Text'] || '');
Moogle_X.EQS.poolColor = Number(Moogle_X.EQS.parameters['Skill Pool Text Color'] || 0);
Moogle_X.EQS.eqsCostText = String(Moogle_X.EQS.parameters['Equip Cost Text'] || '');
Moogle_X.EQS.eqsCostColor = Number(Moogle_X.EQS.parameters['Equip Cost Text Color'] || 0);
Moogle_X.EQS.eqsCostNumberColor = Number(Moogle_X.EQS.parameters['Equip Cost Number Color'] || 0);
Moogle_X.EQS.slotTypeRectWidth = Number(Moogle_X.EQS.parameters['Slot Type Name Rectangle Width'] || 120);
Moogle_X.EQS.showEqsMenuSkill = Number(Moogle_X.EQS.parameters['Show in Skill Menu']) != 0;
Moogle_X.EQS.eqsMenuSwitchSkill = Number(Moogle_X.EQS.parameters['Skill Menu Switch ID'] || 0);
Moogle_X.EQS.showEqsMenu = Number(Moogle_X.EQS.parameters['Show in Main Menu']) != 0;
Moogle_X.EQS.eqsTitle = String(Moogle_X.EQS.parameters['Menu Vocab'] || '');
Moogle_X.EQS.eqsMenuSwitch = Number(Moogle_X.EQS.parameters['Main Menu Switch ID'] || 0);
Moogle_X.EQS.eqSeName = String(Moogle_X.EQS.parameters['Equip SE Name'] || 'Equip1');
Moogle_X.EQS.eqSeVolume = Number(Moogle_X.EQS.parameters['Equip SE Volume'] || 0);
Moogle_X.EQS.eqSePitch = Number(Moogle_X.EQS.parameters['Equip SE Pitch'] || 0);
Moogle_X.EQS.eqSePan = Number(Moogle_X.EQS.parameters['Equip SE Pan'] || 0);
Moogle_X.EQS.partySkillPool = Number(Moogle_X.EQS.parameters['Party Based Skill Pool']) != 0;
Moogle_X.EQS.classRestrict = Number(Moogle_X.EQS.parameters['Apply EQS Class Restriction']) != 0;
Moogle_X.EQS.legalSkills = String(Moogle_X.EQS.parameters['Legal Skill List'] || 0);
if (Moogle_X.EQS.partySkillPool) {
// "Party Based Skill Pool" cannot co-exist with "EQS Class Restriction".
Moogle_X.EQS.classRestrict = false;
}
var legalSkillIds = Moogle_X.EQS.legalSkills.split(' ');
Moogle_X.EQS.legalSkills = [];
for (var i = 0; i < legalSkillIds.length; i++) {
Moogle_X.EQS.legalSkills.push(Number(legalSkillIds[i]));
}
// Slot Types variables.
Moogle_X.EQS.slotTypes = [];
Moogle_X.EQS.slotTypes.push(null); // Slot Type 0
// Slot Type 1
var paramType1Name = String(Moogle_X.EQS.parameters['Slot Type 1 Name'] || '');
var paramType1Color = Number(Moogle_X.EQS.parameters['Slot Type 1 Color'] || 0);
var paramType1 = {"name":paramType1Name,"color":paramType1Color};
Moogle_X.EQS.slotTypes.push(paramType1);
// Slot Type 2
var paramType2Name = String(Moogle_X.EQS.parameters['Slot Type 2 Name'] || '');
var paramType2Color = Number(Moogle_X.EQS.parameters['Slot Type 2 Color'] || 0);
var paramType2 = {"name":paramType2Name,"color":paramType2Color};
Moogle_X.EQS.slotTypes.push(paramType2);
// Slot Type 3
var paramType3Name = String(Moogle_X.EQS.parameters['Slot Type 3 Name'] || '');
var paramType3Color = Number(Moogle_X.EQS.parameters['Slot Type 3 Color'] || 0);
var paramType3 = {"name":paramType3Name,"color":paramType3Color};
Moogle_X.EQS.slotTypes.push(paramType3);
// Slot Type 4
var paramType4Name = String(Moogle_X.EQS.parameters['Slot Type 4 Name'] || '');
var paramType4Color = Number(Moogle_X.EQS.parameters['Slot Type 4 Color'] || 0);
var paramType4 = {"name":paramType4Name,"color":paramType4Color};
Moogle_X.EQS.slotTypes.push(paramType4);
// Slot Type 5
var paramType5Name = String(Moogle_X.EQS.parameters['Slot Type 5 Name'] || '');
var paramType5Color = Number(Moogle_X.EQS.parameters['Slot Type 5 Color'] || 0);
var paramType5 = {"name":paramType5Name,"color":paramType5Color};
Moogle_X.EQS.slotTypes.push(paramType5);
// Slot Type 6
var paramType6Name = String(Moogle_X.EQS.parameters['Slot Type 6 Name'] || '');
var paramType6Color = Number(Moogle_X.EQS.parameters['Slot Type 6 Color'] || 0);
var paramType6 = {"name":paramType6Name,"color":paramType6Color};
Moogle_X.EQS.slotTypes.push(paramType6);
// Slot Type 7
var paramType7Name = String(Moogle_X.EQS.parameters['Slot Type 7 Name'] || '');