Initial Repository Push
This commit is contained in:
@@ -0,0 +1,266 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers;
|
||||
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.Enum.StackType;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.objects.*;
|
||||
import engine.powers.poweractions.AbstractPowerAction;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class ActionsBase {
|
||||
|
||||
public int UUID;
|
||||
public String IDString;
|
||||
public String effectID;
|
||||
public int minTrains;
|
||||
public int maxTrains;
|
||||
public float duration;
|
||||
public float ramp;
|
||||
public boolean addFormula;
|
||||
public String stackType;
|
||||
public StackType stackTypeType;
|
||||
public int stackOrder;
|
||||
|
||||
public boolean greaterThanEqual = false;
|
||||
public boolean always = false;
|
||||
public boolean greaterThan = false;
|
||||
public String stackPriority;
|
||||
|
||||
private AbstractPowerAction powerAction;
|
||||
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
*/
|
||||
public ActionsBase() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public ActionsBase(ResultSet rs, HashMap<String, AbstractPowerAction> apa) throws SQLException {
|
||||
|
||||
this.UUID = rs.getInt("ID");
|
||||
this.IDString = rs.getString("powerID");
|
||||
this.effectID = rs.getString("effectID");
|
||||
this.minTrains = rs.getInt("minTrains");
|
||||
this.maxTrains = rs.getInt("maxTrains");
|
||||
this.duration = rs.getFloat("duration");
|
||||
this.ramp = rs.getFloat("ramp");
|
||||
this.addFormula = (rs.getInt("useAddFormula") == 1) ? true : false;
|
||||
this.stackType = rs.getString("stackType");
|
||||
this.stackTypeType = StackType.GetStackType(this.stackType);
|
||||
this.stackOrder = rs.getInt("stackOrder");
|
||||
this.stackPriority = rs.getString("stackPriority");
|
||||
|
||||
switch (stackPriority) {
|
||||
case "GreaterThanOrEqualTo":
|
||||
this.greaterThanEqual = true;
|
||||
break;
|
||||
case "Always":
|
||||
this.always = true;
|
||||
break;
|
||||
case "GreaterThan":
|
||||
this.greaterThan = true;
|
||||
break;
|
||||
}
|
||||
this.powerAction = apa.get(this.effectID);
|
||||
}
|
||||
|
||||
protected ActionsBase(int uUID, String effectID, int minTrains, int maxTrains, float duration, float ramp,
|
||||
boolean addFormula, String stackType, int stackOrder, boolean greaterThanEqual, boolean always,
|
||||
boolean greaterThan, AbstractPowerAction powerAction) {
|
||||
super();
|
||||
UUID = uUID;
|
||||
this.effectID = effectID;
|
||||
this.minTrains = minTrains;
|
||||
this.maxTrains = maxTrains;
|
||||
this.duration = duration;
|
||||
this.ramp = ramp;
|
||||
this.addFormula = addFormula;
|
||||
this.stackType = stackType;
|
||||
this.stackTypeType = StackType.GetStackType(this.stackType);
|
||||
if (this.stackTypeType == null)
|
||||
Logger.info("Invalid Stack Type " + this.stackTypeType + " for " + this.effectID);
|
||||
this.stackOrder = stackOrder;
|
||||
this.greaterThanEqual = greaterThanEqual;
|
||||
this.always = always;
|
||||
this.greaterThan = greaterThan;
|
||||
this.powerAction = powerAction;
|
||||
|
||||
if (this.greaterThanEqual)
|
||||
this.stackPriority = "GreaterThanOrEqualTo";
|
||||
else if(this.always)
|
||||
this.stackPriority = "Always";
|
||||
else if (this.greaterThan)
|
||||
this.stackPriority = "GreaterThan";
|
||||
|
||||
}
|
||||
|
||||
// public static ArrayList<ActionsBase> getActionsBase(String ID) {
|
||||
// PreparedStatementShared ps = null;
|
||||
// ArrayList<ActionsBase> out = new ArrayList<ActionsBase>();
|
||||
// try {
|
||||
// ps = new PreparedStatementShared("SELECT * FROM actions where powerID = ?");
|
||||
// ps.setString(1, ID);
|
||||
// ResultSet rs = ps.executeQuery();
|
||||
// while (rs.next()) {
|
||||
// ActionsBase toAdd = new ActionsBase(rs);
|
||||
// out.add(toAdd);
|
||||
// }
|
||||
// rs.close();
|
||||
// } catch (Exception e) {
|
||||
// Logger.error("ActionsBase", e);
|
||||
// } finally {
|
||||
// ps.release();
|
||||
// }
|
||||
// return out;
|
||||
// }
|
||||
|
||||
public static void getActionsBase(HashMap<String, PowersBase> powers, HashMap<String, AbstractPowerAction> apa) {
|
||||
PreparedStatementShared ps = null;
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_action");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
String IDString; ActionsBase toAdd; PowersBase pb;
|
||||
while (rs.next()) {
|
||||
IDString = rs.getString("powerID");
|
||||
pb = powers.get(IDString);
|
||||
if (pb != null) {
|
||||
toAdd = new ActionsBase(rs, apa);
|
||||
pb.getActions().add(toAdd);
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error( e.toString());
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
|
||||
int gateID = 5000;
|
||||
for (String IDString : Runegate.GetAllOpenGateIDStrings()){
|
||||
gateID++;
|
||||
ActionsBase openGateActionBase = new ActionsBase(gateID, "OPENGATE", 5, 9999, 0, 0, true, "IgnoreStack", 0, true, false, false, PowersManager.getPowerActionByIDString("OPENGATE"));
|
||||
|
||||
PowersBase openGatePower = powers.get(IDString);
|
||||
|
||||
if (openGatePower == null){
|
||||
Logger.error( "no powerbase for action " + IDString);
|
||||
break;
|
||||
}
|
||||
openGatePower.getActions().add(openGateActionBase);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int getUUID() {
|
||||
return this.UUID;
|
||||
}
|
||||
|
||||
public String getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
|
||||
public int getMinTrains() {
|
||||
return this.minTrains;
|
||||
}
|
||||
|
||||
public int getMaxTrains() {
|
||||
return this.maxTrains;
|
||||
}
|
||||
|
||||
public float getDuration() {
|
||||
return this.duration;
|
||||
}
|
||||
|
||||
public AbstractPowerAction getPowerAction() {
|
||||
return this.powerAction;
|
||||
}
|
||||
|
||||
public int getDuration(int trains) {
|
||||
if (this.addFormula)
|
||||
return (int)((this.duration + (this.ramp * trains)) * 1000);
|
||||
else
|
||||
return (int)((this.duration * (1 + (this.ramp * trains))) * 1000);
|
||||
}
|
||||
|
||||
public float getDurationAsFloat(int trains) {
|
||||
if (this.addFormula)
|
||||
return ((this.duration + (this.ramp * trains)) * 1000);
|
||||
else
|
||||
return ((this.duration * (1 + (this.ramp * trains))) * 1000);
|
||||
}
|
||||
|
||||
public int getDurationInSeconds(int trains) {
|
||||
if (this.addFormula)
|
||||
return (int)(this.duration + (this.ramp * trains));
|
||||
else
|
||||
return (int)(this.duration * (1 + (this.ramp * trains)));
|
||||
}
|
||||
|
||||
public String getStackType() {
|
||||
return this.stackType;
|
||||
}
|
||||
|
||||
public int getStackOrder() {
|
||||
return this.stackOrder;
|
||||
}
|
||||
|
||||
public boolean greaterThanEqual() {
|
||||
return this.greaterThanEqual;
|
||||
}
|
||||
|
||||
public boolean greaterThan() {
|
||||
return this.greaterThan;
|
||||
}
|
||||
|
||||
public boolean always() {
|
||||
return this.always;
|
||||
}
|
||||
|
||||
//Add blocked types here
|
||||
public boolean blocked(AbstractWorldObject awo, PowersBase pb, int trains) {
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
PlayerBonuses bonus = ac.getBonuses();
|
||||
if (bonus == null)
|
||||
return false;
|
||||
|
||||
//TODO make this more efficient then testing strings
|
||||
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.Stun))
|
||||
return true; //Currently stun immune. Skip stun
|
||||
else if(this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare))
|
||||
return true; //Currently snare immune. Skip snare
|
||||
else if(this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.Blind))
|
||||
return true; //Currently blind immune. Skip blind
|
||||
else if(this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
||||
return true; //Currently power block immune. Skip power block
|
||||
else if (this.stackType.equals("Root") && bonus.getBool(ModType.ImmuneTo, SourceType.Root))
|
||||
return true;
|
||||
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
|
||||
// return true; //Currently shadowmantled. Skip heals
|
||||
else if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly))
|
||||
return true;
|
||||
else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
||||
return true;
|
||||
else return pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers;
|
||||
|
||||
import engine.Enum.DamageType;
|
||||
|
||||
public class DamageShield {
|
||||
|
||||
private final DamageType damageType;
|
||||
private final float amount;
|
||||
private final boolean usePercent;
|
||||
|
||||
public DamageShield(DamageType damageType, float amount, boolean usePercent) {
|
||||
super();
|
||||
this.damageType = damageType;
|
||||
this.amount = amount;
|
||||
this.usePercent = usePercent;
|
||||
}
|
||||
|
||||
public DamageType getDamageType() {
|
||||
return this.damageType;
|
||||
}
|
||||
|
||||
public float getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
public boolean usePercent() {
|
||||
return this.usePercent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ds.DamageType: " + this.damageType.name() + ", Amount: " + this.amount + ", UsePercent: " + this.usePercent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,892 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.DamageType;
|
||||
import engine.Enum.EffectSourceType;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.PowerFailCondition;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.job.JobContainer;
|
||||
import engine.jobs.AbstractEffectJob;
|
||||
import engine.jobs.DamageOverTimeJob;
|
||||
import engine.jobs.FinishSpireEffectJob;
|
||||
import engine.jobs.NoTimeJob;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.ApplyEffectMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class EffectsBase {
|
||||
|
||||
private int UUID;
|
||||
private String IDString;
|
||||
// private String name;
|
||||
private int token;
|
||||
private float amount;
|
||||
private float amountRamp;
|
||||
|
||||
// flags
|
||||
private boolean isItemEffect;
|
||||
private boolean isSpireEffect;
|
||||
private boolean ignoreMod;
|
||||
private boolean dontSave;
|
||||
|
||||
private boolean cancelOnAttack = false;
|
||||
private boolean cancelOnAttackSwing = false;
|
||||
private boolean cancelOnCast = false;
|
||||
private boolean cancelOnCastSpell = false;
|
||||
private boolean cancelOnEquipChange = false;
|
||||
private boolean cancelOnLogout = false;
|
||||
private boolean cancelOnMove = false;
|
||||
private boolean cancelOnNewCharm = false;
|
||||
private boolean cancelOnSit = false;
|
||||
private boolean cancelOnTakeDamage = false;
|
||||
private boolean cancelOnTerritoryClaim = false;
|
||||
private boolean cancelOnUnEquip = false;
|
||||
private boolean useRampAdd;
|
||||
private boolean isPrefix = false; //used by items
|
||||
private boolean isSuffix = false; //used by items
|
||||
private String name = "";
|
||||
private float value = 0;
|
||||
private ConcurrentHashMap<ItemBase, Integer> resourceCosts = new ConcurrentHashMap<>();
|
||||
private ConcurrentHashMap<String, Boolean> sourceTypes = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
public static HashMap<Integer,HashSet<EffectSourceType>> effectSourceTypeMap = new HashMap<>();
|
||||
public static HashMap<String, HashSet<AbstractEffectModifier>> modifiersMap = new HashMap<>();
|
||||
private static ConcurrentHashMap<String, String> itemEffectsByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
private static int NewID = 3000;
|
||||
public static HashMap<String,HashMap<String,ArrayList<String>>> OldEffectsMap = new HashMap<>();
|
||||
public static HashMap<String,HashMap<String,ArrayList<String>>> NewEffectsMap = new HashMap<>();
|
||||
public static HashMap<String,HashMap<String,ArrayList<String>>> ChangedEffectsMap = new HashMap<>();
|
||||
public static HashMap<String,HashSet<PowerFailCondition>> EffectFailConditions = new HashMap<>();
|
||||
public static HashMap<Integer,HashSet<DamageType>> EffectDamageTypes = new HashMap<>();
|
||||
|
||||
public static HashSet<AbstractEffectModifier> DefaultModifiers = new HashSet<>();
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
*/
|
||||
public EffectsBase() {
|
||||
|
||||
}
|
||||
|
||||
public EffectsBase(EffectsBase copyEffect, int newToken, String IDString) {
|
||||
|
||||
UUID = NewID++;
|
||||
this.IDString = IDString;
|
||||
this.token = newToken;
|
||||
|
||||
//filll
|
||||
if (copyEffect == null){
|
||||
int flags = 0;
|
||||
this.isItemEffect = ((flags & 1) != 0) ? true : false;
|
||||
this.isSpireEffect = ((flags & 2) != 0) ? true : false;
|
||||
this.ignoreMod = ((flags & 4) != 0) ? true : false;
|
||||
this.dontSave = ((flags & 8) != 0) ? true : false;
|
||||
|
||||
if (this.IDString.startsWith("PRE-"))
|
||||
this.isPrefix = true;
|
||||
else if (this.IDString.startsWith("SUF-"))
|
||||
this.isSuffix = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.amount = copyEffect.amount;
|
||||
this.amountRamp = copyEffect.amountRamp;
|
||||
this.isItemEffect = copyEffect.isItemEffect;
|
||||
this.isSpireEffect = copyEffect.isSpireEffect;
|
||||
this.ignoreMod = copyEffect.ignoreMod;
|
||||
this.dontSave = copyEffect.dontSave;
|
||||
this.cancelOnAttack = copyEffect.cancelOnAttack;
|
||||
this.cancelOnAttackSwing = copyEffect.cancelOnAttackSwing;
|
||||
this.cancelOnCast = copyEffect.cancelOnCast;
|
||||
this.cancelOnCastSpell = copyEffect.cancelOnCastSpell;
|
||||
this.cancelOnEquipChange = copyEffect.cancelOnEquipChange;
|
||||
this.cancelOnLogout = copyEffect.cancelOnLogout;
|
||||
this.cancelOnMove = copyEffect.cancelOnMove;
|
||||
this.cancelOnNewCharm = copyEffect.cancelOnNewCharm;
|
||||
this.cancelOnSit = copyEffect.cancelOnSit;
|
||||
this.cancelOnTakeDamage = copyEffect.cancelOnTakeDamage;
|
||||
this.cancelOnTerritoryClaim = copyEffect.cancelOnTerritoryClaim;
|
||||
this.cancelOnUnEquip = copyEffect.cancelOnUnEquip;
|
||||
this.useRampAdd = copyEffect.useRampAdd;
|
||||
this.isPrefix = copyEffect.isPrefix;
|
||||
this.isSuffix = copyEffect.isSuffix;
|
||||
this.name = copyEffect.name;
|
||||
this.value = copyEffect.value;
|
||||
this.resourceCosts = copyEffect.resourceCosts;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public EffectsBase(ResultSet rs) throws SQLException {
|
||||
|
||||
this.UUID = rs.getInt("ID");
|
||||
this.IDString = rs.getString("IDString");
|
||||
this.name = rs.getString("name");
|
||||
this.token = rs.getInt("Token");
|
||||
|
||||
//override tokens for some effects like Safemode that use the Action Token instead of the effect Token,
|
||||
switch (this.IDString){
|
||||
case "INVIS-D":
|
||||
this.token = -1661751254;
|
||||
break;
|
||||
case "SafeMode":
|
||||
this.token = -1661750486;
|
||||
break;
|
||||
|
||||
}
|
||||
int flags = rs.getInt("flags");
|
||||
this.isItemEffect = ((flags & 1) != 0) ? true : false;
|
||||
this.isSpireEffect = ((flags & 2) != 0) ? true : false;
|
||||
this.ignoreMod = ((flags & 4) != 0) ? true : false;
|
||||
this.dontSave = ((flags & 8) != 0) ? true : false;
|
||||
|
||||
if (this.IDString.startsWith("PRE-"))
|
||||
this.isPrefix = true;
|
||||
else if (this.IDString.startsWith("SUF-"))
|
||||
this.isSuffix = true;
|
||||
// getFailConditions();
|
||||
}
|
||||
|
||||
|
||||
public static EffectsBase createNoDbEffectsBase(EffectsBase copyEffect, int newToken, String IDString){
|
||||
EffectsBase cachedEffectsBase = new EffectsBase(copyEffect,newToken,IDString);
|
||||
|
||||
if (cachedEffectsBase == null)
|
||||
return null;
|
||||
|
||||
//add to Lists.
|
||||
PowersManager.effectsBaseByIDString.put(cachedEffectsBase.IDString, cachedEffectsBase);
|
||||
PowersManager.effectsBaseByToken.put(cachedEffectsBase.token, cachedEffectsBase);
|
||||
|
||||
return cachedEffectsBase;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static ArrayList<EffectsBase> getAllEffectsBase() {
|
||||
PreparedStatementShared ps = null;
|
||||
ArrayList<EffectsBase> out = new ArrayList<>();
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_effectbase ORDER BY `IDString` DESC");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
while (rs.next()) {
|
||||
EffectsBase toAdd = new EffectsBase(rs);
|
||||
out.add(toAdd);
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
//testHash(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
public static ArrayList<EffectsBase> getAllLiveEffectsBase() {
|
||||
PreparedStatementShared ps = null;
|
||||
ArrayList<EffectsBase> out = new ArrayList<>();
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_effectbase_24 ORDER BY `IDString` DESC");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
while (rs.next()) {
|
||||
EffectsBase toAdd = new EffectsBase(rs);
|
||||
out.add(toAdd);
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
//testHash(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
//private static void testHash(ArrayList<EffectsBase> effs) {
|
||||
// int valid = 0, invalid = 0;
|
||||
// for (EffectsBase eff : effs) {
|
||||
// String ids = eff.getIDString();
|
||||
// int tok = eff.getToken();
|
||||
// if (ids.length() != 8 || ids.startsWith("PRE-") || ids.startsWith("SUF-") || ids.endsWith("X") || !ids.substring(3,4).equals("-"))
|
||||
// continue;
|
||||
//
|
||||
//// if ((tok > 1 || tok < 0) && ids.length() == 8) {
|
||||
// int out = Hash(ids);
|
||||
// if (out != tok) {
|
||||
// System.out.println(ids + ": " + Integer.toHexString(out) + "(" + out + ")");
|
||||
// invalid++;
|
||||
// } else
|
||||
// valid++;
|
||||
//// }
|
||||
// }
|
||||
// System.out.println("valid: " + valid + ", invalid: " + invalid);
|
||||
//}
|
||||
|
||||
//private static int Hash(String IDString) {
|
||||
// char[] val = IDString.toCharArray();
|
||||
// int out = 360;
|
||||
// out ^= val[0];
|
||||
// out ^= (val[1] << 5);
|
||||
// out ^= (val[2] << 10);
|
||||
// out ^= (val[4] << 23);
|
||||
// out ^= (val[5] << 19);
|
||||
// out ^= (val[6] << 15);
|
||||
// out ^= (val[7] << 26);
|
||||
// out ^= (val[7] >> 6);
|
||||
// out ^= 17;
|
||||
// return out;
|
||||
//}
|
||||
|
||||
|
||||
public static void getFailConditions(HashMap<String, EffectsBase> effects) {
|
||||
PreparedStatementShared ps = null;
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_failcondition WHERE powerOrEffect = 'Effect';");
|
||||
|
||||
ResultSet rs = ps.executeQuery();
|
||||
PowerFailCondition failCondition = null;
|
||||
|
||||
Object value;
|
||||
while (rs.next()) {
|
||||
String fail = rs.getString("type");
|
||||
|
||||
|
||||
|
||||
String IDString = rs.getString("IDString");
|
||||
int token = DbManager.hasher.SBStringHash(IDString);
|
||||
failCondition = PowerFailCondition.valueOf(fail);
|
||||
if (failCondition == null){
|
||||
Logger.error( "Couldn't Find FailCondition " + fail + " for " + IDString);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (EffectsBase.EffectFailConditions.get(IDString) == null){
|
||||
EffectsBase.EffectFailConditions.put(IDString, new HashSet<>());
|
||||
}
|
||||
|
||||
EffectsBase.EffectFailConditions.get(IDString).add(failCondition);
|
||||
EffectsBase eb = effects.get(IDString);
|
||||
|
||||
switch (failCondition) {
|
||||
|
||||
case TakeDamage:
|
||||
|
||||
|
||||
|
||||
// dont go any further.
|
||||
if (eb == null){
|
||||
break;
|
||||
}
|
||||
|
||||
eb.cancelOnTakeDamage = true;
|
||||
|
||||
|
||||
|
||||
|
||||
eb.amount = rs.getFloat("amount");
|
||||
eb.amountRamp = rs.getFloat("ramp");
|
||||
eb.useRampAdd = rs.getBoolean("UseAddFormula");
|
||||
|
||||
String damageType1 = rs.getString("damageType1");
|
||||
String damageType2 = rs.getString("damageType1");
|
||||
String damageType3 = rs.getString("damageType1");
|
||||
|
||||
|
||||
if (damageType1.isEmpty() && damageType2.isEmpty() && damageType3.isEmpty())
|
||||
break;
|
||||
|
||||
if (!EffectsBase.EffectDamageTypes.containsKey(eb.getToken())){
|
||||
EffectsBase.EffectDamageTypes.put(eb.getToken(), new HashSet<>());
|
||||
}
|
||||
if (damageType1.equalsIgnoreCase("Crushing"))
|
||||
damageType1 = "Crush";
|
||||
if (damageType1.equalsIgnoreCase("Piercing"))
|
||||
damageType1 = "Pierce";
|
||||
if (damageType1.equalsIgnoreCase("Slashing"))
|
||||
damageType1 = "Slash";
|
||||
|
||||
if (damageType2.equalsIgnoreCase("Crushing"))
|
||||
damageType2 = "Crush";
|
||||
if (damageType2.equalsIgnoreCase("Piercing"))
|
||||
damageType2 = "Pierce";
|
||||
if (damageType2.equalsIgnoreCase("Slashing"))
|
||||
damageType2 = "Slash";
|
||||
|
||||
if (damageType3.equalsIgnoreCase("Crushing"))
|
||||
damageType3 = "Crush";
|
||||
if (damageType3.equalsIgnoreCase("Piercing"))
|
||||
damageType3 = "Pierce";
|
||||
if (damageType3.equalsIgnoreCase("Slashing"))
|
||||
damageType3 = "Slash";
|
||||
DamageType dt = getDamageType(damageType1);
|
||||
if (dt != null)
|
||||
EffectsBase.EffectDamageTypes.get(eb.token).add(dt);
|
||||
|
||||
dt = getDamageType(damageType2);
|
||||
if (dt != null)
|
||||
EffectsBase.EffectDamageTypes.get(eb.token).add(dt);
|
||||
dt = getDamageType(damageType3);
|
||||
if (dt != null)
|
||||
EffectsBase.EffectDamageTypes.get(eb.token).add(dt);
|
||||
break;
|
||||
case Attack:
|
||||
eb.cancelOnAttack = true;
|
||||
break;
|
||||
case AttackSwing:
|
||||
eb.cancelOnAttackSwing = true;
|
||||
break;
|
||||
case Cast:
|
||||
eb.cancelOnCast = true;
|
||||
break;
|
||||
case CastSpell:
|
||||
eb.cancelOnCastSpell = true;
|
||||
break;
|
||||
case EquipChange:
|
||||
eb.cancelOnEquipChange = true;
|
||||
break;
|
||||
case Logout:
|
||||
eb.cancelOnLogout = true;
|
||||
break;
|
||||
case Move:
|
||||
eb.cancelOnMove = true;
|
||||
break;
|
||||
case NewCharm:
|
||||
eb.cancelOnNewCharm = true;
|
||||
break;
|
||||
case Sit:
|
||||
eb.cancelOnSit = true;
|
||||
break;
|
||||
case TerritoryClaim:
|
||||
eb.cancelOnTerritoryClaim = true;
|
||||
break;
|
||||
case UnEquip:
|
||||
eb.cancelOnUnEquip = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error( e);
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public float getDamageAmount(int trains) {
|
||||
if (useRampAdd)
|
||||
return (amount + (amountRamp * trains));
|
||||
else
|
||||
return (amount * (1 + (amountRamp * trains)));
|
||||
}
|
||||
|
||||
public boolean damageTypeSpecific() {
|
||||
|
||||
return EffectsBase.EffectDamageTypes.containsKey(this.token);
|
||||
|
||||
}
|
||||
|
||||
public boolean containsDamageType(DamageType dt) {
|
||||
if (!EffectsBase.EffectDamageTypes.containsKey(this.token))
|
||||
return false;
|
||||
return EffectsBase.EffectDamageTypes.get(this.token).contains(dt);
|
||||
}
|
||||
|
||||
private static DamageType getDamageType(String name) {
|
||||
try {
|
||||
switch (name) {
|
||||
case "Crushing":
|
||||
name = "Crush";
|
||||
break;
|
||||
case "Slashing":
|
||||
name = "Slash";
|
||||
break;
|
||||
case "Piercing":
|
||||
name = "Pierce";
|
||||
break;
|
||||
}
|
||||
if (name.isEmpty())
|
||||
return null;
|
||||
else
|
||||
return DamageType.valueOf(name);
|
||||
} catch (Exception e) {
|
||||
Logger.error(name);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// public String getName() {
|
||||
// return this.name;
|
||||
// }
|
||||
|
||||
public int getUUID() {
|
||||
return this.UUID;
|
||||
}
|
||||
|
||||
public String getIDString() {
|
||||
return this.IDString;
|
||||
}
|
||||
|
||||
public int getToken() {
|
||||
return this.token;
|
||||
}
|
||||
|
||||
public ConcurrentHashMap<String, Boolean> getSourceTypes() {
|
||||
return this.sourceTypes;
|
||||
}
|
||||
|
||||
public HashSet<AbstractEffectModifier> getModifiers() {
|
||||
|
||||
if (EffectsBase.modifiersMap.containsKey(this.IDString) == false)
|
||||
return EffectsBase.DefaultModifiers;
|
||||
|
||||
return EffectsBase.modifiersMap.get(this.IDString);
|
||||
}
|
||||
|
||||
public boolean isItemEffect() {
|
||||
return this.isItemEffect;
|
||||
}
|
||||
|
||||
public boolean isSpireEffect() {
|
||||
return this.isSpireEffect;
|
||||
}
|
||||
|
||||
public boolean ignoreMod() {
|
||||
return this.ignoreMod;
|
||||
}
|
||||
|
||||
public boolean dontSave() {
|
||||
return this.dontSave;
|
||||
}
|
||||
|
||||
public boolean isPrefix() {
|
||||
return this.isPrefix;
|
||||
}
|
||||
|
||||
public boolean isSuffix() {
|
||||
return this.isSuffix;
|
||||
}
|
||||
|
||||
public void startEffect(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||
|
||||
|
||||
|
||||
// Add SourceTypes for dispel
|
||||
|
||||
if (this.token != 0) {
|
||||
if (effect == null) {
|
||||
Logger.error("AbstractEffectModifier.applyEffectModifier: missing FinishEffectTimeJob");
|
||||
return;
|
||||
}
|
||||
// AbstractWorldObject source = effect.getSource();
|
||||
if (source == null) {
|
||||
Logger.error( "AbstractEffectModifier.applyEffectModifier: missing source");
|
||||
return;
|
||||
}
|
||||
PowersBase pb = effect.getPower();
|
||||
if (pb == null) {
|
||||
Logger.error( "AbstractEffectModifier.applyEffectModifier: missing power");
|
||||
return;
|
||||
}
|
||||
ActionsBase ab = effect.getAction();
|
||||
if (ab == null) {
|
||||
Logger.error( "AbstractEffectModifier.applyEffectModifier: missing action");
|
||||
return;
|
||||
}
|
||||
|
||||
//don't send effect if dead, except for death shroud
|
||||
if (!awo.isAlive()) {
|
||||
if (pb.getToken() != 1672601862)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!effect.skipSendEffect()) {
|
||||
// float duration = (pb.isChant()) ? pb.getChantDuration() * 1000 : ab.getDuration(trains);
|
||||
float duration = ab.getDurationInSeconds(trains);
|
||||
if (pb.getToken() == 1672601862){
|
||||
|
||||
Effect eff = awo.getEffects().get("DeathShroud");
|
||||
|
||||
|
||||
|
||||
|
||||
if (eff != null) {
|
||||
JobContainer jc = eff.getJobContainer();
|
||||
|
||||
|
||||
if (jc != null){
|
||||
duration = jc.timeOfExection() - System.currentTimeMillis();
|
||||
duration *= .001f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (duration > 0f) {
|
||||
int removeToken = this.token;
|
||||
ApplyEffectMsg pum = new ApplyEffectMsg();
|
||||
if (effect.getAction() != null)
|
||||
if ( effect.getAction().getPowerAction() != null
|
||||
&& PowersManager.ActionTokenByIDString.containsKey(effect.getAction().getPowerAction().getIDString()))
|
||||
try{
|
||||
removeToken = PowersManager.ActionTokenByIDString.get(effect.getAction().getPowerAction().getIDString());
|
||||
}catch(Exception e){
|
||||
removeToken = this.token;
|
||||
}
|
||||
|
||||
pum.setEffectID(removeToken);
|
||||
pum.setSourceType(source.getObjectType().ordinal());
|
||||
pum.setSourceID(source.getObjectUUID());
|
||||
pum.setTargetType(awo.getObjectType().ordinal());
|
||||
pum.setTargetID(awo.getObjectUUID());
|
||||
pum.setNumTrains(trains);
|
||||
pum.setDuration((int) duration);
|
||||
// pum.setDuration((pb.isChant()) ? (int)pb.getChantDuration() : ab.getDurationInSeconds(trains));
|
||||
pum.setPowerUsedID(pb.getToken());
|
||||
pum.setPowerUsedName(pb.getName());
|
||||
DispatchMessage.sendToAllInRange(awo, pum);
|
||||
}
|
||||
|
||||
if (awo.getObjectType().equals(GameObjectType.Item)) {
|
||||
if (source.getCharItemManager() != null) {
|
||||
source.getCharItemManager().updateInventory();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// call modifiers to do their job
|
||||
if (!effect.skipApplyEffect()) {
|
||||
for (AbstractEffectModifier em : this.getModifiers())
|
||||
em.applyEffectModifier(source, awo, trains, effect);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send end effect message to client
|
||||
public void endEffect(AbstractWorldObject source, AbstractWorldObject awo, int trains, PowersBase pb, AbstractEffectJob effect) {
|
||||
if (awo == null) {
|
||||
Logger.error("endEffect(): Null AWO object passed in.");
|
||||
return;
|
||||
}
|
||||
if (pb == null) {
|
||||
Logger.error("endEffect(): Null PowerBase object passed in.");
|
||||
return;
|
||||
}
|
||||
if (!effect.skipCancelEffect() && !effect.isNoOverwrite()) {
|
||||
|
||||
int sendToken = this.token;
|
||||
|
||||
if (effect.getAction() != null)
|
||||
if ( effect.getAction().getPowerAction() != null
|
||||
&& PowersManager.ActionTokenByIDString.containsKey(effect.getAction().getPowerAction().getIDString()))
|
||||
try{
|
||||
sendToken = PowersManager.ActionTokenByIDString.get(effect.getAction().getPowerAction().getIDString());
|
||||
}catch(Exception e){
|
||||
sendToken = this.token;
|
||||
}
|
||||
ApplyEffectMsg pum = new ApplyEffectMsg();
|
||||
pum.setEffectID(sendToken);
|
||||
if (source != null) {
|
||||
pum.setSourceType(source.getObjectType().ordinal());
|
||||
pum.setSourceID(source.getObjectUUID());
|
||||
} else {
|
||||
pum.setSourceType(0);
|
||||
pum.setSourceID(0);
|
||||
}
|
||||
pum.setTargetType(awo.getObjectType().ordinal());
|
||||
pum.setTargetID(awo.getObjectUUID());
|
||||
pum.setUnknown02(2);
|
||||
pum.setNumTrains(0);
|
||||
pum.setDuration(-1);
|
||||
pum.setPowerUsedID(pb.getToken());
|
||||
pum.setPowerUsedName(pb.getName());
|
||||
DispatchMessage.sendToAllInRange(awo, pum);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void endEffectNoPower(int trains, AbstractEffectJob effect) {
|
||||
|
||||
AbstractWorldObject source = effect.getSource();
|
||||
|
||||
if (source == null)
|
||||
return;
|
||||
|
||||
if (!effect.skipCancelEffect() && !effect.isNoOverwrite()) {
|
||||
ApplyEffectMsg pum = new ApplyEffectMsg();
|
||||
pum.setEffectID(this.token);
|
||||
|
||||
pum.setSourceType(source.getObjectType().ordinal());
|
||||
pum.setSourceID(source.getObjectUUID());
|
||||
pum.setTargetType(source.getObjectType().ordinal());
|
||||
pum.setTargetID(source.getObjectUUID());
|
||||
pum.setUnknown02(2);
|
||||
pum.setNumTrains(0);
|
||||
pum.setDuration(-1);
|
||||
pum.setUnknown06((byte)1);
|
||||
pum.setEffectSourceType(effect.getEffectSourceType());
|
||||
pum.setEffectSourceID(effect.getEffectSourceID());
|
||||
pum.setPowerUsedID(0);
|
||||
pum.setPowerUsedName(this.name);
|
||||
|
||||
if (source.getObjectType() == GameObjectType.PlayerCharacter){
|
||||
Dispatch dispatch = Dispatch.borrow((PlayerCharacter)source, pum);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void sendEffect(AbstractEffectJob effect, int duration, ClientConnection conn) {
|
||||
if (effect == null && conn != null)
|
||||
return;
|
||||
|
||||
if (conn == null)
|
||||
return;
|
||||
AbstractWorldObject source = effect.getSource();
|
||||
AbstractWorldObject awo = effect.getTarget();
|
||||
int trains = effect.getTrains();
|
||||
if (source == null || awo == null)
|
||||
return;
|
||||
|
||||
if (this.token != 0) {
|
||||
PowersBase pb = effect.getPower();
|
||||
if (pb == null) {
|
||||
Logger.error( "AbstractEffectModifier.applyEffectModifier: missing power");
|
||||
return;
|
||||
}
|
||||
ActionsBase ab = effect.getAction();
|
||||
if (ab == null) {
|
||||
Logger.error("AbstractEffectModifier.applyEffectModifier: missing action");
|
||||
return;
|
||||
}
|
||||
|
||||
//don't send effect if dead, except for death shroud
|
||||
if (!awo.isAlive()) {
|
||||
if (pb.getToken() != 1672601862)
|
||||
return;
|
||||
}
|
||||
|
||||
//duration for damage over times is (total time - (number of ticks x 5 seconds per tick))
|
||||
if (effect instanceof DamageOverTimeJob)
|
||||
duration = ((DamageOverTimeJob)effect).getTickLength();
|
||||
|
||||
// float dur = (pb.isChant()) ? pb.getChantDuration() * 1000 : ab.getDuration(trains);
|
||||
float dur = ab.getDuration(trains);
|
||||
if (dur > 0f) {
|
||||
ApplyEffectMsg pum = new ApplyEffectMsg();
|
||||
pum.setEffectID(this.token);
|
||||
pum.setSourceType(source.getObjectType().ordinal());
|
||||
pum.setSourceID(source.getObjectUUID());
|
||||
pum.setTargetType(awo.getObjectType().ordinal());
|
||||
pum.setTargetID(awo.getObjectUUID());
|
||||
pum.setNumTrains(trains);
|
||||
pum.setDuration(duration);
|
||||
pum.setPowerUsedID(pb.getToken());
|
||||
pum.setPowerUsedName(pb.getName());
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(conn.getPlayerCharacter(), pum);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void sendEffectNoPower(AbstractEffectJob effect, int duration, ClientConnection conn) {
|
||||
|
||||
if (effect == null && conn != null)
|
||||
return;
|
||||
|
||||
if (conn == null)
|
||||
return;
|
||||
|
||||
AbstractWorldObject source = effect.getSource();
|
||||
AbstractWorldObject awo = effect.getTarget();
|
||||
int trains = effect.getTrains();
|
||||
|
||||
if (source == null || awo == null)
|
||||
return;
|
||||
|
||||
if (this.token != 0) {
|
||||
//don't send effect if dead, except for death shroud
|
||||
if (!awo.isAlive()) {
|
||||
return;
|
||||
}
|
||||
|
||||
//duration for damage over times is (total time - (number of ticks x 5 seconds per tick))
|
||||
if (effect instanceof DamageOverTimeJob)
|
||||
duration = ((DamageOverTimeJob)effect).getTickLength();
|
||||
else if (effect instanceof FinishSpireEffectJob)
|
||||
duration = 45;
|
||||
else if (effect instanceof NoTimeJob)
|
||||
duration = -1;
|
||||
|
||||
// float dur = (pb.isChant()) ? pb.getChantDuration() * 1000 : ab.getDuration(trains);
|
||||
|
||||
ApplyEffectMsg pum = new ApplyEffectMsg();
|
||||
pum.setEffectID(this.token);
|
||||
pum.setSourceType(source.getObjectType().ordinal());
|
||||
pum.setSourceID(source.getObjectUUID());
|
||||
pum.setTargetType(source.getObjectType().ordinal());
|
||||
pum.setTargetID(source.getObjectUUID());
|
||||
pum.setUnknown06((byte)1);
|
||||
pum.setEffectSourceType(effect.getEffectSourceType());
|
||||
pum.setEffectSourceID(effect.getEffectSourceID());
|
||||
pum.setNumTrains(trains);
|
||||
pum.setDuration(duration);
|
||||
pum.setPowerUsedID(0);
|
||||
pum.setPowerUsedName(this.name);
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(conn.getPlayerCharacter(), pum);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public boolean containsSource(EffectSourceType sourceType) {
|
||||
if (EffectsBase.effectSourceTypeMap.containsKey(this.token) == false)
|
||||
return false;
|
||||
return EffectsBase.effectSourceTypeMap.get(this.token).contains(sourceType);
|
||||
|
||||
}
|
||||
|
||||
public boolean cancelOnAttack() {
|
||||
return this.cancelOnAttack;
|
||||
}
|
||||
|
||||
public boolean cancelOnAttackSwing() {
|
||||
return this.cancelOnAttackSwing;
|
||||
}
|
||||
|
||||
public boolean cancelOnCast() {
|
||||
return this.cancelOnCast;
|
||||
}
|
||||
|
||||
public boolean cancelOnCastSpell() {
|
||||
return this.cancelOnCastSpell;
|
||||
}
|
||||
|
||||
public boolean cancelOnEquipChange() {
|
||||
return this.cancelOnEquipChange;
|
||||
}
|
||||
|
||||
public boolean cancelOnLogout() {
|
||||
return this.cancelOnLogout;
|
||||
}
|
||||
|
||||
public boolean cancelOnMove() {
|
||||
return this.cancelOnMove;
|
||||
}
|
||||
|
||||
public boolean cancelOnNewCharm() {
|
||||
return this.cancelOnNewCharm;
|
||||
}
|
||||
|
||||
public boolean cancelOnSit() {
|
||||
return this.cancelOnSit;
|
||||
}
|
||||
|
||||
public boolean cancelOnTakeDamage() {
|
||||
return this.cancelOnTakeDamage;
|
||||
}
|
||||
|
||||
public boolean cancelOnTerritoryClaim() {
|
||||
return this.cancelOnTerritoryClaim;
|
||||
}
|
||||
|
||||
public boolean cancelOnUnEquip() {
|
||||
return this.cancelOnUnEquip;
|
||||
}
|
||||
|
||||
//For Debugging purposes.
|
||||
public void setToken(int token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public static String getItemEffectsByName(String string) {
|
||||
if (EffectsBase.itemEffectsByName.containsKey(string))
|
||||
return EffectsBase.itemEffectsByName.get(string);
|
||||
return "";
|
||||
}
|
||||
|
||||
public static void addItemEffectsByName(String name, String ID) {
|
||||
EffectsBase.itemEffectsByName.put(name, ID);
|
||||
}
|
||||
|
||||
public String getDamageTypes() {
|
||||
String text = "";
|
||||
if (!EffectsBase.EffectDamageTypes.containsKey(this.token))
|
||||
return text;
|
||||
for (DamageType type: EffectsBase.EffectDamageTypes.get(this.token)) {
|
||||
text += type.name() + ' ';
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name){
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public float getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(float Value){
|
||||
this.value = Value;
|
||||
}
|
||||
public ConcurrentHashMap<ItemBase,Integer> getResourcesForEffect() {
|
||||
if (this.resourceCosts.isEmpty()){
|
||||
ArrayList<EffectsResourceCosts> effectsCostList = DbManager.EffectsResourceCostsQueries.GET_ALL_EFFECT_RESOURCES(this.IDString);
|
||||
for (EffectsResourceCosts erc : effectsCostList){
|
||||
this.resourceCosts.put(ItemBase.getItemBase(erc.getResourceID()), erc.getAmount());
|
||||
}
|
||||
}
|
||||
return this.resourceCosts;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers;
|
||||
|
||||
import engine.objects.PreparedStatementShared;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class FailCondition {
|
||||
|
||||
private String IDString;
|
||||
private Boolean forPower;
|
||||
private String type;
|
||||
private float amount;
|
||||
private float ramp;
|
||||
private boolean rampAdd;
|
||||
|
||||
// private String damageType1;
|
||||
// private String damageType2;
|
||||
// private String damageType3;
|
||||
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
*/
|
||||
public FailCondition() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public FailCondition(ResultSet rs) throws SQLException {
|
||||
|
||||
this.IDString = rs.getString("IDString");
|
||||
this.forPower = (rs.getString("powerOrEffect").equals("Power")) ? true : false;
|
||||
this.type = rs.getString("type");
|
||||
this.amount = rs.getFloat("amount");
|
||||
this.ramp = rs.getFloat("ramp");
|
||||
this.rampAdd = (rs.getInt("useAddFormula") == 1) ? true : false;
|
||||
// this.damageType1 = rs.getString("damageType1");
|
||||
// this.damageType2 = rs.getString("damageType2");
|
||||
// this.damageType3 = rs.getString("damageType3");
|
||||
}
|
||||
|
||||
public static ArrayList<FailCondition> getAllFailConditions() {
|
||||
PreparedStatementShared ps = null;
|
||||
ArrayList<FailCondition> out = new ArrayList<>();
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM failconditions");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
while (rs.next()) {
|
||||
FailCondition toAdd = new FailCondition(rs);
|
||||
out.add(toAdd);
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error( e);
|
||||
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
public String getIDString() {
|
||||
return this.IDString;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
public boolean forPower() {
|
||||
return this.forPower;
|
||||
}
|
||||
|
||||
public float getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
public float getRamp() {
|
||||
return this.ramp;
|
||||
}
|
||||
|
||||
public float getAmountForTrains(float trains) {
|
||||
if (this.rampAdd)
|
||||
return this.amount + (this.ramp * trains);
|
||||
else
|
||||
return this.amount * (1 + (this.ramp * trains));
|
||||
}
|
||||
|
||||
public boolean useRampAdd() {
|
||||
return this.rampAdd;
|
||||
}
|
||||
|
||||
// public String getDamageType1() {
|
||||
// return this.damageType1;
|
||||
// }
|
||||
|
||||
// public String getDamageType2() {
|
||||
// return this.damageType2;
|
||||
// }
|
||||
|
||||
// public String getDamageType3() {
|
||||
// return this.damageType3;
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers;
|
||||
|
||||
import engine.objects.PreparedStatementShared;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class PowerPrereq {
|
||||
|
||||
private String effect;
|
||||
private String message;
|
||||
private boolean mainHand;
|
||||
private boolean required;
|
||||
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
*/
|
||||
public PowerPrereq() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public PowerPrereq(ResultSet rs, int type) throws SQLException {
|
||||
|
||||
// this.IDString = rs.getString("IDString");
|
||||
if (type == 1) {
|
||||
this.effect = rs.getString("messageone");
|
||||
this.message = rs.getString("messagetwo");
|
||||
this.mainHand = false;
|
||||
this.required = false;
|
||||
} else if (type == 2) {
|
||||
String sl = rs.getString("messageone");
|
||||
if (sl.equals("RHELD"))
|
||||
this.mainHand = true;
|
||||
else if (sl.equals("LHELD"))
|
||||
this.mainHand = false;
|
||||
this.effect = "";
|
||||
this.message = rs.getString("messagetwo");
|
||||
this.required = (rs.getInt("required") == 1) ? true : false;
|
||||
} else { //targetEffectPrereq
|
||||
this.effect = rs.getString("messageone");
|
||||
this.message = "";
|
||||
this.mainHand = false;
|
||||
this.required = (rs.getInt("required") == 1) ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void getAllPowerPrereqs(HashMap<String, PowersBase> powers) {
|
||||
PreparedStatementShared ps = null;
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_powercastprereq");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
int type; String IDString; PowerPrereq toAdd; PowersBase pb;
|
||||
while (rs.next()) {
|
||||
IDString = rs.getString("IDString");
|
||||
pb = powers.get(IDString);
|
||||
if (pb != null) {
|
||||
type = rs.getInt("Type");
|
||||
toAdd = new PowerPrereq(rs, type);
|
||||
if (type == 1)
|
||||
pb.getEffectPrereqs().add(toAdd);
|
||||
else if (type == 2)
|
||||
pb.getEquipPrereqs().add(toAdd);
|
||||
else
|
||||
pb.getTargetEffectPrereqs().add(toAdd);
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error( e.toString());
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
}
|
||||
|
||||
public String getEffect() {
|
||||
return this.effect;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return this.message;
|
||||
}
|
||||
|
||||
public boolean mainHand() {
|
||||
return this.mainHand;
|
||||
}
|
||||
|
||||
public boolean isRequired() {
|
||||
return this.required;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,700 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers;
|
||||
|
||||
import engine.Enum.PowerCategoryType;
|
||||
import engine.Enum.PowerTargetType;
|
||||
import engine.objects.PreparedStatementShared;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class PowersBase {
|
||||
|
||||
public int UUID;
|
||||
public String name;
|
||||
public int token;
|
||||
public String IDString;
|
||||
public String category;
|
||||
public int skillID;
|
||||
public float range;
|
||||
public float cost;
|
||||
public float costRamp;
|
||||
public float castTime;
|
||||
public float castTimeRamp;
|
||||
public float cooldown;
|
||||
public float recycleTime;
|
||||
public float recycleRamp;
|
||||
public int maxTrains;
|
||||
public float hateValue;
|
||||
public float hateRamp;
|
||||
public String monsterTypePrereq; // target limited to these types
|
||||
public String skillName;
|
||||
public float weaponRange = 15f;
|
||||
|
||||
// aoe related
|
||||
public boolean isAOE = true;
|
||||
public boolean useCone = false;
|
||||
public boolean usePointBlank = false;
|
||||
public boolean useSphere = false;
|
||||
public float radius;
|
||||
public byte groupReq; // who the spell won't hit
|
||||
public int maxNumMobTargets;
|
||||
public int maxNumPlayerTargets;
|
||||
|
||||
// chant related
|
||||
public float chantDuration;
|
||||
public int chantIterations;
|
||||
|
||||
// valid target types from targetType field
|
||||
public boolean targetPlayer = false;
|
||||
public boolean targetMob = false;
|
||||
public boolean targetPet = false;
|
||||
public boolean targetNecroPet = false;
|
||||
public boolean targetSelf = false;
|
||||
public boolean targetWeapon = false;
|
||||
public boolean targetCorpse = false;
|
||||
public boolean targetBuilding = false;
|
||||
public boolean targetGroup = false;
|
||||
public boolean targetGuildLeader = false;
|
||||
public boolean targetJewelry = false;
|
||||
public boolean targetArmor = false;
|
||||
public boolean targetItem = false;
|
||||
|
||||
|
||||
// flags
|
||||
public boolean isCasterFriendly = false; // from groupReq
|
||||
public boolean isGroupFriendly = false; // from groupReq
|
||||
public boolean isGroupOnly = false; // from groupReq
|
||||
public boolean mustHitPets = false; // from groupReq
|
||||
public boolean isNationFriendly = false; // from groupReq
|
||||
public boolean targetFromLastTarget = false; // from unknown06
|
||||
public boolean targetFromSelf = false; // from unknown06
|
||||
public boolean targetFromName = false; // from unknown06
|
||||
public boolean targetFromNearbyMobs = false; // from unknown06
|
||||
public boolean useHealth = false; // from costType
|
||||
public boolean useMana = false; // from costType
|
||||
public boolean useStamina = false; // from costType
|
||||
public boolean isSpell = true; // from skillOrSpell field
|
||||
public boolean allowedInCombat = false; // from combat field
|
||||
public boolean allowedOutOfCombat = false; // from combat field
|
||||
public boolean regularPlayerCanCast = false; // from grantOverrideVar
|
||||
public boolean hateRampAdd = true; // 1 bit flag
|
||||
public boolean costRampAdd = true; // 2 bit flag
|
||||
public boolean recycleRampAdd = true; // 4 bit flag
|
||||
public boolean initRampAdd = true; // 8 bit flag
|
||||
public boolean canCastWhileMoving = false; // 16 bit flag
|
||||
public boolean canCastWhileFlying = false; // 32 bit flag
|
||||
public boolean isChant = false; // 64 bit flag
|
||||
public boolean losCheck = false; // 128 bit flag
|
||||
public boolean sticky = false; // 256 bit flag
|
||||
public boolean isAdminPower = false; // 512 bit flag
|
||||
public boolean requiresHitRoll = false; // 1024 bit flag
|
||||
public boolean isWeaponPower = false; // from category
|
||||
public boolean isHeal = false; //from category
|
||||
public boolean isTrack = false; //from category
|
||||
public boolean isHarmful = true;
|
||||
public boolean vampDrain = false;
|
||||
|
||||
public boolean cancelOnCastSpell = false;
|
||||
public boolean cancelOnTakeDamage = false;
|
||||
|
||||
public final ArrayList<String> monsterTypeRestrictions = new ArrayList<>();
|
||||
public final ArrayList<ActionsBase> actions = new ArrayList<>();
|
||||
public final ArrayList<PowerPrereq> effectPrereqs = new ArrayList<>();
|
||||
public final ArrayList<PowerPrereq> targetEffectPrereqs = new ArrayList<>();
|
||||
public final ArrayList<PowerPrereq> equipPrereqs = new ArrayList<>();
|
||||
|
||||
public PowerTargetType targetType;
|
||||
public PowerCategoryType powerCategory;
|
||||
public String description;
|
||||
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
*/
|
||||
public PowersBase() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public PowersBase(ResultSet rs) throws SQLException {
|
||||
|
||||
this.UUID = rs.getInt("ID");
|
||||
this.name = rs.getString("name").trim();
|
||||
this.token = rs.getInt("token");
|
||||
this.skillName = rs.getString("skillName").trim();
|
||||
this.IDString = rs.getString("IDString").trim();
|
||||
this.isSpell = (rs.getString("skillOrSpell").equals("SPELL")) ? true : false;
|
||||
this.skillID = rs.getInt("skillID");
|
||||
this.range = rs.getFloat("range");
|
||||
this.description = (rs.getString("description")).trim().replace("\r\n ", "");
|
||||
String ct = rs.getString("costType").trim();
|
||||
if (ct.equals("HEALTH"))
|
||||
this.useHealth = true;
|
||||
else if (ct.equals("MANA"))
|
||||
this.useMana = true;
|
||||
else if (ct.equals("STAMINA"))
|
||||
this.useStamina = true;
|
||||
ct = rs.getString("targetType").trim();
|
||||
if (ct.equals("BUILDING"))
|
||||
this.targetBuilding = true;
|
||||
else if (ct.equals("CORPSE"))
|
||||
this.targetCorpse = true;
|
||||
else if (ct.equals("GROUP"))
|
||||
this.targetGroup = true;
|
||||
else if (ct.equals("GUILDLEADER"))
|
||||
this.targetGuildLeader = true;
|
||||
else if (ct.equals("MOBILE")) {
|
||||
this.targetMob = true;
|
||||
this.targetPet = true; // sure on this one?
|
||||
} else if (ct.equals("PC"))
|
||||
this.targetPlayer = true;
|
||||
else if (ct.equals("SELF"))
|
||||
this.targetSelf = true;
|
||||
else if (ct.equals("PET"))
|
||||
this.targetPet = true;
|
||||
else if (ct.equals("NECROPET"))
|
||||
this.targetNecroPet = true;
|
||||
else if (ct.equals("ARMOR"))
|
||||
this.targetArmor = true;
|
||||
else if (ct.equals("WEAPON"))
|
||||
this.targetWeapon = true;
|
||||
else if (ct.equals("JEWELRY"))
|
||||
this.targetJewelry = true;
|
||||
else if (ct.equals("ITEM")) {
|
||||
this.targetItem = true;
|
||||
this.targetJewelry = true;
|
||||
this.targetArmor = true;
|
||||
this.targetWeapon = true;
|
||||
} else if (ct.equals("ARMORWEAPONJEWELRY")) {
|
||||
this.targetArmor = true;
|
||||
this.targetWeapon = true;
|
||||
this.targetJewelry = true;
|
||||
} else if (ct.equals("PCMOBILE")) {
|
||||
this.targetPlayer = true;
|
||||
this.targetMob = true;
|
||||
this.targetPet = true; // sure on this one?
|
||||
} else if (ct.equals("WEAPONARMOR")) {
|
||||
this.targetWeapon = true;
|
||||
this.targetArmor = true;
|
||||
} else {
|
||||
Logger.info("Missed " + ct + " targetType");
|
||||
}
|
||||
String cat = rs.getString("category").trim();
|
||||
this.category = cat;
|
||||
|
||||
|
||||
if (cat.isEmpty())
|
||||
this.powerCategory = PowerCategoryType.NONE;
|
||||
else
|
||||
this.powerCategory = PowerCategoryType.valueOf(cat.replace("-", ""));
|
||||
|
||||
|
||||
|
||||
|
||||
if (cat.equals("WEAPON")) {
|
||||
this.isWeaponPower = true;
|
||||
this.isHarmful = false;
|
||||
if (this.skillName.equals("Bow") || this.skillName.equals("Crossbow") || this.skillName.equals("Archery"))
|
||||
this.weaponRange = 1000f;
|
||||
else if (this.skillName.equals("Throwing"))
|
||||
this.weaponRange = 60f;
|
||||
else
|
||||
this.weaponRange = 15f;
|
||||
} else if (cat.equals("HEAL") || cat.equals("GROUPHEAL")) {
|
||||
this.isHeal = true;
|
||||
this.isHarmful = false;
|
||||
} else if (cat.equals("TRACK")) {
|
||||
this.isTrack = true;
|
||||
this.isHarmful = false;
|
||||
} else if (cat.equals("AE") || cat.equals("AEDAMAGE") ||
|
||||
cat.equals("BREAKFLY") ||
|
||||
cat.equals("DAMAGE") || cat.equals("DEBUFF") ||
|
||||
cat.equals("MOVE") || cat.equals("SPECIAL") ||
|
||||
cat.equals("SPIREDISABLE"))
|
||||
this.isHarmful = true;
|
||||
else if (cat.equals("CHANT")) {
|
||||
this.isHarmful = ct.equals("MOBILE") || ct.equals("PC") || ct.equals("PCMOBILE");
|
||||
} else if (cat.equals("DISPEL")) {
|
||||
//TODO this needs broken down better later
|
||||
this.isHarmful = false;
|
||||
} else if (cat.isEmpty()) {
|
||||
if (ct.equals("MOBILE") || ct.equals("PCMOBILE"))
|
||||
this.isHarmful = true;
|
||||
else if (ct.equals("PC")) {
|
||||
this.isHarmful = this.token != 429607195 && this.token != 429425915;
|
||||
} else
|
||||
this.isHarmful = false;
|
||||
} else
|
||||
this.isHarmful = false;
|
||||
|
||||
if (cat.equals("VAMPDRAIN")) {
|
||||
this.vampDrain = true;
|
||||
this.isHarmful = true;
|
||||
}
|
||||
|
||||
this.cost = rs.getFloat("cost");
|
||||
this.costRamp = rs.getFloat("costRamp");
|
||||
this.castTime = rs.getFloat("castTime");
|
||||
this.castTimeRamp = rs.getFloat("initRamp");
|
||||
this.cooldown = rs.getFloat("cooldown");
|
||||
this.recycleTime = rs.getFloat("recycleTime");
|
||||
this.recycleRamp = rs.getFloat("recycleRamp");
|
||||
this.maxTrains = rs.getInt("maxTrains");
|
||||
this.hateValue = rs.getFloat("hateValue");
|
||||
this.hateRamp = rs.getFloat("hateRamp");
|
||||
ct = rs.getString("unknown06").trim();
|
||||
if (this.targetSelf) {
|
||||
} else if (ct.equals("CLICK"))
|
||||
if (!this.targetGroup)
|
||||
this.targetFromLastTarget = true;
|
||||
else if (ct.equals("NAME"))
|
||||
this.targetFromName = true;
|
||||
else if (ct.equals("NEARBYMOBS"))
|
||||
this.targetFromNearbyMobs = true;
|
||||
this.monsterTypePrereq = rs.getString("monsterTypePrereqs").trim();
|
||||
ct = rs.getString("radiusType").trim();
|
||||
if (ct.equals("CONE"))
|
||||
this.useCone = true;
|
||||
else if (ct.equals("POINTBLANK"))
|
||||
this.usePointBlank = true;
|
||||
else if (ct.equals("SPHERE"))
|
||||
this.useSphere = true;
|
||||
else
|
||||
this.isAOE = false;
|
||||
this.radius = rs.getFloat("radius");
|
||||
ct = rs.getString("groupReq").trim();
|
||||
if (ct.equals("CASTER"))
|
||||
this.isCasterFriendly = true;
|
||||
else if (ct.equals("GROUP")) {
|
||||
this.isGroupFriendly = true;
|
||||
this.isCasterFriendly = true;
|
||||
}
|
||||
else if (ct.equals("ALLBUTGROUP"))
|
||||
this.isGroupOnly = true;
|
||||
else if (ct.equals("ALLBUTPETS"))
|
||||
this.mustHitPets = true;
|
||||
else if (ct.equals("NATION")) {
|
||||
this.isNationFriendly = true;
|
||||
this.isCasterFriendly = true;
|
||||
}
|
||||
this.maxNumMobTargets = rs.getInt("maxNumMobTargets");
|
||||
this.maxNumPlayerTargets = rs.getInt("maxNumPlayerTargets");
|
||||
this.chantDuration = rs.getFloat("chantDuration");
|
||||
this.chantIterations = rs.getInt("chantIterations");
|
||||
ct = rs.getString("combat").trim();
|
||||
if (ct.equals("COMBAT"))
|
||||
this.allowedInCombat = true;
|
||||
else if (ct.equals("NONCOMBAT"))
|
||||
this.allowedOutOfCombat = true;
|
||||
else if (ct.equals("BOTH")) {
|
||||
this.allowedInCombat = true;
|
||||
this.allowedOutOfCombat = true;
|
||||
}
|
||||
ct = rs.getString("grantOverideVar").trim();
|
||||
if (ct.equals("PGOV_PLAYER"))
|
||||
this.regularPlayerCanCast = true;
|
||||
int flags = rs.getInt("flags");
|
||||
if ((flags & 1) == 0)
|
||||
this.hateRampAdd = false;
|
||||
if ((flags & 2) == 0)
|
||||
this.costRampAdd = false;
|
||||
if ((flags & 4) == 0)
|
||||
this.recycleRampAdd = false;
|
||||
if ((flags & 8) == 0)
|
||||
this.initRampAdd = false;
|
||||
if ((flags & 16) != 0)
|
||||
this.canCastWhileMoving = true;
|
||||
if ((flags & 32) != 0)
|
||||
this.canCastWhileFlying = true;
|
||||
if ((flags & 64) != 0)
|
||||
this.isChant = true;
|
||||
if ((flags & 128) != 0)
|
||||
this.losCheck = true;
|
||||
if ((flags & 256) != 0)
|
||||
this.sticky = true;
|
||||
if ((flags & 512) != 0)
|
||||
this.isAdminPower = true;
|
||||
if ((flags & 1024) != 0)
|
||||
this.requiresHitRoll = true;
|
||||
ct = rs.getString("monsterTypeRestrict1").trim();
|
||||
if (!ct.isEmpty())
|
||||
this.monsterTypeRestrictions.add(ct);
|
||||
ct = rs.getString("monsterTypeRestrict2").trim();
|
||||
if (!ct.isEmpty())
|
||||
this.monsterTypeRestrictions.add(ct);
|
||||
ct = rs.getString("monsterTypeRestrict3").trim();
|
||||
if (!ct.isEmpty())
|
||||
this.monsterTypeRestrictions.add(ct);
|
||||
}
|
||||
|
||||
public static ArrayList<PowersBase> getAllPowersBase() {
|
||||
PreparedStatementShared ps = null;
|
||||
ArrayList<PowersBase> out = new ArrayList<>();
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_powerbase");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
while (rs.next()) {
|
||||
PowersBase toAdd = new PowersBase(rs);
|
||||
out.add(toAdd);
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error( e.toString());
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
||||
public static void getFailConditions(HashMap<String, PowersBase> powers) {
|
||||
PreparedStatementShared ps = null;
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT IDString, type FROM static_power_failcondition where powerOrEffect = 'Power'");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
String type, IDString; PowersBase pb;
|
||||
while (rs.next()) {
|
||||
type = rs.getString("type");
|
||||
IDString = rs.getString("IDString");
|
||||
pb = powers.get(IDString);
|
||||
if (pb != null) {
|
||||
switch (type) {
|
||||
case "CastSpell":
|
||||
pb.cancelOnCastSpell = true;
|
||||
break;
|
||||
case "TakeDamage":
|
||||
pb.cancelOnTakeDamage = true;
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
Logger.error("null power for Grief " + IDString);
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error( e.toString());
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public int getMaxTrains() {
|
||||
return this.maxTrains;
|
||||
}
|
||||
|
||||
public int getUUID() {
|
||||
return this.UUID;
|
||||
}
|
||||
|
||||
public String getIDString() {
|
||||
return this.IDString;
|
||||
}
|
||||
|
||||
public int getToken() {
|
||||
if (this.IDString.equals("BLEED-DOT-10.5-RANGE"))
|
||||
return -369682965;
|
||||
return this.token;
|
||||
}
|
||||
|
||||
public int getCastTime(int trains) { // returns cast time in ms
|
||||
if (this.initRampAdd)
|
||||
return (int) ((this.castTime + (this.castTimeRamp * trains)) * 1000);
|
||||
else
|
||||
return (int) ((this.castTime * (1 + (this.castTimeRamp * trains))) * 1000);
|
||||
}
|
||||
|
||||
public int getRecycleTime(int trains) { // returns cast time in ms
|
||||
if (this.recycleRampAdd)
|
||||
return (int) (((this.recycleTime + (this.recycleRamp * trains)) * 1000) + getCastTime(trains));
|
||||
else
|
||||
return (int) (((this.recycleTime * (1 + (this.recycleRamp * trains))) * 1000) + getCastTime(trains));
|
||||
}
|
||||
|
||||
// public ArrayList<FailCondition> getConditions() {
|
||||
// return this.conditions;
|
||||
// }
|
||||
|
||||
public ArrayList<PowerPrereq> getEffectPrereqs() {
|
||||
return this.effectPrereqs;
|
||||
}
|
||||
|
||||
public ArrayList<PowerPrereq> getTargetEffectPrereqs() {
|
||||
return this.targetEffectPrereqs;
|
||||
}
|
||||
|
||||
public ArrayList<PowerPrereq> getEquipPrereqs() {
|
||||
return this.equipPrereqs;
|
||||
}
|
||||
|
||||
public ArrayList<ActionsBase> getActions() {
|
||||
return this.actions;
|
||||
}
|
||||
|
||||
public boolean usePointBlank() {
|
||||
return this.usePointBlank;
|
||||
}
|
||||
|
||||
public float getRadius() {
|
||||
return this.radius;
|
||||
}
|
||||
|
||||
public int getMaxNumMobTargets() {
|
||||
return this.maxNumMobTargets;
|
||||
}
|
||||
|
||||
public int getMaxNumPlayerTargets() {
|
||||
return this.maxNumPlayerTargets;
|
||||
}
|
||||
|
||||
public boolean cancelOnCastSpell() {
|
||||
return this.cancelOnCastSpell;
|
||||
}
|
||||
|
||||
public boolean cancelOnTakeDamage() {
|
||||
return this.cancelOnTakeDamage;
|
||||
}
|
||||
|
||||
public boolean allowedInCombat() {
|
||||
return this.allowedInCombat;
|
||||
}
|
||||
|
||||
public boolean allowedOutOfCombat() {
|
||||
return this.allowedOutOfCombat;
|
||||
}
|
||||
|
||||
public boolean isCasterFriendly() {
|
||||
return this.isCasterFriendly;
|
||||
}
|
||||
|
||||
public boolean isGroupFriendly() {
|
||||
return this.isGroupFriendly;
|
||||
}
|
||||
|
||||
public boolean isNationFriendly() {
|
||||
return this.isNationFriendly;
|
||||
}
|
||||
|
||||
public boolean isGroupOnly() {
|
||||
return this.isGroupOnly;
|
||||
}
|
||||
|
||||
public boolean mustHitPets() {
|
||||
return this.mustHitPets;
|
||||
}
|
||||
|
||||
public boolean targetFromLastTarget() {
|
||||
return this.targetFromLastTarget;
|
||||
}
|
||||
|
||||
public boolean targetFromSelf() {
|
||||
return this.targetFromSelf;
|
||||
}
|
||||
|
||||
public boolean targetFromName() {
|
||||
return this.targetFromName;
|
||||
}
|
||||
|
||||
public boolean targetFromNearbyMobs() {
|
||||
return this.targetFromNearbyMobs;
|
||||
}
|
||||
|
||||
public float getRange() {
|
||||
return this.range;
|
||||
}
|
||||
|
||||
public boolean requiresHitRoll() {
|
||||
return this.requiresHitRoll;
|
||||
}
|
||||
|
||||
public boolean regularPlayerCanCast() {
|
||||
return this.regularPlayerCanCast;
|
||||
}
|
||||
|
||||
public boolean isSpell() {
|
||||
return this.isSpell;
|
||||
}
|
||||
|
||||
public boolean isHarmful() {
|
||||
return this.isHarmful;
|
||||
}
|
||||
|
||||
public boolean targetPlayer() {
|
||||
return this.targetPlayer;
|
||||
}
|
||||
|
||||
public boolean targetMob() {
|
||||
return this.targetMob;
|
||||
}
|
||||
|
||||
public boolean targetPet() {
|
||||
return this.targetPet;
|
||||
}
|
||||
|
||||
public boolean targetNecroPet() {
|
||||
return this.targetNecroPet;
|
||||
}
|
||||
|
||||
public boolean targetSelf() {
|
||||
return this.targetSelf;
|
||||
}
|
||||
|
||||
public boolean targetCorpse() {
|
||||
return this.targetCorpse;
|
||||
}
|
||||
|
||||
public boolean targetBuilding() {
|
||||
return this.targetBuilding;
|
||||
}
|
||||
|
||||
public boolean targetGroup() {
|
||||
return this.targetGroup;
|
||||
}
|
||||
|
||||
public boolean targetGuildLeader() {
|
||||
return this.targetGuildLeader;
|
||||
}
|
||||
|
||||
public boolean targetJewelry() {
|
||||
return this.targetJewelry;
|
||||
}
|
||||
|
||||
public boolean targetArmor() {
|
||||
return this.targetArmor;
|
||||
}
|
||||
|
||||
public boolean targetWeapon() {
|
||||
return this.targetWeapon;
|
||||
}
|
||||
|
||||
public boolean targetItem() {
|
||||
return this.targetItem;
|
||||
}
|
||||
|
||||
public long getCooldown() {
|
||||
return (long) (this.cooldown * 1000); // return
|
||||
// in ms
|
||||
}
|
||||
|
||||
public boolean useHealth() {
|
||||
return this.useHealth;
|
||||
}
|
||||
|
||||
public boolean useMana() {
|
||||
return this.useMana;
|
||||
}
|
||||
|
||||
public boolean useStamina() {
|
||||
return this.useStamina;
|
||||
}
|
||||
|
||||
public float getCost(int trains) {
|
||||
if (this.costRampAdd)
|
||||
return this.cost + (this.costRamp * trains);
|
||||
else
|
||||
return this.cost * (1 + (this.costRamp * trains));
|
||||
|
||||
}
|
||||
|
||||
public float getHateValue() {
|
||||
return this.hateValue;
|
||||
}
|
||||
|
||||
public float getHateRamp() {
|
||||
return this.hateRamp;
|
||||
}
|
||||
|
||||
public float getHateValue(int trains) {
|
||||
return this.hateValue + (this.hateRamp * trains);
|
||||
}
|
||||
|
||||
public boolean canCastWhileMoving() {
|
||||
return this.canCastWhileMoving;
|
||||
}
|
||||
|
||||
public boolean canCastWhileFlying() {
|
||||
return this.canCastWhileFlying;
|
||||
}
|
||||
|
||||
public boolean isAOE() {
|
||||
return isAOE;
|
||||
}
|
||||
|
||||
public boolean isChant() {
|
||||
return isChant;
|
||||
}
|
||||
|
||||
public int getChantIterations() {
|
||||
return chantIterations;
|
||||
}
|
||||
|
||||
public float getChantDuration() {
|
||||
return chantDuration;
|
||||
}
|
||||
|
||||
public boolean isWeaponPower() {
|
||||
return isWeaponPower;
|
||||
}
|
||||
|
||||
public boolean isHeal() {
|
||||
return isHeal;
|
||||
}
|
||||
|
||||
public boolean isTrack() {
|
||||
return isTrack;
|
||||
}
|
||||
|
||||
public boolean vampDrain() {
|
||||
return vampDrain;
|
||||
}
|
||||
|
||||
public void setCancelOnCastSpell(boolean value) {
|
||||
this.cancelOnCastSpell = value;
|
||||
}
|
||||
|
||||
public void setCancelOnTakeDamage(boolean value) {
|
||||
this.cancelOnTakeDamage = value;
|
||||
}
|
||||
|
||||
public String getSkillName() {
|
||||
return this.skillName;
|
||||
}
|
||||
|
||||
public String getMonsterTypePrereq() {
|
||||
return this.monsterTypePrereq;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return this.category;
|
||||
}
|
||||
|
||||
public float getWeaponRange() {
|
||||
return this.weaponRange;
|
||||
}
|
||||
|
||||
public PowerCategoryType getPowerCategoryType(){
|
||||
return this.powerCategory;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
|
||||
//This package creates a list of AbstractWorldObjects
|
||||
//sorted by range from a specified point.
|
||||
public class RangeBasedAwo implements Comparable<RangeBasedAwo> {
|
||||
|
||||
private float range;
|
||||
private AbstractWorldObject awo;
|
||||
|
||||
public RangeBasedAwo(Float range, AbstractWorldObject awo) {
|
||||
super();
|
||||
this.range = range;
|
||||
this.awo = awo;
|
||||
}
|
||||
|
||||
public static HashSet<RangeBasedAwo> createList(HashSet<AbstractWorldObject> awolist, Vector3fImmutable searchLoc) {
|
||||
HashSet<RangeBasedAwo> rbal = new HashSet<>();
|
||||
for (AbstractWorldObject awo: awolist) {
|
||||
RangeBasedAwo rba = new RangeBasedAwo(searchLoc.distance(awo.getLoc()), awo);
|
||||
rbal.add(rba);
|
||||
}
|
||||
return rbal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(RangeBasedAwo obj) throws ClassCastException {
|
||||
return (int)(this.range - obj.range);
|
||||
}
|
||||
|
||||
public static HashSet<AbstractWorldObject> getSortedList(HashSet<AbstractWorldObject> awolist, Vector3fImmutable searchLoc, int maxPlayers, int maxMobs) {
|
||||
int playerCnt = 0;
|
||||
int mobCnt = 0;
|
||||
int maxCnt = (maxPlayers > maxMobs) ? maxPlayers : maxMobs;
|
||||
HashSet<RangeBasedAwo> rbal = RangeBasedAwo.createList(awolist, searchLoc);
|
||||
awolist = new HashSet<>();
|
||||
for (RangeBasedAwo rba : rbal) {
|
||||
if (awolist.size() >= maxCnt)
|
||||
return awolist;
|
||||
AbstractWorldObject awo = rba.awo;
|
||||
|
||||
if (awo.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
if (playerCnt < maxPlayers) {
|
||||
awolist.add(awo);
|
||||
playerCnt++;
|
||||
}
|
||||
} else if (awo.getObjectType().equals(Enum.GameObjectType.Mob)) {
|
||||
if (mobCnt < maxMobs) {
|
||||
awolist.add(awo);
|
||||
mobCnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return awolist;
|
||||
}
|
||||
|
||||
public static HashSet<AbstractCharacter> getTrackList(HashSet<AbstractWorldObject> awolist, PlayerCharacter pc, int max) {
|
||||
Vector3fImmutable searchLoc = pc.getLoc();
|
||||
int cnt = 0;
|
||||
HashSet<RangeBasedAwo> rbal = RangeBasedAwo.createList(awolist, searchLoc);
|
||||
HashSet<AbstractCharacter> aclist = new HashSet<>();
|
||||
for (RangeBasedAwo rba : rbal) {
|
||||
if (aclist.size() >= max)
|
||||
return aclist;
|
||||
AbstractWorldObject awo = rba.awo;
|
||||
|
||||
if (awo.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||
if (((PlayerCharacter)awo).isCSR())
|
||||
continue;
|
||||
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo) && !(pc.equals(awo))) {
|
||||
aclist.add((AbstractCharacter)awo);
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
return aclist;
|
||||
}
|
||||
|
||||
public float getRange() {
|
||||
return this.range;
|
||||
}
|
||||
|
||||
public AbstractWorldObject getAwo() {
|
||||
return this.awo;
|
||||
}
|
||||
}
|
||||
@@ -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) {}
|
||||
}
|
||||
@@ -0,0 +1,274 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Item;
|
||||
import engine.objects.PreparedStatementShared;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.PowersBase;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public abstract class AbstractPowerAction {
|
||||
|
||||
protected PowersBase parent;
|
||||
protected int UUID;
|
||||
protected String IDString;
|
||||
protected String type;
|
||||
protected boolean isAggressive;
|
||||
protected long validItemFlags;
|
||||
|
||||
/**
|
||||
* No Table ID Constructor
|
||||
*/
|
||||
public AbstractPowerAction() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public AbstractPowerAction(ResultSet rs) throws SQLException {
|
||||
|
||||
this.UUID = rs.getInt("ID");
|
||||
this.IDString = rs.getString("IDString");
|
||||
this.type = rs.getString("type");
|
||||
int flags = rs.getInt("flags");
|
||||
this.isAggressive = ((flags & 128) != 0) ? true : false;
|
||||
}
|
||||
|
||||
public AbstractPowerAction( int uUID, String iDString, String type, boolean isAggressive,
|
||||
long validItemFlags) {
|
||||
super();
|
||||
UUID = uUID;
|
||||
IDString = iDString;
|
||||
this.type = type;
|
||||
this.isAggressive = false;
|
||||
}
|
||||
|
||||
public static void getAllPowerActions(HashMap<String, AbstractPowerAction> powerActions, HashMap<Integer, AbstractPowerAction> powerActionsByID, HashMap<String, EffectsBase> effects) {
|
||||
PreparedStatementShared ps = null;
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM static_power_poweraction");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
String IDString, type;
|
||||
while (rs.next()) {
|
||||
AbstractPowerAction apa;
|
||||
type = rs.getString("type");
|
||||
IDString = rs.getString("IDString");
|
||||
int token = DbManager.hasher.SBStringHash(IDString);
|
||||
//cache token, used for applying effects.
|
||||
PowersManager.ActionTokenByIDString.put(IDString, token);
|
||||
if (type.equals("ApplyEffect"))
|
||||
apa = new ApplyEffectPowerAction(rs, effects);
|
||||
else if (type.equals("ApplyEffects"))
|
||||
apa = new ApplyEffectsPowerAction(rs, effects);
|
||||
else if (type.equals("DeferredPower"))
|
||||
apa = new DeferredPowerPowerAction(rs, effects);
|
||||
else if (type.equals("DamageOverTime"))
|
||||
apa = new DamageOverTimePowerAction(rs, effects);
|
||||
else if (type.equals("Peek"))
|
||||
apa = new PeekPowerAction(rs);
|
||||
else if (type.equals("Charm"))
|
||||
apa = new CharmPowerAction(rs);
|
||||
else if (type.equals("Fear"))
|
||||
apa = new FearPowerAction(rs);
|
||||
else if (type.equals("Confusion"))
|
||||
apa = new ConfusionPowerAction(rs);
|
||||
else if (type.equals("RemoveEffect"))
|
||||
apa = new RemoveEffectPowerAction(rs);
|
||||
else if (type.equals("Track"))
|
||||
apa = new TrackPowerAction(rs, effects);
|
||||
else if (type.equals("DirectDamage"))
|
||||
apa = new DirectDamagePowerAction(rs, effects);
|
||||
else if (type.equals("Transform"))
|
||||
apa = new TransformPowerAction(rs, effects);
|
||||
else if (type.equals("CreateMob"))
|
||||
apa = new CreateMobPowerAction(rs);
|
||||
else if (type.equals("Invis"))
|
||||
apa = new InvisPowerAction(rs, effects);
|
||||
else if (type.equals("ClearNearbyAggro"))
|
||||
apa = new ClearNearbyAggroPowerAction(rs);
|
||||
else if (type.equals("MobRecall"))
|
||||
apa = new MobRecallPowerAction(rs);
|
||||
else if (type.equals("SetItemFlag"))
|
||||
apa = new SetItemFlagPowerAction(rs);
|
||||
else if (type.equals("SimpleDamage"))
|
||||
apa = new SimpleDamagePowerAction(rs);
|
||||
else if (type.equals("TransferStatOT"))
|
||||
apa = new TransferStatOTPowerAction(rs, effects);
|
||||
else if (type.equals("TransferStat"))
|
||||
apa = new TransferStatPowerAction(rs, effects);
|
||||
else if (type.equals("Teleport"))
|
||||
apa = new TeleportPowerAction(rs);
|
||||
else if (type.equals("TreeChoke"))
|
||||
apa = new TreeChokePowerAction(rs);
|
||||
else if (type.equals("Block"))
|
||||
apa = new BlockPowerAction(rs);
|
||||
else if (type.equals("Resurrect"))
|
||||
apa = new ResurrectPowerAction(rs);
|
||||
else if (type.equals("ClearAggro"))
|
||||
apa = new ClearAggroPowerAction(rs);
|
||||
else if (type.equals("ClaimMine"))
|
||||
apa = new ClaimMinePowerAction(rs);
|
||||
else if (type.equals("Recall"))
|
||||
apa = new RecallPowerAction(rs);
|
||||
else if (type.equals("SpireDisable"))
|
||||
apa = new SpireDisablePowerAction(rs);
|
||||
else if (type.equals("Steal"))
|
||||
apa = new StealPowerAction(rs);
|
||||
else if (type.equals("Summon"))
|
||||
apa = new SummonPowerAction(rs);
|
||||
else if (type.equals("RunegateTeleport"))
|
||||
apa = new RunegateTeleportPowerAction(rs);
|
||||
else if (type.equals("RunegateTeleport"))
|
||||
apa = new RunegateTeleportPowerAction(rs);
|
||||
else if (type.equals("OpenGate"))
|
||||
apa = new OpenGatePowerAction(rs);
|
||||
else {
|
||||
Logger.error("valid type not found for poweraction of ID" + rs.getInt("ID"));
|
||||
continue;
|
||||
}
|
||||
powerActions.put(IDString, apa);
|
||||
powerActionsByID.put(apa.UUID, apa);
|
||||
apa.validItemFlags = 0;
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error( e.toString());
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Add OpenGatePowerAction
|
||||
AbstractPowerAction openGateAction = new OpenGatePowerAction(5000, "OPENGATE", "OpenGate", false, 0);
|
||||
powerActions.put("OPENGATE", openGateAction);
|
||||
powerActionsByID.put(openGateAction.UUID, openGateAction);
|
||||
}
|
||||
|
||||
public void startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int numTrains, ActionsBase ab, PowersBase pb) {
|
||||
this._startAction(source, awo, targetLoc, numTrains, ab, pb);
|
||||
}
|
||||
|
||||
public void startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
this._startAction(source, awo, targetLoc, numTrains, ab, pb,duration);
|
||||
}
|
||||
|
||||
protected abstract void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int numTrains, ActionsBase ab, PowersBase pb);
|
||||
|
||||
protected abstract void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int numTrains, ActionsBase ab, PowersBase pb, int duration);
|
||||
|
||||
public void handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int numTrains, ActionsBase ab, PowersBase pb) {
|
||||
this._handleChant(source, target, targetLoc, numTrains, ab, pb);
|
||||
}
|
||||
|
||||
protected abstract void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int numTrains, ActionsBase ab, PowersBase pb);
|
||||
|
||||
public int getUUID() {
|
||||
return this.UUID;
|
||||
}
|
||||
|
||||
public String getIDString() {
|
||||
return this.IDString;
|
||||
}
|
||||
|
||||
// public String getMessageType() {
|
||||
// return this.type;
|
||||
// }
|
||||
|
||||
public boolean isAggressive() {
|
||||
return this.isAggressive;
|
||||
}
|
||||
|
||||
public PowersBase getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public void setParent(PowersBase value) {
|
||||
this.parent = value;
|
||||
}
|
||||
|
||||
public void applyEffectForItem(Item item, int trains) {
|
||||
if (this instanceof ApplyEffectPowerAction)
|
||||
((ApplyEffectPowerAction)this)._applyEffectForItem(item, trains);
|
||||
if (this instanceof ApplyEffectsPowerAction)
|
||||
((ApplyEffectsPowerAction)this)._applyEffectForItem(item, trains);
|
||||
}
|
||||
public void applyBakedInStatsForItem(Item item, int trains) {
|
||||
if (this instanceof ApplyEffectPowerAction)
|
||||
((ApplyEffectPowerAction)this)._applyBakedInStatsForItem(item, trains);
|
||||
if (this instanceof ApplyEffectsPowerAction)
|
||||
((ApplyEffectsPowerAction)this)._applyBakedInStatsForItem(item, trains);
|
||||
}
|
||||
|
||||
public EffectsBase getEffectsBase() {
|
||||
if (this instanceof ApplyEffectPowerAction)
|
||||
return ((ApplyEffectPowerAction)this).getEffect();
|
||||
else if (this instanceof ApplyEffectsPowerAction)
|
||||
return ((ApplyEffectsPowerAction)this).getEffect();
|
||||
return null;
|
||||
}
|
||||
|
||||
public EffectsBase getEffectsBase2() {
|
||||
if (this instanceof ApplyEffectsPowerAction)
|
||||
return ((ApplyEffectsPowerAction)this).getEffect2();
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void loadValidItemFlags(HashMap<String, AbstractPowerAction> powerActions) {
|
||||
PreparedStatementShared ps = null;
|
||||
try {
|
||||
ps = new PreparedStatementShared("SELECT * FROM `static_power_effect_allowed_item`");
|
||||
ResultSet rs = ps.executeQuery();
|
||||
String IDS;
|
||||
long flags;
|
||||
while (rs.next()) {
|
||||
AbstractPowerAction apa;
|
||||
flags = rs.getLong("flags");
|
||||
IDS = rs.getString("IDString");
|
||||
if (powerActions.containsKey(IDS)) {
|
||||
apa = powerActions.get(IDS);
|
||||
apa.validItemFlags = flags;
|
||||
} else {
|
||||
Logger.error("Unable to find PowerAction " + IDS);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
rs.close();
|
||||
} catch (Exception e) {
|
||||
Logger.error(e.toString());
|
||||
} finally {
|
||||
ps.release();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//These functions verify a powerAction is valid for an item type
|
||||
public long getValidItemFlags() {
|
||||
return this.validItemFlags;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,265 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.ai.MobileFSM;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.jobs.ChantJob;
|
||||
import engine.jobs.DeferredPowerJob;
|
||||
import engine.jobs.FinishEffectTimeJob;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.chat.ChatSystemMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.PowersBase;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class ApplyEffectPowerAction extends AbstractPowerAction {
|
||||
|
||||
private String effectID;
|
||||
private EffectsBase effect;
|
||||
private String effectParentID;
|
||||
private EffectsBase effectParent;
|
||||
|
||||
public ApplyEffectPowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
|
||||
super(rs);
|
||||
this.effectParentID = rs.getString("IDString");
|
||||
this.effectParent = effects.get(this.effectParentID);
|
||||
this.effectID = rs.getString("effectID");
|
||||
this.effect = effects.get(this.effectID);
|
||||
}
|
||||
|
||||
public ApplyEffectPowerAction(ResultSet rs, EffectsBase effect) throws SQLException {
|
||||
super(rs);
|
||||
|
||||
this.effectID = rs.getString("effectID");
|
||||
this.effect = effect;
|
||||
}
|
||||
|
||||
public String getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
|
||||
public EffectsBase getEffect() {
|
||||
return this.effect;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (this.effect == null || pb == null || ab == null) {
|
||||
//TODO log error here
|
||||
return;
|
||||
}
|
||||
|
||||
//add schedule job to end it if needed and add effect to pc
|
||||
int duration = 0;
|
||||
// if (pb.isChant())
|
||||
// duration = (int)pb.getChantDuration() * 1000;
|
||||
// else
|
||||
duration = ab.getDuration(trains);
|
||||
String stackType = ab.getStackType();
|
||||
if (stackType.equals("WeaponMove")) {
|
||||
DeferredPowerJob eff = new DeferredPowerJob(source, awo, stackType, trains, ab, pb, this.effect, this);
|
||||
if (stackType.equals("IgnoreStack"))
|
||||
awo.addEffect(Integer.toString(ab.getUUID()), 10000, eff, this.effect, trains);
|
||||
else
|
||||
awo.addEffect(stackType, 10000, eff, this.effect, trains);
|
||||
if (awo.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||
((PlayerCharacter)awo).setWeaponPower(eff);
|
||||
this.effect.startEffect(source, awo, trains, eff);
|
||||
} else {
|
||||
FinishEffectTimeJob eff = new FinishEffectTimeJob(source, awo, stackType, trains, ab, pb, effect);
|
||||
|
||||
if (blockInvul(pb, source, awo)) {
|
||||
this.effect.endEffect(source, awo, trains, pb, eff);
|
||||
return;
|
||||
}
|
||||
|
||||
// Effect lastEff = awo.getEffects().get(eff.getStackType());
|
||||
//
|
||||
// if (lastEff != null && lastEff.getPowerToken() == eff.getPowerToken())
|
||||
// lastEff.cancelJob(true);
|
||||
|
||||
if (duration > 0) {
|
||||
if (stackType.equals("IgnoreStack"))
|
||||
awo.addEffect(Integer.toString(ab.getUUID()), duration, eff, effect, trains);
|
||||
else
|
||||
awo.addEffect(stackType, duration, eff, effect, trains);
|
||||
} else
|
||||
awo.applyAllBonuses();
|
||||
// //TODO if chant, start cycle
|
||||
// if (pb.isChant() && source.equals(awo)) {
|
||||
// ChantJob cj = new ChantJob(source, awo, stackType, trains, ab, pb, effect, eff);
|
||||
// source.setLastChant((int)(pb.getChantDuration()-2) * 1000, cj);
|
||||
// eff.setChant(true);
|
||||
// }
|
||||
|
||||
if (this.effectID.equals("TAUNT")){
|
||||
|
||||
if (awo != null && awo.getObjectType() == GameObjectType.Mob){
|
||||
MobileFSM.setAggro((Mob)awo,source.getObjectUUID());
|
||||
ChatSystemMsg msg = ChatManager.CombatInfo(source, awo);
|
||||
DispatchMessage.sendToAllInRange(source, msg);
|
||||
}
|
||||
}
|
||||
this.effect.startEffect(source, awo, trains, eff);
|
||||
}
|
||||
}
|
||||
|
||||
protected void _applyEffectForItem(Item item, int trains) {
|
||||
if (item == null || this.effect == null)
|
||||
return;
|
||||
item.addEffectNoTimer(Integer.toString(this.effect.getUUID()), this.effect, trains,false);
|
||||
item.addEffectNoTimer(Integer.toString(this.effectParent.getUUID()), this.effectParent, trains,false);
|
||||
}
|
||||
protected void _applyBakedInStatsForItem(Item item, int trains) {
|
||||
if (item == null)
|
||||
return;
|
||||
if (this.effect == null){
|
||||
Logger.error( "Unknown Token: EffectBase ID " + this.effectID + '.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.effectParent == null){
|
||||
Logger.error("Unknown Token: EffectBase ID " + this.effectParentID + '.');
|
||||
return;
|
||||
}
|
||||
Effect eff = item.addEffectNoTimer(Integer.toString(this.effect.getUUID()), this.effect, trains,false);
|
||||
Effect eff3 = item.addEffectNoTimer(Integer.toString(this.effectParent.getUUID()), this.effectParent, trains,false);
|
||||
if (eff != null && eff3 != null){
|
||||
eff3.setBakedInStat(true);
|
||||
item.getEffectNames().add(this.effect.getIDString());
|
||||
item.getEffectNames().add(this.effectParent.getIDString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (source != null) {
|
||||
PlayerBonuses bonuses = source.getBonuses();
|
||||
|
||||
if (bonuses == null)
|
||||
return;
|
||||
|
||||
boolean noSilence = bonuses.getBool(ModType.Silenced, SourceType.None);
|
||||
|
||||
if (noSilence)
|
||||
return;
|
||||
|
||||
}
|
||||
String stackType = ab.stackType;
|
||||
stackType = stackType.equals("IgnoreStack") ? Integer.toString(ab.getUUID()) : stackType;
|
||||
|
||||
FinishEffectTimeJob eff = new FinishEffectTimeJob(source, target, stackType, trains, ab, pb, effect);
|
||||
ChantJob cj = new ChantJob(source, target, stackType, trains, ab, pb, effect, eff);
|
||||
//handle invul
|
||||
if(pb.getUUID() != 334)
|
||||
source.setLastChant((int)(pb.getChantDuration()) * 1000, cj);
|
||||
else
|
||||
source.setLastChant((int)(pb.getChantDuration()) * 1000, cj);
|
||||
eff.setChant(true);
|
||||
}
|
||||
|
||||
private static boolean blockInvul(PowersBase pb, AbstractCharacter source, AbstractWorldObject awo) {
|
||||
if (awo == null || pb == null || source == null)
|
||||
return false;
|
||||
|
||||
if (source.getObjectUUID() == awo.getObjectUUID())
|
||||
return false;
|
||||
|
||||
if (!AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
return false;
|
||||
|
||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int trains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
if (this.effect == null || pb == null || ab == null) {
|
||||
//TODO log error here
|
||||
return;
|
||||
}
|
||||
|
||||
//add schedule job to end it if needed and add effect to pc
|
||||
// if (pb.isChant())
|
||||
// duration = (int)pb.getChantDuration() * 1000;
|
||||
// else
|
||||
|
||||
String stackType = ab.getStackType();
|
||||
if (stackType.equals("WeaponMove")) {
|
||||
DeferredPowerJob eff = new DeferredPowerJob(source, awo, stackType, trains, ab, pb, this.effect, this);
|
||||
if (stackType.equals("IgnoreStack"))
|
||||
awo.addEffect(Integer.toString(ab.getUUID()), 10000, eff, this.effect, trains);
|
||||
else
|
||||
awo.addEffect(stackType, 10000, eff, this.effect, trains);
|
||||
if (awo.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||
((PlayerCharacter)awo).setWeaponPower(eff);
|
||||
this.effect.startEffect(source, awo, trains, eff);
|
||||
} else {
|
||||
FinishEffectTimeJob eff = new FinishEffectTimeJob(source, awo, stackType, trains, ab, pb, effect);
|
||||
|
||||
if (blockInvul(pb, source, awo)) {
|
||||
this.effect.endEffect(source, awo, trains, pb, eff);
|
||||
return;
|
||||
}
|
||||
|
||||
if (duration > 0) {
|
||||
if (stackType.equals("IgnoreStack"))
|
||||
awo.addEffect(Integer.toString(ab.getUUID()), duration, eff, effect, trains);
|
||||
else
|
||||
awo.addEffect(stackType, duration, eff, effect, trains);
|
||||
} else
|
||||
awo.applyAllBonuses();
|
||||
// //TODO if chant, start cycle
|
||||
// if (pb.isChant() && source.equals(awo)) {
|
||||
// ChantJob cj = new ChantJob(source, awo, stackType, trains, ab, pb, effect, eff);
|
||||
// source.setLastChant((int)(pb.getChantDuration()-2) * 1000, cj);
|
||||
// eff.setChant(true);
|
||||
// }
|
||||
|
||||
if (this.effectID.equals("TAUNT")){
|
||||
|
||||
if (awo != null && awo.getObjectType() == GameObjectType.Mob){
|
||||
MobileFSM.setAggro((Mob)awo,source.getObjectUUID());
|
||||
ChatSystemMsg msg = ChatManager.CombatInfo(source, awo);
|
||||
DispatchMessage.sendToAllInRange(source, msg);
|
||||
}
|
||||
}
|
||||
this.effect.startEffect(source, awo, trains, eff);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Effect;
|
||||
import engine.objects.Item;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.PowersBase;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class ApplyEffectsPowerAction extends AbstractPowerAction {
|
||||
private String IDString;
|
||||
private String effectID;
|
||||
private String effectID2;
|
||||
private EffectsBase effect;
|
||||
private EffectsBase effect2;
|
||||
private EffectsBase effectParent;
|
||||
|
||||
public ApplyEffectsPowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
|
||||
super(rs);
|
||||
this.IDString = rs.getString("IDString");
|
||||
this.effectID = rs.getString("effectID");
|
||||
this.effectID2 = rs.getString("effectID2");
|
||||
this.effect = effects.get(this.effectID);
|
||||
this.effect2 = effects.get(this.effectID2);
|
||||
this.effectParent = effects.get(this.IDString);
|
||||
|
||||
}
|
||||
|
||||
public String getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
|
||||
public String getEffectID2() {
|
||||
return this.effectID2;
|
||||
}
|
||||
|
||||
public EffectsBase getEffect() {
|
||||
return this.effect;
|
||||
}
|
||||
|
||||
public EffectsBase getEffect2() {
|
||||
return this.effect2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
}
|
||||
|
||||
protected void _applyEffectForItem(Item item, int trains) {
|
||||
if (item == null || this.effect == null)
|
||||
return;
|
||||
item.addEffectNoTimer(Integer.toString(this.effect.getUUID()), this.effect, trains,false);
|
||||
if (this.effect2 != null)
|
||||
item.addEffectNoTimer(Integer.toString(this.effect2.getUUID()), this.effect2, trains,false);
|
||||
item.addEffectNoTimer(Integer.toString(this.effectParent.getUUID()), this.effectParent, trains,false);
|
||||
}
|
||||
protected void _applyBakedInStatsForItem(Item item, int trains) {
|
||||
|
||||
if (item == null)
|
||||
return;
|
||||
|
||||
if (this.effect == null){
|
||||
Logger.error( "Unknown Token: EffectBase ID " + this.effectID + '.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.effect2 == null){
|
||||
Logger.error( "Unknown Token: EffectBase ID " + this.effectID2 + '.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.effectParent == null){
|
||||
Logger.error( "Unknown Token: EffectBase ID " + this.IDString + '.');
|
||||
return;
|
||||
}
|
||||
|
||||
Effect eff = item.addEffectNoTimer(Integer.toString(this.effect.getUUID()), this.effect, trains,false);
|
||||
Effect eff2 = item.addEffectNoTimer(Integer.toString(this.effect2.getUUID()), this.effect2, trains,false);
|
||||
Effect eff3 = item.addEffectNoTimer(Integer.toString(this.effectParent.getUUID()), this.effectParent, trains,false);
|
||||
|
||||
if (eff != null && eff2 != null && eff3 != null){
|
||||
eff3.setBakedInStat(true);
|
||||
item.getEffectNames().add(this.effect.getIDString());
|
||||
item.getEffectNames().add(this.effect2.getIDString());
|
||||
item.getEffectNames().add(this.effectParent.getIDString());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
public String getIDString() {
|
||||
return IDString;
|
||||
}
|
||||
|
||||
public void setIDString(String iDString) {
|
||||
IDString = iDString;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class BlockPowerAction extends AbstractPowerAction {
|
||||
|
||||
public BlockPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class CharmPowerAction extends AbstractPowerAction {
|
||||
|
||||
private int levelCap;
|
||||
private int levelCapRamp;
|
||||
|
||||
public CharmPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
this.levelCap = rs.getInt("levelCap");
|
||||
this.levelCapRamp = rs.getInt("levelCapRamp");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
if (source == null || awo == null || !(awo.getObjectType().equals(Enum.GameObjectType.Mob)) || !(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
|
||||
return;
|
||||
|
||||
PlayerCharacter owner = (PlayerCharacter) source;
|
||||
ClientConnection origin = owner.getClientConnection();
|
||||
|
||||
if (origin == null)
|
||||
return;
|
||||
|
||||
//verify is mob, not pet or guard
|
||||
Mob mob = (Mob) awo;
|
||||
if (!mob.isMob())
|
||||
return;
|
||||
|
||||
//make sure mob isn't too high level
|
||||
int cap = this.levelCap + (this.levelCapRamp * trains);
|
||||
if (mob.getLevel() > cap && pb.getToken() != 1577464266)
|
||||
return;
|
||||
|
||||
//turn mob into pet.
|
||||
owner.commandSiegeMinion(mob);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.*;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class ClaimMinePowerAction extends AbstractPowerAction {
|
||||
|
||||
public ClaimMinePowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (source == null || awo == null)
|
||||
return;
|
||||
|
||||
if (!(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
|
||||
return;
|
||||
|
||||
if (!(awo.getObjectType().equals(Enum.GameObjectType.Building)))
|
||||
return;
|
||||
|
||||
Building b = (Building)awo;
|
||||
|
||||
if (b.getRank() > 0)
|
||||
return;
|
||||
|
||||
Mine m = Mine.getMineFromTower(b.getObjectUUID());
|
||||
if (m == null)
|
||||
return;
|
||||
|
||||
m.claimMine((PlayerCharacter) source);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class ClearAggroPowerAction extends AbstractPowerAction {
|
||||
|
||||
public ClearAggroPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (awo != null && awo.getObjectType() == GameObjectType.Mob){
|
||||
((Mob)awo).setNoAggro(true);
|
||||
((Mob)awo).setState(STATE.Patrol);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class ClearNearbyAggroPowerAction extends AbstractPowerAction {
|
||||
|
||||
public ClearNearbyAggroPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (source.getObjectType() == GameObjectType.Mob){
|
||||
((Mob)source).setState(STATE.Patrol);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class ConfusionPowerAction extends AbstractPowerAction {
|
||||
|
||||
public ConfusionPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,175 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM.STATE;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.PetMsg;
|
||||
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 CreateMobPowerAction extends AbstractPowerAction {
|
||||
|
||||
private int mobID;
|
||||
private int mobLevel;
|
||||
|
||||
public CreateMobPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
|
||||
this.mobID = rs.getInt("mobID");
|
||||
this.mobLevel = rs.getInt("mobLevel");
|
||||
}
|
||||
|
||||
public int getMobID() {
|
||||
return this.mobID;
|
||||
}
|
||||
|
||||
public int getMobLevel() {
|
||||
return this.mobLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
if (source == null || !(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
|
||||
return;
|
||||
|
||||
PlayerCharacter owner = (PlayerCharacter) source;
|
||||
Mob currentPet = owner.getPet();
|
||||
Zone seaFloor = ZoneManager.getSeaFloor();
|
||||
Guild guild = Guild.getErrantGuild();
|
||||
ClientConnection origin = owner.getClientConnection();
|
||||
|
||||
if (seaFloor == null || guild == null || origin == null)
|
||||
return;
|
||||
|
||||
MobBase mobbase = MobBase.getMobBase(mobID);
|
||||
|
||||
if (mobbase == null) {
|
||||
Logger.error("Attempt to summon pet with null mobbase: " + mobID);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mobbase.isNecroPet() && owner.inSafeZone())
|
||||
return;
|
||||
|
||||
//create Pet
|
||||
Mob pet = Mob.createPet(mobID, guild, seaFloor, owner, (short)mobLevel);
|
||||
|
||||
|
||||
if(pet.getMobBaseID() == 12021 || pet.getMobBaseID() == 12022) { //is a necro pet
|
||||
if(currentPet!= null && !currentPet.isNecroPet() && !currentPet.isSiege()) {
|
||||
DbManager.removeFromCache(currentPet);
|
||||
WorldGrid.RemoveWorldObject(currentPet);
|
||||
currentPet.setState(STATE.Disabled);
|
||||
currentPet.setCombatTarget(null);
|
||||
|
||||
if (currentPet.getParentZone() != null)
|
||||
currentPet.getParentZone().zoneMobSet.remove(currentPet);
|
||||
|
||||
currentPet.getPlayerAgroMap().clear();
|
||||
|
||||
try {
|
||||
currentPet.clearEffects();
|
||||
}catch(Exception e){
|
||||
Logger.error(e.getMessage());
|
||||
}
|
||||
|
||||
//currentPet.disableIntelligence();
|
||||
}else if (currentPet != null && currentPet.isSiege()){
|
||||
currentPet.setMob();
|
||||
currentPet.setOwner(null);
|
||||
currentPet.setCombatTarget(null);
|
||||
|
||||
if (currentPet.isAlive())
|
||||
WorldGrid.updateObject(currentPet);
|
||||
}
|
||||
//remove 10th pet
|
||||
|
||||
|
||||
owner.spawnNecroPet(pet);
|
||||
|
||||
}
|
||||
else { //is not a necro pet
|
||||
if(currentPet != null) {
|
||||
if(!currentPet.isNecroPet() && !currentPet.isSiege()) {
|
||||
DbManager.removeFromCache(currentPet);
|
||||
currentPet.setCombatTarget(null);
|
||||
currentPet.setState(STATE.Disabled);
|
||||
|
||||
currentPet.setOwner(null);
|
||||
WorldGrid.RemoveWorldObject(currentPet);
|
||||
|
||||
currentPet.getParentZone().zoneMobSet.remove(currentPet);
|
||||
currentPet.getPlayerAgroMap().clear();
|
||||
currentPet.clearEffects();
|
||||
//currentPet.disableIntelligence();
|
||||
}
|
||||
else {
|
||||
if (currentPet.isSiege()){
|
||||
currentPet.setMob();
|
||||
currentPet.setOwner(null);
|
||||
currentPet.setCombatTarget(null);
|
||||
|
||||
if (currentPet.isAlive())
|
||||
WorldGrid.updateObject(currentPet);
|
||||
}
|
||||
|
||||
}
|
||||
PlayerCharacter.auditNecroPets(owner);
|
||||
PlayerCharacter.resetNecroPets(owner);
|
||||
}
|
||||
}
|
||||
/* if(owner.getPet() != null) {
|
||||
if(owner.getPet().getMobBaseID() != 12021 && owner.getPet().getMobBaseID() != 12022) {
|
||||
//if not a necro pet, remove pet
|
||||
WorldGrid.removeWorldObject(owner.getPet());
|
||||
owner.getPet().disableIntelligence();
|
||||
Mob.removePet(owner.getPet().getUUID());
|
||||
owner.setPet(null);
|
||||
}
|
||||
else {
|
||||
//if it is a necro pet, add it to the line and set as mob
|
||||
owner.getPet().setMob();
|
||||
}
|
||||
}*/
|
||||
|
||||
// if (mobID == 12021 || mobID == 12022) //Necro Pets
|
||||
// pet.setPet(owner, true);
|
||||
owner.setPet(pet);
|
||||
PetMsg pm = new PetMsg(5, pet);
|
||||
Dispatch dispatch = Dispatch.borrow(owner, pm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.jobs.DamageOverTimeJob;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class DamageOverTimePowerAction extends AbstractPowerAction {
|
||||
|
||||
private String effectID;
|
||||
private int numIterations;
|
||||
private EffectsBase effect;
|
||||
|
||||
public DamageOverTimePowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
|
||||
super(rs);
|
||||
|
||||
this.effectID = rs.getString("effectID");
|
||||
this.numIterations = rs.getInt("numIterations");
|
||||
this.effect = effects.get(this.effectID);
|
||||
}
|
||||
|
||||
public String getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
|
||||
public int getNumIterations() {
|
||||
return this.numIterations;
|
||||
}
|
||||
|
||||
public EffectsBase getEffect() {
|
||||
return this.effect;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (this.effect == null || pb == null || ab == null) {
|
||||
//TODO log error here
|
||||
return;
|
||||
}
|
||||
//add schedule job to end it if needed and add effect to pc
|
||||
int duration = ab.getDuration(trains);
|
||||
String stackType = ab.getStackType();
|
||||
DamageOverTimeJob eff = new DamageOverTimeJob(source, awo, stackType, trains, ab, pb, this.effect, this);
|
||||
int tick = eff.getTickLength();
|
||||
if (duration > 0) {
|
||||
if (stackType.equals("IgnoreStack"))
|
||||
awo.addEffect(Integer.toString(ab.getUUID()), eff.getTickLength(), eff, this.effect, trains);
|
||||
else
|
||||
awo.addEffect(stackType, tick, eff, this.effect, trains);
|
||||
}
|
||||
|
||||
//start effect icon for client. Skip applying dot until first iteration.
|
||||
eff.setSkipApplyEffect(true);
|
||||
this.effect.startEffect(source, awo, trains, eff);
|
||||
eff.setSkipApplyEffect(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.jobs.DeferredPowerJob;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class DeferredPowerPowerAction extends AbstractPowerAction {
|
||||
|
||||
private String effectID;
|
||||
private String deferedPowerID;
|
||||
private EffectsBase effect;
|
||||
// private EffectsBase deferedPower;
|
||||
|
||||
public DeferredPowerPowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
|
||||
super(rs);
|
||||
|
||||
this.effectID = rs.getString("effectID");
|
||||
this.deferedPowerID = rs.getString("deferredPowerID");
|
||||
this.effect = effects.get(this.effectID);
|
||||
}
|
||||
|
||||
public String getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
|
||||
public String getDeferredPowerID() {
|
||||
return this.deferedPowerID;
|
||||
}
|
||||
|
||||
public EffectsBase getEffect() {
|
||||
return this.effect;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (this.effect == null || pb == null || ab == null) {
|
||||
//TODO log error here
|
||||
return;
|
||||
}
|
||||
|
||||
//add schedule job to end it if needed and add effect to pc
|
||||
|
||||
String stackType = ab.getStackType();
|
||||
DeferredPowerJob eff = new DeferredPowerJob(source, awo, stackType, trains, ab, pb, this.effect, this);
|
||||
if (stackType.equals("IgnoreStack"))
|
||||
awo.addEffect(Integer.toString(ab.getUUID()), 10000, eff, this.effect, trains);
|
||||
else
|
||||
awo.addEffect(stackType, 10000, eff, this.effect, trains);
|
||||
|
||||
switch (awo.getObjectType()){
|
||||
case PlayerCharacter:
|
||||
((PlayerCharacter)awo).setWeaponPower(eff);
|
||||
break;
|
||||
case Mob:
|
||||
((Mob)awo).setWeaponPower(eff);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
this.effect.startEffect(source, awo, trains, eff);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.jobs.FinishEffectTimeJob;
|
||||
import engine.jobs.PersistentAoeJob;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class DirectDamagePowerAction extends AbstractPowerAction {
|
||||
|
||||
private String effectID;
|
||||
private EffectsBase effect;
|
||||
|
||||
public DirectDamagePowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
|
||||
super(rs);
|
||||
|
||||
this.effectID = rs.getString("effectID");
|
||||
this.effect = effects.get(this.effectID);
|
||||
}
|
||||
|
||||
public String getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
|
||||
public EffectsBase getEffect() {
|
||||
return this.effect;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (this.effect == null || pb == null || ab == null) {
|
||||
//TODO log error here
|
||||
return;
|
||||
}
|
||||
|
||||
//add schedule job to end it if needed and add effect to pc
|
||||
int duration = ab.getDuration(trains);
|
||||
String stackType = ab.getStackType();
|
||||
FinishEffectTimeJob eff = new FinishEffectTimeJob(source, awo, stackType, trains, ab, pb, this.effect);
|
||||
eff.setSkipSendEffect(true);
|
||||
if (duration > 0) {
|
||||
if (stackType.equals("IgnoreStack"))
|
||||
awo.addEffect(Integer.toString(ab.getUUID()), duration, eff, this.effect, trains);
|
||||
else
|
||||
awo.addEffect(stackType, duration, eff, this.effect, trains);
|
||||
}
|
||||
|
||||
// //if chant, start cycle
|
||||
// if (pb.isChant() && targetLoc.x != 0f && targetLoc.z != 0f) {
|
||||
// PersistentAoeJob paoe = new PersistentAoeJob(source, stackType, trains, ab, pb, effect, eff, targetLoc);
|
||||
// source.addPersistantAoe(stackType, (int)(pb.getChantDuration() * 1000), paoe, effect, trains);
|
||||
// eff.setChant(true);
|
||||
// }
|
||||
|
||||
this.effect.startEffect(source, awo, trains, eff);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
String stackType = ab.getStackType();
|
||||
stackType = stackType.equals("IgnoreStack") ? Integer.toString(ab.getUUID()) : stackType;
|
||||
FinishEffectTimeJob eff = new FinishEffectTimeJob(source, target, stackType, trains, ab, pb, this.effect);
|
||||
if (targetLoc.x != 0f && targetLoc.z != 0f) {
|
||||
PersistentAoeJob paoe = new PersistentAoeJob(source,target, stackType, trains, ab, pb, effect, eff, targetLoc);
|
||||
source.addPersistantAoe(stackType, (int)(pb.getChantDuration() * 1000), paoe, effect, trains);
|
||||
eff.setChant(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.job.JobScheduler;
|
||||
import engine.jobs.EndFearJob;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class FearPowerAction extends AbstractPowerAction {
|
||||
|
||||
private int levelCap;
|
||||
private int levelCapRamp;
|
||||
|
||||
public FearPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
this.levelCap = rs.getInt("levelCap");
|
||||
this.levelCapRamp = rs.getInt("levelCapRamp");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (source == null || awo == null || !(awo.getObjectType().equals(Enum.GameObjectType.Mob)) || !(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
|
||||
return;
|
||||
|
||||
PlayerCharacter owner = (PlayerCharacter) source;
|
||||
ClientConnection origin = owner.getClientConnection();
|
||||
if (origin == null)
|
||||
return;
|
||||
|
||||
//verify is mob, not pet or guard
|
||||
Mob mob = (Mob) awo;
|
||||
if (!mob.isMob())
|
||||
return;
|
||||
|
||||
//make sure mob isn't too high level
|
||||
int cap = this.levelCap + (this.levelCapRamp * trains);
|
||||
if (mob.getLevel() > cap || mob.getLevel() > 79)
|
||||
return;
|
||||
|
||||
//Apply fear to mob
|
||||
int duration = 10 + ((int)(trains * 0.5));
|
||||
String stackType = ab.getStackType();
|
||||
EndFearJob efj = new EndFearJob(source, awo, stackType, trains, ab, pb, null);
|
||||
((Mob)awo).setFearedObject(source);
|
||||
JobScheduler.getInstance().scheduleJob(efj, duration * 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.jobs.FinishEffectTimeJob;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
public class InvisPowerAction extends AbstractPowerAction {
|
||||
|
||||
private String effectID;
|
||||
private EffectsBase effect;
|
||||
|
||||
public InvisPowerAction(ResultSet rs, HashMap<String, EffectsBase> effects) throws SQLException {
|
||||
super(rs);
|
||||
|
||||
this.effectID = rs.getString("effectID");
|
||||
this.effect = effects.get(this.effectID);
|
||||
}
|
||||
|
||||
public String getEffectID() {
|
||||
return this.effectID;
|
||||
}
|
||||
|
||||
public EffectsBase getEffect() {
|
||||
return this.effect;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (this.effect == null || pb == null || ab == null) {
|
||||
//TODO log error here
|
||||
return;
|
||||
}
|
||||
|
||||
// if (this.effect.ignoreMod())
|
||||
// trains = 50; //set above see invis for safe mode and csr-invis
|
||||
|
||||
//add schedule job to end it if needed and add effect to pc
|
||||
int duration = ab.getDuration(trains);
|
||||
String stackType = ab.getStackType();
|
||||
FinishEffectTimeJob eff = new FinishEffectTimeJob(source, awo, stackType, trains, ab, pb, this.effect);
|
||||
if (duration > 0) {
|
||||
if (stackType.equals("IgnoreStack"))
|
||||
awo.addEffect(Integer.toString(ab.getUUID()), duration, eff, this.effect, trains);
|
||||
else
|
||||
awo.addEffect(stackType, duration, eff, this.effect, trains);
|
||||
}
|
||||
this.effect.startEffect(source, awo, trains, eff);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.ai.MobileFSM;
|
||||
import engine.gameManager.MovementManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class MobRecallPowerAction extends AbstractPowerAction {
|
||||
|
||||
public MobRecallPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (!AbstractWorldObject.IsAbstractCharacter(awo) || source == null)
|
||||
return;
|
||||
AbstractCharacter awoac = (AbstractCharacter)awo;
|
||||
|
||||
if (awo.getObjectType() != GameObjectType.Mob)
|
||||
return;
|
||||
|
||||
|
||||
MovementManager.translocate(awoac,awoac.getBindLoc(), null);
|
||||
if (awoac.getObjectType() == GameObjectType.Mob){
|
||||
MobileFSM.setAwake((Mob)awoac,true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.RunegateType;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Runegate;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class OpenGatePowerAction extends AbstractPowerAction {
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public OpenGatePowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
public OpenGatePowerAction(int uUID, String iDString, String type, boolean isAggressive, long validItemFlags) {
|
||||
super(uUID, iDString, type, isAggressive, validItemFlags);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
|
||||
if (awo.getObjectType().equals(GameObjectType.Building) == false)
|
||||
return;
|
||||
|
||||
Building targetBuilding = (Building) awo;
|
||||
Runegate runeGate;
|
||||
RunegateType runegateType;
|
||||
RunegateType portalType;
|
||||
int token;
|
||||
|
||||
// Sanity check.
|
||||
|
||||
if (source == null || awo == null || !(awo.getObjectType().equals(Enum.GameObjectType.Building)) || pb == null)
|
||||
return;
|
||||
|
||||
// Make sure building has a blueprint
|
||||
|
||||
if (targetBuilding.getBlueprintUUID() == 0)
|
||||
return;
|
||||
|
||||
// Make sure building is actually a runegate.
|
||||
|
||||
if (targetBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.RUNEGATE)
|
||||
return;
|
||||
|
||||
// Which portal was opened?
|
||||
|
||||
token = pb.getToken();
|
||||
portalType = RunegateType.AIR;
|
||||
|
||||
switch (token) {
|
||||
case 428937084: //Death Gate
|
||||
portalType = RunegateType.OBLIV;
|
||||
break;
|
||||
|
||||
case 429756284: //Chaos Gate
|
||||
portalType = RunegateType.CHAOS;
|
||||
break;
|
||||
|
||||
case 429723516: //Khar Gate
|
||||
portalType = RunegateType.MERCHANT;
|
||||
break;
|
||||
|
||||
case 429559676: //Spirit Gate
|
||||
portalType = RunegateType.SPIRIT;
|
||||
break;
|
||||
|
||||
case 429592444: //Water Gate
|
||||
portalType = RunegateType.WATER;
|
||||
break;
|
||||
|
||||
case 429428604: //Fire Gate
|
||||
portalType = RunegateType.FIRE;
|
||||
break;
|
||||
|
||||
case 429526908: //Air Gate
|
||||
portalType = RunegateType.AIR;
|
||||
break;
|
||||
|
||||
case 429625212: //Earth Gate
|
||||
portalType = RunegateType.EARTH;
|
||||
break;
|
||||
|
||||
default:
|
||||
}
|
||||
|
||||
// Which runegate was clicked on?
|
||||
|
||||
runegateType = RunegateType.getGateTypeFromUUID(targetBuilding.getObjectUUID());
|
||||
runeGate = Runegate.getRunegates()[runegateType.ordinal()];
|
||||
|
||||
runeGate.activatePortal(portalType);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.LootWindowResponseMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
|
||||
public class PeekPowerAction extends AbstractPowerAction {
|
||||
|
||||
public PeekPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
if (source == null || awo == null || !(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
|
||||
return;
|
||||
|
||||
PlayerCharacter pc = null;
|
||||
if (source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
|
||||
pc = (PlayerCharacter) source;
|
||||
|
||||
AbstractCharacter target = null;
|
||||
if (AbstractWorldObject.IsAbstractCharacter(awo))
|
||||
target = (AbstractCharacter) awo;
|
||||
|
||||
//test probability of successful peek
|
||||
boolean peekSuccess = peekSuccess(source, awo);
|
||||
if (peekSuccess) {
|
||||
ChatManager.chatPeekSteal(pc, target, null, true, peekDetect(source, awo), -1);
|
||||
} else {
|
||||
ChatManager.chatPeekSteal(pc, target, null, false, false, -1);
|
||||
return;
|
||||
}
|
||||
|
||||
LootWindowResponseMsg lwrm = null;
|
||||
|
||||
if (awo.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
|
||||
PlayerCharacter tar = (PlayerCharacter)awo;
|
||||
|
||||
if (!tar.isAlive())
|
||||
return;
|
||||
|
||||
lwrm = new LootWindowResponseMsg(tar.getObjectType().ordinal(), tar.getObjectUUID(), tar.getInventory(true));
|
||||
} else if (awo.getObjectType().equals(Enum.GameObjectType.Mob)) {
|
||||
|
||||
Mob tar = (Mob) awo;
|
||||
|
||||
if (!tar.isAlive())
|
||||
return;
|
||||
|
||||
lwrm = new LootWindowResponseMsg(tar.getObjectType().ordinal(), tar.getObjectUUID(), tar.getInventory(true));
|
||||
}
|
||||
if (lwrm == null)
|
||||
return;
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(pc, lwrm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
protected static boolean peekSuccess(AbstractCharacter pc, AbstractWorldObject awo) {
|
||||
if (pc == null || awo == null || !AbstractWorldObject.IsAbstractCharacter(awo) || pc.getPowers() == null)
|
||||
return false;
|
||||
|
||||
int levelDif = pc.getLevel() - ((AbstractCharacter)awo).getLevel();
|
||||
|
||||
if (!pc.getPowers().containsKey(429494332))
|
||||
return false;
|
||||
|
||||
CharacterPower cp = pc.getPowers().get(429494332);
|
||||
int trains = cp.getTotalTrains();
|
||||
|
||||
float chance = 30 + (trains * 1.5f) + levelDif;
|
||||
chance = (chance < 5f) ? 5f : chance;
|
||||
chance = (chance > 95f) ? 95f : chance;
|
||||
|
||||
float roll = ThreadLocalRandom.current().nextFloat() * 100f;
|
||||
|
||||
return roll < chance;
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected static boolean peekDetect(AbstractCharacter pc, AbstractWorldObject awo) {
|
||||
if (pc == null || awo == null || !AbstractWorldObject.IsAbstractCharacter(awo) || pc.getPowers() == null)
|
||||
return false;
|
||||
|
||||
int levelDif = pc.getLevel() - ((AbstractCharacter)awo).getLevel();
|
||||
|
||||
if (!pc.getPowers().containsKey(429494332))
|
||||
return false;
|
||||
|
||||
CharacterPower cp = pc.getPowers().get(429494332);
|
||||
int trains = cp.getTotalTrains();
|
||||
|
||||
// check if peek is detected
|
||||
float chance = 30 + (40-trains)*1.5f - levelDif;
|
||||
chance = (chance < 5f) ? 5f : chance;
|
||||
chance = (chance > 95f) ? 95f : chance;
|
||||
|
||||
float roll = ThreadLocalRandom.current().nextFloat() * 100f;
|
||||
return roll < chance;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.ai.MobileFSM;
|
||||
import engine.gameManager.MovementManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.PromptRecallMsg;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class RecallPowerAction extends AbstractPowerAction {
|
||||
|
||||
public RecallPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (!AbstractWorldObject.IsAbstractCharacter(awo) || source == null)
|
||||
return;
|
||||
AbstractCharacter awoac = (AbstractCharacter)awo;
|
||||
|
||||
if (awo.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||
|
||||
PlayerCharacter pc = (PlayerCharacter) awo;
|
||||
|
||||
if (pc.hasBoon())
|
||||
return;
|
||||
|
||||
ClientConnection cc = pc.getClientConnection();
|
||||
|
||||
if(source.getObjectUUID() != pc.getObjectUUID()) {
|
||||
pc.setTimeStampNow("PromptRecall");
|
||||
pc.setTimeStamp("LastRecallType",1); //recall to bind
|
||||
PromptRecallMsg promptRecallMsgmsg = new PromptRecallMsg();
|
||||
Dispatch dispatch = Dispatch.borrow(pc, promptRecallMsgmsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
|
||||
|
||||
} else {
|
||||
MovementManager.translocate(awoac, awoac.getBindLoc(), null);
|
||||
}
|
||||
} else {
|
||||
Vector3fImmutable bindloc = awoac.getBindLoc();
|
||||
if (bindloc.x == 0.0f || bindloc.y == 0.0f)
|
||||
awoac.setBindLoc(MBServerStatics.startX, MBServerStatics.startY, MBServerStatics.startZ);
|
||||
awoac.teleport(awoac.getBindLoc());
|
||||
if (awoac.getObjectType() == GameObjectType.Mob){
|
||||
MobileFSM.setAwake((Mob)awoac,true);
|
||||
if (awoac.isAlive())
|
||||
WorldGrid.updateObject(awoac);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum.EffectSourceType;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class RemoveEffectPowerAction extends AbstractPowerAction {
|
||||
|
||||
|
||||
public EffectSourceType sourceType;
|
||||
private boolean removeAll;
|
||||
|
||||
public RemoveEffectPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
String effectTypeToRemove = rs.getString("effectSourceToRemove").replace("-", "").trim();
|
||||
sourceType = EffectSourceType.GetEffectSourceType(effectTypeToRemove);
|
||||
int flags = rs.getInt("flags");
|
||||
this.removeAll = ((flags & 2) != 0) ? true : false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (awo != null) {
|
||||
|
||||
|
||||
if (this.removeAll)
|
||||
awo.removeEffectBySource(this.sourceType, trains, true);
|
||||
else
|
||||
if (this.getIDString().equals("SNC-003A"))
|
||||
trains = 40;
|
||||
awo.removeEffectBySource(this.sourceType, trains, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class ResurrectPowerAction extends AbstractPowerAction {
|
||||
|
||||
public ResurrectPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.RunegateType;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.PromptRecallMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import static engine.math.FastMath.sqr;
|
||||
import static engine.math.FastMath.sqrt;
|
||||
|
||||
public class RunegateTeleportPowerAction extends AbstractPowerAction {
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public RunegateTeleportPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
if (source == null || awo == null || !(awo .getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
|
||||
return;
|
||||
|
||||
PlayerCharacter pc = (PlayerCharacter) awo;
|
||||
float dist = 9999999999f;
|
||||
Building rg = null;
|
||||
Vector3fImmutable rgLoc;
|
||||
|
||||
for (Runegate runegate: Runegate.getRunegates()) {
|
||||
|
||||
if ((runegate.getGateType() == RunegateType.OBLIV) ||
|
||||
(runegate.getGateType() == RunegateType.CHAOS))
|
||||
continue;
|
||||
|
||||
for (Runegate thisGate : Runegate.getRunegates()) {
|
||||
|
||||
rgLoc = thisGate.getGateType().getGateBuilding().getLoc();
|
||||
|
||||
float distanceToRunegateSquared = source.getLoc().distanceSquared2D(rgLoc);
|
||||
|
||||
if (distanceToRunegateSquared < sqr(dist)) {
|
||||
dist = sqrt(distanceToRunegateSquared);
|
||||
rg = thisGate.getGateType().getGateBuilding();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(source.getObjectUUID() != pc.getObjectUUID()) {
|
||||
pc.setTimeStampNow("PromptRecall");
|
||||
pc.setTimeStamp("LastRecallType",0); //recall to rg
|
||||
|
||||
if (rg != null) {
|
||||
PromptRecallMsg promptRecallMsgmsg = new PromptRecallMsg();
|
||||
Dispatch dispatch = Dispatch.borrow(pc, promptRecallMsgmsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (rg != null) {
|
||||
pc.teleport(rg.getLoc());
|
||||
pc.setSafeMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.CharacterItemManager;
|
||||
import engine.objects.Item;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class SetItemFlagPowerAction extends AbstractPowerAction {
|
||||
|
||||
public SetItemFlagPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
if (source == null || awo == null || !(awo .getObjectType().equals(Enum.GameObjectType.Item)))
|
||||
return;
|
||||
|
||||
Item item = (Item) awo;
|
||||
|
||||
if (item.containerType != Enum.ItemContainerType.INVENTORY)
|
||||
return; //Send an error here?
|
||||
|
||||
//until this is shown to do something else, just use it as item identify spell.
|
||||
item.setIsID(true);
|
||||
|
||||
if (!DbManager.ItemQueries.UPDATE_FLAGS(item))
|
||||
item.setIsID(false); //update failed, reset
|
||||
|
||||
//update inventory
|
||||
CharacterItemManager cim = source.getCharItemManager();
|
||||
if (cim != null)
|
||||
cim.updateInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
|
||||
public class SimpleDamagePowerAction extends AbstractPowerAction {
|
||||
|
||||
private int simpleDamage;
|
||||
|
||||
public SimpleDamagePowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
|
||||
this.simpleDamage = rs.getInt("simpleDamage");
|
||||
}
|
||||
|
||||
public int getSimpleDamage() {
|
||||
return this.simpleDamage;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class SpireDisablePowerAction extends AbstractPowerAction {
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public SpireDisablePowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
if (awo == null)
|
||||
return;
|
||||
|
||||
if (source == null)
|
||||
return;
|
||||
|
||||
PlayerCharacter pc = null;
|
||||
|
||||
if (source.getObjectType() == GameObjectType.PlayerCharacter)
|
||||
pc = (PlayerCharacter)source;
|
||||
else
|
||||
return;
|
||||
|
||||
if (awo.getObjectType() != GameObjectType.Building)
|
||||
return;
|
||||
|
||||
|
||||
//Check if Building is Spire.
|
||||
|
||||
Building spire = (Building)awo;
|
||||
|
||||
if ((spire.getBlueprintUUID() == 0) ||
|
||||
(spire.getBlueprint() != null && spire.getBlueprint().getBuildingGroup() != BuildingGroup.SPIRE)) {
|
||||
ChatManager.chatSystemError((PlayerCharacter)source, "This Building is not a spire.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!spire.isSpireIsActive())
|
||||
return;
|
||||
|
||||
spire.disableSpire(false);
|
||||
|
||||
if (trains > 20)
|
||||
trains = 20;
|
||||
|
||||
long duration = trains * 4500 + 30000;
|
||||
spire.setTimeStamp("DISABLED", System.currentTimeMillis() + duration);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||
// Magicbane Emulator Project © 2013 - 2022
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
package engine.powers.poweractions;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.CombatManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.LootMsg;
|
||||
import engine.objects.*;
|
||||
import engine.powers.ActionsBase;
|
||||
import engine.powers.PowersBase;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import static engine.math.FastMath.sqr;
|
||||
|
||||
|
||||
public class StealPowerAction extends AbstractPowerAction {
|
||||
|
||||
/**
|
||||
* ResultSet Constructor
|
||||
*/
|
||||
public StealPowerAction(ResultSet rs) throws SQLException {
|
||||
super(rs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
|
||||
if (source == null || awo == null || !(source.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) || !(awo.getObjectType().equals(Enum.GameObjectType.Item)))
|
||||
return;
|
||||
|
||||
PlayerCharacter sourcePlayer = (PlayerCharacter) source;
|
||||
|
||||
if (sourcePlayer.isSafeMode())
|
||||
return;
|
||||
|
||||
if (!sourcePlayer.isAlive())
|
||||
return;
|
||||
|
||||
//prevent stealing no steal mob loot
|
||||
if (awo instanceof MobLoot && ((MobLoot)awo).noSteal())
|
||||
return;
|
||||
|
||||
Item tar = (Item) awo;
|
||||
AbstractWorldObject owner = (AbstractWorldObject) tar.getOwner();
|
||||
|
||||
if (owner == null)
|
||||
return;
|
||||
|
||||
|
||||
AbstractCharacter ownerAC = null;
|
||||
if (AbstractWorldObject.IsAbstractCharacter(owner))
|
||||
ownerAC = (AbstractCharacter) owner;
|
||||
|
||||
if (ownerAC != null)
|
||||
if (ownerAC.getLoc().distanceSquared(sourcePlayer.getLoc()) > sqr(MBServerStatics.LOOT_RANGE))
|
||||
return;
|
||||
|
||||
//only steal from players or mobs
|
||||
|
||||
if (owner.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
|
||||
PlayerCharacter ownerPC = (PlayerCharacter)owner;
|
||||
|
||||
if (ownerPC.isSafeMode() || sourcePlayer.inSafeZone() || ownerPC.inSafeZone())
|
||||
return;
|
||||
|
||||
if (ownerPC.getLoc().distanceSquared(sourcePlayer.getLoc()) > sqr(MBServerStatics.LOOT_RANGE))
|
||||
return;
|
||||
|
||||
//dupe check, validate player has item
|
||||
if (!tar.validForInventory(ownerPC.getClientConnection(), ownerPC, ownerPC.getCharItemManager()))//pc.getCharItemManager()))
|
||||
return;
|
||||
|
||||
//mark thief and target as player aggressive
|
||||
sourcePlayer.setLastPlayerAttackTime();
|
||||
ownerPC.setLastPlayerAttackTime();
|
||||
|
||||
//Handle target attacking back if in combat and has no other target
|
||||
CombatManager.handleRetaliate(ownerAC, sourcePlayer);
|
||||
|
||||
} else if (owner.getObjectType().equals(Enum.GameObjectType.Mob)) {
|
||||
sourcePlayer.setLastMobAttackTime(); //mark thief as mob aggressive
|
||||
} else
|
||||
return;
|
||||
|
||||
ClientConnection origin = sourcePlayer.getClientConnection();
|
||||
|
||||
if (origin == null)
|
||||
return;
|
||||
|
||||
int amount = getAmountToSteal(tar);
|
||||
|
||||
//test probability of steal success
|
||||
if (!stealSuccess(sourcePlayer, owner)) {
|
||||
ChatManager.chatPeekSteal(sourcePlayer, ownerAC, tar, false, false, -1);
|
||||
return;
|
||||
} else {
|
||||
ChatManager.chatPeekSteal(sourcePlayer, ownerAC, tar, true, false, amount);
|
||||
//TODO send steal failure success
|
||||
}
|
||||
|
||||
//attempt transfer item
|
||||
CharacterItemManager myCIM = sourcePlayer.getCharItemManager();
|
||||
CharacterItemManager ownerCIM = ((AbstractCharacter)owner).getCharItemManager();
|
||||
if (myCIM == null || ownerCIM == null)
|
||||
return;
|
||||
|
||||
if (tar.getItemBase().getType().equals(ItemType.GOLD)) {
|
||||
//stealing gold
|
||||
if (!myCIM.transferGoldToMyInventory((AbstractCharacter)owner, amount))
|
||||
return;
|
||||
} else {
|
||||
//stealing items
|
||||
if (ownerCIM.lootItemFromMe(tar, sourcePlayer, origin, true, amount) == null)
|
||||
return;
|
||||
}
|
||||
|
||||
//send loot message to person stealing.
|
||||
LootMsg lm = new LootMsg(source.getObjectType().ordinal(), source.getObjectUUID(), owner.getObjectType().ordinal(), owner.getObjectUUID(), tar);
|
||||
Dispatch dispatch = Dispatch.borrow(sourcePlayer, lm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
|
||||
|
||||
//update thief's inventory
|
||||
if (sourcePlayer.getCharItemManager() != null)
|
||||
sourcePlayer.getCharItemManager().updateInventory();
|
||||
|
||||
//update victims inventory
|
||||
if (owner.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
PlayerCharacter ownerPC = (PlayerCharacter) owner;
|
||||
|
||||
if (ownerPC.getCharItemManager() != null)
|
||||
ownerPC.getCharItemManager().updateInventory();
|
||||
}
|
||||
|
||||
//TODO if victim is trading, cancel trade window for both people involved in trade
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _handleChant(AbstractCharacter source, AbstractWorldObject target, Vector3fImmutable targetLoc, int trains, ActionsBase ab, PowersBase pb) {
|
||||
}
|
||||
|
||||
protected static boolean stealSuccess(PlayerCharacter pc, AbstractWorldObject awo) {
|
||||
if (pc == null || awo == null || !AbstractWorldObject.IsAbstractCharacter(awo) || pc.getPowers() == null)
|
||||
return false;
|
||||
|
||||
int levelDif = pc.getLevel() - ((AbstractCharacter)awo).getLevel();
|
||||
|
||||
if (!pc.getPowers().containsKey(429396028))
|
||||
return false;
|
||||
|
||||
CharacterPower cp = pc.getPowers().get(429396028);
|
||||
int trains = cp.getTotalTrains();
|
||||
|
||||
float chance = 20 + (trains * 1.5f) + levelDif;
|
||||
chance = (chance < 5f) ? 5f : chance;
|
||||
chance = (chance > 85f) ? 85f : chance;
|
||||
|
||||
float roll = ThreadLocalRandom.current().nextFloat() * 100f;
|
||||
|
||||
return roll < chance;
|
||||
|
||||
}
|
||||
|
||||
//called to get amount of gold to steal between 0 and max gold
|
||||
protected static int getAmountToSteal(Item i) {
|
||||
if (i.getItemBase() != null && i.getItemBase().getUUID() == 7) {
|
||||
int amount = i.getNumOfItems();
|
||||
if (amount < 1)
|
||||
return -1;
|
||||
int a = ThreadLocalRandom.current().nextInt(amount + 1);
|
||||
int b = ThreadLocalRandom.current().nextInt(amount + 1);
|
||||
int c = ThreadLocalRandom.current().nextInt(amount + 1);
|
||||
return (a + b + c) / 3;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void _startAction(AbstractCharacter source, AbstractWorldObject awo, Vector3fImmutable targetLoc,
|
||||
int numTrains, ActionsBase ab, PowersBase pb, int duration) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user