[FEATURE] Data will now use json (#417)
* [FEATURE] Item data is now loaded from json * [TASK] Renamed the old method into it's new use * [TASK] Removed unused code * [FEATURE] Added some more json's * [CLEANUP] Code cleanup * [FEATURE] NPC drops are now in json * [CLEANUP] Removed testing class
This commit is contained in:
1 parent
09343c6a8c
commit
8a6cf6f1ae
33 files changed
+513556
-22340
No files matched your search
@@ -0,0 +1,49 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
public class DoorData {
|
||||
private final int id;
|
||||
private final Location[] locations;
|
||||
private final int face;
|
||||
private final int type;
|
||||
|
||||
public DoorData(int id, Location[] locations, int face, int type) {
|
||||
this.id = id;
|
||||
this.locations = locations;
|
||||
this.face = face;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public Location[] getLocations() {
|
||||
return locations;
|
||||
}
|
||||
|
||||
public int getFace() {
|
||||
return face;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static class Location {
|
||||
private int x;
|
||||
private int y;
|
||||
private int height;
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
public class GlobalDropData {
|
||||
|
||||
private int id;
|
||||
private int amount;
|
||||
private int itemX;
|
||||
private int itemY;
|
||||
private int height;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public int getItemX() {
|
||||
return itemX;
|
||||
}
|
||||
|
||||
public int getItemY() {
|
||||
return itemY;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
public class ItemData {
|
||||
private final int id;
|
||||
private final String name;
|
||||
private final String examine;
|
||||
private final Values[] values;
|
||||
private final Bonuses[] bonuses;
|
||||
|
||||
public ItemData(int id, String name, String examine, Values[] values, Bonuses[] bonuses) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.examine = examine;
|
||||
this.values = values;
|
||||
this.bonuses = bonuses;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getExamine() {
|
||||
return examine;
|
||||
}
|
||||
|
||||
public Values getValues() {
|
||||
return values[0];
|
||||
}
|
||||
|
||||
public Bonuses getBonuses() {
|
||||
return bonuses[0];
|
||||
}
|
||||
|
||||
public static class Values {
|
||||
int shopValue;
|
||||
int lowAlch;
|
||||
int highAlch;
|
||||
|
||||
public int getShopValue() {
|
||||
return shopValue;
|
||||
}
|
||||
|
||||
public int getLowAlch() {
|
||||
return lowAlch;
|
||||
}
|
||||
|
||||
public int getHighAlch() {
|
||||
return highAlch;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Bonuses {
|
||||
int attackStab;
|
||||
int attackSlash;
|
||||
int attackCrush;
|
||||
int attackMagic;
|
||||
int attackRange;
|
||||
int defenceStab;
|
||||
int defenceSlash;
|
||||
int defenceCrush;
|
||||
int defenceMagic;
|
||||
int defenceRange;
|
||||
int strengthBonus;
|
||||
int prayerBonus;
|
||||
|
||||
public int getAttackStab() {
|
||||
return attackStab;
|
||||
}
|
||||
|
||||
public int getAttackSlash() {
|
||||
return attackSlash;
|
||||
}
|
||||
|
||||
public int getAttackCrush() {
|
||||
return attackCrush;
|
||||
}
|
||||
|
||||
public int getAttackMagic() {
|
||||
return attackMagic;
|
||||
}
|
||||
|
||||
public int getAttackRange() {
|
||||
return attackRange;
|
||||
}
|
||||
|
||||
public int getDefenceStab() {
|
||||
return defenceStab;
|
||||
}
|
||||
|
||||
public int getDefenceSlash() {
|
||||
return defenceSlash;
|
||||
}
|
||||
|
||||
public int getDefenceCrush() {
|
||||
return defenceCrush;
|
||||
}
|
||||
|
||||
public int getDefenceMagic() {
|
||||
return defenceMagic;
|
||||
}
|
||||
|
||||
public int getDefenceRange() {
|
||||
return defenceRange;
|
||||
}
|
||||
|
||||
public int getStrengthBonus() {
|
||||
return strengthBonus;
|
||||
}
|
||||
|
||||
public int getPrayerBonus() {
|
||||
return prayerBonus;
|
||||
}
|
||||
|
||||
public int[] getBonuses() {
|
||||
int[] bonuses = new int[12];
|
||||
|
||||
bonuses[0] = this.getAttackStab();
|
||||
bonuses[1] = this.getAttackSlash();
|
||||
bonuses[2] = this.getAttackCrush();
|
||||
bonuses[3] = this.getAttackMagic();
|
||||
bonuses[4] = this.getAttackRange();
|
||||
bonuses[5] = this.getDefenceStab();
|
||||
bonuses[6] = this.getDefenceSlash();
|
||||
bonuses[7] = this.getDefenceCrush();
|
||||
bonuses[8] = this.getDefenceMagic();
|
||||
bonuses[9] = this.getDefenceRange();
|
||||
bonuses[10] = this.getStrengthBonus();
|
||||
bonuses[11] = this.getPrayerBonus();
|
||||
|
||||
return bonuses;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
public class NpcData {
|
||||
private final int id;
|
||||
private final String name;
|
||||
private final int combat;
|
||||
private final int hitpoints;
|
||||
|
||||
public NpcData(int id, String name, int combat, int hitpoints) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.combat = combat;
|
||||
this.hitpoints = hitpoints;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getCombat() {
|
||||
return combat;
|
||||
}
|
||||
|
||||
public int getHitpoints() {
|
||||
return hitpoints;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
import com.rebotted.game.npcs.drops.ItemDrop;
|
||||
|
||||
/**
|
||||
* @author SandroC
|
||||
*/
|
||||
public class NpcDrop {
|
||||
private final int id;
|
||||
private final ItemDrop[] items;
|
||||
|
||||
public NpcDrop(int id, ItemDrop[] items) {
|
||||
this.id = id;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public ItemDrop[] getItems() {
|
||||
return items;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
/**
|
||||
* @author SandroC
|
||||
*/
|
||||
public class NpcSpawn {
|
||||
private final int id;
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int height;
|
||||
private final int walk;
|
||||
private final int maxHit;
|
||||
private final int attack;
|
||||
private final int strength;
|
||||
|
||||
public NpcSpawn(int id, int x, int y, int height, int walk, int maxHit, int attack, int strength) {
|
||||
this.id = id;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.height = height;
|
||||
this.walk = walk;
|
||||
this.maxHit = maxHit;
|
||||
this.attack = attack;
|
||||
this.strength = strength;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public int isWalk() {
|
||||
return walk;
|
||||
}
|
||||
|
||||
public int getMaxHit() {
|
||||
return maxHit;
|
||||
}
|
||||
|
||||
public int getAttack() {
|
||||
return attack;
|
||||
}
|
||||
|
||||
public int getStrength() {
|
||||
return strength;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
/**
|
||||
* @author SandroC
|
||||
*/
|
||||
public class ShopData {
|
||||
private final int id;
|
||||
private final String name;
|
||||
private final int sellModifier;
|
||||
private final int buyModifier;
|
||||
private final ShopItems[] items;
|
||||
|
||||
public ShopData(int id, String name, int sellModifier, int buyModifier, ShopItems[] items) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.sellModifier = sellModifier;
|
||||
this.buyModifier = buyModifier;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public int getSellModifier() {
|
||||
return sellModifier;
|
||||
}
|
||||
|
||||
public int getBuyModifier() {
|
||||
return buyModifier;
|
||||
}
|
||||
|
||||
public ShopItems[] getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public static class ShopItems {
|
||||
int itemId;
|
||||
int itemAmount;
|
||||
|
||||
public int getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
public int getItemAmount() {
|
||||
return itemAmount;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user