forked from MagicBane/Server
Project cleanup pre merge.
This commit is contained in:
@@ -24,97 +24,98 @@ import java.sql.SQLException;
|
||||
|
||||
public abstract class AbstractEffectModifier {
|
||||
|
||||
protected EffectsBase parent;
|
||||
protected int UUID;
|
||||
protected String IDString;
|
||||
protected String effectType;
|
||||
public float minMod;
|
||||
protected float maxMod;
|
||||
protected float percentMod;
|
||||
protected float ramp;
|
||||
protected boolean useRampAdd;
|
||||
protected String type;
|
||||
public SourceType sourceType;
|
||||
|
||||
protected String string1;
|
||||
protected String string2;
|
||||
public ModType modType;
|
||||
public float minMod;
|
||||
public SourceType sourceType;
|
||||
public ModType modType;
|
||||
protected EffectsBase parent;
|
||||
protected int UUID;
|
||||
protected String IDString;
|
||||
protected String effectType;
|
||||
protected float maxMod;
|
||||
protected float percentMod;
|
||||
protected float ramp;
|
||||
protected boolean useRampAdd;
|
||||
protected String type;
|
||||
protected String string1;
|
||||
protected String string2;
|
||||
|
||||
public AbstractEffectModifier(ResultSet rs) throws SQLException {
|
||||
public AbstractEffectModifier(ResultSet rs) throws SQLException {
|
||||
|
||||
this.UUID = rs.getInt("ID");
|
||||
this.IDString = rs.getString("IDString");
|
||||
this.effectType = rs.getString("modType");
|
||||
this.modType = ModType.GetModType(this.effectType);
|
||||
this.type = rs.getString("type").replace("\"", "");
|
||||
this.sourceType = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
|
||||
this.minMod = rs.getFloat("minMod");
|
||||
this.maxMod = rs.getFloat("maxMod");
|
||||
this.percentMod = rs.getFloat("percentMod");
|
||||
this.ramp = rs.getFloat("ramp");
|
||||
this.useRampAdd = (rs.getInt("useRampAdd") == 1) ? true : false;
|
||||
|
||||
this.string1 = rs.getString("string1");
|
||||
this.string2 = rs.getString("string2");
|
||||
}
|
||||
this.UUID = rs.getInt("ID");
|
||||
this.IDString = rs.getString("IDString");
|
||||
this.effectType = rs.getString("modType");
|
||||
this.modType = ModType.GetModType(this.effectType);
|
||||
this.type = rs.getString("type").replace("\"", "");
|
||||
this.sourceType = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
|
||||
this.minMod = rs.getFloat("minMod");
|
||||
this.maxMod = rs.getFloat("maxMod");
|
||||
this.percentMod = rs.getFloat("percentMod");
|
||||
this.ramp = rs.getFloat("ramp");
|
||||
this.useRampAdd = (rs.getInt("useRampAdd") == 1) ? true : false;
|
||||
|
||||
this.string1 = rs.getString("string1");
|
||||
this.string2 = rs.getString("string2");
|
||||
}
|
||||
|
||||
|
||||
public int getUUID() {
|
||||
return this.UUID;
|
||||
}
|
||||
public int getUUID() {
|
||||
return this.UUID;
|
||||
}
|
||||
|
||||
// public String getIDString() {
|
||||
// return this.IDString;
|
||||
// }
|
||||
// public String getIDString() {
|
||||
// return this.IDString;
|
||||
// }
|
||||
|
||||
public String getmodType() {
|
||||
return this.effectType;
|
||||
}
|
||||
public String getmodType() {
|
||||
return this.effectType;
|
||||
}
|
||||
|
||||
public float getMinMod() {
|
||||
return this.minMod;
|
||||
}
|
||||
public float getMinMod() {
|
||||
return this.minMod;
|
||||
}
|
||||
|
||||
public float getMaxMod() {
|
||||
return this.maxMod;
|
||||
}
|
||||
public float getMaxMod() {
|
||||
return this.maxMod;
|
||||
}
|
||||
|
||||
public float getPercentMod() {
|
||||
return this.percentMod;
|
||||
}
|
||||
public float getPercentMod() {
|
||||
return this.percentMod;
|
||||
}
|
||||
|
||||
public float getRamp() {
|
||||
return this.ramp;
|
||||
}
|
||||
public float getRamp() {
|
||||
return this.ramp;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public String getString1() {
|
||||
return this.string1;
|
||||
}
|
||||
public String getString1() {
|
||||
return this.string1;
|
||||
}
|
||||
|
||||
public String getString2() {
|
||||
return this.string2;
|
||||
}
|
||||
public String getString2() {
|
||||
return this.string2;
|
||||
}
|
||||
|
||||
public EffectsBase getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
public EffectsBase getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(EffectsBase value) {
|
||||
this.parent = value;
|
||||
}
|
||||
public void setParent(EffectsBase value) {
|
||||
this.parent = value;
|
||||
}
|
||||
|
||||
public void applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
public void applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
_applyEffectModifier(source, awo, trains, effect);
|
||||
}
|
||||
_applyEffectModifier(source, awo, trains, effect);
|
||||
}
|
||||
|
||||
protected abstract void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect);
|
||||
protected abstract void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect);
|
||||
|
||||
public abstract void applyBonus(AbstractCharacter ac, int trains);
|
||||
public abstract void applyBonus(Item item, int trains);
|
||||
public abstract void applyBonus(Building building, int trains);
|
||||
public abstract void applyBonus(AbstractCharacter ac, int trains);
|
||||
|
||||
public abstract void applyBonus(Item item, int trains);
|
||||
|
||||
public abstract void applyBonus(Building building, int trains);
|
||||
}
|
||||
|
||||
@@ -18,32 +18,35 @@ import java.sql.SQLException;
|
||||
|
||||
public class AdjustAboveDmgCapEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public AdjustAboveDmgCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public AdjustAboveDmgCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setFloat(this, amount);
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setFloat(this, amount);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,23 +20,26 @@ import java.sql.SQLException;
|
||||
|
||||
public class AmbidexterityEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public AmbidexterityEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public AmbidexterityEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(ModType.Ambidexterity, SourceType.None, true);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(ModType.Ambidexterity, SourceType.None, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,25 +18,28 @@ import java.sql.SQLException;
|
||||
|
||||
public class ArmorPiercingEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ArmorPiercingEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ArmorPiercingEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
amount = this.percentMod;
|
||||
bonus.addFloat(this, amount * 0.01f);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
amount = this.percentMod;
|
||||
bonus.addFloat(this, amount * 0.01f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,29 +18,32 @@ import java.sql.SQLException;
|
||||
|
||||
public class AttackDelayEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public AttackDelayEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public AttackDelayEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,39 +18,42 @@ import java.sql.SQLException;
|
||||
|
||||
public class AttributeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public AttributeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public AttributeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
ac.update();
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
ac.update();
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,33 +21,36 @@ import java.sql.SQLException;
|
||||
|
||||
public class BlackMantleEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public BlackMantleEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public BlackMantleEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
SourceType sourceType = SourceType.valueOf(this.type);
|
||||
|
||||
if (sourceType == null){
|
||||
Logger.error("Bad Source Type for " + this.type);
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
SourceType sourceType = SourceType.valueOf(this.type);
|
||||
|
||||
if (this.type.equals("Heal"))
|
||||
bonus.setFloat(this, trains);
|
||||
else
|
||||
bonus.setBool(ModType.ImmuneTo, this.sourceType, true);
|
||||
}
|
||||
if (sourceType == null) {
|
||||
Logger.error("Bad Source Type for " + this.type);
|
||||
return;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
if (this.type.equals("Heal"))
|
||||
bonus.setFloat(this, trains);
|
||||
else
|
||||
bonus.setBool(ModType.ImmuneTo, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,25 @@ import java.sql.SQLException;
|
||||
|
||||
public class BladeTrailsEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public BladeTrailsEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public BladeTrailsEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,29 +18,32 @@ import java.sql.SQLException;
|
||||
|
||||
public class BlockEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public BlockEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public BlockEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setFloat(this, amount);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setFloat(this, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,43 +20,46 @@ import java.util.HashSet;
|
||||
|
||||
public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public BlockedPowerTypeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public BlockedPowerTypeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType, true);
|
||||
|
||||
|
||||
for (String effect : ac.getEffects().keySet()){
|
||||
Effect eff = ac.getEffects().get(effect);
|
||||
ModType toBlock = ModType.None;
|
||||
|
||||
switch (this.sourceType){
|
||||
case Invisible:
|
||||
toBlock = ModType.Invisible;
|
||||
break;
|
||||
}
|
||||
|
||||
HashSet<AbstractEffectModifier> aemList = eff.getEffectModifiers();
|
||||
for (AbstractEffectModifier aem : aemList ){
|
||||
if (aem.modType.equals(toBlock)){
|
||||
ac.endEffect(effect);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
|
||||
for (String effect : ac.getEffects().keySet()) {
|
||||
Effect eff = ac.getEffects().get(effect);
|
||||
ModType toBlock = ModType.None;
|
||||
|
||||
switch (this.sourceType) {
|
||||
case Invisible:
|
||||
toBlock = ModType.Invisible;
|
||||
break;
|
||||
}
|
||||
|
||||
HashSet<AbstractEffectModifier> aemList = eff.getEffectModifiers();
|
||||
for (AbstractEffectModifier aem : aemList) {
|
||||
if (aem.modType.equals(toBlock)) {
|
||||
ac.endEffect(effect);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,24 +18,27 @@ import java.sql.SQLException;
|
||||
|
||||
public class CannotAttackEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CannotAttackEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public CannotAttackEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
|
||||
bonus.setBool(this.modType,this.sourceType, true);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,28 +19,31 @@ import java.sql.SQLException;
|
||||
|
||||
public class CannotCastEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CannotCastEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public CannotCastEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
if (ac.getObjectType().equals(Enum.GameObjectType.Mob)) {
|
||||
Mob mob = (Mob) ac;
|
||||
}
|
||||
if (ac.getObjectType().equals(Enum.GameObjectType.Mob)) {
|
||||
Mob mob = (Mob) ac;
|
||||
}
|
||||
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType, true);
|
||||
}
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,24 +18,27 @@ import java.sql.SQLException;
|
||||
|
||||
public class CannotMoveEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CannotMoveEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public CannotMoveEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType,true);
|
||||
ac.stopMovement(ac.getMovementLoc());
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
ac.stopMovement(ac.getMovementLoc());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,23 +18,26 @@ import java.sql.SQLException;
|
||||
|
||||
public class CannotTrackEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CannotTrackEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public CannotTrackEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType,true);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,25 @@ import java.sql.SQLException;
|
||||
|
||||
public class CharmedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CharmedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public CharmedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,23 +18,26 @@ import java.sql.SQLException;
|
||||
|
||||
public class ConstrainedAmbidexterityEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ConstrainedAmbidexterityEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ConstrainedAmbidexterityEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setString(this,this.type);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setString(this, this.type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,37 +18,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class DCVEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DCVEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public DCVEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = (amount) / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this,amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = (amount) / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,42 +20,44 @@ import java.sql.SQLException;
|
||||
|
||||
public class DREffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DREffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public DREffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
//Defense Rating (defense bonus for armor)
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
//Defense Rating (defense bonus for armor)
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
if (item == null)
|
||||
return;
|
||||
String key; float amount = 0f;
|
||||
if (this.percentMod != 0f) {
|
||||
if (this.useRampAdd)
|
||||
amount = (this.percentMod + (this.ramp * trains)) / 100f;
|
||||
else
|
||||
amount = (this.percentMod * (1 + (this.ramp * trains))) / 100f;
|
||||
amount = amount/100;
|
||||
key = "DR.percent";
|
||||
} else {
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
key = "DR";
|
||||
}
|
||||
item.addBonus(this, amount);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
if (item == null)
|
||||
return;
|
||||
String key;
|
||||
float amount = 0f;
|
||||
if (this.percentMod != 0f) {
|
||||
if (this.useRampAdd)
|
||||
amount = (this.percentMod + (this.ramp * trains)) / 100f;
|
||||
else
|
||||
amount = (this.percentMod * (1 + (this.ramp * trains))) / 100f;
|
||||
amount = amount / 100;
|
||||
key = "DR.percent";
|
||||
} else {
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
key = "DR";
|
||||
}
|
||||
item.addBonus(this, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,29 +18,32 @@ import java.sql.SQLException;
|
||||
|
||||
public class DamageCapEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DamageCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public DamageCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setFloat(this, amount);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setFloat(this, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,45 +20,49 @@ import java.sql.SQLException;
|
||||
|
||||
public class DamageShieldEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DamageShieldEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public DamageShieldEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
float amount; boolean usePercent;
|
||||
if (this.percentMod != 0) {
|
||||
amount = this.percentMod;
|
||||
usePercent = true;
|
||||
} else {
|
||||
amount = this.minMod;
|
||||
usePercent = false;
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
float amount;
|
||||
boolean usePercent;
|
||||
if (this.percentMod != 0) {
|
||||
amount = this.percentMod;
|
||||
usePercent = true;
|
||||
} else {
|
||||
amount = this.minMod;
|
||||
usePercent = false;
|
||||
}
|
||||
|
||||
if (this.ramp > 0f) {
|
||||
float mod = this.ramp * trains;
|
||||
if (this.useRampAdd)
|
||||
amount += mod;
|
||||
else
|
||||
amount *= (1 + mod);
|
||||
}
|
||||
if (this.ramp > 0f) {
|
||||
float mod = this.ramp * trains;
|
||||
if (this.useRampAdd)
|
||||
amount += mod;
|
||||
else
|
||||
amount *= (1 + mod);
|
||||
}
|
||||
|
||||
DamageType dt = DamageType.valueOf(this.type);
|
||||
if (dt != null) {
|
||||
DamageShield ds = new DamageShield(dt, amount, usePercent);
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus != null)
|
||||
bonus.addDamageShield(this, ds);
|
||||
}
|
||||
}
|
||||
DamageType dt = DamageType.valueOf(this.type);
|
||||
if (dt != null) {
|
||||
DamageShield ds = new DamageShield(dt, amount, usePercent);
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus != null)
|
||||
bonus.addDamageShield(this, ds);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,37 +18,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class DodgeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DodgeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public DodgeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,32 +20,33 @@ import java.sql.SQLException;
|
||||
|
||||
public class DurabilityEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DurabilityEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public DurabilityEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains)
|
||||
{
|
||||
if(item == null){
|
||||
return;
|
||||
}
|
||||
float amount = 0;
|
||||
amount = this.percentMod;
|
||||
item.addBonus(this,amount);
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
float amount = 0;
|
||||
amount = this.percentMod;
|
||||
item.addBonus(this, amount);
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,28 +18,31 @@ import java.util.HashSet;
|
||||
|
||||
public class ExclusiveDamageCapEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ExclusiveDamageCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ExclusiveDamageCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus == null)
|
||||
return;
|
||||
if (bonus.getList(this.modType) == null)
|
||||
bonus.setList(this.modType, new HashSet<>());
|
||||
bonus.getList(this.modType).add(this.sourceType);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus == null)
|
||||
return;
|
||||
if (bonus.getList(this.modType) == null)
|
||||
bonus.setList(this.modType, new HashSet<>());
|
||||
bonus.getList(this.modType).add(this.sourceType);
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,25 @@ import java.sql.SQLException;
|
||||
|
||||
public class FadeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public FadeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public FadeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,23 +17,26 @@ import java.sql.SQLException;
|
||||
|
||||
public class FlyEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public FlyEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public FlyEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType,true);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,162 +29,172 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class HealthEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
private DamageType damageType;
|
||||
private DamageType damageType;
|
||||
|
||||
public HealthEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
String damageTypeDB = rs.getString("type");
|
||||
try {
|
||||
this.damageType = DamageType.valueOf(damageTypeDB);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
||||
+ " value received = '" + damageTypeDB + '\'', e);
|
||||
}
|
||||
}
|
||||
public HealthEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
String damageTypeDB = rs.getString("type");
|
||||
try {
|
||||
this.damageType = DamageType.valueOf(damageTypeDB);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
||||
+ " value received = '" + damageTypeDB + '\'', e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
if (awo == null) {
|
||||
Logger.error("_applyEffectModifier(): NULL AWO passed in.");
|
||||
return;
|
||||
}
|
||||
public static float getMinDamage(float baseMin, float intelligence, float spirit, float focus) {
|
||||
float min = baseMin * (((float) Math.pow(intelligence, 0.75f) * 0.0311f) + (0.02f * (int) focus) + ((float) Math.pow(spirit, 0.75f) * 0.0416f));
|
||||
return (float) ((int) (min + 0.5f)); //round to nearest whole number
|
||||
}
|
||||
|
||||
if (effect == null) {
|
||||
Logger.error( "_applyEffectModifier(): NULL AbstractEffectJob passed in.");
|
||||
return;
|
||||
}
|
||||
public static float getMaxDamage(float baseMax, float intelligence, float spirit, float focus) {
|
||||
float max = baseMax * (((float) Math.pow(intelligence, 0.75f) * 0.0785f) + (0.015f * (int) focus) + ((float) Math.pow(spirit, 0.75f) * 0.0157f));
|
||||
return (float) ((int) (max + 0.5f)); //round to nearest whole number
|
||||
}
|
||||
|
||||
float modAmount = 0f;
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
if (awo == null) {
|
||||
Logger.error("_applyEffectModifier(): NULL AWO passed in.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Modify health by percent
|
||||
if (this.percentMod != 0f) {
|
||||
if (effect == null) {
|
||||
Logger.error("_applyEffectModifier(): NULL AbstractEffectJob passed in.");
|
||||
return;
|
||||
}
|
||||
|
||||
//high level mobs/players should not be %damaged/healed.
|
||||
if (awo.getHealthMax() > 25000f && (this.percentMod < 0f || this.percentMod > 5f))
|
||||
return;
|
||||
float modAmount = 0f;
|
||||
|
||||
float mod = 1f;
|
||||
if (this.useRampAdd)
|
||||
mod = (this.percentMod + (this.ramp * trains)) / 100;
|
||||
else
|
||||
mod = (this.percentMod * (1 + (this.ramp * trains))) / 100;
|
||||
modAmount = mod * awo.getHealthMax();
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
if (((AbstractCharacter)awo).isSit())
|
||||
modAmount *= 2.5f;
|
||||
}
|
||||
// Modify health by percent
|
||||
if (this.percentMod != 0f) {
|
||||
|
||||
//debug for spell damage and atr
|
||||
if (source.getDebug(16) && source.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
String smsg = "Percent Damage: " + mod * 100 + '%';
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
//high level mobs/players should not be %damaged/healed.
|
||||
if (awo.getHealthMax() > 25000f && (this.percentMod < 0f || this.percentMod > 5f))
|
||||
return;
|
||||
|
||||
// Modify health by min/max amount
|
||||
else if (this.minMod != 0f || this.maxMod != 0f) {
|
||||
float min = this.minMod;
|
||||
float max = this.maxMod;
|
||||
if (this.ramp > 0f) {
|
||||
float mod = this.ramp * trains;
|
||||
if (this.useRampAdd) {
|
||||
min += mod;
|
||||
max += mod;
|
||||
} else {
|
||||
min *= (1 + mod);
|
||||
max *= (1 + mod);
|
||||
}
|
||||
}
|
||||
if (source.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
float mod = 1f;
|
||||
if (this.useRampAdd)
|
||||
mod = (this.percentMod + (this.ramp * trains)) / 100;
|
||||
else
|
||||
mod = (this.percentMod * (1 + (this.ramp * trains))) / 100;
|
||||
modAmount = mod * awo.getHealthMax();
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
if (((AbstractCharacter) awo).isSit())
|
||||
modAmount *= 2.5f;
|
||||
}
|
||||
|
||||
float focus;
|
||||
CharacterSkill skill = pc.getSkills().get(effect.getPower().getSkillName());
|
||||
if (skill == null)
|
||||
focus = CharacterSkill.getQuickMastery(pc, effect.getPower().getSkillName());
|
||||
else
|
||||
focus = skill.getModifiedAmount();
|
||||
//TODO clean up old formulas once new one is verified
|
||||
// min *= (0.5 + 0.0075 * pc.getStatIntCurrent() + 0.011 * pc.getStatSpiCurrent() + 0.0196 * focus);
|
||||
// max *= (0.62 + 0.0192 * pc.getStatIntCurrent() + 0.00415 * pc.getStatSpiCurrent() + 0.015 * focus);
|
||||
float intt = (pc.getStatIntCurrent() >= 1) ? (float)pc.getStatIntCurrent() : 1f;
|
||||
float spi = (pc.getStatSpiCurrent() >= 1) ? (float)pc.getStatSpiCurrent() : 1f;
|
||||
// min *= (intt * 0.0045 + 0.055 * (float)Math.sqrt(intt - 0.5) + spi * 0.006 + 0.07 * (float)Math.sqrt(spi - 0.5) + 0.02 * (int)focus);
|
||||
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
|
||||
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
||||
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
||||
//debug for spell damage and atr
|
||||
if (source.getDebug(16) && source.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
String smsg = "Percent Damage: " + mod * 100 + '%';
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
|
||||
//debug for spell damage and atr
|
||||
if (pc.getDebug(16)) {
|
||||
String smsg = "Damage: " + (int)Math.abs(min) + " - " + (int)Math.abs(max);
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}else if (source.getObjectType() == GameObjectType.Mob){
|
||||
Mob pc = (Mob) source;
|
||||
// Modify health by min/max amount
|
||||
else if (this.minMod != 0f || this.maxMod != 0f) {
|
||||
float min = this.minMod;
|
||||
float max = this.maxMod;
|
||||
if (this.ramp > 0f) {
|
||||
float mod = this.ramp * trains;
|
||||
if (this.useRampAdd) {
|
||||
min += mod;
|
||||
max += mod;
|
||||
} else {
|
||||
min *= (1 + mod);
|
||||
max *= (1 + mod);
|
||||
}
|
||||
}
|
||||
if (source.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
|
||||
float focus;
|
||||
CharacterSkill skill = pc.getSkills().get(effect.getPower().getSkillName());
|
||||
if (skill == null)
|
||||
focus = CharacterSkill.getQuickMastery(pc, effect.getPower().getSkillName());
|
||||
else
|
||||
focus = skill.getModifiedAmount();
|
||||
//TODO clean up old formulas once new one is verified
|
||||
// min *= (0.5 + 0.0075 * pc.getStatIntCurrent() + 0.011 * pc.getStatSpiCurrent() + 0.0196 * focus);
|
||||
// max *= (0.62 + 0.0192 * pc.getStatIntCurrent() + 0.00415 * pc.getStatSpiCurrent() + 0.015 * focus);
|
||||
float intt = (pc.getStatIntCurrent() >= 1) ? (float)pc.getStatIntCurrent() : 1f;
|
||||
float focus;
|
||||
CharacterSkill skill = pc.getSkills().get(effect.getPower().getSkillName());
|
||||
if (skill == null)
|
||||
focus = CharacterSkill.getQuickMastery(pc, effect.getPower().getSkillName());
|
||||
else
|
||||
focus = skill.getModifiedAmount();
|
||||
//TODO clean up old formulas once new one is verified
|
||||
// min *= (0.5 + 0.0075 * pc.getStatIntCurrent() + 0.011 * pc.getStatSpiCurrent() + 0.0196 * focus);
|
||||
// max *= (0.62 + 0.0192 * pc.getStatIntCurrent() + 0.00415 * pc.getStatSpiCurrent() + 0.015 * focus);
|
||||
float intt = (pc.getStatIntCurrent() >= 1) ? (float) pc.getStatIntCurrent() : 1f;
|
||||
float spi = (pc.getStatSpiCurrent() >= 1) ? (float) pc.getStatSpiCurrent() : 1f;
|
||||
// min *= (intt * 0.0045 + 0.055 * (float)Math.sqrt(intt - 0.5) + spi * 0.006 + 0.07 * (float)Math.sqrt(spi - 0.5) + 0.02 * (int)focus);
|
||||
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
|
||||
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
||||
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
||||
|
||||
if (pc.isPlayerGuard())
|
||||
intt = 200;
|
||||
float spi = (pc.getStatSpiCurrent() >= 1) ? (float)pc.getStatSpiCurrent() : 1f;
|
||||
//debug for spell damage and atr
|
||||
if (pc.getDebug(16)) {
|
||||
String smsg = "Damage: " + (int) Math.abs(min) + " - " + (int) Math.abs(max);
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
} else if (source.getObjectType() == GameObjectType.Mob) {
|
||||
Mob pc = (Mob) source;
|
||||
|
||||
if (pc.isPlayerGuard())
|
||||
spi = 200;
|
||||
// min *= (intt * 0.0045 + 0.055 * (float)Math.sqrt(intt - 0.5) + spi * 0.006 + 0.07 * (float)Math.sqrt(spi - 0.5) + 0.02 * (int)focus);
|
||||
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
|
||||
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
||||
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
||||
float focus;
|
||||
CharacterSkill skill = pc.getSkills().get(effect.getPower().getSkillName());
|
||||
if (skill == null)
|
||||
focus = CharacterSkill.getQuickMastery(pc, effect.getPower().getSkillName());
|
||||
else
|
||||
focus = skill.getModifiedAmount();
|
||||
//TODO clean up old formulas once new one is verified
|
||||
// min *= (0.5 + 0.0075 * pc.getStatIntCurrent() + 0.011 * pc.getStatSpiCurrent() + 0.0196 * focus);
|
||||
// max *= (0.62 + 0.0192 * pc.getStatIntCurrent() + 0.00415 * pc.getStatSpiCurrent() + 0.015 * focus);
|
||||
float intt = (pc.getStatIntCurrent() >= 1) ? (float) pc.getStatIntCurrent() : 1f;
|
||||
|
||||
//debug for spell damage and atr
|
||||
// if (pc.getDebug(16)) {
|
||||
// String smsg = "Damage: " + (int)Math.abs(min) + " - " + (int)Math.abs(max);
|
||||
// ChatManager.chatSystemInfo(pc, smsg);
|
||||
// }
|
||||
}
|
||||
modAmount = calculateDamage(source, min, max, awo, trains);
|
||||
PlayerBonuses bonus = source.getBonuses();
|
||||
if (pc.isPlayerGuard())
|
||||
intt = 200;
|
||||
float spi = (pc.getStatSpiCurrent() >= 1) ? (float) pc.getStatSpiCurrent() : 1f;
|
||||
|
||||
// Apply any power effect modifiers (such as stances)
|
||||
if (bonus != null)
|
||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
||||
}
|
||||
if (modAmount == 0f)
|
||||
return;
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
if (pc.isPlayerGuard())
|
||||
spi = 200;
|
||||
// min *= (intt * 0.0045 + 0.055 * (float)Math.sqrt(intt - 0.5) + spi * 0.006 + 0.07 * (float)Math.sqrt(spi - 0.5) + 0.02 * (int)focus);
|
||||
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
|
||||
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
||||
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
||||
|
||||
if (!ac.isAlive())
|
||||
return;
|
||||
//debug for spell damage and atr
|
||||
// if (pc.getDebug(16)) {
|
||||
// String smsg = "Damage: " + (int)Math.abs(min) + " - " + (int)Math.abs(max);
|
||||
// ChatManager.chatSystemInfo(pc, smsg);
|
||||
// }
|
||||
}
|
||||
modAmount = calculateDamage(source, min, max, awo, trains);
|
||||
PlayerBonuses bonus = source.getBonuses();
|
||||
|
||||
int powerID = 0, effectID = 0;
|
||||
String powerName = "";
|
||||
if (effect.getPower() != null) {
|
||||
powerID = effect.getPower().getToken();
|
||||
powerName = effect.getPower().getName();
|
||||
} else {
|
||||
Logger.error("Power has returned null! Damage will fail to register! (" + (ac.getCurrentHitpoints()>0?"Alive)":"Dead)"));
|
||||
}
|
||||
// Apply any power effect modifiers (such as stances)
|
||||
if (bonus != null)
|
||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
||||
}
|
||||
if (modAmount == 0f)
|
||||
return;
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
|
||||
if (effect.getEffect() != null) {
|
||||
effectID = effect.getEffect().getToken();
|
||||
} else {
|
||||
Logger.error("Effect has returned null! Damage will fail to register! (" + (ac.getCurrentHitpoints()>0?"Alive)":"Dead)"));
|
||||
}
|
||||
if (!ac.isAlive())
|
||||
return;
|
||||
|
||||
//see if target is immune to heals
|
||||
if (modAmount > 0f) {
|
||||
boolean skipImmune = false;
|
||||
// first tick of HoT going thru SM was removed in a later patch
|
||||
int powerID = 0, effectID = 0;
|
||||
String powerName = "";
|
||||
if (effect.getPower() != null) {
|
||||
powerID = effect.getPower().getToken();
|
||||
powerName = effect.getPower().getName();
|
||||
} else {
|
||||
Logger.error("Power has returned null! Damage will fail to register! (" + (ac.getCurrentHitpoints() > 0 ? "Alive)" : "Dead)"));
|
||||
}
|
||||
|
||||
if (effect.getEffect() != null) {
|
||||
effectID = effect.getEffect().getToken();
|
||||
} else {
|
||||
Logger.error("Effect has returned null! Damage will fail to register! (" + (ac.getCurrentHitpoints() > 0 ? "Alive)" : "Dead)"));
|
||||
}
|
||||
|
||||
//see if target is immune to heals
|
||||
if (modAmount > 0f) {
|
||||
boolean skipImmune = false;
|
||||
// first tick of HoT going thru SM was removed in a later patch
|
||||
/*if (effect.getAction().getPowerAction() instanceof DirectDamagePowerAction) {
|
||||
ArrayList<ActionsBase> actions = effect.getPower().getActions();
|
||||
for (ActionsBase ab : actions) {
|
||||
@@ -194,138 +204,131 @@ public class HealthEffectModifier extends AbstractEffectModifier {
|
||||
}
|
||||
}*/
|
||||
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
mhm.setUnknown03(5); //set target is immune
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
return;
|
||||
}
|
||||
}
|
||||
float mod = 0;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
mhm.setUnknown03(5); //set target is immune
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
return;
|
||||
}
|
||||
}
|
||||
float mod = 0;
|
||||
|
||||
//Modify health
|
||||
//Modify health
|
||||
|
||||
mod = ac.modifyHealth(modAmount, source, false);
|
||||
mod = ac.modifyHealth(modAmount, source, false);
|
||||
|
||||
float cur = awo.getCurrentHitpoints();
|
||||
float maxAmount = awo.getHealthMax() - cur;
|
||||
float cur = awo.getCurrentHitpoints();
|
||||
float maxAmount = awo.getHealthMax() - cur;
|
||||
|
||||
AbstractNetMsg mhm = null;
|
||||
if (modAmount < 0 && cur < 0 && mod != 0)
|
||||
mhm = new ModifyHealthKillMsg(source, ac, modAmount, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
else
|
||||
mhm = new ModifyHealthMsg(source, ac, modAmount, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
AbstractNetMsg mhm = null;
|
||||
if (modAmount < 0 && cur < 0 && mod != 0)
|
||||
mhm = new ModifyHealthKillMsg(source, ac, modAmount, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
else
|
||||
mhm = new ModifyHealthMsg(source, ac, modAmount, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
|
||||
if (effect instanceof DamageOverTimeJob) {
|
||||
if (mhm instanceof ModifyHealthMsg)
|
||||
((ModifyHealthMsg)mhm).setOmitFromChat(1);
|
||||
else if (mhm instanceof ModifyHealthKillMsg)
|
||||
((ModifyHealthKillMsg)mhm).setUnknown02(1);
|
||||
}
|
||||
if (effect instanceof DamageOverTimeJob) {
|
||||
if (mhm instanceof ModifyHealthMsg)
|
||||
((ModifyHealthMsg) mhm).setOmitFromChat(1);
|
||||
else if (mhm instanceof ModifyHealthKillMsg)
|
||||
((ModifyHealthKillMsg) mhm).setUnknown02(1);
|
||||
}
|
||||
|
||||
//send the damage
|
||||
//send the damage
|
||||
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
|
||||
// //send corpse if this kills a mob
|
||||
// //TODO fix the someone misses blurb.
|
||||
// if(awo instanceof Mob && awo.getHealth() <= 0) {
|
||||
// CombatMessageMsg cmm = new CombatMessageMsg(null, 0, awo, 15);
|
||||
// try {
|
||||
// DispatchMessage.sendToAllInRange(ac, cmm);
|
||||
// } catch (MsgSendException e) {
|
||||
// Logger.error("MobCorpseSendError", e);
|
||||
// }
|
||||
// }
|
||||
} else if (awo.getObjectType().equals(GameObjectType.Building)) {
|
||||
// //send corpse if this kills a mob
|
||||
// //TODO fix the someone misses blurb.
|
||||
// if(awo instanceof Mob && awo.getHealth() <= 0) {
|
||||
// CombatMessageMsg cmm = new CombatMessageMsg(null, 0, awo, 15);
|
||||
// try {
|
||||
// DispatchMessage.sendToAllInRange(ac, cmm);
|
||||
// } catch (MsgSendException e) {
|
||||
// Logger.error("MobCorpseSendError", e);
|
||||
// }
|
||||
// }
|
||||
} else if (awo.getObjectType().equals(GameObjectType.Building)) {
|
||||
|
||||
Building b = (Building) awo;
|
||||
Building b = (Building) awo;
|
||||
|
||||
if (modAmount < 0 && (!b.isVulnerable()))
|
||||
return; //can't damage invul building
|
||||
if (modAmount < 0 && (!b.isVulnerable()))
|
||||
return; //can't damage invul building
|
||||
|
||||
int powerID = 0, effectID = 0;
|
||||
String powerName = "";
|
||||
if (effect.getPower() != null) {
|
||||
powerID = effect.getPower().getToken();
|
||||
powerName = effect.getPower().getName();
|
||||
} else
|
||||
Logger.error("Power has returned null! Damage will fail to register! (" + (b.getRank() == -1 ? "Standing)" : "Destroyed)"));
|
||||
int powerID = 0, effectID = 0;
|
||||
String powerName = "";
|
||||
if (effect.getPower() != null) {
|
||||
powerID = effect.getPower().getToken();
|
||||
powerName = effect.getPower().getName();
|
||||
} else
|
||||
Logger.error("Power has returned null! Damage will fail to register! (" + (b.getRank() == -1 ? "Standing)" : "Destroyed)"));
|
||||
|
||||
if (effect.getEffect() != null) {
|
||||
effectID = effect.getEffect().getToken();
|
||||
} else
|
||||
Logger.error("Effect has returned null! Damage will fail to register! (" + (b.getRank() == -1 ? "Standing)" : "Destroyed)"));
|
||||
if (effect.getEffect() != null) {
|
||||
effectID = effect.getEffect().getToken();
|
||||
} else
|
||||
Logger.error("Effect has returned null! Damage will fail to register! (" + (b.getRank() == -1 ? "Standing)" : "Destroyed)"));
|
||||
|
||||
float mod = b.modifyHealth(modAmount, source);
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, b, modAmount, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
float mod = b.modifyHealth(modAmount, source);
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, b, modAmount, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
|
||||
if (effect instanceof DamageOverTimeJob)
|
||||
mhm.setOmitFromChat(1);
|
||||
if (effect instanceof DamageOverTimeJob)
|
||||
mhm.setOmitFromChat(1);
|
||||
|
||||
//send the damage
|
||||
//send the damage
|
||||
|
||||
DispatchMessage.sendToAllInRange(b, mhm);
|
||||
DispatchMessage.sendToAllInRange(b, mhm);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private float calculateDamage(AbstractCharacter source, float minDamage, float maxDamage, AbstractWorldObject awo, int trains) {
|
||||
private float calculateDamage(AbstractCharacter source, float minDamage, float maxDamage, AbstractWorldObject awo, int trains) {
|
||||
|
||||
// get range between min and max
|
||||
float range = maxDamage - minDamage;
|
||||
// get range between min and max
|
||||
float range = maxDamage - minDamage;
|
||||
|
||||
// Damage is calculated twice to average a more central point
|
||||
float damage = ThreadLocalRandom.current().nextFloat() * range;
|
||||
damage = (damage + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
||||
// Damage is calculated twice to average a more central point
|
||||
float damage = ThreadLocalRandom.current().nextFloat() * range;
|
||||
damage = (damage + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
||||
|
||||
// put it back between min and max
|
||||
damage += minDamage;
|
||||
// put it back between min and max
|
||||
damage += minDamage;
|
||||
|
||||
Resists resists = null;
|
||||
// get resists
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
resists = ac.getResists();
|
||||
} else if (awo.getObjectType().equals(GameObjectType.Building))
|
||||
resists = ((Building) awo).getResists();
|
||||
Resists resists = null;
|
||||
// get resists
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
resists = ac.getResists();
|
||||
} else if (awo.getObjectType().equals(GameObjectType.Building))
|
||||
resists = ((Building) awo).getResists();
|
||||
|
||||
// calculate resists in if any
|
||||
if (resists != null) {
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
damage = resists.getResistedDamage(source, (AbstractCharacter) awo, damageType, damage * -1, trains) * -1;
|
||||
else
|
||||
damage = resists.getResistedDamage(source, null, damageType, damage * -1, trains) * -1;
|
||||
}
|
||||
// calculate resists in if any
|
||||
if (resists != null) {
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
damage = resists.getResistedDamage(source, (AbstractCharacter) awo, damageType, damage * -1, trains) * -1;
|
||||
else
|
||||
damage = resists.getResistedDamage(source, null, damageType, damage * -1, trains) * -1;
|
||||
}
|
||||
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
if (ac.isSit())
|
||||
damage *= 2.5f; // increase damage if sitting
|
||||
}
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
if (ac.isSit())
|
||||
damage *= 2.5f; // increase damage if sitting
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
public static float getMinDamage(float baseMin, float intelligence, float spirit, float focus) {
|
||||
float min = baseMin * (((float)Math.pow(intelligence, 0.75f) * 0.0311f) + (0.02f * (int)focus) + ((float)Math.pow(spirit, 0.75f) * 0.0416f));
|
||||
return (float)((int)(min + 0.5f)); //round to nearest whole number
|
||||
}
|
||||
|
||||
public static float getMaxDamage(float baseMax, float intelligence, float spirit, float focus) {
|
||||
float max = baseMax * (((float)Math.pow(intelligence, 0.75f) * 0.0785f) + (0.015f * (int)focus) + ((float)Math.pow(spirit, 0.75f) * 0.0157f));
|
||||
return (float)((int)(max + 0.5f)); //round to nearest whole number
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class HealthFullEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public HealthFullEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public HealthFullEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,31 +17,34 @@ import java.sql.SQLException;
|
||||
|
||||
public class HealthRecoverRateEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public HealthRecoverRateEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public HealthRecoverRateEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
ac.update();
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.multRegen(this.modType, amount); //positive regen modifiers
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
ac.update();
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.multRegen(this.modType, amount); //positive regen modifiers
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,29 +18,32 @@ import java.util.HashSet;
|
||||
|
||||
public class IgnoreDamageCapEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public IgnoreDamageCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public IgnoreDamageCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus == null)
|
||||
return;
|
||||
|
||||
if (bonus.getList(this.modType) == null)
|
||||
bonus.setList(this.modType, new HashSet<>());
|
||||
bonus.getList(this.modType).add(this.sourceType);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus == null)
|
||||
return;
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
if (bonus.getList(this.modType) == null)
|
||||
bonus.setList(this.modType, new HashSet<>());
|
||||
bonus.getList(this.modType).add(this.sourceType);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,23 +17,26 @@ import java.sql.SQLException;
|
||||
|
||||
public class IgnorePassiveDefenseEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public IgnorePassiveDefenseEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public IgnorePassiveDefenseEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType,true);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,24 +17,27 @@ import java.sql.SQLException;
|
||||
|
||||
public class ImmuneToAttackEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ImmuneToAttackEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ImmuneToAttackEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType,true);
|
||||
}
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,23 +17,26 @@ import java.sql.SQLException;
|
||||
|
||||
public class ImmuneToEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ImmuneToEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ImmuneToEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType,true);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,24 +17,27 @@ import java.sql.SQLException;
|
||||
|
||||
public class ImmuneToPowersEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ImmuneToPowersEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ImmuneToPowersEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType,true);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,60 +23,62 @@ import java.sql.SQLException;
|
||||
|
||||
public class InvisibleEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public InvisibleEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public InvisibleEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
if (awo.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) awo;
|
||||
if (awo.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) awo;
|
||||
|
||||
if (effect == null)
|
||||
return;
|
||||
if (effect == null)
|
||||
return;
|
||||
|
||||
PowersBase pb = effect.getPower();
|
||||
if (pb == null)
|
||||
return;
|
||||
PowersBase pb = effect.getPower();
|
||||
if (pb == null)
|
||||
return;
|
||||
|
||||
ActionsBase ab = effect.getAction();
|
||||
ActionsBase ab = effect.getAction();
|
||||
|
||||
if (ab == null)
|
||||
return;
|
||||
if (ab == null)
|
||||
return;
|
||||
|
||||
//send invis message to everyone around.
|
||||
ClientConnection origin = SessionManager.getClientConnection(pc);
|
||||
if (origin == null)
|
||||
return;
|
||||
//send invis message to everyone around.
|
||||
ClientConnection origin = SessionManager.getClientConnection(pc);
|
||||
if (origin == null)
|
||||
return;
|
||||
|
||||
ab.getDurationInSeconds(trains);
|
||||
ab.getDurationInSeconds(trains);
|
||||
|
||||
pc.setHidden(trains);
|
||||
pc.setHidden(trains);
|
||||
|
||||
pc.setTimeStampNow("Invis");
|
||||
pc.setTimeStampNow("Invis");
|
||||
|
||||
}
|
||||
else {
|
||||
Logger.error( "Cannot go invis on a non player.");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Logger.error("Cannot go invis on a non player.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
if (ac == null)
|
||||
return;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus != null)
|
||||
bonus.updateIfHigher(this, (float)trains);
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
if (ac == null)
|
||||
return;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus != null)
|
||||
bonus.updateIfHigher(this, (float) trains);
|
||||
|
||||
//remove pets
|
||||
if (ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
|
||||
((PlayerCharacter)ac).dismissPet();
|
||||
}
|
||||
//remove pets
|
||||
if (ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
|
||||
((PlayerCharacter) ac).dismissPet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,83 +21,126 @@ import java.sql.SQLException;
|
||||
|
||||
public class ItemNameEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public String name = "";
|
||||
public String name = "";
|
||||
|
||||
public ItemNameEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
public ItemNameEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
|
||||
//We're going to add effect names to a lookup map for ./makeitem
|
||||
int ID = rs.getInt("ID");
|
||||
switch (ID) { //don't add these ID's to the name list. They're duplicates
|
||||
case 4259: return;
|
||||
case 4210: return;
|
||||
case 4: return;
|
||||
case 97: return;
|
||||
case 610: return;
|
||||
case 4442: return;
|
||||
case 5106: return;
|
||||
case 4637: return;
|
||||
case 2271: return;
|
||||
case 587: return;
|
||||
case 600: return;
|
||||
case 3191: return;
|
||||
case 3589: return;
|
||||
case 3950: return;
|
||||
case 3499: return;
|
||||
case 4925: return;
|
||||
case 15: return;
|
||||
case 5101: return;
|
||||
case 2418: return;
|
||||
case 183: return;
|
||||
case 373: return;
|
||||
case 1893: return;
|
||||
case 3127: return;
|
||||
case 1232: return;
|
||||
case 4522: return;
|
||||
case 4817: return;
|
||||
case 2833: return;
|
||||
case 4469: return;
|
||||
case 2122: return;
|
||||
case 3057: return;
|
||||
case 3070: return;
|
||||
case 191: return;
|
||||
case 3117: return;
|
||||
case 3702: return;
|
||||
case 1619: return;
|
||||
case 2584: return;
|
||||
case 414: return;
|
||||
case 2078: return;
|
||||
case 4844: return;
|
||||
case 2275: return;
|
||||
}
|
||||
//We're going to add effect names to a lookup map for ./makeitem
|
||||
int ID = rs.getInt("ID");
|
||||
switch (ID) { //don't add these ID's to the name list. They're duplicates
|
||||
case 4259:
|
||||
return;
|
||||
case 4210:
|
||||
return;
|
||||
case 4:
|
||||
return;
|
||||
case 97:
|
||||
return;
|
||||
case 610:
|
||||
return;
|
||||
case 4442:
|
||||
return;
|
||||
case 5106:
|
||||
return;
|
||||
case 4637:
|
||||
return;
|
||||
case 2271:
|
||||
return;
|
||||
case 587:
|
||||
return;
|
||||
case 600:
|
||||
return;
|
||||
case 3191:
|
||||
return;
|
||||
case 3589:
|
||||
return;
|
||||
case 3950:
|
||||
return;
|
||||
case 3499:
|
||||
return;
|
||||
case 4925:
|
||||
return;
|
||||
case 15:
|
||||
return;
|
||||
case 5101:
|
||||
return;
|
||||
case 2418:
|
||||
return;
|
||||
case 183:
|
||||
return;
|
||||
case 373:
|
||||
return;
|
||||
case 1893:
|
||||
return;
|
||||
case 3127:
|
||||
return;
|
||||
case 1232:
|
||||
return;
|
||||
case 4522:
|
||||
return;
|
||||
case 4817:
|
||||
return;
|
||||
case 2833:
|
||||
return;
|
||||
case 4469:
|
||||
return;
|
||||
case 2122:
|
||||
return;
|
||||
case 3057:
|
||||
return;
|
||||
case 3070:
|
||||
return;
|
||||
case 191:
|
||||
return;
|
||||
case 3117:
|
||||
return;
|
||||
case 3702:
|
||||
return;
|
||||
case 1619:
|
||||
return;
|
||||
case 2584:
|
||||
return;
|
||||
case 414:
|
||||
return;
|
||||
case 2078:
|
||||
return;
|
||||
case 4844:
|
||||
return;
|
||||
case 2275:
|
||||
return;
|
||||
}
|
||||
|
||||
String namePre = rs.getString("string1");
|
||||
String nameSuf = rs.getString("string2");
|
||||
String n = (namePre.isEmpty()) ? nameSuf : namePre;
|
||||
this.name = n;
|
||||
n = n.toLowerCase();
|
||||
n = n.replace(" ", "_");
|
||||
String IDString = rs.getString("IDString");
|
||||
IDString = IDString.substring(0, IDString.length() - 1);
|
||||
EffectsBase.addItemEffectsByName(n, IDString);
|
||||
}
|
||||
String namePre = rs.getString("string1");
|
||||
String nameSuf = rs.getString("string2");
|
||||
String n = (namePre.isEmpty()) ? nameSuf : namePre;
|
||||
this.name = n;
|
||||
n = n.toLowerCase();
|
||||
n = n.replace(" ", "_");
|
||||
String IDString = rs.getString("IDString");
|
||||
IDString = IDString.substring(0, IDString.length() - 1);
|
||||
EffectsBase.addItemEffectsByName(n, IDString);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
@@ -44,189 +41,192 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class ManaEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
private DamageType damageType;
|
||||
private DamageType damageType;
|
||||
|
||||
public ManaEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
String damageTypeDB = rs.getString("type");
|
||||
try {
|
||||
this.damageType = DamageType.valueOf(damageTypeDB);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
||||
+ " value received = '" + damageTypeDB + '\'', e);
|
||||
}
|
||||
}
|
||||
public ManaEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
String damageTypeDB = rs.getString("type");
|
||||
try {
|
||||
this.damageType = DamageType.valueOf(damageTypeDB);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
||||
+ " value received = '" + damageTypeDB + '\'', e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
if (awo == null) {
|
||||
Logger.error( "_applyEffectModifier(): NULL AWO passed in.");
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
if (awo == null) {
|
||||
Logger.error("_applyEffectModifier(): NULL AWO passed in.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (effect == null) {
|
||||
Logger.error( "_applyEffectModifier(): NULL AbstractEffectJob passed in.");
|
||||
return;
|
||||
}
|
||||
if (effect == null) {
|
||||
Logger.error("_applyEffectModifier(): NULL AbstractEffectJob passed in.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
return;
|
||||
AbstractCharacter awoac = (AbstractCharacter) awo;
|
||||
if (!AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
return;
|
||||
AbstractCharacter awoac = (AbstractCharacter) awo;
|
||||
|
||||
float modAmount = 0f;
|
||||
float modAmount = 0f;
|
||||
|
||||
// Modify Mana by percent
|
||||
if (this.percentMod != 0f) {
|
||||
// Modify Mana by percent
|
||||
if (this.percentMod != 0f) {
|
||||
|
||||
float mod = 1f;
|
||||
if (this.useRampAdd)
|
||||
mod = (this.percentMod + (this.ramp * trains)) / 100;
|
||||
else
|
||||
mod = (this.percentMod * (1 + (this.ramp * trains))) / 100;
|
||||
modAmount = mod * awoac.getManaMax();
|
||||
float mod = 1f;
|
||||
if (this.useRampAdd)
|
||||
mod = (this.percentMod + (this.ramp * trains)) / 100;
|
||||
else
|
||||
mod = (this.percentMod * (1 + (this.ramp * trains))) / 100;
|
||||
modAmount = mod * awoac.getManaMax();
|
||||
|
||||
if (awoac.isSit())
|
||||
modAmount *= 2.5f;
|
||||
if (awoac.isSit())
|
||||
modAmount *= 2.5f;
|
||||
|
||||
//debug for spell damage and atr
|
||||
if (source.getDebug(16) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
//debug for spell damage and atr
|
||||
if (source.getDebug(16) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
String smsg = "Percent Damage: " + mod * 100 + '%';
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
String smsg = "Percent Damage: " + mod * 100 + '%';
|
||||
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
|
||||
// Modify health by min/max amount
|
||||
else if (this.minMod != 0f || this.maxMod != 0f) {
|
||||
float min = this.minMod;
|
||||
float max = this.maxMod;
|
||||
if (this.ramp > 0f) {
|
||||
float mod = this.ramp * trains;
|
||||
if (this.useRampAdd) {
|
||||
min += mod;
|
||||
max += mod;
|
||||
} else {
|
||||
min *= (1 + mod);
|
||||
max *= (1 + mod);
|
||||
}
|
||||
}
|
||||
if (source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
// Modify health by min/max amount
|
||||
else if (this.minMod != 0f || this.maxMod != 0f) {
|
||||
float min = this.minMod;
|
||||
float max = this.maxMod;
|
||||
if (this.ramp > 0f) {
|
||||
float mod = this.ramp * trains;
|
||||
if (this.useRampAdd) {
|
||||
min += mod;
|
||||
max += mod;
|
||||
} else {
|
||||
min *= (1 + mod);
|
||||
max *= (1 + mod);
|
||||
}
|
||||
}
|
||||
if (source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
|
||||
float focus;
|
||||
CharacterSkill skill = pc.getSkills().get(effect.getPower().getSkillName());
|
||||
if (skill == null)
|
||||
focus = CharacterSkill.getQuickMastery(pc, effect.getPower().getSkillName());
|
||||
else
|
||||
focus = skill.getModifiedAmount();
|
||||
//TODO clean up old formulas once new one is verified
|
||||
// min *= (0.5 + 0.0075 * pc.getStatIntCurrent() + 0.011 * pc.getStatSpiCurrent() + 0.0196 * focus);
|
||||
// max *= (0.62 + 0.0192 * pc.getStatIntCurrent() + 0.00415 * pc.getStatSpiCurrent() + 0.015 * focus);
|
||||
float intt = (pc.getStatIntCurrent() >= 1) ? (float)pc.getStatIntCurrent() : 1f;
|
||||
float spi = (pc.getStatSpiCurrent() >= 1) ? (float)pc.getStatSpiCurrent() : 1f;
|
||||
// min *= (intt * 0.0045 + 0.055 * (float)Math.sqrt(intt - 0.5) + spi * 0.006 + 0.07 * (float)Math.sqrt(spi - 0.5) + 0.02 * (int)focus);
|
||||
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
|
||||
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
||||
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
||||
float focus;
|
||||
CharacterSkill skill = pc.getSkills().get(effect.getPower().getSkillName());
|
||||
if (skill == null)
|
||||
focus = CharacterSkill.getQuickMastery(pc, effect.getPower().getSkillName());
|
||||
else
|
||||
focus = skill.getModifiedAmount();
|
||||
//TODO clean up old formulas once new one is verified
|
||||
// min *= (0.5 + 0.0075 * pc.getStatIntCurrent() + 0.011 * pc.getStatSpiCurrent() + 0.0196 * focus);
|
||||
// max *= (0.62 + 0.0192 * pc.getStatIntCurrent() + 0.00415 * pc.getStatSpiCurrent() + 0.015 * focus);
|
||||
float intt = (pc.getStatIntCurrent() >= 1) ? (float) pc.getStatIntCurrent() : 1f;
|
||||
float spi = (pc.getStatSpiCurrent() >= 1) ? (float) pc.getStatSpiCurrent() : 1f;
|
||||
// min *= (intt * 0.0045 + 0.055 * (float)Math.sqrt(intt - 0.5) + spi * 0.006 + 0.07 * (float)Math.sqrt(spi - 0.5) + 0.02 * (int)focus);
|
||||
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
|
||||
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
||||
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
||||
|
||||
//debug for spell damage and atr
|
||||
if (pc.getDebug(16)) {
|
||||
String smsg = "Damage: " + (int)Math.abs(min) + " - " + (int)Math.abs(max);
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
modAmount = calculateDamage(source, awoac, min, max, awo, trains);
|
||||
PlayerBonuses bonus = source.getBonuses();
|
||||
//debug for spell damage and atr
|
||||
if (pc.getDebug(16)) {
|
||||
String smsg = "Damage: " + (int) Math.abs(min) + " - " + (int) Math.abs(max);
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
modAmount = calculateDamage(source, awoac, min, max, awo, trains);
|
||||
PlayerBonuses bonus = source.getBonuses();
|
||||
|
||||
// Apply any power effect modifiers (such as stances)
|
||||
if (bonus != null)
|
||||
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
|
||||
}
|
||||
if (modAmount == 0f)
|
||||
return;
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
int powerID = 0, effectID = 0;
|
||||
String powerName = "";
|
||||
if (effect.getPower() != null) {
|
||||
powerID = effect.getPower().getToken();
|
||||
powerName = effect.getPower().getName();
|
||||
}
|
||||
if (effect.getEffect() != null) {
|
||||
effectID = effect.getEffect().getToken();
|
||||
}
|
||||
// Apply any power effect modifiers (such as stances)
|
||||
if (bonus != null)
|
||||
modAmount *= (1 + bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None));
|
||||
}
|
||||
if (modAmount == 0f)
|
||||
return;
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
int powerID = 0, effectID = 0;
|
||||
String powerName = "";
|
||||
if (effect.getPower() != null) {
|
||||
powerID = effect.getPower().getToken();
|
||||
powerName = effect.getPower().getName();
|
||||
}
|
||||
if (effect.getEffect() != null) {
|
||||
effectID = effect.getEffect().getToken();
|
||||
}
|
||||
|
||||
//see if target is immune to heals
|
||||
if (modAmount > 0f) {
|
||||
boolean skipImmune = false;
|
||||
if (effect.getAction().getPowerAction() instanceof DirectDamagePowerAction) {
|
||||
ArrayList<ActionsBase> actions = effect.getPower().getActions();
|
||||
for (ActionsBase ab : actions) {
|
||||
AbstractPowerAction apa = ab.getPowerAction();
|
||||
if (apa instanceof DamageOverTimePowerAction)
|
||||
skipImmune = true;
|
||||
}
|
||||
}
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
mhm.setUnknown03(5); //set target is immune
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//see if target is immune to heals
|
||||
if (modAmount > 0f) {
|
||||
boolean skipImmune = false;
|
||||
if (effect.getAction().getPowerAction() instanceof DirectDamagePowerAction) {
|
||||
ArrayList<ActionsBase> actions = effect.getPower().getActions();
|
||||
for (ActionsBase ab : actions) {
|
||||
AbstractPowerAction apa = ab.getPowerAction();
|
||||
if (apa instanceof DamageOverTimePowerAction)
|
||||
skipImmune = true;
|
||||
}
|
||||
}
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
mhm.setUnknown03(5); //set target is immune
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ac.modifyMana(modAmount, source);
|
||||
ac.modifyMana(modAmount, source);
|
||||
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, modAmount, 0f, powerID, powerName, trains,
|
||||
effectID);
|
||||
if (effect instanceof DamageOverTimeJob)
|
||||
mhm.setOmitFromChat(1);
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
}
|
||||
}
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, modAmount, 0f, powerID, powerName, trains,
|
||||
effectID);
|
||||
if (effect instanceof DamageOverTimeJob)
|
||||
mhm.setOmitFromChat(1);
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
}
|
||||
}
|
||||
|
||||
private float calculateDamage(AbstractCharacter source, AbstractCharacter target, float minDamage, float maxDamage, AbstractWorldObject awo, int trains) {
|
||||
// get range between min and max
|
||||
float range = maxDamage - minDamage;
|
||||
private float calculateDamage(AbstractCharacter source, AbstractCharacter target, float minDamage, float maxDamage, AbstractWorldObject awo, int trains) {
|
||||
// get range between min and max
|
||||
float range = maxDamage - minDamage;
|
||||
|
||||
// Damage is calculated twice to average a more central point
|
||||
float damage = ThreadLocalRandom.current().nextFloat() * range;
|
||||
damage = (damage + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
||||
// Damage is calculated twice to average a more central point
|
||||
float damage = ThreadLocalRandom.current().nextFloat() * range;
|
||||
damage = (damage + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
||||
|
||||
// put it back between min and max
|
||||
damage += minDamage;
|
||||
// put it back between min and max
|
||||
damage += minDamage;
|
||||
|
||||
Resists resists = null;
|
||||
// get resists
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
resists = ac.getResists();
|
||||
} else if (awo.getObjectType().equals(Enum.GameObjectType.Building))
|
||||
resists = ((Building) awo).getResists();
|
||||
Resists resists = null;
|
||||
// get resists
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
resists = ac.getResists();
|
||||
} else if (awo.getObjectType().equals(Enum.GameObjectType.Building))
|
||||
resists = ((Building) awo).getResists();
|
||||
|
||||
// calculate resists in if any
|
||||
if (resists != null)
|
||||
damage = resists.getResistedDamage(source, target, damageType, damage * -1, trains) * -1;
|
||||
// calculate resists in if any
|
||||
if (resists != null)
|
||||
damage = resists.getResistedDamage(source, target, damageType, damage * -1, trains) * -1;
|
||||
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
if (ac.isSit())
|
||||
damage *= 2.5f; // increase damage if sitting
|
||||
}
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
if (ac.isSit())
|
||||
damage *= 2.5f; // increase damage if sitting
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class ManaFullEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ManaFullEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ManaFullEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,29 +17,32 @@ import java.sql.SQLException;
|
||||
|
||||
public class ManaRecoverRateEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ManaRecoverRateEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ManaRecoverRateEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.multRegen(this.modType, amount); //positive regen modifiers
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.multRegen(this.modType, amount); //positive regen modifiers
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,42 +20,44 @@ import java.sql.SQLException;
|
||||
|
||||
public class MaxDamageEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public MaxDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public MaxDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
if (item == null)
|
||||
return;
|
||||
String key; float amount = 0f;
|
||||
if (this.percentMod != 0f) {
|
||||
if (this.useRampAdd)
|
||||
amount = (this.percentMod + (this.ramp * trains)) / 100f;
|
||||
else
|
||||
amount = (this.percentMod * (1 + (this.ramp * trains))) / 100f;
|
||||
amount = amount/100;
|
||||
key = "max.percent";
|
||||
} else {
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
key = "max";
|
||||
}
|
||||
item.addBonus(this, amount);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
if (item == null)
|
||||
return;
|
||||
String key;
|
||||
float amount = 0f;
|
||||
if (this.percentMod != 0f) {
|
||||
if (this.useRampAdd)
|
||||
amount = (this.percentMod + (this.ramp * trains)) / 100f;
|
||||
else
|
||||
amount = (this.percentMod * (1 + (this.ramp * trains))) / 100f;
|
||||
amount = amount / 100;
|
||||
key = "max.percent";
|
||||
} else {
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
key = "max";
|
||||
}
|
||||
item.addBonus(this, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class MeleeDamageEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public MeleeDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public MeleeDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,42 +20,44 @@ import java.sql.SQLException;
|
||||
|
||||
public class MinDamageEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public MinDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public MinDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
if (item == null)
|
||||
return;
|
||||
String key; float amount = 0f;
|
||||
if (this.percentMod != 0f) {
|
||||
if (this.useRampAdd)
|
||||
amount = (this.percentMod + (this.ramp * trains)) / 100f;
|
||||
else
|
||||
amount = (this.percentMod * (1 + (this.ramp * trains))) / 100f;
|
||||
amount = amount/100;
|
||||
key = "min.percent";
|
||||
} else {
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
key = "min";
|
||||
}
|
||||
item.addBonus(this, amount);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
if (item == null)
|
||||
return;
|
||||
String key;
|
||||
float amount = 0f;
|
||||
if (this.percentMod != 0f) {
|
||||
if (this.useRampAdd)
|
||||
amount = (this.percentMod + (this.ramp * trains)) / 100f;
|
||||
else
|
||||
amount = (this.percentMod * (1 + (this.ramp * trains))) / 100f;
|
||||
amount = amount / 100;
|
||||
key = "min.percent";
|
||||
} else {
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
key = "min";
|
||||
}
|
||||
item.addBonus(this, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,36 +18,39 @@ import java.sql.SQLException;
|
||||
|
||||
public class NoModEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public NoModEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public NoModEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
//TODO check if anything needs removed.
|
||||
}
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
//TODO check if anything needs removed.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType,true);
|
||||
|
||||
switch (this.sourceType){
|
||||
case Fly:
|
||||
if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||
return;
|
||||
PlayerCharacter flyer = (PlayerCharacter)ac;
|
||||
|
||||
if (flyer.getAltitude() > 0)
|
||||
flyer.update();
|
||||
PlayerCharacter.GroundPlayer(flyer);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
switch (this.sourceType) {
|
||||
case Fly:
|
||||
if (!ac.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||
return;
|
||||
PlayerCharacter flyer = (PlayerCharacter) ac;
|
||||
|
||||
if (flyer.getAltitude() > 0)
|
||||
flyer.update();
|
||||
PlayerCharacter.GroundPlayer(flyer);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class OCVEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public OCVEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public OCVEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class ParryEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ParryEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ParryEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class PassiveDefenseEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public PassiveDefenseEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public PassiveDefenseEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class PowerCostEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public PowerCostEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public PowerCostEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,25 @@ import java.sql.SQLException;
|
||||
|
||||
public class PowerCostHealthEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public PowerCostHealthEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public PowerCostHealthEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class PowerDamageEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public PowerDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public PowerDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,26 +17,29 @@ import java.sql.SQLException;
|
||||
|
||||
public class ProtectionFromEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ProtectionFromEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ProtectionFromEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus == null)
|
||||
return;
|
||||
bonus.setFloat(this, trains);
|
||||
// bonus.setBool(this, true);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus == null)
|
||||
return;
|
||||
bonus.setFloat(this, trains);
|
||||
// bonus.setBool(this, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class ResistanceEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ResistanceEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ResistanceEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,25 @@ import java.sql.SQLException;
|
||||
|
||||
public class ScaleHeightEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ScaleHeightEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ScaleHeightEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,25 @@ import java.sql.SQLException;
|
||||
|
||||
public class ScaleWidthEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ScaleWidthEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ScaleWidthEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class ScanRangeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ScanRangeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ScanRangeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,26 +17,29 @@ import java.sql.SQLException;
|
||||
|
||||
public class SeeInvisibleEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SeeInvisibleEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public SeeInvisibleEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
if (ac == null)
|
||||
return;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus != null)
|
||||
bonus.updateIfHigher(this, (float)trains);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
if (ac == null)
|
||||
return;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus != null)
|
||||
bonus.updateIfHigher(this, (float) trains);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,24 +17,27 @@ import java.sql.SQLException;
|
||||
|
||||
public class SilencedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SilencedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public SilencedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType, true);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class SkillEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SkillEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public SkillEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class SlayEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SlayEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public SlayEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class SpeedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SpeedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public SpeedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
//Logger.error(this.getSimpleClassName(), "Speed applied with " + trains + " trains");
|
||||
}
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
//Logger.error(this.getSimpleClassName(), "Speed applied with " + trains + " trains");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,23 +17,26 @@ import java.sql.SQLException;
|
||||
|
||||
public class SpireBlockEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SpireBlockEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public SpireBlockEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType, true);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
@@ -44,187 +41,190 @@ import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class StaminaEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
private DamageType damageType;
|
||||
private DamageType damageType;
|
||||
|
||||
public StaminaEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
String damageTypeDB = rs.getString("type");
|
||||
try {
|
||||
this.damageType = DamageType.valueOf(damageTypeDB);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
||||
+ " value received = '" + damageTypeDB + '\'', e);
|
||||
}
|
||||
}
|
||||
public StaminaEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
String damageTypeDB = rs.getString("type");
|
||||
try {
|
||||
this.damageType = DamageType.valueOf(damageTypeDB);
|
||||
} catch (IllegalArgumentException e) {
|
||||
Logger.error("DamageType could not be loaded from database. " + "UUID = " + this.UUID
|
||||
+ " value received = '" + damageTypeDB + '\'', e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
if (awo == null) {
|
||||
Logger.error( "_applyEffectModifier(): NULL AWO passed in.");
|
||||
return;
|
||||
}
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
if (awo == null) {
|
||||
Logger.error("_applyEffectModifier(): NULL AWO passed in.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (effect == null) {
|
||||
Logger.error( "_applyEffectModifier(): NULL AbstractEffectJob passed in.");
|
||||
return;
|
||||
}
|
||||
if (effect == null) {
|
||||
Logger.error("_applyEffectModifier(): NULL AbstractEffectJob passed in.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
return;
|
||||
AbstractCharacter awoac = (AbstractCharacter) awo;
|
||||
if (!AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
return;
|
||||
AbstractCharacter awoac = (AbstractCharacter) awo;
|
||||
|
||||
float modAmount = 0f;
|
||||
float modAmount = 0f;
|
||||
|
||||
// Modify Stamina by percent
|
||||
if (this.percentMod != 0f) {
|
||||
float mod = 1f;
|
||||
if (this.useRampAdd)
|
||||
mod = (this.percentMod + (this.ramp * trains)) / 100;
|
||||
else
|
||||
mod = (this.percentMod * (1 + (this.ramp * trains))) / 100;
|
||||
modAmount = mod * awoac.getStaminaMax();
|
||||
if (awoac.isSit())
|
||||
modAmount *= 2.5f;
|
||||
// Modify Stamina by percent
|
||||
if (this.percentMod != 0f) {
|
||||
float mod = 1f;
|
||||
if (this.useRampAdd)
|
||||
mod = (this.percentMod + (this.ramp * trains)) / 100;
|
||||
else
|
||||
mod = (this.percentMod * (1 + (this.ramp * trains))) / 100;
|
||||
modAmount = mod * awoac.getStaminaMax();
|
||||
if (awoac.isSit())
|
||||
modAmount *= 2.5f;
|
||||
|
||||
//debug for spell damage and atr
|
||||
if (source.getDebug(16) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
String smsg = "Percent Damage: " + mod * 100 + '%';
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
//debug for spell damage and atr
|
||||
if (source.getDebug(16) && source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
String smsg = "Percent Damage: " + mod * 100 + '%';
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
|
||||
// Modify Stamina by min/max amount
|
||||
else if (this.minMod != 0f || this.maxMod != 0f) {
|
||||
float min = this.minMod;
|
||||
float max = this.maxMod;
|
||||
if (this.ramp > 0f) {
|
||||
float mod = this.ramp * trains;
|
||||
if (this.useRampAdd) {
|
||||
min += mod;
|
||||
max += mod;
|
||||
} else {
|
||||
min *= (1 + mod);
|
||||
max *= (1 + mod);
|
||||
}
|
||||
}
|
||||
if (source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
// Modify Stamina by min/max amount
|
||||
else if (this.minMod != 0f || this.maxMod != 0f) {
|
||||
float min = this.minMod;
|
||||
float max = this.maxMod;
|
||||
if (this.ramp > 0f) {
|
||||
float mod = this.ramp * trains;
|
||||
if (this.useRampAdd) {
|
||||
min += mod;
|
||||
max += mod;
|
||||
} else {
|
||||
min *= (1 + mod);
|
||||
max *= (1 + mod);
|
||||
}
|
||||
}
|
||||
if (source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) source;
|
||||
|
||||
float focus;
|
||||
CharacterSkill skill = pc.getSkills().get(effect.getPower().getSkillName());
|
||||
if (skill == null)
|
||||
focus = CharacterSkill.getQuickMastery(pc, effect.getPower().getSkillName());
|
||||
else
|
||||
focus = skill.getModifiedAmount();
|
||||
//TODO clean up old formulas once new one is verified
|
||||
// min *= (0.5 + 0.0075 * pc.getStatIntCurrent() + 0.011 * pc.getStatSpiCurrent() + 0.0196 * focus);
|
||||
// max *= (0.62 + 0.0192 * pc.getStatIntCurrent() + 0.00415 * pc.getStatSpiCurrent() + 0.015 * focus);
|
||||
float intt = (pc.getStatIntCurrent() >= 1) ? (float)pc.getStatIntCurrent() : 1f;
|
||||
float spi = (pc.getStatSpiCurrent() >= 1) ? (float)pc.getStatSpiCurrent() : 1f;
|
||||
// min *= (intt * 0.0045 + 0.055 * (float)Math.sqrt(intt - 0.5) + spi * 0.006 + 0.07 * (float)Math.sqrt(spi - 0.5) + 0.02 * (int)focus);
|
||||
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
|
||||
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
||||
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
||||
float focus;
|
||||
CharacterSkill skill = pc.getSkills().get(effect.getPower().getSkillName());
|
||||
if (skill == null)
|
||||
focus = CharacterSkill.getQuickMastery(pc, effect.getPower().getSkillName());
|
||||
else
|
||||
focus = skill.getModifiedAmount();
|
||||
//TODO clean up old formulas once new one is verified
|
||||
// min *= (0.5 + 0.0075 * pc.getStatIntCurrent() + 0.011 * pc.getStatSpiCurrent() + 0.0196 * focus);
|
||||
// max *= (0.62 + 0.0192 * pc.getStatIntCurrent() + 0.00415 * pc.getStatSpiCurrent() + 0.015 * focus);
|
||||
float intt = (pc.getStatIntCurrent() >= 1) ? (float) pc.getStatIntCurrent() : 1f;
|
||||
float spi = (pc.getStatSpiCurrent() >= 1) ? (float) pc.getStatSpiCurrent() : 1f;
|
||||
// min *= (intt * 0.0045 + 0.055 * (float)Math.sqrt(intt - 0.5) + spi * 0.006 + 0.07 * (float)Math.sqrt(spi - 0.5) + 0.02 * (int)focus);
|
||||
// max *= (intt * 0.0117 + 0.13 * (float)Math.sqrt(intt - 0.5) + spi * 0.0024 + (float)Math.sqrt(spi - 0.5) * 0.021 + 0.015 * (int)focus);
|
||||
min = HealthEffectModifier.getMinDamage(min, intt, spi, focus);
|
||||
max = HealthEffectModifier.getMaxDamage(max, intt, spi, focus);
|
||||
|
||||
//debug for spell damage and atr
|
||||
if (pc.getDebug(16)) {
|
||||
String smsg = "Damage: " + (int)Math.abs(min) + " - " + (int)Math.abs(max);
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
modAmount = calculateDamage(source, awoac, min, max, awo, trains);
|
||||
PlayerBonuses bonus = source.getBonuses();
|
||||
//debug for spell damage and atr
|
||||
if (pc.getDebug(16)) {
|
||||
String smsg = "Damage: " + (int) Math.abs(min) + " - " + (int) Math.abs(max);
|
||||
ChatManager.chatSystemInfo(pc, smsg);
|
||||
}
|
||||
}
|
||||
modAmount = calculateDamage(source, awoac, min, max, awo, trains);
|
||||
PlayerBonuses bonus = source.getBonuses();
|
||||
|
||||
// Apply any power effect modifiers (such as stances)
|
||||
if (bonus != null)
|
||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
||||
}
|
||||
if (modAmount == 0f)
|
||||
return;
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
int powerID = 0, effectID = 0;
|
||||
String powerName = "";
|
||||
if (effect.getPower() != null) {
|
||||
powerID = effect.getPower().getToken();
|
||||
powerName = effect.getPower().getName();
|
||||
}
|
||||
if (effect.getEffect() != null) {
|
||||
effectID = effect.getEffect().getToken();
|
||||
}
|
||||
// Apply any power effect modifiers (such as stances)
|
||||
if (bonus != null)
|
||||
modAmount *= (1 + (bonus.getFloatPercentAll(ModType.PowerDamageModifier, SourceType.None)));
|
||||
}
|
||||
if (modAmount == 0f)
|
||||
return;
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
int powerID = 0, effectID = 0;
|
||||
String powerName = "";
|
||||
if (effect.getPower() != null) {
|
||||
powerID = effect.getPower().getToken();
|
||||
powerName = effect.getPower().getName();
|
||||
}
|
||||
if (effect.getEffect() != null) {
|
||||
effectID = effect.getEffect().getToken();
|
||||
}
|
||||
|
||||
//see if target is immune to heals
|
||||
if (modAmount > 0f) {
|
||||
boolean skipImmune = false;
|
||||
if (effect.getAction().getPowerAction() instanceof DirectDamagePowerAction) {
|
||||
ArrayList<ActionsBase> actions = effect.getPower().getActions();
|
||||
for (ActionsBase ab : actions) {
|
||||
AbstractPowerAction apa = ab.getPowerAction();
|
||||
if (apa instanceof DamageOverTimePowerAction)
|
||||
skipImmune = true;
|
||||
}
|
||||
}
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
mhm.setUnknown03(5); //set target is immune
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
//see if target is immune to heals
|
||||
if (modAmount > 0f) {
|
||||
boolean skipImmune = false;
|
||||
if (effect.getAction().getPowerAction() instanceof DirectDamagePowerAction) {
|
||||
ArrayList<ActionsBase> actions = effect.getPower().getActions();
|
||||
for (ActionsBase ab : actions) {
|
||||
AbstractPowerAction apa = ab.getPowerAction();
|
||||
if (apa instanceof DamageOverTimePowerAction)
|
||||
skipImmune = true;
|
||||
}
|
||||
}
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (!skipImmune && bonus.getFloat(ModType.BlackMantle, SourceType.Heal) >= trains) {
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, 0f, powerID, powerName, trains, effectID);
|
||||
mhm.setUnknown03(5); //set target is immune
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ac.modifyStamina(modAmount, source);
|
||||
ac.modifyStamina(modAmount, source);
|
||||
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, modAmount, powerID, powerName, trains,
|
||||
effectID);
|
||||
if (effect instanceof DamageOverTimeJob)
|
||||
mhm.setOmitFromChat(1);
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
}
|
||||
}
|
||||
ModifyHealthMsg mhm = new ModifyHealthMsg(source, ac, 0f, 0f, modAmount, powerID, powerName, trains,
|
||||
effectID);
|
||||
if (effect instanceof DamageOverTimeJob)
|
||||
mhm.setOmitFromChat(1);
|
||||
DispatchMessage.sendToAllInRange(ac, mhm);
|
||||
}
|
||||
}
|
||||
|
||||
private float calculateDamage(AbstractCharacter source, AbstractCharacter target, float minDamage, float maxDamage, AbstractWorldObject awo, int trains) {
|
||||
private float calculateDamage(AbstractCharacter source, AbstractCharacter target, float minDamage, float maxDamage, AbstractWorldObject awo, int trains) {
|
||||
|
||||
// get range between min and max
|
||||
float range = maxDamage - minDamage;
|
||||
// get range between min and max
|
||||
float range = maxDamage - minDamage;
|
||||
|
||||
// Damage is calculated twice to average a more central point
|
||||
float damage = ThreadLocalRandom.current().nextFloat() * range;
|
||||
damage = (damage + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
||||
// Damage is calculated twice to average a more central point
|
||||
float damage = ThreadLocalRandom.current().nextFloat() * range;
|
||||
damage = (damage + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
||||
|
||||
// put it back between min and max
|
||||
damage += minDamage;
|
||||
// put it back between min and max
|
||||
damage += minDamage;
|
||||
|
||||
Resists resists = null;
|
||||
// get resists
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
resists = ac.getResists();
|
||||
} else if (awo.getObjectType().equals(Enum.GameObjectType.Building))
|
||||
resists = ((Building) awo).getResists();
|
||||
Resists resists = null;
|
||||
// get resists
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
resists = ac.getResists();
|
||||
} else if (awo.getObjectType().equals(Enum.GameObjectType.Building))
|
||||
resists = ((Building) awo).getResists();
|
||||
|
||||
// calculate resists in if any
|
||||
if (resists != null)
|
||||
damage = resists.getResistedDamage(source, target, damageType, damage * -1, trains) * -1;
|
||||
// calculate resists in if any
|
||||
if (resists != null)
|
||||
damage = resists.getResistedDamage(source, target, damageType, damage * -1, trains) * -1;
|
||||
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
if (ac.isSit())
|
||||
damage *= 2.5f; // increase damage if sitting
|
||||
}
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
if (ac.isSit())
|
||||
damage *= 2.5f; // increase damage if sitting
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,37 +17,40 @@ import java.sql.SQLException;
|
||||
|
||||
public class StaminaFullEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public StaminaFullEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public StaminaFullEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,31 +17,34 @@ import java.sql.SQLException;
|
||||
|
||||
public class StaminaRecoverRateEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public StaminaRecoverRateEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public StaminaRecoverRateEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
|
||||
//Erection is this right?
|
||||
amount = amount/100;
|
||||
bonus.multRegen(this.modType, amount); //positive regen modifiers
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
//Erection is this right?
|
||||
amount = amount / 100;
|
||||
bonus.multRegen(this.modType, amount); //positive regen modifiers
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,30 +18,33 @@ import java.sql.SQLException;
|
||||
|
||||
public class StunnedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public StunnedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public StunnedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
if (ac.getObjectType() == GameObjectType.Mob) {
|
||||
Mob mob = (Mob) ac;
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
if (ac.getObjectType() == GameObjectType.Mob) {
|
||||
Mob mob = (Mob) ac;
|
||||
}
|
||||
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType,this.sourceType, true);
|
||||
ac.cancelOnStun();
|
||||
ac.setIsCasting(false);
|
||||
ac.stopMovement(ac.getLoc());
|
||||
}
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
bonus.setBool(this.modType, this.sourceType, true);
|
||||
ac.cancelOnStun();
|
||||
ac.setIsCasting(false);
|
||||
ac.stopMovement(ac.getLoc());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,22 +20,25 @@ import java.sql.SQLException;
|
||||
|
||||
public class ValueEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ValueEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public ValueEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,26 +22,29 @@ import java.sql.SQLException;
|
||||
|
||||
public class WeaponProcEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public WeaponProcEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public WeaponProcEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
public void applyProc(AbstractCharacter ac, AbstractWorldObject target) {
|
||||
PowersManager.applyPower(ac, target, Vector3fImmutable.ZERO, this.string1, (int)this.percentMod, false);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
|
||||
public void applyProc(AbstractCharacter ac, AbstractWorldObject target) {
|
||||
PowersManager.applyPower(ac, target, Vector3fImmutable.ZERO, this.string1, (int) this.percentMod, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,38 +17,41 @@ import java.sql.SQLException;
|
||||
|
||||
public class WeaponRangeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public WeaponRangeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public WeaponRangeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
Float amount = 0f;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (this.percentMod != 0f) { //Stat Percent Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
bonus.addFloat(this, amount);
|
||||
} else { //Stat Modifiers
|
||||
if (this.useRampAdd)
|
||||
amount = this.minMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.minMod * (1 + (this.ramp * trains));
|
||||
bonus.addFloat(this, amount);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,41 +20,42 @@ import java.sql.SQLException;
|
||||
|
||||
public class WeaponSpeedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public WeaponSpeedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
public WeaponSpeedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
Float amount = 0f;
|
||||
Float amount = 0f;
|
||||
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
|
||||
amount = amount/100;
|
||||
amount = amount / 100;
|
||||
|
||||
ac.getBonuses().addFloat(this, amount);
|
||||
}
|
||||
ac.getBonuses().addFloat(this, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
Float amount = 0f;
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount/100;
|
||||
item.addBonus(this, amount);
|
||||
}
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {
|
||||
Float amount = 0f;
|
||||
if (this.useRampAdd)
|
||||
amount = this.percentMod + (this.ramp * trains);
|
||||
else
|
||||
amount = this.percentMod * (1 + (this.ramp * trains));
|
||||
amount = amount / 100;
|
||||
item.addBonus(this, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user