forked from MagicBane/Server
Project cleanup pre merge.
This commit is contained in:
+159
-161
@@ -19,202 +19,200 @@ import java.util.ArrayList;
|
||||
|
||||
public class BaseClass extends AbstractGameObject {
|
||||
|
||||
private final String name;
|
||||
private final String description;
|
||||
private final String name;
|
||||
private final String description;
|
||||
|
||||
private final byte strMod;
|
||||
private final byte dexMod;
|
||||
private final byte conMod;
|
||||
private final byte intMod;
|
||||
private final byte spiMod;
|
||||
private final byte strMod;
|
||||
private final byte dexMod;
|
||||
private final byte conMod;
|
||||
private final byte intMod;
|
||||
private final byte spiMod;
|
||||
|
||||
private final float healthMod;
|
||||
private final float manaMod;
|
||||
private final float staminaMod;
|
||||
|
||||
private int token = 0;
|
||||
|
||||
private final ArrayList<SkillReq> skillsGranted;
|
||||
private final ArrayList<PowerReq> powersGranted;
|
||||
private ArrayList<MobBaseEffects> effectsList = new ArrayList<>();
|
||||
private final float healthMod;
|
||||
private final float manaMod;
|
||||
private final float staminaMod;
|
||||
private final ArrayList<SkillReq> skillsGranted;
|
||||
private final ArrayList<PowerReq> powersGranted;
|
||||
private int token = 0;
|
||||
private ArrayList<MobBaseEffects> effectsList = new ArrayList<>();
|
||||
|
||||
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
*/
|
||||
public BaseClass(String name, String description, byte strMod, byte dexMod, byte conMod, byte intMod, byte spiMod,
|
||||
ArrayList<RuneBase> allowedRunes, ArrayList<SkillReq> skillsGranted, ArrayList<PowerReq> powersGranted) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.strMod = strMod;
|
||||
this.dexMod = dexMod;
|
||||
this.conMod = conMod;
|
||||
this.intMod = intMod;
|
||||
this.spiMod = spiMod;
|
||||
this.healthMod = 1;
|
||||
this.manaMod = 1;
|
||||
this.staminaMod = 1;
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
*/
|
||||
public BaseClass(String name, String description, byte strMod, byte dexMod, byte conMod, byte intMod, byte spiMod,
|
||||
ArrayList<RuneBase> allowedRunes, ArrayList<SkillReq> skillsGranted, ArrayList<PowerReq> powersGranted) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.strMod = strMod;
|
||||
this.dexMod = dexMod;
|
||||
this.conMod = conMod;
|
||||
this.intMod = intMod;
|
||||
this.spiMod = spiMod;
|
||||
this.healthMod = 1;
|
||||
this.manaMod = 1;
|
||||
this.staminaMod = 1;
|
||||
|
||||
this.skillsGranted = skillsGranted;
|
||||
this.powersGranted = powersGranted;
|
||||
this.skillsGranted = skillsGranted;
|
||||
this.powersGranted = powersGranted;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Normal Constructor
|
||||
*/
|
||||
public BaseClass(String name, String description, byte strMod, byte dexMod, byte conMod, byte intMod, byte spiMod,
|
||||
ArrayList<RuneBase> allowedRunes, ArrayList<SkillReq> skillsGranted, ArrayList<PowerReq> powersGranted, int newUUID) {
|
||||
super(newUUID);
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.strMod = strMod;
|
||||
this.dexMod = dexMod;
|
||||
this.conMod = conMod;
|
||||
this.intMod = intMod;
|
||||
this.spiMod = spiMod;
|
||||
this.healthMod = 1;
|
||||
this.manaMod = 1;
|
||||
this.staminaMod = 1;
|
||||
this.skillsGranted = skillsGranted;
|
||||
this.powersGranted = powersGranted;
|
||||
/**
|
||||
* Normal Constructor
|
||||
*/
|
||||
public BaseClass(String name, String description, byte strMod, byte dexMod, byte conMod, byte intMod, byte spiMod,
|
||||
ArrayList<RuneBase> allowedRunes, ArrayList<SkillReq> skillsGranted, ArrayList<PowerReq> powersGranted, int newUUID) {
|
||||
super(newUUID);
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.strMod = strMod;
|
||||
this.dexMod = dexMod;
|
||||
this.conMod = conMod;
|
||||
this.intMod = intMod;
|
||||
this.spiMod = spiMod;
|
||||
this.healthMod = 1;
|
||||
this.manaMod = 1;
|
||||
this.staminaMod = 1;
|
||||
this.skillsGranted = skillsGranted;
|
||||
this.powersGranted = powersGranted;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public BaseClass(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public BaseClass(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
|
||||
this.name = rs.getString("name");
|
||||
this.description = rs.getString("description");
|
||||
this.strMod = rs.getByte("strMod");
|
||||
this.dexMod = rs.getByte("dexMod");
|
||||
this.conMod = rs.getByte("conMod");
|
||||
this.intMod = rs.getByte("intMod");
|
||||
this.spiMod = rs.getByte("spiMod");
|
||||
this.token = rs.getInt("token");
|
||||
this.healthMod = rs.getInt("healthMod");
|
||||
this.manaMod = rs.getInt("manaMod");
|
||||
this.staminaMod = rs.getInt("staminaMod");
|
||||
this.skillsGranted = DbManager.SkillReqQueries.GET_REQS_FOR_RUNE(this.getObjectUUID());
|
||||
this.powersGranted = PowerReq.getPowerReqsForRune(this.getObjectUUID());
|
||||
this.effectsList = (DbManager.MobBaseQueries.GET_RUNEBASE_EFFECTS(this.getObjectUUID()));
|
||||
this.name = rs.getString("name");
|
||||
this.description = rs.getString("description");
|
||||
this.strMod = rs.getByte("strMod");
|
||||
this.dexMod = rs.getByte("dexMod");
|
||||
this.conMod = rs.getByte("conMod");
|
||||
this.intMod = rs.getByte("intMod");
|
||||
this.spiMod = rs.getByte("spiMod");
|
||||
this.token = rs.getInt("token");
|
||||
this.healthMod = rs.getInt("healthMod");
|
||||
this.manaMod = rs.getInt("manaMod");
|
||||
this.staminaMod = rs.getInt("staminaMod");
|
||||
this.skillsGranted = DbManager.SkillReqQueries.GET_REQS_FOR_RUNE(this.getObjectUUID());
|
||||
this.powersGranted = PowerReq.getPowerReqsForRune(this.getObjectUUID());
|
||||
this.effectsList = (DbManager.MobBaseQueries.GET_RUNEBASE_EFFECTS(this.getObjectUUID()));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Getters
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public static void LoadAllBaseClasses() {
|
||||
DbManager.BaseClassQueries.GET_ALL_BASE_CLASSES();
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public static void serializeForClientMsg(BaseClass baseClass, ByteBufferWriter writer) {
|
||||
serializeForClientMsg(baseClass, writer, 3);
|
||||
}
|
||||
|
||||
public byte getStrMod() {
|
||||
return strMod;
|
||||
}
|
||||
public static void serializeForClientMsg(BaseClass baseClass, ByteBufferWriter writer, int type) {
|
||||
writer.putInt(type); // For BaseClass
|
||||
writer.putInt(0); // Pad
|
||||
writer.putInt(baseClass.getObjectUUID());
|
||||
writer.putInt(baseClass.getObjectType().ordinal()); // Is this correct?
|
||||
writer.putInt(baseClass.getObjectUUID());
|
||||
}
|
||||
|
||||
public byte getDexMod() {
|
||||
return dexMod;
|
||||
}
|
||||
public static BaseClass getBaseClass(final int UUID) {
|
||||
return DbManager.BaseClassQueries.GET_BASE_CLASS(UUID);
|
||||
}
|
||||
|
||||
public byte getConMod() {
|
||||
return conMod;
|
||||
}
|
||||
/*
|
||||
* Getters
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public byte getIntMod() {
|
||||
return intMod;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public byte getSpiMod() {
|
||||
return spiMod;
|
||||
}
|
||||
public byte getStrMod() {
|
||||
return strMod;
|
||||
}
|
||||
|
||||
public int getToken() {
|
||||
return this.token;
|
||||
}
|
||||
public byte getDexMod() {
|
||||
return dexMod;
|
||||
}
|
||||
|
||||
public float getHealthMod() {
|
||||
return this.healthMod;
|
||||
}
|
||||
public byte getConMod() {
|
||||
return conMod;
|
||||
}
|
||||
|
||||
public float getManaMod() {
|
||||
return this.manaMod;
|
||||
}
|
||||
public byte getIntMod() {
|
||||
return intMod;
|
||||
}
|
||||
|
||||
public float getStaminaMod() {
|
||||
return this.staminaMod;
|
||||
}
|
||||
public byte getSpiMod() {
|
||||
return spiMod;
|
||||
}
|
||||
|
||||
public ArrayList<Integer> getRuneList() {
|
||||
return RuneBase.AllowedBaseClassRunesMap.get(this.getObjectUUID());
|
||||
}
|
||||
public int getToken() {
|
||||
return this.token;
|
||||
}
|
||||
|
||||
public ArrayList<SkillReq> getSkillsGranted() {
|
||||
return this.skillsGranted;
|
||||
}
|
||||
public float getHealthMod() {
|
||||
return this.healthMod;
|
||||
}
|
||||
|
||||
public ArrayList<PowerReq> getPowersGranted() {
|
||||
return this.powersGranted;
|
||||
}
|
||||
public float getManaMod() {
|
||||
return this.manaMod;
|
||||
}
|
||||
|
||||
public ArrayList<RuneBaseEffect> getEffectsGranted() {
|
||||
return RuneBaseEffect.RuneIDBaseEffectMap.get(this.getObjectUUID());
|
||||
}
|
||||
public float getStaminaMod() {
|
||||
return this.staminaMod;
|
||||
}
|
||||
|
||||
/*
|
||||
* Utils
|
||||
*/
|
||||
public boolean isAllowedRune(RuneBase rb) {
|
||||
public ArrayList<Integer> getRuneList() {
|
||||
return RuneBase.AllowedBaseClassRunesMap.get(this.getObjectUUID());
|
||||
}
|
||||
|
||||
if (this.getRuneList().contains(rb.getObjectUUID()))
|
||||
return true;
|
||||
public ArrayList<SkillReq> getSkillsGranted() {
|
||||
return this.skillsGranted;
|
||||
}
|
||||
|
||||
if (RuneBase.AllowedBaseClassRunesMap.containsKey(111111)){
|
||||
if (RuneBase.AllowedBaseClassRunesMap.get(111111).contains(rb.getObjectUUID()))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
* Serializing
|
||||
*/
|
||||
|
||||
public static void LoadAllBaseClasses(){
|
||||
DbManager.BaseClassQueries.GET_ALL_BASE_CLASSES();
|
||||
}
|
||||
public ArrayList<PowerReq> getPowersGranted() {
|
||||
return this.powersGranted;
|
||||
}
|
||||
|
||||
/*
|
||||
* Serializing
|
||||
*/
|
||||
|
||||
public static void serializeForClientMsg(BaseClass baseClass, ByteBufferWriter writer) {
|
||||
serializeForClientMsg(baseClass,writer, 3);
|
||||
}
|
||||
public ArrayList<RuneBaseEffect> getEffectsGranted() {
|
||||
return RuneBaseEffect.RuneIDBaseEffectMap.get(this.getObjectUUID());
|
||||
}
|
||||
|
||||
public static void serializeForClientMsg(BaseClass baseClass,ByteBufferWriter writer, int type) {
|
||||
writer.putInt(type); // For BaseClass
|
||||
writer.putInt(0); // Pad
|
||||
writer.putInt(baseClass.getObjectUUID());
|
||||
writer.putInt(baseClass.getObjectType().ordinal()); // Is this correct?
|
||||
writer.putInt(baseClass.getObjectUUID());
|
||||
}
|
||||
/*
|
||||
* Utils
|
||||
*/
|
||||
public boolean isAllowedRune(RuneBase rb) {
|
||||
|
||||
public static BaseClass getBaseClass(final int UUID) {
|
||||
return DbManager.BaseClassQueries.GET_BASE_CLASS(UUID);
|
||||
}
|
||||
if (this.getRuneList().contains(rb.getObjectUUID()))
|
||||
return true;
|
||||
|
||||
@Override
|
||||
public void updateDatabase() {
|
||||
; //Never update..
|
||||
}
|
||||
if (RuneBase.AllowedBaseClassRunesMap.containsKey(111111)) {
|
||||
if (RuneBase.AllowedBaseClassRunesMap.get(111111).contains(rb.getObjectUUID()))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public ArrayList<MobBaseEffects> getEffectsList() {
|
||||
return effectsList;
|
||||
}
|
||||
@Override
|
||||
public void updateDatabase() {
|
||||
; //Never update..
|
||||
}
|
||||
|
||||
public ArrayList<MobBaseEffects> getEffectsList() {
|
||||
return effectsList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user