Compare commits
351 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 74b1994f5e | |||
| dfa646d828 | |||
| 668b61b734 | |||
| 20c032fa4d | |||
| 62235497ad | |||
| 983dd46870 | |||
| 4da089e9b8 | |||
| aaff28d720 | |||
| 93befc0887 | |||
| d304d0706c | |||
| eff44c334d | |||
| e082a0b49c | |||
| 3842cce1ab | |||
| f4fc7fc75b | |||
| f89ce2ee15 | |||
| ecd7215003 | |||
| 585f984554 | |||
| 7125e9b360 | |||
| 2fb7260077 | |||
| d3ef0c828d | |||
| bedf3761bd | |||
| b3b9867624 | |||
| d0f1a73a9f | |||
| 4bcf00fd6f | |||
| 5f7465194e | |||
| f0c6584818 | |||
| a61b8d193b | |||
| 001a89ccf0 | |||
| c2633d0d9f | |||
| 5957ff6f7b | |||
| afc80c0e03 | |||
| 740949812c | |||
| ee0fc67984 | |||
| 434a9d5fda | |||
| ec6ec33c74 | |||
| 71c240e347 | |||
| eaf9894f99 | |||
| b68aa3b289 | |||
| 345e729d1a | |||
| 2e8b4c97ac | |||
| 01d5e37a81 | |||
| 67dc95e496 | |||
| e56c5a4fdc | |||
| 4e3a578ad1 | |||
| 1b7114d8bd | |||
| 27cc7655b3 | |||
| f7b593149d | |||
| 01e7e0fac3 | |||
| 228781e62f | |||
| d0c41816ac | |||
| 2bc872e9d9 | |||
| 127300c58b | |||
| 1da1b2f546 | |||
| 79f7458010 | |||
| c8f90ea654 | |||
| 27c1ec0e55 | |||
| bda4bb66e1 | |||
| 2691b4317b | |||
| 25878db5f0 | |||
| 9cd5e42c08 | |||
| c39dc59ef5 | |||
| 0b5564267f | |||
| 6ca5e46ef6 | |||
| 4b855cdf6e | |||
| b4638f9218 | |||
| 5b8934c922 | |||
| 9d89f5d7f4 | |||
| 1c6be6a1ea | |||
| 5d054142ff | |||
| 7723ac8830 | |||
| b5cc45aafd | |||
| 94d3364808 | |||
| dab46c185c | |||
| 8bf5360f6f | |||
| ee431510fb | |||
| 465736912b | |||
| f2ae969e84 | |||
| f2eaf61bd0 | |||
| 189c052ed5 | |||
| fa28129aa4 | |||
| c42d438a7c | |||
| 2e1efce858 | |||
| 825d7eb071 | |||
| cd80b9f228 | |||
| 502dda0b3b | |||
| a8ea778c6e | |||
| 6c29321581 | |||
| 7ed94d171a | |||
| afd73082f3 | |||
| 890f3523f3 | |||
| 8e8ed92e26 | |||
| b935ae9fc4 | |||
| d6272d7310 | |||
| e60a7a5ac0 | |||
| 7e8cb056ed | |||
| 9ae3cb796d | |||
| 9a6a131bbf | |||
| 3909ddb3ba | |||
| dbc26b8243 | |||
| 93a4acb108 | |||
| 9c1c4e02a9 | |||
| 00aa06c5f1 | |||
| f3578f82e6 | |||
| 85ee1faf4a | |||
| b72c8e8ce3 | |||
| 77a89b8f8a | |||
| a9a9b6a8ac | |||
| fab77a0dbb | |||
| e83e0def2e | |||
| ebcc721d43 | |||
| ff6d236ea7 | |||
| 41a9c19001 | |||
| 187ef18ac2 | |||
| 93304e3eb7 | |||
| b1f14c4beb | |||
| 1b2c073886 | |||
| f20a5bb881 | |||
| 394ba5a165 | |||
| c35e689d1b | |||
| a9b6fcb9ee | |||
| 8eeb539f16 | |||
| a863902370 | |||
| 12f8139d1e | |||
| 4f25e7e24f | |||
| 5860a263d9 | |||
| 1460ddb975 | |||
| 5326126dcb | |||
| e6a8cdd5e2 | |||
| 0dc8eeee90 | |||
| e719d13c8c | |||
| 9ee2592ec7 | |||
| 720b97dc69 | |||
| 177917a8c8 | |||
| a1323e5d17 | |||
| 760b2c3df1 | |||
| 31f8b5a294 | |||
| 3498cc370f | |||
| 66dd7b5f90 | |||
| 5cc979e2f3 | |||
| 1bcf307f94 | |||
| cdf67f4ce5 | |||
| 67f2dce2fd | |||
| 162f28d874 | |||
| c6ab1b5468 | |||
| d17db3a1fd | |||
| 9428436883 | |||
| 62dfb8a42e | |||
| c6647a99b8 | |||
| a11797c5e4 | |||
| 84a124bb52 | |||
| b296742de0 | |||
| c0560ece47 | |||
| 89fd647870 | |||
| 07da5cb77c | |||
| aaf84d13f8 | |||
| fd1bb0def7 | |||
| 3223eae7b6 | |||
| d836f80805 | |||
| 1a6dcf3f57 | |||
| dce48f3d66 | |||
| 10d98f32b6 | |||
| acdf6db91a | |||
| 0ee7269c8f | |||
| 4b888b3d92 | |||
| f0ed15baf0 | |||
| 6c882a7788 | |||
| 11e03e0051 | |||
| 6e47b80d23 | |||
| a3d3c32b07 | |||
| 3a27f2f4c8 | |||
| 1638804f1f | |||
| 362958c0f1 | |||
| 74720956a1 | |||
| 58e1f4d70b | |||
| c871c253b1 | |||
| 547b101c60 | |||
| b9ccbe219f | |||
| c31409d26f | |||
| 00d6e4f819 | |||
| dc9f33dc7b | |||
| 3d45f26611 | |||
| 8554bad731 | |||
| b2a8fe357e | |||
| 08ac0b8d8d | |||
| 23bf491d4b | |||
| 76d22abd0b | |||
| e4e8086e41 | |||
| 63116551bc | |||
| d06ce44bd5 | |||
| 387f75766f | |||
| 2a18b96d23 | |||
| bf2174fbe5 | |||
| 462f6725b6 | |||
| ed09bffc87 | |||
| 218de2bb70 | |||
| c90961b691 | |||
| 1b5b904a8f | |||
| ed219efb92 | |||
| 4d704d3ab0 | |||
| 11076ff586 | |||
| 6b22e624f6 | |||
| a81f90238b | |||
| e7c2e827b9 | |||
| 82aa2f9b77 | |||
| d9cc2d2a56 | |||
| 28e3769d1e | |||
| e092d764bd | |||
| 27c0a852e9 | |||
| bf6ad69d4c | |||
| 0b4b270d2f | |||
| 4b63493b73 | |||
| 9b6c8af171 | |||
| 4c7421cd62 | |||
| 7662069100 | |||
| adb10e34f3 | |||
| bd0d814142 | |||
| 06364a2b9e | |||
| afb6d3e8a3 | |||
| a48ff5851c | |||
| ede21f8d54 | |||
| d08190cbff | |||
| cd50ca4309 | |||
| 97c118ae1a | |||
| 8878f07628 | |||
| dee30d8121 | |||
| 5087465ecb | |||
| 39844251b0 | |||
| 8c983eadff | |||
| 7efe5209aa | |||
| 95cf5fa209 | |||
| adde3fc3a8 | |||
| b7089e88d3 | |||
| da63d9d926 | |||
| c8a5224c75 | |||
| d4618ae4b9 | |||
| 0591b9d41f | |||
| 52c5f51613 | |||
| f8b9c97730 | |||
| c7fa537cfb | |||
| e0e8296339 | |||
| e677ca9f33 | |||
| c19f6df690 | |||
| 3ed7f7c3fb | |||
| 6b10374adb | |||
| 0a65ea61e7 | |||
| 6500659c1f | |||
| 480887a78f | |||
| 05ac2d0a90 | |||
| bbac9ce6b9 | |||
| 5b9866f704 | |||
| 4a6e4d2a85 | |||
| b7ef3de527 | |||
| 4bfb866abe | |||
| 23d2b595d9 | |||
| 7d30fd2b96 | |||
| 93d5976c1e | |||
| 260bc453d1 | |||
| 5a619db9bd | |||
| d622406912 | |||
| a5e2b69ae3 | |||
| 56686944af | |||
| aa957f41af | |||
| 9336305334 | |||
| bc9c5224d0 | |||
| eda27b2e9c | |||
| c5d6b382f8 | |||
| ae0d182e2e | |||
| ad78d152f7 | |||
| 000ccdaf0a | |||
| 57249727de | |||
| d6c49d0793 | |||
| 2fa58c4f38 | |||
| c361c2a78a | |||
| 4d862355be | |||
| 52028e0e97 | |||
| 3e4e13a8ae | |||
| 0ceea002d5 | |||
| 7d8f4049b9 | |||
| dbefaa7ead | |||
| 9c1ec1069f | |||
| f36c980eb9 | |||
| cb1a7f014d | |||
| e729bc9541 | |||
| c97a6f555a | |||
| 95a104e397 | |||
| e7ad83cc60 | |||
| 821b7264ec | |||
| 0bf3456119 | |||
| ff7bd7a699 | |||
| a028bebafd | |||
| 789d9a3bb6 | |||
| 8e19b66a9b | |||
| 975845375f | |||
| 74b37063bf | |||
| c2fee2290d | |||
| f7c8c44ebb | |||
| 91b2ff6e62 | |||
| 8293f552b1 | |||
| a84336fc31 | |||
| 3951114eb7 | |||
| f24877e9ce | |||
| b81b83570a | |||
| 2417073a4d | |||
| ebc0b7a89e | |||
| 3d6bfcf48f | |||
| a5864b74f8 | |||
| de8896ff4e | |||
| e579912733 | |||
| c7b4404c36 | |||
| f1de7d413a | |||
| cc6f5f5f25 | |||
| 19bf75ade8 | |||
| 73eacc3779 | |||
| 69f3504ee9 | |||
| bd89b5e975 | |||
| 186eea3099 | |||
| 5e0badef17 | |||
| ea24d493fd | |||
| d12d040def | |||
| 491a9dbae9 | |||
| 1e0372c40d | |||
| d2f6344846 | |||
| 47cb824b3f | |||
| 7d8117173f | |||
| 2f076d3215 | |||
| 1a0b8c1d35 | |||
| 887db109c1 | |||
| d8b7f74cd1 | |||
| b81b4f0e0a | |||
| 0b4e0d65a9 | |||
| 2f837ace1e | |||
| 319d68d15e | |||
| 2224d811eb | |||
| 9ec97ce448 | |||
| f13b8b5d3e | |||
| 633f5837dc | |||
| 3238cfa0ff | |||
| 83b1503cee | |||
| 6854fad222 | |||
| 56dd3cfa95 | |||
| f81a1acb20 | |||
| 4ed5744707 | |||
| 085f2816a9 | |||
| 0526fdef2f | |||
| 093ee9f59a | |||
| 1d56b138a5 | |||
| 419ce3f49c | |||
| a27f257f80 | |||
| 8eee7ca23e | |||
| 28cf0d2232 | |||
| e12a8a3c7c |
@@ -58,9 +58,6 @@ public abstract class dbHandlerBase {
|
|||||||
|
|
||||||
int id = rs.getInt(1);
|
int id = rs.getInt(1);
|
||||||
|
|
||||||
if (id == 39052)
|
|
||||||
Logger.info(id);
|
|
||||||
|
|
||||||
if (DbManager.inCache(localObjectType, id)) {
|
if (DbManager.inCache(localObjectType, id)) {
|
||||||
objectList.add((T) DbManager.getFromCache(localObjectType, id));
|
objectList.add((T) DbManager.getFromCache(localObjectType, id));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -798,7 +798,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 == -1)
|
if (rank < 0)
|
||||||
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);
|
||||||
|
|||||||
@@ -462,12 +462,11 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (damage > 0) {
|
if (damage > 0) {
|
||||||
|
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
if (AbstractCharacter.IsAbstractCharacter(target))
|
||||||
((AbstractCharacter) target).modifyHealth(-damage, attacker, true);
|
((AbstractCharacter) target).modifyHealth(-damage, attacker, true);
|
||||||
((AbstractCharacter) target).cancelOnTakeDamage();
|
else
|
||||||
}else {
|
|
||||||
((Building) target).modifyHealth(-damage, attacker);
|
((Building) target).modifyHealth(-damage, attacker);
|
||||||
}
|
|
||||||
int attackAnim = getSwingAnimation(null, null, slot);
|
int attackAnim = getSwingAnimation(null, null, slot);
|
||||||
if (attacker.charItemManager.getEquipped().get(slot) != null) {
|
if (attacker.charItemManager.getEquipped().get(slot) != null) {
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ 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,11 +170,9 @@ public enum ConfigManager {
|
|||||||
|
|
||||||
Logger.info("Loading WPAK data");
|
Logger.info("Loading WPAK data");
|
||||||
|
|
||||||
// *** Needs powermanager collection
|
//EffectsParser.parseWpakFile();
|
||||||
// defined before activation.
|
//PowersParser.parseWpakFile();
|
||||||
// EffectsParser.parseWpakFile();
|
//PowerActionParser.parseWpakFile();
|
||||||
// PowersParser.parseWpakFile();
|
|
||||||
// PowerActionParser.parseWpakFile();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,15 +49,8 @@ public enum ForgeManager implements Runnable {
|
|||||||
public static final ConcurrentHashMap<NPC, ConcurrentHashMap.KeySetView<WorkOrder, Boolean>> vendorWorkOrderLookup = new ConcurrentHashMap<>();
|
public static final ConcurrentHashMap<NPC, ConcurrentHashMap.KeySetView<WorkOrder, Boolean>> vendorWorkOrderLookup = new ConcurrentHashMap<>();
|
||||||
public static final ConcurrentHashMap<Item, WorkOrder> itemWorkOrderLookup = new ConcurrentHashMap<>();
|
public static final ConcurrentHashMap<Item, WorkOrder> itemWorkOrderLookup = new ConcurrentHashMap<>();
|
||||||
|
|
||||||
public static void start() {
|
|
||||||
|
|
||||||
Thread forgeManager;
|
|
||||||
forgeManager = new Thread(FORGE_MANAGER);
|
|
||||||
forgeManager.setName("Forge Manager");
|
|
||||||
forgeManager.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
WorkOrder workOrder;
|
WorkOrder workOrder;
|
||||||
@@ -119,6 +112,14 @@ public enum ForgeManager implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void start() {
|
||||||
|
|
||||||
|
Thread forgeManager;
|
||||||
|
forgeManager = new Thread(FORGE_MANAGER);
|
||||||
|
forgeManager.setName("Forge Manager");
|
||||||
|
forgeManager.start();
|
||||||
|
}
|
||||||
|
|
||||||
public static int submit(WorkOrder workOrder) {
|
public static int submit(WorkOrder workOrder) {
|
||||||
|
|
||||||
// Must have a city to roll anything
|
// Must have a city to roll anything
|
||||||
|
|||||||
@@ -31,6 +31,10 @@ import engine.objects.*;
|
|||||||
import engine.powers.*;
|
import engine.powers.*;
|
||||||
import engine.powers.poweractions.AbstractPowerAction;
|
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 org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -112,10 +116,30 @@ public enum PowersManager {
|
|||||||
return powerEntries;
|
return powerEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void InitializeEffects(){
|
||||||
|
// Add EffectsBase
|
||||||
|
ArrayList<EffectsBase> effectList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Effect entry : EffectsParser.effect_data.values()) {
|
||||||
|
EffectsBase effectBase = new EffectsBase(entry);
|
||||||
|
effectList.add(effectBase);
|
||||||
|
PowersManager.effectsBaseByToken.put(effectBase.getToken(), effectBase);
|
||||||
|
PowersManager.effectsBaseByIDString.put(effectBase.getIDString(), effectBase);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add Fail Conditions
|
||||||
|
EffectsBase.getFailConditions(PowersManager.effectsBaseByIDString);
|
||||||
|
}
|
||||||
|
|
||||||
// This pre-loads all powers and effects
|
// This pre-loads all powers and effects
|
||||||
public static void InitializePowers() {
|
public static void InitializePowers() {
|
||||||
|
|
||||||
// Add EffectsBase
|
EffectsParser.parseWpakFile();
|
||||||
|
PowersParser.parseWpakFile();
|
||||||
|
PowerActionParser.parseWpakFile();
|
||||||
|
|
||||||
|
//InitializeEffects();
|
||||||
|
|
||||||
ArrayList<EffectsBase> ebList = dbEffectsBaseHandler.getAllEffectsBase();
|
ArrayList<EffectsBase> ebList = dbEffectsBaseHandler.getAllEffectsBase();
|
||||||
|
|
||||||
for (EffectsBase eb : ebList) {
|
for (EffectsBase eb : ebList) {
|
||||||
@@ -957,7 +981,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
|
||||||
Effect ef = target.getEffects().get(stackType);
|
engine.objects.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();
|
||||||
@@ -1129,7 +1153,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
|
||||||
Effect ef = target.getEffects().get(stackType);
|
engine.objects.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();
|
||||||
@@ -1443,7 +1467,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
|
||||||
Effect ef = target.getEffects().get(stackType);
|
engine.objects.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();
|
||||||
@@ -1890,7 +1914,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) {
|
||||||
Effect eff = awo.getEffects().get(stackType);
|
engine.objects.Effect eff = awo.getEffects().get(stackType);
|
||||||
if (eff != null)
|
if (eff != null)
|
||||||
eff.cancelJob(true);
|
eff.cancelJob(true);
|
||||||
} else
|
} else
|
||||||
|
|||||||
+8
-44
@@ -841,27 +841,15 @@ public class mbEnums {
|
|||||||
DRAIN;
|
DRAIN;
|
||||||
|
|
||||||
public static DamageType getDamageType(String modName) {
|
public static DamageType getDamageType(String modName) {
|
||||||
|
|
||||||
if (modName.isEmpty())
|
|
||||||
return DamageType.NONE;
|
|
||||||
|
|
||||||
if(modName.toLowerCase().equals("blind"))
|
if(modName.toLowerCase().equals("blind"))
|
||||||
modName = "BLINDNESS";
|
modName = "BLINDNESS";
|
||||||
|
|
||||||
if(modName.toLowerCase().equals("powerblock"))
|
if(modName.toLowerCase().equals("powerblock"))
|
||||||
modName = "POWERINHIBITOR";
|
modName = "POWERINHIBITOR";
|
||||||
|
|
||||||
//validity check for not looking up damage type that doesn't exist
|
|
||||||
boolean valid = false;
|
|
||||||
for(DamageType type : DamageType.values()){
|
|
||||||
if(type.name().equals(modName))
|
|
||||||
valid = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!valid)
|
|
||||||
return DamageType.NONE;
|
|
||||||
|
|
||||||
DamageType damageType;
|
DamageType damageType;
|
||||||
|
if (modName.isEmpty())
|
||||||
|
return DamageType.NONE;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
damageType = DamageType.valueOf(modName.replace(",", "").toUpperCase());
|
damageType = DamageType.valueOf(modName.replace(",", "").toUpperCase());
|
||||||
@@ -3038,14 +3026,14 @@ public class mbEnums {
|
|||||||
public enum PowerType {
|
public enum PowerType {
|
||||||
None,
|
None,
|
||||||
SPELL,
|
SPELL,
|
||||||
SKILL
|
SKILL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CostType {
|
public enum CostType {
|
||||||
NONE,
|
NONE,
|
||||||
HEALTH,
|
HEALTH,
|
||||||
MANA,
|
MANA,
|
||||||
STAMINA
|
STAMINA;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum AreaType {
|
public enum AreaType {
|
||||||
@@ -3054,7 +3042,7 @@ public class mbEnums {
|
|||||||
POINTBLANK,
|
POINTBLANK,
|
||||||
LINE,
|
LINE,
|
||||||
CONE,
|
CONE,
|
||||||
WALL
|
WALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ExcludeType {
|
public enum ExcludeType {
|
||||||
@@ -3065,14 +3053,14 @@ public class mbEnums {
|
|||||||
NATION,
|
NATION,
|
||||||
PLAYERS,
|
PLAYERS,
|
||||||
ALLBUTGROUP,
|
ALLBUTGROUP,
|
||||||
ALLBUTPETS
|
ALLBUTPETS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CastingModeType {
|
public enum CastingModeType {
|
||||||
NONE,
|
NONE,
|
||||||
COMBAT,
|
COMBAT,
|
||||||
NONCOMBAT,
|
NONCOMBAT,
|
||||||
BOTH
|
BOTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum TargetSelectType {
|
public enum TargetSelectType {
|
||||||
@@ -3081,7 +3069,7 @@ public class mbEnums {
|
|||||||
GROUP,
|
GROUP,
|
||||||
GUILD,
|
GUILD,
|
||||||
NEARBYMOBS,
|
NEARBYMOBS,
|
||||||
NAME
|
NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CategoryToPowerType {
|
public enum CategoryToPowerType {
|
||||||
@@ -3091,29 +3079,5 @@ public class mbEnums {
|
|||||||
Always
|
Always
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ModificationType {
|
|
||||||
ADD,
|
|
||||||
MULTIPLY
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum ServerConfig {
|
|
||||||
MBDB_108("AERYNTH", "ARAC", "MOURNING", 300000),
|
|
||||||
MBDB_192("DALGOTH", "ARAC", "GOOK", 300001),
|
|
||||||
MBDB_162("VORGINA", "LORE", "SAEDRON", 300002),
|
|
||||||
MBDB_164("VORGINA", "ARAC", "THURIN", 300002);
|
|
||||||
|
|
||||||
public final String mapType;
|
|
||||||
public final String ruleType;
|
|
||||||
public final String serverName;
|
|
||||||
public final int realmMap;
|
|
||||||
|
|
||||||
ServerConfig(String mapType, String ruleType, String serverName, int realmMap) {
|
|
||||||
|
|
||||||
this.mapType = mapType;
|
|
||||||
this.ruleType = ruleType;
|
|
||||||
this.serverName = serverName;
|
|
||||||
this.realmMap = realmMap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -561,7 +561,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 it's
|
// If the tree is R8 and deranking, we need to update the
|
||||||
// mesh along with buildings losing their health bonus
|
// mesh along with buildings losing their health bonus
|
||||||
|
|
||||||
if (this.rank == 8) {
|
if (this.rank == 8) {
|
||||||
@@ -959,7 +959,7 @@ public class Building extends AbstractWorldObject {
|
|||||||
// Altitude of this building is derived from the heightmap engine.
|
// Altitude of this building is derived from the heightmap engine.
|
||||||
|
|
||||||
Vector3fImmutable tempLoc = new Vector3fImmutable(this.statLat + this.parentZone.absX, 0, this.statLon + this.parentZone.absZ);
|
Vector3fImmutable tempLoc = new Vector3fImmutable(this.statLat + this.parentZone.absX, 0, this.statLon + this.parentZone.absZ);
|
||||||
tempLoc = new Vector3fImmutable(tempLoc.x, Terrain.getWorldHeight(tempLoc) + this.statAlt, tempLoc.z);
|
tempLoc = new Vector3fImmutable(tempLoc.x, Terrain.getWorldHeight(tempLoc), tempLoc.z);
|
||||||
this.setLoc(tempLoc);
|
this.setLoc(tempLoc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 isDestroyed = new AtomicBoolean(false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ResultSet Constructor
|
* ResultSet Constructor
|
||||||
@@ -322,6 +324,7 @@ public class City extends AbstractWorldObject {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
//can't repledge to a guild you're already part of
|
//can't repledge to a guild you're already part of
|
||||||
|
|
||||||
if (repledge && city.getGuild().equals(playerCharacter.guild))
|
if (repledge && city.getGuild().equals(playerCharacter.guild))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -1116,17 +1119,21 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
public final void destroy() {
|
public final void destroy() {
|
||||||
|
|
||||||
Thread destroyCityThread = new Thread(new DestroyCityThread(this));
|
if (this.isDestroyed.compareAndSet(false, true)) {
|
||||||
|
|
||||||
destroyCityThread.setName("destroyCity:" + this.getName());
|
Thread destroyCityThread = new Thread(new DestroyCityThread(this));
|
||||||
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.getName());
|
transferCityThread.setName("TransferCity:" + this.getParent().zoneName);
|
||||||
transferCityThread.start();
|
transferCityThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -512,6 +512,29 @@ public class NPC extends AbstractCharacter {
|
|||||||
return MinionType.ContractToMinionMap.containsKey(contractID);
|
return MinionType.ContractToMinionMap.containsKey(contractID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean UpdateEquipSetID(NPC npc, int equipSetID) {
|
||||||
|
|
||||||
|
if (!LootManager._bootySetMap.containsKey(equipSetID))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (!DbManager.NPCQueries.UPDATE_EQUIPSET(npc, equipSetID))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
npc.equipmentSetID = equipSetID;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean UpdateRaceID(NPC npc, int raceID) {
|
||||||
|
|
||||||
|
if (!DbManager.NPCQueries.UPDATE_MOBBASE(npc, raceID))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
npc.loadID = raceID;
|
||||||
|
npc.mobBase = MobBase.getMobBase(npc.loadID);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public static NPCProfits GetNPCProfits(NPC npc) {
|
public static NPCProfits GetNPCProfits(NPC npc) {
|
||||||
return NPCProfits.ProfitCache.get(npc.currentID);
|
return NPCProfits.ProfitCache.get(npc.currentID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,10 +26,11 @@ 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.Effect;
|
|
||||||
import engine.objects.PlayerCharacter;
|
import engine.objects.PlayerCharacter;
|
||||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
|
import engine.util.Hasher;
|
||||||
|
import engine.wpak.data.Effect;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
@@ -62,7 +63,7 @@ public class EffectsBase {
|
|||||||
// flags
|
// flags
|
||||||
private boolean isItemEffect;
|
private boolean isItemEffect;
|
||||||
private boolean isSpireEffect;
|
private boolean isSpireEffect;
|
||||||
private boolean ignoreMod;
|
private boolean ignoreNoMod;
|
||||||
private boolean dontSave;
|
private boolean dontSave;
|
||||||
private boolean cancelOnAttack = false;
|
private boolean cancelOnAttack = false;
|
||||||
private boolean cancelOnAttackSwing = false;
|
private boolean cancelOnAttackSwing = false;
|
||||||
@@ -91,6 +92,33 @@ 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;
|
||||||
|
}
|
||||||
|
|
||||||
public EffectsBase(EffectsBase copyEffect, int newToken, String IDString) {
|
public EffectsBase(EffectsBase copyEffect, int newToken, String IDString) {
|
||||||
|
|
||||||
UUID = NewID++;
|
UUID = NewID++;
|
||||||
@@ -102,7 +130,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.ignoreMod = ((flags & 4) != 0) ? true : false;
|
this.ignoreNoMod = ((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-"))
|
||||||
@@ -117,7 +145,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.ignoreMod = copyEffect.ignoreMod;
|
this.ignoreNoMod = copyEffect.ignoreNoMod;
|
||||||
this.dontSave = copyEffect.dontSave;
|
this.dontSave = copyEffect.dontSave;
|
||||||
this.cancelOnAttack = copyEffect.cancelOnAttack;
|
this.cancelOnAttack = copyEffect.cancelOnAttack;
|
||||||
this.cancelOnAttackSwing = copyEffect.cancelOnAttackSwing;
|
this.cancelOnAttackSwing = copyEffect.cancelOnAttackSwing;
|
||||||
@@ -163,7 +191,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.ignoreMod = ((flags & 4) != 0) ? true : false;
|
this.ignoreNoMod = ((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-"))
|
||||||
@@ -351,7 +379,7 @@ public class EffectsBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean ignoreMod() {
|
public boolean ignoreMod() {
|
||||||
return this.ignoreMod;
|
return this.ignoreNoMod;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean dontSave() {
|
public boolean dontSave() {
|
||||||
@@ -404,7 +432,7 @@ public class EffectsBase {
|
|||||||
float duration = ab.getDurationInSeconds(trains);
|
float duration = ab.getDurationInSeconds(trains);
|
||||||
if (pb.getToken() == 1672601862) {
|
if (pb.getToken() == 1672601862) {
|
||||||
|
|
||||||
Effect eff = awo.getEffects().get("DeathShroud");
|
engine.objects.Effect eff = awo.getEffects().get("DeathShroud");
|
||||||
|
|
||||||
|
|
||||||
if (eff != null) {
|
if (eff != null) {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class WorldServer {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) throws IOException {
|
||||||
|
|
||||||
WorldServer worldServer;
|
WorldServer worldServer;
|
||||||
|
|
||||||
|
|||||||
@@ -53,129 +53,117 @@ public class DestroyCityThread implements Runnable {
|
|||||||
|
|
||||||
// Member variable assignment
|
// Member variable assignment
|
||||||
|
|
||||||
cityZone = city.getParent();
|
try {
|
||||||
newParent = cityZone.parent;
|
cityZone = city.getParent();
|
||||||
formerGuild = city.getTOL().getGuild();
|
newParent = cityZone.parent;
|
||||||
|
formerGuild = city.getTOL().getGuild();
|
||||||
|
|
||||||
// Former guild loses it's tree!
|
Logger.info("Destroy city thread started for: " + cityZone.zoneName);
|
||||||
|
|
||||||
if (DbManager.GuildQueries.SET_GUILD_OWNED_CITY(formerGuild.getObjectUUID(), 0)) {
|
// Former guild loses tree!
|
||||||
|
|
||||||
//Successful Update of guild
|
if (DbManager.GuildQueries.SET_GUILD_OWNED_CITY(formerGuild.getObjectUUID(), 0)) {
|
||||||
|
|
||||||
formerGuild.setGuildState(mbEnums.GuildState.Errant);
|
//Successful Update of guild
|
||||||
formerGuild.setNation(null);
|
|
||||||
formerGuild.setCityUUID(0);
|
formerGuild.setGuildState(mbEnums.GuildState.Errant);
|
||||||
GuildManager.updateAllGuildTags(formerGuild);
|
formerGuild.setNation(null);
|
||||||
GuildManager.updateAllGuildBinds(formerGuild, null);
|
formerGuild.setCityUUID(0);
|
||||||
|
GuildManager.updateAllGuildTags(formerGuild);
|
||||||
|
GuildManager.updateAllGuildBinds(formerGuild, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// By losing the tree, the former owners lose all of their subguilds.
|
||||||
|
|
||||||
|
if (!formerGuild.getSubGuildList().isEmpty()) {
|
||||||
|
|
||||||
|
subGuildList = new ArrayList<>();
|
||||||
|
|
||||||
|
subGuildList.addAll(formerGuild.getSubGuildList());
|
||||||
|
|
||||||
|
for (Guild subGuild : subGuildList) {
|
||||||
|
formerGuild.removeSubGuild(subGuild);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Build list of buildings within this parent zone
|
||||||
|
|
||||||
|
ArrayList<Building> destroySet = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Building cityBuilding : cityZone.zoneBuildingSet) {
|
||||||
|
|
||||||
|
// Sanity Check in case player deletes the building
|
||||||
|
// before this thread can get to it
|
||||||
|
|
||||||
|
if (cityBuilding == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Do nothing with the banestone. It will be removed elsewhere
|
||||||
|
|
||||||
|
if (cityBuilding.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.BANESTONE))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// All buildings are moved to a location relative
|
||||||
|
// to their new parent zone
|
||||||
|
|
||||||
|
localCoords = ZoneManager.worldToLocal(cityBuilding.getLoc(), newParent);
|
||||||
|
|
||||||
|
DbManager.BuildingQueries.MOVE_BUILDING(cityBuilding.getObjectUUID(), newParent.getObjectUUID(), localCoords.x, localCoords.y, localCoords.z);
|
||||||
|
|
||||||
|
// All buildings are re-parented to a zone one node
|
||||||
|
// higher in the tree (continent) as we will be
|
||||||
|
// deleting the city zone very shortly.
|
||||||
|
|
||||||
|
if (cityBuilding.getParentZoneID() != newParent.getParentZoneID())
|
||||||
|
cityBuilding.setParentZone(newParent);
|
||||||
|
|
||||||
|
// No longer a tree, no longer any protection contract!
|
||||||
|
|
||||||
|
cityBuilding.setProtectionState(mbEnums.ProtectionState.NONE);
|
||||||
|
|
||||||
|
// Remove warehouse entry if one exists.
|
||||||
|
|
||||||
|
if (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.WAREHOUSE) {
|
||||||
|
DbManager.WarehouseQueries.DELETE_WAREHOUSE(city.warehouse);
|
||||||
|
city.warehouse = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mark all auto protected buildings for destruction
|
||||||
|
|
||||||
|
if ((cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.SHRINE) || (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.WAREHOUSE))
|
||||||
|
destroySet.add(cityBuilding);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Destroy set of auto-protected buildings
|
||||||
|
|
||||||
|
for (Building building : destroySet)
|
||||||
|
if (building.getRank() != -1)
|
||||||
|
BuildingManager.setRank(building, -1);
|
||||||
|
|
||||||
|
if (city.realm != null) {
|
||||||
|
city.realm.removeCity(city.getObjectUUID());
|
||||||
|
city.realm = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// It's now safe to delete the city zone from the database
|
||||||
|
// which will cause a cascade delete of everything else
|
||||||
|
|
||||||
|
if (!DbManager.ZoneQueries.DELETE_ZONE(cityZone)) {
|
||||||
|
Logger.error("DestroyCityThread", "Database error when deleting city zone: " + cityZone.getObjectUUID());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Refresh the city for map requests
|
||||||
|
|
||||||
|
City.lastCityUpdate = System.currentTimeMillis();
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
Logger.error(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// By losing the tree, the former owners lose all of their subguilds.
|
|
||||||
|
|
||||||
if (!formerGuild.getSubGuildList().isEmpty()) {
|
|
||||||
|
|
||||||
subGuildList = new ArrayList<>();
|
|
||||||
|
|
||||||
subGuildList.addAll(formerGuild.getSubGuildList());
|
|
||||||
|
|
||||||
for (Guild subGuild : subGuildList) {
|
|
||||||
formerGuild.removeSubGuild(subGuild);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Building tol = null;
|
|
||||||
|
|
||||||
// Build list of buildings within this parent zone
|
|
||||||
|
|
||||||
for (Building cityBuilding : cityZone.zoneBuildingSet) {
|
|
||||||
|
|
||||||
// Sanity Check in case player deletes the building
|
|
||||||
// before this thread can get to it
|
|
||||||
|
|
||||||
if (cityBuilding == null)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// check null bluepritn and log error
|
|
||||||
if (cityBuilding.getBlueprint() == null){
|
|
||||||
Logger.error("Null Blueprint for building ID: " + cityBuilding.getObjectUUID());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Do nothing with the banestone. It will be removed elsewhere
|
|
||||||
|
|
||||||
if (cityBuilding.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.BANESTONE))
|
|
||||||
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
|
|
||||||
// to their new parent zone
|
|
||||||
|
|
||||||
localCoords = ZoneManager.worldToLocal(cityBuilding.getLoc(), newParent);
|
|
||||||
|
|
||||||
DbManager.BuildingQueries.MOVE_BUILDING(cityBuilding.getObjectUUID(), newParent.getObjectUUID(), localCoords.x, localCoords.y, localCoords.z);
|
|
||||||
|
|
||||||
// All buildings are re-parented to a zone one node
|
|
||||||
// higher in the tree (continent) as we will be
|
|
||||||
// deleting the city zone very shortly.
|
|
||||||
|
|
||||||
if (cityBuilding.getParentZoneID() != newParent.getParentZoneID())
|
|
||||||
cityBuilding.setParentZone(newParent);
|
|
||||||
|
|
||||||
// No longer a tree, no longer any protection contract!
|
|
||||||
|
|
||||||
cityBuilding.setProtectionState(mbEnums.ProtectionState.NONE);
|
|
||||||
|
|
||||||
// Remove warehouse entry if one exists.
|
|
||||||
|
|
||||||
if (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.WAREHOUSE) {
|
|
||||||
DbManager.WarehouseQueries.DELETE_WAREHOUSE(city.warehouse);
|
|
||||||
city.warehouse = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Destroy all remaining city assets
|
|
||||||
|
|
||||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.BARRACK)
|
|
||||||
|| (cityBuilding.getBlueprint().isWallPiece())
|
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.SHRINE)
|
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.TOL)
|
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.SPIRE)
|
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.WAREHOUSE)) {
|
|
||||||
|
|
||||||
if (cityBuilding.getRank() != -1)
|
|
||||||
BuildingManager.setRank(cityBuilding, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Destroy the tol
|
|
||||||
|
|
||||||
if (tol != null)
|
|
||||||
BuildingManager.setRank(tol, -1);
|
|
||||||
|
|
||||||
if (city.realm != null)
|
|
||||||
city.realm.removeCity(city.getObjectUUID());
|
|
||||||
|
|
||||||
// It's now safe to delete the city zone from the database
|
|
||||||
// which will cause a cascade delete of everything else
|
|
||||||
|
|
||||||
|
|
||||||
if (DbManager.ZoneQueries.DELETE_ZONE(cityZone) == false) {
|
|
||||||
Logger.error("DestroyCityThread", "Database error when deleting city zone: " + cityZone.getObjectUUID());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Refresh the city for map requests
|
|
||||||
|
|
||||||
City.lastCityUpdate = System.currentTimeMillis();
|
|
||||||
|
|
||||||
// Zone and city should vanish upon next reboot
|
// Zone and city should vanish upon next reboot
|
||||||
// if the codebase reaches here.
|
// if the codebase reaches here.
|
||||||
|
|
||||||
Logger.info(city.getParent().zoneName + " uuid:" + city.getObjectUUID() + "has been destroyed!");
|
Logger.info(city.getParent().zoneName + " uuid: " + city.getObjectUUID() + " has been destroyed!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,16 +18,14 @@ import org.pmw.tinylog.Logger;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
public class EffectsParser {
|
public class EffectsParser {
|
||||||
|
|
||||||
public static String effectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg";
|
public static String effectsPath = ConfigManager.DEFAULT_DATA_DIR + "wpak/Effects.cfg";
|
||||||
|
public static HashMap<String, Effect> effect_data = new HashMap<>();
|
||||||
private static final Pattern EFFECT_REGEX = Pattern.compile("(?<=EFFECTBEGIN)(.+?)(?=EFFECTEND)", Pattern.DOTALL);
|
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 SOURCE_REGEX = Pattern.compile("(?<=SOURCEBEGIN)(.+?)(?=SOURCEEND)", Pattern.DOTALL);
|
||||||
private static final Pattern MODS_REGEX = Pattern.compile("(?<=MODSBEGIN)(.+?)(?=MODSEND)", Pattern.DOTALL);
|
private static final Pattern MODS_REGEX = Pattern.compile("(?<=MODSBEGIN)(.+?)(?=MODSEND)", Pattern.DOTALL);
|
||||||
@@ -53,12 +51,8 @@ public class EffectsParser {
|
|||||||
Matcher matcher = EFFECT_REGEX.matcher(fileContents);
|
Matcher matcher = EFFECT_REGEX.matcher(fileContents);
|
||||||
|
|
||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
try {
|
Effect effect = parseEffectEntry(matcher.group());
|
||||||
Effect effect = parseEffectEntry(matcher.group());
|
effect_data.put(effect.effect_id, effect);
|
||||||
// WpakPowerManager._effectsLookup.put(effect.effect_id, effect);
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error("EFFECT PARSE FAILED: " + e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,8 +174,8 @@ public class EffectsParser {
|
|||||||
case Stamina:
|
case Stamina:
|
||||||
modifierEntry.min = Float.parseFloat(modValues.get(1).trim());
|
modifierEntry.min = Float.parseFloat(modValues.get(1).trim());
|
||||||
modifierEntry.max = Float.parseFloat(modValues.get(2).trim());
|
modifierEntry.max = Float.parseFloat(modValues.get(2).trim());
|
||||||
modifierEntry.percentage = Float.parseFloat(modValues.get(3).trim());
|
modifierEntry.value = Float.parseFloat(modValues.get(3).trim());
|
||||||
modifierEntry.value = Float.parseFloat(modValues.get(4).trim()); // Always zero
|
// Parameter 4 is always 0.
|
||||||
modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim());
|
modifierEntry.compoundCurveType = mbEnums.CompoundCurveType.valueOf(modValues.get(5).trim());
|
||||||
modifierEntry.arg1 = modValues.get(6).trim();
|
modifierEntry.arg1 = modValues.get(6).trim();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public class PowerActionParser {
|
|||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
|
|
||||||
PowerAction powerAction = parsePowerActionEntry(matcher.group().trim());
|
PowerAction powerAction = parsePowerActionEntry(matcher.group().trim());
|
||||||
// WpakPowerManager._powerActionLookup.put(Hasher.SBStringHash(powerAction.action_id), powerAction);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,26 +82,26 @@ public class PowerActionParser {
|
|||||||
|
|
||||||
Iterator<String> headerIterator = headerData.iterator();
|
Iterator<String> headerIterator = headerData.iterator();
|
||||||
powerAction.action_id = headerIterator.next();
|
powerAction.action_id = headerIterator.next();
|
||||||
powerAction.action_type = mbEnums.PowerActionType.valueOf(headerIterator.next());
|
powerAction.action_type = headerIterator.next();
|
||||||
|
|
||||||
switch (powerAction.action_type) {
|
switch (powerAction.action_type) {
|
||||||
case RemoveEffect:
|
case "RemoveEffect":
|
||||||
effect = new Effect();
|
effect = new Effect();
|
||||||
effect.effect_id = headerIterator.next();
|
effect.effect_id = headerIterator.next();
|
||||||
powerAction.effects.add(effect);
|
powerAction.effects.add(effect);
|
||||||
break;
|
break;
|
||||||
case CreateMob:
|
case "CreateMob":
|
||||||
powerAction.petRace = Integer.parseInt(headerIterator.next());
|
|
||||||
powerAction.petLevel = Integer.parseInt(headerIterator.next());
|
powerAction.petLevel = Integer.parseInt(headerIterator.next());
|
||||||
|
powerAction.petRace = Integer.parseInt(headerIterator.next());
|
||||||
break;
|
break;
|
||||||
case DamageOverTime:
|
case "DamageOverTime":
|
||||||
effect = new Effect();
|
effect = new Effect();
|
||||||
effect.effect_id = headerIterator.next();
|
effect.effect_id = headerIterator.next();
|
||||||
effect.cycleDuration = Integer.parseInt(headerIterator.next());
|
effect.cycleDuration = Integer.parseInt(headerIterator.next());
|
||||||
effect.cycleDelay = Integer.parseInt(headerIterator.next());
|
effect.cycleDelay = Integer.parseInt(headerIterator.next());
|
||||||
powerAction.effects.add(effect);
|
powerAction.effects.add(effect);
|
||||||
break;
|
break;
|
||||||
case ApplyEffects:
|
case "ApplyEffects":
|
||||||
int level = Integer.parseInt(headerIterator.next());
|
int level = Integer.parseInt(headerIterator.next());
|
||||||
|
|
||||||
while (headerIterator.hasNext()) {
|
while (headerIterator.hasNext()) {
|
||||||
@@ -111,12 +111,12 @@ public class PowerActionParser {
|
|||||||
powerAction.effects.add(effect);
|
powerAction.effects.add(effect);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Transform:
|
case "Transform":
|
||||||
case Invis:
|
case "Invis":
|
||||||
case ApplyEffect:
|
case "ApplyEffect":
|
||||||
case DeferredPower:
|
case "DeferredPower":
|
||||||
case DirectDamage:
|
case "DirectDamage":
|
||||||
case SpireDisable:
|
case "SpireDisable":
|
||||||
while (headerIterator.hasNext()) {
|
while (headerIterator.hasNext()) {
|
||||||
effect = new Effect();
|
effect = new Effect();
|
||||||
effect.effect_id = headerIterator.next();
|
effect.effect_id = headerIterator.next();
|
||||||
@@ -129,76 +129,73 @@ public class PowerActionParser {
|
|||||||
powerAction.effects.add(effect);
|
powerAction.effects.add(effect);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TransferStat:
|
case "TransferStat":
|
||||||
statTransfer = new StatTransfer();
|
statTransfer = new StatTransfer();
|
||||||
statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next());
|
statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next());
|
||||||
statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next());
|
statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next());
|
||||||
statTransfer.ramp = Float.parseFloat(headerIterator.next());
|
statTransfer.fromStatValue = Float.parseFloat(headerIterator.next());
|
||||||
statTransfer.rampCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
statTransfer.fromCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
||||||
statTransfer.efficiency = Float.parseFloat(headerIterator.next());
|
statTransfer.toStatValue = Float.parseFloat(headerIterator.next());
|
||||||
statTransfer.efficiencyCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
statTransfer.toCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
||||||
statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next());
|
statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next());
|
||||||
statTransfer.isDrain = Boolean.parseBoolean(headerIterator.next());
|
statTransfer.toStatBool = Boolean.parseBoolean(headerIterator.next());
|
||||||
powerAction.statTransfer = statTransfer;
|
powerAction.statTransfer = statTransfer;
|
||||||
break;
|
break;
|
||||||
case TransferStatOT:
|
case "TransferStatOT":
|
||||||
statTransfer = new StatTransfer();
|
statTransfer = new StatTransfer();
|
||||||
statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next());
|
statTransfer.fromStat = mbEnums.CostType.valueOf(headerIterator.next());
|
||||||
statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next());
|
statTransfer.toStat = mbEnums.CostType.valueOf(headerIterator.next());
|
||||||
statTransfer.ramp = Float.parseFloat(headerIterator.next());
|
statTransfer.fromStatValue = Float.parseFloat(headerIterator.next());
|
||||||
statTransfer.rampCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
statTransfer.fromCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
||||||
statTransfer.efficiency = Float.parseFloat(headerIterator.next());
|
statTransfer.toStatValue = Float.parseFloat(headerIterator.next());
|
||||||
statTransfer.efficiencyCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
statTransfer.toCurve = mbEnums.CompoundCurveType.valueOf(headerIterator.next());
|
||||||
statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next());
|
statTransfer.fromStatBool = Boolean.parseBoolean(headerIterator.next());
|
||||||
statTransfer.isDrain = Boolean.parseBoolean(headerIterator.next());
|
statTransfer.toStatBool = Boolean.parseBoolean(headerIterator.next());
|
||||||
statTransfer.transfer_action = headerIterator.next();
|
statTransfer.transfer_action = headerIterator.next();
|
||||||
statTransfer.transfer_ticks = Integer.parseInt(headerIterator.next());
|
statTransfer.transfer_ticks = Integer.parseInt(headerIterator.next());
|
||||||
powerAction.statTransfer = statTransfer;
|
powerAction.statTransfer = statTransfer;
|
||||||
break;
|
break;
|
||||||
case Charm:
|
case "Charm":
|
||||||
effect = new Effect();
|
effect = new Effect();
|
||||||
effect.effect_id = headerIterator.next();
|
effect.effect_id = headerIterator.next();
|
||||||
effect.level = Integer.parseInt(headerIterator.next());
|
effect.level = Integer.parseInt(headerIterator.next());
|
||||||
effect.type = headerIterator.next();
|
effect.type = headerIterator.next();
|
||||||
powerAction.effects.add(effect);
|
powerAction.effects.add(effect);
|
||||||
break;
|
break;
|
||||||
case Block:
|
case "Block":
|
||||||
effect = new Effect();
|
effect = new Effect();
|
||||||
effect.effect_id = headerIterator.next();
|
effect.effect_id = headerIterator.next();
|
||||||
effect.level = Integer.parseInt(headerIterator.next());
|
effect.level = Integer.parseInt(headerIterator.next());
|
||||||
powerAction.effects.add(effect);
|
powerAction.effects.add(effect);
|
||||||
break;
|
break;
|
||||||
case Resurrect:
|
case "Resurrect":
|
||||||
powerAction.levelCap = Integer.parseInt(headerIterator.next());
|
powerAction.levelCap = Integer.parseInt(headerIterator.next());
|
||||||
break;
|
break;
|
||||||
case SetItemFlag:
|
case "SetItemFlag":
|
||||||
powerAction.itemFlag = mbEnums.ItemFlags.valueOf(headerIterator.next());
|
powerAction.itemFlag = mbEnums.ItemFlags.valueOf(headerIterator.next());
|
||||||
break;
|
break;
|
||||||
case Track:
|
case "Track":
|
||||||
trackEntry = new TrackEntry();
|
trackEntry = new TrackEntry();
|
||||||
trackEntry.action_id = headerIterator.next();
|
trackEntry.action_id = headerIterator.next();
|
||||||
trackEntry.trackPlayer = Boolean.parseBoolean(headerIterator.next());
|
trackEntry.unknown1 = Boolean.parseBoolean(headerIterator.next());
|
||||||
trackEntry.trackCorpse = Boolean.parseBoolean(headerIterator.next());
|
trackEntry.unknown2 = Boolean.parseBoolean(headerIterator.next());
|
||||||
trackEntry.filter = mbEnums.MonsterType.valueOf(headerIterator.next());
|
trackEntry.type = headerIterator.next();
|
||||||
trackEntry.min = Integer.parseInt(headerIterator.next());
|
trackEntry.min = Integer.parseInt(headerIterator.next());
|
||||||
trackEntry.max = Integer.parseInt(headerIterator.next());
|
trackEntry.max = Integer.parseInt(headerIterator.next());
|
||||||
powerAction.trackEntry = trackEntry;
|
powerAction.trackEntry = trackEntry;
|
||||||
break;
|
break;
|
||||||
case Teleport:
|
case "Recall": // No arguments for these tags or not parsed
|
||||||
if (headerIterator.hasNext())
|
case "Summon":
|
||||||
powerAction.ignoreNoTeleSpire = Boolean.parseBoolean(headerIterator.next());
|
case "Teleport":
|
||||||
break;
|
case "TreeChoke":
|
||||||
case Recall: // No arguments for these tags or not parsed
|
case "SimpleDamage":
|
||||||
case Summon:
|
case "MobRecall": // One argument always zero
|
||||||
case TreeChoke:
|
case "ClearAggro":
|
||||||
case SimpleDamage:
|
case "ClearNearbyAggro":
|
||||||
case MobRecall: // One argument always zero
|
case "Peek":
|
||||||
case ClearAggro:
|
case "ClaimMine":
|
||||||
case ClearNearbyAggro:
|
case "RunegateTeleport":
|
||||||
case Peek:
|
case "Steal":
|
||||||
case ClaimMine:
|
|
||||||
case RunegateTeleport:
|
|
||||||
case Steal:
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Logger.error("Unhandled type " + powerAction.action_type + " for Pow4erAction: " + powerAction.action_id);
|
Logger.error("Unhandled type " + powerAction.action_type + " for Pow4erAction: " + powerAction.action_id);
|
||||||
@@ -218,7 +215,7 @@ public class PowerActionParser {
|
|||||||
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
|
|
||||||
for (String bodyPart : arguments)
|
for (String bodyPart : arguments)
|
||||||
powerAction.bodyParts.add(Integer.parseInt(bodyPart));
|
powerAction.bodyparts.add(Integer.parseInt(bodyPart));
|
||||||
break;
|
break;
|
||||||
case "FEMALEBODYPARTS":
|
case "FEMALEBODYPARTS":
|
||||||
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
@@ -272,7 +269,7 @@ public class PowerActionParser {
|
|||||||
powerAction.levelCap = Integer.parseInt(arguments.get(0));
|
powerAction.levelCap = Integer.parseInt(arguments.get(0));
|
||||||
|
|
||||||
if (arguments.size() > 1) // Not all level caps have a curve
|
if (arguments.size() > 1) // Not all level caps have a curve
|
||||||
powerAction.levelCapCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1));
|
powerAction.levelCurve = mbEnums.CompoundCurveType.valueOf(arguments.get(1));
|
||||||
break;
|
break;
|
||||||
case "CLEARAGGRO":
|
case "CLEARAGGRO":
|
||||||
powerAction.clearAggro = Boolean.parseBoolean(lineValues.get(1).trim());
|
powerAction.clearAggro = Boolean.parseBoolean(lineValues.get(1).trim());
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class PowersParser {
|
|||||||
while (matcher.find()) {
|
while (matcher.find()) {
|
||||||
|
|
||||||
Power power = parsePowerEntry(matcher.group().trim());
|
Power power = parsePowerEntry(matcher.group().trim());
|
||||||
// @TODO WpakPowerManager._powersLookup.put(Hasher.SBStringHash(power.power_id), power);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,7 +104,7 @@ public class PowersParser {
|
|||||||
PowerEntry power = new PowerEntry();
|
PowerEntry power = new PowerEntry();
|
||||||
power.power_type = mbEnums.PowerType.valueOf(iterator.next());
|
power.power_type = mbEnums.PowerType.valueOf(iterator.next());
|
||||||
power.icon = Integer.parseInt(iterator.next());
|
power.icon = Integer.parseInt(iterator.next());
|
||||||
power.focusLine = iterator.next().replaceAll("\"", "");
|
power.powerBase = iterator.next().replaceAll("\"", "");
|
||||||
powerEntry.powers.add(power);
|
powerEntry.powers.add(power);
|
||||||
|
|
||||||
String nextValue = iterator.next();
|
String nextValue = iterator.next();
|
||||||
@@ -115,7 +115,7 @@ public class PowersParser {
|
|||||||
power = new PowerEntry();
|
power = new PowerEntry();
|
||||||
power.power_type = mbEnums.PowerType.valueOf(nextValue);
|
power.power_type = mbEnums.PowerType.valueOf(nextValue);
|
||||||
power.icon = Integer.parseInt(iterator.next());
|
power.icon = Integer.parseInt(iterator.next());
|
||||||
power.focusLine = iterator.next().replaceAll("\"", "");
|
power.powerBase = iterator.next().replaceAll("\"", "");
|
||||||
powerEntry.powers.add(power);
|
powerEntry.powers.add(power);
|
||||||
powerEntry.target_type = mbEnums.PowerTargetType.valueOf(iterator.next());
|
powerEntry.target_type = mbEnums.PowerTargetType.valueOf(iterator.next());
|
||||||
} else
|
} else
|
||||||
@@ -157,7 +157,7 @@ public class PowersParser {
|
|||||||
case "ACTION":
|
case "ACTION":
|
||||||
actionEntry = new ActionEntry();
|
actionEntry = new ActionEntry();
|
||||||
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
actionEntry.action_id = arguments.get(0);
|
actionEntry.effect_id = arguments.get(0);
|
||||||
actionEntry.minTrains = Integer.parseInt(arguments.get(1));
|
actionEntry.minTrains = Integer.parseInt(arguments.get(1));
|
||||||
actionEntry.maxTrains = Integer.parseInt(arguments.get(2));
|
actionEntry.maxTrains = Integer.parseInt(arguments.get(2));
|
||||||
actionEntry.duration = Float.parseFloat(arguments.get(3));
|
actionEntry.duration = Float.parseFloat(arguments.get(3));
|
||||||
@@ -189,7 +189,7 @@ public class PowersParser {
|
|||||||
powerEntry.description.add(lineValues.get(1).trim());
|
powerEntry.description.add(lineValues.get(1).trim());
|
||||||
break;
|
break;
|
||||||
case "CATEGORY":
|
case "CATEGORY":
|
||||||
powerEntry.category = mbEnums.PowerCategoryType.valueOf(lineValues.get(1).trim());
|
powerEntry.category = lineValues.get(1).trim();
|
||||||
break;
|
break;
|
||||||
case "CURVE":
|
case "CURVE":
|
||||||
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
arguments = Arrays.asList(lineValues.get(1).trim().split("\\s+"));
|
||||||
@@ -206,14 +206,9 @@ public class PowersParser {
|
|||||||
|
|
||||||
while (argumentIterator.hasNext()) {
|
while (argumentIterator.hasNext()) {
|
||||||
EquipmentPreReq equipmentPreReq = new EquipmentPreReq();
|
EquipmentPreReq equipmentPreReq = new EquipmentPreReq();
|
||||||
equipmentPreReq.slot = mbEnums.EquipSlotType.valueOf(argumentIterator.next());
|
equipmentPreReq.slot = mbEnums.EquipSlotType.valueOf(arguments.get(0));
|
||||||
equipmentPreReq.skill = argumentIterator.next().replaceAll("\"", "");
|
equipmentPreReq.skill = arguments.get(1).replaceAll("\"", "");
|
||||||
|
equipmentPreReq.required = Integer.parseInt(arguments.get(2));
|
||||||
if (argumentIterator.hasNext())
|
|
||||||
equipmentPreReq.required = Integer.parseInt(argumentIterator.next());
|
|
||||||
else
|
|
||||||
equipmentPreReq.required = 0;
|
|
||||||
|
|
||||||
powerEntry.equipmentPreReq.add(equipmentPreReq);
|
powerEntry.equipmentPreReq.add(equipmentPreReq);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import engine.mbEnums;
|
|||||||
|
|
||||||
public class ActionEntry {
|
public class ActionEntry {
|
||||||
|
|
||||||
public String action_id;
|
public String effect_id;
|
||||||
public int minTrains;
|
public int minTrains;
|
||||||
public int maxTrains;
|
public int maxTrains;
|
||||||
public float duration;
|
public float duration;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ package engine.wpak.data;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class Effect {
|
public class Effect {
|
||||||
public String effect_id;
|
public String effect_id;
|
||||||
@@ -33,19 +32,4 @@ public class Effect {
|
|||||||
public String message;
|
public String message;
|
||||||
public int cycleDuration;
|
public int cycleDuration;
|
||||||
public int cycleDelay;
|
public int cycleDelay;
|
||||||
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o)
|
|
||||||
return true;
|
|
||||||
if (o == null || getClass() != o.getClass())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Effect effect = (Effect) o;
|
|
||||||
return Objects.equals(effect_id, effect.effect_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return effect_id.hashCode(); // Use only the id field for hashCode
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ public class ModifierEntry {
|
|||||||
public mbEnums.ModType type;
|
public mbEnums.ModType type;
|
||||||
public float min;
|
public float min;
|
||||||
public float max;
|
public float max;
|
||||||
public float percentage;
|
|
||||||
public float value;
|
public float value;
|
||||||
public mbEnums.CompoundCurveType compoundCurveType;
|
public mbEnums.CompoundCurveType compoundCurveType;
|
||||||
public String arg1; // ItemName "Masterwork" ""
|
public String arg1; // ItemName "Masterwork" ""
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import engine.mbEnums;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.EnumSet;
|
import java.util.EnumSet;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class Power {
|
public class Power {
|
||||||
public String power_id;
|
public String power_id;
|
||||||
@@ -47,7 +46,7 @@ public class Power {
|
|||||||
public String grantOverrideVar;
|
public String grantOverrideVar;
|
||||||
public ArrayList<String> description = new ArrayList<>();
|
public ArrayList<String> description = new ArrayList<>();
|
||||||
public HashMap<String, mbEnums.CompoundCurveType> curves = new HashMap<>();
|
public HashMap<String, mbEnums.CompoundCurveType> curves = new HashMap<>();
|
||||||
public mbEnums.PowerCategoryType category;
|
public String category;
|
||||||
public boolean canCastWhileMoving = false;
|
public boolean canCastWhileMoving = false;
|
||||||
public boolean bladeTrails = false;
|
public boolean bladeTrails = false;
|
||||||
public ArrayList<Effect> effectPreReqs = new ArrayList<>();
|
public ArrayList<Effect> effectPreReqs = new ArrayList<>();
|
||||||
@@ -67,30 +66,4 @@ public class Power {
|
|||||||
public boolean isProjectile = false;
|
public boolean isProjectile = false;
|
||||||
public HashMap<String, Float> conditions = new HashMap<>();
|
public HashMap<String, Float> conditions = new HashMap<>();
|
||||||
|
|
||||||
public boolean isSpell() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSkill() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isChant() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o)
|
|
||||||
return true;
|
|
||||||
if (o == null || getClass() != o.getClass())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Power power = (Power) o;
|
|
||||||
return Objects.equals(power_id, power.power_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return power_id.hashCode(); // Use only the id field for hashCode
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,25 +11,24 @@ package engine.wpak.data;
|
|||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
public class PowerAction {
|
public class PowerAction {
|
||||||
|
|
||||||
// Header values
|
// Header values
|
||||||
|
|
||||||
public String action_id;
|
public String action_id;
|
||||||
public mbEnums.PowerActionType action_type;
|
public String action_type;
|
||||||
public ArrayList<Effect> effects = new ArrayList<>();
|
public ArrayList<Effect> effects = new ArrayList<>();
|
||||||
public int petLevel;
|
public int petLevel;
|
||||||
public int petRace;
|
public int petRace;
|
||||||
public StatTransfer statTransfer;
|
public StatTransfer statTransfer;
|
||||||
public int levelCap;
|
public int levelCap;
|
||||||
public mbEnums.CompoundCurveType levelCapCurve;
|
public mbEnums.CompoundCurveType levelCurve;
|
||||||
public TrackEntry trackEntry;
|
public TrackEntry trackEntry;
|
||||||
|
|
||||||
// Additional variables after header go here.
|
// Additional variables after header go here.
|
||||||
|
|
||||||
public ArrayList<Integer> bodyParts = new ArrayList<>();
|
public ArrayList<Integer> bodyparts = new ArrayList<>();
|
||||||
public ArrayList<Integer> femaleBodyParts = new ArrayList<>();
|
public ArrayList<Integer> femaleBodyParts = new ArrayList<>();
|
||||||
public boolean shouldShowWeapons = false;
|
public boolean shouldShowWeapons = false;
|
||||||
public boolean shouldShowArmor = false;
|
public boolean shouldShowArmor = false;
|
||||||
@@ -49,20 +48,6 @@ public class PowerAction {
|
|||||||
public mbEnums.MobBehaviourType rootFsmID;
|
public mbEnums.MobBehaviourType rootFsmID;
|
||||||
public int splashDamageMin;
|
public int splashDamageMin;
|
||||||
public int splashDamageMax;
|
public int splashDamageMax;
|
||||||
public boolean ignoreNoTeleSpire = false;
|
|
||||||
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o)
|
|
||||||
return true;
|
|
||||||
if (o == null || getClass() != o.getClass())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
PowerAction powerAction = (PowerAction) o;
|
|
||||||
return Objects.equals(action_id, powerAction.action_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return action_id.hashCode(); // Use only the id field for hashCode
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ import engine.mbEnums;
|
|||||||
public class PowerEntry {
|
public class PowerEntry {
|
||||||
public mbEnums.PowerType power_type;
|
public mbEnums.PowerType power_type;
|
||||||
public int icon;
|
public int icon;
|
||||||
public String focusLine;
|
public String powerBase;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,13 +12,13 @@ import engine.mbEnums;
|
|||||||
|
|
||||||
public class StatTransfer {
|
public class StatTransfer {
|
||||||
public mbEnums.CostType fromStat;
|
public mbEnums.CostType fromStat;
|
||||||
public float ramp;
|
public float fromStatValue;
|
||||||
public mbEnums.CompoundCurveType rampCurve;
|
public mbEnums.CompoundCurveType fromCurve;
|
||||||
public mbEnums.CostType toStat;
|
public mbEnums.CostType toStat;
|
||||||
public float efficiency;
|
public float toStatValue;
|
||||||
public mbEnums.CompoundCurveType efficiencyCurve;
|
public mbEnums.CompoundCurveType toCurve;
|
||||||
public boolean fromStatBool;
|
public boolean fromStatBool;
|
||||||
public boolean isDrain;
|
public boolean toStatBool;
|
||||||
public String transfer_action;
|
public String transfer_action;
|
||||||
public int transfer_ticks;
|
public int transfer_ticks;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,14 +8,12 @@
|
|||||||
|
|
||||||
package engine.wpak.data;
|
package engine.wpak.data;
|
||||||
|
|
||||||
import engine.mbEnums;
|
|
||||||
|
|
||||||
public class TrackEntry {
|
public class TrackEntry {
|
||||||
|
|
||||||
public String action_id;
|
public String action_id;
|
||||||
public Boolean trackPlayer;
|
public Boolean unknown1;
|
||||||
public Boolean trackCorpse;
|
public Boolean unknown2;
|
||||||
public mbEnums.MonsterType filter;
|
public String type;
|
||||||
public int min;
|
public int min;
|
||||||
public int max;
|
public int max;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user