|
|
|
@ -12,6 +12,7 @@ import engine.Enum.*;
@@ -12,6 +12,7 @@ import engine.Enum.*;
|
|
|
|
|
import engine.InterestManagement.HeightMap; |
|
|
|
|
import engine.InterestManagement.WorldGrid; |
|
|
|
|
import engine.db.handlers.dbEffectsBaseHandler; |
|
|
|
|
import engine.db.handlers.dbPowerHandler; |
|
|
|
|
import engine.db.handlers.dbSkillReqHandler; |
|
|
|
|
import engine.job.AbstractJob; |
|
|
|
|
import engine.job.AbstractScheduleJob; |
|
|
|
@ -32,7 +33,6 @@ import engine.powers.poweractions.TrackPowerAction;
@@ -32,7 +33,6 @@ import engine.powers.poweractions.TrackPowerAction;
|
|
|
|
|
import engine.server.MBServerStatics; |
|
|
|
|
import org.pmw.tinylog.Logger; |
|
|
|
|
|
|
|
|
|
import java.sql.ResultSet; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.HashSet; |
|
|
|
@ -85,10 +85,6 @@ public enum PowersManager {
@@ -85,10 +85,6 @@ public enum PowersManager {
|
|
|
|
|
return PowersManager.effectsBaseByIDString.get(IDString); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static AbstractPowerAction getPowerActionByID(Integer id) { |
|
|
|
|
return PowersManager.powerActionsByID.get(id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static AbstractPowerAction getPowerActionByIDString(String IDString) { |
|
|
|
|
return PowersManager.powerActionsByIDString.get(IDString); |
|
|
|
|
} |
|
|
|
@ -128,8 +124,8 @@ public enum PowersManager {
@@ -128,8 +124,8 @@ public enum PowersManager {
|
|
|
|
|
dbEffectsBaseHandler.cacheAllEffectModifiers(); |
|
|
|
|
|
|
|
|
|
// Add Source Types to Effects
|
|
|
|
|
PowersManager.addAllSourceTypes(); |
|
|
|
|
PowersManager.addAllAnimationOverrides(); |
|
|
|
|
dbPowerHandler.addAllSourceTypes(); |
|
|
|
|
dbPowerHandler.addAllAnimationOverrides(); |
|
|
|
|
|
|
|
|
|
// Add PowerActions
|
|
|
|
|
AbstractPowerAction.getAllPowerActions(PowersManager.powerActionsByIDString, PowersManager.powerActionsByID, PowersManager.effectsBaseByIDString); |
|
|
|
@ -156,59 +152,6 @@ public enum PowersManager {
@@ -156,59 +152,6 @@ public enum PowersManager {
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void addAllSourceTypes() { |
|
|
|
|
PreparedStatementShared ps = null; |
|
|
|
|
try { |
|
|
|
|
ps = new PreparedStatementShared("SELECT * FROM static_power_sourcetype"); |
|
|
|
|
ResultSet rs = ps.executeQuery(); |
|
|
|
|
String IDString, source; |
|
|
|
|
while (rs.next()) { |
|
|
|
|
IDString = rs.getString("IDString"); |
|
|
|
|
int token = DbManager.hasher.SBStringHash(IDString); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
source = rs.getString("source").replace("-", "").trim(); |
|
|
|
|
EffectSourceType effectSourceType = EffectSourceType.GetEffectSourceType(source); |
|
|
|
|
|
|
|
|
|
if (EffectsBase.effectSourceTypeMap.containsKey(token) == false) |
|
|
|
|
EffectsBase.effectSourceTypeMap.put(token, new HashSet<>()); |
|
|
|
|
|
|
|
|
|
EffectsBase.effectSourceTypeMap.get(token).add(effectSourceType); |
|
|
|
|
} |
|
|
|
|
rs.close(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
Logger.error(e); |
|
|
|
|
} finally { |
|
|
|
|
ps.release(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void addAllAnimationOverrides() { |
|
|
|
|
PreparedStatementShared ps = null; |
|
|
|
|
try { |
|
|
|
|
ps = new PreparedStatementShared("SELECT * FROM static_power_animation_override"); |
|
|
|
|
ResultSet rs = ps.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); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
rs.close(); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
Logger.error(e); |
|
|
|
|
} finally { |
|
|
|
|
ps.release(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static EffectsBase setEffectToken(int ID, int token) { |
|
|
|
|
for (EffectsBase eb : PowersManager.effectsBaseByIDString.values()) { |
|
|
|
|
if (eb.getUUID() == ID) { |
|
|
|
|