Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 67c840c42c | |||
| 42544a137a | |||
| 062fef49a1 | |||
| bb23e761cd |
@@ -777,7 +777,7 @@ public enum BuildingManager {
|
|||||||
int newMeshUUID;
|
int newMeshUUID;
|
||||||
boolean success;
|
boolean success;
|
||||||
|
|
||||||
// If this building has no blueprint then set rank and exit immediatly.
|
// If this building has no blueprint then set rank and exit immediately.
|
||||||
|
|
||||||
if (building.blueprintUUID == 0 || building.getBlueprint() != null && building.getBlueprint().getBuildingGroup().equals(BuildingGroup.MINE)) {
|
if (building.blueprintUUID == 0 || building.getBlueprint() != null && building.getBlueprint().getBuildingGroup().equals(BuildingGroup.MINE)) {
|
||||||
building.rank = rank;
|
building.rank = rank;
|
||||||
|
|||||||
@@ -11,8 +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.PowersParser;
|
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
@@ -166,14 +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();
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3022,62 +3022,5 @@ public class mbEnums {
|
|||||||
PREFIX,
|
PREFIX,
|
||||||
SUFFIX;
|
SUFFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum PowerType {
|
|
||||||
None,
|
|
||||||
SPELL,
|
|
||||||
SKILL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum CostType {
|
|
||||||
NONE,
|
|
||||||
HEALTH,
|
|
||||||
MANA,
|
|
||||||
STAMINA;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum AreaType {
|
|
||||||
NONE,
|
|
||||||
SPHERE,
|
|
||||||
POINTBLANK,
|
|
||||||
LINE,
|
|
||||||
CONE,
|
|
||||||
WALL;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ExcludeType {
|
|
||||||
NONE,
|
|
||||||
CASTER,
|
|
||||||
GROUP,
|
|
||||||
GUILD,
|
|
||||||
NATION,
|
|
||||||
PLAYERS,
|
|
||||||
ALLBUTGROUP,
|
|
||||||
ALLBUTPETS;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum CastingModeType {
|
|
||||||
NONE,
|
|
||||||
COMBAT,
|
|
||||||
NONCOMBAT,
|
|
||||||
BOTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum TargetSelectType {
|
|
||||||
NONE,
|
|
||||||
CLICK,
|
|
||||||
GROUP,
|
|
||||||
GUILD,
|
|
||||||
NEARBYMOBS,
|
|
||||||
NAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum CategoryToPowerType {
|
|
||||||
None,
|
|
||||||
GreaterThanOrEqualTo,
|
|
||||||
GreaterThan,
|
|
||||||
Always
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -505,6 +505,11 @@ public class Building extends AbstractWorldObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (city.destroyed.get() == true) {
|
||||||
|
Logger.error(city.getName() + "derankk called on destroyed city");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bane = city.getBane();
|
bane = city.getBane();
|
||||||
|
|
||||||
// We need to collect the spires and shrines on the citygrid in case
|
// We need to collect the spires and shrines on the citygrid in case
|
||||||
@@ -592,6 +597,13 @@ public class Building extends AbstractWorldObject {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (city.destroyed.get() == true) {
|
||||||
|
Logger.error(city.getName() + "attempt to destroy a destroyed city");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
city.destroyed.set(true);
|
||||||
|
|
||||||
// Must remove a bane before considering destruction of a TOL
|
// Must remove a bane before considering destruction of a TOL
|
||||||
|
|
||||||
if (bane != null) {
|
if (bane != null) {
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ 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 {
|
||||||
@@ -80,6 +81,7 @@ 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 destroyed = new AtomicBoolean(false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResultSet Constructor
|
* ResultSet Constructor
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class WorldServer {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
WorldServer worldServer;
|
WorldServer worldServer;
|
||||||
|
|
||||||
|
|||||||
@@ -83,8 +83,6 @@ public class DestroyCityThread implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Building tol = null;
|
|
||||||
|
|
||||||
// Build list of buildings within this parent zone
|
// Build list of buildings within this parent zone
|
||||||
|
|
||||||
for (Building cityBuilding : cityZone.zoneBuildingSet) {
|
for (Building cityBuilding : cityZone.zoneBuildingSet) {
|
||||||
@@ -100,13 +98,6 @@ public class DestroyCityThread implements Runnable {
|
|||||||
if (cityBuilding.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.BANESTONE))
|
if (cityBuilding.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.BANESTONE))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// TOL is processed after all other structures in the city zone
|
|
||||||
|
|
||||||
if (cityBuilding.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.TOL)) {
|
|
||||||
tol = cityBuilding;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// All buildings are moved to a location relative
|
// All buildings are moved to a location relative
|
||||||
// to their new parent zone
|
// to their new parent zone
|
||||||
|
|
||||||
@@ -146,11 +137,6 @@ public class DestroyCityThread implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destroy the tol
|
|
||||||
|
|
||||||
if (tol != null)
|
|
||||||
BuildingManager.setRank(tol, -1);
|
|
||||||
|
|
||||||
if (city.realm != null)
|
if (city.realm != null)
|
||||||
city.realm.removeCity(city.getObjectUUID());
|
city.realm.removeCity(city.getObjectUUID());
|
||||||
|
|
||||||
|
|||||||
@@ -1,259 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak;
|
|
||||||
|
|
||||||
import engine.gameManager.ConfigManager;
|
|
||||||
import engine.mbEnums;
|
|
||||||
import engine.wpak.data.EffectEntry;
|
|
||||||
import engine.wpak.data.EffectModifier;
|
|
||||||
import org.pmw.tinylog.Logger;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class EffectsParser {
|
|
||||||
|
|
||||||
public static String effectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg";
|
|
||||||
public static HashMap<String, EffectEntry> effect_data = new HashMap<>();
|
|
||||||
private static final Pattern EFFECT_REGEX = Pattern.compile("(?<=EFFECTBEGIN)(.+?)(?=EFFECTEND)", Pattern.DOTALL);
|
|
||||||
private static final Pattern SOURCE_REGEX = Pattern.compile("(?<=SOURCEBEGIN)(.+?)(?=SOURCEEND)", Pattern.DOTALL);
|
|
||||||
private static final Pattern MODS_REGEX = Pattern.compile("(?<=MODSBEGIN)(.+?)(?=MODSEND)", Pattern.DOTALL);
|
|
||||||
private static final Pattern CONDITIONS_REGEX = Pattern.compile("(?<=CONDITIONBEGIN)(.+?)(?=CONDITIONEND)", Pattern.DOTALL);
|
|
||||||
private static final Pattern STRSPLIT_REGEX = Pattern.compile("([^\"]\\S*|\"[^\"]*\")\\s*"); // Regex ignores spaces within quotes
|
|
||||||
|
|
||||||
public static void parseWpakFile() {
|
|
||||||
|
|
||||||
// Read .wpak file from disk
|
|
||||||
|
|
||||||
byte[] fileData = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
fileData = Files.readAllBytes(Paths.get(effectsPath));
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
String fileContents = new String(fileData);
|
|
||||||
|
|
||||||
// Iterate over effect entries from .wpak data
|
|
||||||
|
|
||||||
Matcher matcher = EFFECT_REGEX.matcher(fileContents);
|
|
||||||
|
|
||||||
while (matcher.find()) {
|
|
||||||
EffectEntry effectEntry = parseEffectEntry(matcher.group());
|
|
||||||
effect_data.put(effectEntry.effect_id, effectEntry);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static EffectEntry parseEffectEntry(String effectData) {
|
|
||||||
|
|
||||||
EffectEntry effectEntry = new EffectEntry();
|
|
||||||
|
|
||||||
// Remove all lines that contain a # and leading/trailing blank lines
|
|
||||||
|
|
||||||
effectData = effectData.replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", "");
|
|
||||||
effectData = effectData.trim();
|
|
||||||
|
|
||||||
// Parse effect entry header
|
|
||||||
|
|
||||||
String firstLine;
|
|
||||||
ArrayList<String> effectHeader = new ArrayList<>();
|
|
||||||
|
|
||||||
// Some effects exist without sources/mods or conditions
|
|
||||||
// (ACID "MOB" 0)
|
|
||||||
|
|
||||||
if (effectData.indexOf('\n') > 0)
|
|
||||||
firstLine = effectData.substring(0, effectData.indexOf('\n'));
|
|
||||||
else
|
|
||||||
firstLine = effectData;
|
|
||||||
|
|
||||||
Matcher matcher = STRSPLIT_REGEX.matcher(firstLine);
|
|
||||||
|
|
||||||
while (matcher.find())
|
|
||||||
effectHeader.add(matcher.group().trim());
|
|
||||||
|
|
||||||
effectEntry.effect_id = effectHeader.get(0);
|
|
||||||
effectEntry.effect_name = effectHeader.get(1);
|
|
||||||
effectEntry.effect_name = effectEntry.effect_name.replaceAll("\"", "");
|
|
||||||
|
|
||||||
// Some effect mods have no icon
|
|
||||||
// (SEEINVIS-SHADE "See Invis")
|
|
||||||
|
|
||||||
if (effectHeader.size() == 3)
|
|
||||||
effectEntry.icon = Integer.parseInt(effectHeader.get(2));
|
|
||||||
else
|
|
||||||
effectEntry.icon = 0;
|
|
||||||
|
|
||||||
// Parse source entries
|
|
||||||
|
|
||||||
matcher = SOURCE_REGEX.matcher(effectData);
|
|
||||||
|
|
||||||
while (matcher.find())
|
|
||||||
effectEntry.sources.add(matcher.group().trim());
|
|
||||||
|
|
||||||
// Parse modifier entries
|
|
||||||
|
|
||||||
matcher = MODS_REGEX.matcher(effectData);
|
|
||||||
|
|
||||||
// Iterate effect entries from .wpak config data
|
|
||||||
|
|
||||||
while (matcher.find()) {
|
|
||||||
EffectModifier effectModifier = parseModEntry(matcher.group());
|
|
||||||
effectEntry.mods.add(effectModifier);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse Conditions
|
|
||||||
|
|
||||||
matcher = CONDITIONS_REGEX.matcher(effectData);
|
|
||||||
|
|
||||||
while (matcher.find()) {
|
|
||||||
String[] conditions = matcher.group().trim().split("\n");
|
|
||||||
|
|
||||||
for (String condition : conditions) {
|
|
||||||
String[] parameters = condition.trim().split("\\s+");
|
|
||||||
effectEntry.conditions.put(parameters[0], Float.parseFloat(parameters[1]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return effectEntry;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static EffectModifier parseModEntry(String modData) {
|
|
||||||
|
|
||||||
EffectModifier effectModifier = new EffectModifier();
|
|
||||||
|
|
||||||
String[] modEntries = modData.trim().split("\n");
|
|
||||||
|
|
||||||
for (String modEntry : modEntries) {
|
|
||||||
|
|
||||||
ArrayList<String> modValues = new ArrayList<>();
|
|
||||||
Matcher matcher = STRSPLIT_REGEX.matcher(modEntry.trim());
|
|
||||||
|
|
||||||
while (matcher.find())
|
|
||||||
modValues.add(matcher.group().trim());
|
|
||||||
|
|
||||||
effectModifier.type = mbEnums.ModType.valueOf(modValues.get(0).trim());
|
|
||||||
|
|
||||||
switch (effectModifier.type) {
|
|
||||||
case BladeTrails: // No parm modifiers
|
|
||||||
case ImmuneToAttack:
|
|
||||||
case ImmuneToPowers:
|
|
||||||
case Ambidexterity:
|
|
||||||
case Silenced:
|
|
||||||
case IgnorePassiveDefense:
|
|
||||||
case Stunned:
|
|
||||||
case PowerCostHealth:
|
|
||||||
case Charmed:
|
|
||||||
case Fly:
|
|
||||||
case CannotMove:
|
|
||||||
case CannotTrack:
|
|
||||||
case CannotAttack:
|
|
||||||
case CannotCast:
|
|
||||||
case SpireBlock:
|
|
||||||
case Invisible:
|
|
||||||
case SeeInvisible:
|
|
||||||
break;
|
|
||||||
case AnimOverride:
|
|
||||||
effectModifier.min = Float.parseFloat(modValues.get(1).trim());
|
|
||||||
effectModifier.max = Float.parseFloat(modValues.get(2).trim());
|
|
||||||
break;
|
|
||||||
case Health:
|
|
||||||
case Mana:
|
|
||||||
case Stamina:
|
|
||||||
effectModifier.min = Float.parseFloat(modValues.get(1).trim());
|
|
||||||
effectModifier.max = Float.parseFloat(modValues.get(2).trim());
|
|
||||||
effectModifier.scale = Float.parseFloat(modValues.get(3).trim());
|
|
||||||
// Parameter 4 is always 0.
|
|
||||||
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim());
|
|
||||||
effectModifier.arg1 = modValues.get(6).trim();
|
|
||||||
break;
|
|
||||||
case Attr:
|
|
||||||
case Resistance:
|
|
||||||
case Skill:
|
|
||||||
case HealthRecoverRate:
|
|
||||||
case ManaRecoverRate:
|
|
||||||
case StaminaRecoverRate:
|
|
||||||
case DamageShield:
|
|
||||||
case HealthFull:
|
|
||||||
case ManaFull:
|
|
||||||
case StaminaFull:
|
|
||||||
case Slay:
|
|
||||||
case Fade:
|
|
||||||
case Durability:
|
|
||||||
effectModifier.min = Float.parseFloat(modValues.get(1).trim());
|
|
||||||
effectModifier.scale = Float.parseFloat(modValues.get(2).trim());
|
|
||||||
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim());
|
|
||||||
|
|
||||||
if (modValues.size() > 4)
|
|
||||||
effectModifier.arg1 = modValues.get(4).trim(); // Some HeathFull entries do not have an argument
|
|
||||||
break;
|
|
||||||
case MeleeDamageModifier:
|
|
||||||
case OCV:
|
|
||||||
case DCV:
|
|
||||||
case AttackDelay:
|
|
||||||
case AdjustAboveDmgCap:
|
|
||||||
case DamageCap:
|
|
||||||
case ArmorPiercing:
|
|
||||||
case Speed:
|
|
||||||
case PowerDamageModifier:
|
|
||||||
case DR:
|
|
||||||
case PassiveDefense:
|
|
||||||
case MaxDamage:
|
|
||||||
case Value:
|
|
||||||
case WeaponSpeed:
|
|
||||||
case MinDamage:
|
|
||||||
case PowerCost:
|
|
||||||
case Block:
|
|
||||||
case Parry:
|
|
||||||
case Dodge:
|
|
||||||
case ScanRange:
|
|
||||||
case ScaleHeight:
|
|
||||||
case ScaleWidth:
|
|
||||||
case WeaponRange:
|
|
||||||
effectModifier.min = Float.parseFloat(modValues.get(1).trim());
|
|
||||||
effectModifier.scale = Float.parseFloat(modValues.get(2).trim());
|
|
||||||
effectModifier.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(3).trim());
|
|
||||||
break;
|
|
||||||
case ItemName:
|
|
||||||
case BlockedPowerType:
|
|
||||||
case ImmuneTo:
|
|
||||||
case BlackMantle:
|
|
||||||
effectModifier.arg1 = modValues.get(1).trim();
|
|
||||||
|
|
||||||
// Some BlockedPowerType entries have only one argument
|
|
||||||
|
|
||||||
if (modValues.size() > 2)
|
|
||||||
effectModifier.arg2 = modValues.get(2).trim();
|
|
||||||
break;
|
|
||||||
case NoMod:
|
|
||||||
case ConstrainedAmbidexterity:
|
|
||||||
case ProtectionFrom:
|
|
||||||
case ExclusiveDamageCap:
|
|
||||||
case IgnoreDamageCap:
|
|
||||||
effectModifier.arg1 = modValues.get(1).trim();
|
|
||||||
break;
|
|
||||||
case WeaponProc:
|
|
||||||
effectModifier.min = Float.parseFloat(modValues.get(1).trim());
|
|
||||||
effectModifier.arg1 = modValues.get(2).trim();
|
|
||||||
effectModifier.scale = Float.parseFloat(modValues.get(3).trim());
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Logger.error("Unhandled type: " + effectModifier.type);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return effectModifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak;
|
|
||||||
|
|
||||||
import engine.gameManager.ConfigManager;
|
|
||||||
import engine.wpak.data.PowerActionEntry;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class PowerActionParser {
|
|
||||||
private static final Pattern STRSPLIT_REGEX = Pattern.compile("([^\"]\\S*|\"[^\"]*\")\\s*");
|
|
||||||
private static final Pattern POWER_ACTION_REGEX = Pattern.compile("(?<=POWERACTIONBEGIN)(.+?)(?=POWERACTIONEND)", Pattern.DOTALL);
|
|
||||||
private static final String powerActionPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/PowerActions.cfg";
|
|
||||||
|
|
||||||
public static void parseWpakFile() {
|
|
||||||
|
|
||||||
// Read .wpak file from disk
|
|
||||||
|
|
||||||
byte[] fileData;
|
|
||||||
|
|
||||||
try {
|
|
||||||
fileData = Files.readAllBytes(Paths.get(powerActionPath));
|
|
||||||
} catch (
|
|
||||||
IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
String fileContents = new String(fileData);
|
|
||||||
|
|
||||||
// Iterate over power entries from .wpak data
|
|
||||||
|
|
||||||
Matcher matcher = POWER_ACTION_REGEX.matcher(fileContents);
|
|
||||||
|
|
||||||
while (matcher.find()) {
|
|
||||||
|
|
||||||
PowerActionEntry powerActionEntry = parsePowerActionEntry(matcher.group().trim());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static PowerActionEntry parsePowerActionEntry(String powerActionData) {
|
|
||||||
|
|
||||||
PowerActionEntry powerActionEntry = new PowerActionEntry();
|
|
||||||
|
|
||||||
return powerActionEntry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,316 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak;
|
|
||||||
|
|
||||||
import engine.gameManager.ConfigManager;
|
|
||||||
import engine.mbEnums;
|
|
||||||
import engine.wpak.data.*;
|
|
||||||
import org.pmw.tinylog.Logger;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class PowersParser {
|
|
||||||
|
|
||||||
private static final Pattern POWER_REGEX = Pattern.compile("(?<=POWERBEGIN)(.+?)(?=POWEREND)", Pattern.DOTALL);
|
|
||||||
private static final Pattern STRSPLIT_REGEX = Pattern.compile("([^\"]\\S*|\"[^\"]*\")\\s*");
|
|
||||||
private static final Pattern CONDITION_REGEX = Pattern.compile("(?<=CONDITIONBEGIN)(.+?)(?=CONDITIONEND)", Pattern.DOTALL);
|
|
||||||
private static final String powersPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Powers.cfg";
|
|
||||||
|
|
||||||
public static void parseWpakFile() {
|
|
||||||
|
|
||||||
// Read .wpak file from disk
|
|
||||||
|
|
||||||
byte[] fileData;
|
|
||||||
|
|
||||||
try {
|
|
||||||
fileData = Files.readAllBytes(Paths.get(powersPath));
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
String fileContents = new String(fileData);
|
|
||||||
|
|
||||||
// Iterate over power entries from .wpak data
|
|
||||||
|
|
||||||
Matcher matcher = POWER_REGEX.matcher(fileContents);
|
|
||||||
|
|
||||||
while (matcher.find()) {
|
|
||||||
|
|
||||||
PowerEntry powerEntry = parsePowerEntry(matcher.group().trim());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static PowerEntry parsePowerEntry(String powerData) {
|
|
||||||
|
|
||||||
PowerEntry powerEntry = new PowerEntry();
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
StringBuilder conditionString = new StringBuilder();
|
|
||||||
StringBuilder powerString = new StringBuilder();
|
|
||||||
|
|
||||||
int endPos = 0;
|
|
||||||
|
|
||||||
// Separate out any conditions from the power data
|
|
||||||
|
|
||||||
Matcher matcher = CONDITION_REGEX.matcher(powerData);
|
|
||||||
|
|
||||||
while (matcher.find()) {
|
|
||||||
conditionString.append(matcher.group().trim());
|
|
||||||
powerString.append(powerData, endPos, matcher.start());
|
|
||||||
endPos = matcher.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
powerString.append(powerData.substring(endPos));
|
|
||||||
|
|
||||||
// Cleanup dangling tags and lines that contain a # and leading/trailing blank lines
|
|
||||||
|
|
||||||
powerString = new StringBuilder(powerString.toString().replaceAll("CONDITIONBEGINCONDITIONEND", ""));
|
|
||||||
powerString = new StringBuilder(powerString.toString().replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", ""));
|
|
||||||
|
|
||||||
conditionString = new StringBuilder(conditionString.toString().replaceAll("(?m)^(\\s*#.*|\\s*)\r?\n?", ""));
|
|
||||||
|
|
||||||
// Parse header line in power data
|
|
||||||
|
|
||||||
String[] lineData = powerString.toString().trim().split("\n");
|
|
||||||
ArrayList<String> powerHeader = new ArrayList<>();
|
|
||||||
|
|
||||||
String headerString = lineData[0];
|
|
||||||
headerString = headerString.replace("\n", " ");
|
|
||||||
|
|
||||||
matcher = STRSPLIT_REGEX.matcher(headerString);
|
|
||||||
|
|
||||||
while (matcher.find())
|
|
||||||
powerHeader.add(matcher.group().trim());
|
|
||||||
|
|
||||||
java.util.Iterator<String> iterator = powerHeader.iterator();
|
|
||||||
|
|
||||||
powerEntry.power_id = iterator.next();
|
|
||||||
powerEntry.power = iterator.next().replaceAll("\"", "");
|
|
||||||
|
|
||||||
PowerData power = new PowerData();
|
|
||||||
power.power_type = mbEnums.PowerType.valueOf(iterator.next());
|
|
||||||
power.icon = Integer.parseInt(iterator.next());
|
|
||||||
power.powerBase = iterator.next().replaceAll("\"", "");
|
|
||||||
powerEntry.powers.add(power);
|
|
||||||
|
|
||||||
String nextValue = iterator.next();
|
|
||||||
|
|
||||||
// Account for second definition
|
|
||||||
|
|
||||||
if (nextValue.equals("SPELL") || nextValue.equals("SKILL")) {
|
|
||||||
power = new PowerData();
|
|
||||||
power.power_type = mbEnums.PowerType.valueOf(nextValue);
|
|
||||||
power.icon = Integer.parseInt(iterator.next());
|
|
||||||
power.powerBase = iterator.next().replaceAll("\"", "");
|
|
||||||
powerEntry.powers.add(power);
|
|
||||||
powerEntry.target_type = mbEnums.PowerTargetType.valueOf(iterator.next());
|
|
||||||
} else
|
|
||||||
powerEntry.target_type = mbEnums.PowerTargetType.valueOf(nextValue);
|
|
||||||
|
|
||||||
powerEntry.range = Integer.parseInt(iterator.next());
|
|
||||||
powerEntry.areaType = mbEnums.AreaType.valueOf(iterator.next());
|
|
||||||
powerEntry.areaRange = Integer.parseInt(iterator.next());
|
|
||||||
powerEntry.excludeType = mbEnums.ExcludeType.valueOf(iterator.next());
|
|
||||||
powerEntry.costType = mbEnums.CostType.valueOf(iterator.next());
|
|
||||||
powerEntry.cost = Float.parseFloat(iterator.next());
|
|
||||||
powerEntry.difficulty = Float.parseFloat(iterator.next());
|
|
||||||
powerEntry.precision = Float.parseFloat(iterator.next());
|
|
||||||
powerEntry.init_time = Float.parseFloat(iterator.next().replaceAll("(\\.0)+$", ""));
|
|
||||||
powerEntry.release_time = Float.parseFloat(iterator.next());
|
|
||||||
powerEntry.recycle_time = Float.parseFloat(iterator.next());
|
|
||||||
powerEntry.hitRollYN = Integer.parseInt(iterator.next());
|
|
||||||
powerEntry.castingMode = mbEnums.CastingModeType.valueOf(iterator.next());
|
|
||||||
powerEntry.initAmin = Integer.parseInt(iterator.next());
|
|
||||||
powerEntry.releaseAnim = Integer.parseInt(iterator.next());
|
|
||||||
powerEntry.targetSelect = mbEnums.TargetSelectType.valueOf(iterator.next());
|
|
||||||
|
|
||||||
// Process key value pairs after header
|
|
||||||
|
|
||||||
iterator = Arrays.stream(lineData).iterator();
|
|
||||||
iterator.next(); // Ignore header
|
|
||||||
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
|
|
||||||
String lineValue = iterator.next();
|
|
||||||
String[] lineValues = lineValue.split("=");
|
|
||||||
String key = lineValues[0].trim();
|
|
||||||
ActionEntry actionEntry;
|
|
||||||
String[] arguments;
|
|
||||||
Matcher matcher1;
|
|
||||||
ArrayList<String> args;
|
|
||||||
|
|
||||||
switch (key) {
|
|
||||||
case "ACTION":
|
|
||||||
actionEntry = new ActionEntry();
|
|
||||||
arguments = lineValues[1].trim().split("\\s+");
|
|
||||||
|
|
||||||
if (powerEntry.power_id.equals("HNT-050"))
|
|
||||||
Logger.error("debug");
|
|
||||||
|
|
||||||
actionEntry.effect_id = arguments[0];
|
|
||||||
actionEntry.minTrains = Integer.parseInt(arguments[1]);
|
|
||||||
actionEntry.maxTrains = Integer.parseInt(arguments[2]);
|
|
||||||
actionEntry.duration = Float.parseFloat(arguments[3]);
|
|
||||||
actionEntry.curve = mbEnums.CompoundCurveType.valueOf(arguments[4]);
|
|
||||||
actionEntry.stackingCategory = arguments[5];
|
|
||||||
actionEntry.stackingPriority = Integer.parseInt(arguments[6]);
|
|
||||||
actionEntry.categoryToPower = mbEnums.CategoryToPowerType.valueOf(arguments[7]);
|
|
||||||
powerEntry.actionEntries.add(actionEntry);
|
|
||||||
break;
|
|
||||||
case "MaxLevel":
|
|
||||||
powerEntry.maxLevel = Integer.parseInt(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "HateValue":
|
|
||||||
arguments = lineValues[1].trim().split("\\s+");
|
|
||||||
powerEntry.hateValue = Integer.parseInt(arguments[0]);
|
|
||||||
|
|
||||||
// Not all entries have a curve. Defaults to DefaultFlat;
|
|
||||||
|
|
||||||
if (arguments.length > 1)
|
|
||||||
powerEntry.hateCurve = mbEnums.CompoundCurveType.valueOf(arguments[1]);
|
|
||||||
break;
|
|
||||||
case "LOOPANIMID":
|
|
||||||
powerEntry.loopAnimID = Integer.parseInt(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "GRANTOVERRIDEVAR":
|
|
||||||
powerEntry.grantOverrideVar = lineValues[1].trim();
|
|
||||||
break;
|
|
||||||
case "DESCRIPTION":
|
|
||||||
powerEntry.description.add(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "CATEGORY":
|
|
||||||
powerEntry.category = lineValues[1].trim();
|
|
||||||
break;
|
|
||||||
case "CURVE":
|
|
||||||
arguments = lineValues[1].trim().split("\\s+");
|
|
||||||
powerEntry.curves.put(arguments[0], mbEnums.CompoundCurveType.valueOf(arguments[1]));
|
|
||||||
break;
|
|
||||||
case "EQPREREQ":
|
|
||||||
EquipmentPreReq equipmentPreReq = new EquipmentPreReq();
|
|
||||||
matcher1 = STRSPLIT_REGEX.matcher(lineValues[1].trim());
|
|
||||||
args = new ArrayList<>();
|
|
||||||
|
|
||||||
while (matcher1.find())
|
|
||||||
args.add(matcher1.group().trim());
|
|
||||||
|
|
||||||
equipmentPreReq.slot = mbEnums.EquipSlotType.valueOf(args.get(0));
|
|
||||||
equipmentPreReq.skill = args.get(1).replaceAll("\"", "");
|
|
||||||
equipmentPreReq.level = Integer.parseInt(args.get(2));
|
|
||||||
powerEntry.equipmentPreReq = equipmentPreReq;
|
|
||||||
break;
|
|
||||||
case "CANCASTWHILEMOVING":
|
|
||||||
powerEntry.canCastWhileMoving = Boolean.parseBoolean(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "CANCASTWHILEFLYING":
|
|
||||||
powerEntry.canCastWhileFlying = Boolean.parseBoolean(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "BLADETRAILS":
|
|
||||||
powerEntry.bladeTrails = Boolean.parseBoolean(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "EFFECTPREREQ":
|
|
||||||
EffectDescription effectPreReq = new EffectDescription();
|
|
||||||
arguments = lineValues[1].trim().split("\\s+");
|
|
||||||
effectPreReq.effect_id = arguments[9];
|
|
||||||
effectPreReq.level = Integer.parseInt(arguments[1]);
|
|
||||||
effectPreReq.message = arguments[2];
|
|
||||||
powerEntry.effectPreReqs.add(effectPreReq);
|
|
||||||
break;
|
|
||||||
case "MONSTERTYPERESTRICTS":
|
|
||||||
arguments = lineValues[1].trim().split("\\s+");
|
|
||||||
for (String restriction : arguments)
|
|
||||||
powerEntry.monsterRestricts.add(mbEnums.MonsterType.valueOf(restriction.trim()));
|
|
||||||
break;
|
|
||||||
case "MONSTERTYPEPREREQS":
|
|
||||||
arguments = lineValues[1].trim().split("\\s+");
|
|
||||||
for (String restriction : arguments)
|
|
||||||
powerEntry.monsterPrereqs.add(mbEnums.MonsterType.valueOf(restriction.trim()));
|
|
||||||
break;
|
|
||||||
case "SHOULDCHECKPATH":
|
|
||||||
powerEntry.shouldCheckPath = Boolean.parseBoolean(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "STICKY":
|
|
||||||
powerEntry.sticky = Boolean.parseBoolean(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "PULSEINFO":
|
|
||||||
arguments = lineValues[1].trim().split("\\s+");
|
|
||||||
powerEntry.pulseCycle = Integer.parseInt(arguments[0]);
|
|
||||||
powerEntry.pulseDuration = Integer.parseInt(arguments[1]);
|
|
||||||
break;
|
|
||||||
case "MAXNUMMOBTARGETS":
|
|
||||||
powerEntry.maxMobTargets = Integer.parseInt(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "MAXNUMPLAYERTARGETS":
|
|
||||||
powerEntry.maxPlayerTargets = Integer.parseInt(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "ISADMINPOWER":
|
|
||||||
powerEntry.isAdminPower = Boolean.parseBoolean(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "ISPROJECTILE":
|
|
||||||
powerEntry.isProjectile = Boolean.parseBoolean(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "CASTERSPULSEPARTICLE":
|
|
||||||
powerEntry.casterPulseParticle = Integer.parseInt(lineValues[1].trim());
|
|
||||||
break;
|
|
||||||
case "TARGETEFFECTPREREQS_ORED":
|
|
||||||
EffectDescription preReq = new EffectDescription();
|
|
||||||
arguments = lineValues[1].trim().split("\\s+");
|
|
||||||
preReq.effect_id = arguments[0];
|
|
||||||
preReq.level = Integer.parseInt(arguments[1]);
|
|
||||||
powerEntry.targetEffectPrereqs.add(preReq);
|
|
||||||
break;
|
|
||||||
case "SOUNDS": // Values not parsed
|
|
||||||
case "APPLYDAMAGESELF":
|
|
||||||
case "APPLYDAMAGECASTER":
|
|
||||||
case "APPLYDAMAGEOTHER":
|
|
||||||
case "APPLYDAMAGETARGET":
|
|
||||||
case "APPLYEFFECTSELF":
|
|
||||||
case "APPLYEFFECTOTHER":
|
|
||||||
case "APPLYEFFECTCASTER":
|
|
||||||
case "APPLYEFFECTTARGET":
|
|
||||||
case "FIZZLEOTHER":
|
|
||||||
case "FIZZLESELF":
|
|
||||||
case "INITSTRING":
|
|
||||||
case "SUCCESSOTHER":
|
|
||||||
case "SUCCESSSELF":
|
|
||||||
case "WEAROFFEFFECTOTHER":
|
|
||||||
case "WEAROFFEFFECTSELF":
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Logger.error("Unhandled variable type:" + key + " for power: " + powerEntry.power_id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse power conditions
|
|
||||||
|
|
||||||
if (conditionString.toString().isEmpty() == false) {
|
|
||||||
String[] conditions = conditionString.toString().split("\n");
|
|
||||||
|
|
||||||
for (String condition : conditions) {
|
|
||||||
String[] parameters = condition.trim().split("\\s+");
|
|
||||||
powerEntry.conditions.put(parameters[0], Float.parseFloat(parameters[1]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(powerEntry.power_id + " " + e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return powerEntry;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak.data;
|
|
||||||
|
|
||||||
import engine.mbEnums;
|
|
||||||
|
|
||||||
public class ActionEntry {
|
|
||||||
|
|
||||||
public String effect_id;
|
|
||||||
public int minTrains;
|
|
||||||
public int maxTrains;
|
|
||||||
public float duration;
|
|
||||||
public String stackingCategory;
|
|
||||||
public mbEnums.CompoundCurveType curve;
|
|
||||||
public int stackingPriority;
|
|
||||||
public mbEnums.CategoryToPowerType categoryToPower;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak.data;
|
|
||||||
|
|
||||||
public class EffectDescription {
|
|
||||||
public String effect_id;
|
|
||||||
public int level;
|
|
||||||
public String message;
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak.data;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
|
||||||
|
|
||||||
public class EffectEntry {
|
|
||||||
public String effect_id;
|
|
||||||
public String effect_name;
|
|
||||||
public int icon;
|
|
||||||
public HashSet<String> sources = new HashSet<>();
|
|
||||||
public ArrayList<EffectModifier> mods = new ArrayList<>();
|
|
||||||
public HashMap<String, Float> conditions = new HashMap<>();
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak.data;
|
|
||||||
|
|
||||||
import engine.mbEnums;
|
|
||||||
|
|
||||||
public class EffectModifier {
|
|
||||||
public mbEnums.ModType type;
|
|
||||||
public float min;
|
|
||||||
public float max;
|
|
||||||
public float scale;
|
|
||||||
public mbEnums.CompoundCurveType compoundCurveType;
|
|
||||||
public String arg1; // ItemName "Masterwork" ""
|
|
||||||
public String arg2; // ItemName "" "of the Defender"
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak.data;
|
|
||||||
|
|
||||||
import engine.mbEnums;
|
|
||||||
|
|
||||||
public class EquipmentPreReq {
|
|
||||||
|
|
||||||
public mbEnums.EquipSlotType slot;
|
|
||||||
public String skill;
|
|
||||||
public int level;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak.data;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public class PowerActionEntry {
|
|
||||||
|
|
||||||
public String action_id;
|
|
||||||
public String action_type;
|
|
||||||
public ArrayList<EffectDescription> effects;
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak.data;
|
|
||||||
|
|
||||||
import engine.mbEnums;
|
|
||||||
|
|
||||||
public class PowerData {
|
|
||||||
public mbEnums.PowerType power_type;
|
|
||||||
public int icon;
|
|
||||||
public String powerBase;
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2024
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
package engine.wpak.data;
|
|
||||||
|
|
||||||
import engine.mbEnums;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.EnumSet;
|
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
public class PowerEntry {
|
|
||||||
public String power_id;
|
|
||||||
public String power;
|
|
||||||
public ArrayList<PowerData> powers = new ArrayList<>();
|
|
||||||
public mbEnums.PowerTargetType target_type;
|
|
||||||
public int range;
|
|
||||||
public mbEnums.AreaType areaType;
|
|
||||||
public int areaRange;
|
|
||||||
public mbEnums.ExcludeType excludeType;
|
|
||||||
public mbEnums.CostType costType;
|
|
||||||
public float cost;
|
|
||||||
public float difficulty;
|
|
||||||
public float precision;
|
|
||||||
public float init_time;
|
|
||||||
public float release_time;
|
|
||||||
public float recycle_time;
|
|
||||||
public int hitRollYN;
|
|
||||||
public mbEnums.CastingModeType castingMode;
|
|
||||||
public int initAmin;
|
|
||||||
public int releaseAnim;
|
|
||||||
public mbEnums.TargetSelectType targetSelect;
|
|
||||||
|
|
||||||
// Additional key/value type power entries
|
|
||||||
|
|
||||||
public ArrayList<ActionEntry> actionEntries = new ArrayList<>();
|
|
||||||
public int maxLevel;
|
|
||||||
public int hateValue;
|
|
||||||
public mbEnums.CompoundCurveType hateCurve = mbEnums.CompoundCurveType.DefaultFlat;
|
|
||||||
public int loopAnimID;
|
|
||||||
public String grantOverrideVar;
|
|
||||||
public ArrayList<String> description = new ArrayList<>();
|
|
||||||
public HashMap<String, mbEnums.CompoundCurveType> curves = new HashMap<>();
|
|
||||||
public String category;
|
|
||||||
public boolean canCastWhileMoving = false;
|
|
||||||
public boolean bladeTrails = false;
|
|
||||||
public ArrayList<EffectDescription> effectPreReqs = new ArrayList<>();
|
|
||||||
public EquipmentPreReq equipmentPreReq;
|
|
||||||
public EnumSet<mbEnums.MonsterType> monsterRestricts = EnumSet.noneOf(mbEnums.MonsterType.class);
|
|
||||||
public EnumSet<mbEnums.MonsterType> monsterPrereqs = EnumSet.noneOf(mbEnums.MonsterType.class);
|
|
||||||
public boolean shouldCheckPath = false;
|
|
||||||
public boolean sticky = false;
|
|
||||||
public int pulseCycle;
|
|
||||||
public int pulseDuration;
|
|
||||||
public int maxMobTargets;
|
|
||||||
public int maxPlayerTargets;
|
|
||||||
public boolean isAdminPower = false;
|
|
||||||
public int casterPulseParticle;
|
|
||||||
public ArrayList<EffectDescription> targetEffectPrereqs = new ArrayList<>();
|
|
||||||
public boolean canCastWhileFlying = false;
|
|
||||||
public boolean isProjectile = false;
|
|
||||||
public HashMap<String, Float> conditions = new HashMap<>();
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user