Initial Repository Push
This commit is contained in:
@@ -0,0 +1,373 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
import engine.powers.EffectsBase;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
||||
|
||||
public abstract class AbstractEffectModifier {
|
||||
|
||||
protected EffectsBase parent;
|
||||
protected int UUID;
|
||||
protected String IDString;
|
||||
protected String effectType;
|
||||
protected 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 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");
|
||||
}
|
||||
|
||||
public static ArrayList<AbstractEffectModifier> getAllEffectModifiers() {
|
||||
PreparedStatementShared ps = null;
|
||||
ArrayList<AbstractEffectModifier> out = new ArrayList<>();
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_effectmod");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
String IDString;
|
||||
AbstractEffectModifier aem = null;
|
||||
while (rs.next()) {
|
||||
IDString = rs.getString("IDString");
|
||||
int token = DbManager.hasher.SBStringHash(IDString);
|
||||
|
||||
EffectsBase eb = PowersManager.getEffectByIDString(IDString);
|
||||
|
||||
ModType modifier = ModType.GetModType(rs.getString("modType"));
|
||||
|
||||
//combine item prefix and suffix effect modifiers
|
||||
switch (modifier){
|
||||
case AdjustAboveDmgCap:
|
||||
aem = new AdjustAboveDmgCapEffectModifier(rs);
|
||||
break;
|
||||
case Ambidexterity:
|
||||
aem = new AmbidexterityEffectModifier(rs);
|
||||
break;
|
||||
case AnimOverride:
|
||||
break;
|
||||
case ArmorPiercing:
|
||||
aem = new ArmorPiercingEffectModifier(rs);
|
||||
break;
|
||||
case AttackDelay:
|
||||
aem = new AttackDelayEffectModifier(rs);
|
||||
break;
|
||||
case Attr:
|
||||
aem = new AttributeEffectModifier(rs);
|
||||
break;
|
||||
case BlackMantle:
|
||||
aem = new BlackMantleEffectModifier(rs);
|
||||
break;
|
||||
case BladeTrails:
|
||||
aem = new BladeTrailsEffectModifier(rs);
|
||||
break;
|
||||
case Block:
|
||||
aem = new BlockEffectModifier(rs);
|
||||
break;
|
||||
case BlockedPowerType:
|
||||
aem = new BlockedPowerTypeEffectModifier(rs);
|
||||
break;
|
||||
case CannotAttack:
|
||||
aem = new CannotAttackEffectModifier(rs);
|
||||
break;
|
||||
case CannotCast:
|
||||
aem = new CannotCastEffectModifier(rs);
|
||||
break;
|
||||
case CannotMove:
|
||||
aem = new CannotMoveEffectModifier(rs);
|
||||
break;
|
||||
case CannotTrack:
|
||||
aem = new CannotTrackEffectModifier(rs);
|
||||
break;
|
||||
case Charmed:
|
||||
aem = new CharmedEffectModifier(rs);
|
||||
break;
|
||||
case ConstrainedAmbidexterity:
|
||||
aem = new ConstrainedAmbidexterityEffectModifier(rs);
|
||||
break;
|
||||
case DamageCap:
|
||||
aem = new DamageCapEffectModifier(rs);
|
||||
break;
|
||||
case DamageShield:
|
||||
aem = new DamageShieldEffectModifier(rs);
|
||||
break;
|
||||
case DCV:
|
||||
aem = new DCVEffectModifier(rs);
|
||||
break;
|
||||
case Dodge:
|
||||
aem = new DodgeEffectModifier(rs);
|
||||
break;
|
||||
case DR:
|
||||
aem = new DREffectModifier(rs);
|
||||
break;
|
||||
case Durability:
|
||||
aem = new DurabilityEffectModifier(rs);
|
||||
break;
|
||||
case ExclusiveDamageCap:
|
||||
aem = new ExclusiveDamageCapEffectModifier(rs);
|
||||
break;
|
||||
case Fade:
|
||||
aem = new FadeEffectModifier(rs);
|
||||
break;
|
||||
case Fly:
|
||||
aem = new FlyEffectModifier(rs);
|
||||
break;
|
||||
case Health:
|
||||
aem = new HealthEffectModifier(rs);
|
||||
break;
|
||||
case HealthFull:
|
||||
aem = new HealthFullEffectModifier(rs);
|
||||
break;
|
||||
case HealthRecoverRate:
|
||||
aem = new HealthRecoverRateEffectModifier(rs);
|
||||
break;
|
||||
case IgnoreDamageCap:
|
||||
aem = new IgnoreDamageCapEffectModifier(rs);
|
||||
break;
|
||||
case IgnorePassiveDefense:
|
||||
aem = new IgnorePassiveDefenseEffectModifier(rs);
|
||||
break;
|
||||
case ImmuneTo:
|
||||
aem = new ImmuneToEffectModifier(rs);
|
||||
break;
|
||||
case ImmuneToAttack:
|
||||
aem = new ImmuneToAttackEffectModifier(rs);
|
||||
break;
|
||||
case ImmuneToPowers:
|
||||
aem = new ImmuneToPowersEffectModifier(rs);
|
||||
break;
|
||||
case Invisible:
|
||||
aem = new InvisibleEffectModifier(rs);
|
||||
break;
|
||||
case ItemName:
|
||||
aem = new ItemNameEffectModifier(rs);
|
||||
if ((((ItemNameEffectModifier)aem).name.isEmpty()))
|
||||
break;
|
||||
if (eb != null)
|
||||
eb.setName((((ItemNameEffectModifier)aem).name));
|
||||
break;
|
||||
case Mana:
|
||||
aem = new ManaEffectModifier(rs);
|
||||
break;
|
||||
case ManaFull:
|
||||
aem = new ManaFullEffectModifier(rs);
|
||||
break;
|
||||
case ManaRecoverRate:
|
||||
aem = new ManaRecoverRateEffectModifier(rs);
|
||||
break;
|
||||
case MaxDamage:
|
||||
aem = new MaxDamageEffectModifier(rs);
|
||||
break;
|
||||
case MeleeDamageModifier:
|
||||
aem = new MeleeDamageEffectModifier(rs);
|
||||
break;
|
||||
case MinDamage:
|
||||
aem = new MinDamageEffectModifier(rs);
|
||||
break;
|
||||
case NoMod:
|
||||
aem = new NoModEffectModifier(rs);
|
||||
break;
|
||||
case OCV:
|
||||
aem = new OCVEffectModifier(rs);
|
||||
break;
|
||||
case Parry:
|
||||
aem = new ParryEffectModifier(rs);
|
||||
break;
|
||||
case PassiveDefense:
|
||||
aem = new PassiveDefenseEffectModifier(rs);
|
||||
case PowerCost:
|
||||
aem = new PowerCostEffectModifier(rs);
|
||||
break;
|
||||
case PowerCostHealth:
|
||||
aem = new PowerCostHealthEffectModifier(rs);
|
||||
break;
|
||||
case PowerDamageModifier:
|
||||
aem = new PowerDamageEffectModifier(rs);
|
||||
break;
|
||||
case ProtectionFrom:
|
||||
aem = new ProtectionFromEffectModifier(rs);
|
||||
break;
|
||||
case Resistance:
|
||||
aem = new ResistanceEffectModifier(rs);
|
||||
break;
|
||||
case ScaleHeight:
|
||||
aem = new ScaleHeightEffectModifier(rs);
|
||||
break;
|
||||
case ScaleWidth:
|
||||
aem = new ScaleWidthEffectModifier(rs);
|
||||
break;
|
||||
case ScanRange:
|
||||
aem = new ScanRangeEffectModifier(rs);
|
||||
break;
|
||||
case SeeInvisible:
|
||||
aem = new SeeInvisibleEffectModifier(rs);
|
||||
break;
|
||||
case Silenced:
|
||||
aem = new SilencedEffectModifier(rs);
|
||||
break;
|
||||
case Skill:
|
||||
aem = new SkillEffectModifier(rs);
|
||||
break;
|
||||
case Slay:
|
||||
aem = new SlayEffectModifier(rs);
|
||||
break;
|
||||
case Speed:
|
||||
aem = new SpeedEffectModifier(rs);
|
||||
break;
|
||||
case SpireBlock:
|
||||
aem = new SpireBlockEffectModifier(rs);
|
||||
break;
|
||||
case Stamina:
|
||||
aem = new StaminaEffectModifier(rs);
|
||||
break;
|
||||
case StaminaFull:
|
||||
aem = new StaminaFullEffectModifier(rs);
|
||||
break;
|
||||
case StaminaRecoverRate:
|
||||
aem = new StaminaRecoverRateEffectModifier(rs);
|
||||
break;
|
||||
case Stunned:
|
||||
aem = new StunnedEffectModifier(rs);
|
||||
break;
|
||||
case Value:
|
||||
aem = new ValueEffectModifier(rs);
|
||||
if (eb != null){
|
||||
ValueEffectModifier valueEffect = (ValueEffectModifier)aem;
|
||||
eb.setValue(valueEffect.minMod);
|
||||
}
|
||||
break;
|
||||
case WeaponProc:
|
||||
aem = new WeaponProcEffectModifier(rs);
|
||||
break;
|
||||
case WeaponRange:
|
||||
aem = new WeaponRangeEffectModifier(rs);
|
||||
break;
|
||||
case WeaponSpeed:
|
||||
aem = new WeaponSpeedEffectModifier(rs);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (aem != null){
|
||||
|
||||
|
||||
if (EffectsBase.modifiersMap.containsKey(eb.getIDString()) == false)
|
||||
EffectsBase.modifiersMap.put(eb.getIDString(), new HashSet<>());
|
||||
EffectsBase.modifiersMap.get(eb.getIDString()).add(aem);
|
||||
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error( e);
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public int getUUID() {
|
||||
return this.UUID;
|
||||
}
|
||||
|
||||
// public String getIDString() {
|
||||
// return this.IDString;
|
||||
// }
|
||||
|
||||
public String getmodType() {
|
||||
return this.effectType;
|
||||
}
|
||||
|
||||
public float getMinMod() {
|
||||
return this.minMod;
|
||||
}
|
||||
|
||||
public float getMaxMod() {
|
||||
return this.maxMod;
|
||||
}
|
||||
|
||||
public float getPercentMod() {
|
||||
return this.percentMod;
|
||||
}
|
||||
|
||||
public float getRamp() {
|
||||
return this.ramp;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public String getString1() {
|
||||
return this.string1;
|
||||
}
|
||||
|
||||
public String getString2() {
|
||||
return this.string2;
|
||||
}
|
||||
|
||||
public EffectsBase getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(EffectsBase value) {
|
||||
this.parent = value;
|
||||
}
|
||||
|
||||
public void applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
_applyEffectModifier(source, awo, trains, 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);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class AdjustAboveDmgCapEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public AdjustAboveDmgCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class AmbidexterityEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public AmbidexterityEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class ArmorPiercingEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ArmorPiercingEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class AttackDelayEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public AttackDelayEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class AttributeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public AttributeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class BlackMantleEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public BlackMantleEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
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) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class BladeTrailsEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public BladeTrailsEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class BlockEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public BlockEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum.ModType;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashSet;
|
||||
|
||||
|
||||
public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public BlockedPowerTypeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class CannotAttackEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CannotAttackEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class CannotCastEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CannotCastEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
if (ac.getObjectType().equals(Enum.GameObjectType.Mob)) {
|
||||
Mob mob = (Mob) ac;
|
||||
}
|
||||
|
||||
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) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class CannotMoveEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CannotMoveEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class CannotTrackEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CannotTrackEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class CharmedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public CharmedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class ConstrainedAmbidexterityEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ConstrainedAmbidexterityEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class DCVEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DCVEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class DREffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DREffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(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) {}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class DamageCapEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DamageCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum.DamageType;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
import engine.powers.DamageShield;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class DamageShieldEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DamageShieldEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class DodgeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DodgeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class DurabilityEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public DurabilityEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class ExclusiveDamageCapEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ExclusiveDamageCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class FadeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public FadeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class FlyEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public FlyEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,331 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum.DamageType;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.jobs.DamageOverTimeJob;
|
||||
import engine.net.AbstractNetMsg;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ModifyHealthKillMsg;
|
||||
import engine.net.client.msg.ModifyHealthMsg;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class HealthEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
float modAmount = 0f;
|
||||
|
||||
// Modify health by percent
|
||||
if (this.percentMod != 0f) {
|
||||
|
||||
//high level mobs/players should not be %damaged/healed.
|
||||
if (awo.getHealthMax() > 25000f && (this.percentMod < 0f || this.percentMod > 5f))
|
||||
return;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
//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);
|
||||
}
|
||||
}
|
||||
|
||||
// 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 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);
|
||||
}
|
||||
}else if (source.getObjectType() == GameObjectType.Mob){
|
||||
Mob pc = (Mob) 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;
|
||||
|
||||
if (pc.isPlayerGuard())
|
||||
intt = 200;
|
||||
float spi = (pc.getStatSpiCurrent() >= 1) ? (float)pc.getStatSpiCurrent() : 1f;
|
||||
|
||||
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);
|
||||
|
||||
//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();
|
||||
|
||||
// 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 (!ac.isAlive())
|
||||
return;
|
||||
|
||||
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) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
float mod = 0;
|
||||
|
||||
//Modify health
|
||||
|
||||
mod = ac.modifyHealth(modAmount, source, false);
|
||||
|
||||
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);
|
||||
|
||||
if (effect instanceof DamageOverTimeJob) {
|
||||
if (mhm instanceof ModifyHealthMsg)
|
||||
((ModifyHealthMsg)mhm).setOmitFromChat(1);
|
||||
else if (mhm instanceof ModifyHealthKillMsg)
|
||||
((ModifyHealthKillMsg)mhm).setUnknown02(1);
|
||||
}
|
||||
|
||||
//send the damage
|
||||
|
||||
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)) {
|
||||
|
||||
Building b = (Building) awo;
|
||||
|
||||
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)"));
|
||||
|
||||
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);
|
||||
|
||||
if (effect instanceof DamageOverTimeJob)
|
||||
mhm.setOmitFromChat(1);
|
||||
|
||||
//send the damage
|
||||
|
||||
DispatchMessage.sendToAllInRange(b, mhm);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private float calculateDamage(AbstractCharacter source, 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;
|
||||
|
||||
// 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();
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, 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
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class HealthFullEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public HealthFullEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class HealthRecoverRateEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public HealthRecoverRateEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashSet;
|
||||
|
||||
public class IgnoreDamageCapEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public IgnoreDamageCapEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class IgnorePassiveDefenseEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public IgnorePassiveDefenseEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ImmuneToAttackEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ImmuneToAttackEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ImmuneToEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ImmuneToEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ImmuneToPowersEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ImmuneToPowersEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.objects.*;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class InvisibleEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public InvisibleEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
if (awo.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter pc = (PlayerCharacter) awo;
|
||||
|
||||
if (effect == null)
|
||||
return;
|
||||
|
||||
PowersBase pb = effect.getPower();
|
||||
if (pb == null)
|
||||
return;
|
||||
|
||||
ActionsBase ab = effect.getAction();
|
||||
|
||||
if (ab == null)
|
||||
return;
|
||||
|
||||
//send invis message to everyone around.
|
||||
ClientConnection origin = SessionManager.getClientConnection(pc);
|
||||
if (origin == null)
|
||||
return;
|
||||
|
||||
ab.getDurationInSeconds(trains);
|
||||
|
||||
pc.setHidden(trains);
|
||||
|
||||
pc.setTimeStampNow("Invis");
|
||||
|
||||
}
|
||||
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);
|
||||
|
||||
//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) {}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
import engine.powers.EffectsBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ItemNameEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
String name = "";
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.DamageType;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.jobs.DamageOverTimeJob;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ModifyHealthMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.poweractions.AbstractPowerAction;
|
||||
import engine.powers.poweractions.DamageOverTimePowerAction;
|
||||
import engine.powers.poweractions.DirectDamagePowerAction;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class ManaEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@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 (!AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
return;
|
||||
AbstractCharacter awoac = (AbstractCharacter) awo;
|
||||
|
||||
float modAmount = 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();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
//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();
|
||||
}
|
||||
|
||||
//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);
|
||||
|
||||
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;
|
||||
|
||||
// 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;
|
||||
|
||||
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;
|
||||
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
if (ac.isSit())
|
||||
damage *= 2.5f; // increase damage if sitting
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ManaFullEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ManaFullEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ManaRecoverRateEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ManaRecoverRateEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class MaxDamageEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public MaxDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@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(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class MeleeDamageEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public MeleeDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class MinDamageEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public MinDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@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(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class NoModEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
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
|
||||
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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class OCVEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public OCVEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ParryEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ParryEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class PassiveDefenseEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public PassiveDefenseEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class PowerCostEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public PowerCostEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class PowerCostHealthEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public PowerCostHealthEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class PowerDamageEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public PowerDamageEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ProtectionFromEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ProtectionFromEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ResistanceEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ResistanceEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ScaleHeightEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ScaleHeightEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ScaleWidthEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ScaleWidthEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ScanRangeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ScanRangeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class SeeInvisibleEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SeeInvisibleEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class SilencedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SilencedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class SkillEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SkillEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class SlayEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SlayEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class SpeedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
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
|
||||
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) {}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class SpireBlockEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public SpireBlockEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.DamageType;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.jobs.DamageOverTimeJob;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ModifyHealthMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.poweractions.AbstractPowerAction;
|
||||
import engine.powers.poweractions.DamageOverTimePowerAction;
|
||||
import engine.powers.poweractions.DirectDamagePowerAction;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
public class StaminaEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@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 (!AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
return;
|
||||
AbstractCharacter awoac = (AbstractCharacter) awo;
|
||||
|
||||
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;
|
||||
|
||||
//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;
|
||||
|
||||
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();
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// 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();
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class StaminaFullEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public StaminaFullEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class StaminaRecoverRateEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public StaminaRecoverRateEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class StunnedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public StunnedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
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) {}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class ValueEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public ValueEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class WeaponProcEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public WeaponProcEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(Item item, int trains) {}
|
||||
@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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class WeaponRangeEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public WeaponRangeEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@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(Item item, int trains) {}
|
||||
@Override
|
||||
public void applyBonus(Building building, int trains) {}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.effectmodifiers;
|
||||
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Item;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class WeaponSpeedEffectModifier extends AbstractEffectModifier {
|
||||
|
||||
public WeaponSpeedEffectModifier(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyBonus(AbstractCharacter ac, int trains) {}
|
||||
|
||||
@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) {}
|
||||
}
|
||||
Reference in New Issue
Block a user