|
|
@ -19,7 +19,6 @@ import java.sql.ResultSet; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.sql.SQLException; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.HashSet; |
|
|
|
|
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
import java.util.concurrent.ConcurrentHashMap; |
|
|
|
|
|
|
|
|
|
|
|
public class ItemBase { |
|
|
|
public class ItemBase { |
|
|
@ -28,7 +27,6 @@ public class ItemBase { |
|
|
|
public static int GOLD_BASE_ID = 7; |
|
|
|
public static int GOLD_BASE_ID = 7; |
|
|
|
public static ArrayList<Integer> AnniversaryGifts = new ArrayList<>(); |
|
|
|
public static ArrayList<Integer> AnniversaryGifts = new ArrayList<>(); |
|
|
|
public static HashMap<Integer, ItemBase> _itemBaseByUUID = new HashMap<>(); |
|
|
|
public static HashMap<Integer, ItemBase> _itemBaseByUUID = new HashMap<>(); |
|
|
|
public static HashMap<engine.Enum.ItemType, HashSet<ItemBase>> ItemBaseTypeMap = new HashMap<>(); |
|
|
|
|
|
|
|
// Internal cache
|
|
|
|
// Internal cache
|
|
|
|
private static final HashMap<Integer, Integer> itemHashIDMap = new HashMap<>(); |
|
|
|
private static final HashMap<Integer, Integer> itemHashIDMap = new HashMap<>(); |
|
|
|
private static final HashMap<String, Integer> _IDsByNames = new HashMap<>(); |
|
|
|
private static final HashMap<String, Integer> _IDsByNames = new HashMap<>(); |
|
|
@ -44,7 +42,6 @@ public class ItemBase { |
|
|
|
private final byte useAmount; |
|
|
|
private final byte useAmount; |
|
|
|
|
|
|
|
|
|
|
|
// Armor and weapon related values
|
|
|
|
// Armor and weapon related values
|
|
|
|
private final int restrictFlag; |
|
|
|
|
|
|
|
private final String skillRequired; |
|
|
|
private final String skillRequired; |
|
|
|
private final short percentRequired; |
|
|
|
private final short percentRequired; |
|
|
|
private final float blockMod; |
|
|
|
private final float blockMod; |
|
|
@ -82,7 +79,6 @@ public class ItemBase { |
|
|
|
this.hashID = rs.getInt("itemHashID"); |
|
|
|
this.hashID = rs.getInt("itemHashID"); |
|
|
|
|
|
|
|
|
|
|
|
this.isConsumable = false; |
|
|
|
this.isConsumable = false; |
|
|
|
this.restrictFlag = rs.getInt("restrictFlag"); |
|
|
|
|
|
|
|
this.skillRequired = rs.getString("skillRequired"); |
|
|
|
this.skillRequired = rs.getString("skillRequired"); |
|
|
|
this.percentRequired = rs.getShort("percentRequired"); |
|
|
|
this.percentRequired = rs.getShort("percentRequired"); |
|
|
|
this.blockMod = rs.getFloat("blockMod"); |
|
|
|
this.blockMod = rs.getFloat("blockMod"); |
|
|
@ -374,53 +370,10 @@ public class ItemBase { |
|
|
|
return uuid; |
|
|
|
return uuid; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public boolean isLightArmor() { |
|
|
|
|
|
|
|
return this.skillRequired.equals("Wear Armor, Light"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isMediumArmor() { |
|
|
|
|
|
|
|
return this.skillRequired.equals("Wear Armor, Medium"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isHeavyArmor() { |
|
|
|
|
|
|
|
return this.skillRequired.equals("Wear Armor, Heavy"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isClothArmor() { |
|
|
|
|
|
|
|
return this.skillRequired.isEmpty(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isThrowing() { |
|
|
|
|
|
|
|
return this.mastery.equals("Throwing"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isStaff() { |
|
|
|
|
|
|
|
return this.mastery.equals("Staff"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isScepter() { |
|
|
|
|
|
|
|
return this.mastery.equals("Benediction"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isArchery() { |
|
|
|
|
|
|
|
return this.mastery.equals("Archery"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isMelee() { |
|
|
|
|
|
|
|
return (this.isThrowing() == false && this.isStaff() == false && this.isScepter() == false && this.isArchery() == false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isTwoHanded() { |
|
|
|
public boolean isTwoHanded() { |
|
|
|
return this.twoHanded; |
|
|
|
return this.twoHanded; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* @return the restrictFlag |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public int getRestrictFlag() { |
|
|
|
|
|
|
|
return restrictFlag; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @return the skillRequired |
|
|
|
* @return the skillRequired |
|
|
|
*/ |
|
|
|
*/ |
|
|
|