forked from MagicBane/Server
Compare commits
446 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 92db9e1086 | |||
| f0875a6093 | |||
| 0c50cd9536 | |||
| 3c1280e546 | |||
| aece43a3bc | |||
| 1417760f5b | |||
| 2947753c3c | |||
| 98664a8983 | |||
| 5e5203aa36 | |||
| a41288ac78 | |||
| bdb9a12bd5 | |||
| 458bdbd72d | |||
| 65b10f72fa | |||
| b50110f7b0 | |||
| 1e09930bdb | |||
| 614fb9a5e9 | |||
| 17b4b993e2 | |||
| fa45e9556f | |||
| deab274ba2 | |||
| 82cefce424 | |||
| 0fd6dfb648 | |||
| a5ccba2e27 | |||
| e09bd9aae0 | |||
| 74b1994f5e | |||
| dfa646d828 | |||
| 668b61b734 | |||
| 20c032fa4d | |||
| 62235497ad | |||
| 983dd46870 | |||
| 4da089e9b8 | |||
| aaff28d720 | |||
| 93befc0887 | |||
| d304d0706c | |||
| eff44c334d | |||
| e082a0b49c | |||
| 42186fd2a3 | |||
| 769b84b9da | |||
| 3842cce1ab | |||
| f4fc7fc75b | |||
| f89ce2ee15 | |||
| ecd7215003 | |||
| 585f984554 | |||
| 3d96e6504e | |||
| f0efd0c477 | |||
| bc50408c45 | |||
| 7125e9b360 | |||
| 2fb7260077 | |||
| d3ef0c828d | |||
| bedf3761bd | |||
| b3b9867624 | |||
| d0f1a73a9f | |||
| 4bcf00fd6f | |||
| 5f7465194e | |||
| f0c6584818 | |||
| a61b8d193b | |||
| c863cd5f54 | |||
| c01c69db83 | |||
| 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 | |||
| 9ad5f239b0 | |||
| 3db8ee7afd | |||
| f07974f673 | |||
| 0d5cef1652 | |||
| 04203c092a | |||
| 78feee482b | |||
| 8c35844e08 | |||
| 0fbb43e021 | |||
| 145449f26d | |||
| feef6263b4 | |||
| 6c622c377f | |||
| 8943121336 | |||
| 70cb469190 | |||
| a42f307a70 | |||
| 2a3ae6eaec | |||
| 9e4b596aa1 | |||
| aa1fe792a3 | |||
| 79919121a8 | |||
| 80ccfff635 | |||
| 381139af35 | |||
| e79da63556 | |||
| 533565e37e | |||
| da0510d2bc | |||
| 1f732a8ca9 | |||
| 0d24789a93 | |||
| 35427cfb4a | |||
| 695a78b1e2 | |||
| 9f6710ccb9 | |||
| fff1e80f61 | |||
| 141af19daa | |||
| 630748541f | |||
| d32818f351 | |||
| d6f94bd0e7 | |||
| db6a4e471d | |||
| a24c611bac | |||
| 3926160ab1 | |||
| 4a7013de61 | |||
| 56564f1c3b | |||
| 8a3e39e97d | |||
| 5224c79441 | |||
| ede016a93d | |||
| cc1825dec9 | |||
| d257ce50cf | |||
| 5b246211e1 | |||
| 33c923b0de | |||
| 02d524663a | |||
| 5bd85addb7 | |||
| 40bae67443 | |||
| 1cf1d731c4 | |||
| 24215e21c9 | |||
| 3accd779b9 | |||
| 1d673ca2e5 | |||
| c935ea1986 | |||
| 678ccafd3c | |||
| 31292785a5 | |||
| cdc4717033 | |||
| 35c8ac0289 | |||
| f5cc4a3290 | |||
| 74bd7ddb8b | |||
| 4feb95131c | |||
| d22ba7b89d | |||
| 722fd14be5 | |||
| 12e73d59c7 | |||
| 5c70f15064 | |||
| 8ca641f353 |
@@ -1,303 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2022
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
|
|
||||||
package engine.db.handlers;
|
|
||||||
|
|
||||||
import engine.gameManager.DbManager;
|
|
||||||
import engine.gameManager.PowersManager;
|
|
||||||
import engine.mbEnums;
|
|
||||||
import engine.powers.EffectsBase;
|
|
||||||
import engine.powers.effectmodifiers.*;
|
|
||||||
import org.pmw.tinylog.Logger;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashSet;
|
|
||||||
|
|
||||||
public class dbEffectsBaseHandler extends dbHandlerBase {
|
|
||||||
|
|
||||||
public dbEffectsBaseHandler() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ArrayList<EffectsBase> getAllEffectsBase() {
|
|
||||||
|
|
||||||
ArrayList<EffectsBase> effectList = new ArrayList<>();
|
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
|
||||||
PreparedStatement prepareStatement = connection.prepareStatement("SELECT * FROM static_power_effectbase ORDER BY `IDString` DESC")) {
|
|
||||||
|
|
||||||
ResultSet rs = prepareStatement.executeQuery();
|
|
||||||
|
|
||||||
while (rs.next()) {
|
|
||||||
EffectsBase effectBase = new EffectsBase(rs);
|
|
||||||
effectList.add(effectBase);
|
|
||||||
}
|
|
||||||
} catch (SQLException e) {
|
|
||||||
Logger.error(e.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return effectList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void cacheAllEffectModifiers() {
|
|
||||||
|
|
||||||
String IDString;
|
|
||||||
AbstractEffectModifier abstractEffectModifier = null;
|
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
|
||||||
PreparedStatement prepareStatement = connection.prepareStatement("SELECT * FROM static_power_effectmod")) {
|
|
||||||
|
|
||||||
ResultSet rs = prepareStatement.executeQuery();
|
|
||||||
|
|
||||||
while (rs.next()) {
|
|
||||||
|
|
||||||
IDString = rs.getString("IDString");
|
|
||||||
EffectsBase effectBase = PowersManager.getEffectByIDString(IDString);
|
|
||||||
mbEnums.ModType modifier = mbEnums.ModType.GetModType(rs.getString("modType"));
|
|
||||||
|
|
||||||
//combine item prefix and suffix effect modifiers
|
|
||||||
|
|
||||||
abstractEffectModifier = getCombinedModifiers(abstractEffectModifier, rs, effectBase, modifier);
|
|
||||||
|
|
||||||
if (abstractEffectModifier != null) {
|
|
||||||
|
|
||||||
if (EffectsBase.modifiersMap.containsKey(effectBase.getIDString()) == false)
|
|
||||||
EffectsBase.modifiersMap.put(effectBase.getIDString(), new HashSet<>());
|
|
||||||
|
|
||||||
EffectsBase.modifiersMap.get(effectBase.getIDString()).add(abstractEffectModifier);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static AbstractEffectModifier getCombinedModifiers(AbstractEffectModifier abstractEffectModifier, ResultSet rs, EffectsBase effectBase, mbEnums.ModType modifier) throws SQLException {
|
|
||||||
switch (modifier) {
|
|
||||||
case AdjustAboveDmgCap:
|
|
||||||
abstractEffectModifier = new AdjustAboveDmgCapEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Ambidexterity:
|
|
||||||
abstractEffectModifier = new AmbidexterityEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case AnimOverride:
|
|
||||||
break;
|
|
||||||
case ArmorPiercing:
|
|
||||||
abstractEffectModifier = new ArmorPiercingEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case AttackDelay:
|
|
||||||
abstractEffectModifier = new AttackDelayEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Attr:
|
|
||||||
abstractEffectModifier = new AttributeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case BlackMantle:
|
|
||||||
abstractEffectModifier = new BlackMantleEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case BladeTrails:
|
|
||||||
abstractEffectModifier = new BladeTrailsEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Block:
|
|
||||||
abstractEffectModifier = new BlockEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case BlockedPowerType:
|
|
||||||
abstractEffectModifier = new BlockedPowerTypeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case CannotAttack:
|
|
||||||
abstractEffectModifier = new CannotAttackEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case CannotCast:
|
|
||||||
abstractEffectModifier = new CannotCastEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case CannotMove:
|
|
||||||
abstractEffectModifier = new CannotMoveEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case CannotTrack:
|
|
||||||
abstractEffectModifier = new CannotTrackEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Charmed:
|
|
||||||
abstractEffectModifier = new CharmedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ConstrainedAmbidexterity:
|
|
||||||
abstractEffectModifier = new ConstrainedAmbidexterityEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case DamageCap:
|
|
||||||
abstractEffectModifier = new DamageCapEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case DamageShield:
|
|
||||||
abstractEffectModifier = new DamageShieldEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case DCV:
|
|
||||||
abstractEffectModifier = new DCVEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Dodge:
|
|
||||||
abstractEffectModifier = new DodgeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case DR:
|
|
||||||
abstractEffectModifier = new DREffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Durability:
|
|
||||||
abstractEffectModifier = new DurabilityEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ExclusiveDamageCap:
|
|
||||||
abstractEffectModifier = new ExclusiveDamageCapEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Fade:
|
|
||||||
abstractEffectModifier = new FadeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Fly:
|
|
||||||
abstractEffectModifier = new FlyEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Health:
|
|
||||||
abstractEffectModifier = new HealthEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case HealthFull:
|
|
||||||
abstractEffectModifier = new HealthFullEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case HealthRecoverRate:
|
|
||||||
abstractEffectModifier = new HealthRecoverRateEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case IgnoreDamageCap:
|
|
||||||
abstractEffectModifier = new IgnoreDamageCapEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case IgnorePassiveDefense:
|
|
||||||
abstractEffectModifier = new IgnorePassiveDefenseEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ImmuneTo:
|
|
||||||
abstractEffectModifier = new ImmuneToEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ImmuneToAttack:
|
|
||||||
abstractEffectModifier = new ImmuneToAttackEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ImmuneToPowers:
|
|
||||||
abstractEffectModifier = new ImmuneToPowersEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Invisible:
|
|
||||||
abstractEffectModifier = new InvisibleEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ItemName:
|
|
||||||
abstractEffectModifier = new ItemNameEffectModifier(rs);
|
|
||||||
if (((ItemNameEffectModifier) abstractEffectModifier).name.isEmpty())
|
|
||||||
break;
|
|
||||||
if (effectBase != null)
|
|
||||||
effectBase.setName((((ItemNameEffectModifier) abstractEffectModifier).name));
|
|
||||||
break;
|
|
||||||
case Mana:
|
|
||||||
abstractEffectModifier = new ManaEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ManaFull:
|
|
||||||
abstractEffectModifier = new ManaFullEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ManaRecoverRate:
|
|
||||||
abstractEffectModifier = new ManaRecoverRateEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case MaxDamage:
|
|
||||||
abstractEffectModifier = new MaxDamageEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case MeleeDamageModifier:
|
|
||||||
abstractEffectModifier = new MeleeDamageEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case MinDamage:
|
|
||||||
abstractEffectModifier = new MinDamageEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case NoMod:
|
|
||||||
abstractEffectModifier = new NoModEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case OCV:
|
|
||||||
abstractEffectModifier = new OCVEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Parry:
|
|
||||||
abstractEffectModifier = new ParryEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case PassiveDefense:
|
|
||||||
abstractEffectModifier = new PassiveDefenseEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case PowerCost:
|
|
||||||
abstractEffectModifier = new PowerCostEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case PowerCostHealth:
|
|
||||||
abstractEffectModifier = new PowerCostHealthEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case PowerDamageModifier:
|
|
||||||
abstractEffectModifier = new PowerDamageEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ProtectionFrom:
|
|
||||||
abstractEffectModifier = new ProtectionFromEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Resistance:
|
|
||||||
abstractEffectModifier = new ResistanceEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ScaleHeight:
|
|
||||||
abstractEffectModifier = new ScaleHeightEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ScaleWidth:
|
|
||||||
abstractEffectModifier = new ScaleWidthEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case ScanRange:
|
|
||||||
abstractEffectModifier = new ScanRangeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case SeeInvisible:
|
|
||||||
abstractEffectModifier = new SeeInvisibleEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Silenced:
|
|
||||||
abstractEffectModifier = new SilencedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Skill:
|
|
||||||
abstractEffectModifier = new SkillEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Slay:
|
|
||||||
abstractEffectModifier = new SlayEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Speed:
|
|
||||||
abstractEffectModifier = new SpeedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case SpireBlock:
|
|
||||||
abstractEffectModifier = new SpireBlockEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Stamina:
|
|
||||||
abstractEffectModifier = new StaminaEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case StaminaFull:
|
|
||||||
abstractEffectModifier = new StaminaFullEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case StaminaRecoverRate:
|
|
||||||
abstractEffectModifier = new StaminaRecoverRateEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Stunned:
|
|
||||||
abstractEffectModifier = new StunnedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case Value:
|
|
||||||
abstractEffectModifier = new ValueEffectModifier(rs);
|
|
||||||
if (effectBase != null) {
|
|
||||||
ValueEffectModifier valueEffect = (ValueEffectModifier) abstractEffectModifier;
|
|
||||||
effectBase.setValue(valueEffect.minMod);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case WeaponProc:
|
|
||||||
abstractEffectModifier = new WeaponProcEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case WeaponRange:
|
|
||||||
abstractEffectModifier = new WeaponRangeEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
case WeaponSpeed:
|
|
||||||
abstractEffectModifier = new WeaponSpeedEffectModifier(rs);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
return abstractEffectModifier;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -221,20 +221,4 @@ public class dbLootHandler extends dbHandlerBase {
|
|||||||
return bootySets;
|
return bootySets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LOAD_ENCHANT_VALUES() {
|
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT `IDString`, `minMod` FROM `static_power_effectmod` WHERE `modType` = ?")) {
|
|
||||||
|
|
||||||
preparedStatement.setString(1, "Value");
|
|
||||||
ResultSet rs = preparedStatement.executeQuery();
|
|
||||||
|
|
||||||
while (rs.next())
|
|
||||||
Item.addEnchantValue(rs.getString("IDString"), rs.getInt("minMod"));
|
|
||||||
|
|
||||||
} catch (SQLException e) {
|
|
||||||
Logger.error(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,82 +0,0 @@
|
|||||||
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
|
||||||
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
|
||||||
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
|
||||||
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
|
||||||
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
|
||||||
// Magicbane Emulator Project © 2013 - 2022
|
|
||||||
// www.magicbane.com
|
|
||||||
|
|
||||||
|
|
||||||
package engine.db.handlers;
|
|
||||||
|
|
||||||
import engine.gameManager.DbManager;
|
|
||||||
import engine.gameManager.PowersManager;
|
|
||||||
import engine.mbEnums;
|
|
||||||
import engine.objects.Mob;
|
|
||||||
import engine.powers.EffectsBase;
|
|
||||||
import org.pmw.tinylog.Logger;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.util.HashSet;
|
|
||||||
|
|
||||||
public class dbPowerHandler extends dbHandlerBase {
|
|
||||||
|
|
||||||
public dbPowerHandler() {
|
|
||||||
this.localClass = Mob.class;
|
|
||||||
this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addAllSourceTypes() {
|
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_sourcetype")) {
|
|
||||||
|
|
||||||
ResultSet rs = preparedStatement.executeQuery();
|
|
||||||
String IDString, source;
|
|
||||||
|
|
||||||
while (rs.next()) {
|
|
||||||
IDString = rs.getString("IDString");
|
|
||||||
int token = DbManager.hasher.SBStringHash(IDString);
|
|
||||||
|
|
||||||
source = rs.getString("source").replace("-", "").trim();
|
|
||||||
mbEnums.EffectSourceType effectSourceType = mbEnums.EffectSourceType.GetEffectSourceType(source);
|
|
||||||
|
|
||||||
if (EffectsBase.effectSourceTypeMap.containsKey(token) == false)
|
|
||||||
EffectsBase.effectSourceTypeMap.put(token, new HashSet<>());
|
|
||||||
|
|
||||||
EffectsBase.effectSourceTypeMap.get(token).add(effectSourceType);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void addAllAnimationOverrides() {
|
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_animation_override")) {
|
|
||||||
|
|
||||||
ResultSet rs = preparedStatement.executeQuery();
|
|
||||||
|
|
||||||
String IDString;
|
|
||||||
int animation;
|
|
||||||
while (rs.next()) {
|
|
||||||
IDString = rs.getString("IDString");
|
|
||||||
|
|
||||||
EffectsBase eb = PowersManager.getEffectByIDString(IDString);
|
|
||||||
if (eb != null)
|
|
||||||
IDString = eb.getIDString();
|
|
||||||
|
|
||||||
animation = rs.getInt("animation");
|
|
||||||
PowersManager.AnimationOverrides.put(IDString, animation);
|
|
||||||
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -136,6 +136,12 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
|||||||
int cityUID = rs.getInt("cityUUID");
|
int cityUID = rs.getInt("cityUUID");
|
||||||
JSONObject jsonObject = new JSONObject(rs.getString("warehouse"));
|
JSONObject jsonObject = new JSONObject(rs.getString("warehouse"));
|
||||||
City city = City.getCity(cityUID);
|
City city = City.getCity(cityUID);
|
||||||
|
|
||||||
|
if (city == null) {
|
||||||
|
Logger.error("No city " + cityUID + " for warehouse");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
city.warehouse = new Warehouse(jsonObject);
|
city.warehouse = new Warehouse(jsonObject);
|
||||||
city.warehouse.city = city;
|
city.warehouse.city = city;
|
||||||
|
|
||||||
@@ -192,6 +198,7 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
|||||||
// via the client interface.
|
// via the client interface.
|
||||||
|
|
||||||
ArrayList<WorkOrder> submitList = new ArrayList<>();
|
ArrayList<WorkOrder> submitList = new ArrayList<>();
|
||||||
|
ArrayList<WorkOrder> orphanList = new ArrayList<>();
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
try (Connection connection = DbManager.getConnection();
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_workorders`;");
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `dyn_workorders`;");
|
||||||
@@ -209,7 +216,14 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
|||||||
// Submit new workOrders to the ForgeManager
|
// Submit new workOrders to the ForgeManager
|
||||||
|
|
||||||
for (WorkOrder workOrder : submitList) {
|
for (WorkOrder workOrder : submitList) {
|
||||||
|
|
||||||
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
|
DbManager.WarehouseQueries.DELETE_WORKORDER(workOrder);
|
||||||
|
|
||||||
|
// Delete but do not reconstitute orphan workOrders
|
||||||
|
|
||||||
|
if (workOrder.vendor == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
workOrder.workOrderID = ForgeManager.workOrderCounter.incrementAndGet();
|
workOrder.workOrderID = ForgeManager.workOrderCounter.incrementAndGet();
|
||||||
DbManager.WarehouseQueries.WRITE_WORKORDER(workOrder);
|
DbManager.WarehouseQueries.WRITE_WORKORDER(workOrder);
|
||||||
ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder);
|
ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder);
|
||||||
|
|||||||
@@ -104,67 +104,67 @@ public enum BuildingManager {
|
|||||||
if (building == null)
|
if (building == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
//cannot access destroyed buildings
|
||||||
if (building.getRank() == -1)
|
if (building.getRank() == -1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (IsOwner(building, player))
|
//admin characters can always access buildings
|
||||||
return true;
|
|
||||||
|
|
||||||
//individual friend.
|
|
||||||
|
|
||||||
if (building.getFriends() != null && building.getFriends().get(player.getObjectUUID()) != null)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
//Admins can access stuff
|
|
||||||
|
|
||||||
if (player.isCSR())
|
if (player.isCSR())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//Guild stuff
|
//owner can always access their own building
|
||||||
|
|
||||||
if (building.getGuild().isGuildLeader(player.getObjectUUID()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (building.getFriends().get(player.getGuild().getObjectUUID()) != null && building.getFriends().get(player.getGuild().getObjectUUID()).friendType == 8)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (building.getFriends().get(player.getGuild().getObjectUUID()) != null && building.getFriends().get(player.getGuild().getObjectUUID()).friendType == 9 && GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return Guild.sameGuild(building.getGuild(), player.getGuild()) && GuildStatusController.isGuildLeader(player.getGuildStatus());
|
|
||||||
|
|
||||||
//TODO test friends list once added
|
|
||||||
//does not meet above criteria. Cannot access.
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean playerCanManageNotFriends(PlayerCharacter player, Building building) {
|
|
||||||
|
|
||||||
//Player Can only Control Building if player is in Same Guild as Building and is higher rank than IC.
|
|
||||||
|
|
||||||
if (player == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (building == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (building.getRank() == -1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (IsOwner(building, player))
|
if (IsOwner(building, player))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
//Somehow guild leader check fails? lets check if Player is true Guild GL.
|
//check for default IC access if building belongs to same guild
|
||||||
if (building.getGuild() != null && building.getGuild().isGuildLeader(player.getObjectUUID()))
|
if(player.guild.equals(building.getGuild())) {
|
||||||
return true;
|
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() != null) {
|
||||||
|
switch (building.getBlueprint().getBuildingGroup()) {
|
||||||
|
case TOL:
|
||||||
|
case BARRACK:
|
||||||
|
case SPIRE:
|
||||||
|
case SHRINE:
|
||||||
|
case BANESTONE:
|
||||||
|
case MINE:
|
||||||
|
case WAREHOUSE:
|
||||||
|
case BULWARK:
|
||||||
|
case SIEGETENT:
|
||||||
|
if (GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
if (GuildStatusController.isGuildLeader(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!GuildStatusController.isGuildLeader(player.getGuildStatus()) && !GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
//check against friends list entries if any present
|
||||||
return false;
|
if (building.getFriends() != null) {
|
||||||
|
|
||||||
|
//check individuals
|
||||||
|
if (building.getFriends().get(player.getObjectUUID()) != null)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (building.getFriends().get(player.guild.objectUUID) != null) {
|
||||||
|
|
||||||
|
//check friend type for guild related access
|
||||||
|
switch (building.getFriends().get(player.guild.objectUUID).friendType) {
|
||||||
|
case 8: //full member
|
||||||
|
if (GuildStatusController.isFullMember(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case 9: //Inner Council
|
||||||
|
if (GuildStatusController.isInnerCouncil(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
if (GuildStatusController.isGuildLeader(player.getGuildStatus()))
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//did not meet access grant criteria, deny access
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized boolean lootBuilding(PlayerCharacter player, Building building) {
|
public static synchronized boolean lootBuilding(PlayerCharacter player, Building building) {
|
||||||
@@ -463,29 +463,19 @@ public enum BuildingManager {
|
|||||||
return GuildStatusController.isGuildLeader(player.getGuildStatus()) || GuildStatusController.isInnerCouncil(player.getGuildStatus());
|
return GuildStatusController.isGuildLeader(player.getGuildStatus()) || GuildStatusController.isInnerCouncil(player.getGuildStatus());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int GetAvailableGold(Building building) {
|
|
||||||
|
|
||||||
if (building.getStrongboxValue() == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (building.getStrongboxValue() < building.reserve)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return building.getStrongboxValue() - building.reserve;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean IsPlayerHostile(Building building, PlayerCharacter player) {
|
public static boolean IsPlayerHostile(Building building, PlayerCharacter player) {
|
||||||
|
|
||||||
//Nation Members and Guild members are not hostile.
|
|
||||||
// if (building.getGuild() != null){
|
|
||||||
// if (pc.getGuild() != null)
|
|
||||||
// if (building.getGuild().getObjectUUID() == pc.getGuildUUID()
|
|
||||||
// || pc.getGuild().getNation().getObjectUUID() == building.getGuild().getNation().getObjectUUID())
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
if (Guild.sameNationExcludeErrant(building.getGuild(), player.getGuild()))
|
if (Guild.sameNationExcludeErrant(building.getGuild(), player.getGuild()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if(building.enforceKOS) {
|
||||||
|
if (building.getCity() != null) {
|
||||||
|
Building TOL = building.getCity().getTOL();
|
||||||
|
if (TOL != null) {
|
||||||
|
building = TOL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!building.reverseKOS) {
|
if (!building.reverseKOS) {
|
||||||
|
|
||||||
Condemned condemn = building.getCondemned().get(player.getObjectUUID());
|
Condemned condemn = building.getCondemned().get(player.getObjectUUID());
|
||||||
@@ -808,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);
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import engine.job.JobContainer;
|
|||||||
import engine.job.JobScheduler;
|
import engine.job.JobScheduler;
|
||||||
import engine.jobs.AttackJob;
|
import engine.jobs.AttackJob;
|
||||||
import engine.jobs.DeferredPowerJob;
|
import engine.jobs.DeferredPowerJob;
|
||||||
import engine.math.Vector3f;
|
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
import engine.net.client.msg.TargetedActionMsg;
|
import engine.net.client.msg.TargetedActionMsg;
|
||||||
@@ -20,6 +19,7 @@ import engine.net.client.msg.UpdateStateMsg;
|
|||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.DamageShield;
|
import engine.powers.DamageShield;
|
||||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
|
import engine.powers.effectmodifiers.WeaponProcEffectModifier;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -124,9 +124,9 @@ public enum CombatManager {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
//check if this slot is on attack timer, if timer has passed clear it, else early exit
|
//check if this slot is on attack timer, if timer has passed clear it, else early exit
|
||||||
if(attacker.getTimers().containsKey("Attack"+slot.name()))
|
if (attacker.getTimers() != null && attacker.getTimers().containsKey("Attack" + slot.name()))
|
||||||
if(attacker.getTimers().get("Attack"+slot.name()).timeToExecutionLeft() <= 0)
|
if (attacker.getTimers().get("Attack" + slot.name()).timeToExecutionLeft() <= 0)
|
||||||
attacker.getTimers().remove("Attack"+slot.name());
|
attacker.getTimers().remove("Attack" + slot.name());
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -156,12 +156,12 @@ public enum CombatManager {
|
|||||||
|
|
||||||
boolean inRange = false;
|
boolean inRange = false;
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
||||||
attackRange += ((AbstractCharacter)target).calcHitBox();
|
attackRange += ((AbstractCharacter) target).calcHitBox();
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(attackRange > 15 && attacker.isMoving()){
|
if (attackRange > 15 && attacker.isMoving()) {
|
||||||
//cannot shoot bow while moving;
|
//cannot shoot bow while moving;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -169,23 +169,23 @@ public enum CombatManager {
|
|||||||
switch (target.getObjectType()) {
|
switch (target.getObjectType()) {
|
||||||
case PlayerCharacter:
|
case PlayerCharacter:
|
||||||
attackRange += ((PlayerCharacter) target).getCharacterHeight() * 0.5f;
|
attackRange += ((PlayerCharacter) target).getCharacterHeight() * 0.5f;
|
||||||
if (distanceSquared < attackRange * attackRange)
|
if (distanceSquared <= attackRange * attackRange)
|
||||||
inRange = true;
|
inRange = true;
|
||||||
break;
|
break;
|
||||||
case Mob:
|
case Mob:
|
||||||
attackRange += ((AbstractCharacter) target).calcHitBox();
|
attackRange += ((AbstractCharacter) target).calcHitBox();
|
||||||
if (distanceSquared < attackRange * attackRange)
|
if (distanceSquared <= attackRange * attackRange)
|
||||||
inRange = true;
|
inRange = true;
|
||||||
break;
|
break;
|
||||||
case Building:
|
case Building:
|
||||||
if(attackRange > 15){
|
if (attackRange > 15) {
|
||||||
float rangeSquared = (attackRange + target.getBounds().getHalfExtents().x) * (attackRange + target.getBounds().getHalfExtents().x);
|
float rangeSquared = (attackRange + target.getBounds().getHalfExtents().x) * (attackRange + target.getBounds().getHalfExtents().x);
|
||||||
//float distanceSquared = attacker.loc.distanceSquared(target.loc);
|
//float distanceSquared = attacker.loc.distanceSquared(target.loc);
|
||||||
if(distanceSquared < rangeSquared) {
|
if (distanceSquared < rangeSquared) {
|
||||||
inRange = true;
|
inRange = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
float locX = target.loc.x - target.getBounds().getHalfExtents().x;
|
float locX = target.loc.x - target.getBounds().getHalfExtents().x;
|
||||||
float locZ = target.loc.z - target.getBounds().getHalfExtents().y;
|
float locZ = target.loc.z - target.getBounds().getHalfExtents().y;
|
||||||
float sizeX = (target.getBounds().getHalfExtents().x + attackRange) * 2;
|
float sizeX = (target.getBounds().getHalfExtents().x + attackRange) * 2;
|
||||||
@@ -202,7 +202,7 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (weapon != null) {
|
if (weapon != null) {
|
||||||
|
|
||||||
int wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
float wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
||||||
|
|
||||||
if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None) != 0f) //add weapon speed bonus
|
if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None) != 0f) //add weapon speed bonus
|
||||||
wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None));
|
wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None));
|
||||||
@@ -213,7 +213,7 @@ public enum CombatManager {
|
|||||||
if (wepSpeed < 10)
|
if (wepSpeed < 10)
|
||||||
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
|
||||||
|
|
||||||
delay = wepSpeed * 100L;
|
delay = (long)wepSpeed * 100L;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
||||||
@@ -221,6 +221,16 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (inRange) {
|
if (inRange) {
|
||||||
|
|
||||||
|
if(attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)){
|
||||||
|
if(!attacker.getTimestamps().contains(slot.name()+"Attack")){
|
||||||
|
attacker.getTimestamps().put(slot.name()+"Attack", System.currentTimeMillis() - 1000);
|
||||||
|
} else if(System.currentTimeMillis() < attacker.getTimestamps().get(slot.name()+"Attack") + delay){
|
||||||
|
setAutoAttackJob(attacker,slot,delay);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//handle retaliate
|
//handle retaliate
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
if (AbstractCharacter.IsAbstractCharacter(target)) {
|
||||||
if (((AbstractCharacter) target).combatTarget == null || !((AbstractCharacter) target).combatTarget.isAlive()) {
|
if (((AbstractCharacter) target).combatTarget == null || !((AbstractCharacter) target).combatTarget.isAlive()) {
|
||||||
@@ -264,6 +274,22 @@ public enum CombatManager {
|
|||||||
atr = attacker.atrHandTwo;
|
atr = attacker.atrHandTwo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//apply weapon powers before early exit for miss or passives
|
||||||
|
DeferredPowerJob dpj = null;
|
||||||
|
|
||||||
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||||
|
|
||||||
|
dpj = ((PlayerCharacter) attacker).getWeaponPower();
|
||||||
|
|
||||||
|
if (dpj != null) {
|
||||||
|
dpj.attack(target, attackRange);
|
||||||
|
|
||||||
|
if (dpj.getPower() != null && (dpj.getPowerToken() == -1851459567 || dpj.getPowerToken() == -1851489518))
|
||||||
|
((PlayerCharacter) attacker).setWeaponPower(dpj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int def = 0;
|
int def = 0;
|
||||||
|
|
||||||
if (AbstractCharacter.IsAbstractCharacter(target))
|
if (AbstractCharacter.IsAbstractCharacter(target))
|
||||||
@@ -293,7 +319,7 @@ public enum CombatManager {
|
|||||||
DispatchManager.sendToAllInRange(attacker, msg);
|
DispatchManager.sendToAllInRange(attacker, msg);
|
||||||
|
|
||||||
//we need to send the animation even if the attacker misses
|
//we need to send the animation even if the attacker misses
|
||||||
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template,null,slot));
|
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template, null, slot));
|
||||||
DispatchManager.sendToAllInRange(target, cmm);
|
DispatchManager.sendToAllInRange(target, cmm);
|
||||||
|
|
||||||
//set auto attack job
|
//set auto attack job
|
||||||
@@ -332,12 +358,18 @@ public enum CombatManager {
|
|||||||
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
|
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
|
||||||
DispatchManager.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
DispatchManager.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||||
|
|
||||||
|
//we need to send the animation even if the attacker misses
|
||||||
|
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template, null, slot));
|
||||||
|
DispatchManager.sendToAllInRange(target, cmm);
|
||||||
//set auto attack job
|
//set auto attack job
|
||||||
setAutoAttackJob(attacker, slot, delay);
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//check for proccing
|
||||||
|
checkForProc(attacker,target,weapon);
|
||||||
|
|
||||||
//calculate the base damage
|
//calculate the base damage
|
||||||
int damage = ThreadLocalRandom.current().nextInt(min, max + 1);
|
int damage = ThreadLocalRandom.current().nextInt(min, max + 1);
|
||||||
if (damage == 0) {
|
if (damage == 0) {
|
||||||
@@ -345,7 +377,7 @@ public enum CombatManager {
|
|||||||
setAutoAttackJob(attacker, slot, delay);
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(attacker.getObjectType().equals(mbEnums.GameObjectType.Mob) && ((Mob)attacker).isPet())
|
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob) && ((Mob) attacker).isPet())
|
||||||
calculatePetDamage(attacker);
|
calculatePetDamage(attacker);
|
||||||
|
|
||||||
//get the damage type
|
//get the damage type
|
||||||
@@ -414,6 +446,9 @@ public enum CombatManager {
|
|||||||
|
|
||||||
if (resists.immuneTo(damageType)) {
|
if (resists.immuneTo(damageType)) {
|
||||||
//set auto attack job
|
//set auto attack job
|
||||||
|
//we need to send the animation even if the attacker misses
|
||||||
|
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) 0, getSwingAnimation(weapon.template, null, slot));
|
||||||
|
DispatchManager.sendToAllInRange(target, cmm);
|
||||||
setAutoAttackJob(attacker, slot, delay);
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -446,20 +481,6 @@ public enum CombatManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DeferredPowerJob dpj = null;
|
|
||||||
|
|
||||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
|
||||||
|
|
||||||
dpj = ((PlayerCharacter) attacker).getWeaponPower();
|
|
||||||
|
|
||||||
if (dpj != null) {
|
|
||||||
dpj.attack(target, attackRange);
|
|
||||||
|
|
||||||
if (dpj.getPower() != null && (dpj.getPowerToken() == -1851459567 || dpj.getPowerToken() == -1851489518))
|
|
||||||
((PlayerCharacter) attacker).setWeaponPower(dpj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//set auto attack job
|
//set auto attack job
|
||||||
setAutoAttackJob(attacker, slot, delay);
|
setAutoAttackJob(attacker, slot, delay);
|
||||||
|
|
||||||
@@ -537,7 +558,7 @@ public enum CombatManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Item has no equipment slots and should not try to return an animation, return default instead
|
//Item has no equipment slots and should not try to return an animation, return default instead
|
||||||
if(wb.item_eq_slots_or == null || wb.item_eq_slots_or.size() == 0){
|
if (wb.item_eq_slots_or == null || wb.item_eq_slots_or.isEmpty()) {
|
||||||
return 75;
|
return 75;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,15 +567,15 @@ public enum CombatManager {
|
|||||||
int random;
|
int random;
|
||||||
|
|
||||||
//Item can only be equipped in one slot, return animation for that slot
|
//Item can only be equipped in one slot, return animation for that slot
|
||||||
if(wb.item_eq_slots_or.size() == 1){
|
if (wb.item_eq_slots_or.size() == 1) {
|
||||||
if (wb.item_eq_slots_or.iterator().next().equals(mbEnums.EquipSlotType.RHELD)) {
|
if (wb.item_eq_slots_or.iterator().next().equals(mbEnums.EquipSlotType.RHELD)) {
|
||||||
anim = wb.weapon_attack_anim_right.get(0)[0];
|
anim = wb.weapon_attack_anim_right.get(0)[0];
|
||||||
if (dpj != null) {
|
if (dpj != null) {
|
||||||
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_right.size());
|
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_right.size());
|
||||||
anim = wb.weapon_attack_anim_right.get(random)[0];
|
anim = wb.weapon_attack_anim_right.get(random)[0];
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
anim = wb.weapon_attack_anim_left.get(0)[0];
|
anim = wb.weapon_attack_anim_left.get(0)[0];
|
||||||
if (dpj != null) {
|
if (dpj != null) {
|
||||||
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_left.size());
|
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_left.size());
|
||||||
anim = wb.weapon_attack_anim_left.get(random)[0];
|
anim = wb.weapon_attack_anim_left.get(random)[0];
|
||||||
@@ -570,7 +591,7 @@ public enum CombatManager {
|
|||||||
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_right.size());
|
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_right.size());
|
||||||
anim = wb.weapon_attack_anim_right.get(random)[0];
|
anim = wb.weapon_attack_anim_right.get(random)[0];
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
anim = wb.weapon_attack_anim_left.get(0)[0];
|
anim = wb.weapon_attack_anim_left.get(0)[0];
|
||||||
if (dpj != null) {
|
if (dpj != null) {
|
||||||
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_left.size());
|
random = ThreadLocalRandom.current().nextInt(wb.weapon_attack_anim_left.size());
|
||||||
@@ -580,8 +601,8 @@ public enum CombatManager {
|
|||||||
return anim;
|
return anim;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getPassiveAnimation(mbEnums.PassiveType passiveType){
|
public static int getPassiveAnimation(mbEnums.PassiveType passiveType) {
|
||||||
switch(passiveType){
|
switch (passiveType) {
|
||||||
case Block:
|
case Block:
|
||||||
return COMBAT_BLOCK_ANIMATION;
|
return COMBAT_BLOCK_ANIMATION;
|
||||||
case Parry:
|
case Parry:
|
||||||
@@ -596,7 +617,7 @@ public enum CombatManager {
|
|||||||
public static void setAutoAttackJob(AbstractCharacter attacker, mbEnums.EquipSlotType slot, long delay) {
|
public static void setAutoAttackJob(AbstractCharacter attacker, mbEnums.EquipSlotType slot, long delay) {
|
||||||
//calculate next allowed attack and update the timestamp
|
//calculate next allowed attack and update the timestamp
|
||||||
|
|
||||||
if(attacker.getTimestamps().containsKey("Attack" + slot.name()) && attacker.getTimestamps().get("Attack" + slot.name()) > System.currentTimeMillis())
|
if (attacker.getTimestamps().containsKey("Attack" + slot.name()) && attacker.getTimestamps().get("Attack" + slot.name()) > System.currentTimeMillis())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
attacker.getTimestamps().put("Attack" + slot.name(), System.currentTimeMillis() + delay);
|
attacker.getTimestamps().put("Attack" + slot.name(), System.currentTimeMillis() + delay);
|
||||||
@@ -613,6 +634,7 @@ public enum CombatManager {
|
|||||||
Logger.error("Unable to find Timers for Character " + attacker.getObjectUUID());
|
Logger.error("Unable to find Timers for Character " + attacker.getObjectUUID());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int calculatePetDamage(AbstractCharacter agent) {
|
public static int calculatePetDamage(AbstractCharacter agent) {
|
||||||
//damage calc for pet
|
//damage calc for pet
|
||||||
float range;
|
float range;
|
||||||
@@ -627,6 +649,7 @@ public enum CombatManager {
|
|||||||
damage = min + ((ThreadLocalRandom.current().nextFloat() * range) + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
damage = min + ((ThreadLocalRandom.current().nextFloat() * range) + (ThreadLocalRandom.current().nextFloat() * range)) / 2;
|
||||||
return (int) (damage * dmgMultiplier);
|
return (int) (damage * dmgMultiplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getMinDmg(double min, AbstractCharacter agent) {
|
public static double getMinDmg(double min, AbstractCharacter agent) {
|
||||||
int primary = agent.getStatStrCurrent();
|
int primary = agent.getStatStrCurrent();
|
||||||
int secondary = agent.getStatDexCurrent();
|
int secondary = agent.getStatDexCurrent();
|
||||||
@@ -634,6 +657,7 @@ public enum CombatManager {
|
|||||||
int masteryLevel = 0;
|
int masteryLevel = 0;
|
||||||
return min * (pow(0.0048 * primary + .049 * (primary - 0.75), 0.5) + pow(0.0066 * secondary + 0.064 * (secondary - 0.75), 0.5) + +0.01 * (focusLevel + masteryLevel));
|
return min * (pow(0.0048 * primary + .049 * (primary - 0.75), 0.5) + pow(0.0066 * secondary + 0.064 * (secondary - 0.75), 0.5) + +0.01 * (focusLevel + masteryLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static double getMaxDmg(double max, AbstractCharacter agent) {
|
public static double getMaxDmg(double max, AbstractCharacter agent) {
|
||||||
int primary = agent.getStatStrCurrent();
|
int primary = agent.getStatStrCurrent();
|
||||||
int secondary = agent.getStatDexCurrent();
|
int secondary = agent.getStatDexCurrent();
|
||||||
@@ -641,4 +665,20 @@ public enum CombatManager {
|
|||||||
int masteryLevel = 0;
|
int masteryLevel = 0;
|
||||||
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
return max * (pow(0.0124 * primary + 0.118 * (primary - 0.75), 0.5) + pow(0.0022 * secondary + 0.028 * (secondary - 0.75), 0.5) + 0.0075 * (focusLevel + masteryLevel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void checkForProc(AbstractCharacter attacker, AbstractWorldObject target, Item weapon){
|
||||||
|
|
||||||
|
if(weapon == null) // cant proc without a weapon
|
||||||
|
return;
|
||||||
|
|
||||||
|
for(Effect eff : weapon.effects.values()){
|
||||||
|
for(AbstractEffectModifier mod : eff.getEffectsBase().getModifiers()){
|
||||||
|
if(mod.modType.equals(mbEnums.ModType.WeaponProc))
|
||||||
|
if(ThreadLocalRandom.current().nextInt(0,101) < 6)
|
||||||
|
((WeaponProcEffectModifier)mod).applyProc(attacker,target);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -11,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;
|
||||||
@@ -164,6 +167,13 @@ public enum ConfigManager {
|
|||||||
Logger.info("Compiling regex");
|
Logger.info("Compiling regex");
|
||||||
|
|
||||||
regex.put(MB_LOGIN_FNAME_REGEX, Pattern.compile(MB_LOGIN_FNAME_REGEX.getValue()));
|
regex.put(MB_LOGIN_FNAME_REGEX, Pattern.compile(MB_LOGIN_FNAME_REGEX.getValue()));
|
||||||
|
|
||||||
|
Logger.info("Loading WPAK data");
|
||||||
|
|
||||||
|
//EffectsParser.parseWpakFile();
|
||||||
|
//PowersParser.parseWpakFile();
|
||||||
|
//PowerActionParser.parseWpakFile();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,8 +69,6 @@ public enum DbManager {
|
|||||||
public static final dbBlueprintHandler BlueprintQueries = new dbBlueprintHandler();
|
public static final dbBlueprintHandler BlueprintQueries = new dbBlueprintHandler();
|
||||||
public static final dbShrineHandler ShrineQueries = new dbShrineHandler();
|
public static final dbShrineHandler ShrineQueries = new dbShrineHandler();
|
||||||
public static final dbRunegateHandler RunegateQueries = new dbRunegateHandler();
|
public static final dbRunegateHandler RunegateQueries = new dbRunegateHandler();
|
||||||
|
|
||||||
public static final dbPowerHandler PowerQueries = new dbPowerHandler();
|
|
||||||
public static final dbPetitionHandler PetitionQueries = new dbPetitionHandler();
|
public static final dbPetitionHandler PetitionQueries = new dbPetitionHandler();
|
||||||
private static final EnumMap<GameObjectType, ConcurrentHashMap<Integer, AbstractGameObject>> objectCache = new EnumMap<>(GameObjectType.class);
|
private static final EnumMap<GameObjectType, ConcurrentHashMap<Integer, AbstractGameObject>> objectCache = new EnumMap<>(GameObjectType.class);
|
||||||
public static Hasher hasher;
|
public static Hasher hasher;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public enum ForgeManager implements Runnable {
|
|||||||
// Early exit for completed workOrders loaded from disk
|
// Early exit for completed workOrders loaded from disk
|
||||||
// or vendors who were re-deeded with items still cooking.
|
// or vendors who were re-deeded with items still cooking.
|
||||||
|
|
||||||
if (workOrder.vendor == null && workOrder.runCompleted.get())
|
if (workOrder.vendor == null || workOrder.runCompleted.get())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// This workOrder has completed production.
|
// This workOrder has completed production.
|
||||||
@@ -265,12 +265,12 @@ public enum ForgeManager implements Runnable {
|
|||||||
|
|
||||||
// Assign a prefix and suffix to this item if random rolled
|
// Assign a prefix and suffix to this item if random rolled
|
||||||
|
|
||||||
if (workOrder.prefixToken == 0)
|
if (workOrder.prefixToken == 0 && workOrder.vendor.getItemModTable().contains((template.modTable)))
|
||||||
forgedItem.prefixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.PREFIX, template.modTable);
|
forgedItem.prefixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.PREFIX, template.modTable);
|
||||||
else
|
else
|
||||||
forgedItem.prefixToken = workOrder.prefixToken;
|
forgedItem.prefixToken = workOrder.prefixToken;
|
||||||
|
|
||||||
if (workOrder.suffixToken == 0)
|
if (workOrder.suffixToken == 0 && workOrder.vendor.getItemModTable().contains((template.modTable)))
|
||||||
forgedItem.suffixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.SUFFIX, template.modTable);
|
forgedItem.suffixToken = calcRandomMod(workOrder.vendor, mbEnums.ItemModType.SUFFIX, template.modTable);
|
||||||
else
|
else
|
||||||
forgedItem.suffixToken = workOrder.suffixToken;
|
forgedItem.suffixToken = workOrder.suffixToken;
|
||||||
@@ -393,6 +393,12 @@ public enum ForgeManager implements Runnable {
|
|||||||
if (rollForModifier < 80) {
|
if (rollForModifier < 80) {
|
||||||
int randomModifier = LootManager.TableRoll(vendor.getLevel(), false);
|
int randomModifier = LootManager.TableRoll(vendor.getLevel(), false);
|
||||||
modTableEntry = ModTableEntry.rollTable(modTypeTableEntry.modTableID, randomModifier);
|
modTableEntry = ModTableEntry.rollTable(modTypeTableEntry.modTableID, randomModifier);
|
||||||
|
|
||||||
|
// @TODO : Figure out how a null can be returned from a defined set.
|
||||||
|
|
||||||
|
if (modTableEntry == null)
|
||||||
|
return 0;
|
||||||
|
|
||||||
EffectsBase effectsBase = PowersManager.getEffectByIDString(modTableEntry.action);
|
EffectsBase effectsBase = PowersManager.getEffectByIDString(modTableEntry.action);
|
||||||
modifier = effectsBase.getToken();
|
modifier = effectsBase.getToken();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public enum ItemManager {
|
|||||||
if (characterSkill == null)
|
if (characterSkill == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (characterSkill.getModifiedAmountBeforeMods() > required_value)
|
if (characterSkill.getModifiedAmountBeforeMods() >= required_value)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ package engine.gameManager;
|
|||||||
|
|
||||||
import engine.InterestManagement.Terrain;
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.db.handlers.dbEffectsBaseHandler;
|
|
||||||
import engine.db.handlers.dbPowerHandler;
|
|
||||||
import engine.db.handlers.dbSkillReqHandler;
|
import engine.db.handlers.dbSkillReqHandler;
|
||||||
import engine.job.AbstractJob;
|
import engine.job.AbstractJob;
|
||||||
import engine.job.AbstractScheduleJob;
|
import engine.job.AbstractScheduleJob;
|
||||||
@@ -29,8 +27,14 @@ import engine.net.client.ClientConnection;
|
|||||||
import engine.net.client.msg.*;
|
import engine.net.client.msg.*;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.*;
|
import engine.powers.*;
|
||||||
import engine.powers.poweractions.AbstractPowerAction;
|
import engine.powers.poweractions.*;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
|
import engine.wpak.EffectsParser;
|
||||||
|
import engine.wpak.PowerActionParser;
|
||||||
|
import engine.wpak.PowersParser;
|
||||||
|
import engine.wpak.WpakPowerManager;
|
||||||
|
import engine.wpak.data.Effect;
|
||||||
|
import engine.wpak.data.PowerAction;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -53,7 +57,6 @@ public enum PowersManager {
|
|||||||
public static HashMap<String, AbstractPowerAction> powerActionsByIDString = new HashMap<>();
|
public static HashMap<String, AbstractPowerAction> powerActionsByIDString = new HashMap<>();
|
||||||
public static HashMap<Integer, AbstractPowerAction> powerActionsByID = new HashMap<>();
|
public static HashMap<Integer, AbstractPowerAction> powerActionsByID = new HashMap<>();
|
||||||
public static HashMap<String, Integer> ActionTokenByIDString = new HashMap<>();
|
public static HashMap<String, Integer> ActionTokenByIDString = new HashMap<>();
|
||||||
public static HashMap<String, Integer> AnimationOverrides = new HashMap<>();
|
|
||||||
public static HashMap<Integer, ArrayList<RunePowerEntry>> _allRunePowers;
|
public static HashMap<Integer, ArrayList<RunePowerEntry>> _allRunePowers;
|
||||||
public static HashMap<Integer, ArrayList<RuneSkillAdjustEntry>> _allRuneSkillAdjusts;
|
public static HashMap<Integer, ArrayList<RuneSkillAdjustEntry>> _allRuneSkillAdjusts;
|
||||||
public static HashMap<String, HashMap<ResourceType, Integer>> _effect_costMaps = new HashMap<>();
|
public static HashMap<String, HashMap<ResourceType, Integer>> _effect_costMaps = new HashMap<>();
|
||||||
@@ -112,33 +115,150 @@ public enum PowersManager {
|
|||||||
return powerEntries;
|
return powerEntries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void InitializeEffects(){
|
||||||
|
// Add EffectsBase
|
||||||
|
ArrayList<EffectsBase> effectList = new ArrayList<>();
|
||||||
|
|
||||||
|
for (Effect entry : WpakPowerManager.effect_data.values()) {
|
||||||
|
EffectsBase effectBase = new EffectsBase(entry);
|
||||||
|
effectList.add(effectBase);
|
||||||
|
PowersManager.effectsBaseByToken.put(effectBase.getToken(), effectBase);
|
||||||
|
PowersManager.effectsBaseByIDString.put(effectBase.getIDString(), effectBase);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void InitializePowerActions(){
|
||||||
|
// Add PowerActions
|
||||||
|
//AbstractPowerAction.getAllPowerActions(PowersManager.powerActionsByIDString, PowersManager.powerActionsByID, PowersManager.effectsBaseByIDString);
|
||||||
|
|
||||||
|
HashMap<String, EffectsBase> effects = PowersManager.effectsBaseByIDString;
|
||||||
|
|
||||||
|
for (PowerAction powerAction : WpakPowerManager.power_actions.values()) {
|
||||||
|
AbstractPowerAction apa;
|
||||||
|
String type = powerAction.action_type;
|
||||||
|
String IDString = powerAction.action_id;
|
||||||
|
int token = DbManager.hasher.SBStringHash(IDString);
|
||||||
|
//cache token, used for applying effects.
|
||||||
|
PowersManager.ActionTokenByIDString.put(IDString, token);
|
||||||
|
apa = null;
|
||||||
|
switch (type) {
|
||||||
|
default:
|
||||||
|
Logger.error("valid type not found for poweraction of ID" + IDString);
|
||||||
|
break;
|
||||||
|
case "ApplyEffect":
|
||||||
|
apa = new ApplyEffectPowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "ApplyEffects":
|
||||||
|
apa = new ApplyEffectsPowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "DeferredPower":
|
||||||
|
apa = new DeferredPowerPowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "DamageOverTime":
|
||||||
|
apa = new DamageOverTimePowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "Peek":
|
||||||
|
apa = new PeekPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Charm":
|
||||||
|
apa = new CharmPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Fear":
|
||||||
|
apa = new FearPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Confusion":
|
||||||
|
apa = new ConfusionPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "RemoveEffect":
|
||||||
|
apa = new RemoveEffectPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Track":
|
||||||
|
apa = new TrackPowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "DirectDamage":
|
||||||
|
apa = new DirectDamagePowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "Transform":
|
||||||
|
apa = new TransformPowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "CreateMob":
|
||||||
|
apa = new CreateMobPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Invis":
|
||||||
|
apa = new InvisPowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "ClearNearbyAggro":
|
||||||
|
apa = new ClearNearbyAggroPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "MobRecall":
|
||||||
|
apa = new MobRecallPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "SetItemFlag":
|
||||||
|
apa = new SetItemFlagPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "SimpleDamage":
|
||||||
|
apa = new SimpleDamagePowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "TransferStatOT":
|
||||||
|
apa = new TransferStatOTPowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "TransferStat":
|
||||||
|
apa = new TransferStatPowerAction(powerAction, effects);
|
||||||
|
break;
|
||||||
|
case "Teleport":
|
||||||
|
apa = new TeleportPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "TreeChoke":
|
||||||
|
apa = new TreeChokePowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Block":
|
||||||
|
apa = new BlockPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Resurrect":
|
||||||
|
apa = new ResurrectPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "ClearAggro":
|
||||||
|
apa = new ClearAggroPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "ClaimMine":
|
||||||
|
apa = new ClaimMinePowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Recall":
|
||||||
|
apa = new RecallPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "SpireDisable":
|
||||||
|
apa = new SpireDisablePowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Steal":
|
||||||
|
apa = new StealPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "Summon":
|
||||||
|
apa = new SummonPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "RunegateTeleport":
|
||||||
|
apa = new RunegateTeleportPowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
case "OpenGate":
|
||||||
|
apa = new OpenGatePowerAction(powerAction);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
PowersManager.powerActionsByIDString.put(IDString, apa);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This pre-loads all powers and effects
|
// This pre-loads all powers and effects
|
||||||
public static void InitializePowers() {
|
public static void InitializePowers() {
|
||||||
|
|
||||||
// Add EffectsBase
|
EffectsParser.parseWpakFile();
|
||||||
ArrayList<EffectsBase> ebList = dbEffectsBaseHandler.getAllEffectsBase();
|
PowersParser.parseWpakFile();
|
||||||
|
PowerActionParser.parseWpakFile();
|
||||||
|
|
||||||
for (EffectsBase eb : ebList) {
|
//Initialize Effects Data
|
||||||
PowersManager.effectsBaseByToken.put(eb.getToken(), eb);
|
InitializeEffects();
|
||||||
PowersManager.effectsBaseByIDString.put(eb.getIDString(), eb);
|
|
||||||
|
|
||||||
}
|
//Initialize Power Actions
|
||||||
|
InitializePowerActions();
|
||||||
// Add Fail Conditions
|
|
||||||
EffectsBase.getFailConditions(PowersManager.effectsBaseByIDString);
|
|
||||||
|
|
||||||
// Add Modifiers to Effects
|
|
||||||
dbEffectsBaseHandler.cacheAllEffectModifiers();
|
|
||||||
|
|
||||||
// Add Source Types to Effects
|
|
||||||
dbPowerHandler.addAllSourceTypes();
|
|
||||||
dbPowerHandler.addAllAnimationOverrides();
|
|
||||||
|
|
||||||
// Add PowerActions
|
|
||||||
AbstractPowerAction.getAllPowerActions(PowersManager.powerActionsByIDString, PowersManager.powerActionsByID, PowersManager.effectsBaseByIDString);
|
|
||||||
|
|
||||||
// Load valid Item Flags
|
|
||||||
// AbstractPowerAction.loadValidItemFlags(PowersManager.powerActionsByIDString);
|
|
||||||
|
|
||||||
// get all PowersBase
|
// get all PowersBase
|
||||||
ArrayList<PowersBase> pbList = dbSkillReqHandler.getAllPowersBase();
|
ArrayList<PowersBase> pbList = dbSkillReqHandler.getAllPowersBase();
|
||||||
@@ -159,16 +279,6 @@ public enum PowersManager {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EffectsBase setEffectToken(int ID, int token) {
|
|
||||||
for (EffectsBase eb : PowersManager.effectsBaseByIDString.values()) {
|
|
||||||
if (eb.getUUID() == ID) {
|
|
||||||
eb.setToken(token);
|
|
||||||
return eb;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void usePower(final PerformActionMsg msg, ClientConnection origin,
|
public static void usePower(final PerformActionMsg msg, ClientConnection origin,
|
||||||
boolean sendCastToSelf) {
|
boolean sendCastToSelf) {
|
||||||
|
|
||||||
@@ -176,12 +286,29 @@ public enum PowersManager {
|
|||||||
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
|
PowersBase pb = PowersManager.powersBaseByToken.get(msg.getPowerUsedID());
|
||||||
PlayerCharacter caster = origin.getPlayerCharacter();
|
PlayerCharacter caster = origin.getPlayerCharacter();
|
||||||
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID());
|
PlayerCharacter target = PlayerCharacter.getFromCache(msg.getTargetID());
|
||||||
if (pb != null && pb.isHarmful == false) {
|
if (pb != null && pb.enforceLore()) {
|
||||||
//if (caster.guild.equals(Guild.getErrantGuild()))
|
//if (caster.guild.equals(Guild.getErrantGuild()))
|
||||||
// return;
|
// return;
|
||||||
|
|
||||||
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false)
|
if (target != null && caster.guild.getGuildType().equals(target.guild.getGuildType()) == false && target.getObjectType().equals(GameObjectType.Building) == false) {
|
||||||
|
RecyclePowerMsg recyclePowerMsg = new RecyclePowerMsg(msg.getPowerUsedID());
|
||||||
|
Dispatch dispatch = Dispatch.borrow(origin.getPlayerCharacter(), recyclePowerMsg);
|
||||||
|
DispatchManager.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
|
||||||
|
|
||||||
|
// Send Fail to cast message
|
||||||
|
PlayerCharacter pc = SessionManager
|
||||||
|
.getPlayerCharacter(origin);
|
||||||
|
|
||||||
|
if (pc != null) {
|
||||||
|
sendPowerMsg(pc, 2, msg);
|
||||||
|
if (pc.isCasting()) {
|
||||||
|
pc.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
pc.setIsCasting(false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -908,10 +1035,6 @@ public enum PowersManager {
|
|||||||
if (pb.isHarmful())
|
if (pb.isHarmful())
|
||||||
mobTarget.handleDirectAggro(playerCharacter);
|
mobTarget.handleDirectAggro(playerCharacter);
|
||||||
}
|
}
|
||||||
//Power is aiding a target, handle aggro if combat target is a Mob.
|
|
||||||
if (!pb.isHarmful() && target.getObjectType() == GameObjectType.PlayerCharacter) {
|
|
||||||
PlayerCharacter pcTarget = (PlayerCharacter) target;
|
|
||||||
}
|
|
||||||
|
|
||||||
// update target of used power timer
|
// update target of used power timer
|
||||||
|
|
||||||
@@ -933,8 +1056,7 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target, pb, trains)) {
|
if (ab.blocked(target,pb.vampDrain)) {
|
||||||
|
|
||||||
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
PowersManager.sendEffectMsg(playerCharacter, 5, ab, pb);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -945,7 +1067,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();
|
||||||
@@ -1109,7 +1231,7 @@ public enum PowersManager {
|
|||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
|
|
||||||
if (ab.blocked(target, pb, trains))
|
if (ab.blocked(target,pb.vampDrain))
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
String stackType = ab.getStackType();
|
String stackType = ab.getStackType();
|
||||||
@@ -1117,7 +1239,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();
|
||||||
@@ -1423,7 +1545,7 @@ public enum PowersManager {
|
|||||||
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
if (trains < ab.getMinTrains() || trains > ab.getMaxTrains())
|
||||||
continue;
|
continue;
|
||||||
// If something blocks the action, then stop
|
// If something blocks the action, then stop
|
||||||
if (ab.blocked(target, pb, trains))
|
if (ab.blocked(target,pb.vampDrain))
|
||||||
// sendPowerMsg(pc, 5, msg);
|
// sendPowerMsg(pc, 5, msg);
|
||||||
continue;
|
continue;
|
||||||
// TODO handle overwrite stack order here
|
// TODO handle overwrite stack order here
|
||||||
@@ -1431,7 +1553,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();
|
||||||
@@ -1878,7 +2000,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
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.job.AbstractScheduleJob;
|
|||||||
import engine.net.client.msg.PerformActionMsg;
|
import engine.net.client.msg.PerformActionMsg;
|
||||||
import engine.objects.PlayerCharacter;
|
import engine.objects.PlayerCharacter;
|
||||||
import engine.powers.PowersBase;
|
import engine.powers.PowersBase;
|
||||||
|
import engine.wpak.data.Power;
|
||||||
|
|
||||||
public class UsePowerJob extends AbstractScheduleJob {
|
public class UsePowerJob extends AbstractScheduleJob {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
|
||||||
|
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
|
||||||
|
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
|
||||||
|
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
|
||||||
|
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
|
||||||
|
// Magicbane Emulator Project © 2013 - 2022
|
||||||
|
// www.magicbane.com
|
||||||
|
|
||||||
|
|
||||||
|
package engine.jobs;
|
||||||
|
|
||||||
|
import engine.gameManager.PowersManager;
|
||||||
|
import engine.job.AbstractScheduleJob;
|
||||||
|
import engine.net.client.msg.PerformActionMsg;
|
||||||
|
import engine.objects.AbstractWorldObject;
|
||||||
|
import engine.objects.PlayerCharacter;
|
||||||
|
import engine.powers.PowersBase;
|
||||||
|
import engine.wpak.WpakPowerManager;
|
||||||
|
import engine.wpak.data.Power;
|
||||||
|
|
||||||
|
public class WpakUsePowerJob extends AbstractScheduleJob {
|
||||||
|
|
||||||
|
private final PlayerCharacter pc;
|
||||||
|
private final PerformActionMsg msg;
|
||||||
|
private AbstractWorldObject target;
|
||||||
|
|
||||||
|
public WpakUsePowerJob(PlayerCharacter pc, PerformActionMsg msg, AbstractWorldObject tar) {
|
||||||
|
super();
|
||||||
|
this.pc = pc;
|
||||||
|
this.msg = msg;
|
||||||
|
this.target = tar;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doJob() {
|
||||||
|
WpakPowerManager.finishUsePower(this.msg, this.pc,this.target);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void _cancelJob() {
|
||||||
|
//cast stopped early, reset recycle timer
|
||||||
|
PowersManager.finishRecycleTime(this.msg, this.pc, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -84,6 +84,11 @@ public class WorkOrder implements Delayed {
|
|||||||
this.completionTime = jsonWorkOrder.getLong("completionTime");
|
this.completionTime = jsonWorkOrder.getLong("completionTime");
|
||||||
this.runCompleted.set(jsonWorkOrder.getBoolean("runCompleted"));
|
this.runCompleted.set(jsonWorkOrder.getBoolean("runCompleted"));
|
||||||
|
|
||||||
|
// Vendor sanity check. Might have been deleted
|
||||||
|
|
||||||
|
if (this.vendor == null)
|
||||||
|
return;
|
||||||
|
|
||||||
JSONObject productionCostMap = jsonWorkOrder.getJSONObject("production_cost");
|
JSONObject productionCostMap = jsonWorkOrder.getJSONObject("production_cost");
|
||||||
|
|
||||||
for (String key : productionCostMap.keySet()) {
|
for (String key : productionCostMap.keySet()) {
|
||||||
@@ -107,6 +112,7 @@ public class WorkOrder implements Delayed {
|
|||||||
for (Object o : tokenList) {
|
for (Object o : tokenList) {
|
||||||
int prefix = ((JSONArray) o).getInt(0);
|
int prefix = ((JSONArray) o).getInt(0);
|
||||||
int suffix = ((JSONArray) o).getInt(1);
|
int suffix = ((JSONArray) o).getInt(1);
|
||||||
|
|
||||||
Item cookingItem = ForgeManager.forgeItem(this);
|
Item cookingItem = ForgeManager.forgeItem(this);
|
||||||
cookingItem.prefixToken = prefix;
|
cookingItem.prefixToken = prefix;
|
||||||
cookingItem.suffixToken = suffix;
|
cookingItem.suffixToken = suffix;
|
||||||
@@ -129,7 +135,8 @@ public class WorkOrder implements Delayed {
|
|||||||
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.item_wt))
|
if (!workOrder.vendor.charItemManager.hasRoomInventory(template.item_wt))
|
||||||
return 30; //30: That person cannot carry that item
|
return 30; //30: That person cannot carry that item
|
||||||
|
|
||||||
if (!workOrder.vendor.getItemModTable().contains((template.modTable)))
|
if ((workOrder.prefixToken != 0 || workOrder.suffixToken != 0) &&
|
||||||
|
!workOrder.vendor.getItemModTable().contains((template.modTable)))
|
||||||
return 59; //59: This hireling does not have this formula
|
return 59; //59: This hireling does not have this formula
|
||||||
|
|
||||||
if (!Warehouse.calcCostOverrun(workOrder).isEmpty())
|
if (!Warehouse.calcCostOverrun(workOrder).isEmpty())
|
||||||
|
|||||||
+99
-33
@@ -831,16 +831,22 @@ public class mbEnums {
|
|||||||
SPIRES,
|
SPIRES,
|
||||||
SNARE,
|
SNARE,
|
||||||
STUN,
|
STUN,
|
||||||
BLIND,
|
BLINDNESS,
|
||||||
ROOT,
|
ROOT,
|
||||||
FEAR,
|
FEAR,
|
||||||
CHARM,
|
CHARM,
|
||||||
POWERBLOCK,
|
POWERINHIBITOR,
|
||||||
DEBUFF,
|
DEBUFF,
|
||||||
STEAL,
|
STEAL,
|
||||||
DRAIN;
|
DRAIN;
|
||||||
|
|
||||||
public static DamageType getDamageType(String modName) {
|
public static DamageType getDamageType(String modName) {
|
||||||
|
if(modName.toLowerCase().equals("blind"))
|
||||||
|
modName = "BLINDNESS";
|
||||||
|
|
||||||
|
if(modName.toLowerCase().equals("powerblock"))
|
||||||
|
modName = "POWERINHIBITOR";
|
||||||
|
|
||||||
DamageType damageType;
|
DamageType damageType;
|
||||||
if (modName.isEmpty())
|
if (modName.isEmpty())
|
||||||
return DamageType.NONE;
|
return DamageType.NONE;
|
||||||
@@ -2715,42 +2721,45 @@ public class mbEnums {
|
|||||||
|
|
||||||
public enum ResourceType {
|
public enum ResourceType {
|
||||||
|
|
||||||
GOLD(7, 2308551, 100000000, 10),
|
GOLD(7, -1670881623, 2308551, 100000000, 50000),
|
||||||
ADAMANT(1580003, -1741189964, 1000, 10),
|
ADAMANT(1580003, 1557001525, -1741189964, 1000, 10),
|
||||||
AGATE(1580009, 75173057, 2000, 10),
|
AGATE(1580009, -1096157543, 75173057, 2000, 20),
|
||||||
ANTIMONY(1580014, 452320058, 1000, 10),
|
ANTIMONY(1580014, 1256147265, 452320058, 1000, 10),
|
||||||
AZOTH(1580012, 78329697, 2000, 10),
|
AZOTH(1580012, -1205326951, 78329697, 2000, 20),
|
||||||
BLOODSTONE(1580020, -1569826353, 500, 10),
|
BLOODSTONE(1580020, -1912381716, -1569826353, 500, 5),
|
||||||
BRONZEWOOD(1580006, 1334770447, 500, 10),
|
BRONZEWOOD(1580006, -519681813, 1334770447, 1000, 30),
|
||||||
COAL(1580008, 2559427, 3000, 10),
|
COAL(1580008, -1672872311, 2559427, 3000, 30),
|
||||||
DIAMOND(1580010, -1730704107, 2000, 10),
|
DIAMOND(1580010, 1540225085, -1730704107, 2000, 20),
|
||||||
GALVOR(1580017, -1596311545, 2000, 10),
|
GALVOR(1580017, -1683992404, -1596311545, 2000, 5),
|
||||||
IRON(1580002, 2504297, 2000, 10),
|
IRON(1580002, -1673518119, 2504297, 2000, 20),
|
||||||
LUMBER(1580004, -1603256692, 10000, 10),
|
LUMBER(1580004, -1628412684, -1603256692, 10000, 100),
|
||||||
MANDRAKE(1580007, 1191391799, 1000, 10),
|
MANDRAKE(1580007, 1519910613, 1191391799, 1000, 10),
|
||||||
MITHRIL(1580021, -1761257186, 500, 10),
|
MITHRIL(1580021, 626743397, -1761257186, 500, 5),
|
||||||
OAK(1580005, 74767, 3000, 10),
|
OAK(1580005, -1653034775, 74767, 3000, 30),
|
||||||
OBSIDIAN(1580019, -697973233, 500, 10),
|
OBSIDIAN(1580019, 778019055, -697973233, 500, 5),
|
||||||
ONYX(1580011, 2977263, 1000, 10),
|
ONYX(1580011, -1675952151, 2977263, 1000, 10),
|
||||||
ORICHALK(1580013, -2036290524, 3000, 10),
|
ORICHALK(1580013, -1468730955, -2036290524, 3000, 30),
|
||||||
QUICKSILVER(1580016, -472884509, 1000, 10),
|
QUICKSILVER(1580016, -2081208434, -472884509, 1000, 10),
|
||||||
STONE(1580000, 74856115, 10000, 10),
|
STONE(1580000, -1094703863, 74856115, 10000, 100),
|
||||||
SULFUR(1580015, -1586349421, 1000, 10),
|
SULFUR(1580015, -1763687412, -1586349421, 1000, 10),
|
||||||
TRUESTEEL(1580001, -317484979, 2000, 10),
|
TRUESTEEL(1580001, -169012482, -317484979, 2000, 20),
|
||||||
WORMWOOD(1580018, 1532478436, 500, 10);
|
WORMWOOD(1580018, 1204785075, 1532478436, 500, 5);
|
||||||
|
|
||||||
public static HashMap<Integer, ResourceType> resourceLookup = new HashMap<>();
|
public static HashMap<Integer, ResourceType> templateLookup = new HashMap<>();
|
||||||
public static HashMap<Integer, ResourceType> hashLookup = new HashMap<>();
|
public static HashMap<Integer, ResourceType> templateHashLookup = new HashMap<>();
|
||||||
|
public static HashMap<Integer, ResourceType> resourceHashLookup = new HashMap<>();
|
||||||
public int templateID;
|
public int templateID;
|
||||||
public ItemTemplate template;
|
public ItemTemplate template;
|
||||||
public int hash;
|
public int resourceHash;
|
||||||
|
public int templateHash;
|
||||||
public int deposit_limit;
|
public int deposit_limit;
|
||||||
public int mine_production;
|
public int mine_production;
|
||||||
|
|
||||||
ResourceType(int templateID, int hash, int deposit_limit, int mine_production) {
|
ResourceType(int templateID, int resourceHash, int templateHash, int deposit_limit, int mine_production) {
|
||||||
this.templateID = templateID;
|
this.templateID = templateID;
|
||||||
this.template = ItemTemplate.templates.get(this.templateID);
|
this.template = ItemTemplate.templates.get(this.templateID);
|
||||||
this.hash = hash;
|
this.resourceHash = resourceHash;
|
||||||
|
this.templateHash = templateHash;
|
||||||
this.deposit_limit = deposit_limit;
|
this.deposit_limit = deposit_limit;
|
||||||
this.mine_production = mine_production;
|
this.mine_production = mine_production;
|
||||||
}
|
}
|
||||||
@@ -2758,11 +2767,11 @@ public class mbEnums {
|
|||||||
public static void InitializeResourceTypes() {
|
public static void InitializeResourceTypes() {
|
||||||
|
|
||||||
for (ResourceType resourceType : ResourceType.values()) {
|
for (ResourceType resourceType : ResourceType.values()) {
|
||||||
resourceLookup.put(resourceType.templateID, resourceType);
|
templateLookup.put(resourceType.templateID, resourceType);
|
||||||
hashLookup.put(resourceType.hash, resourceType);
|
templateHashLookup.put(resourceType.templateHash, resourceType);
|
||||||
|
resourceHashLookup.put(resourceType.resourceHash, resourceType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3013,5 +3022,62 @@ 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
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public class MobAI {
|
|||||||
public static void attackPlayer(Mob mob, PlayerCharacter target) {
|
public static void attackPlayer(Mob mob, PlayerCharacter target) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(target == null || !target.isAlive() || !target.isActive() ) {
|
if (target == null || !target.isAlive() || !target.isActive()) {
|
||||||
mob.setCombatTarget(null);
|
mob.setCombatTarget(null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -175,6 +175,8 @@ public class MobAI {
|
|||||||
public static void attackMob(Mob mob, Mob target) {
|
public static void attackMob(Mob mob, Mob target) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (mob == null || target == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (mob.getRange() >= 30 && mob.isMoving())
|
if (mob.getRange() >= 30 && mob.isMoving())
|
||||||
return;
|
return;
|
||||||
@@ -973,36 +975,36 @@ public class MobAI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void hamletGuardAggro(Mob mob) {
|
private static void hamletGuardAggro(Mob mob) {
|
||||||
Realm realm = RealmMap.getRealmAtLocation(mob.loc);
|
Realm realm = RealmMap.getRealmAtLocation(mob.loc);
|
||||||
if(realm.getRealmName().equals("Uthgaard")){
|
if (realm.getRealmName().equals("Uthgaard")) {
|
||||||
HashSet<AbstractWorldObject> loadedMobs = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_MOB);
|
HashSet<AbstractWorldObject> loadedMobs = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_MOB);
|
||||||
for (AbstractWorldObject awo : loadedMobs) {
|
for (AbstractWorldObject awo : loadedMobs) {
|
||||||
Mob targetMob = (Mob) awo;
|
Mob targetMob = (Mob) awo;
|
||||||
if (targetMob.equals(mob))
|
if (targetMob.equals(mob))
|
||||||
continue;
|
continue;
|
||||||
if (!targetMob.isAlive() || targetMob.despawned)
|
if (!targetMob.isAlive() || targetMob.despawned)
|
||||||
continue;
|
continue;
|
||||||
if (targetMob.isPet())
|
if (targetMob.isPet())
|
||||||
continue;
|
continue;
|
||||||
mob.combatTarget = targetMob;
|
mob.combatTarget = targetMob;
|
||||||
return;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PLAYER);
|
return;
|
||||||
for (AbstractWorldObject awo : loadedPlayers) {
|
}
|
||||||
PlayerCharacter pc = (PlayerCharacter) awo;
|
HashSet<AbstractWorldObject> loadedPlayers = WorldGrid.getObjectsInRangePartial(mob.loc, MobAIThread.AI_BASE_AGGRO_RANGE, MBServerStatics.MASK_PLAYER);
|
||||||
if (!pc.isAlive() || !pc.isActive())
|
for (AbstractWorldObject awo : loadedPlayers) {
|
||||||
continue;
|
PlayerCharacter pc = (PlayerCharacter) awo;
|
||||||
if (pc.guild.equals(Guild.getErrantGuild())) {
|
if (!pc.isAlive() || !pc.isActive())
|
||||||
mob.combatTarget = pc;
|
continue;
|
||||||
return;
|
if (pc.guild.equals(Guild.getErrantGuild())) {
|
||||||
}
|
|
||||||
if (pc.guild.charter.equals(mob.guild.charter))
|
|
||||||
continue;
|
|
||||||
mob.combatTarget = pc;
|
mob.combatTarget = pc;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (pc.guild.charter.equals(mob.guild.charter))
|
||||||
|
continue;
|
||||||
|
mob.combatTarget = pc;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void defaultLogic(Mob mob) {
|
private static void defaultLogic(Mob mob) {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class ArcMineChangeProductionMsgHandler extends AbstractClientMsgHandler
|
|||||||
|
|
||||||
//make sure valid resource
|
//make sure valid resource
|
||||||
|
|
||||||
mbEnums.ResourceType resource = mbEnums.ResourceType.hashLookup.get(changeProductionMsg.getResourceHash());
|
mbEnums.ResourceType resource = mbEnums.ResourceType.resourceHashLookup.get(changeProductionMsg.getResourceHash());
|
||||||
|
|
||||||
if (resource == null)
|
if (resource == null)
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (building.getGuild().isEmptyGuild())
|
if (building.getGuild().isEmptyGuild())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(sourcePlayer, building))
|
if (!BuildingManager.playerCanManage(sourcePlayer, building))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ public class ClaimGuildTreeMsgHandler extends AbstractClientMsgHandler {
|
|||||||
(building == null) || playerZone == null || playerCity == null)
|
(building == null) || playerZone == null || playerCity == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(sourcePlayer, building))
|
if (!BuildingManager.playerCanManage(sourcePlayer, building))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
boolean open = (msg.getMessageType() == OPEN_CITY);
|
boolean open = (msg.getMessageType() == OPEN_CITY);
|
||||||
|
|||||||
@@ -102,6 +102,9 @@ public class InviteToSubHandler extends AbstractClientMsgHandler {
|
|||||||
//source guild is limited to 7 subs
|
//source guild is limited to 7 subs
|
||||||
//TODO this should be based on TOL rank
|
//TODO this should be based on TOL rank
|
||||||
|
|
||||||
|
//cannot be subbed into a nation if you already have your own sub guilds
|
||||||
|
if(targetGuild.getSubGuildList() != null && targetGuild.getSubGuildList().size() > 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (!sourceGuild.canSubAGuild(targetGuild)) {
|
if (!sourceGuild.canSubAGuild(targetGuild)) {
|
||||||
sendChat(source, "This Guild can't be subbed.");
|
sendChat(source, "This Guild can't be subbed.");
|
||||||
|
|||||||
@@ -28,30 +28,6 @@ public class ManageCityAssetMsgHandler extends AbstractClientMsgHandler {
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean playerCanManageNotFriends(PlayerCharacter player, Building building) {
|
|
||||||
|
|
||||||
//Player Can only Control Building if player is in Same Guild as Building and is higher rank than IC.
|
|
||||||
|
|
||||||
if (player == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (building.getRank() == -1)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (BuildingManager.IsOwner(building, player))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (GuildStatusController.isGuildLeader(player.getGuildStatus()) == false && GuildStatusController.isInnerCouncil(player.getGuildStatus()) == false)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
//Somehow guild leader check fails above? lets check if Player is true Guild GL.
|
|
||||||
if (building.getGuild() != null && building.getGuild().isGuildLeader(player.getObjectUUID()))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return Guild.sameGuild(building.getGuild(), player.getGuild());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
protected boolean _handleNetMsg(ClientNetMsg baseMsg, ClientConnection origin) {
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ public class MerchantMsgHandler extends AbstractClientMsgHandler {
|
|||||||
City targetCity = null;
|
City targetCity = null;
|
||||||
|
|
||||||
if (isTeleport)
|
if (isTeleport)
|
||||||
cities = City.getCitiesToTeleportTo(player);
|
cities = City.getCitiesToTeleportTo(player, false);
|
||||||
else
|
else
|
||||||
cities = City.getCitiesToRepledgeTo(player);
|
cities = City.getCitiesToRepledgeTo(player);
|
||||||
for (City city : cities) {
|
for (City city : cities) {
|
||||||
|
|||||||
@@ -264,8 +264,9 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
|||||||
player.cancelOnSpell();
|
player.cancelOnSpell();
|
||||||
break;
|
break;
|
||||||
case RUNE:
|
case RUNE:
|
||||||
ApplyRuneMsg.applyRune(uuid, origin, player);
|
if(ApplyRuneMsg.applyRune(uuid, origin, player)) {
|
||||||
itemMan.consume(item);
|
itemMan.consume(item);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default: //shouldn't be here, consume item
|
default: //shouldn't be here, consume item
|
||||||
dispatch = Dispatch.borrow(player, msg);
|
dispatch = Dispatch.borrow(player, msg);
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (building == null)
|
if (building == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ManageCityAssetMsgHandler.playerCanManageNotFriends(player, building) == false)
|
if (BuildingManager.playerCanManage(player, building) == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (orderNpcMsg.getPatrolSize() >= 20)
|
if (orderNpcMsg.getPatrolSize() >= 20)
|
||||||
@@ -411,7 +411,7 @@ public class OrderNPCMsgHandler extends AbstractClientMsgHandler {
|
|||||||
case 2:
|
case 2:
|
||||||
player = SessionManager.getPlayerCharacter(origin);
|
player = SessionManager.getPlayerCharacter(origin);
|
||||||
|
|
||||||
if (ManageCityAssetMsgHandler.playerCanManageNotFriends(player, building) == false)
|
if (BuildingManager.playerCanManage(player, building) == false)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (building.getHirelings().containsKey(npc) == false)
|
if (building.getHirelings().containsKey(npc) == false)
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class PetAttackMsgHandler extends AbstractClientMsgHandler {
|
|||||||
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
||||||
|
|
||||||
switch (msg.getTargetType()) {
|
switch (msg.getTargetType()) {
|
||||||
case 53: //player character
|
case 52: //player character
|
||||||
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
pet.setCombatTarget(PlayerCharacter.getPlayerCharacter(msg.getTargetID()));
|
||||||
break;
|
break;
|
||||||
case 37://mob
|
case 37://mob
|
||||||
|
|||||||
@@ -86,15 +86,15 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
|
|||||||
if (ablist == null)
|
if (ablist == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
TrackPowerAction tpa = null;
|
TrackPowerAction trackPowerAction = null;
|
||||||
|
|
||||||
for (ActionsBase ab : ablist) {
|
for (ActionsBase ab : ablist) {
|
||||||
AbstractPowerAction apa = ab.getPowerAction();
|
AbstractPowerAction apa = ab.getPowerAction();
|
||||||
if (apa != null && apa instanceof TrackPowerAction)
|
if (apa != null && apa instanceof TrackPowerAction)
|
||||||
tpa = (TrackPowerAction) apa;
|
trackPowerAction = (TrackPowerAction) apa;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tpa == null)
|
if (trackPowerAction == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Check powers for normal users
|
// Check powers for normal users
|
||||||
@@ -111,16 +111,16 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler {
|
|||||||
int mask = 0;
|
int mask = 0;
|
||||||
|
|
||||||
if (pb.targetPlayer())
|
if (pb.targetPlayer())
|
||||||
if (tpa.trackVampire()) // track vampires
|
if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Vampire)) // track vampires
|
||||||
mask = MBServerStatics.MASK_PLAYER | MBServerStatics.MASK_UNDEAD;
|
mask = MBServerStatics.MASK_PLAYER | MBServerStatics.MASK_UNDEAD;
|
||||||
else
|
else
|
||||||
// track all players
|
// track all players
|
||||||
mask = MBServerStatics.MASK_PLAYER;
|
mask = MBServerStatics.MASK_PLAYER;
|
||||||
else if (pb.targetCorpse()) // track corpses
|
else if (pb.targetCorpse()) // track corpses
|
||||||
mask = MBServerStatics.MASK_CORPSE;
|
mask = MBServerStatics.MASK_CORPSE;
|
||||||
else if (tpa.trackNPC()) // Track NPCs
|
else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.NPC)) // Track NPCs
|
||||||
mask = MBServerStatics.MASK_NPC;
|
mask = MBServerStatics.MASK_NPC;
|
||||||
else if (tpa.trackUndead()) // Track Undead
|
else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Undead)) // Track Undead
|
||||||
mask = MBServerStatics.MASK_MOB | MBServerStatics.MASK_UNDEAD;
|
mask = MBServerStatics.MASK_MOB | MBServerStatics.MASK_UNDEAD;
|
||||||
else
|
else
|
||||||
// Track All
|
// Track All
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class TransferGoldToFromBuildingMsgHandler extends AbstractClientMsgHandl
|
|||||||
|
|
||||||
if (msg.getDirection() == 2) {
|
if (msg.getDirection() == 2) {
|
||||||
|
|
||||||
if (!ManageCityAssetMsgHandler.playerCanManageNotFriends(player, building))
|
if (!BuildingManager.playerCanManage(player, building))
|
||||||
return true;
|
return true;
|
||||||
if (building.setReserve(msg.getUnknown01(), player)) {
|
if (building.setReserve(msg.getUnknown01(), player)) {
|
||||||
dispatch = Dispatch.borrow(player, msg);
|
dispatch = Dispatch.borrow(player, msg);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class SendOwnPlayerMsg extends ClientNetMsg {
|
|||||||
@Override
|
@Override
|
||||||
protected int getPowerOfTwoBufferSize() {
|
protected int getPowerOfTwoBufferSize() {
|
||||||
//Larger size for historically larger opcodes
|
//Larger size for historically larger opcodes
|
||||||
return (17); // 2^17 == 131,072
|
return (18); // 2^17 == 131,072
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -73,10 +73,8 @@ public class TeleportRepledgeListMsg extends ClientNetMsg {
|
|||||||
|
|
||||||
public void configure() {
|
public void configure() {
|
||||||
|
|
||||||
if (isTeleport)
|
cities = City.getCitiesToTeleportTo(player, !isTeleport);
|
||||||
cities = City.getCitiesToTeleportTo(player);
|
|
||||||
else
|
|
||||||
cities = City.getCitiesToRepledgeTo(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class ViewResourcesMsg extends ClientNetMsg {
|
|||||||
|
|
||||||
for (mbEnums.ResourceType resourceType : (warehouseObject.resources.keySet())) {
|
for (mbEnums.ResourceType resourceType : (warehouseObject.resources.keySet())) {
|
||||||
|
|
||||||
writer.putInt(resourceType.hash);
|
writer.putInt(resourceType.templateHash);
|
||||||
writer.putInt((warehouseObject.resources.get(resourceType)));
|
writer.putInt((warehouseObject.resources.get(resourceType)));
|
||||||
|
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ public class ViewResourcesMsg extends ClientNetMsg {
|
|||||||
|
|
||||||
for (mbEnums.ResourceType resourceType : warehouseObject.resources.keySet()) {
|
for (mbEnums.ResourceType resourceType : warehouseObject.resources.keySet()) {
|
||||||
|
|
||||||
writer.putInt(resourceType.hash);
|
writer.putInt(resourceType.templateHash);
|
||||||
writer.putInt(0); //available?
|
writer.putInt(0); //available?
|
||||||
writer.putInt(resourceType.deposit_limit); //max?
|
writer.putInt(resourceType.deposit_limit); //max?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import engine.net.client.msg.ApplyRuneMsg;
|
|||||||
import engine.net.client.msg.UpdateStateMsg;
|
import engine.net.client.msg.UpdateStateMsg;
|
||||||
import engine.powers.EffectsBase;
|
import engine.powers.EffectsBase;
|
||||||
import engine.powers.PowersBase;
|
import engine.powers.PowersBase;
|
||||||
|
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -655,13 +656,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
|
AssignDamageAtrForPlayers(abstractCharacter, equipped.get(EquipSlotType.LHELD), false, equipped.get(EquipSlotType.LHELD));
|
||||||
if (abstractCharacter.getObjectType().equals(GameObjectType.Mob)) {
|
if (abstractCharacter.getObjectType().equals(GameObjectType.Mob)) {
|
||||||
Mob mob = (Mob) abstractCharacter;
|
Mob mob = (Mob) abstractCharacter;
|
||||||
abstractCharacter.minDamageHandOne += (int) mob.mobBase.getDamageMin();
|
abstractCharacter.minDamageHandOne = (int) mob.mobBase.getDamageMin();
|
||||||
abstractCharacter.minDamageHandTwo += (int) mob.mobBase.getDamageMin();
|
abstractCharacter.minDamageHandTwo = (int) mob.mobBase.getDamageMin();
|
||||||
abstractCharacter.maxDamageHandOne += (int) mob.mobBase.getDamageMax();
|
abstractCharacter.maxDamageHandOne = (int) mob.mobBase.getDamageMax();
|
||||||
abstractCharacter.maxDamageHandTwo += (int) mob.mobBase.getDamageMax();
|
abstractCharacter.maxDamageHandTwo = (int) mob.mobBase.getDamageMax();
|
||||||
abstractCharacter.atrHandOne += mob.mobBase.getAttackRating();
|
abstractCharacter.atrHandOne = mob.mobBase.getAttackRating();
|
||||||
abstractCharacter.atrHandTwo += mob.mobBase.getAttackRating();
|
abstractCharacter.atrHandTwo = mob.mobBase.getAttackRating();
|
||||||
abstractCharacter.defenseRating += mob.mobBase.getDefenseRating();
|
abstractCharacter.defenseRating = mob.mobBase.getDefenseRating();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -804,7 +805,25 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
if (weapon != null)
|
if (weapon != null)
|
||||||
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None));
|
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.WeaponSpeed, SourceType.None));
|
||||||
|
|
||||||
speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None));
|
PlayerBonuses bonuses = abstractCharacter.bonuses;
|
||||||
|
if (bonuses != null) {
|
||||||
|
ModType modType = ModType.AttackDelay;
|
||||||
|
for (AbstractEffectModifier mod : bonuses.bonusFloats.keySet()) {
|
||||||
|
|
||||||
|
if (mod.getPercentMod() == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
if (!mod.modType.equals(modType))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (bonuses.bonusFloats.get(mod) == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
speed *= (1 + bonuses.bonusFloats.get(mod));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//speed *= (1 + abstractCharacter.bonuses.getFloatPercentAll(ModType.AttackDelay, SourceType.None));
|
||||||
|
|
||||||
if (speed < 10)
|
if (speed < 10)
|
||||||
speed = 10;
|
speed = 10;
|
||||||
@@ -1809,7 +1828,13 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
|||||||
//handle hate value addition
|
//handle hate value addition
|
||||||
Mob target = (Mob) this;
|
Mob target = (Mob) this;
|
||||||
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
if (attacker.getObjectType().equals(GameObjectType.PlayerCharacter)) {
|
||||||
target.playerAgroMap.put(attacker.getObjectUUID(), target.playerAgroMap.get(attacker.getObjectUUID()) + value);
|
|
||||||
|
if (target.playerAgroMap.containsKey(attacker.getObjectUUID()))
|
||||||
|
target.playerAgroMap.put(attacker.getObjectUUID(), target.playerAgroMap.get(attacker.getObjectUUID()) + value);
|
||||||
|
else
|
||||||
|
target.playerAgroMap.put(attacker.getObjectUUID(), value);
|
||||||
|
|
||||||
|
|
||||||
if (target.isPlayerGuard()) {
|
if (target.isPlayerGuard()) {
|
||||||
if (target.guardedCity != null && target.guardedCity.cityOutlaws.contains(attacker.getObjectUUID()) == false)
|
if (target.guardedCity != null && target.guardedCity.cityOutlaws.contains(attacker.getObjectUUID()) == false)
|
||||||
target.guardedCity.cityOutlaws.add(attacker.getObjectUUID());
|
target.guardedCity.cityOutlaws.add(attacker.getObjectUUID());
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
|
|||||||
if (eff == null) {
|
if (eff == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (eff.containsSource(source) && trains >= eff.getTrains()) {
|
if (eff.getEffectsBase().effectSources.contains(source) && trains >= eff.getTrains()) {
|
||||||
if (removeAll) {
|
if (removeAll) {
|
||||||
//remove all effects of source type
|
//remove all effects of source type
|
||||||
if (eff.cancel()) {
|
if (eff.cancel()) {
|
||||||
|
|||||||
@@ -641,18 +641,18 @@ public final class Bane {
|
|||||||
return cityUUID;
|
return cityUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startBane(){
|
public void startBane() {
|
||||||
City city = this.getCity();
|
City city = this.getCity();
|
||||||
if(city == null)
|
if (city == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.isStarted = true; //flag the bane as started
|
this.isStarted = true; //flag the bane as started
|
||||||
|
|
||||||
for(AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(city.loc,mbEnums.CityBoundsType.ZONE.halfExtents + 64,MBServerStatics.MASK_BUILDING)){
|
for (AbstractWorldObject awo : WorldGrid.getObjectsInRangePartial(city.loc, mbEnums.CityBoundsType.ZONE.halfExtents + 64, MBServerStatics.MASK_BUILDING)) {
|
||||||
Building building = (Building)awo;
|
Building building = (Building) awo;
|
||||||
if(building == null)
|
if (building == null)
|
||||||
continue;
|
continue;
|
||||||
if(building.protectionState.equals(ProtectionState.UNDERSIEGE) == false)
|
if (building.protectionState.equals(ProtectionState.UNDERSIEGE) == false)
|
||||||
building.protectionState = ProtectionState.UNDERSIEGE;
|
building.protectionState = ProtectionState.UNDERSIEGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -163,6 +163,11 @@ public class Building extends AbstractWorldObject {
|
|||||||
if (upgradeTimeStamp != null)
|
if (upgradeTimeStamp != null)
|
||||||
this.upgradeDateTime = LocalDateTime.ofInstant(upgradeTimeStamp.toInstant(), ZoneId.systemDefault());
|
this.upgradeDateTime = LocalDateTime.ofInstant(upgradeTimeStamp.toInstant(), ZoneId.systemDefault());
|
||||||
|
|
||||||
|
if(rs.getInt("enforceKOS") == 0)
|
||||||
|
this.enforceKOS = false;
|
||||||
|
else
|
||||||
|
this.enforceKOS = true;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error("Failed for object " + this.blueprintUUID + ' ' + this.getObjectUUID() + e);
|
Logger.error("Failed for object " + this.blueprintUUID + ' ' + this.getObjectUUID() + e);
|
||||||
}
|
}
|
||||||
@@ -556,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) {
|
||||||
@@ -1447,7 +1452,7 @@ public class Building extends AbstractWorldObject {
|
|||||||
|
|
||||||
public synchronized boolean setReserve(int amount, PlayerCharacter player) {
|
public synchronized boolean setReserve(int amount, PlayerCharacter player) {
|
||||||
|
|
||||||
if (!BuildingManager.playerCanManageNotFriends(player, this))
|
if (!BuildingManager.playerCanManage(player, this))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (amount < 0)
|
if (amount < 0)
|
||||||
|
|||||||
@@ -1400,6 +1400,7 @@ public class CharacterItemManager {
|
|||||||
|
|
||||||
if (!ItemManager.validForSkills(item, pc.getSkills())) {
|
if (!ItemManager.validForSkills(item, pc.getSkills())) {
|
||||||
this.forceToInventory(slot, item, pc, initialized);
|
this.forceToInventory(slot, item, pc, initialized);
|
||||||
|
this.equipped.remove(slot);
|
||||||
pc.applyBonuses();
|
pc.applyBonuses();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+145
-133
@@ -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
|
||||||
@@ -120,9 +122,7 @@ public class City extends AbstractWorldObject {
|
|||||||
this.treeOfLifeID = rs.getInt("treeOfLifeUUID");
|
this.treeOfLifeID = rs.getInt("treeOfLifeUUID");
|
||||||
this.bindX = rs.getFloat("bindX");
|
this.bindX = rs.getFloat("bindX");
|
||||||
this.bindZ = rs.getFloat("bindZ");
|
this.bindZ = rs.getFloat("bindZ");
|
||||||
this.bindLoc = new Vector3fImmutable(this.location.getX() + this.bindX,
|
this.bindLoc = new Vector3fImmutable(this.location.getX() + this.bindX, this.location.getY(), this.location.getZ() + this.bindZ);
|
||||||
this.location.getY(),
|
|
||||||
this.location.getZ() + this.bindZ);
|
|
||||||
this.radiusType = rs.getInt("radiusType");
|
this.radiusType = rs.getInt("radiusType");
|
||||||
|
|
||||||
float bindradiustemp = rs.getFloat("bindRadius");
|
float bindradiustemp = rs.getFloat("bindRadius");
|
||||||
@@ -288,106 +288,134 @@ public class City extends AbstractWorldObject {
|
|||||||
return city.getBindLoc();
|
return city.getBindLoc();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter pc) {
|
public static ArrayList<City> getCitiesToTeleportTo(PlayerCharacter playerCharacter, boolean repledge) {
|
||||||
|
|
||||||
ArrayList<City> cities = new ArrayList<>();
|
ArrayList<City> cities = new ArrayList<>();
|
||||||
|
|
||||||
if (pc == null)
|
if (playerCharacter == null)
|
||||||
return cities;
|
return cities;
|
||||||
|
|
||||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
||||||
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
//handle compiling of cities able to be teleported to for lore rule-set
|
||||||
//handle compiling of cities able to be teleported to for lore rule-set
|
|
||||||
for (AbstractGameObject ago : worldCities.values()) {
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
City city = (City) ago;
|
|
||||||
if(city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
City city = (City) ago;
|
||||||
continue; // cannot teleport to perdition or bastion
|
|
||||||
if (city.isNpc == 1 && city.getGuild().charter.equals(pc.guild.charter)) {
|
// Filter Player cities
|
||||||
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
|
||||||
|
if (city.parentZone == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Can't teleport to something without a tree
|
||||||
|
|
||||||
|
if (city.getTOL() == null)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// No abandoned cities
|
||||||
|
|
||||||
|
if (city.getTOL().getGuild().isEmptyGuild())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// No destroyed cities
|
||||||
|
|
||||||
|
if (city.getTOL().getRank() == -1)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//can't repledge to a guild you're already part of
|
||||||
|
|
||||||
|
if (repledge && city.getGuild().equals(playerCharacter.guild))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (city.parentZone.guild_zone) {
|
||||||
|
|
||||||
|
//players can all port and repledge inside their own nation
|
||||||
|
|
||||||
|
if(city.getGuild().getNation().equals(playerCharacter.guild.getNation())){
|
||||||
|
cities.add(city);
|
||||||
continue;
|
continue;
|
||||||
} else if (city.isNoobIsle == 1 && pc.level <= 20) {
|
}
|
||||||
cities.add(city); // everyone can go to noob island if they are under level 20
|
|
||||||
continue;
|
if (city.isOpen() && city.getTOL().rank > 4) {
|
||||||
} else if (city.cityName.equals("Khan'Ov Srekel")) {
|
|
||||||
cities.add(city); //everyone anytime can teleport to khan
|
// Filter Lore cities
|
||||||
continue;
|
|
||||||
} else if (city.isOpen() && city.getTOL().rank > 4 && city.getGuild().charter.equals(pc.guild.charter))
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
if (!city.getTOL().reverseKOS) {
|
|
||||||
cities.add(city);//can teleport to any open ToL that shares charter
|
if (repledge) {
|
||||||
continue;
|
if (!city.getGuild().charter.canJoin(playerCharacter))
|
||||||
|
continue;
|
||||||
|
} else if (!city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer playerUUID = playerCharacter.objectUUID;
|
||||||
|
Integer guildUUID = playerCharacter.guildUUID;
|
||||||
|
Integer nationUUID = playerCharacter.guild.getNation().getObjectUUID();
|
||||||
|
boolean allowed = false;
|
||||||
|
|
||||||
|
if (city.getTOL().reverseKOS) {
|
||||||
|
|
||||||
|
//reverse KOS, specific values are allowed
|
||||||
|
|
||||||
|
if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) ||
|
||||||
|
(city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active))
|
||||||
|
allowed = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (city.getTOL().getCondemned().contains(pc.objectUUID) && city.getTOL().getCondemned().get(pc.objectUUID).active) {
|
//not reverse KOS, everyone is allowed by default
|
||||||
cities.add(city);//this player is allowed for the reverse KOS
|
|
||||||
continue;
|
allowed = true;
|
||||||
}
|
|
||||||
if (city.getTOL().getCondemned().contains(pc.guildUUID) && city.getTOL().getCondemned().get(pc.guildUUID).active) {
|
//specific values are not allowed
|
||||||
cities.add(city);//this guild is allowed for the reverse KOS
|
|
||||||
continue;
|
if ((city.getTOL().getCondemned().containsKey(playerUUID) && city.getTOL().getCondemned().get(playerUUID).active) ||
|
||||||
}
|
(city.getTOL().getCondemned().containsKey(guildUUID) && city.getTOL().getCondemned().get(guildUUID).active) ||
|
||||||
if (city.getTOL().getCondemned().contains(pc.guild.getNation().getObjectUUID()) && city.getTOL().getCondemned().get(pc.guild.getNation().getObjectUUID()).active) {
|
(city.getTOL().getCondemned().containsKey(nationUUID) && city.getTOL().getCondemned().get(nationUUID).active))
|
||||||
cities.add(city);//this nation is allowed for the reverse KOS
|
allowed = false;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (city.getGuild().getNation().equals(pc.guild.getNation())) {
|
|
||||||
cities.add(city);//can always teleport inside your own nation
|
if (allowed)
|
||||||
|
cities.add(city);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
|
||||||
|
|
||||||
Guild pcG = pc.getGuild();
|
// Filter NPC cities
|
||||||
//add npc cities
|
|
||||||
|
|
||||||
for (AbstractGameObject ago : worldCities.values()) {
|
if (city.isNoobIsle == 1) {
|
||||||
|
|
||||||
if (ago.getObjectType().equals(GameObjectType.City)) {
|
if (playerCharacter.level < 20)
|
||||||
City city = (City) ago;
|
cities.add(city); // everyone can go to noob island if they are under level 20
|
||||||
|
|
||||||
if (city.noTeleport)
|
continue;
|
||||||
continue;
|
}
|
||||||
|
|
||||||
if (city.parentZone != null && city.parentZone.guild_zone) {
|
// Players cannot teleport to perdition or bastion
|
||||||
|
|
||||||
if (pc.getAccount().status.equals(AccountStatus.ADMIN)) {
|
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// These cities are available for anyone off noob island
|
||||||
|
|
||||||
|
if (playerCharacter.level >= 20 && (city.cityName.equals("Sea Dog's Rest") || city.cityName.equals("Khan'Ov Srekel") || city.cityName.equals("City of Khar Th'Sekt"))) {
|
||||||
|
cities.add(city);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add Lore cities
|
||||||
|
|
||||||
|
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
||||||
|
|
||||||
|
if (repledge) {
|
||||||
|
if (city.getGuild().charter.canJoin(playerCharacter))
|
||||||
cities.add(city);
|
cities.add(city);
|
||||||
} else
|
} else if (city.getGuild().charter.equals(playerCharacter.guild.charter))
|
||||||
//list Player cities
|
cities.add(city);
|
||||||
|
|
||||||
//open city, just list
|
|
||||||
|
|
||||||
if (city.open && city.getTOL() != null && city.getTOL().getRank() > 4) {
|
|
||||||
|
|
||||||
if (!BuildingManager.IsPlayerHostile(city.getTOL(), pc)) {
|
|
||||||
if (ConfigManager.MB_RULESET.getValue().equals("LORE")) {
|
|
||||||
if (city.getGuild().getGuildType().equals(pc.guild.getGuildType())) {
|
|
||||||
cities.add(city);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (Guild.sameNationExcludeErrant(city.getGuild(), pcG))
|
|
||||||
cities.add(city);
|
|
||||||
|
|
||||||
|
|
||||||
} else if (city.isNpc == 1) {
|
|
||||||
|
|
||||||
//list NPC cities
|
|
||||||
|
|
||||||
Guild g = city.getGuild();
|
|
||||||
if (g == null) {
|
|
||||||
if (city.isNpc == 1)
|
|
||||||
if (city.isNoobIsle == 1) {
|
|
||||||
if (pc.getLevel() < 21)
|
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
} else if (pc.getLevel() > 9)
|
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
|
|
||||||
} else if (pc.getLevel() >= g.getTeleportMin() && pc.getLevel() <= g.getTeleportMax())
|
|
||||||
cities.add(city); //verify nation or guild is same
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return cities;
|
return cities;
|
||||||
@@ -407,7 +435,7 @@ public class City extends AbstractWorldObject {
|
|||||||
//handle compiling of cities able to be repledged to for lore rule-set
|
//handle compiling of cities able to be repledged to for lore rule-set
|
||||||
for (AbstractGameObject ago : worldCities.values()) {
|
for (AbstractGameObject ago : worldCities.values()) {
|
||||||
City city = (City) ago;
|
City city = (City) ago;
|
||||||
if(city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
if (city.cityName.equals("Perdition") || city.cityName.equals("Bastion"))
|
||||||
continue; // cannot repledge to perdition or bastion
|
continue; // cannot repledge to perdition or bastion
|
||||||
if (city.isNpc == 1 && city.getGuild().charter.canJoin(playerCharacter)) {
|
if (city.isNpc == 1 && city.getGuild().charter.canJoin(playerCharacter)) {
|
||||||
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
cities.add(city); // anyone of the same charter can teleport to a safehold of that charter
|
||||||
@@ -586,7 +614,7 @@ public class City extends AbstractWorldObject {
|
|||||||
if (this.siegesWithstood == siegesWithstood)
|
if (this.siegesWithstood == siegesWithstood)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (DbManager.CityQueries.updateSiegesWithstood(this, siegesWithstood) == true)
|
if (DbManager.CityQueries.updateSiegesWithstood(this, siegesWithstood))
|
||||||
this.siegesWithstood = siegesWithstood;
|
this.siegesWithstood = siegesWithstood;
|
||||||
else
|
else
|
||||||
Logger.error("Error when writing to database for cityUUID: " + this.getObjectUUID());
|
Logger.error("Error when writing to database for cityUUID: " + this.getObjectUUID());
|
||||||
@@ -640,19 +668,12 @@ public class City extends AbstractWorldObject {
|
|||||||
public Guild getGuild() {
|
public Guild getGuild() {
|
||||||
|
|
||||||
if (this.getTOL() == null)
|
if (this.getTOL() == null)
|
||||||
return null;
|
return Guild.getErrantGuild();
|
||||||
|
|
||||||
if (this.isNpc == 1) {
|
if (this.getTOL().getOwner() == null)
|
||||||
|
return Guild.getErrantGuild();
|
||||||
|
|
||||||
if (this.getTOL().getOwner() == null)
|
return this.getTOL().getOwner().getGuild();
|
||||||
return null;
|
|
||||||
return this.getTOL().getOwner().getGuild();
|
|
||||||
} else {
|
|
||||||
|
|
||||||
if (this.getTOL().getOwner() == null)
|
|
||||||
return null;
|
|
||||||
return this.getTOL().getOwner().getGuild();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean openCity(boolean open) {
|
public boolean openCity(boolean open) {
|
||||||
@@ -731,7 +752,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
for (AbstractCharacter npc : getTOL().getHirelings().keySet()) {
|
for (AbstractCharacter npc : getTOL().getHirelings().keySet()) {
|
||||||
if (npc.getObjectType() == GameObjectType.NPC)
|
if (npc.getObjectType() == GameObjectType.NPC)
|
||||||
if (((NPC) npc).getContract().isRuneMaster() == true)
|
if (((NPC) npc).getContract().isRuneMaster())
|
||||||
outNPC = (NPC) npc;
|
outNPC = (NPC) npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -764,16 +785,13 @@ public class City extends AbstractWorldObject {
|
|||||||
// Set location for this city
|
// Set location for this city
|
||||||
|
|
||||||
this.location = new Vector3fImmutable(this.parentZone.absX, this.parentZone.absY, this.parentZone.absZ);
|
this.location = new Vector3fImmutable(this.parentZone.absX, this.parentZone.absY, this.parentZone.absZ);
|
||||||
this.bindLoc = new Vector3fImmutable(this.location.x + this.bindX,
|
this.bindLoc = new Vector3fImmutable(this.location.x + this.bindX, this.location.y, this.location.z + this.bindZ);
|
||||||
this.location.y,
|
|
||||||
this.location.z + this.bindZ);
|
|
||||||
|
|
||||||
// set city bounds
|
// set city bounds
|
||||||
|
|
||||||
Bounds cityBounds = Bounds.borrow();
|
Bounds cityBounds = Bounds.borrow();
|
||||||
cityBounds.setBounds(new Vector2f(this.location.x + 64, this.location.z + 64), // location x and z are offset by 64 from the center of the city.
|
cityBounds.setBounds(new Vector2f(this.location.x + 64, this.location.z + 64), // location x and z are offset by 64 from the center of the city.
|
||||||
new Vector2f(mbEnums.CityBoundsType.GRID.halfExtents, mbEnums.CityBoundsType.GRID.halfExtents),
|
new Vector2f(mbEnums.CityBoundsType.GRID.halfExtents, mbEnums.CityBoundsType.GRID.halfExtents), 0.0f);
|
||||||
0.0f);
|
|
||||||
this.setBounds(cityBounds);
|
this.setBounds(cityBounds);
|
||||||
|
|
||||||
// Sanity check; no tol
|
// Sanity check; no tol
|
||||||
@@ -781,8 +799,7 @@ public class City extends AbstractWorldObject {
|
|||||||
if (BuildingManager.getBuilding(this.treeOfLifeID) == null)
|
if (BuildingManager.getBuilding(this.treeOfLifeID) == null)
|
||||||
Logger.info("City UID " + this.getObjectUUID() + " Failed to Load Tree of Life with ID " + this.treeOfLifeID);
|
Logger.info("City UID " + this.getObjectUUID() + " Failed to Load Tree of Life with ID " + this.treeOfLifeID);
|
||||||
|
|
||||||
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER))
|
if ((ConfigManager.serverType.equals(ServerType.WORLDSERVER)) && (this.isNpc == (byte) 0)) {
|
||||||
&& (this.isNpc == (byte) 0)) {
|
|
||||||
|
|
||||||
this.realm = RealmMap.getRealmAtLocation(this.getLoc());
|
this.realm = RealmMap.getRealmAtLocation(this.getLoc());
|
||||||
|
|
||||||
@@ -802,8 +819,7 @@ public class City extends AbstractWorldObject {
|
|||||||
if (this.getGuild().getGuildState() == GuildState.Nation)
|
if (this.getGuild().getGuildState() == GuildState.Nation)
|
||||||
for (Guild sub : this.getGuild().getSubGuildList()) {
|
for (Guild sub : this.getGuild().getSubGuildList()) {
|
||||||
|
|
||||||
if ((sub.getGuildState() == GuildState.Protectorate) ||
|
if ((sub.getGuildState() == GuildState.Protectorate) || (sub.getGuildState() == GuildState.Province)) {
|
||||||
(sub.getGuildState() == GuildState.Province)) {
|
|
||||||
this.isCapital = 1;
|
this.isCapital = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -828,7 +844,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
this.setHash();
|
this.setHash();
|
||||||
|
|
||||||
if (DataWarehouse.recordExists(mbEnums.DataRecordType.CITY, this.getObjectUUID()) == false) {
|
if (!DataWarehouse.recordExists(DataRecordType.CITY, this.getObjectUUID())) {
|
||||||
CityRecord cityRecord = CityRecord.borrow(this, mbEnums.RecordEventType.CREATE);
|
CityRecord cityRecord = CityRecord.borrow(this, mbEnums.RecordEventType.CREATE);
|
||||||
DataWarehouse.pushToWarehouse(cityRecord);
|
DataWarehouse.pushToWarehouse(cityRecord);
|
||||||
}
|
}
|
||||||
@@ -853,9 +869,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
for (Building building : this.parentZone.zoneBuildingSet) {
|
for (Building building : this.parentZone.zoneBuildingSet) {
|
||||||
|
|
||||||
if (building.getBlueprint() != null &&
|
if (building.getBlueprint() != null && building.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE && building.getBlueprint().getBuildingGroup() != BuildingGroup.TOL) {
|
||||||
building.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE &&
|
|
||||||
building.getBlueprint().getBuildingGroup() != BuildingGroup.TOL) {
|
|
||||||
|
|
||||||
building.healthMax += (building.healthMax * Realm.getRealmHealthMod(this));
|
building.healthMax += (building.healthMax * Realm.getRealmHealthMod(this));
|
||||||
|
|
||||||
@@ -937,7 +951,7 @@ public class City extends AbstractWorldObject {
|
|||||||
|
|
||||||
// Reapply effect with timeout?
|
// Reapply effect with timeout?
|
||||||
|
|
||||||
if (refreshEffect == true)
|
if (refreshEffect)
|
||||||
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this);
|
player.addCityEffect(Integer.toString(effectBase.getUUID()), effectBase, rank, MBServerStatics.FOURTYFIVE_SECONDS, false, this);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1105,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();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1193,26 +1211,25 @@ public class City extends AbstractWorldObject {
|
|||||||
// All protection contracts are void upon transfer of a city
|
// All protection contracts are void upon transfer of a city
|
||||||
//Dont forget to not Flip protection on Banestones and siege Equipment... Noob.
|
//Dont forget to not Flip protection on Banestones and siege Equipment... Noob.
|
||||||
|
|
||||||
if (cityBuilding.getBlueprint() != null && !cityBuilding.getBlueprint().isSiegeEquip()
|
if (cityBuilding.getBlueprint() != null && !cityBuilding.getBlueprint().isSiegeEquip() && cityBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE)
|
||||||
&& cityBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.BANESTONE)
|
|
||||||
cityBuilding.setProtectionState(ProtectionState.NONE);
|
cityBuilding.setProtectionState(ProtectionState.NONE);
|
||||||
|
|
||||||
// Transfer ownership of valid city assets
|
// Transfer ownership of valid city assets
|
||||||
// these assets are autoprotected.
|
// these assets are autoprotected.
|
||||||
|
|
||||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL)
|
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE)
|
PlayerCharacter guildLeader = PlayerCharacter.getPlayerCharacter(sourcePlayer.guild.getGuildLeaderUUID());
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK)
|
if(guildLeader != null)
|
||||||
|| (cityBuilding.getBlueprint().isWallPiece())
|
cityBuilding.claim(guildLeader);
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
else
|
||||||
|
cityBuilding.claim(sourcePlayer);
|
||||||
cityBuilding.claim(sourcePlayer);
|
|
||||||
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.setForceRename(true);
|
this.setForceRename(true);
|
||||||
|
|
||||||
|
|
||||||
// Reset city timer for map update
|
// Reset city timer for map update
|
||||||
|
|
||||||
City.lastCityUpdate = System.currentTimeMillis();
|
City.lastCityUpdate = System.currentTimeMillis();
|
||||||
@@ -1245,12 +1262,7 @@ public class City extends AbstractWorldObject {
|
|||||||
// Transfer ownership of valid city assets
|
// Transfer ownership of valid city assets
|
||||||
// these assets are autoprotected.
|
// these assets are autoprotected.
|
||||||
|
|
||||||
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL)
|
if ((cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.TOL) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK) || (cityBuilding.getBlueprint().isWallPiece()) || (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)) {
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SPIRE)
|
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.BARRACK)
|
|
||||||
|| (cityBuilding.getBlueprint().isWallPiece())
|
|
||||||
|| (cityBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.SHRINE)
|
|
||||||
) {
|
|
||||||
|
|
||||||
cityBuilding.claim(sourcePlayer);
|
cityBuilding.claim(sourcePlayer);
|
||||||
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
cityBuilding.setProtectionState(ProtectionState.PROTECTED);
|
||||||
@@ -1399,7 +1411,7 @@ public class City extends AbstractWorldObject {
|
|||||||
taxPercent = .20f;
|
taxPercent = .20f;
|
||||||
|
|
||||||
for (int resourceHash : msg.getResources().keySet())
|
for (int resourceHash : msg.getResources().keySet())
|
||||||
resources.add(ResourceType.hashLookup.get(resourceHash));
|
resources.add(ResourceType.templateHashLookup.get(resourceHash));
|
||||||
|
|
||||||
for (ResourceType resourceType : resources) {
|
for (ResourceType resourceType : resources) {
|
||||||
if (Warehouse.isAboveCap(ruledWarehouse, resourceType, (int) (city.warehouse.resources.get(resourceType) * taxPercent))) {
|
if (Warehouse.isAboveCap(ruledWarehouse, resourceType, (int) (city.warehouse.resources.get(resourceType) * taxPercent))) {
|
||||||
|
|||||||
@@ -433,12 +433,6 @@ public class Effect {
|
|||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsSource(EffectSourceType source) {
|
|
||||||
if (this.eb != null)
|
|
||||||
return this.eb.containsSource(source);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JobContainer getJobContainer() {
|
public JobContainer getJobContainer() {
|
||||||
return this.jc;
|
return this.jc;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,12 +193,16 @@ public class Guild extends AbstractWorldObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean sameNationExcludeErrant(Guild a, Guild b) {
|
public static boolean sameNationExcludeErrant(Guild a, Guild b) {
|
||||||
|
|
||||||
if (a == null || b == null)
|
if (a == null || b == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (a.getObjectUUID() == b.getObjectUUID())
|
if (a.getObjectUUID() == b.getObjectUUID())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (a.nation == null || b.nation == null)
|
if (a.nation == null || b.nation == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
|
return a.nation.getObjectUUID() == b.nation.getObjectUUID() && !a.nation.isEmptyGuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
writer.putInt(mine.getObjectUUID()); //actually a hash of mine
|
writer.putInt(mine.getObjectUUID()); //actually a hash of mine
|
||||||
writer.putString(mine.mineType.name);
|
writer.putString(mine.mineType.name);
|
||||||
writer.putString(mine.zoneName);
|
writer.putString(mine.zoneName);
|
||||||
writer.putInt(mine.production.hash);
|
writer.putInt(mine.production.resourceHash);
|
||||||
writer.putInt(mine.production.mine_production);
|
writer.putInt(mine.production.mine_production);
|
||||||
writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here
|
writer.putInt(mine.getModifiedProductionAmount()); //TODO calculate range penalty here
|
||||||
writer.putInt(3600); //window in seconds
|
writer.putInt(3600); //window in seconds
|
||||||
@@ -220,8 +220,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
// Only inactive mines are returned.
|
// Only inactive mines are returned.
|
||||||
|
|
||||||
for (Mine mine : Mine.mineMap.keySet()) {
|
for (Mine mine : Mine.mineMap.keySet()) {
|
||||||
if (mine.owningGuild.getObjectUUID() == guildID &&
|
if (mine.owningGuild.getObjectUUID() == guildID)
|
||||||
mine.isActive == false)
|
|
||||||
mineList.add(mine);
|
mineList.add(mine);
|
||||||
}
|
}
|
||||||
return mineList;
|
return mineList;
|
||||||
@@ -393,7 +392,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
// writer.putInt(0x215C92BB); //this.unknown1);
|
// writer.putInt(0x215C92BB); //this.unknown1);
|
||||||
writer.putString(this.mineType.name);
|
writer.putString(this.mineType.name);
|
||||||
writer.putString(this.zoneName);
|
writer.putString(this.zoneName);
|
||||||
writer.putInt(this.production.hash);
|
writer.putInt(this.production.resourceHash);
|
||||||
writer.putInt(this.production.mine_production);
|
writer.putInt(this.production.mine_production);
|
||||||
writer.putInt(this.getModifiedProductionAmount()); //TODO calculate range penalty here
|
writer.putInt(this.getModifiedProductionAmount()); //TODO calculate range penalty here
|
||||||
writer.putInt(3600); //window in seconds
|
writer.putInt(3600); //window in seconds
|
||||||
@@ -482,7 +481,7 @@ public class Mine extends AbstractGameObject {
|
|||||||
if (this.owningGuild.getOwnedCity().warehouse == null)
|
if (this.owningGuild.getOwnedCity().warehouse == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Warehouse.depositFromMine(this, mbEnums.ResourceType.resourceLookup.get(this.production.templateID), this.getModifiedProductionAmount(), this.owningGuild.getOwnedCity().warehouse);
|
return Warehouse.depositFromMine(this, mbEnums.ResourceType.templateLookup.get(this.production.templateID), this.getModifiedProductionAmount(), this.owningGuild.getOwnedCity().warehouse);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean updateGuildOwner(PlayerCharacter playerCharacter) {
|
public boolean updateGuildOwner(PlayerCharacter playerCharacter) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
public class PlayerBonuses {
|
public class PlayerBonuses {
|
||||||
|
|
||||||
//First bonus set
|
//First bonus set
|
||||||
private ConcurrentHashMap<AbstractEffectModifier, Float> bonusFloats = new ConcurrentHashMap<>();
|
ConcurrentHashMap<AbstractEffectModifier, Float> bonusFloats = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<AbstractEffectModifier, DamageShield> bonusDamageShields = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<AbstractEffectModifier, DamageShield> bonusDamageShields = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<AbstractEffectModifier, String> bonusStrings = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<AbstractEffectModifier, String> bonusStrings = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<ModType, HashSet<SourceType>> bonusLists = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<ModType, HashSet<SourceType>> bonusLists = new ConcurrentHashMap<>();
|
||||||
|
|||||||
@@ -349,13 +349,13 @@ public class Resists {
|
|||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Stun))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Stun))
|
||||||
this.immuneTo.put(mbEnums.DamageType.STUN, true);
|
this.immuneTo.put(mbEnums.DamageType.STUN, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind))
|
||||||
this.immuneTo.put(mbEnums.DamageType.BLIND, true);
|
this.immuneTo.put(mbEnums.DamageType.BLINDNESS, true);
|
||||||
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None))
|
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None))
|
||||||
this.immuneTo.put(mbEnums.DamageType.ATTACK, true);
|
this.immuneTo.put(mbEnums.DamageType.ATTACK, true);
|
||||||
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None))
|
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None))
|
||||||
this.immuneTo.put(mbEnums.DamageType.POWERS, true);
|
this.immuneTo.put(mbEnums.DamageType.POWERS, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
||||||
this.immuneTo.put(mbEnums.DamageType.POWERBLOCK, true);
|
this.immuneTo.put(mbEnums.DamageType.POWERINHIBITOR, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff))
|
||||||
this.immuneTo.put(mbEnums.DamageType.DEBUFF, true);
|
this.immuneTo.put(mbEnums.DamageType.DEBUFF, true);
|
||||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear))
|
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear))
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class Warehouse {
|
|||||||
if (warehouse == null)
|
if (warehouse == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.hashLookup.get(msg.getHashID());
|
mbEnums.ResourceType resourceType = mbEnums.ResourceType.templateHashLookup.get(msg.getHashID());
|
||||||
|
|
||||||
if (isResourceLocked(warehouse, resourceType)) {
|
if (isResourceLocked(warehouse, resourceType)) {
|
||||||
ChatManager.chatSystemInfo(playerCharacter, "You cannot withdrawl a locked resource.");
|
ChatManager.chatSystemInfo(playerCharacter, "You cannot withdrawl a locked resource.");
|
||||||
@@ -182,7 +182,7 @@ public class Warehouse {
|
|||||||
|
|
||||||
warehouse = city.warehouse;
|
warehouse = city.warehouse;
|
||||||
|
|
||||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.hashLookup.get(hashID);
|
mbEnums.ResourceType resourceType = mbEnums.ResourceType.templateHashLookup.get(hashID);
|
||||||
|
|
||||||
// toggle lock
|
// toggle lock
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ public class Warehouse {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.resourceLookup.get(resource.templateID);
|
mbEnums.ResourceType resourceType = mbEnums.ResourceType.templateLookup.get(resource.templateID);
|
||||||
|
|
||||||
if (warehouse.resources.get(resourceType) == null)
|
if (warehouse.resources.get(resourceType) == null)
|
||||||
return false;
|
return false;
|
||||||
@@ -261,7 +261,7 @@ public class Warehouse {
|
|||||||
|
|
||||||
int newAmount = oldAmount + amount;
|
int newAmount = oldAmount + amount;
|
||||||
|
|
||||||
if (newAmount > mbEnums.ResourceType.resourceLookup.get(resource.templateID).deposit_limit)
|
if (newAmount > mbEnums.ResourceType.templateLookup.get(resource.templateID).deposit_limit)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (removeFromInventory) {
|
if (removeFromInventory) {
|
||||||
@@ -381,7 +381,7 @@ public class Warehouse {
|
|||||||
int amount = (int) (warehouse.resources.get(resourceType) * taxPercent);
|
int amount = (int) (warehouse.resources.get(resourceType) * taxPercent);
|
||||||
|
|
||||||
if (amount <= 0) {
|
if (amount <= 0) {
|
||||||
msg.getResources().put(resourceType.hash, 0);
|
msg.getResources().put(resourceType.resourceHash, 0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -395,20 +395,18 @@ public class Warehouse {
|
|||||||
if (newAmount < amount)
|
if (newAmount < amount)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
msg.getResources().put(resourceType.hash, amount);
|
msg.getResources().put(resourceType.resourceHash, amount);
|
||||||
|
|
||||||
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
|
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
|
||||||
msg.getResources().put(resourceType.hash, 0);
|
msg.getResources().put(resourceType.resourceHash, 0);
|
||||||
warehouse.resources.put(resourceType, oldAmount);
|
warehouse.resources.put(resourceType, oldAmount);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
warehouse.resources.put(resourceType, newAmount);
|
warehouse.resources.put(resourceType, newAmount);
|
||||||
depositRealmTaxes(taxer, resourceType, amount, warehouse);
|
depositRealmTaxes(taxer, resourceType, amount, warehouse);
|
||||||
mbEnums.ResourceType resource;
|
|
||||||
|
|
||||||
AddTransactionToWarehouse(warehouse, taxer.getObjectType(), taxer.getObjectUUID(), mbEnums.TransactionType.TAXRESOURCE, resourceType, amount);
|
AddTransactionToWarehouse(warehouse, taxer.getObjectType(), taxer.getObjectUUID(), mbEnums.TransactionType.TAXRESOURCE, resourceType, amount);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,7 +429,7 @@ public class Warehouse {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (addToInventory)
|
if (addToInventory)
|
||||||
if (!itemMan.hasRoomInventory(template.item_wt * amount)) {
|
if (!itemMan.hasRoomInventory(template.item_wt)) {
|
||||||
ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item.");
|
ChatManager.chatSystemInfo(playerCharacter, "You can not carry any more of that item.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,13 +11,11 @@ package engine.powers;
|
|||||||
|
|
||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import engine.gameManager.PowersManager;
|
import engine.gameManager.PowersManager;
|
||||||
|
import engine.mbEnums;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
import engine.mbEnums.SourceType;
|
import engine.mbEnums.SourceType;
|
||||||
import engine.mbEnums.StackType;
|
import engine.mbEnums.StackType;
|
||||||
import engine.objects.AbstractCharacter;
|
import engine.objects.*;
|
||||||
import engine.objects.AbstractWorldObject;
|
|
||||||
import engine.objects.PlayerBonuses;
|
|
||||||
import engine.objects.Runegate;
|
|
||||||
import engine.powers.poweractions.AbstractPowerAction;
|
import engine.powers.poweractions.AbstractPowerAction;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -244,32 +242,23 @@ public class ActionsBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Add blocked types here
|
//Add blocked types here
|
||||||
public boolean blocked(AbstractWorldObject awo, PowersBase pb, int trains) {
|
public boolean blocked(AbstractWorldObject awo, boolean vampDrain) {
|
||||||
if (AbstractWorldObject.IsAbstractCharacter(awo)) {
|
//Check for immunities
|
||||||
AbstractCharacter ac = (AbstractCharacter) awo;
|
if (AbstractCharacter.IsAbstractCharacter(awo)){
|
||||||
PlayerBonuses bonus = ac.getBonuses();
|
AbstractCharacter pcTarget = (AbstractCharacter) awo;
|
||||||
if (bonus == null)
|
PlayerBonuses bonus = pcTarget.getBonuses();
|
||||||
return false;
|
|
||||||
|
|
||||||
//TODO make this more efficient then testing strings
|
if(vampDrain)
|
||||||
if (this.stackType.equals("Stun") && bonus.getBool(ModType.ImmuneTo, SourceType.STUN))
|
return bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
|
||||||
return true; //Currently stun immune. Skip stun
|
|
||||||
else if (this.stackType.equals("Snare") && bonus.getBool(ModType.ImmuneTo, SourceType.Snare))
|
if ((this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly)) ||
|
||||||
return true; //Currently snare immune. Skip snare
|
(this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))) {
|
||||||
else if (this.stackType.equals("Blindness") && bonus.getBool(ModType.ImmuneTo, SourceType.Blind))
|
|
||||||
return true; //Currently blind immune. Skip blind
|
|
||||||
else if (this.stackType.equals("PowerInhibitor") && bonus.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
|
||||||
return true; //Currently power block immune. Skip power block
|
|
||||||
else if (this.stackType.equals("Root") && bonus.getBool(ModType.ImmuneTo, SourceType.Root))
|
|
||||||
return true;
|
return true;
|
||||||
// else if (pb.isHeal() && (bonus.getByte("immuneTo.Heal")) >= trains)
|
}
|
||||||
// return true; //Currently shadowmantled. Skip heals
|
|
||||||
else if (this.stackType.equals("Flight") && bonus.getBool(ModType.NoMod, SourceType.Fly))
|
mbEnums.DamageType damageType = mbEnums.DamageType.getDamageType(this.stackType.toUpperCase());
|
||||||
return true;
|
return pcTarget.getResists().immuneTo(damageType);
|
||||||
else if (this.stackType.equals("Track") && bonus.getBool(ModType.CannotTrack, SourceType.None))
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return pb.vampDrain() && bonus.getBool(ModType.BlockedPowerType, SourceType.VAMPDRAIN);
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
+366
-212
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
package engine.powers;
|
package engine.powers;
|
||||||
|
|
||||||
import engine.gameManager.DbManager;
|
|
||||||
import engine.gameManager.DispatchManager;
|
import engine.gameManager.DispatchManager;
|
||||||
import engine.gameManager.PowersManager;
|
import engine.gameManager.PowersManager;
|
||||||
import engine.job.JobContainer;
|
import engine.job.JobContainer;
|
||||||
@@ -24,65 +23,58 @@ import engine.mbEnums.PowerFailCondition;
|
|||||||
import engine.net.Dispatch;
|
import engine.net.Dispatch;
|
||||||
import engine.net.client.ClientConnection;
|
import engine.net.client.ClientConnection;
|
||||||
import engine.net.client.msg.ApplyEffectMsg;
|
import engine.net.client.msg.ApplyEffectMsg;
|
||||||
import engine.objects.AbstractCharacter;
|
import engine.objects.*;
|
||||||
import engine.objects.AbstractWorldObject;
|
import engine.powers.effectmodifiers.*;
|
||||||
import engine.objects.Effect;
|
|
||||||
import engine.objects.PlayerCharacter;
|
|
||||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
|
||||||
import engine.server.MBServerStatics;
|
import engine.server.MBServerStatics;
|
||||||
|
import engine.util.Hasher;
|
||||||
|
import engine.wpak.data.ConditionEntry;
|
||||||
|
import engine.wpak.data.Effect;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.Connection;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
public class EffectsBase {
|
public class EffectsBase {
|
||||||
|
private static final ConcurrentHashMap<String, String> itemEffectsByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||||
public static HashMap<Integer, HashSet<EffectSourceType>> effectSourceTypeMap = new HashMap<>();
|
public static int NewID = 3000;
|
||||||
public static HashMap<String, HashSet<AbstractEffectModifier>> modifiersMap = new HashMap<>();
|
public int UUID;
|
||||||
public static HashMap<String, HashMap<String, ArrayList<String>>> OldEffectsMap = new HashMap<>();
|
public String IDString;
|
||||||
public static HashMap<String, HashMap<String, ArrayList<String>>> NewEffectsMap = new HashMap<>();
|
// public String name;
|
||||||
public static HashMap<String, HashMap<String, ArrayList<String>>> ChangedEffectsMap = new HashMap<>();
|
public int token;
|
||||||
public static HashMap<String, HashSet<PowerFailCondition>> EffectFailConditions = new HashMap<>();
|
public float amount;
|
||||||
public static HashMap<Integer, HashSet<mbEnums.DamageType>> EffectDamageTypes = new HashMap<>();
|
public float amountRamp;
|
||||||
public static HashSet<AbstractEffectModifier> DefaultModifiers = new HashSet<>();
|
|
||||||
private static ConcurrentHashMap<String, String> itemEffectsByName = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
|
||||||
private static int NewID = 3000;
|
|
||||||
private int UUID;
|
|
||||||
private String IDString;
|
|
||||||
// private String name;
|
|
||||||
private int token;
|
|
||||||
private float amount;
|
|
||||||
private float amountRamp;
|
|
||||||
// flags
|
// flags
|
||||||
private boolean isItemEffect;
|
public boolean isItemEffect;
|
||||||
private boolean isSpireEffect;
|
public boolean isSpireEffect;
|
||||||
private boolean ignoreMod;
|
public boolean ignoreNoMod;
|
||||||
private boolean dontSave;
|
public boolean dontSave;
|
||||||
private boolean cancelOnAttack = false;
|
public boolean cancelOnAttack = false;
|
||||||
private boolean cancelOnAttackSwing = false;
|
public boolean cancelOnAttackSwing = false;
|
||||||
private boolean cancelOnCast = false;
|
public boolean cancelOnCast = false;
|
||||||
private boolean cancelOnCastSpell = false;
|
public boolean cancelOnCastSpell = false;
|
||||||
private boolean cancelOnEquipChange = false;
|
public boolean cancelOnEquipChange = false;
|
||||||
private boolean cancelOnLogout = false;
|
public boolean cancelOnLogout = false;
|
||||||
private boolean cancelOnMove = false;
|
public boolean cancelOnMove = false;
|
||||||
private boolean cancelOnNewCharm = false;
|
public boolean cancelOnNewCharm = false;
|
||||||
private boolean cancelOnSit = false;
|
public boolean cancelOnSit = false;
|
||||||
private boolean cancelOnTakeDamage = false;
|
public boolean cancelOnTakeDamage = false;
|
||||||
private boolean cancelOnTerritoryClaim = false;
|
public boolean cancelOnTerritoryClaim = false;
|
||||||
private boolean cancelOnUnEquip = false;
|
public boolean cancelOnUnEquip = false;
|
||||||
private boolean useRampAdd;
|
public boolean useRampAdd;
|
||||||
private boolean isPrefix = false; //used by items
|
public boolean isPrefix = false; //used by items
|
||||||
private boolean isSuffix = false; //used by items
|
public boolean isSuffix = false; //used by items
|
||||||
private String name = "";
|
public String name = "";
|
||||||
private float value = 0;
|
public float value = 0;
|
||||||
private ConcurrentHashMap<mbEnums.ResourceType, Integer> resourceCosts = new ConcurrentHashMap<>();
|
private ConcurrentHashMap<mbEnums.ResourceType, Integer> resourceCosts = new ConcurrentHashMap<>();
|
||||||
private ConcurrentHashMap<String, Boolean> sourceTypes = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
|
||||||
|
//loaded values from parser
|
||||||
|
public HashSet<EffectSourceType> effectSources = new HashSet<>();
|
||||||
|
public HashSet<AbstractEffectModifier> effectModifiers = new HashSet<>();
|
||||||
|
public HashSet<PowerFailCondition> effectFailCondition = new HashSet<>();
|
||||||
|
|
||||||
|
public HashSet<mbEnums.DamageType> effectDamageTypes = new HashSet<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* No Table ID Constructor
|
* No Table ID Constructor
|
||||||
@@ -91,6 +83,110 @@ public class EffectsBase {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* EffectEntry Constructor
|
||||||
|
*/
|
||||||
|
|
||||||
|
public EffectsBase(Effect entry) {
|
||||||
|
this.IDString = entry.effect_id;
|
||||||
|
this.name = entry.effect_name;
|
||||||
|
this.token = Hasher.SBStringHash(entry.effect_name);
|
||||||
|
|
||||||
|
//override tokens for some effects like Safemode that use the Action Token instead of the effect Token,
|
||||||
|
switch (this.IDString) {
|
||||||
|
case "INVIS-D":
|
||||||
|
this.token = -1661751254;
|
||||||
|
break;
|
||||||
|
case "SafeMode":
|
||||||
|
this.token = -1661750486;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
this.isItemEffect = entry.isItemEffect;
|
||||||
|
this.isSpireEffect = entry.isSpireEffect;
|
||||||
|
this.ignoreNoMod = entry.ignoreNoMod;
|
||||||
|
this.dontSave = entry.dontSave;
|
||||||
|
|
||||||
|
if (this.IDString.startsWith("PRE-"))
|
||||||
|
this.isPrefix = true;
|
||||||
|
else if (this.IDString.startsWith("SUF-"))
|
||||||
|
this.isSuffix = true;
|
||||||
|
|
||||||
|
//load effect modifiers
|
||||||
|
for (ModifierEntry mod : entry.mods)
|
||||||
|
this.effectModifiers.add(getCombinedModifiers(null, mod, this, mod.type));
|
||||||
|
|
||||||
|
//load sources
|
||||||
|
for (String source : entry.sources)
|
||||||
|
this.effectSources.add(EffectSourceType.GetEffectSourceType(source));
|
||||||
|
|
||||||
|
//load fail conditions
|
||||||
|
for (ConditionEntry condition : entry.conditions) {
|
||||||
|
PowerFailCondition failCondition = PowerFailCondition.valueOf(condition.condition);
|
||||||
|
this.effectFailCondition.add(failCondition);
|
||||||
|
loadFailConditions(failCondition, this, condition);
|
||||||
|
|
||||||
|
//add all damage types
|
||||||
|
if(!condition.damageTypes.isEmpty())
|
||||||
|
this.effectDamageTypes.addAll(condition.damageTypes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void loadFailConditions(PowerFailCondition failCondition, EffectsBase eb, ConditionEntry entry) {
|
||||||
|
|
||||||
|
if (failCondition == null || eb == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (failCondition) {
|
||||||
|
|
||||||
|
case TakeDamage:
|
||||||
|
|
||||||
|
eb.cancelOnTakeDamage = true;
|
||||||
|
|
||||||
|
|
||||||
|
eb.amount = entry.arg;
|
||||||
|
eb.amountRamp = (float) entry.curveType.getValue();
|
||||||
|
eb.useRampAdd = (float) entry.curveType.getValue() != 0;
|
||||||
|
break;
|
||||||
|
case Attack:
|
||||||
|
eb.cancelOnAttack = true;
|
||||||
|
break;
|
||||||
|
case AttackSwing:
|
||||||
|
eb.cancelOnAttackSwing = true;
|
||||||
|
break;
|
||||||
|
case Cast:
|
||||||
|
eb.cancelOnCast = true;
|
||||||
|
break;
|
||||||
|
case CastSpell:
|
||||||
|
eb.cancelOnCastSpell = true;
|
||||||
|
break;
|
||||||
|
case EquipChange:
|
||||||
|
eb.cancelOnEquipChange = true;
|
||||||
|
break;
|
||||||
|
case Logout:
|
||||||
|
eb.cancelOnLogout = true;
|
||||||
|
break;
|
||||||
|
case Move:
|
||||||
|
eb.cancelOnMove = true;
|
||||||
|
break;
|
||||||
|
case NewCharm:
|
||||||
|
eb.cancelOnNewCharm = true;
|
||||||
|
break;
|
||||||
|
case Sit:
|
||||||
|
eb.cancelOnSit = true;
|
||||||
|
break;
|
||||||
|
case TerritoryClaim:
|
||||||
|
eb.cancelOnTerritoryClaim = true;
|
||||||
|
break;
|
||||||
|
case UnEquip:
|
||||||
|
eb.cancelOnUnEquip = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public EffectsBase(EffectsBase copyEffect, int newToken, String IDString) {
|
public EffectsBase(EffectsBase copyEffect, int newToken, String IDString) {
|
||||||
|
|
||||||
UUID = NewID++;
|
UUID = NewID++;
|
||||||
@@ -102,7 +198,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 +213,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 +259,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-"))
|
||||||
@@ -173,113 +269,6 @@ public class EffectsBase {
|
|||||||
// getFailConditions();
|
// getFailConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void getFailConditions(HashMap<String, EffectsBase> effects) {
|
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_power_failcondition WHERE powerOrEffect = 'Effect';")) {
|
|
||||||
|
|
||||||
ResultSet rs = preparedStatement.executeQuery();
|
|
||||||
|
|
||||||
PowerFailCondition failCondition = null;
|
|
||||||
|
|
||||||
while (rs.next()) {
|
|
||||||
String fail = rs.getString("type");
|
|
||||||
|
|
||||||
|
|
||||||
String IDString = rs.getString("IDString");
|
|
||||||
failCondition = PowerFailCondition.valueOf(fail);
|
|
||||||
|
|
||||||
if (failCondition == null) {
|
|
||||||
Logger.error("Couldn't Find FailCondition " + fail + " for " + IDString);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (EffectsBase.EffectFailConditions.get(IDString) == null) {
|
|
||||||
EffectsBase.EffectFailConditions.put(IDString, new HashSet<>());
|
|
||||||
}
|
|
||||||
|
|
||||||
EffectsBase.EffectFailConditions.get(IDString).add(failCondition);
|
|
||||||
EffectsBase eb = effects.get(IDString);
|
|
||||||
|
|
||||||
switch (failCondition) {
|
|
||||||
|
|
||||||
case TakeDamage:
|
|
||||||
|
|
||||||
// dont go any further.
|
|
||||||
|
|
||||||
if (eb == null)
|
|
||||||
break;
|
|
||||||
|
|
||||||
eb.cancelOnTakeDamage = true;
|
|
||||||
|
|
||||||
|
|
||||||
eb.amount = rs.getFloat("amount");
|
|
||||||
eb.amountRamp = rs.getFloat("ramp");
|
|
||||||
eb.useRampAdd = rs.getBoolean("UseAddFormula");
|
|
||||||
|
|
||||||
String damageType1 = rs.getString("damageType1");
|
|
||||||
String damageType2 = rs.getString("damageType2");
|
|
||||||
String damageType3 = rs.getString("damageType3");
|
|
||||||
|
|
||||||
if (damageType1.isEmpty() && damageType2.isEmpty() && damageType3.isEmpty())
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (!EffectsBase.EffectDamageTypes.containsKey(eb.getToken()))
|
|
||||||
EffectsBase.EffectDamageTypes.put(eb.getToken(), new HashSet<>());
|
|
||||||
|
|
||||||
mbEnums.DamageType dt = mbEnums.DamageType.getDamageType(damageType1);
|
|
||||||
if (dt != null)
|
|
||||||
EffectsBase.EffectDamageTypes.get(eb.token).add(dt);
|
|
||||||
|
|
||||||
dt = mbEnums.DamageType.getDamageType(damageType2);
|
|
||||||
if (dt != null)
|
|
||||||
EffectsBase.EffectDamageTypes.get(eb.token).add(dt);
|
|
||||||
dt = mbEnums.DamageType.getDamageType(damageType3);
|
|
||||||
if (dt != null)
|
|
||||||
EffectsBase.EffectDamageTypes.get(eb.token).add(dt);
|
|
||||||
break;
|
|
||||||
case Attack:
|
|
||||||
eb.cancelOnAttack = true;
|
|
||||||
break;
|
|
||||||
case AttackSwing:
|
|
||||||
eb.cancelOnAttackSwing = true;
|
|
||||||
break;
|
|
||||||
case Cast:
|
|
||||||
eb.cancelOnCast = true;
|
|
||||||
break;
|
|
||||||
case CastSpell:
|
|
||||||
eb.cancelOnCastSpell = true;
|
|
||||||
break;
|
|
||||||
case EquipChange:
|
|
||||||
eb.cancelOnEquipChange = true;
|
|
||||||
break;
|
|
||||||
case Logout:
|
|
||||||
eb.cancelOnLogout = true;
|
|
||||||
break;
|
|
||||||
case Move:
|
|
||||||
eb.cancelOnMove = true;
|
|
||||||
break;
|
|
||||||
case NewCharm:
|
|
||||||
eb.cancelOnNewCharm = true;
|
|
||||||
break;
|
|
||||||
case Sit:
|
|
||||||
eb.cancelOnSit = true;
|
|
||||||
break;
|
|
||||||
case TerritoryClaim:
|
|
||||||
eb.cancelOnTerritoryClaim = true;
|
|
||||||
break;
|
|
||||||
case UnEquip:
|
|
||||||
eb.cancelOnUnEquip = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rs.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
Logger.error(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getItemEffectsByName(String string) {
|
public static String getItemEffectsByName(String string) {
|
||||||
if (EffectsBase.itemEffectsByName.containsKey(string))
|
if (EffectsBase.itemEffectsByName.containsKey(string))
|
||||||
return EffectsBase.itemEffectsByName.get(string);
|
return EffectsBase.itemEffectsByName.get(string);
|
||||||
@@ -303,14 +292,12 @@ public class EffectsBase {
|
|||||||
|
|
||||||
public boolean damageTypeSpecific() {
|
public boolean damageTypeSpecific() {
|
||||||
|
|
||||||
return EffectsBase.EffectDamageTypes.containsKey(this.token);
|
return !this.effectDamageTypes.isEmpty();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsDamageType(mbEnums.DamageType dt) {
|
public boolean containsDamageType(mbEnums.DamageType dt) {
|
||||||
if (!EffectsBase.EffectDamageTypes.containsKey(this.token))
|
return this.effectDamageTypes.contains(dt);
|
||||||
return false;
|
|
||||||
return EffectsBase.EffectDamageTypes.get(this.token).contains(dt);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUUID() {
|
public int getUUID() {
|
||||||
@@ -330,32 +317,8 @@ public class EffectsBase {
|
|||||||
this.token = token;
|
this.token = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConcurrentHashMap<String, Boolean> getSourceTypes() {
|
|
||||||
return this.sourceTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public HashSet<AbstractEffectModifier> getModifiers() {
|
public HashSet<AbstractEffectModifier> getModifiers() {
|
||||||
|
return this.effectModifiers;
|
||||||
if (EffectsBase.modifiersMap.containsKey(this.IDString) == false)
|
|
||||||
return EffectsBase.DefaultModifiers;
|
|
||||||
|
|
||||||
return EffectsBase.modifiersMap.get(this.IDString);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isItemEffect() {
|
|
||||||
return this.isItemEffect;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isSpireEffect() {
|
|
||||||
return this.isSpireEffect;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean ignoreMod() {
|
|
||||||
return this.ignoreMod;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean dontSave() {
|
|
||||||
return this.dontSave;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPrefix() {
|
public boolean isPrefix() {
|
||||||
@@ -404,7 +367,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) {
|
||||||
@@ -639,13 +602,6 @@ public class EffectsBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsSource(EffectSourceType sourceType) {
|
|
||||||
if (EffectsBase.effectSourceTypeMap.containsKey(this.token) == false)
|
|
||||||
return false;
|
|
||||||
return EffectsBase.effectSourceTypeMap.get(this.token).contains(sourceType);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean cancelOnAttack() {
|
public boolean cancelOnAttack() {
|
||||||
return this.cancelOnAttack;
|
return this.cancelOnAttack;
|
||||||
}
|
}
|
||||||
@@ -694,16 +650,6 @@ public class EffectsBase {
|
|||||||
return this.cancelOnUnEquip;
|
return this.cancelOnUnEquip;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDamageTypes() {
|
|
||||||
String text = "";
|
|
||||||
if (!EffectsBase.EffectDamageTypes.containsKey(this.token))
|
|
||||||
return text;
|
|
||||||
for (mbEnums.DamageType type : EffectsBase.EffectDamageTypes.get(this.token)) {
|
|
||||||
text += type.name() + ' ';
|
|
||||||
}
|
|
||||||
return text;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
@@ -713,12 +659,220 @@ public class EffectsBase {
|
|||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getValue() {
|
public static AbstractEffectModifier getCombinedModifiers(AbstractEffectModifier abstractEffectModifier, ModifierEntry rs, EffectsBase effectBase, mbEnums.ModType modifier){
|
||||||
return value;
|
switch (modifier) {
|
||||||
}
|
case AdjustAboveDmgCap:
|
||||||
|
abstractEffectModifier = new AdjustAboveDmgCapEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Ambidexterity:
|
||||||
|
abstractEffectModifier = new AmbidexterityEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case AnimOverride:
|
||||||
|
break;
|
||||||
|
case ArmorPiercing:
|
||||||
|
abstractEffectModifier = new ArmorPiercingEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case AttackDelay:
|
||||||
|
abstractEffectModifier = new AttackDelayEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Attr:
|
||||||
|
abstractEffectModifier = new AttributeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case BlackMantle:
|
||||||
|
abstractEffectModifier = new BlackMantleEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case BladeTrails:
|
||||||
|
abstractEffectModifier = new BladeTrailsEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Block:
|
||||||
|
abstractEffectModifier = new BlockEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case BlockedPowerType:
|
||||||
|
abstractEffectModifier = new BlockedPowerTypeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case CannotAttack:
|
||||||
|
abstractEffectModifier = new CannotAttackEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case CannotCast:
|
||||||
|
abstractEffectModifier = new CannotCastEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case CannotMove:
|
||||||
|
abstractEffectModifier = new CannotMoveEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case CannotTrack:
|
||||||
|
abstractEffectModifier = new CannotTrackEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Charmed:
|
||||||
|
abstractEffectModifier = new CharmedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ConstrainedAmbidexterity:
|
||||||
|
abstractEffectModifier = new ConstrainedAmbidexterityEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case DamageCap:
|
||||||
|
abstractEffectModifier = new DamageCapEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case DamageShield:
|
||||||
|
abstractEffectModifier = new DamageShieldEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case DCV:
|
||||||
|
abstractEffectModifier = new DCVEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Dodge:
|
||||||
|
abstractEffectModifier = new DodgeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case DR:
|
||||||
|
abstractEffectModifier = new DREffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Durability:
|
||||||
|
abstractEffectModifier = new DurabilityEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ExclusiveDamageCap:
|
||||||
|
abstractEffectModifier = new ExclusiveDamageCapEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Fade:
|
||||||
|
abstractEffectModifier = new FadeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Fly:
|
||||||
|
abstractEffectModifier = new FlyEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Health:
|
||||||
|
abstractEffectModifier = new HealthEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case HealthFull:
|
||||||
|
abstractEffectModifier = new HealthFullEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case HealthRecoverRate:
|
||||||
|
abstractEffectModifier = new HealthRecoverRateEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case IgnoreDamageCap:
|
||||||
|
abstractEffectModifier = new IgnoreDamageCapEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case IgnorePassiveDefense:
|
||||||
|
abstractEffectModifier = new IgnorePassiveDefenseEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ImmuneTo:
|
||||||
|
abstractEffectModifier = new ImmuneToEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ImmuneToAttack:
|
||||||
|
abstractEffectModifier = new ImmuneToAttackEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ImmuneToPowers:
|
||||||
|
abstractEffectModifier = new ImmuneToPowersEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Invisible:
|
||||||
|
abstractEffectModifier = new InvisibleEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ItemName:
|
||||||
|
abstractEffectModifier = new ItemNameEffectModifier(rs);
|
||||||
|
if (((ItemNameEffectModifier) abstractEffectModifier).name.isEmpty())
|
||||||
|
break;
|
||||||
|
if (effectBase != null)
|
||||||
|
effectBase.setName((((ItemNameEffectModifier) abstractEffectModifier).name));
|
||||||
|
break;
|
||||||
|
case Mana:
|
||||||
|
abstractEffectModifier = new ManaEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ManaFull:
|
||||||
|
abstractEffectModifier = new ManaFullEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ManaRecoverRate:
|
||||||
|
abstractEffectModifier = new ManaRecoverRateEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case MaxDamage:
|
||||||
|
abstractEffectModifier = new MaxDamageEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case MeleeDamageModifier:
|
||||||
|
abstractEffectModifier = new MeleeDamageEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case MinDamage:
|
||||||
|
abstractEffectModifier = new MinDamageEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case NoMod:
|
||||||
|
abstractEffectModifier = new NoModEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case OCV:
|
||||||
|
abstractEffectModifier = new OCVEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Parry:
|
||||||
|
abstractEffectModifier = new ParryEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case PassiveDefense:
|
||||||
|
abstractEffectModifier = new PassiveDefenseEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case PowerCost:
|
||||||
|
abstractEffectModifier = new PowerCostEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case PowerCostHealth:
|
||||||
|
abstractEffectModifier = new PowerCostHealthEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case PowerDamageModifier:
|
||||||
|
abstractEffectModifier = new PowerDamageEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ProtectionFrom:
|
||||||
|
abstractEffectModifier = new ProtectionFromEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Resistance:
|
||||||
|
abstractEffectModifier = new ResistanceEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ScaleHeight:
|
||||||
|
abstractEffectModifier = new ScaleHeightEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ScaleWidth:
|
||||||
|
abstractEffectModifier = new ScaleWidthEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case ScanRange:
|
||||||
|
abstractEffectModifier = new ScanRangeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case SeeInvisible:
|
||||||
|
abstractEffectModifier = new SeeInvisibleEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Silenced:
|
||||||
|
abstractEffectModifier = new SilencedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Skill:
|
||||||
|
abstractEffectModifier = new SkillEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Slay:
|
||||||
|
abstractEffectModifier = new SlayEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Speed:
|
||||||
|
abstractEffectModifier = new SpeedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case SpireBlock:
|
||||||
|
abstractEffectModifier = new SpireBlockEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Stamina:
|
||||||
|
abstractEffectModifier = new StaminaEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case StaminaFull:
|
||||||
|
abstractEffectModifier = new StaminaFullEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case StaminaRecoverRate:
|
||||||
|
abstractEffectModifier = new StaminaRecoverRateEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Stunned:
|
||||||
|
abstractEffectModifier = new StunnedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case Value:
|
||||||
|
abstractEffectModifier = new ValueEffectModifier(rs);
|
||||||
|
if (effectBase != null) {
|
||||||
|
ValueEffectModifier valueEffect = (ValueEffectModifier) abstractEffectModifier;
|
||||||
|
effectBase.value = valueEffect.minMod;
|
||||||
|
Item.addEnchantValue(effectBase.getIDString(), (int)valueEffect.minMod);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case WeaponProc:
|
||||||
|
abstractEffectModifier = new WeaponProcEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case WeaponRange:
|
||||||
|
abstractEffectModifier = new WeaponRangeEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
case WeaponSpeed:
|
||||||
|
abstractEffectModifier = new WeaponSpeedEffectModifier(rs);
|
||||||
|
break;
|
||||||
|
|
||||||
public void setValue(float Value) {
|
}
|
||||||
this.value = Value;
|
return abstractEffectModifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -633,4 +633,8 @@ public class PowersBase {
|
|||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean enforceLore(){
|
||||||
|
return this.powerCategory.equals(PowerCategoryType.SUMMON) || this.powerCategory.equals(PowerCategoryType.HEAL)|| this.powerCategory.equals(PowerCategoryType.BUFF);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import engine.objects.AbstractWorldObject;
|
|||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.powers.EffectsBase;
|
import engine.powers.EffectsBase;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -39,22 +40,24 @@ public abstract class AbstractEffectModifier {
|
|||||||
protected String string1;
|
protected String string1;
|
||||||
protected String string2;
|
protected String string2;
|
||||||
|
|
||||||
public AbstractEffectModifier(ResultSet rs) throws SQLException {
|
public AbstractEffectModifier(ResultSet rs){
|
||||||
|
|
||||||
this.UUID = rs.getInt("ID");
|
}
|
||||||
this.IDString = rs.getString("IDString");
|
public AbstractEffectModifier(ModifierEntry mod) {
|
||||||
this.effectType = rs.getString("modType");
|
|
||||||
this.modType = ModType.GetModType(this.effectType);
|
this.IDString = mod.type.name();
|
||||||
this.type = rs.getString("type").replace("\"", "");
|
this.effectType = mod.type.name();
|
||||||
|
this.modType = mod.type;
|
||||||
|
this.type = mod.type.name().replace("\"", "");
|
||||||
this.sourceType = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
|
this.sourceType = SourceType.GetSourceType(this.type.replace(" ", "").replace("-", ""));
|
||||||
this.minMod = rs.getFloat("minMod");
|
this.minMod = mod.min;
|
||||||
this.maxMod = rs.getFloat("maxMod");
|
this.maxMod = mod.max;
|
||||||
this.percentMod = rs.getFloat("percentMod");
|
this.percentMod = mod.value;
|
||||||
this.ramp = rs.getFloat("ramp");
|
this.ramp = (float)mod.compoundCurveType.getValue();
|
||||||
this.useRampAdd = (rs.getInt("useRampAdd") == 1) ? true : false;
|
this.useRampAdd = (float)mod.compoundCurveType.getValue() != 0;
|
||||||
|
|
||||||
this.string1 = rs.getString("string1");
|
this.string1 = mod.arg1;
|
||||||
this.string2 = rs.getString("string2");
|
this.string2 = mod.arg2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -18,7 +19,7 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
public class AdjustAboveDmgCapEffectModifier extends AbstractEffectModifier {
|
public class AdjustAboveDmgCapEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
public AdjustAboveDmgCapEffectModifier(ResultSet rs) throws SQLException {
|
public AdjustAboveDmgCapEffectModifier(ModifierEntry rs){
|
||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import engine.jobs.AbstractEffectJob;
|
|||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
import engine.mbEnums.SourceType;
|
import engine.mbEnums.SourceType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -20,7 +21,7 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
public class AmbidexterityEffectModifier extends AbstractEffectModifier {
|
public class AmbidexterityEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
public AmbidexterityEffectModifier(ResultSet rs) throws SQLException {
|
public AmbidexterityEffectModifier(ModifierEntry rs) {
|
||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -18,7 +19,7 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
public class ArmorPiercingEffectModifier extends AbstractEffectModifier {
|
public class ArmorPiercingEffectModifier extends AbstractEffectModifier {
|
||||||
|
|
||||||
public ArmorPiercingEffectModifier(ResultSet rs) throws SQLException {
|
public ArmorPiercingEffectModifier(ModifierEntry rs){
|
||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,9 @@ public class AttackDelayEffectModifier extends AbstractEffectModifier {
|
|||||||
public AttackDelayEffectModifier(ResultSet rs) throws SQLException {
|
public AttackDelayEffectModifier(ResultSet rs) throws SQLException {
|
||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
public AttackDelayEffectModifier(ModifierEntry rs){
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class AttributeEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AttributeEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import engine.jobs.AbstractEffectJob;
|
|||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
import engine.mbEnums.SourceType;
|
import engine.mbEnums.SourceType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -25,6 +27,10 @@ public class BlackMantleEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BlackMantleEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class BladeTrailsEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BladeTrailsEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class BlockEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BlockEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ package engine.powers.effectmodifiers;
|
|||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.mbEnums.ModType;
|
import engine.mbEnums.ModType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class BlockedPowerTypeEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BlockedPowerTypeEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class CannotAttackEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CannotAttackEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ package engine.powers.effectmodifiers;
|
|||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -23,6 +24,10 @@ public class CannotCastEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CannotCastEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class CannotMoveEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CannotMoveEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class CannotTrackEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CannotTrackEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class CharmedEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CharmedEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class ConstrainedAmbidexterityEffectModifier extends AbstractEffectModifi
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ConstrainedAmbidexterityEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class DCVEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DCVEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class DREffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DREffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class DamageCapEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DamageCapEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import engine.jobs.AbstractEffectJob;
|
|||||||
import engine.mbEnums;
|
import engine.mbEnums;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.DamageShield;
|
import engine.powers.DamageShield;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class DamageShieldEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DamageShieldEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class DodgeEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DodgeEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class DurabilityEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DurabilityEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class ExclusiveDamageCapEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ExclusiveDamageCapEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class FadeEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FadeEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class FlyEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FlyEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import engine.net.AbstractNetMsg;
|
|||||||
import engine.net.client.msg.ModifyHealthKillMsg;
|
import engine.net.client.msg.ModifyHealthKillMsg;
|
||||||
import engine.net.client.msg.ModifyHealthMsg;
|
import engine.net.client.msg.ModifyHealthMsg;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -41,6 +42,10 @@ public class HealthEffectModifier extends AbstractEffectModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HealthEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
public static float getMinDamage(float baseMin, float intelligence, float spirit, float focus) {
|
public static float getMinDamage(float baseMin, float intelligence, float spirit, float focus) {
|
||||||
float min = baseMin * (((float) Math.pow(intelligence, 0.75f) * 0.0311f) + (0.02f * (int) focus) + ((float) Math.pow(spirit, 0.75f) * 0.0416f));
|
float min = baseMin * (((float) Math.pow(intelligence, 0.75f) * 0.0311f) + (0.02f * (int) focus) + ((float) Math.pow(spirit, 0.75f) * 0.0416f));
|
||||||
return (float) ((int) (min + 0.5f)); //round to nearest whole number
|
return (float) ((int) (min + 0.5f)); //round to nearest whole number
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class HealthFullEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HealthFullEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class HealthRecoverRateEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public HealthRecoverRateEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class IgnoreDamageCapEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IgnoreDamageCapEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class IgnorePassiveDefenseEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IgnorePassiveDefenseEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class ImmuneToAttackEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImmuneToAttackEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class ImmuneToEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImmuneToEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class ImmuneToPowersEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImmuneToPowersEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import engine.net.client.ClientConnection;
|
|||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
import engine.powers.ActionsBase;
|
import engine.powers.ActionsBase;
|
||||||
import engine.powers.PowersBase;
|
import engine.powers.PowersBase;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -27,6 +28,10 @@ public class InvisibleEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public InvisibleEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import engine.objects.AbstractWorldObject;
|
|||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
import engine.powers.EffectsBase;
|
import engine.powers.EffectsBase;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -122,6 +123,10 @@ public class ItemNameEffectModifier extends AbstractEffectModifier {
|
|||||||
EffectsBase.addItemEffectsByName(n, IDString);
|
EffectsBase.addItemEffectsByName(n, IDString);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemNameEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import engine.powers.ActionsBase;
|
|||||||
import engine.powers.poweractions.AbstractPowerAction;
|
import engine.powers.poweractions.AbstractPowerAction;
|
||||||
import engine.powers.poweractions.DamageOverTimePowerAction;
|
import engine.powers.poweractions.DamageOverTimePowerAction;
|
||||||
import engine.powers.poweractions.DirectDamagePowerAction;
|
import engine.powers.poweractions.DirectDamagePowerAction;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
@@ -43,6 +44,10 @@ public class ManaEffectModifier extends AbstractEffectModifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ManaEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
if (awo == null) {
|
if (awo == null) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class ManaFullEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ManaFullEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class ManaRecoverRateEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ManaRecoverRateEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class MaxDamageEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MaxDamageEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class MeleeDamageEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MeleeDamageEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class MinDamageEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MinDamageEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ package engine.powers.effectmodifiers;
|
|||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.mbEnums.GameObjectType;
|
import engine.mbEnums.GameObjectType;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -22,6 +23,10 @@ public class NoModEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public NoModEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
//TODO check if anything needs removed.
|
//TODO check if anything needs removed.
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class OCVEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public OCVEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class ParryEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ParryEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class PassiveDefenseEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PassiveDefenseEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class PowerCostEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PowerCostEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class PowerCostHealthEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PowerCostHealthEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class PowerDamageEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PowerDamageEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class ProtectionFromEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ProtectionFromEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class ResistanceEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ResistanceEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class ScaleHeightEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ScaleHeightEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import engine.objects.AbstractCharacter;
|
|||||||
import engine.objects.AbstractWorldObject;
|
import engine.objects.AbstractWorldObject;
|
||||||
import engine.objects.Building;
|
import engine.objects.Building;
|
||||||
import engine.objects.Item;
|
import engine.objects.Item;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -24,6 +25,10 @@ public class ScaleWidthEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ScaleWidthEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class ScanRangeEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ScanRangeEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class SeeInvisibleEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SeeInvisibleEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class SilencedEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SilencedEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ package engine.powers.effectmodifiers;
|
|||||||
|
|
||||||
import engine.jobs.AbstractEffectJob;
|
import engine.jobs.AbstractEffectJob;
|
||||||
import engine.objects.*;
|
import engine.objects.*;
|
||||||
|
import engine.wpak.data.ModifierEntry;
|
||||||
|
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
@@ -21,6 +22,10 @@ public class SkillEffectModifier extends AbstractEffectModifier {
|
|||||||
super(rs);
|
super(rs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public SkillEffectModifier(ModifierEntry rs) {
|
||||||
|
super(rs);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
protected void _applyEffectModifier(AbstractCharacter source, AbstractWorldObject awo, int trains, AbstractEffectJob effect) {
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user