Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c0cd365c1d | |||
| ee5620036d | |||
| 8ff06b1200 | |||
| a348056c86 | |||
| 1c10f8a872 | |||
| 4f28fefbc2 | |||
| 9ff7e07545 | |||
| d5809fc4b1 | |||
| 0c00832264 | |||
| 300452d2d8 | |||
| 9a9ea99bc7 | |||
| d9ab1032f4 | |||
| c2ea4424cf | |||
| b22c07b000 | |||
| 8e70e0597e | |||
| cf58e7b984 | |||
| ba81a24622 | |||
| 007299eae5 | |||
| 5f92345d3e |
@@ -0,0 +1,303 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
|
||||||
|
package engine.db.handlers;
|
||||||
|
|
||||||
|
import engine.gameManager.DbManager;
|
||||||
|
import engine.gameManager.PowersManager;
|
||||||
|
import engine.mbEnums;
|
||||||
|
import engine.powers.EffectsBase;
|
||||||
|
import engine.powers.effectmodifiers.*;
|
||||||
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
public class dbEffectsBaseHandler extends dbHandlerBase {
|
||||||
|
|
||||||
|
public dbEffectsBaseHandler() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ArrayList<EffectsBase> getAllEffectsBase() {
|
||||||
|
|
||||||
|
ArrayList<EffectsBase> effectList = new ArrayList<>();
|
||||||
|
|
||||||
|
try (Connection connection = DbManager.getConnection();
|
||||||
|
PreparedStatement prepareStatement = connection.prepareStatement("SELECT * FROM static_power_effectbase ORDER BY `IDString` DESC")) {
|
||||||
|
|
||||||
|
ResultSet rs = prepareStatement.executeQuery();
|
||||||
|
|
||||||
|
while (rs.next()) {
|
||||||
|
EffectsBase effectBase = new EffectsBase(rs);
|
||||||
|
effectList.add(effectBase);
|
||||||
|
}
|
||||||
|
} catch (SQLException e) {
|
||||||
|
Logger.error(e.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
return effectList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void cacheAllEffectModifiers() {
|
||||||
|
|
||||||
|
String IDString;
|
||||||
|
AbstractEffectModifier abstractEffectModifier = null;
|
||||||
|
|
||||||
|
try (Connection connection = DbManager.getConnection();
|
||||||
|
PreparedStatement prepareStatement = connection.prepareStatement("SELECT * FROM static_power_effectmod")) {
|
||||||
|
|
||||||
|
ResultSet rs = prepareStatement.executeQuery();
|
||||||
|
|
||||||
|
while (rs.next()) {
|
||||||
|
|
||||||
|
IDString = rs.getString("IDString");
|
||||||
|
EffectsBase effectBase = PowersManager.getEffectByIDString(IDString);
|
||||||
|
mbEnums.ModType modifier = mbEnums.ModType.GetModType(rs.getString("modType"));
|
||||||
|
|
||||||
|
//combine item prefix and suffix effect modifiers
|
||||||
|
|
||||||
|
abstractEffectModifier = getCombinedModifiers(abstractEffectModifier, rs, effectBase, modifier);
|
||||||
|
|
||||||
|
if (abstractEffectModifier != null) {
|
||||||
|
|
||||||
|
if (EffectsBase.modifiersMap.containsKey(effectBase.getIDString()) == false)
|
||||||
|
EffectsBase.modifiersMap.put(effectBase.getIDString(), new HashSet<>());
|
||||||
|
|
||||||
|
EffectsBase.modifiersMap.get(effectBase.getIDString()).add(abstractEffectModifier);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.error(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private static AbstractEffectModifier getCombinedModifiers(AbstractEffectModifier abstractEffectModifier, ResultSet rs, EffectsBase effectBase, mbEnums.ModType modifier) throws SQLException {
|
||||||
|
switch (modifier) {
|
||||||
|
case AdjustAboveDmgCap:
|
||||||
|
abstractEffectModifier = new AdjustAboveDmgCapEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Ambidexterity:
|
||||||
|
abstractEffectModifier = new AmbidexterityEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case AnimOverride:
|
||||||
|
break;
|
||||||
|
case ArmorPiercing:
|
||||||
|
abstractEffectModifier = new ArmorPiercingEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case AttackDelay:
|
||||||
|
abstractEffectModifier = new AttackDelayEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Attr:
|
||||||
|
abstractEffectModifier = new AttributeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case BlackMantle:
|
||||||
|
abstractEffectModifier = new BlackMantleEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case BladeTrails:
|
||||||
|
abstractEffectModifier = new BladeTrailsEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Block:
|
||||||
|
abstractEffectModifier = new BlockEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case BlockedPowerType:
|
||||||
|
abstractEffectModifier = new BlockedPowerTypeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case CannotAttack:
|
||||||
|
abstractEffectModifier = new CannotAttackEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case CannotCast:
|
||||||
|
abstractEffectModifier = new CannotCastEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case CannotMove:
|
||||||
|
abstractEffectModifier = new CannotMoveEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case CannotTrack:
|
||||||
|
abstractEffectModifier = new CannotTrackEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Charmed:
|
||||||
|
abstractEffectModifier = new CharmedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ConstrainedAmbidexterity:
|
||||||
|
abstractEffectModifier = new ConstrainedAmbidexterityEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case DamageCap:
|
||||||
|
abstractEffectModifier = new DamageCapEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case DamageShield:
|
||||||
|
abstractEffectModifier = new DamageShieldEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case DCV:
|
||||||
|
abstractEffectModifier = new DCVEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Dodge:
|
||||||
|
abstractEffectModifier = new DodgeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case DR:
|
||||||
|
abstractEffectModifier = new DREffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Durability:
|
||||||
|
abstractEffectModifier = new DurabilityEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ExclusiveDamageCap:
|
||||||
|
abstractEffectModifier = new ExclusiveDamageCapEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Fade:
|
||||||
|
abstractEffectModifier = new FadeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Fly:
|
||||||
|
abstractEffectModifier = new FlyEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Health:
|
||||||
|
abstractEffectModifier = new HealthEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case HealthFull:
|
||||||
|
abstractEffectModifier = new HealthFullEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case HealthRecoverRate:
|
||||||
|
abstractEffectModifier = new HealthRecoverRateEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case IgnoreDamageCap:
|
||||||
|
abstractEffectModifier = new IgnoreDamageCapEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case IgnorePassiveDefense:
|
||||||
|
abstractEffectModifier = new IgnorePassiveDefenseEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ImmuneTo:
|
||||||
|
abstractEffectModifier = new ImmuneToEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ImmuneToAttack:
|
||||||
|
abstractEffectModifier = new ImmuneToAttackEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ImmuneToPowers:
|
||||||
|
abstractEffectModifier = new ImmuneToPowersEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Invisible:
|
||||||
|
abstractEffectModifier = new InvisibleEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ItemName:
|
||||||
|
abstractEffectModifier = new ItemNameEffectModifier(rs);
|
||||||
|
if (((ItemNameEffectModifier) abstractEffectModifier).name.isEmpty())
|
||||||
|
break;
|
||||||
|
if (effectBase != null)
|
||||||
|
effectBase.setName((((ItemNameEffectModifier) abstractEffectModifier).name));
|
||||||
|
break;
|
||||||
|
case Mana:
|
||||||
|
abstractEffectModifier = new ManaEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ManaFull:
|
||||||
|
abstractEffectModifier = new ManaFullEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ManaRecoverRate:
|
||||||
|
abstractEffectModifier = new ManaRecoverRateEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case MaxDamage:
|
||||||
|
abstractEffectModifier = new MaxDamageEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case MeleeDamageModifier:
|
||||||
|
abstractEffectModifier = new MeleeDamageEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case MinDamage:
|
||||||
|
abstractEffectModifier = new MinDamageEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case NoMod:
|
||||||
|
abstractEffectModifier = new NoModEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case OCV:
|
||||||
|
abstractEffectModifier = new OCVEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Parry:
|
||||||
|
abstractEffectModifier = new ParryEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case PassiveDefense:
|
||||||
|
abstractEffectModifier = new PassiveDefenseEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case PowerCost:
|
||||||
|
abstractEffectModifier = new PowerCostEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case PowerCostHealth:
|
||||||
|
abstractEffectModifier = new PowerCostHealthEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case PowerDamageModifier:
|
||||||
|
abstractEffectModifier = new PowerDamageEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ProtectionFrom:
|
||||||
|
abstractEffectModifier = new ProtectionFromEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Resistance:
|
||||||
|
abstractEffectModifier = new ResistanceEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ScaleHeight:
|
||||||
|
abstractEffectModifier = new ScaleHeightEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ScaleWidth:
|
||||||
|
abstractEffectModifier = new ScaleWidthEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ScanRange:
|
||||||
|
abstractEffectModifier = new ScanRangeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case SeeInvisible:
|
||||||
|
abstractEffectModifier = new SeeInvisibleEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Silenced:
|
||||||
|
abstractEffectModifier = new SilencedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Skill:
|
||||||
|
abstractEffectModifier = new SkillEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Slay:
|
||||||
|
abstractEffectModifier = new SlayEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Speed:
|
||||||
|
abstractEffectModifier = new SpeedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case SpireBlock:
|
||||||
|
abstractEffectModifier = new SpireBlockEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Stamina:
|
||||||
|
abstractEffectModifier = new StaminaEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case StaminaFull:
|
||||||
|
abstractEffectModifier = new StaminaFullEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case StaminaRecoverRate:
|
||||||
|
abstractEffectModifier = new StaminaRecoverRateEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Stunned:
|
||||||
|
abstractEffectModifier = new StunnedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Value:
|
||||||
|
abstractEffectModifier = new ValueEffectModifier(rs);
|
||||||
|
if (effectBase != null) {
|
||||||
|
ValueEffectModifier valueEffect = (ValueEffectModifier) abstractEffectModifier;
|
||||||
|
effectBase.setValue(valueEffect.minMod);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WeaponProc:
|
||||||
|
abstractEffectModifier = new WeaponProcEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case WeaponRange:
|
||||||
|
abstractEffectModifier = new WeaponRangeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case WeaponSpeed:
|
||||||
|
abstractEffectModifier = new WeaponSpeedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
return abstractEffectModifier;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -221,4 +221,20 @@ public class dbLootHandler extends dbHandlerBase {
|
|||||||
return bootySets;
|
return bootySets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void LOAD_ENCHANT_VALUES() {
|
||||||
|
|
||||||
|
try (Connection connection = DbManager.getConnection();
|
||||||
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `IDString`, `minMod` FROM `static_power_effectmod` WHERE `modType` = ?")) {
|
||||||
|
|
||||||
|
preparedStatement.setString(1, "Value");
|
||||||
|
ResultSet rs = preparedStatement.executeQuery();
|
||||||
|
|
||||||
|
while (rs.next())
|
||||||
|
Item.addEnchantValue(rs.getString("IDString"), rs.getInt("minMod"));
|
||||||
|
|
||||||
|
} catch (SQLException e) {
|
||||||
|
Logger.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,82 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
|
||||||
|
package engine.db.handlers;
|
||||||
|
|
||||||
|
import engine.gameManager.DbManager;
|
||||||
|
import engine.gameManager.PowersManager;
|
||||||
|
import engine.mbEnums;
|
||||||
|
import engine.objects.Mob;
|
||||||
|
import engine.powers.EffectsBase;
|
||||||
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
public class dbPowerHandler extends dbHandlerBase {
|
||||||
|
|
||||||
|
public dbPowerHandler() {
|
||||||
|
this.localClass = Mob.class;
|
||||||
|
this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addAllSourceTypes() {
|
||||||
|
|
||||||
|
try (Connection connection = DbManager.getConnection();
|
||||||
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_sourcetype")) {
|
||||||
|
|
||||||
|
ResultSet rs = preparedStatement.executeQuery();
|
||||||
|
String IDString, source;
|
||||||
|
|
||||||
|
while (rs.next()) {
|
||||||
|
IDString = rs.getString("IDString");
|
||||||
|
int token = DbManager.hasher.SBStringHash(IDString);
|
||||||
|
|
||||||
|
source = rs.getString("source").replace("-", "").trim();
|
||||||
|
mbEnums.EffectSourceType effectSourceType = mbEnums.EffectSourceType.GetEffectSourceType(source);
|
||||||
|
|
||||||
|
if (EffectsBase.effectSourceTypeMap.containsKey(token) == false)
|
||||||
|
EffectsBase.effectSourceTypeMap.put(token, new HashSet<>());
|
||||||
|
|
||||||
|
EffectsBase.effectSourceTypeMap.get(token).add(effectSourceType);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void addAllAnimationOverrides() {
|
||||||
|
|
||||||
|
try (Connection connection = DbManager.getConnection();
|
||||||
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_animation_override")) {
|
||||||
|
|
||||||
|
ResultSet rs = preparedStatement.executeQuery();
|
||||||
|
|
||||||
|
String IDString;
|
||||||
|
int animation;
|
||||||
|
while (rs.next()) {
|
||||||
|
IDString = rs.getString("IDString");
|
||||||
|
|
||||||
|
EffectsBase eb = PowersManager.getEffectByIDString(IDString);
|
||||||
|
if (eb != null)
|
||||||
|
IDString = eb.getIDString();
|
||||||
|
|
||||||
|
animation = rs.getInt("animation");
|
||||||
|
PowersManager.AnimationOverrides.put(IDString, animation);
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.error(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -136,12 +136,6 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
|||||||
int cityUID = rs.getInt("cityUUID");
|
int cityUID = rs.getInt("cityUUID");
|
||||||
JSONObject jsonObject = new JSONObject(rs.getString("warehouse"));
|
JSONObject jsonObject = new JSONObject(rs.getString("warehouse"));
|
||||||
City city = City.getCity(cityUID);
|
City city = City.getCity(cityUID);
|
||||||
|
|
||||||
if (city == null) {
|
|
||||||
Logger.error("No city " + cityUID + " for warehouse");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
city.warehouse = new Warehouse(jsonObject);
|
city.warehouse = new Warehouse(jsonObject);
|
||||||
city.warehouse.city = city;
|
city.warehouse.city = city;
|
||||||
|
|
||||||
@@ -198,7 +192,6 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
|||||||
// via the client interface.
|
// via the client interface.
|
||||||
|
|
||||||
ArrayList<WorkOrder> submitList = new ArrayList<>();
|
ArrayList<WorkOrder> submitList = new ArrayList<>();
|
||||||
ArrayList<WorkOrder> orphanList = new ArrayList<>();
|
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
try (Connection connection = DbManager.getConnection();
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_workorders`;");
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_workorders`;");
|
||||||
@@ -216,14 +209,7 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
|||||||
// Submit new workOrders to the ForgeManager
|
// Submit new workOrders to the ForgeManager
|
||||||
|
|
||||||
for (WorkOrder workOrder : submitList) {
|
for (WorkOrder workOrder : submitList) {
|
||||||
|
|
||||||
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
|
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
|
||||||
|
|
||||||
// Delete but do not reconstitute orphan workOrders
|
|
||||||
|
|
||||||
if (workOrder.vendor == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
workOrder.workOrderID = ForgeManager.workOrderCounter.incrementAndGet();
|
workOrder.workOrderID = ForgeManager.workOrderCounter.incrementAndGet();
|
||||||
DbManager.WarehouseQueries.WRITE_WORKORDER(workOrder);
|
DbManager.WarehouseQueries.WRITE_WORKORDER(workOrder);
|
||||||
ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder);
|
ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder);
|
||||||
|
|||||||
@@ -0,0 +1,156 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
|
||||||
|
package engine.devcmd.cmds;
|
||||||
|
|
||||||
|
import engine.devcmd.AbstractDevCmd;
|
||||||
|
import engine.gameManager.ChatManager;
|
||||||
|
import engine.gameManager.PowersManager;
|
||||||
|
import engine.mbEnums.PowerActionType;
|
||||||
|
import engine.objects.AbstractGameObject;
|
||||||
|
import engine.objects.PlayerCharacter;
|
||||||
|
import engine.powers.ActionsBase;
|
||||||
|
import engine.powers.PowersBase;
|
||||||
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
|
import engine.util.ThreadUtils;
|
||||||
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
public class ApplyBonusCmd extends AbstractDevCmd {
|
||||||
|
|
||||||
|
public ApplyBonusCmd() {
|
||||||
|
super("applybonus");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void _doCmd(PlayerCharacter pcSender, String[] words,
|
||||||
|
AbstractGameObject target) {
|
||||||
|
|
||||||
|
String action = words[0];
|
||||||
|
|
||||||
|
PowerActionType actionType = null;
|
||||||
|
|
||||||
|
HashMap<String, HashSet<String>> appliedMods = new HashMap<>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (action.equals("all") == false)
|
||||||
|
for (PowerActionType powerActionType : PowerActionType.values()) {
|
||||||
|
if (powerActionType.name().equalsIgnoreCase(action) == false)
|
||||||
|
continue;
|
||||||
|
actionType = powerActionType;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.throwbackError(pcSender, "Invalid power Action type for " + action);
|
||||||
|
this.throwbackInfo(pcSender, "Valid Types : " + this.getActionTypes());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (action.equals("all") == false)
|
||||||
|
if (actionType == null) {
|
||||||
|
this.throwbackError(pcSender, "Invalid power Action type for " + action);
|
||||||
|
this.throwbackInfo(pcSender, "Valid Types : " + this.getActionTypes());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
for (PowersBase pb : PowersManager.powersBaseByIDString.values()) {
|
||||||
|
if (pb.getActions() == null || pb.getActions().isEmpty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
for (ActionsBase ab : pb.getActions()) {
|
||||||
|
if (ab.getPowerAction() == null)
|
||||||
|
continue;
|
||||||
|
if (action.equals("all") == false)
|
||||||
|
if (ab.getPowerAction().getType().equalsIgnoreCase(action) == false)
|
||||||
|
continue;
|
||||||
|
String effect1 = "";
|
||||||
|
String effect2 = "";
|
||||||
|
ChatManager.chatSystemInfo(pcSender, "Applying Power " + pb.getName() + " : " + pb.getDescription());
|
||||||
|
if (ab.getPowerAction().getEffectsBase() == null) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
PowersManager.runPowerAction(pcSender, pcSender, pcSender.getLoc(), ab, 1, pb);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
ThreadUtils.sleep(500);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (ab.getPowerAction().getEffectsBase().getModifiers() == null || ab.getPowerAction().getEffectsBase().getModifiers().isEmpty()) {
|
||||||
|
try {
|
||||||
|
PowersManager.runPowerAction(pcSender, pcSender, pcSender.getLoc(), ab, 1, pb);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean run = true;
|
||||||
|
for (AbstractEffectModifier mod : ab.getPowerAction().getEffectsBase().getModifiers()) {
|
||||||
|
if (appliedMods.containsKey(mod.modType.name()) == false) {
|
||||||
|
appliedMods.put(mod.modType.name(), new HashSet<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (appliedMods.get(mod.modType.name()).contains(mod.sourceType.name())){
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
appliedMods.get(mod.modType.name()).add(mod.sourceType.name());
|
||||||
|
try {
|
||||||
|
try {
|
||||||
|
PowersManager.runPowerAction(pcSender, pcSender, pcSender.getLoc(), ab, 1, pb);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.error(e);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String _getUsageString() {
|
||||||
|
return "' /bounds'";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String _getHelpString() {
|
||||||
|
return "Audits all the mobs in a zone.";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getActionTypes() {
|
||||||
|
String output = "";
|
||||||
|
|
||||||
|
for (PowerActionType actionType : PowerActionType.values()) {
|
||||||
|
output += actionType.name() + " | ";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return output.substring(0, output.length() - 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -104,67 +104,67 @@ public enum BuildingManager {
|
|||||||
if (building == null)
|
if (building == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//cannot access destroyed buildings
|
|
||||||
if (building.getRank() == -1)
|
if (building.getRank() == -1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//admin characters can always access buildings
|
|
||||||
if (player.isCSR())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
//owner can always access their own building
|
|
||||||
if (IsOwner(building, player))
|
if (IsOwner(building, player))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//check for default IC access if building belongs to same guild
|
//individual friend.
|
||||||
if(player.guild.equals(building.getGuild())) {
|
|
||||||
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() != null) {
|
|
||||||
switch (building.getBlueprint().getBuildingGroup()) {
|
|
||||||
case TOL:
|
|
||||||
case BARRACK:
|
|
||||||
case SPIRE:
|
|
||||||
case SHRINE:
|
|
||||||
case BANESTONE:
|
|
||||||
case MINE:
|
|
||||||
case WAREHOUSE:
|
|
||||||
case BULWARK:
|
|
||||||
case SIEGETENT:
|
|
||||||
if (GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
|
||||||
return true;
|
|
||||||
if (GuildStatusController.isGuildLeader(player.getGuildStatus()))
|
|
||||||
return true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//check against friends list entries if any present
|
if (building.getFriends() != null && building.getFriends().get(player.getObjectUUID()) != null)
|
||||||
if (building.getFriends() != null) {
|
return true;
|
||||||
|
|
||||||
//check individuals
|
//Admins can access stuff
|
||||||
if (building.getFriends().get(player.getObjectUUID()) != null)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (building.getFriends().get(player.guild.objectUUID) != null) {
|
if (player.isCSR())
|
||||||
|
return true;
|
||||||
|
|
||||||
//check friend type for guild related access
|
//Guild stuff
|
||||||
switch (building.getFriends().get(player.guild.objectUUID).friendType) {
|
|
||||||
case 8: //full member
|
if (building.getGuild().isGuildLeader(player.getObjectUUID()))
|
||||||
if (GuildStatusController.isFullMember(player.getGuildStatus()))
|
return true;
|
||||||
return true;
|
|
||||||
break;
|
if (building.getFriends().get(player.getGuild().getObjectUUID()) != null && building.getFriends().get(player.getGuild().getObjectUUID()).friendType == 8)
|
||||||
case 9: //Inner Council
|
return true;
|
||||||
if (GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
|
||||||
return true;
|
if (building.getFriends().get(player.getGuild().getObjectUUID()) != null && building.getFriends().get(player.getGuild().getObjectUUID()).friendType == 9 && GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
||||||
if (GuildStatusController.isGuildLeader(player.getGuildStatus()))
|
return true;
|
||||||
return true;
|
|
||||||
break;
|
if (Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isGuildLeader(player.getGuildStatus());
|
||||||
|
|
||||||
|
//TODO test friends list once added
|
||||||
|
//does not meet above criteria. Cannot access.
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean playerCanManageNotFriends(PlayerCharacter player, Building building) {
|
||||||
|
|
||||||
|
//Player Can only Control Building if player is in Same Guild as Building and is higher rank than IC.
|
||||||
|
|
||||||
|
if (player == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (building == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (building.getRank() == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (IsOwner(building, player))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
//Somehow guild leader check fails? lets check if Player is true Guild GL.
|
||||||
|
if (building.getGuild() != null && building.getGuild().isGuildLeader(player.getObjectUUID()))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (!GuildStatusController.isGuildLeader(player.getGuildStatus()) && !GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
||||||
|
return false;
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//did not meet access grant criteria, deny access
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized boolean lootBuilding(PlayerCharacter player, Building building) {
|
public static synchronized boolean lootBuilding(PlayerCharacter player, Building building) {
|
||||||
@@ -463,19 +463,29 @@ public enum BuildingManager {
|
|||||||
return GuildStatusController.isGuildLeader(player.getGuildStatus()) || GuildStatusController.isInnerCouncil(player.getGuildStatus());
|
return GuildStatusController.isGuildLeader(player.getGuildStatus()) || GuildStatusController.isInnerCouncil(player.getGuildStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int GetAvailableGold(Building building) {
|
||||||
|
|
||||||
|
if (building.getStrongboxValue() == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (building.getStrongboxValue() < building.reserve)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return building.getStrongboxValue() - building.reserve;
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean IsPlayerHostile(Building building, PlayerCharacter player) {
|
public static boolean IsPlayerHostile(Building building, PlayerCharacter player) {
|
||||||
|
|
||||||
|
//Nation Members and Guild members are not hostile.
|
||||||
|
// if (building.getGuild() != null){
|
||||||
|
// if (pc.getGuild() != null)
|
||||||
|
// if (building.getGuild().getObjectUUID() == pc.getGuildUUID()
|
||||||
|
// || pc.getGuild().getNation().getObjectUUID() == building.getGuild().getNation().getObjectUUID())
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
if (Guild.sameNationExcludeErrant(building.getGuild(), player.getGuild()))
|
if (Guild.sameNationExcludeErrant(building.getGuild(), player.getGuild()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(building.enforceKOS) {
|
|
||||||
if (building.getCity() != null) {
|
|
||||||
Building TOL = building.getCity().getTOL();
|
|
||||||
if (TOL != null) {
|
|
||||||
building = TOL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!building.reverseKOS) {
|
if (!building.reverseKOS) {
|
||||||
|
|
||||||
Condemned condemn = building.getCondemned().get(player.getObjectUUID());
|
Condemned condemn = building.getCondemned().get(player.getObjectUUID());
|
||||||
@@ -798,7 +808,7 @@ public enum BuildingManager {
|
|||||||
// Attempt to write to database or delete the building
|
// Attempt to write to database or delete the building
|
||||||
// if we are destroying it.
|
// if we are destroying it.
|
||||||
|
|
||||||
if (rank < 0)
|
if (rank == -1)
|
||||||
success = DbManager.BuildingQueries.DELETE_FROM_DATABASE(building);
|
success = DbManager.BuildingQueries.DELETE_FROM_DATABASE(building);
|
||||||
else
|
else
|
||||||
success = DbManager.BuildingQueries.updateBuildingRank(building, rank);
|
success = DbManager.BuildingQueries.updateBuildingRank(building, rank);
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import engine.net.client.msg.UpdateStateMsg;
|
|||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.DamageShield;
|
import engine.powers.DamageShield;
|
||||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
import engine.powers.effectmodifiers.WeaponProcEffectModifier;
|
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -48,7 +47,7 @@ public enum CombatManager {
|
|||||||
public static final int COMBAT_PARRY_ANIMATION = 299;
|
public static final int COMBAT_PARRY_ANIMATION = 299;
|
||||||
public static final int COMBAT_DODGE_ANIMATION = 300;
|
public static final int COMBAT_DODGE_ANIMATION = 300;
|
||||||
|
|
||||||
public static void combatCycle(AbstractCharacter attacker, AbstractWorldObject target) {
|
public static void combatCycle(AbstractCharacter attacker, AbstractWorldObject target, long addedDelay) {
|
||||||
|
|
||||||
//early exit checks
|
//early exit checks
|
||||||
|
|
||||||
@@ -79,411 +78,413 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (mainWeapon == null && offWeapon == null) {
|
if (mainWeapon == null && offWeapon == null) {
|
||||||
//no weapons equipped, punch with both fists
|
//no weapons equipped, punch with both fists
|
||||||
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
|
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD,addedDelay);
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))
|
||||||
processAttack(attacker, target, mbEnums.EquipSlotType.LHELD);
|
processAttack(attacker, target, mbEnums.EquipSlotType.LHELD,addedDelay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mainWeapon != null && offWeapon == null) {
|
if (mainWeapon != null && offWeapon == null) {
|
||||||
//swing right hand only
|
//swing right hand only
|
||||||
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
|
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD,addedDelay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mainWeapon == null && offWeapon != null && !offWeapon.template.item_skill_used.equals("Block")) {
|
if (mainWeapon == null && offWeapon != null && !offWeapon.template.item_skill_used.equals("Block")) {
|
||||||
//swing left hand only
|
//swing left hand only
|
||||||
processAttack(attacker, target, mbEnums.EquipSlotType.LHELD);
|
processAttack(attacker, target, mbEnums.EquipSlotType.LHELD,addedDelay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_used.equals("Block")) {
|
if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_used.equals("Block")) {
|
||||||
//no weapon equipped with a shield, punch with one hand
|
//no weapon equipped with a shield, punch with one hand
|
||||||
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
|
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD,addedDelay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mainWeapon != null && offWeapon != null && offWeapon.template.item_skill_used.equals("Block")) {
|
if (mainWeapon != null && offWeapon != null && offWeapon.template.item_skill_used.equals("Block")) {
|
||||||
//one weapon equipped with a shield, swing with one hand
|
//one weapon equipped with a shield, swing with one hand
|
||||||
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
|
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD,addedDelay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mainWeapon != null && offWeapon != null && !offWeapon.template.item_skill_used.equals("Block")) {
|
if (mainWeapon != null && offWeapon != null && !offWeapon.template.item_skill_used.equals("Block")) {
|
||||||
//two weapons equipped, swing both hands
|
//two weapons equipped, swing both hands
|
||||||
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
|
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD,addedDelay);
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))
|
||||||
processAttack(attacker, target, mbEnums.EquipSlotType.LHELD);
|
processAttack(attacker, target, mbEnums.EquipSlotType.LHELD,addedDelay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void processAttack(AbstractCharacter attacker, AbstractWorldObject target, mbEnums.EquipSlotType slot) {
|
public static void processAttack(AbstractCharacter attacker, AbstractWorldObject target, mbEnums.EquipSlotType slot, long addedDelay) {
|
||||||
|
|
||||||
|
if (slot == null || target == null || attacker == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||||
if (!attacker.isCombat())
|
if (!attacker.isCombat())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//check if this slot is on attack timer, if timer has passed clear it, else early exit
|
|
||||||
if (attacker.getTimers() != null && attacker.getTimers().containsKey("Attack" + slot.name()))
|
|
||||||
if (attacker.getTimers().get("Attack" + slot.name()).timeToExecutionLeft() <= 0)
|
|
||||||
attacker.getTimers().remove("Attack" + slot.name());
|
|
||||||
else
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target.combatLock.writeLock().lock();
|
||||||
|
|
||||||
// check if character is in range to attack target
|
// check if character is in range to attack target
|
||||||
|
try {
|
||||||
|
PlayerBonuses bonus = attacker.getBonuses();
|
||||||
|
|
||||||
PlayerBonuses bonus = attacker.getBonuses();
|
float rangeMod = 1.0f;
|
||||||
|
float attackRange = MBServerStatics.NO_WEAPON_RANGE;
|
||||||
|
|
||||||
float rangeMod = 1.0f;
|
Item weapon = attacker.charItemManager.getEquipped(slot);
|
||||||
float attackRange = MBServerStatics.NO_WEAPON_RANGE;
|
|
||||||
|
|
||||||
Item weapon = attacker.charItemManager.getEquipped(slot);
|
if (weapon != null) {
|
||||||
|
if (bonus != null)
|
||||||
|
rangeMod += bonus.getFloatPercentAll(mbEnums.ModType.WeaponRange, mbEnums.SourceType.None);
|
||||||
|
|
||||||
if (weapon != null) {
|
attackRange += weapon.template.item_weapon_max_range * rangeMod;
|
||||||
if (bonus != null)
|
|
||||||
rangeMod += bonus.getFloatPercentAll(mbEnums.ModType.WeaponRange, mbEnums.SourceType.None);
|
|
||||||
|
|
||||||
attackRange += weapon.template.item_weapon_max_range * rangeMod;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
|
||||||
if (((Mob) attacker).isSiege())
|
|
||||||
attackRange = 300;
|
|
||||||
|
|
||||||
float distanceSquared = attacker.loc.distanceSquared(target.loc);
|
|
||||||
|
|
||||||
boolean inRange = false;
|
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
|
||||||
attackRange += ((AbstractCharacter) target).calcHitBox();
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attackRange > 15 && attacker.isMoving()) {
|
|
||||||
//cannot shoot bow while moving;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (target.getObjectType()) {
|
|
||||||
case PlayerCharacter:
|
|
||||||
attackRange += ((PlayerCharacter) target).getCharacterHeight() * 0.5f;
|
|
||||||
if (distanceSquared <= attackRange * attackRange)
|
|
||||||
inRange = true;
|
|
||||||
break;
|
|
||||||
case Mob:
|
|
||||||
attackRange += ((AbstractCharacter) target).calcHitBox();
|
|
||||||
if (distanceSquared <= attackRange * attackRange)
|
|
||||||
inRange = true;
|
|
||||||
break;
|
|
||||||
case Building:
|
|
||||||
if (attackRange > 15) {
|
|
||||||
float rangeSquared = (attackRange + target.getBounds().getHalfExtents().x) * (attackRange + target.getBounds().getHalfExtents().x);
|
|
||||||
//float distanceSquared = attacker.loc.distanceSquared(target.loc);
|
|
||||||
if (distanceSquared < rangeSquared) {
|
|
||||||
inRange = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
float locX = target.loc.x - target.getBounds().getHalfExtents().x;
|
|
||||||
float locZ = target.loc.z - target.getBounds().getHalfExtents().y;
|
|
||||||
float sizeX = (target.getBounds().getHalfExtents().x + attackRange) * 2;
|
|
||||||
float sizeZ = (target.getBounds().getHalfExtents().y + attackRange) * 2;
|
|
||||||
Rectangle2D.Float rect = new Rectangle2D.Float(locX, locZ, sizeX, sizeZ);
|
|
||||||
if (rect.contains(new Point2D.Float(attacker.loc.x, attacker.loc.z)))
|
|
||||||
inRange = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//get delay for the auto attack job
|
|
||||||
long delay = 5000;
|
|
||||||
|
|
||||||
if (weapon != null) {
|
|
||||||
|
|
||||||
float wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
|
||||||
|
|
||||||
if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None) != 0f) //add weapon speed bonus
|
|
||||||
wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None));
|
|
||||||
|
|
||||||
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None) != 0f) //add effects speed bonus
|
|
||||||
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None));
|
|
||||||
|
|
||||||
if (wepSpeed < 10)
|
|
||||||
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
|
||||||
|
|
||||||
delay = (long)wepSpeed * 100L;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
|
||||||
((Mob) attacker).nextAttackTime = System.currentTimeMillis() + delay;
|
|
||||||
|
|
||||||
if (inRange) {
|
|
||||||
|
|
||||||
if(attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)){
|
|
||||||
if(!attacker.getTimestamps().contains(slot.name()+"Attack")){
|
|
||||||
attacker.getTimestamps().put(slot.name()+"Attack", System.currentTimeMillis() - 1000);
|
|
||||||
} else if(System.currentTimeMillis() < attacker.getTimestamps().get(slot.name()+"Attack") + delay){
|
|
||||||
setAutoAttackJob(attacker,slot,delay);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
||||||
|
if (((Mob) attacker).isSiege())
|
||||||
|
attackRange = 300;
|
||||||
|
|
||||||
//handle retaliate
|
float distanceSquared = attacker.loc.distanceSquared(target.loc);
|
||||||
|
|
||||||
|
boolean inRange = false;
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
||||||
if (((AbstractCharacter) target).combatTarget == null || !((AbstractCharacter) target).combatTarget.isAlive()) {
|
attackRange += ((AbstractCharacter) target).calcHitBox();
|
||||||
((AbstractCharacter) target).combatTarget = attacker;
|
} else {
|
||||||
if (target.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter) && ((AbstractCharacter) target).isCombat())
|
//need to handle building attacks range calculations here
|
||||||
combatCycle((AbstractCharacter) target, attacker);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// take stamina away from attacker if its not a mob
|
attackRange += 4; // need to add 4 to the attack range to offset where the client stops short of legitimate range
|
||||||
if (weapon != null && !attacker.getObjectType().equals(mbEnums.GameObjectType.Mob)) {
|
|
||||||
//check if Out of Stamina
|
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
|
||||||
if (attacker.getStamina() < (weapon.template.item_wt / 3f)) {
|
|
||||||
//set auto attack job
|
|
||||||
setAutoAttackJob(attacker, slot, delay);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
float stam = weapon.template.item_wt / 3f;
|
|
||||||
stam = (stam < 1) ? 1 : stam;
|
|
||||||
attacker.modifyStamina(-(stam), attacker, true);
|
|
||||||
} else
|
|
||||||
attacker.modifyStamina(1, attacker, true);
|
|
||||||
|
|
||||||
//cancel things that are cancelled by an attack
|
float distance = target.loc.distance(attacker.loc);
|
||||||
|
if (attackRange > 25 && attacker.isMoving()) {
|
||||||
attacker.cancelOnAttackSwing();
|
//cannot shoot bow while moving;
|
||||||
|
|
||||||
//declare relevant variables
|
|
||||||
|
|
||||||
int min = attacker.minDamageHandOne;
|
|
||||||
int max = attacker.maxDamageHandOne;
|
|
||||||
int atr = attacker.atrHandOne;
|
|
||||||
|
|
||||||
//get the proper stats based on which slot is attacking
|
|
||||||
|
|
||||||
if (slot == mbEnums.EquipSlotType.LHELD) {
|
|
||||||
min = attacker.minDamageHandTwo;
|
|
||||||
max = attacker.maxDamageHandTwo;
|
|
||||||
atr = attacker.atrHandTwo;
|
|
||||||
}
|
|
||||||
|
|
||||||
//apply weapon powers before early exit for miss or passives
|
|
||||||
DeferredPowerJob dpj = null;
|
|
||||||
|
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
|
||||||
|
|
||||||
dpj = ((PlayerCharacter) attacker).getWeaponPower();
|
|
||||||
|
|
||||||
if (dpj != null) {
|
|
||||||
dpj.attack(target, attackRange);
|
|
||||||
|
|
||||||
if (dpj.getPower() != null && (dpj.getPowerToken() == -1851459567 || dpj.getPowerToken() == -1851489518))
|
|
||||||
((PlayerCharacter) attacker).setWeaponPower(dpj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int def = 0;
|
|
||||||
|
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target))
|
|
||||||
def = ((AbstractCharacter) target).defenseRating;
|
|
||||||
|
|
||||||
//calculate hit chance based off ATR and DEF
|
|
||||||
|
|
||||||
int hitChance;
|
|
||||||
if (def == 0)
|
|
||||||
def = 1;
|
|
||||||
float dif = atr * 1f / def;
|
|
||||||
|
|
||||||
if (dif <= 0.8f)
|
|
||||||
hitChance = 4;
|
|
||||||
else
|
|
||||||
hitChance = ((int) (450 * (dif - 0.8f)) + 4);
|
|
||||||
|
|
||||||
if (target.getObjectType() == mbEnums.GameObjectType.Building)
|
|
||||||
hitChance = 100;
|
|
||||||
int passiveAnim = getPassiveAnimation(mbEnums.PassiveType.None); // checking for a miss due to ATR vs Def
|
|
||||||
if (ThreadLocalRandom.current().nextInt(100) > hitChance) {
|
|
||||||
TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim);
|
|
||||||
|
|
||||||
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
|
|
||||||
DispatchManager.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
|
||||||
else
|
|
||||||
DispatchManager.sendToAllInRange(attacker, msg);
|
|
||||||
|
|
||||||
//we need to send the animation even if the attacker misses
|
|
||||||
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template, null, slot));
|
|
||||||
DispatchManager.sendToAllInRange(target, cmm);
|
|
||||||
|
|
||||||
//set auto attack job
|
|
||||||
setAutoAttackJob(attacker, slot, delay);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//calculate passive chances only if target is AbstractCharacter
|
switch (target.getObjectType()) {
|
||||||
|
case PlayerCharacter:
|
||||||
|
attackRange += ((PlayerCharacter) target).getCharacterHeight() * 0.5f;
|
||||||
|
if (distanceSquared < attackRange * attackRange)
|
||||||
|
inRange = true;
|
||||||
|
break;
|
||||||
|
case Mob:
|
||||||
|
attackRange += ((AbstractCharacter) target).calcHitBox();
|
||||||
|
if (distanceSquared < attackRange * attackRange)
|
||||||
|
inRange = true;
|
||||||
|
break;
|
||||||
|
case Building:
|
||||||
|
if (attackRange > 15) {
|
||||||
|
float rangeSquared = (attackRange + target.getBounds().getHalfExtents().x) * (attackRange + target.getBounds().getHalfExtents().x);
|
||||||
|
//float distanceSquared = attacker.loc.distanceSquared(target.loc);
|
||||||
|
if (distanceSquared < rangeSquared) {
|
||||||
|
inRange = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
float locX = target.loc.x - target.getBounds().getHalfExtents().x;
|
||||||
|
float locZ = target.loc.z - target.getBounds().getHalfExtents().y;
|
||||||
|
float sizeX = (target.getBounds().getHalfExtents().x + attackRange) * 2;
|
||||||
|
float sizeZ = (target.getBounds().getHalfExtents().y + attackRange) * 2;
|
||||||
|
Rectangle2D.Float rect = new Rectangle2D.Float(locX, locZ, sizeX, sizeZ);
|
||||||
|
if (rect.contains(new Point2D.Float(attacker.loc.x, attacker.loc.z)))
|
||||||
|
inRange = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (EnumSet.of(mbEnums.GameObjectType.PlayerCharacter, mbEnums.GameObjectType.NPC, mbEnums.GameObjectType.Mob).contains(target.getObjectType())) {
|
//get delay for the auto attack job
|
||||||
mbEnums.PassiveType passiveType = mbEnums.PassiveType.None;
|
long delay = 5000;
|
||||||
int hitRoll = ThreadLocalRandom.current().nextInt(100);
|
|
||||||
|
|
||||||
float dodgeChance = ((AbstractCharacter) target).getPassiveChance("Dodge", attacker.getLevel(), true);
|
//if (weapon != null) {
|
||||||
float blockChance = ((AbstractCharacter) target).getPassiveChance("Block", attacker.getLevel(), true);
|
|
||||||
float parryChance = ((AbstractCharacter) target).getPassiveChance("Parry", attacker.getLevel(), true);
|
|
||||||
|
|
||||||
// Passive chance clamped at 75
|
// int wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
||||||
|
|
||||||
dodgeChance = Math.max(0, Math.min(75, dodgeChance));
|
// if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None) != 0f) //add weapon speed bonus
|
||||||
blockChance = Math.max(0, Math.min(75, blockChance));
|
// wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None));
|
||||||
parryChance = Math.max(0, Math.min(75, parryChance));
|
|
||||||
|
|
||||||
if (hitRoll < dodgeChance)
|
// if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None) != 0f) //add effects speed bonus
|
||||||
passiveType = mbEnums.PassiveType.Dodge;
|
// wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None));
|
||||||
else if (hitRoll < blockChance)
|
|
||||||
passiveType = mbEnums.PassiveType.Block;
|
// if (wepSpeed < 10)
|
||||||
else if (hitRoll < parryChance)
|
// wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
||||||
passiveType = mbEnums.PassiveType.Parry;
|
|
||||||
|
// delay = wepSpeed * 100L;
|
||||||
|
//}
|
||||||
|
|
||||||
|
if(attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)){
|
||||||
|
if(slot.equals(mbEnums.EquipSlotType.RHELD)){
|
||||||
|
delay = (long)(attacker.speedHandOne * 100L);
|
||||||
|
}else{
|
||||||
|
delay = (long)(attacker.speedHandTwo * 100L);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
||||||
|
((Mob) attacker).nextAttackTime = System.currentTimeMillis() + delay;
|
||||||
|
delay += addedDelay;
|
||||||
|
if (inRange) {
|
||||||
|
|
||||||
|
//handle retaliate
|
||||||
|
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
||||||
|
if (((AbstractCharacter) target).combatTarget == null || !((AbstractCharacter) target).combatTarget.isAlive()) {
|
||||||
|
((AbstractCharacter) target).combatTarget = attacker;
|
||||||
|
if (target.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter) && ((AbstractCharacter) target).isCombat())
|
||||||
|
combatCycle((AbstractCharacter) target, attacker,0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// take stamina away from attacker if its not a mob
|
||||||
|
if (weapon != null && !attacker.getObjectType().equals(mbEnums.GameObjectType.Mob)) {
|
||||||
|
//check if Out of Stamina
|
||||||
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||||
|
if (attacker.getStamina() < (weapon.template.item_wt / 3f)) {
|
||||||
|
//set auto attack job
|
||||||
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
float stam = weapon.template.item_wt / 3f;
|
||||||
|
stam = (stam < 1) ? 1 : stam;
|
||||||
|
attacker.modifyStamina(-(stam), attacker, true);
|
||||||
|
} else
|
||||||
|
attacker.modifyStamina(1, attacker, true);
|
||||||
|
|
||||||
|
//cancel things that are cancelled by an attack
|
||||||
|
|
||||||
|
attacker.cancelOnAttackSwing();
|
||||||
|
|
||||||
|
//declare relevant variables
|
||||||
|
|
||||||
|
int min = attacker.minDamageHandOne;
|
||||||
|
int max = attacker.maxDamageHandOne;
|
||||||
|
int atr = attacker.atrHandOne;
|
||||||
|
|
||||||
|
//get the proper stats based on which slot is attacking
|
||||||
|
|
||||||
|
if (slot == mbEnums.EquipSlotType.LHELD) {
|
||||||
|
min = attacker.minDamageHandTwo;
|
||||||
|
max = attacker.maxDamageHandTwo;
|
||||||
|
atr = attacker.atrHandTwo;
|
||||||
|
}
|
||||||
|
|
||||||
|
//apply weapon powers before early exit for miss or passives
|
||||||
|
DeferredPowerJob dpj = null;
|
||||||
|
|
||||||
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||||
|
|
||||||
|
dpj = ((PlayerCharacter) attacker).getWeaponPower();
|
||||||
|
|
||||||
|
if (dpj != null) {
|
||||||
|
dpj.attack(target, attackRange);
|
||||||
|
|
||||||
|
if (dpj.getPower() != null && (dpj.getPowerToken() == -1851459567 || dpj.getPowerToken() == -1851489518))
|
||||||
|
((PlayerCharacter) attacker).setWeaponPower(dpj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!passiveType.equals(mbEnums.PassiveType.None)) {
|
int def = 0;
|
||||||
passiveAnim = getPassiveAnimation(passiveType);
|
|
||||||
TargetedActionMsg msg = new TargetedActionMsg(attacker, passiveAnim, target, passiveType.value);
|
if (AbstractCharacter.IsAbstractCharacter(target))
|
||||||
|
def = ((AbstractCharacter) target).defenseRating;
|
||||||
|
|
||||||
|
//calculate hit chance based off ATR and DEF
|
||||||
|
|
||||||
|
int hitChance;
|
||||||
|
if (def == 0)
|
||||||
|
def = 1;
|
||||||
|
float dif = atr * 1f / def;
|
||||||
|
|
||||||
|
if (dif <= 0.8f)
|
||||||
|
hitChance = 4;
|
||||||
|
else
|
||||||
|
hitChance = ((int) (450 * (dif - 0.8f)) + 4);
|
||||||
|
|
||||||
|
if (target.getObjectType() == mbEnums.GameObjectType.Building)
|
||||||
|
hitChance = 100;
|
||||||
|
int passiveAnim = getPassiveAnimation(mbEnums.PassiveType.None); // checking for a miss due to ATR vs Def
|
||||||
|
if (ThreadLocalRandom.current().nextInt(100) > hitChance) {
|
||||||
|
TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim);
|
||||||
|
|
||||||
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
|
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
|
||||||
DispatchManager.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
DispatchManager.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||||
|
else
|
||||||
|
DispatchManager.sendToAllInRange(attacker, msg);
|
||||||
|
|
||||||
//we need to send the animation even if the attacker misses
|
//we need to send the animation even if the attacker misses
|
||||||
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template, null, slot));
|
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template, null, slot));
|
||||||
DispatchManager.sendToAllInRange(target, cmm);
|
DispatchManager.sendToAllInRange(target, cmm);
|
||||||
|
|
||||||
//set auto attack job
|
//set auto attack job
|
||||||
setAutoAttackJob(attacker, slot, delay);
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//check for proccing
|
//calculate passive chances only if target is AbstractCharacter
|
||||||
checkForProc(attacker,target,weapon);
|
|
||||||
|
|
||||||
//calculate the base damage
|
if (EnumSet.of(mbEnums.GameObjectType.PlayerCharacter, mbEnums.GameObjectType.NPC, mbEnums.GameObjectType.Mob).contains(target.getObjectType())) {
|
||||||
int damage = ThreadLocalRandom.current().nextInt(min, max + 1);
|
mbEnums.PassiveType passiveType = mbEnums.PassiveType.None;
|
||||||
if (damage == 0) {
|
int hitRoll = ThreadLocalRandom.current().nextInt(100);
|
||||||
//set auto attack job
|
|
||||||
setAutoAttackJob(attacker, slot, delay);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob) && ((Mob) attacker).isPet())
|
|
||||||
calculatePetDamage(attacker);
|
|
||||||
|
|
||||||
//get the damage type
|
float dodgeChance = ((AbstractCharacter) target).getPassiveChance("Dodge", attacker.getLevel(), true);
|
||||||
|
float blockChance = ((AbstractCharacter) target).getPassiveChance("Block", attacker.getLevel(), true);
|
||||||
|
float parryChance = ((AbstractCharacter) target).getPassiveChance("Parry", attacker.getLevel(), true);
|
||||||
|
|
||||||
mbEnums.DamageType damageType;
|
// Passive chance clamped at 75
|
||||||
|
|
||||||
if (attacker.charItemManager.getEquipped().get(slot) == null) {
|
dodgeChance = Math.max(0, Math.min(75, dodgeChance));
|
||||||
damageType = mbEnums.DamageType.CRUSHING;
|
blockChance = Math.max(0, Math.min(75, blockChance));
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
parryChance = Math.max(0, Math.min(75, parryChance));
|
||||||
if (((Mob) attacker).isSiege())
|
|
||||||
damageType = mbEnums.DamageType.SIEGE;
|
|
||||||
} else {
|
|
||||||
damageType = (mbEnums.DamageType) attacker.charItemManager.getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
//get resists
|
if (hitRoll < dodgeChance)
|
||||||
|
passiveType = mbEnums.PassiveType.Dodge;
|
||||||
|
else if (hitRoll < blockChance)
|
||||||
|
passiveType = mbEnums.PassiveType.Block;
|
||||||
|
else if (hitRoll < parryChance)
|
||||||
|
passiveType = mbEnums.PassiveType.Parry;
|
||||||
|
|
||||||
Resists resists;
|
|
||||||
|
|
||||||
if (!AbstractCharacter.IsAbstractCharacter(target))
|
if (!passiveType.equals(mbEnums.PassiveType.None)) {
|
||||||
resists = ((Building) target).getResists(); //this is a building
|
passiveAnim = getPassiveAnimation(passiveType);
|
||||||
else
|
TargetedActionMsg msg = new TargetedActionMsg(attacker, passiveAnim, target, passiveType.value);
|
||||||
resists = ((AbstractCharacter) target).getResists(); //this is a character
|
|
||||||
|
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
|
||||||
AbstractCharacter absTarget = (AbstractCharacter) target;
|
DispatchManager.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||||
|
|
||||||
//check damage shields
|
|
||||||
|
|
||||||
PlayerBonuses bonuses = absTarget.getBonuses();
|
|
||||||
|
|
||||||
if (bonuses != null) {
|
|
||||||
|
|
||||||
ConcurrentHashMap<AbstractEffectModifier, DamageShield> damageShields = bonuses.getDamageShields();
|
|
||||||
float total = 0;
|
|
||||||
|
|
||||||
for (DamageShield ds : damageShields.values()) {
|
|
||||||
|
|
||||||
//get amount to damage back
|
|
||||||
|
|
||||||
float amount;
|
|
||||||
|
|
||||||
if (ds.usePercent())
|
|
||||||
amount = damage * ds.getAmount() / 100;
|
|
||||||
else
|
|
||||||
amount = ds.getAmount();
|
|
||||||
|
|
||||||
//get resisted damage for damagetype
|
|
||||||
|
|
||||||
if (resists != null)
|
|
||||||
amount = resists.getResistedDamage(absTarget, attacker, ds.getDamageType(), amount, 0);
|
|
||||||
total += amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (total > 0) {
|
|
||||||
//apply Damage back
|
|
||||||
attacker.modifyHealth(-total, absTarget, true);
|
|
||||||
TargetedActionMsg cmm = new TargetedActionMsg(attacker, attacker, total, 0);
|
|
||||||
DispatchManager.sendToAllInRange(target, cmm);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (resists != null) {
|
|
||||||
|
|
||||||
//check for damage type immunities
|
|
||||||
|
|
||||||
if (resists.immuneTo(damageType)) {
|
|
||||||
//set auto attack job
|
|
||||||
//we need to send the animation even if the attacker misses
|
//we need to send the animation even if the attacker misses
|
||||||
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template, null, slot));
|
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template, null, slot));
|
||||||
DispatchManager.sendToAllInRange(target, cmm);
|
DispatchManager.sendToAllInRange(target, cmm);
|
||||||
|
//set auto attack job
|
||||||
setAutoAttackJob(attacker, slot, delay);
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//calculate resisted damage including fortitude
|
|
||||||
|
|
||||||
damage = (int) resists.getResistedDamage(attacker, (AbstractCharacter) target, damageType, damage, 0);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//remove damage from target health
|
//calculate the base damage
|
||||||
|
int damage = ThreadLocalRandom.current().nextInt(min, max + 1);
|
||||||
|
if (damage == 0) {
|
||||||
|
//set auto attack job
|
||||||
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob) && ((Mob) attacker).isPet())
|
||||||
|
calculatePetDamage(attacker);
|
||||||
|
|
||||||
if (damage > 0) {
|
//get the damage type
|
||||||
|
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target))
|
mbEnums.DamageType damageType;
|
||||||
((AbstractCharacter) target).modifyHealth(-damage, attacker, true);
|
|
||||||
|
if (attacker.charItemManager.getEquipped().get(slot) == null) {
|
||||||
|
damageType = mbEnums.DamageType.CRUSHING;
|
||||||
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
||||||
|
if (((Mob) attacker).isSiege())
|
||||||
|
damageType = mbEnums.DamageType.SIEGE;
|
||||||
|
} else {
|
||||||
|
damageType = (mbEnums.DamageType) attacker.charItemManager.getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
//get resists
|
||||||
|
|
||||||
|
Resists resists;
|
||||||
|
|
||||||
|
if (!AbstractCharacter.IsAbstractCharacter(target))
|
||||||
|
resists = ((Building) target).getResists(); //this is a building
|
||||||
else
|
else
|
||||||
((Building) target).modifyHealth(-damage, attacker);
|
resists = ((AbstractCharacter) target).getResists(); //this is a character
|
||||||
|
|
||||||
int attackAnim = getSwingAnimation(null, null, slot);
|
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
||||||
if (attacker.charItemManager.getEquipped().get(slot) != null) {
|
AbstractCharacter absTarget = (AbstractCharacter) target;
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
|
||||||
DeferredPowerJob weaponPower = ((PlayerCharacter) attacker).getWeaponPower();
|
//check damage shields
|
||||||
attackAnim = getSwingAnimation(weapon.template, weaponPower, slot);
|
|
||||||
} else {
|
PlayerBonuses bonuses = absTarget.getBonuses();
|
||||||
attackAnim = getSwingAnimation(weapon.template, null, slot);
|
|
||||||
|
if (bonuses != null) {
|
||||||
|
|
||||||
|
ConcurrentHashMap<AbstractEffectModifier, DamageShield> damageShields = bonuses.getDamageShields();
|
||||||
|
float total = 0;
|
||||||
|
|
||||||
|
for (DamageShield ds : damageShields.values()) {
|
||||||
|
|
||||||
|
//get amount to damage back
|
||||||
|
|
||||||
|
float amount;
|
||||||
|
|
||||||
|
if (ds.usePercent())
|
||||||
|
amount = damage * ds.getAmount() / 100;
|
||||||
|
else
|
||||||
|
amount = ds.getAmount();
|
||||||
|
|
||||||
|
//get resisted damage for damagetype
|
||||||
|
|
||||||
|
if (resists != null)
|
||||||
|
amount = resists.getResistedDamage(absTarget, attacker, ds.getDamageType(), amount, 0);
|
||||||
|
total += amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (total > 0) {
|
||||||
|
//apply Damage back
|
||||||
|
attacker.modifyHealth(-total, absTarget, true);
|
||||||
|
TargetedActionMsg cmm = new TargetedActionMsg(attacker, attacker, total, 0);
|
||||||
|
DispatchManager.sendToAllInRange(target, cmm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (resists != null) {
|
||||||
|
|
||||||
|
//check for damage type immunities
|
||||||
|
|
||||||
|
if (resists.immuneTo(damageType)) {
|
||||||
|
//set auto attack job
|
||||||
|
//we need to send the animation even if the attacker misses
|
||||||
|
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template, null, slot));
|
||||||
|
DispatchManager.sendToAllInRange(target, cmm);
|
||||||
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//calculate resisted damage including fortitude
|
||||||
|
if(attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
||||||
|
if(((Mob)attacker).isPet())
|
||||||
|
damage *= attacker.level * 0.1f;
|
||||||
|
damage = (int) resists.getResistedDamage(attacker, (AbstractCharacter) target, damageType, damage, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) damage, attackAnim);
|
|
||||||
DispatchManager.sendToAllInRange(target, cmm);
|
//remove damage from target health
|
||||||
|
|
||||||
|
if (damage > 0) {
|
||||||
|
|
||||||
|
if (AbstractCharacter.IsAbstractCharacter(target))
|
||||||
|
((AbstractCharacter) target).modifyHealth(-damage, attacker, true);
|
||||||
|
else
|
||||||
|
((Building) target).modifyHealth(-damage, attacker);
|
||||||
|
|
||||||
|
int attackAnim = getSwingAnimation(null, null, slot);
|
||||||
|
if (attacker.charItemManager.getEquipped().get(slot) != null) {
|
||||||
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||||
|
DeferredPowerJob weaponPower = ((PlayerCharacter) attacker).getWeaponPower();
|
||||||
|
attackAnim = getSwingAnimation(weapon.template, weaponPower, slot);
|
||||||
|
} else {
|
||||||
|
attackAnim = getSwingAnimation(weapon.template, null, slot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) damage, attackAnim);
|
||||||
|
DispatchManager.sendToAllInRange(target, cmm);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//set auto attack job
|
||||||
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
cancelAutoAttackJob(attacker,slot);
|
||||||
|
//Logger.error("COMBAT CAUGHT ERROR: " + ex.getMessage());
|
||||||
|
} finally {
|
||||||
|
target.combatLock.writeLock().unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
//set auto attack job
|
|
||||||
setAutoAttackJob(attacker, slot, delay);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void toggleCombat(boolean toggle, ClientConnection origin) {
|
public static void toggleCombat(boolean toggle, ClientConnection origin) {
|
||||||
@@ -558,7 +559,7 @@ public enum CombatManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Item has no equipment slots and should not try to return an animation, return default instead
|
//Item has no equipment slots and should not try to return an animation, return default instead
|
||||||
if (wb.item_eq_slots_or == null || wb.item_eq_slots_or.isEmpty()) {
|
if(wb.item_eq_slots_or == null || wb.item_eq_slots_or.isEmpty()){
|
||||||
return 75;
|
return 75;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -567,15 +568,15 @@ public enum CombatManager {
|
|||||||
int random;
|
int random;
|
||||||
|
|
||||||
//Item can only be equipped in one slot, return animation for that slot
|
//Item can only be equipped in one slot, return animation for that slot
|
||||||
if (wb.item_eq_slots_or.size() == 1) {
|
if(wb.item_eq_slots_or.size() == 1){
|
||||||
if (wb.item_eq_slots_or.iterator().next().equals(mbEnums.EquipSlotType.RHELD)) {
|
if (wb.item_eq_slots_or.iterator().next().equals(mbEnums.EquipSlotType.RHELD)) {
|
||||||
anim = wb.weapon_attack_anim_right.get(0)[0];
|
anim = wb.weapon_attack_anim_right.get(0)[0];
|
||||||
if (dpj != null) {
|
if (dpj != null) {
|
||||||
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_right.size());
|
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_right.size());
|
||||||
anim = wb.weapon_attack_anim_right.get(random)[0];
|
anim = wb.weapon_attack_anim_right.get(random)[0];
|
||||||
}
|
}
|
||||||
} else {
|
}else {
|
||||||
anim = wb.weapon_attack_anim_left.get(0)[0];
|
anim = wb.weapon_attack_anim_left.get(0)[0];
|
||||||
if (dpj != null) {
|
if (dpj != null) {
|
||||||
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_left.size());
|
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_left.size());
|
||||||
anim = wb.weapon_attack_anim_left.get(random)[0];
|
anim = wb.weapon_attack_anim_left.get(random)[0];
|
||||||
@@ -591,7 +592,7 @@ public enum CombatManager {
|
|||||||
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_right.size());
|
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_right.size());
|
||||||
anim = wb.weapon_attack_anim_right.get(random)[0];
|
anim = wb.weapon_attack_anim_right.get(random)[0];
|
||||||
}
|
}
|
||||||
} else {
|
}else {
|
||||||
anim = wb.weapon_attack_anim_left.get(0)[0];
|
anim = wb.weapon_attack_anim_left.get(0)[0];
|
||||||
if (dpj != null) {
|
if (dpj != null) {
|
||||||
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_left.size());
|
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_left.size());
|
||||||
@@ -601,8 +602,8 @@ public enum CombatManager {
|
|||||||
return anim;
|
return anim;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getPassiveAnimation(mbEnums.PassiveType passiveType) {
|
public static int getPassiveAnimation(mbEnums.PassiveType passiveType){
|
||||||
switch (passiveType) {
|
switch(passiveType){
|
||||||
case Block:
|
case Block:
|
||||||
return COMBAT_BLOCK_ANIMATION;
|
return COMBAT_BLOCK_ANIMATION;
|
||||||
case Parry:
|
case Parry:
|
||||||
@@ -617,7 +618,10 @@ public enum CombatManager {
|
|||||||
public static void setAutoAttackJob(AbstractCharacter attacker, mbEnums.EquipSlotType slot, long delay) {
|
public static void setAutoAttackJob(AbstractCharacter attacker, mbEnums.EquipSlotType slot, long delay) {
|
||||||
//calculate next allowed attack and update the timestamp
|
//calculate next allowed attack and update the timestamp
|
||||||
|
|
||||||
if (attacker.getTimestamps().containsKey("Attack" + slot.name()) && attacker.getTimestamps().get("Attack" + slot.name()) > System.currentTimeMillis())
|
if(attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter) == false)
|
||||||
|
return; //mobs dont submit auto attack jobs
|
||||||
|
|
||||||
|
if(attacker.getTimestamps().containsKey("Attack" + slot.name()) && attacker.getTimestamps().get("Attack" + slot.name()) > System.currentTimeMillis())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
attacker.getTimestamps().put("Attack" + slot.name(), System.currentTimeMillis() + delay);
|
attacker.getTimestamps().put("Attack" + slot.name(), System.currentTimeMillis() + delay);
|
||||||
@@ -626,7 +630,7 @@ public enum CombatManager {
|
|||||||
ConcurrentHashMap<String, JobContainer> timers = attacker.getTimers();
|
ConcurrentHashMap<String, JobContainer> timers = attacker.getTimers();
|
||||||
|
|
||||||
if (timers != null) {
|
if (timers != null) {
|
||||||
AttackJob aj = new AttackJob(attacker, slot.ordinal(), true);
|
AttackJob aj = new AttackJob(attacker, slot.ordinal(), true, attacker.getCombatTarget());
|
||||||
JobContainer job;
|
JobContainer job;
|
||||||
job = JobScheduler.getInstance().scheduleJob(aj, (System.currentTimeMillis() + delay)); // offset 1 millisecond so no overlap issue
|
job = JobScheduler.getInstance().scheduleJob(aj, (System.currentTimeMillis() + delay)); // offset 1 millisecond so no overlap issue
|
||||||
timers.put("Attack" + slot.name(), job);
|
timers.put("Attack" + slot.name(), job);
|
||||||
@@ -634,8 +638,22 @@ public enum CombatManager {
|
|||||||
Logger.error("Unable to find Timers for Character " + attacker.getObjectUUID());
|
Logger.error("Unable to find Timers for Character " + attacker.getObjectUUID());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public static void cancelAutoAttackJob(AbstractCharacter attacker, mbEnums.EquipSlotType slot) {
|
||||||
|
|
||||||
public static int calculatePetDamage(AbstractCharacter agent) {
|
if(attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter) == false)
|
||||||
|
return;
|
||||||
|
attacker.getTimestamps().put("Attack" + slot.name(), System.currentTimeMillis());
|
||||||
|
|
||||||
|
//handle auto attack job creation
|
||||||
|
ConcurrentHashMap<String, JobContainer> timers = attacker.getTimers();
|
||||||
|
|
||||||
|
if (timers != null) {
|
||||||
|
timers.get("Attack" + slot.name()).cancelJob();
|
||||||
|
} else
|
||||||
|
Logger.error("Unable to find Timers for Character " + attacker.getObjectUUID());
|
||||||
|
|
||||||
|
}
|
||||||
|
public static void calculatePetDamage(AbstractCharacter agent) {
|
||||||
//damage calc for pet
|
//damage calc for pet
|
||||||
float range;
|
float range;
|
||||||
float damage;
|
float damage;
|
||||||
@@ -647,9 +665,7 @@ public enum CombatManager {
|
|||||||
dmgMultiplier += agent.getLevel() * 0.1f;
|
dmgMultiplier += agent.getLevel() * 0.1f;
|
||||||
range = (float) (maxDmg - minDmg);
|
range = (float) (maxDmg - minDmg);
|
||||||
damage = min + ((ThreadLocalRandom.current().nextFloat() * range) + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
damage = min + ((ThreadLocalRandom.current().nextFloat() * range) + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
||||||
return (int) (damage * dmgMultiplier);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getMinDmg(double min, AbstractCharacter agent) {
|
public static double getMinDmg(double min, AbstractCharacter agent) {
|
||||||
int primary = agent.getStatStrCurrent();
|
int primary = agent.getStatStrCurrent();
|
||||||
int secondary = agent.getStatDexCurrent();
|
int secondary = agent.getStatDexCurrent();
|
||||||
@@ -657,7 +673,6 @@ public enum CombatManager {
|
|||||||
int masteryLevel = 0;
|
int masteryLevel = 0;
|
||||||
return min * (pow(0.0048 * primary + .049 * (primary - 0.75), 0.5) + pow(0.0066 * secondary + 0.064 * (secondary - 0.75), 0.5) + +0.01 * (focusLevel + masteryLevel));
|
return min * (pow(0.0048 * primary + .049 * (primary - 0.75), 0.5) + pow(0.0066 * secondary + 0.064 * (secondary - 0.75), 0.5) + +0.01 * (focusLevel + masteryLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getMaxDmg(double max, AbstractCharacter agent) {
|
public static double getMaxDmg(double max, AbstractCharacter agent) {
|
||||||
int primary = agent.getStatStrCurrent();
|
int primary = agent.getStatStrCurrent();
|
||||||
int secondary = agent.getStatDexCurrent();
|
int secondary = agent.getStatDexCurrent();
|
||||||
@@ -665,20 +680,4 @@ public enum CombatManager {
|
|||||||
int masteryLevel = 0;
|
int masteryLevel = 0;
|
||||||
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void checkForProc(AbstractCharacter attacker, AbstractWorldObject target, Item weapon){
|
|
||||||
|
|
||||||
if(weapon == null) // cant proc without a weapon
|
|
||||||
return;
|
|
||||||
|
|
||||||
for(Effect eff : weapon.effects.values()){
|
|
||||||
for(AbstractEffectModifier mod : eff.getEffectsBase().getModifiers()){
|
|
||||||
if(mod.modType.equals(mbEnums.ModType.WeaponProc))
|
|
||||||
if(ThreadLocalRandom.current().nextInt(0,101) < 6)
|
|
||||||
((WeaponProcEffectModifier)mod).applyProc(attacker,target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -11,9 +11,6 @@ package engine.gameManager;
|
|||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.server.login.LoginServer;
|
import engine.server.login.LoginServer;
|
||||||
import engine.server.world.WorldServer;
|
import engine.server.world.WorldServer;
|
||||||
import engine.wpak.EffectsParser;
|
|
||||||
import engine.wpak.PowerActionParser;
|
|
||||||
import engine.wpak.PowersParser;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
@@ -167,13 +164,6 @@ public enum ConfigManager {
|
|||||||
Logger.info("Compiling regex");
|
Logger.info("Compiling regex");
|
||||||
|
|
||||||
regex.put(MB_LOGIN_FNAME_REGEX, Pattern.compile(MB_LOGIN_FNAME_REGEX.getValue()));
|
regex.put(MB_LOGIN_FNAME_REGEX, Pattern.compile(MB_LOGIN_FNAME_REGEX.getValue()));
|
||||||
|
|
||||||
Logger.info("Loading WPAK data");
|
|
||||||
|
|
||||||
//EffectsParser.parseWpakFile();
|
|
||||||
//PowersParser.parseWpakFile();
|
|
||||||
//PowerActionParser.parseWpakFile();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ public enum DbManager {
|
|||||||
public static final dbBlueprintHandler BlueprintQueries = new dbBlueprintHandler();
|
public static final dbBlueprintHandler BlueprintQueries = new dbBlueprintHandler();
|
||||||
public static final dbShrineHandler ShrineQueries = new dbShrineHandler();
|
public static final dbShrineHandler ShrineQueries = new dbShrineHandler();
|
||||||
public static final dbRunegateHandler RunegateQueries = new dbRunegateHandler();
|
public static final dbRunegateHandler RunegateQueries = new dbRunegateHandler();
|
||||||
|
|
||||||
|
public static final dbPowerHandler PowerQueries = new dbPowerHandler();
|
||||||
public static final dbPetitionHandler PetitionQueries = new dbPetitionHandler();
|
public static final dbPetitionHandler PetitionQueries = new dbPetitionHandler();
|
||||||
private static final EnumMap<GameObjectType, ConcurrentHashMap<Integer, AbstractGameObject>> objectCache = new EnumMap<>(GameObjectType.class);
|
private static final EnumMap<GameObjectType, ConcurrentHashMap<Integer, AbstractGameObject>> objectCache = new EnumMap<>(GameObjectType.class);
|
||||||
public static Hasher hasher;
|
public static Hasher hasher;
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ public enum DevCmdManager {
|
|||||||
DevCmdManager.registerDevCmd(new SetNpcNameCmd());
|
DevCmdManager.registerDevCmd(new SetNpcNameCmd());
|
||||||
DevCmdManager.registerDevCmd(new BoundsCmd());
|
DevCmdManager.registerDevCmd(new BoundsCmd());
|
||||||
DevCmdManager.registerDevCmd(new RegionCmd());
|
DevCmdManager.registerDevCmd(new RegionCmd());
|
||||||
|
DevCmdManager.registerDevCmd(new ApplyBonusCmd());
|
||||||
DevCmdManager.registerDevCmd(new SlotTestCmd());
|
DevCmdManager.registerDevCmd(new SlotTestCmd());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public enum ForgeManager implements Runnable {
|
|||||||
// Early exit for completed workOrders loaded from disk
|
// Early exit for completed workOrders loaded from disk
|
||||||
// or vendors who were re-deeded with items still cooking.
|
// or vendors who were re-deeded with items still cooking.
|
||||||
|
|
||||||
if (workOrder.vendor == null || workOrder.runCompleted.get())
|
if (workOrder.vendor == null && workOrder.runCompleted.get())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// This workOrder has completed production.
|
// This workOrder has completed production.
|
||||||
@@ -265,12 +265,12 @@ public enum ForgeManager implements Runnable {
|
|||||||
|
|
||||||
// Assign a prefix and suffix to this item if random rolled
|
// Assign a prefix and suffix to this item if random rolled
|
||||||
|
|
||||||
if (workOrder.prefixToken == 0 && workOrder.vendor.getItemModTable().contains((template.modTable)))
|
if (workOrder.prefixToken == 0)
|
||||||
forgedItem.prefixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.PREFIX, template.modTable);
|
forgedItem.prefixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.PREFIX, template.modTable);
|
||||||
else
|
else
|
||||||
forgedItem.prefixToken = workOrder.prefixToken;
|
forgedItem.prefixToken = workOrder.prefixToken;
|
||||||
|
|
||||||
if (workOrder.suffixToken == 0 && workOrder.vendor.getItemModTable().contains((template.modTable)))
|
if (workOrder.suffixToken == 0)
|
||||||
forgedItem.suffixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.SUFFIX, template.modTable);
|
forgedItem.suffixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.SUFFIX, template.modTable);
|
||||||
else
|
else
|
||||||
forgedItem.suffixToken = workOrder.suffixToken;
|
forgedItem.suffixToken = workOrder.suffixToken;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public enum ItemManager {
|
|||||||
if (characterSkill == null)
|
if (characterSkill == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (characterSkill.getModifiedAmountBeforeMods() >= required_value)
|
if (characterSkill.getModifiedAmountBeforeMods() > required_value)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ package engine.gameManager;
|
|||||||
|
|
||||||
import engine.InterestManagement.Terrain;
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
|
import engine.db.handlers.dbEffectsBaseHandler;
|
||||||
|
import engine.db.handlers.dbPowerHandler;
|
||||||
import engine.db.handlers.dbSkillReqHandler;
|
import engine.db.handlers.dbSkillReqHandler;
|
||||||
import engine.job.AbstractJob;
|
import engine.job.AbstractJob;
|
||||||
import engine.job.AbstractScheduleJob;
|
import engine.job.AbstractScheduleJob;
|
||||||
@@ -27,14 +29,8 @@ import engine.net.client.ClientConnection;
|
|||||||
import engine.net.client.msg.*;
|
import engine.net.client.msg.*;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.*;
|
import engine.powers.*;
|
||||||
import engine.powers.poweractions.*;
|
import engine.powers.poweractions.AbstractPowerAction;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import engine.wpak.EffectsParser;
|
|
||||||
import engine.wpak.PowerActionParser;
|
|
||||||
import engine.wpak.PowersParser;
|
|
||||||
import engine.wpak.data.Effect;
|
|
||||||
import engine.wpak.data.PowerAction;
|
|
||||||
import engine.wpakpowers.WpakPowerManager;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -57,6 +53,7 @@ public enum PowersManager {
|
|||||||
public static HashMap<String, AbstractPowerAction> powerActionsByIDString = new HashMap<>();
|
public static HashMap<String, AbstractPowerAction> powerActionsByIDString = new HashMap<>();
|
||||||
public static HashMap<Integer, AbstractPowerAction> powerActionsByID = new HashMap<>();
|
public static HashMap<Integer, AbstractPowerAction> powerActionsByID = new HashMap<>();
|
||||||
public static HashMap<String, Integer> ActionTokenByIDString = new HashMap<>();
|
public static HashMap<String, Integer> ActionTokenByIDString = new HashMap<>();
|
||||||
|
public static HashMap<String, Integer> AnimationOverrides = new HashMap<>();
|
||||||
public static HashMap<Integer, ArrayList<RunePowerEntry>> _allRunePowers;
|
public static HashMap<Integer, ArrayList<RunePowerEntry>> _allRunePowers;
|
||||||
public static HashMap<Integer, ArrayList<RuneSkillAdjustEntry>> _allRuneSkillAdjusts;
|
public static HashMap<Integer, ArrayList<RuneSkillAdjustEntry>> _allRuneSkillAdjusts;
|
||||||
public static HashMap<String, HashMap<ResourceType, Integer>> _effect_costMaps = new HashMap<>();
|
public static HashMap<String, HashMap<ResourceType, Integer>> _effect_costMaps = new HashMap<>();
|
||||||
@@ -64,12 +61,10 @@ public enum PowersManager {
|
|||||||
|
|
||||||
public static void initPowersManager(boolean fullPowersLoad) {
|
public static void initPowersManager(boolean fullPowersLoad) {
|
||||||
|
|
||||||
if (fullPowersLoad) {
|
if (fullPowersLoad)
|
||||||
//PowersManager.InitializePowers();
|
PowersManager.InitializePowers();
|
||||||
WpakPowerManager.init();
|
else
|
||||||
}else {
|
|
||||||
PowersManager.InitializeLoginPowers();
|
PowersManager.InitializeLoginPowers();
|
||||||
}
|
|
||||||
|
|
||||||
PowersManager.js = JobScheduler.getInstance();
|
PowersManager.js = JobScheduler.getInstance();
|
||||||
|
|
||||||
@@ -117,138 +112,33 @@ public enum PowersManager {
|
|||||||
return powerEntries;
|
return powerEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InitializeEffects(){
|
|
||||||
// Add EffectsBase
|
|
||||||
ArrayList<EffectsBase> effectList = new ArrayList<>();
|
|
||||||
|
|
||||||
for (Effect entry : WpakPowerManager._effectsLookup.values()) {
|
|
||||||
EffectsBase effectBase = new EffectsBase(entry);
|
|
||||||
effectList.add(effectBase);
|
|
||||||
PowersManager.effectsBaseByToken.put(effectBase.getToken(), effectBase);
|
|
||||||
PowersManager.effectsBaseByIDString.put(effectBase.getIDString(), effectBase);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void InitializePowerActions(){
|
|
||||||
// Add PowerActions
|
|
||||||
//AbstractPowerAction.getAllPowerActions(PowersManager.powerActionsByIDString, PowersManager.powerActionsByID, PowersManager.effectsBaseByIDString);
|
|
||||||
|
|
||||||
HashMap<String, EffectsBase> effects = PowersManager.effectsBaseByIDString;
|
|
||||||
|
|
||||||
for (PowerAction powerAction : WpakPowerManager._powerActionLookup.values()) {
|
|
||||||
AbstractPowerAction apa;
|
|
||||||
PowerActionType type = powerAction.action_type;
|
|
||||||
String IDString = powerAction.action_id;
|
|
||||||
int token = DbManager.hasher.SBStringHash(IDString);
|
|
||||||
//cache token, used for applying effects.
|
|
||||||
PowersManager.ActionTokenByIDString.put(IDString, token);
|
|
||||||
apa = null;
|
|
||||||
switch (type) {
|
|
||||||
default:
|
|
||||||
Logger.error("valid type not found for poweraction of ID" + IDString);
|
|
||||||
break;
|
|
||||||
case ApplyEffect:
|
|
||||||
apa = new ApplyEffectPowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case ApplyEffects:
|
|
||||||
apa = new ApplyEffectsPowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case DeferredPower:
|
|
||||||
apa = new DeferredPowerPowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case DamageOverTime:
|
|
||||||
apa = new DamageOverTimePowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case Peek:
|
|
||||||
apa = new PeekPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case Charm:
|
|
||||||
apa = new CharmPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case RemoveEffect:
|
|
||||||
apa = new RemoveEffectPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case Track:
|
|
||||||
apa = new TrackPowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case DirectDamage:
|
|
||||||
apa = new DirectDamagePowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case Transform:
|
|
||||||
apa = new TransformPowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case CreateMob:
|
|
||||||
apa = new CreateMobPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case Invis:
|
|
||||||
apa = new InvisPowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case ClearNearbyAggro:
|
|
||||||
apa = new ClearNearbyAggroPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case MobRecall:
|
|
||||||
apa = new MobRecallPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case SetItemFlag:
|
|
||||||
apa = new SetItemFlagPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case SimpleDamage:
|
|
||||||
apa = new SimpleDamagePowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case TransferStatOT:
|
|
||||||
apa = new TransferStatOTPowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case TransferStat:
|
|
||||||
apa = new TransferStatPowerAction(powerAction, effects);
|
|
||||||
break;
|
|
||||||
case Teleport:
|
|
||||||
apa = new TeleportPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case TreeChoke:
|
|
||||||
apa = new TreeChokePowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case Block:
|
|
||||||
apa = new BlockPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case Resurrect:
|
|
||||||
apa = new ResurrectPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case ClaimMine:
|
|
||||||
apa = new ClaimMinePowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case Recall:
|
|
||||||
apa = new RecallPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case SpireDisable:
|
|
||||||
apa = new SpireDisablePowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case Steal:
|
|
||||||
apa = new StealPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case Summon:
|
|
||||||
apa = new SummonPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
case RunegateTeleport:
|
|
||||||
apa = new RunegateTeleportPowerAction(powerAction);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
PowersManager.powerActionsByIDString.put(IDString, apa);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This pre-loads all powers and effects
|
// This pre-loads all powers and effects
|
||||||
public static void InitializePowers() {
|
public static void InitializePowers() {
|
||||||
|
|
||||||
EffectsParser.parseWpakFile();
|
// Add EffectsBase
|
||||||
PowersParser.parseWpakFile();
|
ArrayList<EffectsBase> ebList = dbEffectsBaseHandler.getAllEffectsBase();
|
||||||
PowerActionParser.parseWpakFile();
|
|
||||||
|
|
||||||
//Initialize Effects Data
|
for (EffectsBase eb : ebList) {
|
||||||
InitializeEffects();
|
PowersManager.effectsBaseByToken.put(eb.getToken(), eb);
|
||||||
|
PowersManager.effectsBaseByIDString.put(eb.getIDString(), eb);
|
||||||
|
|
||||||
//Initialize Power Actions
|
}
|
||||||
InitializePowerActions();
|
|
||||||
|
// Add Fail Conditions
|
||||||
|
EffectsBase.getFailConditions(PowersManager.effectsBaseByIDString);
|
||||||
|
|
||||||
|
// Add Modifiers to Effects
|
||||||
|
dbEffectsBaseHandler.cacheAllEffectModifiers();
|
||||||
|
|
||||||
|
// Add Source Types to Effects
|
||||||
|
dbPowerHandler.addAllSourceTypes();
|
||||||
|
dbPowerHandler.addAllAnimationOverrides();
|
||||||
|
|
||||||
|
// Add PowerActions
|
||||||
|
AbstractPowerAction.getAllPowerActions(PowersManager.powerActionsByIDString, PowersManager.powerActionsByID, PowersManager.effectsBaseByIDString);
|
||||||
|
|
||||||
|
// Load valid Item Flags
|
||||||
|
// AbstractPowerAction.loadValidItemFlags(PowersManager.powerActionsByIDString);
|
||||||
|
|
||||||
// get all PowersBase
|
// get all PowersBase
|
||||||
ArrayList<PowersBase> pbList = dbSkillReqHandler.getAllPowersBase();
|
ArrayList<PowersBase> pbList = dbSkillReqHandler.getAllPowersBase();
|
||||||
@@ -269,36 +159,29 @@ public enum PowersManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static EffectsBase setEffectToken(int ID, int token) {
|
||||||
|
for (EffectsBase eb : PowersManager.effectsBaseByIDString.values()) {
|
||||||
|
if (eb.getUUID() == ID) {
|
||||||
|
eb.setToken(token);
|
||||||
|
return eb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public static void usePower(final PerformActionMsg msg, ClientConnection origin,
|
public static void usePower(final PerformActionMsg msg, ClientConnection origin,
|
||||||
boolean sendCastToSelf) {
|
boolean sendCastToSelf) {
|
||||||
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE") && getPowerByToken(msg.getPowerUsedID()).ignoreLore() == false) {
|
||||||
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
|
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
|
||||||
PlayerCharacter caster = origin.getPlayerCharacter();
|
PlayerCharacter caster = origin.getPlayerCharacter();
|
||||||
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID());
|
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID());
|
||||||
if (pb != null && pb.enforceLore()) {
|
if (pb != null && pb.isHarmful == false) {
|
||||||
//if (caster.guild.equals(Guild.getErrantGuild()))
|
//if (caster.guild.equals(Guild.getErrantGuild()))
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false) {
|
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false)
|
||||||
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID());
|
|
||||||
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg);
|
|
||||||
DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
|
|
||||||
|
|
||||||
// Send Fail to cast message
|
|
||||||
PlayerCharacter pc = SessionManager
|
|
||||||
.getPlayerCharacter(origin);
|
|
||||||
|
|
||||||
if (pc != null) {
|
|
||||||
sendPowerMsg(pc, 2, msg);
|
|
||||||
if (pc.isCasting()) {
|
|
||||||
pc.update();
|
|
||||||
}
|
|
||||||
|
|
||||||
pc.setIsCasting(false);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1025,6 +908,10 @@ public enum PowersManager {
|
|||||||
if (pb.isHarmful())
|
if (pb.isHarmful())
|
||||||
mobTarget.handleDirectAggro(playerCharacter);
|
mobTarget.handleDirectAggro(playerCharacter);
|
||||||
}
|
}
|
||||||
|
//Power is aiding a target, handle aggro if combat target is a Mob.
|
||||||
|
if (!pb.isHarmful() && target.getObjectType() == GameObjectType.PlayerCharacter) {
|
||||||
|
PlayerCharacter pcTarget = (PlayerCharacter) target;
|
||||||
|
}
|
||||||
|
|
||||||
// update target of used power timer
|
// update target of used power timer
|
||||||
|
|
||||||
@@ -1046,7 +933,8 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target,pb.vampDrain)) {
|
if (ab.blocked(target, pb, trains)) {
|
||||||
|
|
||||||
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1057,7 +945,7 @@ public enum PowersManager {
|
|||||||
// if (!stackType.equals("IgnoreStack")) {
|
// if (!stackType.equals("IgnoreStack")) {
|
||||||
if (target.getEffects().containsKey(stackType)) {
|
if (target.getEffects().containsKey(stackType)) {
|
||||||
// remove any existing power that overrides
|
// remove any existing power that overrides
|
||||||
engine.objects.Effect ef = target.getEffects().get(stackType);
|
Effect ef = target.getEffects().get(stackType);
|
||||||
AbstractEffectJob effect = null;
|
AbstractEffectJob effect = null;
|
||||||
if (ef != null) {
|
if (ef != null) {
|
||||||
JobContainer jc = ef.getJobContainer();
|
JobContainer jc = ef.getJobContainer();
|
||||||
@@ -1221,7 +1109,7 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target,pb.vampDrain))
|
if (ab.blocked(target, pb, trains))
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
String stackType = ab.getStackType();
|
String stackType = ab.getStackType();
|
||||||
@@ -1229,7 +1117,7 @@ public enum PowersManager {
|
|||||||
// if (!stackType.equals("IgnoreStack")) {
|
// if (!stackType.equals("IgnoreStack")) {
|
||||||
if (target.getEffects().containsKey(stackType)) {
|
if (target.getEffects().containsKey(stackType)) {
|
||||||
// remove any existing power that overrides
|
// remove any existing power that overrides
|
||||||
engine.objects.Effect ef = target.getEffects().get(stackType);
|
Effect ef = target.getEffects().get(stackType);
|
||||||
AbstractEffectJob effect = null;
|
AbstractEffectJob effect = null;
|
||||||
if (ef != null) {
|
if (ef != null) {
|
||||||
JobContainer jc = ef.getJobContainer();
|
JobContainer jc = ef.getJobContainer();
|
||||||
@@ -1535,7 +1423,7 @@ public enum PowersManager {
|
|||||||
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
if (ab.blocked(target,pb.vampDrain))
|
if (ab.blocked(target, pb, trains))
|
||||||
// sendPowerMsg(pc, 5, msg);
|
// sendPowerMsg(pc, 5, msg);
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
@@ -1543,7 +1431,7 @@ public enum PowersManager {
|
|||||||
stackType = (stackType.equals("IgnoreStack")) ? Integer.toString(ab.getUUID()) : stackType;
|
stackType = (stackType.equals("IgnoreStack")) ? Integer.toString(ab.getUUID()) : stackType;
|
||||||
if (target.getEffects().containsKey(stackType)) {
|
if (target.getEffects().containsKey(stackType)) {
|
||||||
// remove any existing power that overrides
|
// remove any existing power that overrides
|
||||||
engine.objects.Effect ef = target.getEffects().get(stackType);
|
Effect ef = target.getEffects().get(stackType);
|
||||||
AbstractEffectJob effect = null;
|
AbstractEffectJob effect = null;
|
||||||
if (ef != null) {
|
if (ef != null) {
|
||||||
JobContainer jc = ef.getJobContainer();
|
JobContainer jc = ef.getJobContainer();
|
||||||
@@ -1990,7 +1878,7 @@ public enum PowersManager {
|
|||||||
stackType = (stackType.equals("IgnoreStack")) ? Integer
|
stackType = (stackType.equals("IgnoreStack")) ? Integer
|
||||||
.toString(toRemove.getUUID()) : stackType;
|
.toString(toRemove.getUUID()) : stackType;
|
||||||
if (fromChant) {
|
if (fromChant) {
|
||||||
engine.objects.Effect eff = awo.getEffects().get(stackType);
|
Effect eff = awo.getEffects().get(stackType);
|
||||||
if (eff != null)
|
if (eff != null)
|
||||||
eff.cancelJob(true);
|
eff.cancelJob(true);
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ package engine.jobs;
|
|||||||
import engine.gameManager.CombatManager;
|
import engine.gameManager.CombatManager;
|
||||||
import engine.job.AbstractJob;
|
import engine.job.AbstractJob;
|
||||||
import engine.objects.AbstractCharacter;
|
import engine.objects.AbstractCharacter;
|
||||||
|
import engine.objects.AbstractWorldObject;
|
||||||
|
|
||||||
public class AttackJob extends AbstractJob {
|
public class AttackJob extends AbstractJob {
|
||||||
|
|
||||||
@@ -19,16 +20,20 @@ public class AttackJob extends AbstractJob {
|
|||||||
private final int slot;
|
private final int slot;
|
||||||
private final boolean success;
|
private final boolean success;
|
||||||
|
|
||||||
public AttackJob(AbstractCharacter source, int slot, boolean success) {
|
public final AbstractWorldObject target;
|
||||||
|
|
||||||
|
public AttackJob(AbstractCharacter source, int slot, boolean success, AbstractWorldObject target) {
|
||||||
super();
|
super();
|
||||||
this.source = source;
|
this.source = source;
|
||||||
this.slot = slot;
|
this.slot = slot;
|
||||||
this.success = success;
|
this.success = success;
|
||||||
|
this.target = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void doJob() {
|
protected void doJob() {
|
||||||
CombatManager.combatCycle(this.source, this.source.combatTarget);
|
|
||||||
|
CombatManager.combatCycle(this.source,target,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean success() {
|
public boolean success() {
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.job.AbstractScheduleJob;
|
|||||||
import engine.net.client.msg.PerformActionMsg;
|
import engine.net.client.msg.PerformActionMsg;
|
||||||
import engine.objects.PlayerCharacter;
|
import engine.objects.PlayerCharacter;
|
||||||
import engine.powers.PowersBase;
|
import engine.powers.PowersBase;
|
||||||
import engine.wpak.data.Power;
|
|
||||||
|
|
||||||
public class UsePowerJob extends AbstractScheduleJob {
|
public class UsePowerJob extends AbstractScheduleJob {
|
||||||
|
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2022
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
|
|
||||||
package engine.jobs;
|
|
||||||
|
|
||||||
import engine.gameManager.PowersManager;
|
|
||||||
import engine.job.AbstractScheduleJob;
|
|
||||||
import engine.net.client.msg.PerformActionMsg;
|
|
||||||
import engine.objects.AbstractWorldObject;
|
|
||||||
import engine.objects.PlayerCharacter;
|
|
||||||
import engine.wpakpowers.WpakPowerManager;
|
|
||||||
|
|
||||||
public class WpakUsePowerJob extends AbstractScheduleJob {
|
|
||||||
|
|
||||||
private final PlayerCharacter pc;
|
|
||||||
private final PerformActionMsg msg;
|
|
||||||
private AbstractWorldObject target;
|
|
||||||
|
|
||||||
public WpakUsePowerJob(PlayerCharacter pc, PerformActionMsg msg, AbstractWorldObject tar) {
|
|
||||||
super();
|
|
||||||
this.pc = pc;
|
|
||||||
this.msg = msg;
|
|
||||||
this.target = tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void doJob() {
|
|
||||||
WpakPowerManager.finishUsePower(this.msg, this.pc,this.target);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void _cancelJob() {
|
|
||||||
//cast stopped early, reset recycle timer
|
|
||||||
PowersManager.finishRecycleTime(this.msg, this.pc, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -84,11 +84,6 @@ public class WorkOrder implements Delayed {
|
|||||||
this.completionTime = jsonWorkOrder.getLong("completionTime");
|
this.completionTime = jsonWorkOrder.getLong("completionTime");
|
||||||
this.runCompleted.set(jsonWorkOrder.getBoolean("runCompleted"));
|
this.runCompleted.set(jsonWorkOrder.getBoolean("runCompleted"));
|
||||||
|
|
||||||
// Vendor sanity check. Might have been deleted
|
|
||||||
|
|
||||||
if (this.vendor == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
JSONObject productionCostMap = jsonWorkOrder.getJSONObject("production_cost");
|
JSONObject productionCostMap = jsonWorkOrder.getJSONObject("production_cost");
|
||||||
|
|
||||||
for (String key : productionCostMap.keySet()) {
|
for (String key : productionCostMap.keySet()) {
|
||||||
@@ -112,7 +107,6 @@ public class WorkOrder implements Delayed {
|
|||||||
for (Object o : tokenList) {
|
for (Object o : tokenList) {
|
||||||
int prefix = ((JSONArray) o).getInt(0);
|
int prefix = ((JSONArray) o).getInt(0);
|
||||||
int suffix = ((JSONArray) o).getInt(1);
|
int suffix = ((JSONArray) o).getInt(1);
|
||||||
|
|
||||||
Item cookingItem = ForgeManager.forgeItem(this);
|
Item cookingItem = ForgeManager.forgeItem(this);
|
||||||
cookingItem.prefixToken = prefix;
|
cookingItem.prefixToken = prefix;
|
||||||
cookingItem.suffixToken = suffix;
|
cookingItem.suffixToken = suffix;
|
||||||
@@ -135,8 +129,7 @@ public class WorkOrder implements Delayed {
|
|||||||
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.item_wt))
|
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.item_wt))
|
||||||
return 30; //30: That person cannot carry that item
|
return 30; //30: That person cannot carry that item
|
||||||
|
|
||||||
if ((workOrder.prefixToken != 0 || workOrder.suffixToken != 0) &&
|
if (!workOrder.vendor.getItemModTable().contains((template.modTable)))
|
||||||
!workOrder.vendor.getItemModTable().contains((template.modTable)))
|
|
||||||
return 59; //59: This hireling does not have this formula
|
return 59; //59: This hireling does not have this formula
|
||||||
|
|
||||||
if (!Warehouse.calcCostOverrun(workOrder).isEmpty())
|
if (!Warehouse.calcCostOverrun(workOrder).isEmpty())
|
||||||
|
|||||||
+477
-626
File diff suppressed because it is too large
Load Diff
@@ -100,7 +100,7 @@ public class MobAI {
|
|||||||
public static void attackPlayer(Mob mob, PlayerCharacter target) {
|
public static void attackPlayer(Mob mob, PlayerCharacter target) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (target == null || !target.isAlive() || !target.isActive()) {
|
if(target == null || !target.isAlive() || !target.isActive() ) {
|
||||||
mob.setCombatTarget(null);
|
mob.setCombatTarget(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -109,7 +109,7 @@ public class MobAI {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mob.behaviourType.callsForHelp)
|
if (mob.behaviourType != null && mob.behaviourType.callsForHelp)
|
||||||
mobCallForHelp(mob);
|
mobCallForHelp(mob);
|
||||||
|
|
||||||
if (!MovementUtilities.inRangeDropAggro(mob, target)) {
|
if (!MovementUtilities.inRangeDropAggro(mob, target)) {
|
||||||
@@ -125,7 +125,7 @@ public class MobAI {
|
|||||||
if (mob.isMoving() && mob.getRange() > 20)
|
if (mob.isMoving() && mob.getRange() > 20)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CombatManager.combatCycle(mob, target);
|
CombatManager.combatCycle(mob, target,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.getPet() != null)
|
if (target.getPet() != null)
|
||||||
@@ -159,7 +159,7 @@ public class MobAI {
|
|||||||
MovementManager.sendRWSSMsg(mob);
|
MovementManager.sendRWSSMsg(mob);
|
||||||
|
|
||||||
|
|
||||||
CombatManager.combatCycle(mob, target);
|
CombatManager.combatCycle(mob, target,0);
|
||||||
|
|
||||||
if (mob.isSiege()) {
|
if (mob.isSiege()) {
|
||||||
PowerProjectileMsg ppm = new PowerProjectileMsg(mob, target);
|
PowerProjectileMsg ppm = new PowerProjectileMsg(mob, target);
|
||||||
@@ -175,7 +175,7 @@ public class MobAI {
|
|||||||
public static void attackMob(Mob mob, Mob target) {
|
public static void attackMob(Mob mob, Mob target) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (mob == null || target == null)
|
if(mob == null || target == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mob.getRange() >= 30 && mob.isMoving())
|
if (mob.getRange() >= 30 && mob.isMoving())
|
||||||
@@ -183,7 +183,7 @@ public class MobAI {
|
|||||||
|
|
||||||
//no weapons, default mob attack speed 3 seconds.
|
//no weapons, default mob attack speed 3 seconds.
|
||||||
|
|
||||||
CombatManager.combatCycle(mob, target);
|
CombatManager.combatCycle(mob, target,0);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackMob" + " " + e.getMessage());
|
Logger.info(mob.getObjectUUID() + " " + mob.getName() + " Failed At: AttackMob" + " " + e.getMessage());
|
||||||
@@ -975,36 +975,36 @@ public class MobAI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void hamletGuardAggro(Mob mob) {
|
private static void hamletGuardAggro(Mob mob) {
|
||||||
Realm realm = RealmMap.getRealmAtLocation(mob.loc);
|
Realm realm = RealmMap.getRealmAtLocation(mob.loc);
|
||||||
if (realm.getRealmName().equals("Uthgaard")) {
|
if(realm.getRealmName().equals("Uthgaard")){
|
||||||
HashSet<AbstractWorldObject> loadedMobs = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_MOB);
|
HashSet<AbstractWorldObject> loadedMobs = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_MOB);
|
||||||
for (AbstractWorldObject awo : loadedMobs) {
|
for (AbstractWorldObject awo : loadedMobs) {
|
||||||
Mob targetMob = (Mob) awo;
|
Mob targetMob = (Mob) awo;
|
||||||
if (targetMob.equals(mob))
|
if (targetMob.equals(mob))
|
||||||
continue;
|
continue;
|
||||||
if (!targetMob.isAlive() || targetMob.despawned)
|
if (!targetMob.isAlive() || targetMob.despawned)
|
||||||
continue;
|
continue;
|
||||||
if (targetMob.isPet())
|
if (targetMob.isPet())
|
||||||
continue;
|
continue;
|
||||||
mob.combatTarget = targetMob;
|
mob.combatTarget = targetMob;
|
||||||
|
return;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return;
|
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PLAYER);
|
||||||
}
|
for (AbstractWorldObject awo : loadedPlayers) {
|
||||||
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PLAYER);
|
PlayerCharacter pc = (PlayerCharacter) awo;
|
||||||
for (AbstractWorldObject awo : loadedPlayers) {
|
if (!pc.isAlive() || !pc.isActive())
|
||||||
PlayerCharacter pc = (PlayerCharacter) awo;
|
continue;
|
||||||
if (!pc.isAlive() || !pc.isActive())
|
if (pc.guild.equals(Guild.getErrantGuild())) {
|
||||||
continue;
|
mob.combatTarget = pc;
|
||||||
if (pc.guild.equals(Guild.getErrantGuild())) {
|
return;
|
||||||
|
}
|
||||||
|
if (pc.guild.charter.equals(mob.guild.charter))
|
||||||
|
continue;
|
||||||
mob.combatTarget = pc;
|
mob.combatTarget = pc;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (pc.guild.charter.equals(mob.guild.charter))
|
|
||||||
continue;
|
|
||||||
mob.combatTarget = pc;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void defaultLogic(Mob mob) {
|
private static void defaultLogic(Mob mob) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler
|
|||||||
|
|
||||||
//make sure valid resource
|
//make sure valid resource
|
||||||
|
|
||||||
mbEnums.ResourceType resource = mbEnums.ResourceType.resourceHashLookup.get(changeProductionMsg.getResourceHash());
|
mbEnums.ResourceType resource = mbEnums.ResourceType.hashLookup.get(changeProductionMsg.getResourceHash());
|
||||||
|
|
||||||
if (resource == null)
|
if (resource == null)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package engine.net.client.handlers;
|
|||||||
|
|
||||||
import engine.gameManager.BuildingManager;
|
import engine.gameManager.BuildingManager;
|
||||||
import engine.gameManager.CombatManager;
|
import engine.gameManager.CombatManager;
|
||||||
|
import engine.jobs.AttackJob;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
import engine.net.client.msg.AttackCmdMsg;
|
import engine.net.client.msg.AttackCmdMsg;
|
||||||
@@ -82,7 +83,29 @@ public class AttackCmdMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (playerCharacter.isSit())
|
if (playerCharacter.isSit())
|
||||||
CombatManager.toggleSit(false, origin);
|
CombatManager.toggleSit(false, origin);
|
||||||
|
|
||||||
CombatManager.combatCycle(playerCharacter, target);
|
long addedDelay = 0;
|
||||||
|
//check if we are changing targets, cancel outstanding jobs if so
|
||||||
|
if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.RHELD)) {
|
||||||
|
AttackJob ajR = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).getJob());
|
||||||
|
if(ajR.target != null && !ajR.target.equals(target)){
|
||||||
|
playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.RHELD).cancelJob();
|
||||||
|
addedDelay = ajR.getStopTime() - System.currentTimeMillis();
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (playerCharacter.getTimers().containsKey("Attack" + mbEnums.EquipSlotType.LHELD)) {
|
||||||
|
AttackJob ajL = ((AttackJob)playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).getJob());
|
||||||
|
if(ajL.target != null && !ajL.target.equals(target)){
|
||||||
|
playerCharacter.getTimers().get("Attack" + mbEnums.EquipSlotType.LHELD).cancelJob();
|
||||||
|
addedDelay = ajL.getStopTime() - System.currentTimeMillis();
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CombatManager.combatCycle(playerCharacter, target, addedDelay);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (building.getGuild().isEmptyGuild())
|
if (building.getGuild().isEmptyGuild())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!BuildingManager.playerCanManage(sourcePlayer, building))
|
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(sourcePlayer, building))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
|||||||
(building == null) || playerZone == null || playerCity == null)
|
(building == null) || playerZone == null || playerCity == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!BuildingManager.playerCanManage(sourcePlayer, building))
|
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(sourcePlayer, building))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
boolean open = (msg.getMessageType() == OPEN_CITY);
|
boolean open = (msg.getMessageType() == OPEN_CITY);
|
||||||
|
|||||||
@@ -102,9 +102,6 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
|
|||||||
//source guild is limited to 7 subs
|
//source guild is limited to 7 subs
|
||||||
//TODO this should be based on TOL rank
|
//TODO this should be based on TOL rank
|
||||||
|
|
||||||
//cannot be subbed into a nation if you already have your own sub guilds
|
|
||||||
if(targetGuild.getSubGuildList() != null && targetGuild.getSubGuildList().size() > 0)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (!sourceGuild.canSubAGuild(targetGuild)) {
|
if (!sourceGuild.canSubAGuild(targetGuild)) {
|
||||||
sendChat(source, "This Guild can't be subbed.");
|
sendChat(source, "This Guild can't be subbed.");
|
||||||
|
|||||||
@@ -28,6 +28,30 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean playerCanManageNotFriends(PlayerCharacter player, Building building) {
|
||||||
|
|
||||||
|
//Player Can only Control Building if player is in Same Guild as Building and is higher rank than IC.
|
||||||
|
|
||||||
|
if (player == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (building.getRank() == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (BuildingManager.IsOwner(building, player))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false && GuildStatusController.isInnerCouncil(player.getGuildStatus()) == false)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
//Somehow guild leader check fails above? lets check if Player is true Guild GL.
|
||||||
|
if (building.getGuild() != null && building.getGuild().isGuildLeader(player.getObjectUUID()))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return Guild.sameGuild(building.getGuild(), player.getGuild());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
|||||||
City targetCity = null;
|
City targetCity = null;
|
||||||
|
|
||||||
if (isTeleport)
|
if (isTeleport)
|
||||||
cities = City.getCitiesToTeleportTo(player, false);
|
cities = City.getCitiesToTeleportTo(player);
|
||||||
else
|
else
|
||||||
cities = City.getCitiesToRepledgeTo(player);
|
cities = City.getCitiesToRepledgeTo(player);
|
||||||
for (City city : cities) {
|
for (City city : cities) {
|
||||||
|
|||||||
@@ -264,9 +264,8 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
|||||||
player.cancelOnSpell();
|
player.cancelOnSpell();
|
||||||
break;
|
break;
|
||||||
case RUNE:
|
case RUNE:
|
||||||
if(ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
ApplyRuneMsg.applyRune(uuid, origin, player);
|
||||||
itemMan.consume(item);
|
itemMan.consume(item);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default: //shouldn't be here, consume item
|
default: //shouldn't be here, consume item
|
||||||
dispatch = Dispatch.borrow(player, msg);
|
dispatch = Dispatch.borrow(player, msg);
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (building == null)
|
if (building == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (BuildingManager.playerCanManage(player, building) == false)
|
if (ManageCityAssetMsgHandler.playerCanManageNotFriends(player, building) == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (orderNpcMsg.getPatrolSize() >= 20)
|
if (orderNpcMsg.getPatrolSize() >= 20)
|
||||||
@@ -411,7 +411,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
|||||||
case 2:
|
case 2:
|
||||||
player = SessionManager.getPlayerCharacter(origin);
|
player = SessionManager.getPlayerCharacter(origin);
|
||||||
|
|
||||||
if (BuildingManager.playerCanManage(player, building) == false)
|
if (ManageCityAssetMsgHandler.playerCanManageNotFriends(player, building) == false)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (building.getHirelings().containsKey(npc) == false)
|
if (building.getHirelings().containsKey(npc) == false)
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
|
|
||||||
package engine.net.client.handlers;
|
package engine.net.client.handlers;
|
||||||
|
|
||||||
|
import engine.gameManager.PowersManager;
|
||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
import engine.net.client.msg.ClientNetMsg;
|
import engine.net.client.msg.ClientNetMsg;
|
||||||
import engine.net.client.msg.PerformActionMsg;
|
import engine.net.client.msg.PerformActionMsg;
|
||||||
import engine.wpakpowers.WpakPowerManager;
|
|
||||||
|
|
||||||
public class PerformActionMsgHandler extends AbstractClientMsgHandler {
|
public class PerformActionMsgHandler extends AbstractClientMsgHandler {
|
||||||
|
|
||||||
@@ -23,8 +23,7 @@ public class PerformActionMsgHandler extends AbstractClientMsgHandler {
|
|||||||
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
||||||
|
|
||||||
PerformActionMsg msg = (PerformActionMsg) baseMsg;
|
PerformActionMsg msg = (PerformActionMsg) baseMsg;
|
||||||
//PowersManager.beginCast(msg, origin, false); // Wtf ?
|
PowersManager.usePower(msg, origin, false); // Wtf ?
|
||||||
WpakPowerManager.beginCast(msg, origin, false);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class PetAttackMsgHandler extends AbstractClientMsgHandler {
|
|||||||
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
||||||
|
|
||||||
switch (msg.getTargetType()) {
|
switch (msg.getTargetType()) {
|
||||||
case 52: //player character
|
case 53: //player character
|
||||||
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
||||||
break;
|
break;
|
||||||
case 37://mob
|
case 37://mob
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ import engine.net.client.msg.PerformActionMsg;
|
|||||||
import engine.net.client.msg.SendSummonsMsg;
|
import engine.net.client.msg.SendSummonsMsg;
|
||||||
import engine.objects.PlayerCharacter;
|
import engine.objects.PlayerCharacter;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import engine.wpakpowers.WpakPowerManager;
|
|
||||||
|
|
||||||
import static engine.gameManager.PowersManager.sendPowerMsg;
|
import static engine.gameManager.PowersManager.*;
|
||||||
import static engine.gameManager.PowersManager.sendRecyclePower;
|
|
||||||
|
|
||||||
public class SendSummonsMsgHandler extends AbstractClientMsgHandler {
|
public class SendSummonsMsgHandler extends AbstractClientMsgHandler {
|
||||||
|
|
||||||
@@ -83,8 +81,7 @@ public class SendSummonsMsgHandler extends AbstractClientMsgHandler {
|
|||||||
|
|
||||||
// Client removes 200 mana on summon use.. so don't send message to self
|
// Client removes 200 mana on summon use.. so don't send message to self
|
||||||
target.addSummoner(playerCharacter.getObjectUUID(), System.currentTimeMillis() + MBServerStatics.FOURTYFIVE_SECONDS);
|
target.addSummoner(playerCharacter.getObjectUUID(), System.currentTimeMillis() + MBServerStatics.FOURTYFIVE_SECONDS);
|
||||||
//beginCast(pam, origin, false);
|
usePower(pam, origin, false);
|
||||||
WpakPowerManager.beginCast(pam, origin, false);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,15 +86,15 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (ablist == null)
|
if (ablist == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
TrackPowerAction trackPowerAction = null;
|
TrackPowerAction tpa = null;
|
||||||
|
|
||||||
for (ActionsBase ab : ablist) {
|
for (ActionsBase ab : ablist) {
|
||||||
AbstractPowerAction apa = ab.getPowerAction();
|
AbstractPowerAction apa = ab.getPowerAction();
|
||||||
if (apa != null && apa instanceof TrackPowerAction)
|
if (apa != null && apa instanceof TrackPowerAction)
|
||||||
trackPowerAction = (TrackPowerAction) apa;
|
tpa = (TrackPowerAction) apa;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trackPowerAction == null)
|
if (tpa == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Check powers for normal users
|
// Check powers for normal users
|
||||||
@@ -111,16 +111,16 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
|
|||||||
int mask = 0;
|
int mask = 0;
|
||||||
|
|
||||||
if (pb.targetPlayer())
|
if (pb.targetPlayer())
|
||||||
if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Vampire)) // track vampires
|
if (tpa.trackVampire()) // track vampires
|
||||||
mask = MBServerStatics.MASK_PLAYER | MBServerStatics.MASK_UNDEAD;
|
mask = MBServerStatics.MASK_PLAYER | MBServerStatics.MASK_UNDEAD;
|
||||||
else
|
else
|
||||||
// track all players
|
// track all players
|
||||||
mask = MBServerStatics.MASK_PLAYER;
|
mask = MBServerStatics.MASK_PLAYER;
|
||||||
else if (pb.targetCorpse()) // track corpses
|
else if (pb.targetCorpse()) // track corpses
|
||||||
mask = MBServerStatics.MASK_CORPSE;
|
mask = MBServerStatics.MASK_CORPSE;
|
||||||
else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.NPC)) // Track NPCs
|
else if (tpa.trackNPC()) // Track NPCs
|
||||||
mask = MBServerStatics.MASK_NPC;
|
mask = MBServerStatics.MASK_NPC;
|
||||||
else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Undead)) // Track Undead
|
else if (tpa.trackUndead()) // Track Undead
|
||||||
mask = MBServerStatics.MASK_MOB | MBServerStatics.MASK_UNDEAD;
|
mask = MBServerStatics.MASK_MOB | MBServerStatics.MASK_UNDEAD;
|
||||||
else
|
else
|
||||||
// Track All
|
// Track All
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class TransferGoldToFromBuildingMsgHandler extends AbstractClientMsgHandl
|
|||||||
|
|
||||||
if (msg.getDirection() == 2) {
|
if (msg.getDirection() == 2) {
|
||||||
|
|
||||||
if (!BuildingManager.playerCanManage(player, building))
|
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(player, building))
|
||||||
return true;
|
return true;
|
||||||
if (building.setReserve(msg.getUnknown01(), player)) {
|
if (building.setReserve(msg.getUnknown01(), player)) {
|
||||||
dispatch = Dispatch.borrow(player, msg);
|
dispatch = Dispatch.borrow(player, msg);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class SendOwnPlayerMsg extends ClientNetMsg {
|
|||||||
@Override
|
@Override
|
||||||
protected int getPowerOfTwoBufferSize() {
|
protected int getPowerOfTwoBufferSize() {
|
||||||
//Larger size for historically larger opcodes
|
//Larger size for historically larger opcodes
|
||||||
return (18); // 2^17 == 131,072
|
return (17); // 2^17 == 131,072
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -73,8 +73,10 @@ public class TeleportRepledgeListMsg extends ClientNetMsg {
|
|||||||
|
|
||||||
public void configure() {
|
public void configure() {
|
||||||
|
|
||||||
cities = City.getCitiesToTeleportTo(player, !isTeleport);
|
if (isTeleport)
|
||||||
|
cities = City.getCitiesToTeleportTo(player);
|
||||||
|
else
|
||||||
|
cities = City.getCitiesToRepledgeTo(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class ViewResourcesMsg extends ClientNetMsg {
|
|||||||
|
|
||||||
for (mbEnums.ResourceType resourceType : (warehouseObject.resources.keySet())) {
|
for (mbEnums.ResourceType resourceType : (warehouseObject.resources.keySet())) {
|
||||||
|
|
||||||
writer.putInt(resourceType.templateHash);
|
writer.putInt(resourceType.hash);
|
||||||
writer.putInt((warehouseObject.resources.get(resourceType)));
|
writer.putInt((warehouseObject.resources.get(resourceType)));
|
||||||
|
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public class ViewResourcesMsg extends ClientNetMsg {
|
|||||||
|
|
||||||
for (mbEnums.ResourceType resourceType : warehouseObject.resources.keySet()) {
|
for (mbEnums.ResourceType resourceType : warehouseObject.resources.keySet()) {
|
||||||
|
|
||||||
writer.putInt(resourceType.templateHash);
|
writer.putInt(resourceType.hash);
|
||||||
writer.putInt(0); //available?
|
writer.putInt(0); //available?
|
||||||
writer.putInt(resourceType.deposit_limit); //max?
|
writer.putInt(resourceType.deposit_limit); //max?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -656,13 +656,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
|
AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
|
||||||
if (abstractCharacter.getObjectType().equals(GameObjectType.Mob)) {
|
if (abstractCharacter.getObjectType().equals(GameObjectType.Mob)) {
|
||||||
Mob mob = (Mob) abstractCharacter;
|
Mob mob = (Mob) abstractCharacter;
|
||||||
abstractCharacter.minDamageHandOne = (int) mob.mobBase.getDamageMin();
|
abstractCharacter.minDamageHandOne += (int) mob.mobBase.getDamageMin();
|
||||||
abstractCharacter.minDamageHandTwo = (int) mob.mobBase.getDamageMin();
|
abstractCharacter.minDamageHandTwo += (int) mob.mobBase.getDamageMin();
|
||||||
abstractCharacter.maxDamageHandOne = (int) mob.mobBase.getDamageMax();
|
abstractCharacter.maxDamageHandOne += (int) mob.mobBase.getDamageMax();
|
||||||
abstractCharacter.maxDamageHandTwo = (int) mob.mobBase.getDamageMax();
|
abstractCharacter.maxDamageHandTwo += (int) mob.mobBase.getDamageMax();
|
||||||
abstractCharacter.atrHandOne = mob.mobBase.getAttackRating();
|
abstractCharacter.atrHandOne += mob.mobBase.getAttackRating();
|
||||||
abstractCharacter.atrHandTwo = mob.mobBase.getAttackRating();
|
abstractCharacter.atrHandTwo += mob.mobBase.getAttackRating();
|
||||||
abstractCharacter.defenseRating = mob.mobBase.getDefenseRating();
|
abstractCharacter.defenseRating += mob.mobBase.getDefenseRating();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,7 +806,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None));
|
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None));
|
||||||
|
|
||||||
PlayerBonuses bonuses = abstractCharacter.bonuses;
|
PlayerBonuses bonuses = abstractCharacter.bonuses;
|
||||||
if (bonuses != null) {
|
if(bonuses != null){
|
||||||
ModType modType = ModType.AttackDelay;
|
ModType modType = ModType.AttackDelay;
|
||||||
for (AbstractEffectModifier mod : bonuses.bonusFloats.keySet()) {
|
for (AbstractEffectModifier mod : bonuses.bonusFloats.keySet()) {
|
||||||
|
|
||||||
@@ -1787,7 +1787,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
final boolean fromCost) {
|
final boolean fromCost) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
this.combatLock.writeLock().lock();
|
||||||
try {
|
try {
|
||||||
boolean ready = this.healthLock.writeLock().tryLock(1, TimeUnit.SECONDS);
|
boolean ready = this.healthLock.writeLock().tryLock(1, TimeUnit.SECONDS);
|
||||||
|
|
||||||
@@ -1829,7 +1829,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
Mob target = (Mob) this;
|
Mob target = (Mob) this;
|
||||||
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||||
|
|
||||||
if (target.playerAgroMap.containsKey(attacker.getObjectUUID()))
|
if(target.playerAgroMap.containsKey(attacker.getObjectUUID()))
|
||||||
target.playerAgroMap.put(attacker.getObjectUUID(), target.playerAgroMap.get(attacker.getObjectUUID()) + value);
|
target.playerAgroMap.put(attacker.getObjectUUID(), target.playerAgroMap.get(attacker.getObjectUUID()) + value);
|
||||||
else
|
else
|
||||||
target.playerAgroMap.put(attacker.getObjectUUID(), value);
|
target.playerAgroMap.put(attacker.getObjectUUID(), value);
|
||||||
@@ -1852,6 +1852,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
return newHealth - oldHealth;
|
return newHealth - oldHealth;
|
||||||
} finally {
|
} finally {
|
||||||
this.healthLock.writeLock().unlock();
|
this.healthLock.writeLock().unlock();
|
||||||
|
this.combatLock.writeLock().unlock();
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ import engine.net.client.ClientConnection;
|
|||||||
import engine.net.client.msg.UpdateEffectsMsg;
|
import engine.net.client.msg.UpdateEffectsMsg;
|
||||||
import engine.powers.EffectsBase;
|
import engine.powers.EffectsBase;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import engine.wpakpowers.AppliedEffect;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -60,10 +59,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
|
|||||||
private Vector3f rot = new Vector3f(0.0f, 0.0f, 0.0f);
|
private Vector3f rot = new Vector3f(0.0f, 0.0f, 0.0f);
|
||||||
private int objectTypeMask = 0;
|
private int objectTypeMask = 0;
|
||||||
private Bounds bounds;
|
private Bounds bounds;
|
||||||
|
public ReentrantReadWriteLock combatLock = new ReentrantReadWriteLock();
|
||||||
// Effects collection for wpak power manager
|
|
||||||
|
|
||||||
public ConcurrentHashMap<engine.wpak.data.Effect, AppliedEffect> _effects = new ConcurrentHashMap<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* No Id Constructor
|
* No Id Constructor
|
||||||
@@ -380,7 +376,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
|
|||||||
if (eff == null) {
|
if (eff == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (eff.getEffectsBase().effectSources.contains(source) && trains >= eff.getTrains()) {
|
if (eff.containsSource(source) && trains >= eff.getTrains()) {
|
||||||
if (removeAll) {
|
if (removeAll) {
|
||||||
//remove all effects of source type
|
//remove all effects of source type
|
||||||
if (eff.cancel()) {
|
if (eff.cancel()) {
|
||||||
|
|||||||
@@ -641,18 +641,18 @@ public final class Bane {
|
|||||||
return cityUUID;
|
return cityUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startBane() {
|
public void startBane(){
|
||||||
City city = this.getCity();
|
City city = this.getCity();
|
||||||
if (city == null)
|
if(city == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.isStarted = true; //flag the bane as started
|
this.isStarted = true; //flag the bane as started
|
||||||
|
|
||||||
for (AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(city.loc, mbEnums.CityBoundsType.ZONE.halfExtents + 64, MBServerStatics.MASK_BUILDING)) {
|
for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(city.loc,mbEnums.CityBoundsType.ZONE.halfExtents + 64,MBServerStatics.MASK_BUILDING)){
|
||||||
Building building = (Building) awo;
|
Building building = (Building)awo;
|
||||||
if (building == null)
|
if(building == null)
|
||||||
continue;
|
continue;
|
||||||
if (building.protectionState.equals(ProtectionState.UNDERSIEGE) == false)
|
if(building.protectionState.equals(ProtectionState.UNDERSIEGE) == false)
|
||||||
building.protectionState = ProtectionState.UNDERSIEGE;
|
building.protectionState = ProtectionState.UNDERSIEGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,11 +163,6 @@ public class Building extends AbstractWorldObject {
|
|||||||
if (upgradeTimeStamp != null)
|
if (upgradeTimeStamp != null)
|
||||||
this.upgradeDateTime = LocalDateTime.ofInstant(upgradeTimeStamp.toInstant(), ZoneId.systemDefault());
|
this.upgradeDateTime = LocalDateTime.ofInstant(upgradeTimeStamp.toInstant(), ZoneId.systemDefault());
|
||||||
|
|
||||||
if(rs.getInt("enforceKOS") == 0)
|
|
||||||
this.enforceKOS = false;
|
|
||||||
else
|
|
||||||
this.enforceKOS = true;
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error("Failed for object " + this.blueprintUUID + ' ' + this.getObjectUUID() + e);
|
Logger.error("Failed for object " + this.blueprintUUID + ' ' + this.getObjectUUID() + e);
|
||||||
}
|
}
|
||||||
@@ -561,7 +556,7 @@ public class Building extends AbstractWorldObject {
|
|||||||
BuildingManager.setRank(barracksBuilding, -1);
|
BuildingManager.setRank(barracksBuilding, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the tree is R8 and deranking, we need to update the
|
// If the tree is R8 and deranking, we need to update it's
|
||||||
// mesh along with buildings losing their health bonus
|
// mesh along with buildings losing their health bonus
|
||||||
|
|
||||||
if (this.rank == 8) {
|
if (this.rank == 8) {
|
||||||
@@ -1452,7 +1447,7 @@ public class Building extends AbstractWorldObject {
|
|||||||
|
|
||||||
public synchronized boolean setReserve(int amount, PlayerCharacter player) {
|
public synchronized boolean setReserve(int amount, PlayerCharacter player) {
|
||||||
|
|
||||||
if (!BuildingManager.playerCanManage(player, this))
|
if (!BuildingManager.playerCanManageNotFriends(player, this))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (amount < 0)
|
if (amount < 0)
|
||||||
|
|||||||
@@ -1400,7 +1400,6 @@ public class CharacterItemManager {
|
|||||||
|
|
||||||
if (!ItemManager.validForSkills(item, pc.getSkills())) {
|
if (!ItemManager.validForSkills(item, pc.getSkills())) {
|
||||||
this.forceToInventory(slot, item, pc, initialized);
|
this.forceToInventory(slot, item, pc, initialized);
|
||||||
this.equipped.remove(slot);
|
|
||||||
pc.applyBonuses();
|
pc.applyBonuses();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+137
-150
@@ -41,7 +41,6 @@ import java.util.HashSet;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ThreadLocalRandom;
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
|
|
||||||
public class City extends AbstractWorldObject {
|
public class City extends AbstractWorldObject {
|
||||||
@@ -81,7 +80,6 @@ public class City extends AbstractWorldObject {
|
|||||||
private String hash;
|
private String hash;
|
||||||
public Warehouse warehouse;
|
public Warehouse warehouse;
|
||||||
public Realm realm;
|
public Realm realm;
|
||||||
public AtomicBoolean isDestroyed = new AtomicBoolean(false);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResultSet Constructor
|
* ResultSet Constructor
|
||||||
@@ -122,7 +120,9 @@ public class City extends AbstractWorldObject {
|
|||||||
this.treeOfLifeID = rs.getInt("treeOfLifeUUID");
|
this.treeOfLifeID = rs.getInt("treeOfLifeUUID");
|
||||||
this.bindX = rs.getFloat("bindX");
|
this.bindX = rs.getFloat("bindX");
|
||||||
this.bindZ = rs.getFloat("bindZ");
|
this.bindZ = rs.getFloat("bindZ");
|
||||||
this.bindLoc = new Vector3fImmutable(this.location.getX() + this.bindX, this.location.getY(), this.location.getZ() + this.bindZ);
|
this.bindLoc = new Vector3fImmutable(this.location.getX() + this.bindX,
|
||||||
|
this.location.getY(),
|
||||||
|
this.location.getZ() + this.bindZ);
|
||||||
this.radiusType = rs.getInt("radiusType");
|
this.radiusType = rs.getInt("radiusType");
|
||||||
|
|
||||||
float bindradiustemp = rs.getFloat("bindRadius");
|
float bindradiustemp = rs.getFloat("bindRadius");
|
||||||
@@ -288,134 +288,106 @@ public class City extends AbstractWorldObject {
|
|||||||
return city.getBindLoc();
|
return city.getBindLoc();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter playerCharacter, boolean repledge) {
|
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter pc) {
|
||||||
|
|
||||||
ArrayList<City> cities = new ArrayList<>();
|
ArrayList<City> cities = new ArrayList<>();
|
||||||
|
|
||||||
if (playerCharacter == null)
|
if (pc == null)
|
||||||
return cities;
|
return cities;
|
||||||
|
|
||||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
||||||
|
|
||||||
//handle compiling of cities able to be teleported to for lore rule-set
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
|
//handle compiling of cities able to be teleported to for lore rule-set
|
||||||
for (AbstractGameObject ago : worldCities.values()) {
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
|
City city = (City) ago;
|
||||||
City city = (City) ago;
|
if(city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||||
|
continue; // cannot teleport to perdition or bastion
|
||||||
// Filter Player cities
|
if (city.isNpc == 1 && city.getGuild().charter.equals(pc.guild.charter)) {
|
||||||
|
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
||||||
if (city.parentZone == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Can't teleport to something without a tree
|
|
||||||
|
|
||||||
if (city.getTOL() == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// No abandoned cities
|
|
||||||
|
|
||||||
if (city.getTOL().getGuild().isEmptyGuild())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// No destroyed cities
|
|
||||||
|
|
||||||
if (city.getTOL().getRank() == -1)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
//can't repledge to a guild you're already part of
|
|
||||||
|
|
||||||
if (repledge && city.getGuild().equals(playerCharacter.guild))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (city.parentZone.guild_zone) {
|
|
||||||
|
|
||||||
//players can all port and repledge inside their own nation
|
|
||||||
|
|
||||||
if(city.getGuild().getNation().equals(playerCharacter.guild.getNation())){
|
|
||||||
cities.add(city);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
} else if (city.isNoobIsle == 1 && pc.level <= 20) {
|
||||||
|
cities.add(city); // everyone can go to noob island if they are under level 20
|
||||||
if (city.isOpen() && city.getTOL().rank > 4) {
|
continue;
|
||||||
|
} else if (city.cityName.equals("Khan'Ov Srekel")) {
|
||||||
// Filter Lore cities
|
cities.add(city); //everyone anytime can teleport to khan
|
||||||
|
continue;
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
} else if (city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(pc.guild.charter))
|
||||||
|
if (!city.getTOL().reverseKOS) {
|
||||||
if (repledge) {
|
cities.add(city);//can teleport to any open ToL that shares charter
|
||||||
if (!city.getGuild().charter.canJoin(playerCharacter))
|
continue;
|
||||||
continue;
|
|
||||||
} else if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Integer playerUUID = playerCharacter.objectUUID;
|
|
||||||
Integer guildUUID = playerCharacter.guildUUID;
|
|
||||||
Integer nationUUID = playerCharacter.guild.getNation().getObjectUUID();
|
|
||||||
boolean allowed = false;
|
|
||||||
|
|
||||||
if (city.getTOL().reverseKOS) {
|
|
||||||
|
|
||||||
//reverse KOS, specific values are allowed
|
|
||||||
|
|
||||||
if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) ||
|
|
||||||
(city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) ||
|
|
||||||
(city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active))
|
|
||||||
allowed = true;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
//not reverse KOS, everyone is allowed by default
|
if (city.getTOL().getCondemned().contains(pc.objectUUID) && city.getTOL().getCondemned().get(pc.objectUUID).active) {
|
||||||
|
cities.add(city);//this player is allowed for the reverse KOS
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (city.getTOL().getCondemned().contains(pc.guildUUID) && city.getTOL().getCondemned().get(pc.guildUUID).active) {
|
||||||
|
cities.add(city);//this guild is allowed for the reverse KOS
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (city.getTOL().getCondemned().contains(pc.guild.getNation().getObjectUUID()) && city.getTOL().getCondemned().get(pc.guild.getNation().getObjectUUID()).active) {
|
||||||
|
cities.add(city);//this nation is allowed for the reverse KOS
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (city.getGuild().getNation().equals(pc.guild.getNation())) {
|
||||||
|
cities.add(city);//can always teleport inside your own nation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
allowed = true;
|
Guild pcG = pc.getGuild();
|
||||||
|
//add npc cities
|
||||||
|
|
||||||
//specific values are not allowed
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
|
|
||||||
if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) ||
|
if (ago.getObjectType().equals(GameObjectType.City)) {
|
||||||
(city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) ||
|
City city = (City) ago;
|
||||||
(city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active))
|
|
||||||
allowed = false;
|
|
||||||
|
|
||||||
|
if (city.noTeleport)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (city.parentZone != null && city.parentZone.guild_zone) {
|
||||||
|
|
||||||
|
if (pc.getAccount().status.equals(AccountStatus.ADMIN)) {
|
||||||
|
cities.add(city);
|
||||||
|
} else
|
||||||
|
//list Player cities
|
||||||
|
|
||||||
|
//open city, just list
|
||||||
|
|
||||||
|
if (city.open && city.getTOL() != null && city.getTOL().getRank() > 4) {
|
||||||
|
|
||||||
|
if (!BuildingManager.IsPlayerHostile(city.getTOL(), pc)) {
|
||||||
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
|
if (city.getGuild().getGuildType().equals(pc.guild.getGuildType())) {
|
||||||
|
cities.add(city);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cities.add(city); //verify nation or guild is same
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (Guild.sameNationExcludeErrant(city.getGuild(), pcG))
|
||||||
|
cities.add(city);
|
||||||
|
|
||||||
|
|
||||||
|
} else if (city.isNpc == 1) {
|
||||||
|
|
||||||
|
//list NPC cities
|
||||||
|
|
||||||
|
Guild g = city.getGuild();
|
||||||
|
if (g == null) {
|
||||||
|
if (city.isNpc == 1)
|
||||||
|
if (city.isNoobIsle == 1) {
|
||||||
|
if (pc.getLevel() < 21)
|
||||||
|
cities.add(city); //verify nation or guild is same
|
||||||
|
} else if (pc.getLevel() > 9)
|
||||||
|
cities.add(city); //verify nation or guild is same
|
||||||
|
|
||||||
|
} else if (pc.getLevel() >= g.getTeleportMin() && pc.getLevel() <= g.getTeleportMax())
|
||||||
|
cities.add(city); //verify nation or guild is same
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowed)
|
|
||||||
cities.add(city);
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
|
||||||
// Filter NPC cities
|
|
||||||
|
|
||||||
if (city.isNoobIsle == 1) {
|
|
||||||
|
|
||||||
if (playerCharacter.level < 20)
|
|
||||||
cities.add(city); // everyone can go to noob island if they are under level 20
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Players cannot teleport to perdition or bastion
|
|
||||||
|
|
||||||
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// These cities are available for anyone off noob island
|
|
||||||
|
|
||||||
if (playerCharacter.level >= 20 && (city.cityName.equals("Sea Dog's Rest") || city.cityName.equals("Khan'Ov Srekel") || city.cityName.equals("City of Khar Th'Sekt"))) {
|
|
||||||
cities.add(city);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add Lore cities
|
|
||||||
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
|
||||||
|
|
||||||
if (repledge) {
|
|
||||||
if (city.getGuild().charter.canJoin(playerCharacter))
|
|
||||||
cities.add(city);
|
|
||||||
} else if (city.getGuild().charter.equals(playerCharacter.guild.charter))
|
|
||||||
cities.add(city);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cities;
|
return cities;
|
||||||
@@ -435,14 +407,13 @@ public class City extends AbstractWorldObject {
|
|||||||
//handle compiling of cities able to be repledged to for lore rule-set
|
//handle compiling of cities able to be repledged to for lore rule-set
|
||||||
for (AbstractGameObject ago : worldCities.values()) {
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
City city = (City) ago;
|
City city = (City) ago;
|
||||||
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
if(city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||||
continue; // cannot repledge to perdition or bastion
|
continue; // cannot repledge to perdition or bastion
|
||||||
if (city.isNpc == 1 && city.getGuild().charter.canJoin(playerCharacter)) {
|
if (city.isNpc == 1 && city.getGuild().charter.canJoin(playerCharacter)) {
|
||||||
|
if(city.isNoobIsle == 1 && playerCharacter.level >= 21)
|
||||||
|
continue;
|
||||||
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
||||||
continue;
|
continue;
|
||||||
} else if (city.isNoobIsle == 1 && playerCharacter.level <= 20) {
|
|
||||||
cities.add(city); // everyone can go to noob island if they are under level 20
|
|
||||||
continue;
|
|
||||||
} else if (city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.canJoin(playerCharacter))
|
} else if (city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.canJoin(playerCharacter))
|
||||||
if (!city.getTOL().reverseKOS) {
|
if (!city.getTOL().reverseKOS) {
|
||||||
cities.add(city);//can repledge to any open ToL that player can fit into charter
|
cities.add(city);//can repledge to any open ToL that player can fit into charter
|
||||||
@@ -614,7 +585,7 @@ public class City extends AbstractWorldObject {
|
|||||||
if (this.siegesWithstood == siegesWithstood)
|
if (this.siegesWithstood == siegesWithstood)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (DbManager.CityQueries.updateSiegesWithstood(this, siegesWithstood))
|
if (DbManager.CityQueries.updateSiegesWithstood(this, siegesWithstood) == true)
|
||||||
this.siegesWithstood = siegesWithstood;
|
this.siegesWithstood = siegesWithstood;
|
||||||
else
|
else
|
||||||
Logger.error("Error when writing to database for cityUUID: " + this.getObjectUUID());
|
Logger.error("Error when writing to database for cityUUID: " + this.getObjectUUID());
|
||||||
@@ -670,10 +641,17 @@ public class City extends AbstractWorldObject {
|
|||||||
if (this.getTOL() == null)
|
if (this.getTOL() == null)
|
||||||
return Guild.getErrantGuild();
|
return Guild.getErrantGuild();
|
||||||
|
|
||||||
if (this.getTOL().getOwner() == null)
|
if (this.isNpc == 1) {
|
||||||
return Guild.getErrantGuild();
|
|
||||||
|
|
||||||
return this.getTOL().getOwner().getGuild();
|
if (this.getTOL().getOwner() == null)
|
||||||
|
return Guild.getErrantGuild();
|
||||||
|
return this.getTOL().getOwner().getGuild();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (this.getTOL().getOwner() == null)
|
||||||
|
return Guild.getErrantGuild();
|
||||||
|
return this.getTOL().getOwner().getGuild();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean openCity(boolean open) {
|
public boolean openCity(boolean open) {
|
||||||
@@ -752,7 +730,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
for (AbstractCharacter npc : getTOL().getHirelings().keySet()) {
|
for (AbstractCharacter npc : getTOL().getHirelings().keySet()) {
|
||||||
if (npc.getObjectType() == GameObjectType.NPC)
|
if (npc.getObjectType() == GameObjectType.NPC)
|
||||||
if (((NPC) npc).getContract().isRuneMaster())
|
if (((NPC) npc).getContract().isRuneMaster() == true)
|
||||||
outNPC = (NPC) npc;
|
outNPC = (NPC) npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -785,13 +763,16 @@ public class City extends AbstractWorldObject {
|
|||||||
// Set location for this city
|
// Set location for this city
|
||||||
|
|
||||||
this.location = new Vector3fImmutable(this.parentZone.absX, this.parentZone.absY, this.parentZone.absZ);
|
this.location = new Vector3fImmutable(this.parentZone.absX, this.parentZone.absY, this.parentZone.absZ);
|
||||||
this.bindLoc = new Vector3fImmutable(this.location.x + this.bindX, this.location.y, this.location.z + this.bindZ);
|
this.bindLoc = new Vector3fImmutable(this.location.x + this.bindX,
|
||||||
|
this.location.y,
|
||||||
|
this.location.z + this.bindZ);
|
||||||
|
|
||||||
// set city bounds
|
// set city bounds
|
||||||
|
|
||||||
Bounds cityBounds = Bounds.borrow();
|
Bounds cityBounds = Bounds.borrow();
|
||||||
cityBounds.setBounds(new Vector2f(this.location.x + 64, this.location.z + 64), // location x and z are offset by 64 from the center of the city.
|
cityBounds.setBounds(new Vector2f(this.location.x + 64, this.location.z + 64), // location x and z are offset by 64 from the center of the city.
|
||||||
new Vector2f(mbEnums.CityBoundsType.GRID.halfExtents, mbEnums.CityBoundsType.GRID.halfExtents), 0.0f);
|
new Vector2f(mbEnums.CityBoundsType.GRID.halfExtents, mbEnums.CityBoundsType.GRID.halfExtents),
|
||||||
|
0.0f);
|
||||||
this.setBounds(cityBounds);
|
this.setBounds(cityBounds);
|
||||||
|
|
||||||
// Sanity check; no tol
|
// Sanity check; no tol
|
||||||
@@ -799,7 +780,8 @@ public class City extends AbstractWorldObject {
|
|||||||
if (BuildingManager.getBuilding(this.treeOfLifeID) == null)
|
if (BuildingManager.getBuilding(this.treeOfLifeID) == null)
|
||||||
Logger.info("City UID " + this.getObjectUUID() + " Failed to Load Tree of Life with ID " + this.treeOfLifeID);
|
Logger.info("City UID " + this.getObjectUUID() + " Failed to Load Tree of Life with ID " + this.treeOfLifeID);
|
||||||
|
|
||||||
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER)) && (this.isNpc == (byte) 0)) {
|
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER))
|
||||||
|
&& (this.isNpc == (byte) 0)) {
|
||||||
|
|
||||||
this.realm = RealmMap.getRealmAtLocation(this.getLoc());
|
this.realm = RealmMap.getRealmAtLocation(this.getLoc());
|
||||||
|
|
||||||
@@ -819,7 +801,8 @@ public class City extends AbstractWorldObject {
|
|||||||
if (this.getGuild().getGuildState() == GuildState.Nation)
|
if (this.getGuild().getGuildState() == GuildState.Nation)
|
||||||
for (Guild sub : this.getGuild().getSubGuildList()) {
|
for (Guild sub : this.getGuild().getSubGuildList()) {
|
||||||
|
|
||||||
if ((sub.getGuildState() == GuildState.Protectorate) || (sub.getGuildState() == GuildState.Province)) {
|
if ((sub.getGuildState() == GuildState.Protectorate) ||
|
||||||
|
(sub.getGuildState() == GuildState.Province)) {
|
||||||
this.isCapital = 1;
|
this.isCapital = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -844,7 +827,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
this.setHash();
|
this.setHash();
|
||||||
|
|
||||||
if (!DataWarehouse.recordExists(DataRecordType.CITY, this.getObjectUUID())) {
|
if (DataWarehouse.recordExists(mbEnums.DataRecordType.CITY, this.getObjectUUID()) == false) {
|
||||||
CityRecord cityRecord = CityRecord.borrow(this, mbEnums.RecordEventType.CREATE);
|
CityRecord cityRecord = CityRecord.borrow(this, mbEnums.RecordEventType.CREATE);
|
||||||
DataWarehouse.pushToWarehouse(cityRecord);
|
DataWarehouse.pushToWarehouse(cityRecord);
|
||||||
}
|
}
|
||||||
@@ -869,7 +852,9 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
for (Building building : this.parentZone.zoneBuildingSet) {
|
for (Building building : this.parentZone.zoneBuildingSet) {
|
||||||
|
|
||||||
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE && building.getBlueprint().getBuildingGroup() != BuildingGroup.TOL) {
|
if (building.getBlueprint() != null &&
|
||||||
|
building.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE &&
|
||||||
|
building.getBlueprint().getBuildingGroup() != BuildingGroup.TOL) {
|
||||||
|
|
||||||
building.healthMax += (building.healthMax * Realm.getRealmHealthMod(this));
|
building.healthMax += (building.healthMax * Realm.getRealmHealthMod(this));
|
||||||
|
|
||||||
@@ -951,7 +936,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
// Reapply effect with timeout?
|
// Reapply effect with timeout?
|
||||||
|
|
||||||
if (refreshEffect)
|
if (refreshEffect == true)
|
||||||
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this);
|
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1119,21 +1104,17 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
public final void destroy() {
|
public final void destroy() {
|
||||||
|
|
||||||
if (this.isDestroyed.compareAndSet(false, true)) {
|
Thread destroyCityThread = new Thread(new DestroyCityThread(this));
|
||||||
|
|
||||||
Thread destroyCityThread = new Thread(new DestroyCityThread(this));
|
destroyCityThread.setName("destroyCity:" + this.getName());
|
||||||
|
destroyCityThread.start();
|
||||||
destroyCityThread.setName("destroyCity:" + this.getParent().zoneName);
|
|
||||||
destroyCityThread.start();
|
|
||||||
} else
|
|
||||||
Logger.error("Attempt to destroy destroyed city");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void transfer(AbstractCharacter newOwner) {
|
public final void transfer(AbstractCharacter newOwner) {
|
||||||
|
|
||||||
Thread transferCityThread = new Thread(new TransferCityThread(this, newOwner));
|
Thread transferCityThread = new Thread(new TransferCityThread(this, newOwner));
|
||||||
|
|
||||||
transferCityThread.setName("TransferCity:" + this.getParent().zoneName);
|
transferCityThread.setName("TransferCity:" + this.getName());
|
||||||
transferCityThread.start();
|
transferCityThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1211,25 +1192,26 @@ public class City extends AbstractWorldObject {
|
|||||||
// All protection contracts are void upon transfer of a city
|
// All protection contracts are void upon transfer of a city
|
||||||
//Dont forget to not Flip protection on Banestones and siege Equipment... Noob.
|
//Dont forget to not Flip protection on Banestones and siege Equipment... Noob.
|
||||||
|
|
||||||
if (cityBuilding.getBlueprint() != null && !cityBuilding.getBlueprint().isSiegeEquip() && cityBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE)
|
if (cityBuilding.getBlueprint() != null && !cityBuilding.getBlueprint().isSiegeEquip()
|
||||||
|
&& cityBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE)
|
||||||
cityBuilding.setProtectionState(ProtectionState.NONE);
|
cityBuilding.setProtectionState(ProtectionState.NONE);
|
||||||
|
|
||||||
// Transfer ownership of valid city assets
|
// Transfer ownership of valid city assets
|
||||||
// these assets are autoprotected.
|
// these assets are autoprotected.
|
||||||
|
|
||||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL)
|
||||||
PlayerCharacter guildLeader = PlayerCharacter.getPlayerCharacter(sourcePlayer.guild.getGuildLeaderUUID());
|
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE)
|
||||||
if(guildLeader != null)
|
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK)
|
||||||
cityBuilding.claim(guildLeader);
|
|| (cityBuilding.getBlueprint().isWallPiece())
|
||||||
else
|
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
||||||
cityBuilding.claim(sourcePlayer);
|
|
||||||
|
cityBuilding.claim(sourcePlayer);
|
||||||
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setForceRename(true);
|
this.setForceRename(true);
|
||||||
|
|
||||||
|
|
||||||
// Reset city timer for map update
|
// Reset city timer for map update
|
||||||
|
|
||||||
City.lastCityUpdate = System.currentTimeMillis();
|
City.lastCityUpdate = System.currentTimeMillis();
|
||||||
@@ -1262,7 +1244,12 @@ public class City extends AbstractWorldObject {
|
|||||||
// Transfer ownership of valid city assets
|
// Transfer ownership of valid city assets
|
||||||
// these assets are autoprotected.
|
// these assets are autoprotected.
|
||||||
|
|
||||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL)
|
||||||
|
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE)
|
||||||
|
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK)
|
||||||
|
|| (cityBuilding.getBlueprint().isWallPiece())
|
||||||
|
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)
|
||||||
|
) {
|
||||||
|
|
||||||
cityBuilding.claim(sourcePlayer);
|
cityBuilding.claim(sourcePlayer);
|
||||||
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
||||||
@@ -1411,7 +1398,7 @@ public class City extends AbstractWorldObject {
|
|||||||
taxPercent = .20f;
|
taxPercent = .20f;
|
||||||
|
|
||||||
for (int resourceHash : msg.getResources().keySet())
|
for (int resourceHash : msg.getResources().keySet())
|
||||||
resources.add(ResourceType.templateHashLookup.get(resourceHash));
|
resources.add(ResourceType.hashLookup.get(resourceHash));
|
||||||
|
|
||||||
for (ResourceType resourceType : resources) {
|
for (ResourceType resourceType : resources) {
|
||||||
if (Warehouse.isAboveCap(ruledWarehouse, resourceType, (int) (city.warehouse.resources.get(resourceType) * taxPercent))) {
|
if (Warehouse.isAboveCap(ruledWarehouse, resourceType, (int) (city.warehouse.resources.get(resourceType) * taxPercent))) {
|
||||||
|
|||||||
@@ -433,6 +433,12 @@ public class Effect {
|
|||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean containsSource(EffectSourceType source) {
|
||||||
|
if (this.eb != null)
|
||||||
|
return this.eb.containsSource(source);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public JobContainer getJobContainer() {
|
public JobContainer getJobContainer() {
|
||||||
return this.jc;
|
return this.jc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,16 +193,12 @@ public class Guild extends AbstractWorldObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean sameNationExcludeErrant(Guild a, Guild b) {
|
public static boolean sameNationExcludeErrant(Guild a, Guild b) {
|
||||||
|
|
||||||
if (a == null || b == null)
|
if (a == null || b == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (a.getObjectUUID() == b.getObjectUUID())
|
if (a.getObjectUUID() == b.getObjectUUID())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (a.nation == null || b.nation == null)
|
if (a.nation == null || b.nation == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
|
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
writer.putInt(mine.getObjectUUID()); //actually a hash of mine
|
writer.putInt(mine.getObjectUUID()); //actually a hash of mine
|
||||||
writer.putString(mine.mineType.name);
|
writer.putString(mine.mineType.name);
|
||||||
writer.putString(mine.zoneName);
|
writer.putString(mine.zoneName);
|
||||||
writer.putInt(mine.production.resourceHash);
|
writer.putInt(mine.production.hash);
|
||||||
writer.putInt(mine.production.mine_production);
|
writer.putInt(mine.production.mine_production);
|
||||||
writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here
|
writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here
|
||||||
writer.putInt(3600); //window in seconds
|
writer.putInt(3600); //window in seconds
|
||||||
@@ -220,7 +220,8 @@ public class Mine extends AbstractGameObject {
|
|||||||
// Only inactive mines are returned.
|
// Only inactive mines are returned.
|
||||||
|
|
||||||
for (Mine mine : Mine.mineMap.keySet()) {
|
for (Mine mine : Mine.mineMap.keySet()) {
|
||||||
if (mine.owningGuild.getObjectUUID() == guildID)
|
if (mine.owningGuild.getObjectUUID() == guildID &&
|
||||||
|
mine.isActive == false)
|
||||||
mineList.add(mine);
|
mineList.add(mine);
|
||||||
}
|
}
|
||||||
return mineList;
|
return mineList;
|
||||||
@@ -392,7 +393,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
// writer.putInt(0x215C92BB); //this.unknown1);
|
// writer.putInt(0x215C92BB); //this.unknown1);
|
||||||
writer.putString(this.mineType.name);
|
writer.putString(this.mineType.name);
|
||||||
writer.putString(this.zoneName);
|
writer.putString(this.zoneName);
|
||||||
writer.putInt(this.production.resourceHash);
|
writer.putInt(this.production.hash);
|
||||||
writer.putInt(this.production.mine_production);
|
writer.putInt(this.production.mine_production);
|
||||||
writer.putInt(this.getModifiedProductionAmount()); //TODO calculate range penalty here
|
writer.putInt(this.getModifiedProductionAmount()); //TODO calculate range penalty here
|
||||||
writer.putInt(3600); //window in seconds
|
writer.putInt(3600); //window in seconds
|
||||||
@@ -481,7 +482,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
if (this.owningGuild.getOwnedCity().warehouse == null)
|
if (this.owningGuild.getOwnedCity().warehouse == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Warehouse.depositFromMine(this, mbEnums.ResourceType.templateLookup.get(this.production.templateID), this.getModifiedProductionAmount(), this.owningGuild.getOwnedCity().warehouse);
|
return Warehouse.depositFromMine(this, mbEnums.ResourceType.resourceLookup.get(this.production.templateID), this.getModifiedProductionAmount(), this.owningGuild.getOwnedCity().warehouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean updateGuildOwner(PlayerCharacter playerCharacter) {
|
public boolean updateGuildOwner(PlayerCharacter playerCharacter) {
|
||||||
|
|||||||
@@ -349,13 +349,13 @@ public class Resists {
|
|||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Stun))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Stun))
|
||||||
this.immuneTo.put(mbEnums.DamageType.STUN, true);
|
this.immuneTo.put(mbEnums.DamageType.STUN, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind))
|
||||||
this.immuneTo.put(mbEnums.DamageType.BLINDNESS, true);
|
this.immuneTo.put(mbEnums.DamageType.BLIND, true);
|
||||||
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None))
|
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None))
|
||||||
this.immuneTo.put(mbEnums.DamageType.ATTACK, true);
|
this.immuneTo.put(mbEnums.DamageType.ATTACK, true);
|
||||||
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None))
|
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None))
|
||||||
this.immuneTo.put(mbEnums.DamageType.POWERS, true);
|
this.immuneTo.put(mbEnums.DamageType.POWERS, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
||||||
this.immuneTo.put(mbEnums.DamageType.POWERINHIBITOR, true);
|
this.immuneTo.put(mbEnums.DamageType.POWERBLOCK, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff))
|
||||||
this.immuneTo.put(mbEnums.DamageType.DEBUFF, true);
|
this.immuneTo.put(mbEnums.DamageType.DEBUFF, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear))
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class Warehouse {
|
|||||||
if (warehouse == null)
|
if (warehouse == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.templateHashLookup.get(msg.getHashID());
|
mbEnums.ResourceType resourceType = mbEnums.ResourceType.hashLookup.get(msg.getHashID());
|
||||||
|
|
||||||
if (isResourceLocked(warehouse, resourceType)) {
|
if (isResourceLocked(warehouse, resourceType)) {
|
||||||
ChatManager.chatSystemInfo(playerCharacter, "You cannot withdrawl a locked resource.");
|
ChatManager.chatSystemInfo(playerCharacter, "You cannot withdrawl a locked resource.");
|
||||||
@@ -182,7 +182,7 @@ public class Warehouse {
|
|||||||
|
|
||||||
warehouse = city.warehouse;
|
warehouse = city.warehouse;
|
||||||
|
|
||||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.templateHashLookup.get(hashID);
|
mbEnums.ResourceType resourceType = mbEnums.ResourceType.hashLookup.get(hashID);
|
||||||
|
|
||||||
// toggle lock
|
// toggle lock
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ public class Warehouse {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.templateLookup.get(resource.templateID);
|
mbEnums.ResourceType resourceType = mbEnums.ResourceType.resourceLookup.get(resource.templateID);
|
||||||
|
|
||||||
if (warehouse.resources.get(resourceType) == null)
|
if (warehouse.resources.get(resourceType) == null)
|
||||||
return false;
|
return false;
|
||||||
@@ -261,7 +261,7 @@ public class Warehouse {
|
|||||||
|
|
||||||
int newAmount = oldAmount + amount;
|
int newAmount = oldAmount + amount;
|
||||||
|
|
||||||
if (newAmount > mbEnums.ResourceType.templateLookup.get(resource.templateID).deposit_limit)
|
if (newAmount > mbEnums.ResourceType.resourceLookup.get(resource.templateID).deposit_limit)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (removeFromInventory) {
|
if (removeFromInventory) {
|
||||||
@@ -381,7 +381,7 @@ public class Warehouse {
|
|||||||
int amount = (int) (warehouse.resources.get(resourceType) * taxPercent);
|
int amount = (int) (warehouse.resources.get(resourceType) * taxPercent);
|
||||||
|
|
||||||
if (amount <= 0) {
|
if (amount <= 0) {
|
||||||
msg.getResources().put(resourceType.resourceHash, 0);
|
msg.getResources().put(resourceType.hash, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,18 +395,20 @@ public class Warehouse {
|
|||||||
if (newAmount < amount)
|
if (newAmount < amount)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
msg.getResources().put(resourceType.resourceHash, amount);
|
msg.getResources().put(resourceType.hash, amount);
|
||||||
|
|
||||||
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
|
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
|
||||||
msg.getResources().put(resourceType.resourceHash, 0);
|
msg.getResources().put(resourceType.hash, 0);
|
||||||
warehouse.resources.put(resourceType, oldAmount);
|
warehouse.resources.put(resourceType, oldAmount);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
warehouse.resources.put(resourceType, newAmount);
|
warehouse.resources.put(resourceType, newAmount);
|
||||||
depositRealmTaxes(taxer, resourceType, amount, warehouse);
|
depositRealmTaxes(taxer, resourceType, amount, warehouse);
|
||||||
|
mbEnums.ResourceType resource;
|
||||||
|
|
||||||
AddTransactionToWarehouse(warehouse, taxer.getObjectType(), taxer.getObjectUUID(), mbEnums.TransactionType.TAXRESOURCE, resourceType, amount);
|
AddTransactionToWarehouse(warehouse, taxer.getObjectType(), taxer.getObjectUUID(), mbEnums.TransactionType.TAXRESOURCE, resourceType, amount);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -429,7 +431,7 @@ public class Warehouse {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (addToInventory)
|
if (addToInventory)
|
||||||
if (!itemMan.hasRoomInventory(template.item_wt)) {
|
if (!itemMan.hasRoomInventory(template.item_wt * amount)) {
|
||||||
ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item.");
|
ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,11 +11,13 @@ package engine.powers;
|
|||||||
|
|
||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import engine.gameManager.PowersManager;
|
import engine.gameManager.PowersManager;
|
||||||
import engine.mbEnums;
|
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
import engine.mbEnums.SourceType;
|
import engine.mbEnums.SourceType;
|
||||||
import engine.mbEnums.StackType;
|
import engine.mbEnums.StackType;
|
||||||
import engine.objects.*;
|
import engine.objects.AbstractCharacter;
|
||||||
|
import engine.objects.AbstractWorldObject;
|
||||||
|
import engine.objects.PlayerBonuses;
|
||||||
|
import engine.objects.Runegate;
|
||||||
import engine.powers.poweractions.AbstractPowerAction;
|
import engine.powers.poweractions.AbstractPowerAction;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -242,23 +244,32 @@ public class ActionsBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Add blocked types here
|
//Add blocked types here
|
||||||
public boolean blocked(AbstractWorldObject awo, boolean vampDrain) {
|
public boolean blocked(AbstractWorldObject awo, PowersBase pb, int trains) {
|
||||||
//Check for immunities
|
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
||||||
if (AbstractCharacter.IsAbstractCharacter(awo)){
|
AbstractCharacter ac = (AbstractCharacter) awo;
|
||||||
AbstractCharacter pcTarget = (AbstractCharacter) awo;
|
PlayerBonuses bonus = ac.getBonuses();
|
||||||
PlayerBonuses bonus = pcTarget.getBonuses();
|
if (bonus == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
if(vampDrain)
|
//TODO make this more efficient then testing strings
|
||||||
return bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
|
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.STUN))
|
||||||
|
return true; //Currently stun immune. Skip stun
|
||||||
if ((this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly)) ||
|
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare))
|
||||||
(this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))) {
|
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;
|
return true;
|
||||||
}
|
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
|
||||||
|
// return true; //Currently shadowmantled. Skip heals
|
||||||
mbEnums.DamageType damageType = mbEnums.DamageType.getDamageType(this.stackType.toUpperCase());
|
else if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly))
|
||||||
return pcTarget.getResists().immuneTo(damageType);
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+208
-366
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
package engine.powers;
|
package engine.powers;
|
||||||
|
|
||||||
|
import engine.gameManager.DbManager;
|
||||||
import engine.gameManager.DispatchManager;
|
import engine.gameManager.DispatchManager;
|
||||||
import engine.gameManager.PowersManager;
|
import engine.gameManager.PowersManager;
|
||||||
import engine.job.JobContainer;
|
import engine.job.JobContainer;
|
||||||
@@ -25,60 +26,63 @@ import engine.net.client.ClientConnection;
|
|||||||
import engine.net.client.msg.ApplyEffectMsg;
|
import engine.net.client.msg.ApplyEffectMsg;
|
||||||
import engine.objects.AbstractCharacter;
|
import engine.objects.AbstractCharacter;
|
||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Item;
|
import engine.objects.Effect;
|
||||||
import engine.objects.PlayerCharacter;
|
import engine.objects.PlayerCharacter;
|
||||||
import engine.powers.effectmodifiers.*;
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import engine.util.Hasher;
|
|
||||||
import engine.wpak.data.ConditionEntry;
|
|
||||||
import engine.wpak.data.Effect;
|
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
public class EffectsBase {
|
public class EffectsBase {
|
||||||
private static final ConcurrentHashMap<String, String> itemEffectsByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
|
||||||
public static int NewID = 3000;
|
public static HashMap<Integer, HashSet<EffectSourceType>> effectSourceTypeMap = new HashMap<>();
|
||||||
public int UUID;
|
public static HashMap<String, HashSet<AbstractEffectModifier>> modifiersMap = new HashMap<>();
|
||||||
public String IDString;
|
public static HashMap<String, HashMap<String, ArrayList<String>>> OldEffectsMap = new HashMap<>();
|
||||||
// public String name;
|
public static HashMap<String, HashMap<String, ArrayList<String>>> NewEffectsMap = new HashMap<>();
|
||||||
public int token;
|
public static HashMap<String, HashMap<String, ArrayList<String>>> ChangedEffectsMap = new HashMap<>();
|
||||||
public float amount;
|
public static HashMap<String, HashSet<PowerFailCondition>> EffectFailConditions = new HashMap<>();
|
||||||
public float amountRamp;
|
public static HashMap<Integer, HashSet<mbEnums.DamageType>> EffectDamageTypes = new HashMap<>();
|
||||||
|
public static HashSet<AbstractEffectModifier> DefaultModifiers = new HashSet<>();
|
||||||
|
private static ConcurrentHashMap<String, String> itemEffectsByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||||
|
private static int NewID = 3000;
|
||||||
|
private int UUID;
|
||||||
|
private String IDString;
|
||||||
|
// private String name;
|
||||||
|
private int token;
|
||||||
|
private float amount;
|
||||||
|
private float amountRamp;
|
||||||
// flags
|
// flags
|
||||||
public boolean isItemEffect;
|
private boolean isItemEffect;
|
||||||
public boolean isSpireEffect;
|
private boolean isSpireEffect;
|
||||||
public boolean ignoreNoMod;
|
private boolean ignoreMod;
|
||||||
public boolean dontSave;
|
private boolean dontSave;
|
||||||
public boolean cancelOnAttack = false;
|
private boolean cancelOnAttack = false;
|
||||||
public boolean cancelOnAttackSwing = false;
|
private boolean cancelOnAttackSwing = false;
|
||||||
public boolean cancelOnCast = false;
|
private boolean cancelOnCast = false;
|
||||||
public boolean cancelOnCastSpell = false;
|
private boolean cancelOnCastSpell = false;
|
||||||
public boolean cancelOnEquipChange = false;
|
private boolean cancelOnEquipChange = false;
|
||||||
public boolean cancelOnLogout = false;
|
private boolean cancelOnLogout = false;
|
||||||
public boolean cancelOnMove = false;
|
private boolean cancelOnMove = false;
|
||||||
public boolean cancelOnNewCharm = false;
|
private boolean cancelOnNewCharm = false;
|
||||||
public boolean cancelOnSit = false;
|
private boolean cancelOnSit = false;
|
||||||
public boolean cancelOnTakeDamage = false;
|
private boolean cancelOnTakeDamage = false;
|
||||||
public boolean cancelOnTerritoryClaim = false;
|
private boolean cancelOnTerritoryClaim = false;
|
||||||
public boolean cancelOnUnEquip = false;
|
private boolean cancelOnUnEquip = false;
|
||||||
public boolean useRampAdd;
|
private boolean useRampAdd;
|
||||||
public boolean isPrefix = false; //used by items
|
private boolean isPrefix = false; //used by items
|
||||||
public boolean isSuffix = false; //used by items
|
private boolean isSuffix = false; //used by items
|
||||||
public String name = "";
|
private String name = "";
|
||||||
public float value = 0;
|
private float value = 0;
|
||||||
private ConcurrentHashMap<mbEnums.ResourceType, Integer> resourceCosts = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<mbEnums.ResourceType, Integer> resourceCosts = new ConcurrentHashMap<>();
|
||||||
|
private ConcurrentHashMap<String, Boolean> sourceTypes = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||||
//loaded values from parser
|
|
||||||
public HashSet<EffectSourceType> effectSources = new HashSet<>();
|
|
||||||
public HashSet<AbstractEffectModifier> effectModifiers = new HashSet<>();
|
|
||||||
public HashSet<PowerFailCondition> effectFailCondition = new HashSet<>();
|
|
||||||
|
|
||||||
public HashSet<mbEnums.DamageType> effectDamageTypes = new HashSet<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* No Table ID Constructor
|
* No Table ID Constructor
|
||||||
@@ -87,110 +91,6 @@ public class EffectsBase {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* EffectEntry Constructor
|
|
||||||
*/
|
|
||||||
|
|
||||||
public EffectsBase(Effect entry) {
|
|
||||||
this.IDString = entry.effect_id;
|
|
||||||
this.name = entry.effect_name;
|
|
||||||
this.token = Hasher.SBStringHash(entry.effect_name);
|
|
||||||
|
|
||||||
//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;
|
|
||||||
|
|
||||||
}
|
|
||||||
this.isItemEffect = entry.isItemEffect;
|
|
||||||
this.isSpireEffect = entry.isSpireEffect;
|
|
||||||
this.ignoreNoMod = entry.ignoreNoMod;
|
|
||||||
this.dontSave = entry.dontSave;
|
|
||||||
|
|
||||||
if (this.IDString.startsWith("PRE-"))
|
|
||||||
this.isPrefix = true;
|
|
||||||
else if (this.IDString.startsWith("SUF-"))
|
|
||||||
this.isSuffix = true;
|
|
||||||
|
|
||||||
//load effect modifiers
|
|
||||||
for (ModifierEntry mod : entry.mods)
|
|
||||||
this.effectModifiers.add(getCombinedModifiers(null, mod, this, mod.type));
|
|
||||||
|
|
||||||
//load sources
|
|
||||||
for (String source : entry.sources)
|
|
||||||
this.effectSources.add(EffectSourceType.GetEffectSourceType(source));
|
|
||||||
|
|
||||||
//load fail conditions
|
|
||||||
for (ConditionEntry condition : entry.conditions) {
|
|
||||||
PowerFailCondition failCondition = PowerFailCondition.valueOf(condition.condition);
|
|
||||||
this.effectFailCondition.add(failCondition);
|
|
||||||
loadFailConditions(failCondition, this, condition);
|
|
||||||
|
|
||||||
//add all damage types
|
|
||||||
if(!condition.damageTypes.isEmpty())
|
|
||||||
this.effectDamageTypes.addAll(condition.damageTypes);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void loadFailConditions(PowerFailCondition failCondition, EffectsBase eb, ConditionEntry entry) {
|
|
||||||
|
|
||||||
if (failCondition == null || eb == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (failCondition) {
|
|
||||||
|
|
||||||
case TakeDamage:
|
|
||||||
|
|
||||||
eb.cancelOnTakeDamage = true;
|
|
||||||
|
|
||||||
|
|
||||||
eb.amount = entry.arg;
|
|
||||||
eb.amountRamp = (float) entry.curveType.value;
|
|
||||||
eb.useRampAdd = (float) entry.curveType.value != 0;
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public EffectsBase(EffectsBase copyEffect, int newToken, String IDString) {
|
public EffectsBase(EffectsBase copyEffect, int newToken, String IDString) {
|
||||||
|
|
||||||
UUID = NewID++;
|
UUID = NewID++;
|
||||||
@@ -202,7 +102,7 @@ public class EffectsBase {
|
|||||||
int flags = 0;
|
int flags = 0;
|
||||||
this.isItemEffect = ((flags & 1) != 0) ? true : false;
|
this.isItemEffect = ((flags & 1) != 0) ? true : false;
|
||||||
this.isSpireEffect = ((flags & 2) != 0) ? true : false;
|
this.isSpireEffect = ((flags & 2) != 0) ? true : false;
|
||||||
this.ignoreNoMod = ((flags & 4) != 0) ? true : false;
|
this.ignoreMod = ((flags & 4) != 0) ? true : false;
|
||||||
this.dontSave = ((flags & 8) != 0) ? true : false;
|
this.dontSave = ((flags & 8) != 0) ? true : false;
|
||||||
|
|
||||||
if (this.IDString.startsWith("PRE-"))
|
if (this.IDString.startsWith("PRE-"))
|
||||||
@@ -217,7 +117,7 @@ public class EffectsBase {
|
|||||||
this.amountRamp = copyEffect.amountRamp;
|
this.amountRamp = copyEffect.amountRamp;
|
||||||
this.isItemEffect = copyEffect.isItemEffect;
|
this.isItemEffect = copyEffect.isItemEffect;
|
||||||
this.isSpireEffect = copyEffect.isSpireEffect;
|
this.isSpireEffect = copyEffect.isSpireEffect;
|
||||||
this.ignoreNoMod = copyEffect.ignoreNoMod;
|
this.ignoreMod = copyEffect.ignoreMod;
|
||||||
this.dontSave = copyEffect.dontSave;
|
this.dontSave = copyEffect.dontSave;
|
||||||
this.cancelOnAttack = copyEffect.cancelOnAttack;
|
this.cancelOnAttack = copyEffect.cancelOnAttack;
|
||||||
this.cancelOnAttackSwing = copyEffect.cancelOnAttackSwing;
|
this.cancelOnAttackSwing = copyEffect.cancelOnAttackSwing;
|
||||||
@@ -263,7 +163,7 @@ public class EffectsBase {
|
|||||||
int flags = rs.getInt("flags");
|
int flags = rs.getInt("flags");
|
||||||
this.isItemEffect = ((flags & 1) != 0) ? true : false;
|
this.isItemEffect = ((flags & 1) != 0) ? true : false;
|
||||||
this.isSpireEffect = ((flags & 2) != 0) ? true : false;
|
this.isSpireEffect = ((flags & 2) != 0) ? true : false;
|
||||||
this.ignoreNoMod = ((flags & 4) != 0) ? true : false;
|
this.ignoreMod = ((flags & 4) != 0) ? true : false;
|
||||||
this.dontSave = ((flags & 8) != 0) ? true : false;
|
this.dontSave = ((flags & 8) != 0) ? true : false;
|
||||||
|
|
||||||
if (this.IDString.startsWith("PRE-"))
|
if (this.IDString.startsWith("PRE-"))
|
||||||
@@ -273,6 +173,113 @@ public class EffectsBase {
|
|||||||
// getFailConditions();
|
// getFailConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void getFailConditions(HashMap<String, EffectsBase> effects) {
|
||||||
|
|
||||||
|
try (Connection connection = DbManager.getConnection();
|
||||||
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_failcondition WHERE powerOrEffect = 'Effect';")) {
|
||||||
|
|
||||||
|
ResultSet rs = preparedStatement.executeQuery();
|
||||||
|
|
||||||
|
PowerFailCondition failCondition = null;
|
||||||
|
|
||||||
|
while (rs.next()) {
|
||||||
|
String fail = rs.getString("type");
|
||||||
|
|
||||||
|
|
||||||
|
String IDString = rs.getString("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("damageType2");
|
||||||
|
String damageType3 = rs.getString("damageType3");
|
||||||
|
|
||||||
|
if (damageType1.isEmpty() && damageType2.isEmpty() && damageType3.isEmpty())
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (!EffectsBase.EffectDamageTypes.containsKey(eb.getToken()))
|
||||||
|
EffectsBase.EffectDamageTypes.put(eb.getToken(), new HashSet<>());
|
||||||
|
|
||||||
|
mbEnums.DamageType dt = mbEnums.DamageType.getDamageType(damageType1);
|
||||||
|
if (dt != null)
|
||||||
|
EffectsBase.EffectDamageTypes.get(eb.token).add(dt);
|
||||||
|
|
||||||
|
dt = mbEnums.DamageType.getDamageType(damageType2);
|
||||||
|
if (dt != null)
|
||||||
|
EffectsBase.EffectDamageTypes.get(eb.token).add(dt);
|
||||||
|
dt = mbEnums.DamageType.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static String getItemEffectsByName(String string) {
|
public static String getItemEffectsByName(String string) {
|
||||||
if (EffectsBase.itemEffectsByName.containsKey(string))
|
if (EffectsBase.itemEffectsByName.containsKey(string))
|
||||||
return EffectsBase.itemEffectsByName.get(string);
|
return EffectsBase.itemEffectsByName.get(string);
|
||||||
@@ -296,12 +303,14 @@ public class EffectsBase {
|
|||||||
|
|
||||||
public boolean damageTypeSpecific() {
|
public boolean damageTypeSpecific() {
|
||||||
|
|
||||||
return !this.effectDamageTypes.isEmpty();
|
return EffectsBase.EffectDamageTypes.containsKey(this.token);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsDamageType(mbEnums.DamageType dt) {
|
public boolean containsDamageType(mbEnums.DamageType dt) {
|
||||||
return this.effectDamageTypes.contains(dt);
|
if (!EffectsBase.EffectDamageTypes.containsKey(this.token))
|
||||||
|
return false;
|
||||||
|
return EffectsBase.EffectDamageTypes.get(this.token).contains(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUUID() {
|
public int getUUID() {
|
||||||
@@ -321,8 +330,32 @@ public class EffectsBase {
|
|||||||
this.token = token;
|
this.token = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConcurrentHashMap<String, Boolean> getSourceTypes() {
|
||||||
|
return this.sourceTypes;
|
||||||
|
}
|
||||||
|
|
||||||
public HashSet<AbstractEffectModifier> getModifiers() {
|
public HashSet<AbstractEffectModifier> getModifiers() {
|
||||||
return this.effectModifiers;
|
|
||||||
|
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() {
|
public boolean isPrefix() {
|
||||||
@@ -371,7 +404,7 @@ public class EffectsBase {
|
|||||||
float duration = ab.getDurationInSeconds(trains);
|
float duration = ab.getDurationInSeconds(trains);
|
||||||
if (pb.getToken() == 1672601862) {
|
if (pb.getToken() == 1672601862) {
|
||||||
|
|
||||||
engine.objects.Effect eff = awo.getEffects().get("DeathShroud");
|
Effect eff = awo.getEffects().get("DeathShroud");
|
||||||
|
|
||||||
|
|
||||||
if (eff != null) {
|
if (eff != null) {
|
||||||
@@ -606,6 +639,13 @@ public class EffectsBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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() {
|
public boolean cancelOnAttack() {
|
||||||
return this.cancelOnAttack;
|
return this.cancelOnAttack;
|
||||||
}
|
}
|
||||||
@@ -654,6 +694,16 @@ public class EffectsBase {
|
|||||||
return this.cancelOnUnEquip;
|
return this.cancelOnUnEquip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDamageTypes() {
|
||||||
|
String text = "";
|
||||||
|
if (!EffectsBase.EffectDamageTypes.containsKey(this.token))
|
||||||
|
return text;
|
||||||
|
for (mbEnums.DamageType type : EffectsBase.EffectDamageTypes.get(this.token)) {
|
||||||
|
text += type.name() + ' ';
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
@@ -663,220 +713,12 @@ public class EffectsBase {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AbstractEffectModifier getCombinedModifiers(AbstractEffectModifier abstractEffectModifier, ModifierEntry rs, EffectsBase effectBase, mbEnums.ModType modifier){
|
public float getValue() {
|
||||||
switch (modifier) {
|
return value;
|
||||||
case AdjustAboveDmgCap:
|
}
|
||||||
abstractEffectModifier = new AdjustAboveDmgCapEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Ambidexterity:
|
|
||||||
abstractEffectModifier = new AmbidexterityEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case AnimOverride:
|
|
||||||
break;
|
|
||||||
case ArmorPiercing:
|
|
||||||
abstractEffectModifier = new ArmorPiercingEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case AttackDelay:
|
|
||||||
abstractEffectModifier = new AttackDelayEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Attr:
|
|
||||||
abstractEffectModifier = new AttributeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case BlackMantle:
|
|
||||||
abstractEffectModifier = new BlackMantleEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case BladeTrails:
|
|
||||||
abstractEffectModifier = new BladeTrailsEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Block:
|
|
||||||
abstractEffectModifier = new BlockEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case BlockedPowerType:
|
|
||||||
abstractEffectModifier = new BlockedPowerTypeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case CannotAttack:
|
|
||||||
abstractEffectModifier = new CannotAttackEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case CannotCast:
|
|
||||||
abstractEffectModifier = new CannotCastEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case CannotMove:
|
|
||||||
abstractEffectModifier = new CannotMoveEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case CannotTrack:
|
|
||||||
abstractEffectModifier = new CannotTrackEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Charmed:
|
|
||||||
abstractEffectModifier = new CharmedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ConstrainedAmbidexterity:
|
|
||||||
abstractEffectModifier = new ConstrainedAmbidexterityEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case DamageCap:
|
|
||||||
abstractEffectModifier = new DamageCapEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case DamageShield:
|
|
||||||
abstractEffectModifier = new DamageShieldEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case DCV:
|
|
||||||
abstractEffectModifier = new DCVEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Dodge:
|
|
||||||
abstractEffectModifier = new DodgeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case DR:
|
|
||||||
abstractEffectModifier = new DREffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Durability:
|
|
||||||
abstractEffectModifier = new DurabilityEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ExclusiveDamageCap:
|
|
||||||
abstractEffectModifier = new ExclusiveDamageCapEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Fade:
|
|
||||||
abstractEffectModifier = new FadeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Fly:
|
|
||||||
abstractEffectModifier = new FlyEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Health:
|
|
||||||
abstractEffectModifier = new HealthEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case HealthFull:
|
|
||||||
abstractEffectModifier = new HealthFullEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case HealthRecoverRate:
|
|
||||||
abstractEffectModifier = new HealthRecoverRateEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case IgnoreDamageCap:
|
|
||||||
abstractEffectModifier = new IgnoreDamageCapEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case IgnorePassiveDefense:
|
|
||||||
abstractEffectModifier = new IgnorePassiveDefenseEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ImmuneTo:
|
|
||||||
abstractEffectModifier = new ImmuneToEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ImmuneToAttack:
|
|
||||||
abstractEffectModifier = new ImmuneToAttackEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ImmuneToPowers:
|
|
||||||
abstractEffectModifier = new ImmuneToPowersEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Invisible:
|
|
||||||
abstractEffectModifier = new InvisibleEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ItemName:
|
|
||||||
abstractEffectModifier = new ItemNameEffectModifier(rs);
|
|
||||||
if (((ItemNameEffectModifier) abstractEffectModifier).name.isEmpty())
|
|
||||||
break;
|
|
||||||
if (effectBase != null)
|
|
||||||
effectBase.setName((((ItemNameEffectModifier) abstractEffectModifier).name));
|
|
||||||
break;
|
|
||||||
case Mana:
|
|
||||||
abstractEffectModifier = new ManaEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ManaFull:
|
|
||||||
abstractEffectModifier = new ManaFullEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ManaRecoverRate:
|
|
||||||
abstractEffectModifier = new ManaRecoverRateEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case MaxDamage:
|
|
||||||
abstractEffectModifier = new MaxDamageEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case MeleeDamageModifier:
|
|
||||||
abstractEffectModifier = new MeleeDamageEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case MinDamage:
|
|
||||||
abstractEffectModifier = new MinDamageEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case NoMod:
|
|
||||||
abstractEffectModifier = new NoModEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case OCV:
|
|
||||||
abstractEffectModifier = new OCVEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Parry:
|
|
||||||
abstractEffectModifier = new ParryEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case PassiveDefense:
|
|
||||||
abstractEffectModifier = new PassiveDefenseEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case PowerCost:
|
|
||||||
abstractEffectModifier = new PowerCostEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case PowerCostHealth:
|
|
||||||
abstractEffectModifier = new PowerCostHealthEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case PowerDamageModifier:
|
|
||||||
abstractEffectModifier = new PowerDamageEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ProtectionFrom:
|
|
||||||
abstractEffectModifier = new ProtectionFromEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Resistance:
|
|
||||||
abstractEffectModifier = new ResistanceEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ScaleHeight:
|
|
||||||
abstractEffectModifier = new ScaleHeightEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ScaleWidth:
|
|
||||||
abstractEffectModifier = new ScaleWidthEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ScanRange:
|
|
||||||
abstractEffectModifier = new ScanRangeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case SeeInvisible:
|
|
||||||
abstractEffectModifier = new SeeInvisibleEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Silenced:
|
|
||||||
abstractEffectModifier = new SilencedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Skill:
|
|
||||||
abstractEffectModifier = new SkillEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Slay:
|
|
||||||
abstractEffectModifier = new SlayEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Speed:
|
|
||||||
abstractEffectModifier = new SpeedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case SpireBlock:
|
|
||||||
abstractEffectModifier = new SpireBlockEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Stamina:
|
|
||||||
abstractEffectModifier = new StaminaEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case StaminaFull:
|
|
||||||
abstractEffectModifier = new StaminaFullEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case StaminaRecoverRate:
|
|
||||||
abstractEffectModifier = new StaminaRecoverRateEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Stunned:
|
|
||||||
abstractEffectModifier = new StunnedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Value:
|
|
||||||
abstractEffectModifier = new ValueEffectModifier(rs);
|
|
||||||
if (effectBase != null) {
|
|
||||||
ValueEffectModifier valueEffect = (ValueEffectModifier) abstractEffectModifier;
|
|
||||||
effectBase.value = valueEffect.minMod;
|
|
||||||
Item.addEnchantValue(effectBase.getIDString(), (int)valueEffect.minMod);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case WeaponProc:
|
|
||||||
abstractEffectModifier = new WeaponProcEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case WeaponRange:
|
|
||||||
abstractEffectModifier = new WeaponRangeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case WeaponSpeed:
|
|
||||||
abstractEffectModifier = new WeaponSpeedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
public void setValue(float Value) {
|
||||||
return abstractEffectModifier;
|
this.value = Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -633,8 +633,15 @@ public class PowersBase {
|
|||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean enforceLore(){
|
public boolean ignoreLore(){
|
||||||
return this.powerCategory.equals(PowerCategoryType.SUMMON) || this.powerCategory.equals(PowerCategoryType.HEAL)|| this.powerCategory.equals(PowerCategoryType.BUFF);
|
switch(this.category){
|
||||||
|
case "HEAL":
|
||||||
|
case "BUFF":
|
||||||
|
case "DISPELL":
|
||||||
|
case "SUMMON":
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,9 +17,9 @@ import engine.objects.AbstractWorldObject;
|
|||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.powers.EffectsBase;
|
import engine.powers.EffectsBase;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
|
||||||
|
|
||||||
public abstract class AbstractEffectModifier {
|
public abstract class AbstractEffectModifier {
|
||||||
@@ -39,24 +39,22 @@ public abstract class AbstractEffectModifier {
|
|||||||
protected String string1;
|
protected String string1;
|
||||||
protected String string2;
|
protected String string2;
|
||||||
|
|
||||||
public AbstractEffectModifier(ResultSet rs){
|
public AbstractEffectModifier(ResultSet rs) throws SQLException {
|
||||||
|
|
||||||
}
|
this.UUID = rs.getInt("ID");
|
||||||
public AbstractEffectModifier(ModifierEntry mod) {
|
this.IDString = rs.getString("IDString");
|
||||||
|
this.effectType = rs.getString("modType");
|
||||||
this.IDString = mod.type.name();
|
this.modType = ModType.GetModType(this.effectType);
|
||||||
this.effectType = mod.type.name();
|
this.type = rs.getString("type").replace("\"", "");
|
||||||
this.modType = mod.type;
|
|
||||||
this.type = mod.type.name().replace("\"", "");
|
|
||||||
this.sourceType = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
|
this.sourceType = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
|
||||||
this.minMod = mod.min;
|
this.minMod = rs.getFloat("minMod");
|
||||||
this.maxMod = mod.max;
|
this.maxMod = rs.getFloat("maxMod");
|
||||||
this.percentMod = mod.percentage;
|
this.percentMod = rs.getFloat("percentMod");
|
||||||
this.ramp = (float) mod.compoundCurveType.value;
|
this.ramp = rs.getFloat("ramp");
|
||||||
this.useRampAdd = (float) mod.compoundCurveType.value != 0;
|
this.useRampAdd = (rs.getInt("useRampAdd") == 1) ? true : false;
|
||||||
|
|
||||||
this.string1 = mod.arg1;
|
this.string1 = rs.getString("string1");
|
||||||
this.string2 = mod.arg2;
|
this.string2 = rs.getString("string2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -19,7 +18,7 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
public class AdjustAboveDmgCapEffectModifier extends AbstractEffectModifier {
|
public class AdjustAboveDmgCapEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
public AdjustAboveDmgCapEffectModifier(ModifierEntry rs){
|
public AdjustAboveDmgCapEffectModifier(ResultSet rs) throws SQLException {
|
||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import engine.jobs.AbstractEffectJob;
|
|||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
import engine.mbEnums.SourceType;
|
import engine.mbEnums.SourceType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,7 +20,7 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
public class AmbidexterityEffectModifier extends AbstractEffectModifier {
|
public class AmbidexterityEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
public AmbidexterityEffectModifier(ModifierEntry rs) {
|
public AmbidexterityEffectModifier(ResultSet rs) throws SQLException {
|
||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -19,7 +18,7 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
public class ArmorPiercingEffectModifier extends AbstractEffectModifier {
|
public class ArmorPiercingEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
public ArmorPiercingEffectModifier(ModifierEntry rs){
|
public ArmorPiercingEffectModifier(ResultSet rs) throws SQLException {
|
||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,9 +21,6 @@ public class AttackDelayEffectModifier extends AbstractEffectModifier {
|
|||||||
public AttackDelayEffectModifier(ResultSet rs) throws SQLException {
|
public AttackDelayEffectModifier(ResultSet rs) throws SQLException {
|
||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
public AttackDelayEffectModifier(ModifierEntry rs){
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class AttributeEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AttributeEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ import engine.jobs.AbstractEffectJob;
|
|||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
import engine.mbEnums.SourceType;
|
import engine.mbEnums.SourceType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -27,10 +25,6 @@ public class BlackMantleEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlackMantleEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class BladeTrailsEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BladeTrailsEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class BlockEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ package engine.powers.effectmodifiers;
|
|||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BlockedPowerTypeEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
@@ -42,7 +37,7 @@ public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier {
|
|||||||
|
|
||||||
for (String effect : ac.getEffects().keySet()) {
|
for (String effect : ac.getEffects().keySet()) {
|
||||||
Effect eff = ac.getEffects().get(effect);
|
Effect eff = ac.getEffects().get(effect);
|
||||||
ModType toBlock = null;
|
ModType toBlock = ModType.None;
|
||||||
|
|
||||||
switch (this.sourceType) {
|
switch (this.sourceType) {
|
||||||
case Invisible:
|
case Invisible:
|
||||||
@@ -50,10 +45,6 @@ public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (toBlock == null)
|
|
||||||
return;
|
|
||||||
;
|
|
||||||
|
|
||||||
HashSet<AbstractEffectModifier> aemList = eff.getEffectModifiers();
|
HashSet<AbstractEffectModifier> aemList = eff.getEffectModifiers();
|
||||||
for (AbstractEffectModifier aem : aemList) {
|
for (AbstractEffectModifier aem : aemList) {
|
||||||
if (aem.modType.equals(toBlock)) {
|
if (aem.modType.equals(toBlock)) {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class CannotAttackEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CannotAttackEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ package engine.powers.effectmodifiers;
|
|||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,10 +23,6 @@ public class CannotCastEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CannotCastEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class CannotMoveEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CannotMoveEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class CannotTrackEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CannotTrackEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class CharmedEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public CharmedEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class ConstrainedAmbidexterityEffectModifier extends AbstractEffectModifi
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConstrainedAmbidexterityEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class DCVEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DCVEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class DREffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DREffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class DamageCapEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DamageCapEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import engine.jobs.AbstractEffectJob;
|
|||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.DamageShield;
|
import engine.powers.DamageShield;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class DamageShieldEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DamageShieldEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class DodgeEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DodgeEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class DurabilityEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public DurabilityEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class ExclusiveDamageCapEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ExclusiveDamageCapEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class FadeEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FadeEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class FlyEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public FlyEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import engine.net.AbstractNetMsg;
|
|||||||
import engine.net.client.msg.ModifyHealthKillMsg;
|
import engine.net.client.msg.ModifyHealthKillMsg;
|
||||||
import engine.net.client.msg.ModifyHealthMsg;
|
import engine.net.client.msg.ModifyHealthMsg;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -42,10 +41,6 @@ public class HealthEffectModifier extends AbstractEffectModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public HealthEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static float getMinDamage(float baseMin, float intelligence, float spirit, float focus) {
|
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));
|
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
|
return (float) ((int) (min + 0.5f)); //round to nearest whole number
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class HealthFullEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HealthFullEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class HealthRecoverRateEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HealthRecoverRateEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class IgnoreDamageCapEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IgnoreDamageCapEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class IgnorePassiveDefenseEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IgnorePassiveDefenseEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class ImmuneToAttackEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImmuneToAttackEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class ImmuneToEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImmuneToEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class ImmuneToPowersEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImmuneToPowersEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import engine.net.client.ClientConnection;
|
|||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.ActionsBase;
|
import engine.powers.ActionsBase;
|
||||||
import engine.powers.PowersBase;
|
import engine.powers.PowersBase;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -28,10 +27,6 @@ public class InvisibleEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public InvisibleEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import engine.objects.AbstractWorldObject;
|
|||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.powers.EffectsBase;
|
import engine.powers.EffectsBase;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -123,10 +122,6 @@ public class ItemNameEffectModifier extends AbstractEffectModifier {
|
|||||||
EffectsBase.addItemEffectsByName(n, IDString);
|
EffectsBase.addItemEffectsByName(n, IDString);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemNameEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ import engine.powers.ActionsBase;
|
|||||||
import engine.powers.poweractions.AbstractPowerAction;
|
import engine.powers.poweractions.AbstractPowerAction;
|
||||||
import engine.powers.poweractions.DamageOverTimePowerAction;
|
import engine.powers.poweractions.DamageOverTimePowerAction;
|
||||||
import engine.powers.poweractions.DirectDamagePowerAction;
|
import engine.powers.poweractions.DirectDamagePowerAction;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -44,10 +43,6 @@ public class ManaEffectModifier extends AbstractEffectModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ManaEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
if (awo == null) {
|
if (awo == null) {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class ManaFullEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ManaFullEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class ManaRecoverRateEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ManaRecoverRateEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class MaxDamageEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MaxDamageEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class MeleeDamageEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MeleeDamageEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class MinDamageEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MinDamageEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ package engine.powers.effectmodifiers;
|
|||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.mbEnums.GameObjectType;
|
import engine.mbEnums.GameObjectType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,10 +22,6 @@ public class NoModEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NoModEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
//TODO check if anything needs removed.
|
//TODO check if anything needs removed.
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class OCVEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OCVEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class ParryEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ParryEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class PassiveDefenseEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PassiveDefenseEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class PowerCostEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerCostEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class PowerCostHealthEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerCostHealthEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class PowerDamageEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerDamageEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class ProtectionFromEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProtectionFromEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,10 +21,6 @@ public class ResistanceEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResistanceEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.wpak.data.ModifierEntry;
|
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -25,10 +24,6 @@ public class ScaleHeightEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScaleHeightEffectModifier(ModifierEntry rs) {
|
|
||||||
super(rs);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user