RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
ItemDefinition.java
1package com.osroyale.game.world.items;
2
3import com.google.common.collect.LinkedListMultimap;
4import com.google.gson.JsonElement;
5import com.google.gson.JsonObject;
6import com.osroyale.Config;
7import com.osroyale.game.world.entity.combat.attack.FightType;
8import com.osroyale.game.world.entity.combat.ranged.RangedAmmunition;
9import com.osroyale.game.world.entity.combat.ranged.RangedWeaponDefinition;
10import com.osroyale.game.world.entity.combat.ranged.RangedWeaponType;
11import com.osroyale.game.world.entity.combat.weapon.WeaponInterface;
12import com.osroyale.game.world.entity.mob.MobAnimation;
13import com.osroyale.game.world.items.containers.equipment.EquipmentType;
14import com.osroyale.util.parser.GsonParser;
15import com.osroyale.util.parser.JsonSaver;
16import org.jire.tarnishps.defs.ItemDefLoader;
17
18import java.util.*;
19
20import static com.osroyale.game.world.entity.combat.CombatConstants.*;
21
64
65public class ItemDefinition {
66
70 public static ItemDefinition[] DEFINITIONS;
71 private static final Map<FightType, Integer> EMPTY = new HashMap<>();
72 public static final ItemDefinition DEFAULT = new ItemDefinition(1, "null");
73
74 private final int id;
75 private final String name;
76 private String destroyMessage;
77 private boolean destroyable;
78 private boolean stackable;
79 private boolean twoHanded;
80 private boolean tradeable;
81 private int stand_animation;
82 private int attack_anim;
83 private int walk_animation;
84 private int run_animation;
85 private Map<FightType, Integer> attack_animations;
86 private int block_animation;
87 private int unnotedId;
88 private int notedId;
89 private int street_value;
90 private int base_value;
91 private int highAlch;
92 private int lowAlch;
93 private double weight;
94 private EquipmentType equipmentType;
95 private WeaponInterface weaponInterface;
96 private RangedWeaponDefinition rangedDefinition;
97 private int[] requirements;
98 private int[] bonuses;
99
100 public ItemDefinition(int id, String name) {
101 this.id = id;
102 this.name = name;
103 this.destroyMessage = null;
104 this.destroyable = false;
105 this.stackable = false;
106 this.tradeable = true;
107 this.twoHanded = false;
108 this.unnotedId = id;
109 this.notedId = id;
110 this.street_value = 0;
111 this.base_value = 0;
112 this.highAlch = 0;
113 this.lowAlch = 0;
114 this.weight = 0;
115 this.stand_animation = MobAnimation.PLAYER_STAND;
116 this.walk_animation = MobAnimation.PLAYER_WALK;
117 this.run_animation = MobAnimation.PLAYER_RUN;
118 this.attack_animations = EMPTY;
119 this.block_animation = -1;
120 this.equipmentType = EquipmentType.NOT_WIELDABLE;
121 this.weaponInterface = null;
122 this.rangedDefinition = null;
123 this.requirements = EMPTY_REQUIREMENTS;
124 this.bonuses = EMPTY_BONUSES;
125 }
126
127 public static GsonParser createParser() {
128 return new GsonParser("def/item/item_definitions", false) {
129
130 @Override
131 public void initialize(int size) {
133 }
134
135 @Override
136 protected void parse(JsonObject data) {
137 int id = data.get("id").getAsInt();
138 String name = data.get("name").getAsString();
139
140 ItemDefinition definition = new ItemDefinition(id, name);
141
142 if (data.has("destroyable")) {
143 definition.destroyable = data.get("destroyable").getAsBoolean();
144 }
145
146 if (data.has("destroy-message")) {
147 definition.destroyable = true;
148 definition.destroyMessage = data.get("destroy-message").getAsString();
149 }
150
151 if (data.has("stackable")) {
152 definition.stackable = data.get("stackable").getAsBoolean();
153 }
154
155 if (data.has("tradeable")) {
156 definition.tradeable = data.get("tradeable").getAsBoolean();
157 }
158
159 if (data.has("two-handed")) {
160 definition.twoHanded = data.get("two-handed").getAsBoolean();
161 }
162
163 if (data.has("noted-id")) {
164 definition.notedId = data.get("noted-id").getAsInt();
165 }
166
167 if (data.has("unnoted-id")) {
168 definition.unnotedId = data.get("unnoted-id").getAsInt();
169 }
170
171 if (data.has("street-value")) {
172 definition.street_value = data.get("street-value").getAsInt();
173 }
174
175 if (data.has("base-value")) {
176 definition.base_value = data.get("base-value").getAsInt();
177 }
178
179 if (data.has("high-alch")) {
180 definition.highAlch = data.get("high-alch").getAsInt();
181 }
182
183 if (data.has("low-alch")) {
184 definition.lowAlch = data.get("low-alch").getAsInt();
185 }
186
187 if (data.has("weight")) {
188 definition.weight = data.get("weight").getAsDouble();
189 }
190
191 if (data.has("equipment-slot")) {
192 definition.equipmentType = EquipmentType.valueOf(data.get("equipment-slot").getAsString());
193 }
194
195 if (data.has("weapon-interface")) {
196 definition.weaponInterface = WeaponInterface.valueOf(data.get("weapon-interface").getAsString());
197 }
198
199 for (int index = 0; index < SKILL_REQUIREMENT_CONFIG_FIELD_NAMES.length; index++) {
200 String skillRequirement = SKILL_REQUIREMENT_CONFIG_FIELD_NAMES[index];
201 if (data.has(skillRequirement)) {
202 if (definition.requirements == EMPTY_REQUIREMENTS) {
203 definition.requirements = new int[EMPTY_REQUIREMENTS.length];
204 }
205 definition.requirements[index] = data.get(skillRequirement).getAsInt();
206 }
207 }
208
209 for (int index = 0; index < BONUS_CONFIG_FIELD_NAMES.length; index++) {
210 String bonusName = BONUS_CONFIG_FIELD_NAMES[index];
211 if (data.has(bonusName)) {
212 if (definition.bonuses == EMPTY_BONUSES) {
213 definition.bonuses = new int[EMPTY_BONUSES.length];
214 }
215 definition.bonuses[index] = data.get(bonusName).getAsInt();
216 }
217 }
218
219 if (data.has("ranged-type") && data.has("allowed")) {
220 RangedWeaponType type = builder.fromJson(data.get("ranged-type"), RangedWeaponType.class);
221 RangedAmmunition[] allowed = builder.fromJson(data.get("allowed"), RangedAmmunition[].class);
222 definition.rangedDefinition = new RangedWeaponDefinition(type, allowed);
223 }
224
225 if (data.has("stand-animation")) {
226 definition.stand_animation = data.get("stand-animation").getAsInt();
227 }
228
229 if (data.has("walk-animation")) {
230 definition.walk_animation = data.get("walk-animation").getAsInt();
231 }
232
233 if (data.has("run-animation")) {
234 definition.run_animation = data.get("run-animation").getAsInt();
235 }
236
237 if (data.has("attack-animations")) {
238 JsonObject object = (JsonObject) data.get("attack-animations");
239 definition.attack_animations = new HashMap<>(object.entrySet().size());
240
241 for (Map.Entry<String, JsonElement> entry : object.entrySet()) {
242 FightType fightType = FightType.valueOf(entry.getKey());
243 int animation = entry.getValue().getAsInt();
244
245 definition.attack_animations.put(fightType, animation);
246 }
247 }
248
249 if (data.has("block-animation")) {
250 definition.block_animation = data.get("block-animation").getAsInt();
251 }
252
253 DEFINITIONS[id] = definition;
254 }
255
256 @Override
257 protected void onEnd() {
258 ItemDefLoader.load();
259 }
260 };
261 }
262
263 public static ItemDefinition[] create(String path) {
264 ItemDefinition[] definitions = new ItemDefinition[Config.ITEM_DEFINITION_LIMIT];
265
266 new GsonParser(path) {
267
268 @Override
269 public void initialize(int size) {
270 createParser().run();
271 }
272
273 @Override
274 protected void parse(JsonObject data) {
275 int id = data.get("id").getAsInt();
276 String name = data.get("name").getAsString();
277
278 ItemDefinition definition = definitions[id] = new ItemDefinition(id, name);
279 ItemDefinition old = DEFINITIONS[id];
280
281 if (data.has("destroyable")) {
282 definition.destroyable = data.get("destroyable").getAsBoolean();
283 }
284
285 if (data.has("destroy-message")) {
286 definition.destroyable = true;
287 definition.destroyMessage = data.get("destroy-message").getAsString();
288 }
289
290 if (data.has("stackable")) {
291 definition.stackable = data.get("stackable").getAsBoolean();
292 }
293
294 if (data.has("tradeable")) {
295 definition.tradeable = data.get("tradeable").getAsBoolean();
296 }
297
298 if (data.has("two-handed")) {
299 definition.twoHanded = data.get("two-handed").getAsBoolean();
300 }
301
302 if (data.has("noted-id")) {
303 definition.notedId = data.get("noted-id").getAsInt();
304 }
305
306 if (data.has("unnoted-id")) {
307 definition.unnotedId = data.get("unnoted-id").getAsInt();
308 }
309
310 if (data.has("street-value")) {
311 definition.street_value = data.get("street-value").getAsInt();
312 } else if (old != null) {
313 definition.street_value = old.street_value;
314 }
315
316 if (data.has("base-value")) {
317 definition.base_value = data.get("base-value").getAsInt();
318 }
319
320 if (data.has("high-alch")) {
321 definition.highAlch = data.get("high-alch").getAsInt();
322 }
323
324 if (data.has("low-alch")) {
325 definition.lowAlch = data.get("low-alch").getAsInt();
326 }
327
328 if (data.has("weight")) {
329 definition.weight = data.get("weight").getAsDouble();
330 }
331
332 if (old != null && old.equipmentType != EquipmentType.NOT_WIELDABLE) {
333 definition.equipmentType = old.equipmentType;
334 } else if (data.has("equipment-slot")) {
335 definition.equipmentType = EquipmentType.valueOf(data.get("equipment-slot").getAsString());
336 }
337
338 for (int index = 0; index < BONUS_CONFIG_FIELD_NAMES.length; index++) {
339 String bonusName = BONUS_CONFIG_FIELD_NAMES[index];
340 if (data.has(bonusName)) {
341 if (definition.bonuses == EMPTY_BONUSES) {
342 definition.bonuses = new int[EMPTY_BONUSES.length];
343 }
344 definition.bonuses[index] = data.get(bonusName).getAsInt();
345 }
346 }
347
348 if (old != null) {
349 definition.weaponInterface = old.weaponInterface;
350 definition.requirements = old.requirements;
351 definition.rangedDefinition = old.rangedDefinition;
352 definition.stand_animation = old.stand_animation;
353 definition.walk_animation = old.walk_animation;
354 definition.run_animation = old.run_animation;
355 definition.attack_animations = old.attack_animations;
356 definition.block_animation = old.block_animation;
357 }
358 }
359 }.run();
360
361 return definitions;
362 }
363
364 public static ItemDefinition[] fromClientDump(String path) {
365 ItemDefinition[] definitions = new ItemDefinition[Config.ITEM_DEFINITION_LIMIT];
366
367 new GsonParser(path) {
368 @Override
369 protected void parse(JsonObject data) {
370 int id = data.get("id").getAsInt();
371 String name = data.get("name").getAsString();
372
373 ItemDefinition definition = definitions[id] = new ItemDefinition(id, name);
374
375 if (data.has("stackable")) {
376 definition.stackable = data.get("stackable").getAsBoolean();
377 }
378 if (data.has("destroyable")) {
379 definition.destroyable = data.get("destroyable").getAsBoolean();
380 }
381 if (data.has("noted-id")) {
382 definition.notedId = data.get("noted-id").getAsInt();
383 }
384 if (data.has("unnoted-id")) {
385 definition.unnotedId = data.get("unnoted-id").getAsInt();
386 }
387 if (data.has("base-value")) {
388 definition.base_value = data.get("base-value").getAsInt();
389 definition.lowAlch = (int) (definition.base_value * 0.40);
390 definition.highAlch = (int) (definition.base_value * 0.60);
391 }
392 if (data.has("equipment-type")) {
393 definition.equipmentType = EquipmentType.valueOf(data.get("equipment-type").getAsString());
394 }
395 }
396 }.run();
397
398 return definitions;
399 }
400
401 public static void merge(String clientDumpFilePath, String wikiDumpPath, String dumpPath) {
402 new GsonParser(wikiDumpPath) {
403 LinkedListMultimap<String, JsonObject> multimap = LinkedListMultimap.create();
404
405 @Override
406 protected void parse(JsonObject data) {
407 String name = data.get("name").getAsString();
408
409 if (name.isEmpty())
410 return;
411
412 multimap.put(name, data);
413 }
414
415 @Override
416 protected void onEnd() {
417 ItemDefinition[] definitions = fromClientDump(clientDumpFilePath);
418
419 for (ItemDefinition definition : definitions) {
420 if (definition == null || definition.name.equals("null") || definition.name.isEmpty())
421 continue;
422
423 if (!multimap.containsKey(definition.name))
424 continue;
425
426 List<JsonObject> value = multimap.get(definition.name);
427 JsonObject object = value.get(value.size() - 1);
428
429 if (value.size() > 1)
430 multimap.remove(definition.name, object);
431
432 if (object.has("destroy-message"))
433 definition.destroyMessage = object.get("destroy-message").getAsString();
434
435 if (object.has("tradable"))
436 definition.tradeable = object.get("tradable").getAsBoolean();
437
438 if (object.has("weight"))
439 definition.weight = object.get("weight").getAsDouble();
440
441 if (definition.isNoted()) {
442 continue;
443 }
444
445 if (object.has("two-handed"))
446 definition.twoHanded = object.get("two-handed").getAsBoolean();
447
448 if (object.has("equipment-type"))
449 definition.equipmentType = EquipmentType.valueOf(object.get("equipment-type").getAsString());
450
451 for (int index = 0; index < BONUS_CONFIG_FIELD_NAMES.length; index++) {
452 String bonusName = BONUS_CONFIG_FIELD_NAMES[index];
453 if (object.has(bonusName)) {
454 if (definition.bonuses == EMPTY_BONUSES) {
455 definition.bonuses = new int[EMPTY_BONUSES.length];
456 }
457 definition.bonuses[index] = object.get(bonusName).getAsInt();
458 }
459 }
460 }
461
462 DEFINITIONS = definitions;
463 dump(dumpPath);
464 }
465
466 }.run();
467 }
468
469 public static void dump(ItemDefinition[] definitions, String path) {
470 JsonSaver saver = new JsonSaver();
471
472 for (ItemDefinition definition : definitions) {
473 if (definition == null) continue;
474 if (definition.name.equals("null")) continue;
475
476 saver.current().addProperty("id", definition.id);
477 saver.current().addProperty("name", definition.name);
478
479 if (definition.destroyMessage != null) {
480 saver.current().addProperty("destroy-message", definition.destroyMessage);
481 } else if (definition.destroyable) {
482 saver.current().addProperty("destroyable", true);
483 }
484
485 if (definition.stackable) {
486 saver.current().addProperty("stackable", true);
487 }
488
489 if (!definition.tradeable) {
490 saver.current().addProperty("tradeable", false);
491 }
492
493 if (definition.twoHanded) {
494 saver.current().addProperty("two-handed", true);
495 }
496
497 if (definition.unnotedId != definition.id) {
498 saver.current().addProperty("unnoted-id", definition.unnotedId);
499 }
500
501 if (definition.notedId != definition.id) {
502 saver.current().addProperty("noted-id", definition.notedId);
503 }
504
505 if (definition.lowAlch > 1) {
506 saver.current().addProperty("low-alch", definition.lowAlch);
507 }
508
509 if (definition.highAlch > 1) {
510 saver.current().addProperty("high-alch", definition.highAlch);
511 }
512
513 if (definition.base_value > 1) {
514 saver.current().addProperty("base-value", definition.base_value);
515 }
516
517 if (definition.street_value > 1) {
518 saver.current().addProperty("street-value", definition.street_value);
519 }
520
521 if (definition.weight != 0) {
522 saver.current().addProperty("weight", definition.weight);
523 }
524
525 if (definition.stand_animation != MobAnimation.PLAYER_STAND) {
526 saver.current().addProperty("stand-animation", definition.stand_animation);
527 }
528
529 if (definition.walk_animation != MobAnimation.PLAYER_WALK) {
530 saver.current().addProperty("walk-animation", definition.walk_animation);
531 }
532
533 if (definition.run_animation != MobAnimation.PLAYER_RUN) {
534 saver.current().addProperty("run-animation", definition.run_animation);
535 }
536
537 if (definition.attack_animations != EMPTY) {
538 saver.current().add("attack-animations", saver.serializer().toJsonTree(definition.attack_animations));
539 }
540
541 if (definition.block_animation != -1) {
542 saver.current().addProperty("block-animation", definition.block_animation);
543 }
544
545 if (definition.equipmentType != EquipmentType.NOT_WIELDABLE) {
546 saver.current().addProperty("equipment-slot", definition.equipmentType.name());
547 }
548
549 if (definition.weaponInterface != null && definition.weaponInterface != WeaponInterface.UNARMED) {
550 saver.current().addProperty("weapon-interface", definition.weaponInterface.name());
551 }
552
553 for (int index = 0; index < SKILL_REQUIREMENT_CONFIG_FIELD_NAMES.length; index++) {
554 if (definition.requirements[index] > 0)
555 saver.current().addProperty(SKILL_REQUIREMENT_CONFIG_FIELD_NAMES[index], definition.requirements[index]);
556 }
557
558 for (int index = 0; index < BONUS_CONFIG_FIELD_NAMES.length; index++) {
559 if (definition.bonuses[index] != 0)
560 saver.current().addProperty(BONUS_CONFIG_FIELD_NAMES[index], definition.bonuses[index]);
561 }
562
563 if (definition.rangedDefinition != null) {
564 saver.current().addProperty("ranged-type", definition.rangedDefinition.getType().name());
565 saver.current().add("allowed", saver.serializer().toJsonTree(definition.rangedDefinition.getAllowed()));
566 }
567
568 saver.split();
569 }
570
571 saver.publish("./data/" + path + ".json");
572 }
573
574 public static void dump(String path) {
575 JsonSaver saver = new JsonSaver();
576
577 for (ItemDefinition definition : DEFINITIONS) {
578 if (definition == null) continue;
579 if (definition.name.equals("null")) continue;
580
581 saver.current().addProperty("id", definition.id);
582 saver.current().addProperty("name", definition.name);
583
584 if (definition.destroyMessage != null) {
585 saver.current().addProperty("destroy-message", definition.destroyMessage);
586 } else if (definition.destroyable) {
587 saver.current().addProperty("destroyable", true);
588 }
589
590 if (definition.stackable) {
591 saver.current().addProperty("stackable", true);
592 }
593
594 if (!definition.tradeable) {
595 saver.current().addProperty("tradeable", false);
596 }
597
598 if (definition.twoHanded) {
599 saver.current().addProperty("two-handed", true);
600 }
601
602 if (definition.unnotedId != definition.id) {
603 saver.current().addProperty("unnoted-id", definition.unnotedId);
604 }
605
606 if (definition.notedId != definition.id) {
607 saver.current().addProperty("noted-id", definition.notedId);
608 }
609
610 if (definition.lowAlch > 1) {
611 saver.current().addProperty("low-alch", definition.lowAlch);
612 }
613
614 if (definition.highAlch > 1) {
615 saver.current().addProperty("high-alch", definition.highAlch);
616 }
617
618 if (definition.base_value > 1) {
619 saver.current().addProperty("base-value", definition.base_value);
620 }
621
622 if (definition.street_value > 1) {
623 saver.current().addProperty("street-value", definition.street_value);
624 }
625
626 if (definition.weight != 0) {
627 saver.current().addProperty("weight", definition.weight);
628 }
629
630 if (definition.stand_animation != MobAnimation.PLAYER_STAND) {
631 saver.current().addProperty("stand-animation", definition.stand_animation);
632 }
633
634 if (definition.walk_animation != MobAnimation.PLAYER_WALK) {
635 saver.current().addProperty("walk-animation", definition.walk_animation);
636 }
637
638 if (definition.run_animation != MobAnimation.PLAYER_RUN) {
639 saver.current().addProperty("run-animation", definition.run_animation);
640 }
641
642 if (definition.attack_animations != EMPTY) {
643 saver.current().add("attack-animations", saver.serializer().toJsonTree(definition.attack_animations));
644 }
645
646 if (definition.block_animation != -1) {
647 saver.current().addProperty("block-animation", definition.block_animation);
648 }
649
650 if (definition.equipmentType != EquipmentType.NOT_WIELDABLE) {
651 saver.current().addProperty("equipment-slot", definition.equipmentType.name());
652 }
653
654 if (definition.weaponInterface != null && definition.weaponInterface != WeaponInterface.UNARMED) {
655 saver.current().addProperty("weapon-interface", definition.weaponInterface.name());
656 }
657
658 for (int index = 0; index < SKILL_REQUIREMENT_CONFIG_FIELD_NAMES.length; index++) {
659 if (definition.requirements[index] > 0)
660 saver.current().addProperty(SKILL_REQUIREMENT_CONFIG_FIELD_NAMES[index], definition.requirements[index]);
661 }
662
663 for (int index = 0; index < BONUS_CONFIG_FIELD_NAMES.length; index++) {
664 if (definition.bonuses[index] != 0)
665 saver.current().addProperty(BONUS_CONFIG_FIELD_NAMES[index], definition.bonuses[index]);
666 }
667
668 if (definition.rangedDefinition != null) {
669 saver.current().addProperty("ranged-type", definition.rangedDefinition.getType().name());
670 saver.current().add("allowed", saver.serializer().toJsonTree(definition.rangedDefinition.getAllowed()));
671 }
672
673 saver.split();
674 }
675
676 saver.publish("./data/" + path + ".json");
677 }
678
686 public static ItemDefinition get(int id) {
687 if (id < 0 || id >= DEFINITIONS.length) {
688 return DEFAULT;
689 }
690
691 if (DEFINITIONS[id] == null) {
692 return DEFINITIONS[id] = new ItemDefinition(id, "null");
693 }
694
695
696 return DEFINITIONS[id];
697 }
698
704 public int getId() {
705 return id;
706 }
707
713 public String getName() {
714 return name;
715 }
716
722 public String getDestroyMessage() {
723 return destroyMessage;
724 }
725
731 public boolean isNoted() {
732 return unnotedId != id;
733 }
734
740 public boolean isNoteable() {
741 return notedId != id;
742 }
743
750 public int getNotedId() {
751 return notedId;
752 }
753
760 public int getUnnotedId() {
761 return unnotedId;
762 }
763
769 public boolean isStackable() {
770 return stackable;
771 }
772
778 public boolean isDestroyable() {
779 return destroyMessage != null;
780 }
781
787 public boolean isTradeable() {
788 return tradeable;
789 }
790
796 public int getStreetValue() {
797 return street_value;
798 }
799
805 public int getBaseValue() {
806 return base_value;
807 }
808
814 public int getValue() {
815 return street_value > 0 ? street_value : base_value;
816 }
817
823 public int getHighAlch() {
824 return getValue() / 2;
825 }
826
832 public int getLowAlch() {
833 return getValue() / 5;
834// return lowAlch;
835 }
836
837 public EquipmentType getEquipmentType() {
838 return equipmentType;
839 }
840
841 public int[] getRequirements() {
842 return requirements;
843 }
844
845 public int[] getBonuses() {
846 return bonuses;
847 }
848
854 public boolean isEquipable() {
855 return equipmentType != EquipmentType.NOT_WIELDABLE;
856 }
857
858 public boolean isTwoHanded() {
859 return twoHanded;
860 }
861
867 public boolean isWeapon() {
868 return EquipmentType.WEAPON.equals(equipmentType);
869 }
870
876 public double getWeight() {
877 return weight;
878 }
879
880 public int getStandAnimation() {
881 return stand_animation;
882 }
883
884 public int getWalkAnimation() {
885 return walk_animation;
886 }
887
888 public int getRunAnimation() {
889 return run_animation;
890 }
891
892 public OptionalInt getAttackAnimation(FightType fightType) {
893 if (attack_animations == EMPTY) {
894 return OptionalInt.empty();
895 }
896
897 return OptionalInt.of(attack_animations.get(fightType));
898 }
899
900 public OptionalInt getBlockAnimation() {
901 return block_animation == -1 ? OptionalInt.empty() : OptionalInt.of(block_animation);
902 }
903
904 public Optional<RangedWeaponDefinition> getRangedDefinition() {
905 return Optional.ofNullable(rangedDefinition);
906 }
907
908 public WeaponInterface getWeaponInterface() {
909 return weaponInterface;
910 }
911
912 public void setEquipmentType(EquipmentType equipmentType) {
913 this.equipmentType = equipmentType;
914 }
915
916 public boolean isPotion() {
917 return this.name != null && (this.name.toLowerCase().contains("potion") || this.name.toLowerCase().contains("brew") || this.name.toLowerCase().contains("sanfew") || this.name.toLowerCase().contains("restore"));
918 }
919
920 public static ItemDefinition[] getDEFINITIONS() {
921 return DEFINITIONS;
922 }
923
924 public static void setDEFINITIONS(ItemDefinition[] DEFINITIONS) {
925 ItemDefinition.DEFINITIONS = DEFINITIONS;
926 }
927
928 public void setDestroyMessage(String destroyMessage) {
929 this.destroyMessage = destroyMessage;
930 }
931
932 public void setDestroyable(boolean destroyable) {
933 this.destroyable = destroyable;
934 }
935
936 public void setStackable(boolean stackable) {
937 this.stackable = stackable;
938 }
939
940 public void setTwoHanded(boolean twoHanded) {
941 this.twoHanded = twoHanded;
942 }
943
944 public void setTradeable(boolean tradeable) {
945 this.tradeable = tradeable;
946 }
947
948 public int getStand_animation() {
949 return stand_animation;
950 }
951
952 public void setStand_animation(int stand_animation) {
953 this.stand_animation = stand_animation;
954 }
955
956 public int getAttack_anim() {
957 return attack_anim;
958 }
959
960 public void setAttack_anim(int attack_anim) {
961 this.attack_anim = attack_anim;
962 }
963
964 public int getWalk_animation() {
965 return walk_animation;
966 }
967
968 public void setWalk_animation(int walk_animation) {
969 this.walk_animation = walk_animation;
970 }
971
972 public int getRun_animation() {
973 return run_animation;
974 }
975
976 public void setRun_animation(int run_animation) {
977 this.run_animation = run_animation;
978 }
979
980 public Map<FightType, Integer> getAttack_animations() {
981 return attack_animations;
982 }
983
984 public void setAttack_animations(Map<FightType, Integer> attack_animations) {
985 this.attack_animations = attack_animations;
986 }
987
988 public int getBlock_animation() {
989 return block_animation;
990 }
991
992 public void setBlock_animation(int block_animation) {
993 this.block_animation = block_animation;
994 }
995
996 public void setUnnotedId(int unnotedId) {
997 this.unnotedId = unnotedId;
998 }
999
1000 public void setNotedId(int notedId) {
1001 this.notedId = notedId;
1002 }
1003
1004 public int getStreet_value() {
1005 return street_value;
1006 }
1007
1008 public void setStreet_value(int street_value) {
1009 this.street_value = street_value;
1010 }
1011
1012 public int getBase_value() {
1013 return base_value;
1014 }
1015
1016 public void setBase_value(int base_value) {
1017 this.base_value = base_value;
1018 }
1019
1020 public void setHighAlch(int highAlch) {
1021 this.highAlch = highAlch;
1022 }
1023
1024 public void setLowAlch(int lowAlch) {
1025 this.lowAlch = lowAlch;
1026 }
1027
1028 public void setWeight(double weight) {
1029 this.weight = weight;
1030 }
1031
1032 public void setWeaponInterface(WeaponInterface weaponInterface) {
1033 this.weaponInterface = weaponInterface;
1034 }
1035
1036 public void setRangedDefinition(RangedWeaponDefinition rangedDefinition) {
1037 this.rangedDefinition = rangedDefinition;
1038 }
1039
1040 public void setRequirements(int[] requirements) {
1041 this.requirements = requirements;
1042 }
1043
1044 public void setBonuses(int[] bonuses) {
1045 this.bonuses = bonuses;
1046 }
1047}
static final int ITEM_DEFINITION_LIMIT
Definition Config.java:219