Browse Source

Renamed class to not conflict with the java.lang version.

combat-2
MagicBot 7 months ago
parent
commit
c1ee6f5b52
  1. 8
      src/discord/Database.java
  2. 4
      src/discord/DiscordAccount.java
  3. 4
      src/discord/handlers/AccountInfoRequest.java
  4. 12
      src/discord/handlers/BanToggleHandler.java
  5. 4
      src/discord/handlers/PasswordChangeHandler.java
  6. 8
      src/engine/InterestManagement/InterestManager.java
  7. 8
      src/engine/InterestManagement/RealmMap.java
  8. 2
      src/engine/InterestManagement/WorldGrid.java
  9. 8
      src/engine/db/archive/BaneRecord.java
  10. 6
      src/engine/db/archive/CharacterRecord.java
  11. 14
      src/engine/db/archive/CityRecord.java
  12. 4
      src/engine/db/archive/DataRecord.java
  13. 2
      src/engine/db/archive/DataWarehouse.java
  14. 16
      src/engine/db/archive/GuildRecord.java
  15. 14
      src/engine/db/archive/MineRecord.java
  16. 4
      src/engine/db/archive/PvpRecord.java
  17. 16
      src/engine/db/archive/RealmRecord.java
  18. 8
      src/engine/db/handlers/dbAccountHandler.java
  19. 6
      src/engine/db/handlers/dbBaseClassHandler.java
  20. 12
      src/engine/db/handlers/dbBuildingHandler.java
  21. 3
      src/engine/db/handlers/dbBuildingLocationHandler.java
  22. 3
      src/engine/db/handlers/dbCSSessionHandler.java
  23. 6
      src/engine/db/handlers/dbCharacterPowerHandler.java
  24. 6
      src/engine/db/handlers/dbCharacterRuneHandler.java
  25. 8
      src/engine/db/handlers/dbCharacterSkillHandler.java
  26. 6
      src/engine/db/handlers/dbCityHandler.java
  27. 6
      src/engine/db/handlers/dbContractHandler.java
  28. 6
      src/engine/db/handlers/dbEffectsBaseHandler.java
  29. 3
      src/engine/db/handlers/dbEffectsResourceCostHandler.java
  30. 8
      src/engine/db/handlers/dbGuildHandler.java
  31. 6
      src/engine/db/handlers/dbHandlerBase.java
  32. 20
      src/engine/db/handlers/dbItemHandler.java
  33. 3
      src/engine/db/handlers/dbKitHandler.java
  34. 3
      src/engine/db/handlers/dbMenuHandler.java
  35. 8
      src/engine/db/handlers/dbMineHandler.java
  36. 5
      src/engine/db/handlers/dbMobBaseHandler.java
  37. 3
      src/engine/db/handlers/dbMobHandler.java
  38. 5
      src/engine/db/handlers/dbNPCHandler.java
  39. 6
      src/engine/db/handlers/dbPetitionHandler.java
  40. 6
      src/engine/db/handlers/dbPlayerCharacterHandler.java
  41. 6
      src/engine/db/handlers/dbPowerHandler.java
  42. 3
      src/engine/db/handlers/dbPromotionClassHandler.java
  43. 3
      src/engine/db/handlers/dbRuneBaseAttributeHandler.java
  44. 5
      src/engine/db/handlers/dbRuneBaseEffectHandler.java
  45. 3
      src/engine/db/handlers/dbRuneBaseHandler.java
  46. 8
      src/engine/db/handlers/dbRunegateHandler.java
  47. 5
      src/engine/db/handlers/dbShrineHandler.java
  48. 6
      src/engine/db/handlers/dbSkillBaseHandler.java
  49. 3
      src/engine/db/handlers/dbSkillReqHandler.java
  50. 6
      src/engine/db/handlers/dbVendorDialogHandler.java
  51. 12
      src/engine/db/handlers/dbWarehouseHandler.java
  52. 10
      src/engine/db/handlers/dbZoneHandler.java
  53. 2
      src/engine/devcmd/AbstractDevCmd.java
  54. 2
      src/engine/devcmd/cmds/AddBuildingCmd.java
  55. 4
      src/engine/devcmd/cmds/AddMobCmd.java
  56. 2
      src/engine/devcmd/cmds/AddNPCCmd.java
  57. 2
      src/engine/devcmd/cmds/ApplyBonusCmd.java
  58. 2
      src/engine/devcmd/cmds/BoundsCmd.java
  59. 2
      src/engine/devcmd/cmds/GotoCmd.java
  60. 16
      src/engine/devcmd/cmds/GotoObj.java
  61. 12
      src/engine/devcmd/cmds/InfoCmd.java
  62. 2
      src/engine/devcmd/cmds/MakeBaneCmd.java
  63. 4
      src/engine/devcmd/cmds/MakeItemCmd.java
  64. 2
      src/engine/devcmd/cmds/PrintBonusesCmd.java
  65. 12
      src/engine/devcmd/cmds/PrintEquipCmd.java
  66. 2
      src/engine/devcmd/cmds/PrintInventoryCmd.java
  67. 2
      src/engine/devcmd/cmds/PrintSkillsCmd.java
  68. 4
      src/engine/devcmd/cmds/PrintStatsCmd.java
  69. 10
      src/engine/devcmd/cmds/PurgeObjectsCmd.java
  70. 2
      src/engine/devcmd/cmds/RemoveBaneCmd.java
  71. 4
      src/engine/devcmd/cmds/RemoveObjectCmd.java
  72. 2
      src/engine/devcmd/cmds/SetBuildingAltitudeCmd.java
  73. 2
      src/engine/devcmd/cmds/SetGuildCmd.java
  74. 2
      src/engine/devcmd/cmds/SetHealthCmd.java
  75. 6
      src/engine/devcmd/cmds/SetInvulCmd.java
  76. 3
      src/engine/devcmd/cmds/SetManaCmd.java
  77. 2
      src/engine/devcmd/cmds/SetNpcNameCmd.java
  78. 7
      src/engine/devcmd/cmds/SetOwnerCmd.java
  79. 2
      src/engine/devcmd/cmds/SetPromotionClassCmd.java
  80. 2
      src/engine/devcmd/cmds/SetStaminaCmd.java
  81. 2
      src/engine/devcmd/cmds/SetSubRaceCmd.java
  82. 2
      src/engine/devcmd/cmds/ShowOffsetCmd.java
  83. 2
      src/engine/devcmd/cmds/SlotNpcCmd.java
  84. 2
      src/engine/devcmd/cmds/SlotTestCmd.java
  85. 4
      src/engine/devcmd/cmds/SplatMobCmd.java
  86. 2
      src/engine/devcmd/cmds/UnloadFurnitureCmd.java
  87. 10
      src/engine/devcmd/cmds/aiInfoCmd.java
  88. 28
      src/engine/gameManager/BuildingManager.java
  89. 40
      src/engine/gameManager/ChatManager.java
  90. 86
      src/engine/gameManager/CombatManager.java
  91. 4
      src/engine/gameManager/ConfigManager.java
  92. 6
      src/engine/gameManager/DbManager.java
  93. 4
      src/engine/gameManager/DevCmdManager.java
  94. 22
      src/engine/gameManager/GroupManager.java
  95. 10
      src/engine/gameManager/GuildManager.java
  96. 34
      src/engine/gameManager/ItemManager.java
  97. 16
      src/engine/gameManager/LootManager.java
  98. 66
      src/engine/gameManager/MaintenanceManager.java
  99. 8
      src/engine/gameManager/MovementManager.java
  100. 50
      src/engine/gameManager/NPCManager.java
  101. Some files were not shown because too many files have changed in this diff Show More

8
src/discord/Database.java

@ -9,8 +9,8 @@
package discord; package discord;
import engine.Enum;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.mbEnums;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
import java.sql.*; import java.sql.*;
@ -70,7 +70,7 @@ public class Database {
} }
} }
public boolean updateAccountStatus(String discordAccountID, Enum.AccountStatus accountStatus) { public boolean updateAccountStatus(String discordAccountID, mbEnums.AccountStatus accountStatus) {
try (Connection connection = DriverManager.getConnection(sqlURI, ConfigManager.MB_DATABASE_USER.getValue(), try (Connection connection = DriverManager.getConnection(sqlURI, ConfigManager.MB_DATABASE_USER.getValue(),
ConfigManager.MB_DATABASE_PASS.getValue()); ConfigManager.MB_DATABASE_PASS.getValue());
@ -131,7 +131,7 @@ public class Database {
discordAccount = new DiscordAccount(); discordAccount = new DiscordAccount();
discordAccount.discordAccount = rs.getString("discordAccount"); discordAccount.discordAccount = rs.getString("discordAccount");
discordAccount.gameAccountName = rs.getString("acct_uname"); discordAccount.gameAccountName = rs.getString("acct_uname");
discordAccount.status = Enum.AccountStatus.valueOf(rs.getString("status")); discordAccount.status = mbEnums.AccountStatus.valueOf(rs.getString("status"));
discordAccount.isDiscordAdmin = rs.getByte("discordAdmin"); // Registration date cannot be null discordAccount.isDiscordAdmin = rs.getByte("discordAdmin"); // Registration date cannot be null
Timestamp registrationDate = rs.getTimestamp("registrationDate"); Timestamp registrationDate = rs.getTimestamp("registrationDate");
@ -328,7 +328,7 @@ public class Database {
discordAccount = new DiscordAccount(); discordAccount = new DiscordAccount();
discordAccount.discordAccount = rs.getString("discordAccount"); discordAccount.discordAccount = rs.getString("discordAccount");
discordAccount.gameAccountName = rs.getString("acct_uname"); discordAccount.gameAccountName = rs.getString("acct_uname");
discordAccount.status = Enum.AccountStatus.valueOf(rs.getString("status")); discordAccount.status = mbEnums.AccountStatus.valueOf(rs.getString("status"));
// Registration date cannot be null // Registration date cannot be null

4
src/discord/DiscordAccount.java

@ -8,14 +8,14 @@
package discord; package discord;
import engine.Enum; import engine.mbEnums;
import java.time.LocalDateTime; import java.time.LocalDateTime;
public class DiscordAccount { public class DiscordAccount {
public String discordAccount; public String discordAccount;
public String gameAccountName; public String gameAccountName;
public Enum.AccountStatus status; public mbEnums.AccountStatus status;
public LocalDateTime registrationDate; public LocalDateTime registrationDate;
public LocalDateTime lastUpdateRequest; public LocalDateTime lastUpdateRequest;
public byte isDiscordAdmin; public byte isDiscordAdmin;

4
src/discord/handlers/AccountInfoRequest.java

@ -11,7 +11,7 @@ package discord.handlers;
import discord.Database; import discord.Database;
import discord.DiscordAccount; import discord.DiscordAccount;
import discord.MagicBot; import discord.MagicBot;
import engine.Enum; import engine.mbEnums;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import java.util.List; import java.util.List;
@ -21,7 +21,7 @@ public class AccountInfoRequest {
public static void handleRequest(MessageReceivedEvent event) { public static void handleRequest(MessageReceivedEvent event) {
String discordAccountID = event.getAuthor().getId(); String discordAccountID = event.getAuthor().getId();
Enum.AccountStatus accountStatus; mbEnums.AccountStatus accountStatus;
if (Database.online == false) { if (Database.online == false) {

12
src/discord/handlers/BanToggleHandler.java

@ -11,7 +11,7 @@ package discord.handlers;
import discord.DiscordAccount; import discord.DiscordAccount;
import discord.MagicBot; import discord.MagicBot;
import discord.RobotSpeak; import discord.RobotSpeak;
import engine.Enum; import engine.mbEnums;
import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.entities.User;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -23,7 +23,7 @@ public class BanToggleHandler {
public static void handleRequest(MessageReceivedEvent event, String[] args) { public static void handleRequest(MessageReceivedEvent event, String[] args) {
String discordAccountID; String discordAccountID;
Enum.AccountStatus accountStatus; mbEnums.AccountStatus accountStatus;
// Early exit if database unavailable or is not an admin // Early exit if database unavailable or is not an admin
@ -55,10 +55,10 @@ public class BanToggleHandler {
// toggle ban status // toggle ban status
if (discordAccounts.get(0).status.equals(Enum.AccountStatus.BANNED)) if (discordAccounts.get(0).status.equals(mbEnums.AccountStatus.BANNED))
accountStatus = Enum.AccountStatus.ACTIVE; accountStatus = mbEnums.AccountStatus.ACTIVE;
else else
accountStatus = Enum.AccountStatus.BANNED; accountStatus = mbEnums.AccountStatus.BANNED;
// We have a valid discord ID at this point. Banstick? // We have a valid discord ID at this point. Banstick?
@ -82,7 +82,7 @@ public class BanToggleHandler {
// If we're toggling status to active we're done here. // If we're toggling status to active we're done here.
if (accountStatus.equals(Enum.AccountStatus.ACTIVE)) if (accountStatus.equals(mbEnums.AccountStatus.ACTIVE))
return; return;
// Set users role to noob // Set users role to noob

4
src/discord/handlers/PasswordChangeHandler.java

@ -11,7 +11,7 @@ package discord.handlers;
import discord.Database; import discord.Database;
import discord.DiscordAccount; import discord.DiscordAccount;
import discord.MagicBot; import discord.MagicBot;
import engine.Enum; import engine.mbEnums;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent; import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -53,7 +53,7 @@ public class PasswordChangeHandler {
// Banned or suspended user's get no love. // Banned or suspended user's get no love.
if (discordAccount.status.equals(Enum.AccountStatus.BANNED)) { if (discordAccount.status.equals(mbEnums.AccountStatus.BANNED)) {
MagicBot.sendResponse(event, MagicBot.sendResponse(event,
"Sorry but that is too much work. \n" + "Sorry but that is too much work. \n" +
"Your account detailings cannot for to log into game!"); "Your account detailings cannot for to log into game!");

8
src/engine/InterestManagement/InterestManager.java

@ -8,13 +8,13 @@
package engine.InterestManagement; package engine.InterestManagement;
import engine.Enum;
import engine.Enum.DispatchChannel;
import engine.Enum.GameObjectType;
import engine.gameManager.GroupManager; import engine.gameManager.GroupManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.job.JobScheduler; import engine.job.JobScheduler;
import engine.jobs.RefreshGroupJob; import engine.jobs.RefreshGroupJob;
import engine.mbEnums;
import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GameObjectType;
import engine.net.AbstractNetMsg; import engine.net.AbstractNetMsg;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -482,7 +482,7 @@ public enum InterestManager implements Runnable {
awonpc.playerAgroMap.put(player.getObjectUUID(), 0f); awonpc.playerAgroMap.put(player.getObjectUUID(), 0f);
if ((awonpc.agentType.equals(Enum.AIAgentType.MOBILE))) if ((awonpc.agentType.equals(mbEnums.AIAgentType.MOBILE)))
((Mob) awonpc).setCombatTarget(null); ((Mob) awonpc).setCombatTarget(null);
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii()); lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii());

8
src/engine/InterestManagement/RealmMap.java

@ -12,8 +12,8 @@ package engine.InterestManagement;
* Interest management facilities. * Interest management facilities.
*/ */
import engine.Enum;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.TerritoryChangeMessage; import engine.net.client.msg.TerritoryChangeMessage;
@ -88,17 +88,17 @@ public enum RealmMap {
if (city != null) { if (city != null) {
TerritoryChangeMessage tcm = new TerritoryChangeMessage((PlayerCharacter) realm.getRulingCity().getOwner(), realm); TerritoryChangeMessage tcm = new TerritoryChangeMessage((PlayerCharacter) realm.getRulingCity().getOwner(), realm);
Dispatch dispatch = Dispatch.borrow(player, tcm); Dispatch dispatch = Dispatch.borrow(player, tcm);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} else { } else {
TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm); TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm);
Dispatch dispatch = Dispatch.borrow(player, tcm); Dispatch dispatch = Dispatch.borrow(player, tcm);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} }
} else { } else {
TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm); TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm);
Dispatch dispatch = Dispatch.borrow(player, tcm); Dispatch dispatch = Dispatch.borrow(player, tcm);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} }
} }

2
src/engine/InterestManagement/WorldGrid.java

@ -8,7 +8,7 @@
package engine.InterestManagement; package engine.InterestManagement;
import engine.Enum.GridObjectType; import engine.mbEnums.GridObjectType;
import engine.math.FastMath; import engine.math.FastMath;
import engine.math.Vector3f; import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;

8
src/engine/db/archive/BaneRecord.java

@ -9,8 +9,8 @@
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Bane; import engine.objects.Bane;
import engine.objects.City; import engine.objects.City;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
@ -21,7 +21,7 @@ import java.sql.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import static engine.Enum.RecordEventType; import static engine.mbEnums.RecordEventType;
public class BaneRecord extends DataRecord { public class BaneRecord extends DataRecord {
@ -38,7 +38,7 @@ public class BaneRecord extends DataRecord {
private DateTime baneDropTime; private DateTime baneDropTime;
private BaneRecord(Bane bane) { private BaneRecord(Bane bane) {
this.recordType = Enum.DataRecordType.BANE; this.recordType = mbEnums.DataRecordType.BANE;
this.eventType = RecordEventType.PENDING; this.eventType = RecordEventType.PENDING;
} }
@ -51,7 +51,7 @@ public class BaneRecord extends DataRecord {
baneRecord = new BaneRecord(bane); baneRecord = new BaneRecord(bane);
baneRecord.eventType = eventType; baneRecord.eventType = eventType;
} else { } else {
baneRecord.recordType = Enum.DataRecordType.BANE; baneRecord.recordType = mbEnums.DataRecordType.BANE;
baneRecord.eventType = eventType; baneRecord.eventType = eventType;
} }

6
src/engine/db/archive/CharacterRecord.java

@ -9,8 +9,8 @@
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Guild; import engine.objects.Guild;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
@ -33,7 +33,7 @@ public class CharacterRecord extends DataRecord {
private PlayerCharacter player; private PlayerCharacter player;
private CharacterRecord(PlayerCharacter player) { private CharacterRecord(PlayerCharacter player) {
this.recordType = Enum.DataRecordType.CHARACTER; this.recordType = mbEnums.DataRecordType.CHARACTER;
this.player = player; this.player = player;
} }
@ -45,7 +45,7 @@ public class CharacterRecord extends DataRecord {
if (characterRecord == null) { if (characterRecord == null) {
characterRecord = new CharacterRecord(player); characterRecord = new CharacterRecord(player);
} else { } else {
characterRecord.recordType = Enum.DataRecordType.CHARACTER; characterRecord.recordType = mbEnums.DataRecordType.CHARACTER;
characterRecord.player = player; characterRecord.player = player;
} }

14
src/engine/db/archive/CityRecord.java

@ -9,8 +9,8 @@
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.City; import engine.objects.City;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
@ -20,7 +20,7 @@ import java.util.concurrent.LinkedBlockingQueue;
public class CityRecord extends DataRecord { public class CityRecord extends DataRecord {
private static final LinkedBlockingQueue<CityRecord> recordPool = new LinkedBlockingQueue<>(); private static final LinkedBlockingQueue<CityRecord> recordPool = new LinkedBlockingQueue<>();
private Enum.RecordEventType eventType; private mbEnums.RecordEventType eventType;
private City city; private City city;
private String cityHash; private String cityHash;
private String cityGuildHash; private String cityGuildHash;
@ -32,13 +32,13 @@ public class CityRecord extends DataRecord {
private java.time.LocalDateTime establishedDatetime; private java.time.LocalDateTime establishedDatetime;
private CityRecord(City city) { private CityRecord(City city) {
this.recordType = Enum.DataRecordType.CITY; this.recordType = mbEnums.DataRecordType.CITY;
this.city = city; this.city = city;
this.eventType = Enum.RecordEventType.CREATE; this.eventType = mbEnums.RecordEventType.CREATE;
} }
public static CityRecord borrow(City city, Enum.RecordEventType eventType) { public static CityRecord borrow(City city, mbEnums.RecordEventType eventType) {
CityRecord cityRecord; CityRecord cityRecord;
cityRecord = recordPool.poll(); cityRecord = recordPool.poll();
@ -47,7 +47,7 @@ public class CityRecord extends DataRecord {
cityRecord = new CityRecord(city); cityRecord = new CityRecord(city);
cityRecord.eventType = eventType; cityRecord.eventType = eventType;
} else { } else {
cityRecord.recordType = Enum.DataRecordType.CITY; cityRecord.recordType = mbEnums.DataRecordType.CITY;
cityRecord.eventType = eventType; cityRecord.eventType = eventType;
cityRecord.city = city; cityRecord.city = city;
@ -69,7 +69,7 @@ public class CityRecord extends DataRecord {
cityRecord.zoneHash = cityRecord.city.getParent().hash; cityRecord.zoneHash = cityRecord.city.getParent().hash;
if (cityRecord.eventType.equals(Enum.RecordEventType.CREATE)) if (cityRecord.eventType.equals(mbEnums.RecordEventType.CREATE))
cityRecord.establishedDatetime = cityRecord.city.established; cityRecord.establishedDatetime = cityRecord.city.established;
else else
cityRecord.establishedDatetime = java.time.LocalDateTime.now(); cityRecord.establishedDatetime = java.time.LocalDateTime.now();

4
src/engine/db/archive/DataRecord.java

@ -9,11 +9,11 @@
package engine.db.archive; package engine.db.archive;
import engine.Enum; import engine.mbEnums;
class DataRecord { class DataRecord {
public Enum.DataRecordType recordType; public mbEnums.DataRecordType recordType;
DataRecord() { DataRecord() {

2
src/engine/db/archive/DataWarehouse.java

@ -22,7 +22,7 @@ import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import static engine.Enum.DataRecordType; import static engine.mbEnums.DataRecordType;
public class DataWarehouse implements Runnable { public class DataWarehouse implements Runnable {

16
src/engine/db/archive/GuildRecord.java

@ -9,9 +9,9 @@
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.Enum.RecordEventType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.RecordEventType;
import engine.objects.Guild; import engine.objects.Guild;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
@ -30,7 +30,7 @@ public class GuildRecord extends DataRecord {
public static HashMap<Integer, GuildRecord> GuildRecordCache = null; public static HashMap<Integer, GuildRecord> GuildRecordCache = null;
public String guildHash; public String guildHash;
public int guildID; public int guildID;
private Enum.RecordEventType eventType; private mbEnums.RecordEventType eventType;
private Guild guild; private Guild guild;
private String guildName; private String guildName;
private String charterName; private String charterName;
@ -44,9 +44,9 @@ public class GuildRecord extends DataRecord {
private java.time.LocalDateTime eventDatetime; private java.time.LocalDateTime eventDatetime;
private GuildRecord(Guild guild) { private GuildRecord(Guild guild) {
this.recordType = Enum.DataRecordType.GUILD; this.recordType = mbEnums.DataRecordType.GUILD;
this.guild = guild; this.guild = guild;
this.eventType = Enum.RecordEventType.CREATE; this.eventType = mbEnums.RecordEventType.CREATE;
} }
@ -71,7 +71,7 @@ public class GuildRecord extends DataRecord {
} }
public static GuildRecord borrow(Guild guild, Enum.RecordEventType eventType) { public static GuildRecord borrow(Guild guild, mbEnums.RecordEventType eventType) {
GuildRecord guildRecord; GuildRecord guildRecord;
//add //add
guildRecord = recordPool.poll(); guildRecord = recordPool.poll();
@ -81,7 +81,7 @@ public class GuildRecord extends DataRecord {
guildRecord.eventType = eventType; guildRecord.eventType = eventType;
} else { } else {
guildRecord.guild = guild; guildRecord.guild = guild;
guildRecord.recordType = Enum.DataRecordType.GUILD; guildRecord.recordType = mbEnums.DataRecordType.GUILD;
guildRecord.eventType = eventType; guildRecord.eventType = eventType;
} }
@ -89,7 +89,7 @@ public class GuildRecord extends DataRecord {
guildRecord.guildHash = guildRecord.guild.getHash(); guildRecord.guildHash = guildRecord.guild.getHash();
guildRecord.guildID = guildRecord.guild.getObjectUUID(); guildRecord.guildID = guildRecord.guild.getObjectUUID();
guildRecord.guildName = guildRecord.guild.getName(); guildRecord.guildName = guildRecord.guild.getName();
guildRecord.charterName = Enum.GuildCharterType.getGuildTypeFromInt(guildRecord.guild.getCharter()).getCharterName(); guildRecord.charterName = mbEnums.GuildCharterType.getGuildTypeFromInt(guildRecord.guild.getCharter()).getCharterName();
guildRecord.GLHash = DataWarehouse.hasher.encrypt(guildRecord.guild.getGuildLeaderUUID()); guildRecord.GLHash = DataWarehouse.hasher.encrypt(guildRecord.guild.getGuildLeaderUUID());

14
src/engine/db/archive/MineRecord.java

@ -9,8 +9,8 @@
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.AbstractCharacter; import engine.objects.AbstractCharacter;
import engine.objects.Mine; import engine.objects.Mine;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -23,7 +23,7 @@ import java.util.concurrent.LinkedBlockingQueue;
public class MineRecord extends DataRecord { public class MineRecord extends DataRecord {
private static final LinkedBlockingQueue<MineRecord> recordPool = new LinkedBlockingQueue<>(); private static final LinkedBlockingQueue<MineRecord> recordPool = new LinkedBlockingQueue<>();
private Enum.RecordEventType eventType; private mbEnums.RecordEventType eventType;
private String zoneHash; private String zoneHash;
private String charHash; private String charHash;
private String mineGuildHash; private String mineGuildHash;
@ -33,12 +33,12 @@ public class MineRecord extends DataRecord {
private float locY; private float locY;
private MineRecord() { private MineRecord() {
this.recordType = Enum.DataRecordType.MINE; this.recordType = mbEnums.DataRecordType.MINE;
this.eventType = Enum.RecordEventType.CAPTURE; this.eventType = mbEnums.RecordEventType.CAPTURE;
} }
public static MineRecord borrow(Mine mine, AbstractCharacter character, Enum.RecordEventType eventType) { public static MineRecord borrow(Mine mine, AbstractCharacter character, mbEnums.RecordEventType eventType) {
MineRecord mineRecord; MineRecord mineRecord;
mineRecord = recordPool.poll(); mineRecord = recordPool.poll();
@ -48,13 +48,13 @@ public class MineRecord extends DataRecord {
mineRecord = new MineRecord(); mineRecord = new MineRecord();
mineRecord.eventType = eventType; mineRecord.eventType = eventType;
} else { } else {
mineRecord.recordType = Enum.DataRecordType.MINE; mineRecord.recordType = mbEnums.DataRecordType.MINE;
mineRecord.eventType = eventType; mineRecord.eventType = eventType;
} }
mineRecord.zoneHash = mine.getParentZone().hash; mineRecord.zoneHash = mine.getParentZone().hash;
if (character.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { if (character.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
player = (PlayerCharacter) character; player = (PlayerCharacter) character;
mineRecord.charHash = player.getHash(); mineRecord.charHash = player.getHash();
} else } else

4
src/engine/db/archive/PvpRecord.java

@ -23,8 +23,8 @@ import java.time.LocalDateTime;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
import static engine.Enum.DataRecordType; import static engine.mbEnums.DataRecordType;
import static engine.Enum.PvpHistoryType; import static engine.mbEnums.PvpHistoryType;
public class PvpRecord extends DataRecord { public class PvpRecord extends DataRecord {

16
src/engine/db/archive/RealmRecord.java

@ -9,8 +9,8 @@
package engine.db.archive; package engine.db.archive;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Realm; import engine.objects.Realm;
import engine.workthreads.WarehousePushThread; import engine.workthreads.WarehousePushThread;
@ -23,20 +23,20 @@ public class RealmRecord extends DataRecord {
private static final LinkedBlockingQueue<RealmRecord> recordPool = new LinkedBlockingQueue<>(); private static final LinkedBlockingQueue<RealmRecord> recordPool = new LinkedBlockingQueue<>();
private Realm realm; private Realm realm;
private Enum.RecordEventType eventType; private mbEnums.RecordEventType eventType;
private String cityHash; private String cityHash;
private String guildHash; private String guildHash;
private String charterType; private String charterType;
private LocalDateTime eventDateTime; private LocalDateTime eventDateTime;
private RealmRecord(Realm realm) { private RealmRecord(Realm realm) {
this.recordType = Enum.DataRecordType.REALM; this.recordType = mbEnums.DataRecordType.REALM;
this.realm = realm; this.realm = realm;
this.eventType = Enum.RecordEventType.CAPTURE; this.eventType = mbEnums.RecordEventType.CAPTURE;
} }
public static RealmRecord borrow(Realm realm, Enum.RecordEventType eventType) { public static RealmRecord borrow(Realm realm, mbEnums.RecordEventType eventType) {
RealmRecord realmRecord; RealmRecord realmRecord;
realmRecord = recordPool.poll(); realmRecord = recordPool.poll();
@ -45,7 +45,7 @@ public class RealmRecord extends DataRecord {
realmRecord = new RealmRecord(realm); realmRecord = new RealmRecord(realm);
realmRecord.eventType = eventType; realmRecord.eventType = eventType;
} else { } else {
realmRecord.recordType = Enum.DataRecordType.REALM; realmRecord.recordType = mbEnums.DataRecordType.REALM;
realmRecord.eventType = eventType; realmRecord.eventType = eventType;
realmRecord.realm = realm; realmRecord.realm = realm;
@ -53,9 +53,9 @@ public class RealmRecord extends DataRecord {
realmRecord.cityHash = realm.getRulingCity().getHash(); realmRecord.cityHash = realm.getRulingCity().getHash();
realmRecord.guildHash = realm.getRulingCity().getGuild().getHash(); realmRecord.guildHash = realm.getRulingCity().getGuild().getHash();
realmRecord.charterType = Enum.CharterType.getCharterTypeByID(realmRecord.realm.getCharterType()).name(); realmRecord.charterType = mbEnums.CharterType.getCharterTypeByID(realmRecord.realm.getCharterType()).name();
if (realmRecord.eventType.equals(Enum.RecordEventType.CAPTURE)) if (realmRecord.eventType.equals(mbEnums.RecordEventType.CAPTURE))
realmRecord.eventDateTime = realm.ruledSince; realmRecord.eventDateTime = realm.ruledSince;
else else
realmRecord.eventDateTime = LocalDateTime.now(); realmRecord.eventDateTime = LocalDateTime.now();

8
src/engine/db/handlers/dbAccountHandler.java

@ -9,10 +9,10 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.objects.Account; import engine.objects.Account;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -27,7 +27,7 @@ public class dbAccountHandler extends dbHandlerBase {
public dbAccountHandler() { public dbAccountHandler() {
this.localClass = Account.class; this.localClass = Account.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Account GET_ACCOUNT(int accountID) { public Account GET_ACCOUNT(int accountID) {
@ -204,7 +204,7 @@ public class dbAccountHandler extends dbHandlerBase {
if (account != null) { if (account != null) {
account.runAfterLoad(); account.runAfterLoad();
if (ConfigManager.serverType.equals(Enum.ServerType.LOGINSERVER)) if (ConfigManager.serverType.equals(mbEnums.ServerType.LOGINSERVER))
Account.AccountsMap.put(uname, account.getObjectUUID()); Account.AccountsMap.put(uname, account.getObjectUUID());
} }

6
src/engine/db/handlers/dbBaseClassHandler.java

@ -9,9 +9,9 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.objects.BaseClass; import engine.objects.BaseClass;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -25,7 +25,7 @@ public class dbBaseClassHandler extends dbHandlerBase {
public dbBaseClassHandler() { public dbBaseClassHandler() {
this.localClass = BaseClass.class; this.localClass = BaseClass.class;
this.localObjectType = Enum.GameObjectType.BaseClass; this.localObjectType = mbEnums.GameObjectType.BaseClass;
} }
public BaseClass GET_BASE_CLASS(final int id) { public BaseClass GET_BASE_CLASS(final int id) {

12
src/engine/db/handlers/dbBuildingHandler.java

@ -9,13 +9,13 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.DbObjectType;
import engine.Enum.ProtectionState;
import engine.Enum.TaxType;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.mbEnums.DbObjectType;
import engine.mbEnums.ProtectionState;
import engine.mbEnums.TaxType;
import engine.objects.*; import engine.objects.*;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -34,7 +34,7 @@ public class dbBuildingHandler extends dbHandlerBase {
public dbBuildingHandler() { public dbBuildingHandler() {
this.localClass = Building.class; this.localClass = Building.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Building CREATE_BUILDING(int parentZoneID, int OwnerUUID, String name, int meshUUID, public Building CREATE_BUILDING(int parentZoneID, int OwnerUUID, String name, int meshUUID,
@ -112,7 +112,7 @@ public class dbBuildingHandler extends dbHandlerBase {
if (uuid == 0) if (uuid == 0)
return null; return null;
Building building = (Building) DbManager.getFromCache(Enum.GameObjectType.Building, uuid); Building building = (Building) DbManager.getFromCache(mbEnums.GameObjectType.Building, uuid);
if (building != null) if (building != null)
return building; return building;

3
src/engine/db/handlers/dbBuildingLocationHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.BuildingLocation; import engine.objects.BuildingLocation;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -23,7 +24,7 @@ public class dbBuildingLocationHandler extends dbHandlerBase {
public dbBuildingLocationHandler() { public dbBuildingLocationHandler() {
this.localClass = BuildingLocation.class; this.localClass = BuildingLocation.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<BuildingLocation> LOAD_BUILDING_LOCATIONS() { public ArrayList<BuildingLocation> LOAD_BUILDING_LOCATIONS() {

3
src/engine/db/handlers/dbCSSessionHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Account; import engine.objects.Account;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import engine.session.CSSession; import engine.session.CSSession;
@ -26,7 +27,7 @@ public class dbCSSessionHandler extends dbHandlerBase {
public dbCSSessionHandler() { public dbCSSessionHandler() {
this.localClass = CSSession.class; this.localClass = CSSession.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public boolean ADD_CSSESSION(String secKey, Account acc, InetAddress inet, String machineID) { public boolean ADD_CSSESSION(String secKey, Account acc, InetAddress inet, String machineID) {

6
src/engine/db/handlers/dbCharacterPowerHandler.java

@ -9,8 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.CharacterPower; import engine.objects.CharacterPower;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
@ -23,7 +23,7 @@ public class dbCharacterPowerHandler extends dbHandlerBase {
public dbCharacterPowerHandler() { public dbCharacterPowerHandler() {
this.localClass = CharacterPower.class; this.localClass = CharacterPower.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public CharacterPower ADD_CHARACTER_POWER(CharacterPower toAdd) { public CharacterPower ADD_CHARACTER_POWER(CharacterPower toAdd) {
@ -74,7 +74,7 @@ public class dbCharacterPowerHandler extends dbHandlerBase {
public CharacterPower GET_CHARACTER_POWER(int objectUUID) { public CharacterPower GET_CHARACTER_POWER(int objectUUID) {
CharacterPower characterPower = (CharacterPower) DbManager.getFromCache(Enum.GameObjectType.CharacterPower, objectUUID); CharacterPower characterPower = (CharacterPower) DbManager.getFromCache(mbEnums.GameObjectType.CharacterPower, objectUUID);
if (characterPower != null) if (characterPower != null)
return characterPower; return characterPower;

6
src/engine/db/handlers/dbCharacterRuneHandler.java

@ -9,8 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.CharacterRune; import engine.objects.CharacterRune;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -21,7 +21,7 @@ public class dbCharacterRuneHandler extends dbHandlerBase {
public dbCharacterRuneHandler() { public dbCharacterRuneHandler() {
this.localClass = CharacterRune.class; this.localClass = CharacterRune.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public CharacterRune ADD_CHARACTER_RUNE(final CharacterRune toAdd) { public CharacterRune ADD_CHARACTER_RUNE(final CharacterRune toAdd) {
@ -49,7 +49,7 @@ public class dbCharacterRuneHandler extends dbHandlerBase {
public CharacterRune GET_CHARACTER_RUNE(int runeID) { public CharacterRune GET_CHARACTER_RUNE(int runeID) {
CharacterRune characterRune = (CharacterRune) DbManager.getFromCache(Enum.GameObjectType.CharacterRune, runeID); CharacterRune characterRune = (CharacterRune) DbManager.getFromCache(mbEnums.GameObjectType.CharacterRune, runeID);
if (characterRune != null) if (characterRune != null)
return characterRune; return characterRune;

8
src/engine/db/handlers/dbCharacterSkillHandler.java

@ -9,8 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.AbstractCharacter; import engine.objects.AbstractCharacter;
import engine.objects.CharacterSkill; import engine.objects.CharacterSkill;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -24,7 +24,7 @@ public class dbCharacterSkillHandler extends dbHandlerBase {
public dbCharacterSkillHandler() { public dbCharacterSkillHandler() {
this.localClass = CharacterSkill.class; this.localClass = CharacterSkill.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public CharacterSkill ADD_SKILL(CharacterSkill toAdd) { public CharacterSkill ADD_SKILL(CharacterSkill toAdd) {
@ -72,7 +72,7 @@ public class dbCharacterSkillHandler extends dbHandlerBase {
public CharacterSkill GET_SKILL(final int objectUUID) { public CharacterSkill GET_SKILL(final int objectUUID) {
CharacterSkill characterSkill = (CharacterSkill) DbManager.getFromCache(Enum.GameObjectType.CharacterSkill, objectUUID); CharacterSkill characterSkill = (CharacterSkill) DbManager.getFromCache(mbEnums.GameObjectType.CharacterSkill, objectUUID);
if (characterSkill != null) if (characterSkill != null)
return characterSkill; return characterSkill;
@ -95,7 +95,7 @@ public class dbCharacterSkillHandler extends dbHandlerBase {
ConcurrentHashMap<String, CharacterSkill> characterSkills = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW); ConcurrentHashMap<String, CharacterSkill> characterSkills = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
if (ac == null || (!(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))) if (ac == null || (!(ac.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))))
return characterSkills; return characterSkills;
PlayerCharacter playerCharacter = (PlayerCharacter) ac; PlayerCharacter playerCharacter = (PlayerCharacter) ac;

6
src/engine/db/handlers/dbCityHandler.java

@ -9,8 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.City; import engine.objects.City;
@ -25,7 +25,7 @@ public class dbCityHandler extends dbHandlerBase {
public dbCityHandler() { public dbCityHandler() {
this.localClass = City.class; this.localClass = City.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static void addObject(ArrayList<AbstractGameObject> list, ResultSet rs) throws SQLException { public static void addObject(ArrayList<AbstractGameObject> list, ResultSet rs) throws SQLException {
@ -118,7 +118,7 @@ public class dbCityHandler extends dbHandlerBase {
public City GET_CITY(final int cityId) { public City GET_CITY(final int cityId) {
City city = (City) DbManager.getFromCache(Enum.GameObjectType.City, cityId); City city = (City) DbManager.getFromCache(mbEnums.GameObjectType.City, cityId);
if (city != null) if (city != null)
return city; return city;

6
src/engine/db/handlers/dbContractHandler.java

@ -9,8 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Contract; import engine.objects.Contract;
import engine.objects.Item; import engine.objects.Item;
import engine.objects.MobLoot; import engine.objects.MobLoot;
@ -25,12 +25,12 @@ public class dbContractHandler extends dbHandlerBase {
public dbContractHandler() { public dbContractHandler() {
this.localClass = Contract.class; this.localClass = Contract.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Contract GET_CONTRACT(final int objectUUID) { public Contract GET_CONTRACT(final int objectUUID) {
Contract contract = (Contract) DbManager.getFromCache(Enum.GameObjectType.Contract, objectUUID); Contract contract = (Contract) DbManager.getFromCache(mbEnums.GameObjectType.Contract, objectUUID);
if (contract != null) if (contract != null)
return contract; return contract;

6
src/engine/db/handlers/dbEffectsBaseHandler.java

@ -9,9 +9,9 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.mbEnums;
import engine.powers.EffectsBase; import engine.powers.EffectsBase;
import engine.powers.effectmodifiers.*; import engine.powers.effectmodifiers.*;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -63,7 +63,7 @@ public class dbEffectsBaseHandler extends dbHandlerBase {
IDString = rs.getString("IDString"); IDString = rs.getString("IDString");
EffectsBase effectBase = PowersManager.getEffectByIDString(IDString); EffectsBase effectBase = PowersManager.getEffectByIDString(IDString);
Enum.ModType modifier = Enum.ModType.GetModType(rs.getString("modType")); mbEnums.ModType modifier = mbEnums.ModType.GetModType(rs.getString("modType"));
//combine item prefix and suffix effect modifiers //combine item prefix and suffix effect modifiers
@ -86,7 +86,7 @@ public class dbEffectsBaseHandler extends dbHandlerBase {
} }
private static AbstractEffectModifier getCombinedModifiers(AbstractEffectModifier abstractEffectModifier, ResultSet rs, EffectsBase effectBase, Enum.ModType modifier) throws SQLException { private static AbstractEffectModifier getCombinedModifiers(AbstractEffectModifier abstractEffectModifier, ResultSet rs, EffectsBase effectBase, mbEnums.ModType modifier) throws SQLException {
switch (modifier) { switch (modifier) {
case AdjustAboveDmgCap: case AdjustAboveDmgCap:
abstractEffectModifier = new AdjustAboveDmgCapEffectModifier(rs); abstractEffectModifier = new AdjustAboveDmgCapEffectModifier(rs);

3
src/engine/db/handlers/dbEffectsResourceCostHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.EffectsResourceCosts; import engine.objects.EffectsResourceCosts;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -23,7 +24,7 @@ public class dbEffectsResourceCostHandler extends dbHandlerBase {
public dbEffectsResourceCostHandler() { public dbEffectsResourceCostHandler() {
this.localClass = EffectsResourceCosts.class; this.localClass = EffectsResourceCosts.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<EffectsResourceCosts> GET_ALL_EFFECT_RESOURCES(String idString) { public ArrayList<EffectsResourceCosts> GET_ALL_EFFECT_RESOURCES(String idString) {

8
src/engine/db/handlers/dbGuildHandler.java

@ -9,9 +9,9 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GuildHistoryType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GuildHistoryType;
import engine.objects.*; import engine.objects.*;
import engine.server.world.WorldServer; import engine.server.world.WorldServer;
import org.joda.time.DateTime; import org.joda.time.DateTime;
@ -24,7 +24,7 @@ public class dbGuildHandler extends dbHandlerBase {
public dbGuildHandler() { public dbGuildHandler() {
this.localClass = Guild.class; this.localClass = Guild.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static ArrayList<PlayerCharacter> GET_GUILD_BANISHED(final int id) { public static ArrayList<PlayerCharacter> GET_GUILD_BANISHED(final int id) {
@ -276,7 +276,7 @@ public class dbGuildHandler extends dbHandlerBase {
public Guild GET_GUILD(int id) { public Guild GET_GUILD(int id) {
Guild guild = (Guild) DbManager.getFromCache(Enum.GameObjectType.Guild, id); Guild guild = (Guild) DbManager.getFromCache(mbEnums.GameObjectType.Guild, id);
if (guild != null) if (guild != null)
return guild; return guild;

6
src/engine/db/handlers/dbHandlerBase.java

@ -9,10 +9,10 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -42,7 +42,7 @@ public abstract class dbHandlerBase {
// Only call runAfterLoad() for objects instanced on the world server // Only call runAfterLoad() for objects instanced on the world server
if ((abstractGameObject != null && abstractGameObject instanceof AbstractWorldObject) && if ((abstractGameObject != null && abstractGameObject instanceof AbstractWorldObject) &&
(ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER) || (ConfigManager.serverType.equals(mbEnums.ServerType.WORLDSERVER) ||
(abstractGameObject.getObjectType() == GameObjectType.Guild))) (abstractGameObject.getObjectType() == GameObjectType.Guild)))
((AbstractWorldObject) abstractGameObject).runAfterLoad(); ((AbstractWorldObject) abstractGameObject).runAfterLoad();

20
src/engine/db/handlers/dbItemHandler.java

@ -9,10 +9,10 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum;
import engine.Enum.ItemContainerType;
import engine.Enum.ItemType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.mbEnums.ItemContainerType;
import engine.mbEnums.ItemType;
import engine.objects.AbstractCharacter; import engine.objects.AbstractCharacter;
import engine.objects.CharacterItemManager; import engine.objects.CharacterItemManager;
import engine.objects.Item; import engine.objects.Item;
@ -33,7 +33,7 @@ public class dbItemHandler extends dbHandlerBase {
public dbItemHandler() { public dbItemHandler() {
this.localClass = Item.class; this.localClass = Item.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
private static String formatTradeString(HashSet<Integer> list) { private static String formatTradeString(HashSet<Integer> list) {
@ -92,14 +92,14 @@ public class dbItemHandler extends dbHandlerBase {
break; break;
} }
if (toAdd.equipSlot.equals(Enum.EquipSlotType.NONE)) if (toAdd.equipSlot.equals(mbEnums.EquipSlotType.NONE))
preparedStatement.setString(7, ""); preparedStatement.setString(7, "");
else else
preparedStatement.setString(7, toAdd.equipSlot.name()); preparedStatement.setString(7, toAdd.equipSlot.name());
String flagString = ""; String flagString = "";
for (Enum.ItemFlags itemflag : toAdd.flags) for (mbEnums.ItemFlags itemflag : toAdd.flags)
flagString += itemflag.toString() + ";"; flagString += itemflag.toString() + ";";
flagString = flagString.replaceAll(";$", ""); flagString = flagString.replaceAll(";$", "");
@ -366,7 +366,7 @@ public class dbItemHandler extends dbHandlerBase {
//Used to transfer a single item between owners or equip or vault or bank or inventory //Used to transfer a single item between owners or equip or vault or bank or inventory
public boolean UPDATE_OWNER(final Item item, int newOwnerID, public boolean UPDATE_OWNER(final Item item, int newOwnerID,
ItemContainerType containerType, Enum.EquipSlotType slot) { ItemContainerType containerType, mbEnums.EquipSlotType slot) {
boolean worked = false; boolean worked = false;
@ -401,7 +401,7 @@ public class dbItemHandler extends dbHandlerBase {
break; break;
} }
if (slot.equals(Enum.EquipSlotType.NONE)) if (slot.equals(mbEnums.EquipSlotType.NONE))
preparedStatement.setString(4, ""); preparedStatement.setString(4, "");
else else
preparedStatement.setString(4, slot.name()); preparedStatement.setString(4, slot.name());
@ -531,7 +531,7 @@ public class dbItemHandler extends dbHandlerBase {
String flagString = ""; String flagString = "";
for (Enum.ItemFlags itemflag : item.flags) for (mbEnums.ItemFlags itemflag : item.flags)
flagString += itemflag.toString() + ";"; flagString += itemflag.toString() + ";";
flagString = flagString.replaceAll(";$", ""); flagString = flagString.replaceAll(";$", "");
@ -573,7 +573,7 @@ public class dbItemHandler extends dbHandlerBase {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `equipSlot`=? WHERE `UID` = ?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_item` SET `equipSlot`=? WHERE `UID` = ?")) {
if (item.equipSlot.equals(Enum.EquipSlotType.NONE)) if (item.equipSlot.equals(mbEnums.EquipSlotType.NONE))
preparedStatement.setString(1, ""); preparedStatement.setString(1, "");
else else
preparedStatement.setString(1, item.equipSlot.name()); preparedStatement.setString(1, item.equipSlot.name());

3
src/engine/db/handlers/dbKitHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Kit; import engine.objects.Kit;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -23,7 +24,7 @@ public class dbKitHandler extends dbHandlerBase {
public dbKitHandler() { public dbKitHandler() {
this.localClass = Kit.class; this.localClass = Kit.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<Kit> GET_ALL_KITS() { public ArrayList<Kit> GET_ALL_KITS() {

3
src/engine/db/handlers/dbMenuHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.MenuOption; import engine.objects.MenuOption;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -23,7 +24,7 @@ public class dbMenuHandler extends dbHandlerBase {
public dbMenuHandler() { public dbMenuHandler() {
this.localClass = MenuOption.class; this.localClass = MenuOption.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<MenuOption> GET_MENU_OPTIONS(final int id) { public ArrayList<MenuOption> GET_MENU_OPTIONS(final int id) {

8
src/engine/db/handlers/dbMineHandler.java

@ -8,7 +8,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.mbEnums;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.Mine; import engine.objects.Mine;
import engine.objects.MineProduction; import engine.objects.MineProduction;
@ -24,7 +24,7 @@ public class dbMineHandler extends dbHandlerBase {
public dbMineHandler() { public dbMineHandler() {
this.localClass = Mine.class; this.localClass = Mine.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Mine GET_MINE(int id) { public Mine GET_MINE(int id) {
@ -32,7 +32,7 @@ public class dbMineHandler extends dbHandlerBase {
if (id == 0) if (id == 0)
return null; return null;
Mine mine = (Mine) DbManager.getFromCache(Enum.GameObjectType.Mine, id); Mine mine = (Mine) DbManager.getFromCache(mbEnums.GameObjectType.Mine, id);
if (mine != null) if (mine != null)
return mine; return mine;
@ -83,7 +83,7 @@ public class dbMineHandler extends dbHandlerBase {
return false; return false;
} }
public boolean CHANGE_RESOURCE(Mine mine, Enum.ResourceType resource) { public boolean CHANGE_RESOURCE(Mine mine, mbEnums.ResourceType resource) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_mine` SET `mine_resource`=? WHERE `UID`=?")) { PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_mine` SET `mine_resource`=? WHERE `UID`=?")) {

5
src/engine/db/handlers/dbMobBaseHandler.java

@ -9,7 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.GameObjectType; import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.MobBase; import engine.objects.MobBase;
import engine.objects.MobBaseEffects; import engine.objects.MobBaseEffects;
@ -26,7 +27,7 @@ public class dbMobBaseHandler extends dbHandlerBase {
public dbMobBaseHandler() { public dbMobBaseHandler() {
this.localClass = MobBase.class; this.localClass = MobBase.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public MobBase GET_MOBBASE(int id) { public MobBase GET_MOBBASE(int id) {

3
src/engine/db/handlers/dbMobHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.Mob; import engine.objects.Mob;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -24,7 +25,7 @@ public class dbMobHandler extends dbHandlerBase {
public dbMobHandler() { public dbMobHandler() {
this.localClass = Mob.class; this.localClass = Mob.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public Mob PERSIST(Mob toAdd) { public Mob PERSIST(Mob toAdd) {

5
src/engine/db/handlers/dbNPCHandler.java

@ -9,7 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.ProfitType; import engine.mbEnums;
import engine.mbEnums.ProfitType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.NPC; import engine.objects.NPC;
@ -29,7 +30,7 @@ public class dbNPCHandler extends dbHandlerBase {
public dbNPCHandler() { public dbNPCHandler() {
this.localClass = NPC.class; this.localClass = NPC.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static HashMap<Integer, ArrayList<Integer>> LOAD_RUNES_FOR_NPC_AND_MOBS() { public static HashMap<Integer, ArrayList<Integer>> LOAD_RUNES_FOR_NPC_AND_MOBS() {

6
src/engine/db/handlers/dbPetitionHandler.java

@ -9,7 +9,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.mbEnums;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.Petition; import engine.objects.Petition;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -58,8 +58,8 @@ public class dbPetitionHandler extends dbHandlerBase {
" VALUES (?,?,?,?,?,?,?,?,?);")) { " VALUES (?,?,?,?,?,?,?,?,?);")) {
preparedStatement.setTimestamp(1, new java.sql.Timestamp(System.currentTimeMillis())); preparedStatement.setTimestamp(1, new java.sql.Timestamp(System.currentTimeMillis()));
preparedStatement.setString(2, Enum.PetitionType.values()[petition.primaryType].name()); preparedStatement.setString(2, mbEnums.PetitionType.values()[petition.primaryType].name());
preparedStatement.setString(3, Enum.PetitionSubType.values()[petition.subType].name()); preparedStatement.setString(3, mbEnums.PetitionSubType.values()[petition.subType].name());
preparedStatement.setInt(4, petition.reportAccount.getObjectUUID()); preparedStatement.setInt(4, petition.reportAccount.getObjectUUID());
preparedStatement.setString(5, petition.reportAccount.getUname()); preparedStatement.setString(5, petition.reportAccount.getUname());
preparedStatement.setInt(6, petition.reportPlayer.getObjectUUID()); preparedStatement.setInt(6, petition.reportPlayer.getObjectUUID());

6
src/engine/db/handlers/dbPlayerCharacterHandler.java

@ -9,7 +9,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.mbEnums;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.AbstractWorldObject; import engine.objects.AbstractWorldObject;
import engine.objects.Heraldry; import engine.objects.Heraldry;
@ -29,7 +29,7 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
public dbPlayerCharacterHandler() { public dbPlayerCharacterHandler() {
this.localClass = PlayerCharacter.class; this.localClass = PlayerCharacter.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public PlayerCharacter ADD_PLAYER_CHARACTER(final PlayerCharacter toAdd) { public PlayerCharacter ADD_PLAYER_CHARACTER(final PlayerCharacter toAdd) {
@ -176,7 +176,7 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
if (objectUUID == 0) if (objectUUID == 0)
return null; return null;
PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(Enum.GameObjectType.PlayerCharacter, objectUUID); PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(mbEnums.GameObjectType.PlayerCharacter, objectUUID);
if (playerCharacter != null) if (playerCharacter != null)
return playerCharacter; return playerCharacter;

6
src/engine/db/handlers/dbPowerHandler.java

@ -9,7 +9,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.mbEnums;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.objects.Mob; import engine.objects.Mob;
@ -25,7 +25,7 @@ public class dbPowerHandler extends dbHandlerBase {
public dbPowerHandler() { public dbPowerHandler() {
this.localClass = Mob.class; this.localClass = Mob.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static void addAllSourceTypes() { public static void addAllSourceTypes() {
@ -41,7 +41,7 @@ public class dbPowerHandler extends dbHandlerBase {
int token = DbManager.hasher.SBStringHash(IDString); int token = DbManager.hasher.SBStringHash(IDString);
source = rs.getString("source").replace("-", "").trim(); source = rs.getString("source").replace("-", "").trim();
Enum.EffectSourceType effectSourceType = Enum.EffectSourceType.GetEffectSourceType(source); mbEnums.EffectSourceType effectSourceType = mbEnums.EffectSourceType.GetEffectSourceType(source);
if (EffectsBase.effectSourceTypeMap.containsKey(token) == false) if (EffectsBase.effectSourceTypeMap.containsKey(token) == false)
EffectsBase.effectSourceTypeMap.put(token, new HashSet<>()); EffectsBase.effectSourceTypeMap.put(token, new HashSet<>());

3
src/engine/db/handlers/dbPromotionClassHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.PromotionClass; import engine.objects.PromotionClass;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -23,7 +24,7 @@ public class dbPromotionClassHandler extends dbHandlerBase {
public dbPromotionClassHandler() { public dbPromotionClassHandler() {
this.localClass = PromotionClass.class; this.localClass = PromotionClass.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<Integer> GET_ALLOWED_RUNES(final PromotionClass pc) { public ArrayList<Integer> GET_ALLOWED_RUNES(final PromotionClass pc) {

3
src/engine/db/handlers/dbRuneBaseAttributeHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.RuneBaseAttribute; import engine.objects.RuneBaseAttribute;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -23,7 +24,7 @@ public class dbRuneBaseAttributeHandler extends dbHandlerBase {
public dbRuneBaseAttributeHandler() { public dbRuneBaseAttributeHandler() {
this.localClass = RuneBaseAttribute.class; this.localClass = RuneBaseAttribute.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<RuneBaseAttribute> GET_ATTRIBUTES_FOR_RUNEBASE() { public ArrayList<RuneBaseAttribute> GET_ATTRIBUTES_FOR_RUNEBASE() {

5
src/engine/db/handlers/dbRuneBaseEffectHandler.java

@ -9,7 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.GameObjectType; import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.RuneBaseEffect; import engine.objects.RuneBaseEffect;
@ -26,7 +27,7 @@ public class dbRuneBaseEffectHandler extends dbHandlerBase {
public dbRuneBaseEffectHandler() { public dbRuneBaseEffectHandler() {
this.localClass = RuneBaseEffect.class; this.localClass = RuneBaseEffect.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<RuneBaseEffect> GET_EFFECTS_FOR_RUNEBASE(int id) { public ArrayList<RuneBaseEffect> GET_EFFECTS_FOR_RUNEBASE(int id) {

3
src/engine/db/handlers/dbRuneBaseHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.RuneBase; import engine.objects.RuneBase;
import engine.powers.RunePowerEntry; import engine.powers.RunePowerEntry;
import engine.powers.RuneSkillAdjustEntry; import engine.powers.RuneSkillAdjustEntry;
@ -26,7 +27,7 @@ public class dbRuneBaseHandler extends dbHandlerBase {
public dbRuneBaseHandler() { public dbRuneBaseHandler() {
this.localClass = RuneBase.class; this.localClass = RuneBase.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static HashMap<Integer, ArrayList<RunePowerEntry>> LOAD_RUNE_POWERS() { public static HashMap<Integer, ArrayList<RunePowerEntry>> LOAD_RUNE_POWERS() {

8
src/engine/db/handlers/dbRunegateHandler.java

@ -9,7 +9,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.mbEnums;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.Portal; import engine.objects.Portal;
@ -49,7 +49,7 @@ public class dbRunegateHandler extends dbHandlerBase {
public ArrayList<Portal> GET_PORTAL_LIST(int gateUID) { public ArrayList<Portal> GET_PORTAL_LIST(int gateUID) {
ArrayList<Portal> portalList = new ArrayList<>(); ArrayList<Portal> portalList = new ArrayList<>();
Building sourceBuilding = (Building) DbManager.getObject(Enum.GameObjectType.Building, gateUID); Building sourceBuilding = (Building) DbManager.getObject(mbEnums.GameObjectType.Building, gateUID);
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_runegate_portals` WHERE `sourceBuilding` = ?;")) { PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_runegate_portals` WHERE `sourceBuilding` = ?;")) {
@ -60,8 +60,8 @@ public class dbRunegateHandler extends dbHandlerBase {
while (rs.next()) { while (rs.next()) {
int targetBuildingID = rs.getInt("targetBuilding"); int targetBuildingID = rs.getInt("targetBuilding");
Building targetBuilding = (Building) DbManager.getObject(Enum.GameObjectType.Building, targetBuildingID); Building targetBuilding = (Building) DbManager.getObject(mbEnums.GameObjectType.Building, targetBuildingID);
Enum.PortalType portalType = Enum.PortalType.valueOf(rs.getString("portalType")); mbEnums.PortalType portalType = mbEnums.PortalType.valueOf(rs.getString("portalType"));
Portal portal = new Portal(sourceBuilding, portalType, targetBuilding); Portal portal = new Portal(sourceBuilding, portalType, targetBuilding);
portalList.add(portal); portalList.add(portal);
} }

5
src/engine/db/handlers/dbShrineHandler.java

@ -9,7 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum.ProtectionState; import engine.mbEnums;
import engine.mbEnums.ProtectionState;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
@ -28,7 +29,7 @@ public class dbShrineHandler extends dbHandlerBase {
public dbShrineHandler() { public dbShrineHandler() {
this.localClass = Shrine.class; this.localClass = Shrine.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static void addObject(ArrayList<AbstractGameObject> list, ResultSet rs) throws SQLException { public static void addObject(ArrayList<AbstractGameObject> list, ResultSet rs) throws SQLException {

6
src/engine/db/handlers/dbSkillBaseHandler.java

@ -9,8 +9,8 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.mbEnums;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.MaxSkills; import engine.objects.MaxSkills;
import engine.objects.SkillsBase; import engine.objects.SkillsBase;
@ -27,7 +27,7 @@ public class dbSkillBaseHandler extends dbHandlerBase {
public dbSkillBaseHandler() { public dbSkillBaseHandler() {
this.localClass = SkillsBase.class; this.localClass = SkillsBase.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public SkillsBase GET_BASE(final int objectUUID) { public SkillsBase GET_BASE(final int objectUUID) {

3
src/engine/db/handlers/dbSkillReqHandler.java

@ -10,6 +10,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums;
import engine.objects.SkillReq; import engine.objects.SkillReq;
import engine.powers.PowersBase; import engine.powers.PowersBase;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -25,7 +26,7 @@ public class dbSkillReqHandler extends dbHandlerBase {
public dbSkillReqHandler() { public dbSkillReqHandler() {
this.localClass = SkillReq.class; this.localClass = SkillReq.class;
this.localObjectType = engine.Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public static ArrayList<PowersBase> getAllPowersBase() { public static ArrayList<PowersBase> getAllPowersBase() {

6
src/engine/db/handlers/dbVendorDialogHandler.java

@ -9,7 +9,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.mbEnums;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.VendorDialog; import engine.objects.VendorDialog;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -23,12 +23,12 @@ public class dbVendorDialogHandler extends dbHandlerBase {
public dbVendorDialogHandler() { public dbVendorDialogHandler() {
this.localClass = VendorDialog.class; this.localClass = VendorDialog.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public VendorDialog GET_VENDORDIALOG(final int objectUUID) { public VendorDialog GET_VENDORDIALOG(final int objectUUID) {
VendorDialog vendorDialog = (VendorDialog) DbManager.getFromCache(Enum.GameObjectType.VendorDialog, objectUUID); VendorDialog vendorDialog = (VendorDialog) DbManager.getFromCache(mbEnums.GameObjectType.VendorDialog, objectUUID);
if (vendorDialog != null) if (vendorDialog != null)
return vendorDialog; return vendorDialog;

12
src/engine/db/handlers/dbWarehouseHandler.java

@ -9,9 +9,9 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.mbEnums;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.Enum.TransactionType; import engine.mbEnums.TransactionType;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.City; import engine.objects.City;
@ -39,7 +39,7 @@ public class dbWarehouseHandler extends dbHandlerBase {
} }
public boolean CREATE_TRANSACTION(int warehouseBuildingID, GameObjectType targetType, int targetUUID, TransactionType transactionType, Enum.ResourceType resource, int amount, DateTime date) { public boolean CREATE_TRANSACTION(int warehouseBuildingID, GameObjectType targetType, int targetUUID, TransactionType transactionType, mbEnums.ResourceType resource, int amount, DateTime date) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_warehouse_transactions` (`warehouseUID`, `targetType`,`targetUID`, `type`,`resource`,`amount`,`date` ) VALUES (?,?,?,?,?,?,?)")) { PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO `dyn_warehouse_transactions` (`warehouseUID`, `targetType`,`targetUID`, `type`,`resource`,`amount`,`date` ) VALUES (?,?,?,?,?,?,?)")) {
@ -105,7 +105,7 @@ public class dbWarehouseHandler extends dbHandlerBase {
JSONArray locks = new JSONArray(); JSONArray locks = new JSONArray();
for (Enum.ResourceType resource : warehouse.locked) for (mbEnums.ResourceType resource : warehouse.locked)
locks.add(resource.name()); locks.add(resource.name());
warehouseJSON.put("locked", locks); warehouseJSON.put("locked", locks);
@ -142,7 +142,7 @@ public class dbWarehouseHandler extends dbHandlerBase {
// Locate warehouse building // Locate warehouse building
for (Building building : city.parentZone.zoneBuildingSet) { for (Building building : city.parentZone.zoneBuildingSet) {
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.WAREHOUSE)) { if (building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.WAREHOUSE)) {
city.warehouse.building = building; city.warehouse.building = building;
break; break;
} }

10
src/engine/db/handlers/dbZoneHandler.java

@ -9,7 +9,7 @@
package engine.db.handlers; package engine.db.handlers;
import engine.Enum; import engine.mbEnums;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.objects.Zone; import engine.objects.Zone;
@ -26,7 +26,7 @@ public class dbZoneHandler extends dbHandlerBase {
public dbZoneHandler() { public dbZoneHandler() {
this.localClass = Zone.class; this.localClass = Zone.class;
this.localObjectType = Enum.GameObjectType.valueOf(this.localClass.getSimpleName()); this.localObjectType = mbEnums.GameObjectType.valueOf(this.localClass.getSimpleName());
} }
public ArrayList<Zone> GET_ALL_ZONES() { public ArrayList<Zone> GET_ALL_ZONES() {
@ -48,7 +48,7 @@ public class dbZoneHandler extends dbHandlerBase {
public Zone GET_BY_UID(long ID) { public Zone GET_BY_UID(long ID) {
Zone zone = (Zone) DbManager.getFromCache(Enum.GameObjectType.Zone, (int) ID); Zone zone = (Zone) DbManager.getFromCache(mbEnums.GameObjectType.Zone, (int) ID);
if (zone != null) if (zone != null)
return zone; return zone;
@ -90,8 +90,8 @@ public class dbZoneHandler extends dbHandlerBase {
zoneTemplate.max_blend = 128; zoneTemplate.max_blend = 128;
zoneTemplate.min_blend = 128; zoneTemplate.min_blend = 128;
zoneTemplate.terrain_max_y = 5; zoneTemplate.terrain_max_y = 5;
zoneTemplate.major_radius = (int) Enum.CityBoundsType.ZONE.halfExtents; zoneTemplate.major_radius = (int) mbEnums.CityBoundsType.ZONE.halfExtents;
zoneTemplate.minor_radius = (int) Enum.CityBoundsType.ZONE.halfExtents; zoneTemplate.minor_radius = (int) mbEnums.CityBoundsType.ZONE.halfExtents;
zoneTemplate.terrain_type = "PLANAR"; zoneTemplate.terrain_type = "PLANAR";
ZoneManager._zone_templates.put(zoneTemplate.templateID, zoneTemplate); ZoneManager._zone_templates.put(zoneTemplate.templateID, zoneTemplate);

2
src/engine/devcmd/AbstractDevCmd.java

@ -9,9 +9,9 @@
package engine.devcmd; package engine.devcmd;
import engine.Enum.GameObjectType;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums.GameObjectType;
import engine.objects.*; import engine.objects.*;
import java.util.ArrayList; import java.util.ArrayList;

2
src/engine/devcmd/cmds/AddBuildingCmd.java

@ -9,7 +9,6 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.ProtectionState;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
@ -17,6 +16,7 @@ import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3f; import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums.ProtectionState;
import engine.objects.*; import engine.objects.*;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;

4
src/engine/devcmd/cmds/AddMobCmd.java

@ -9,10 +9,10 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.mbEnums;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Mob; import engine.objects.Mob;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
@ -61,7 +61,7 @@ public class AddMobCmd extends AbstractDevCmd {
} }
Mob mob = Mob.createMob(loadID, pc.getLoc(), Mob mob = Mob.createMob(loadID, pc.getLoc(),
null, zone, null, null, "", 1, Enum.AIAgentType.MOBILE); null, zone, null, null, "", 1, mbEnums.AIAgentType.MOBILE);
if (mob != null) { if (mob != null) {
mob.updateDatabase(); mob.updateDatabase();

2
src/engine/devcmd/cmds/AddNPCCmd.java

@ -9,10 +9,10 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.*; import engine.gameManager.*;
import engine.mbEnums.GameObjectType;
import engine.objects.*; import engine.objects.*;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;

2
src/engine/devcmd/cmds/ApplyBonusCmd.java

@ -9,10 +9,10 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.PowerActionType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.mbEnums.PowerActionType;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import engine.powers.ActionsBase; import engine.powers.ActionsBase;

2
src/engine/devcmd/cmds/BoundsCmd.java

@ -9,8 +9,8 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.mbEnums.GameObjectType;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;

2
src/engine/devcmd/cmds/GotoCmd.java

@ -9,7 +9,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;

16
src/engine/devcmd/cmds/GotoObj.java

@ -9,7 +9,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum; import engine.mbEnums;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
@ -27,7 +27,7 @@ public class GotoObj extends AbstractDevCmd {
int uuid; int uuid;
Vector3fImmutable targetLoc = Vector3fImmutable.ZERO; Vector3fImmutable targetLoc = Vector3fImmutable.ZERO;
Enum.DbObjectType objectType; mbEnums.DbObjectType objectType;
try { try {
uuid = Integer.parseInt(words[0]); uuid = Integer.parseInt(words[0]);
@ -41,37 +41,37 @@ public class GotoObj extends AbstractDevCmd {
switch (objectType) { switch (objectType) {
case NPC: case NPC:
NPC npc = (NPC) DbManager.getFromCache(Enum.GameObjectType.NPC, uuid); NPC npc = (NPC) DbManager.getFromCache(mbEnums.GameObjectType.NPC, uuid);
if (npc != null) if (npc != null)
targetLoc = npc.getLoc(); targetLoc = npc.getLoc();
break; break;
case MOB: case MOB:
Mob mob = (Mob) DbManager.getFromCache(Enum.GameObjectType.Mob, uuid); Mob mob = (Mob) DbManager.getFromCache(mbEnums.GameObjectType.Mob, uuid);
if (mob != null) if (mob != null)
targetLoc = mob.getLoc(); targetLoc = mob.getLoc();
break; break;
case CHARACTER: case CHARACTER:
PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(Enum.GameObjectType.PlayerCharacter, uuid); PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(mbEnums.GameObjectType.PlayerCharacter, uuid);
if (playerCharacter != null) if (playerCharacter != null)
targetLoc = playerCharacter.getLoc(); targetLoc = playerCharacter.getLoc();
break; break;
case BUILDING: case BUILDING:
Building building = (Building) DbManager.getFromCache(Enum.GameObjectType.Building, uuid); Building building = (Building) DbManager.getFromCache(mbEnums.GameObjectType.Building, uuid);
if (building != null) if (building != null)
targetLoc = building.getLoc(); targetLoc = building.getLoc();
break; break;
case ZONE: case ZONE:
Zone zone = (Zone) DbManager.getFromCache(Enum.GameObjectType.Zone, uuid); Zone zone = (Zone) DbManager.getFromCache(mbEnums.GameObjectType.Zone, uuid);
if (zone != null) if (zone != null)
targetLoc = zone.getLoc(); targetLoc = zone.getLoc();
break; break;
case CITY: case CITY:
City city = (City) DbManager.getFromCache(Enum.GameObjectType.City, uuid); City city = (City) DbManager.getFromCache(mbEnums.GameObjectType.City, uuid);
if (city != null) if (city != null)
targetLoc = city.getLoc(); targetLoc = city.getLoc();

12
src/engine/devcmd/cmds/InfoCmd.java

@ -9,14 +9,14 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum;
import engine.Enum.BuildingGroup;
import engine.Enum.GameObjectType;
import engine.Enum.TargetColor;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.SessionManager; import engine.gameManager.SessionManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.mbEnums.BuildingGroup;
import engine.mbEnums.GameObjectType;
import engine.mbEnums.TargetColor;
import engine.objects.*; import engine.objects.*;
import engine.util.StringUtils; import engine.util.StringUtils;
@ -436,7 +436,7 @@ public class InfoCmd extends AbstractDevCmd {
if (targetMob.isPet()) { if (targetMob.isPet()) {
output += "isPet: true"; output += "isPet: true";
output += newline; output += newline;
if ((targetMob.agentType.equals(Enum.AIAgentType.PET))) if ((targetMob.agentType.equals(mbEnums.AIAgentType.PET)))
output += "isSummonedPet: true"; output += "isSummonedPet: true";
else else
output += "isSummonedPet: false"; output += "isSummonedPet: false";
@ -456,7 +456,7 @@ public class InfoCmd extends AbstractDevCmd {
output += newline; output += newline;
} }
if ((targetMob.agentType.equals(Enum.AIAgentType.MOBILE))) { if ((targetMob.agentType.equals(mbEnums.AIAgentType.MOBILE))) {
output += "SpawnRadius: " + targetMob.getSpawnRadius(); output += "SpawnRadius: " + targetMob.getSpawnRadius();
output += newline; output += newline;
output += "Spawn Timer: " + targetMob.getSpawnTimeAsString(); output += "Spawn Timer: " + targetMob.getSpawnTimeAsString();

2
src/engine/devcmd/cmds/MakeBaneCmd.java

@ -9,7 +9,6 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.ProtectionState;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
@ -18,6 +17,7 @@ import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3f; import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums.ProtectionState;
import engine.objects.*; import engine.objects.*;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;

4
src/engine/devcmd/cmds/MakeItemCmd.java

@ -9,10 +9,10 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.ItemType;
import engine.Enum.OwnerType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.mbEnums.ItemType;
import engine.mbEnums.OwnerType;
import engine.objects.*; import engine.objects.*;
import engine.powers.EffectsBase; import engine.powers.EffectsBase;

2
src/engine/devcmd/cmds/PrintBonusesCmd.java

@ -9,9 +9,9 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.mbEnums.GameObjectType;
import engine.objects.*; import engine.objects.*;
import engine.powers.effectmodifiers.AbstractEffectModifier; import engine.powers.effectmodifiers.AbstractEffectModifier;

12
src/engine/devcmd/cmds/PrintEquipCmd.java

@ -9,9 +9,9 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.objects.*; import engine.objects.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
@ -64,7 +64,7 @@ public class PrintEquipCmd extends AbstractDevCmd {
if (tar.getObjectType() == GameObjectType.Mob) { if (tar.getObjectType() == GameObjectType.Mob) {
Mob tarMob = (Mob) tar; Mob tarMob = (Mob) tar;
throwbackInfo(pc, "Equip for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')'); throwbackInfo(pc, "Equip for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
for (Enum.EquipSlotType slot : tarMob.charItemManager.equipped.keySet()) { for (mbEnums.EquipSlotType slot : tarMob.charItemManager.equipped.keySet()) {
Item equip = tarMob.charItemManager.equipped.get(slot); Item equip = tarMob.charItemManager.equipped.get(slot);
throwbackInfo(pc, equip.templateID + " : " + equip.template.item_base_name + ", slot: " + slot); throwbackInfo(pc, equip.templateID + " : " + equip.template.item_base_name + ", slot: " + slot);
} }
@ -74,7 +74,7 @@ public class PrintEquipCmd extends AbstractDevCmd {
if (tar.getObjectType() == GameObjectType.NPC) { if (tar.getObjectType() == GameObjectType.NPC) {
NPC tarMob = (NPC) tar; NPC tarMob = (NPC) tar;
throwbackInfo(pc, "Equip for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')'); throwbackInfo(pc, "Equip for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
for (Enum.EquipSlotType slot : tarMob.charItemManager.equipped.keySet()) { for (mbEnums.EquipSlotType slot : tarMob.charItemManager.equipped.keySet()) {
Item equip = tarMob.charItemManager.equipped.get(slot); Item equip = tarMob.charItemManager.equipped.get(slot);
throwbackInfo(pc, equip.templateID + " : " + equip.template.item_base_name + ", slot: " + slot); throwbackInfo(pc, equip.templateID + " : " + equip.template.item_base_name + ", slot: " + slot);
} }
@ -82,10 +82,10 @@ public class PrintEquipCmd extends AbstractDevCmd {
} }
CharacterItemManager cim = ((AbstractCharacter) tar).charItemManager; CharacterItemManager cim = ((AbstractCharacter) tar).charItemManager;
ConcurrentHashMap<Enum.EquipSlotType, Item> list = cim.getEquipped(); ConcurrentHashMap<mbEnums.EquipSlotType, Item> list = cim.getEquipped();
throwbackInfo(pc, "Equip for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')'); throwbackInfo(pc, "Equip for " + type + ' ' + name + " (" + tar.getObjectUUID() + ')');
for (Enum.EquipSlotType slot : list.keySet()) { for (mbEnums.EquipSlotType slot : list.keySet()) {
Item item = list.get(slot); Item item = list.get(slot);
throwbackInfo(pc, " " + item.template.item_base_name + ", slot: " + slot); throwbackInfo(pc, " " + item.template.item_base_name + ", slot: " + slot);
} }

2
src/engine/devcmd/cmds/PrintInventoryCmd.java

@ -9,8 +9,8 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.ItemType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.mbEnums.ItemType;
import engine.objects.*; import engine.objects.*;
import java.text.DecimalFormat; import java.text.DecimalFormat;

2
src/engine/devcmd/cmds/PrintSkillsCmd.java

@ -9,8 +9,8 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.mbEnums.GameObjectType;
import engine.objects.*; import engine.objects.*;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;

4
src/engine/devcmd/cmds/PrintStatsCmd.java

@ -9,9 +9,9 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ItemManager; import engine.gameManager.ItemManager;
import engine.mbEnums;
import engine.objects.*; import engine.objects.*;
/** /**
@ -88,7 +88,7 @@ public class PrintStatsCmd extends AbstractDevCmd {
//get weapons //get weapons
if (tar.charItemManager.equipped.isEmpty() == false) if (tar.charItemManager.equipped.isEmpty() == false)
if (tar.charItemManager.equipped.get(Enum.EquipSlotType.LHELD) != null && !ItemManager.isShield(tar.charItemManager.equipped.get(Enum.EquipSlotType.LHELD))) { if (tar.charItemManager.equipped.get(mbEnums.EquipSlotType.LHELD) != null && !ItemManager.isShield(tar.charItemManager.equipped.get(mbEnums.EquipSlotType.LHELD))) {
//off hand weapon //off hand weapon
out += "Attack Rating: " + tar.atrHandTwo + newline; out += "Attack Rating: " + tar.atrHandTwo + newline;
out += "Damage: " + tar.minDamageHandTwo + " - " + tar.maxDamageHandTwo + newline; out += "Damage: " + tar.minDamageHandTwo + " - " + tar.maxDamageHandTwo + newline;

10
src/engine/devcmd/cmds/PurgeObjectsCmd.java

@ -1,14 +1,14 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum;
import engine.Enum.BuildingGroup;
import engine.Enum.GameObjectType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.mbEnums.BuildingGroup;
import engine.mbEnums.GameObjectType;
import engine.objects.*; import engine.objects.*;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -163,7 +163,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
mob.getParentZone().zoneMobSet.remove(mob); mob.getParentZone().zoneMobSet.remove(mob);
} }
DbManager.NPCQueries.DELETE_NPC(npc); DbManager.NPCQueries.DELETE_NPC(npc);
DbManager.removeFromCache(Enum.GameObjectType.NPC, DbManager.removeFromCache(mbEnums.GameObjectType.NPC,
npc.getObjectUUID()); npc.getObjectUUID());
WorldGrid.RemoveWorldObject(npc); WorldGrid.RemoveWorldObject(npc);
} else if (mobA != null) { } else if (mobA != null) {
@ -176,7 +176,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
mob.getParentZone().zoneMobSet.remove(mob); mob.getParentZone().zoneMobSet.remove(mob);
} }
DbManager.MobQueries.DELETE_MOB(mobA); DbManager.MobQueries.DELETE_MOB(mobA);
DbManager.removeFromCache(Enum.GameObjectType.Mob, DbManager.removeFromCache(mbEnums.GameObjectType.Mob,
mobA.getObjectUUID()); mobA.getObjectUUID());
WorldGrid.RemoveWorldObject(mobA); WorldGrid.RemoveWorldObject(mobA);
} }

2
src/engine/devcmd/cmds/RemoveBaneCmd.java

@ -9,9 +9,9 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.SiegeResult;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.mbEnums.SiegeResult;
import engine.objects.*; import engine.objects.*;
/** /**

4
src/engine/devcmd/cmds/RemoveObjectCmd.java

@ -9,8 +9,6 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.BuildingGroup;
import engine.Enum.DbObjectType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
@ -18,6 +16,8 @@ import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums.BuildingGroup;
import engine.mbEnums.DbObjectType;
import engine.objects.*; import engine.objects.*;
/** /**

2
src/engine/devcmd/cmds/SetBuildingAltitudeCmd.java

@ -9,7 +9,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;

2
src/engine/devcmd/cmds/SetGuildCmd.java

@ -1,6 +1,6 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;

2
src/engine/devcmd/cmds/SetHealthCmd.java

@ -9,7 +9,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.TargetedActionMsg;

6
src/engine/devcmd/cmds/SetInvulCmd.java

@ -10,8 +10,8 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum; import engine.mbEnums;
import engine.Enum.ProtectionState; import engine.mbEnums.ProtectionState;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Building; import engine.objects.Building;
@ -59,7 +59,7 @@ public class SetInvulCmd extends AbstractDevCmd {
// status of the entire city // status of the entire city
if ((b.getBlueprint() != null) && if ((b.getBlueprint() != null) &&
(b.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL))) { (b.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.TOL))) {
City city; City city;

3
src/engine/devcmd/cmds/SetManaCmd.java

@ -1,6 +1,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.mbEnums;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.TargetedActionMsg;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
@ -31,7 +32,7 @@ public class SetManaCmd extends AbstractDevCmd {
//Update all surrounding clients. - NOT for Mana? //Update all surrounding clients. - NOT for Mana?
TargetedActionMsg cmm = new TargetedActionMsg(pc); TargetedActionMsg cmm = new TargetedActionMsg(pc);
DispatchMessage.dispatchMsgToInterestArea(pc, cmm, engine.Enum.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); DispatchMessage.dispatchMsgToInterestArea(pc, cmm, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
this.throwbackError(pc, "Supplied data: " + words[0] this.throwbackError(pc, "Supplied data: " + words[0]

2
src/engine/devcmd/cmds/SetNpcNameCmd.java

@ -9,7 +9,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;

7
src/engine/devcmd/cmds/SetOwnerCmd.java

@ -1,7 +1,8 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.DbObjectType; import engine.mbEnums;
import engine.Enum.GameObjectType; import engine.mbEnums.DbObjectType;
import engine.mbEnums.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.objects.*; import engine.objects.*;
@ -37,7 +38,7 @@ public class SetOwnerCmd extends AbstractDevCmd {
// if it's a tol change ownership of the city // if it's a tol change ownership of the city
if (_targetBuilding.getBlueprint() != null && if (_targetBuilding.getBlueprint() != null &&
_targetBuilding.getBlueprint().getBuildingGroup().equals(engine.Enum.BuildingGroup.TOL)) { _targetBuilding.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.TOL)) {
City city = _targetBuilding.getCity(); City city = _targetBuilding.getCity();

2
src/engine/devcmd/cmds/SetPromotionClassCmd.java

@ -1,6 +1,6 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.InterestManagement.InterestManager; import engine.InterestManagement.InterestManager;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;

2
src/engine/devcmd/cmds/SetStaminaCmd.java

@ -9,7 +9,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.DispatchChannel; import engine.mbEnums.DispatchChannel;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.TargetedActionMsg;

2
src/engine/devcmd/cmds/SetSubRaceCmd.java

@ -10,7 +10,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.ApplyBuildingEffectMsg; import engine.net.client.msg.ApplyBuildingEffectMsg;

2
src/engine/devcmd/cmds/ShowOffsetCmd.java

@ -1,6 +1,6 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;

2
src/engine/devcmd/cmds/SlotNpcCmd.java

@ -9,7 +9,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.BuildingGroup; import engine.mbEnums.BuildingGroup;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;

2
src/engine/devcmd/cmds/SlotTestCmd.java

@ -9,7 +9,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.BuildingManager; import engine.gameManager.BuildingManager;
import engine.gameManager.ChatManager; import engine.gameManager.ChatManager;

4
src/engine/devcmd/cmds/SplatMobCmd.java

@ -1,6 +1,6 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum; import engine.mbEnums;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.ZoneManager; import engine.gameManager.ZoneManager;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
@ -111,7 +111,7 @@ public class SplatMobCmd extends AbstractDevCmd {
mobile = Mob.createMob(_mobileUUID, mobile = Mob.createMob(_mobileUUID,
Vector3fImmutable.getRandomPointInCircle(_currentLocation, _targetRange), Vector3fImmutable.getRandomPointInCircle(_currentLocation, _targetRange),
null, serverZone, null, null, "", 1, Enum.AIAgentType.MOBILE); null, serverZone, null, null, "", 1, mbEnums.AIAgentType.MOBILE);
if (mobile != null) { if (mobile != null) {
mobile.updateDatabase(); mobile.updateDatabase();

2
src/engine/devcmd/cmds/UnloadFurnitureCmd.java

@ -9,7 +9,7 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.net.client.msg.LoadStructureMsg; import engine.net.client.msg.LoadStructureMsg;
import engine.net.client.msg.MoveToPointMsg; import engine.net.client.msg.MoveToPointMsg;

10
src/engine/devcmd/cmds/aiInfoCmd.java

@ -9,10 +9,10 @@
package engine.devcmd.cmds; package engine.devcmd.cmds;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.gameManager.PowersManager; import engine.gameManager.PowersManager;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.mobileAI.MobAI; import engine.mobileAI.MobAI;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
import engine.objects.Mob; import engine.objects.Mob;
@ -67,7 +67,7 @@ public class aiInfoCmd extends AbstractDevCmd {
if (mob.isPlayerGuard() == true) { if (mob.isPlayerGuard() == true) {
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION))
contractID = mob.guardCaptain.contract.getContractID(); contractID = mob.guardCaptain.contract.getContractID();
else else
contractID = mob.contract.getContractID(); contractID = mob.contract.getContractID();
@ -75,7 +75,7 @@ public class aiInfoCmd extends AbstractDevCmd {
if (contractID != 0) { if (contractID != 0) {
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) { if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION)) {
output += "Captain Contract: " + contractID + newline; output += "Captain Contract: " + contractID + newline;
output += "Captain UUID: " + mob.guardCaptain.getObjectUUID() + newline; output += "Captain UUID: " + mob.guardCaptain.getObjectUUID() + newline;
} else } else
@ -128,7 +128,7 @@ public class aiInfoCmd extends AbstractDevCmd {
if (mob.contract != null) if (mob.contract != null)
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID)); contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.contractUUID));
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION))
contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID)); contractEntries = new ArrayList<>(PowersManager.getPowersForRune(mob.guardCaptain.contractUUID));
powerEntries.addAll(contractEntries); powerEntries.addAll(contractEntries);

28
src/engine/gameManager/BuildingManager.java

@ -9,9 +9,6 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum;
import engine.Enum.BuildingGroup;
import engine.Enum.GameObjectType;
import engine.InterestManagement.InterestManager; import engine.InterestManagement.InterestManager;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.job.JobContainer; import engine.job.JobContainer;
@ -19,6 +16,9 @@ import engine.job.JobScheduler;
import engine.jobs.UpgradeBuildingJob; import engine.jobs.UpgradeBuildingJob;
import engine.math.Bounds; import engine.math.Bounds;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.mbEnums.BuildingGroup;
import engine.mbEnums.GameObjectType;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
import engine.objects.*; import engine.objects.*;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
@ -230,7 +230,7 @@ public enum BuildingManager {
if (warehouse == null) if (warehouse == null)
return false; return false;
for (Enum.ResourceType resourceType : EnumSet.allOf(Enum.ResourceType.class)) { for (mbEnums.ResourceType resourceType : EnumSet.allOf(mbEnums.ResourceType.class)) {
if (!player.charItemManager.hasRoomInventory(resourceType.template.item_wt)) { if (!player.charItemManager.hasRoomInventory(resourceType.template.item_wt)) {
ChatManager.chatSystemInfo(player, "You can not carry any more of that item."); ChatManager.chatSystemInfo(player, "You can not carry any more of that item.");
@ -323,7 +323,7 @@ public enum BuildingManager {
// Clear minions from database if a guard captain // Clear minions from database if a guard captain
if (guardCaptain.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN)) if (guardCaptain.agentType.equals(mbEnums.AIAgentType.GUARDCAPTAIN))
DbManager.MobQueries.REMOVE_ALL_MINIONS(hireling.getObjectUUID()); DbManager.MobQueries.REMOVE_ALL_MINIONS(hireling.getObjectUUID());
} }
@ -418,7 +418,7 @@ public enum BuildingManager {
Building building; Building building;
building = (Building) DbManager.getFromCache(Enum.GameObjectType.Building, id); building = (Building) DbManager.getFromCache(mbEnums.GameObjectType.Building, id);
if (building != null) if (building != null)
return building; return building;
@ -584,14 +584,14 @@ public enum BuildingManager {
if (NPC.ISWallArcher(contract)) { if (NPC.ISWallArcher(contract)) {
mobile = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), zone, building, contract, pirateName, rank, Enum.AIAgentType.GUARDWALLARCHER); mobile = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), zone, building, contract, pirateName, rank, mbEnums.AIAgentType.GUARDWALLARCHER);
if (mobile == null) if (mobile == null)
return false; return false;
// Configure AI and write new mobile to disk // Configure AI and write new mobile to disk
mobile.behaviourType = Enum.MobBehaviourType.GuardWallArcher; mobile.behaviourType = mbEnums.MobBehaviourType.GuardWallArcher;
mobile = DbManager.MobQueries.PERSIST(mobile); mobile = DbManager.MobQueries.PERSIST(mobile);
// Spawn new mobile // Spawn new mobile
@ -603,14 +603,14 @@ public enum BuildingManager {
if (NPC.ISGuardCaptain(contract.getContractID())) { if (NPC.ISGuardCaptain(contract.getContractID())) {
mobile = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), zone, building, contract, pirateName, rank, Enum.AIAgentType.GUARDCAPTAIN); mobile = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), zone, building, contract, pirateName, rank, mbEnums.AIAgentType.GUARDCAPTAIN);
if (mobile == null) if (mobile == null)
return false; return false;
// Configure AI and write new mobile to disk // Configure AI and write new mobile to disk
mobile.behaviourType = Enum.MobBehaviourType.GuardCaptain; mobile.behaviourType = mbEnums.MobBehaviourType.GuardCaptain;
mobile = DbManager.MobQueries.PERSIST(mobile); mobile = DbManager.MobQueries.PERSIST(mobile);
// Spawn new mobile // Spawn new mobile
@ -623,14 +623,14 @@ public enum BuildingManager {
if (contract.getContractID() == 910) { if (contract.getContractID() == 910) {
//guard dog //guard dog
mobile = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), zone, building, contract, pirateName, rank, Enum.AIAgentType.GUARDCAPTAIN); mobile = Mob.createMob(contract.getMobbaseID(), Vector3fImmutable.ZERO, contractOwner.getGuild(), zone, building, contract, pirateName, rank, mbEnums.AIAgentType.GUARDCAPTAIN);
if (mobile == null) if (mobile == null)
return false; return false;
// Configure AI and write new mobile to disk // Configure AI and write new mobile to disk
mobile.behaviourType = Enum.MobBehaviourType.GuardCaptain; mobile.behaviourType = mbEnums.MobBehaviourType.GuardCaptain;
mobile = DbManager.MobQueries.PERSIST(mobile); mobile = DbManager.MobQueries.PERSIST(mobile);
// Spawn new mobile // Spawn new mobile
@ -739,7 +739,7 @@ public enum BuildingManager {
Vector3fImmutable bindLoc = null; Vector3fImmutable bindLoc = null;
if (building == null) if (building == null)
return Enum.Ruins.getRandomRuin().getLocation(); return mbEnums.Ruins.getRandomRuin().getLocation();
bindLoc = building.getLoc(); bindLoc = building.getLoc();
@ -856,7 +856,7 @@ public enum BuildingManager {
// protection // protection
if (building.rank == -1) if (building.rank == -1)
building.protectionState = Enum.ProtectionState.NONE; building.protectionState = mbEnums.ProtectionState.NONE;
// update object to clients // update object to clients

40
src/engine/gameManager/ChatManager.java

@ -9,13 +9,13 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum;
import engine.Enum.GameObjectType;
import engine.Enum.ModType;
import engine.Enum.SourceType;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.db.archive.BaneRecord; import engine.db.archive.BaneRecord;
import engine.db.archive.PvpRecord; import engine.db.archive.PvpRecord;
import engine.mbEnums;
import engine.mbEnums.GameObjectType;
import engine.mbEnums.ModType;
import engine.mbEnums.SourceType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.MessageDispatcher; import engine.net.MessageDispatcher;
@ -79,7 +79,7 @@ public enum ChatManager {
ArrayList<AbstractWorldObject> distroList = new ArrayList<>(); ArrayList<AbstractWorldObject> distroList = new ArrayList<>();
for (PlayerCharacter pc : SessionManager for (PlayerCharacter pc : SessionManager
.getAllActivePlayerCharacters()) { .getAllActivePlayerCharacters()) {
if (pc.getAccount().status.equals(Enum.AccountStatus.BANNED) == false) if (pc.getAccount().status.equals(mbEnums.AccountStatus.BANNED) == false)
distroList.add(pc); distroList.add(pc);
} }
// Send dispatch to each player // Send dispatch to each player
@ -87,7 +87,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }
@ -161,7 +161,7 @@ public enum ChatManager {
// Make the Message // Make the Message
ChatSayMsg chatSayMsg = new ChatSayMsg(player, text); ChatSayMsg chatSayMsg = new ChatSayMsg(player, text);
DispatchMessage.dispatchMsgToInterestArea(pcSender, chatSayMsg, Enum.DispatchChannel.SECONDARY, MBServerStatics.SAY_RANGE, true, true); DispatchMessage.dispatchMsgToInterestArea(pcSender, chatSayMsg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SAY_RANGE, true, true);
} }
@ -169,9 +169,9 @@ public enum ChatManager {
ChatSystemMsg msg = new ChatSystemMsg(null, messageString); ChatSystemMsg msg = new ChatSystemMsg(null, messageString);
msg.setMessageType(4); msg.setMessageType(4);
msg.setChannel(engine.Enum.ChatChannelType.SYSTEM.getChannelID()); msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
Dispatch dispatch = Dispatch.borrow(targetPlayer, msg); Dispatch dispatch = Dispatch.borrow(targetPlayer, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
/* /*
@ -195,7 +195,7 @@ public enum ChatManager {
// Make the Message // Make the Message
ChatShoutMsg msg = new ChatShoutMsg(sender, text); ChatShoutMsg msg = new ChatShoutMsg(sender, text);
DispatchMessage.dispatchMsgToInterestArea(pcSender, msg, engine.Enum.DispatchChannel.SECONDARY, MBServerStatics.SHOUT_RANGE, true, true); DispatchMessage.dispatchMsgToInterestArea(pcSender, msg, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.SHOUT_RANGE, true, true);
} }
@ -284,13 +284,13 @@ public enum ChatManager {
// Send dispatch to each player // Send dispatch to each player
Dispatch dispatch = Dispatch.borrow(pcRecip, chatTellMsg); Dispatch dispatch = Dispatch.borrow(pcRecip, chatTellMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
// Also send /tell to sender // Also send /tell to sender
if (pcSender != null) { if (pcSender != null) {
Dispatch dispatch = Dispatch.borrow(pcSender, chatTellMsg); Dispatch dispatch = Dispatch.borrow(pcSender, chatTellMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} else } else
@ -342,14 +342,14 @@ public enum ChatManager {
chatGuildMsg.setUnknown04(sender.getGuild() != null ? sender.getGuild() chatGuildMsg.setUnknown04(sender.getGuild() != null ? sender.getGuild()
.getCharter() : 0); // Charter? .getCharter() : 0); // Charter?
chatGuildMsg.setUnknown05(GuildStatusController.getTitle(sender.getGuildStatus())); // Title? chatGuildMsg.setUnknown05(GuildStatusController.getTitle(sender.getGuildStatus())); // Title?
chatGuildMsg.setUnknown06(sender.race.getRaceType().getCharacterSex().equals(Enum.CharacterSex.MALE) ? 1 : 2); // isMale?, seen 1 and 2 chatGuildMsg.setUnknown06(sender.race.getRaceType().getCharacterSex().equals(mbEnums.CharacterSex.MALE) ? 1 : 2); // isMale?, seen 1 and 2
// Send dispatch to each player // Send dispatch to each player
for (AbstractWorldObject abstractWorldObject : distroList) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGuildMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGuildMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }
@ -404,7 +404,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatICMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, chatICMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }
@ -463,7 +463,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGroupMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, chatGroupMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }
@ -497,7 +497,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, msg); Dispatch dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }
@ -536,7 +536,7 @@ public enum ChatManager {
if (item != null) //Steal if (item != null) //Steal
if (success) { if (success) {
String name = ""; String name = "";
if (item.template.item_type.equals(Enum.ItemType.GOLD)) if (item.template.item_type.equals(mbEnums.ItemType.GOLD))
name = amount + " gold "; name = amount + " gold ";
else { else {
String vowels = "aeiou"; String vowels = "aeiou";
@ -844,7 +844,7 @@ public enum ChatManager {
for (AbstractWorldObject abstractWorldObject : distroList) { for (AbstractWorldObject abstractWorldObject : distroList) {
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject; PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }
@ -993,7 +993,7 @@ public enum ChatManager {
chatSystemMsg.setChannel(channel); chatSystemMsg.setChannel(channel);
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg); Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }

86
src/engine/gameManager/CombatManager.java

@ -8,11 +8,11 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum;
import engine.job.JobContainer; 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.mbEnums;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.TargetedActionMsg; import engine.net.client.msg.TargetedActionMsg;
@ -46,40 +46,40 @@ public enum CombatManager {
case PlayerCharacter: case PlayerCharacter:
case Mob: case Mob:
PlayerBonuses bonuses = ((AbstractCharacter) target).getBonuses(); PlayerBonuses bonuses = ((AbstractCharacter) target).getBonuses();
if (bonuses != null && bonuses.getBool(Enum.ModType.ImmuneToAttack, Enum.SourceType.None)) if (bonuses != null && bonuses.getBool(mbEnums.ModType.ImmuneToAttack, mbEnums.SourceType.None))
return; return;
break; break;
case NPC: case NPC:
return; return;
} }
Item mainWeapon = attacker.charItemManager.getEquipped().get(Enum.EquipSlotType.RHELD); Item mainWeapon = attacker.charItemManager.getEquipped().get(mbEnums.EquipSlotType.RHELD);
Item offWeapon = attacker.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD); Item offWeapon = attacker.charItemManager.getEquipped().get(mbEnums.EquipSlotType.LHELD);
if (mainWeapon == null && offWeapon == null) { if (mainWeapon == null && offWeapon == null) {
//no weapons equipped, punch with both fists //no weapons equipped, punch with both fists
processAttack(attacker, target, Enum.EquipSlotType.RHELD); processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
processAttack(attacker, target, Enum.EquipSlotType.LHELD); processAttack(attacker, target, mbEnums.EquipSlotType.LHELD);
} else if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block")) { } else if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block")) {
//no weapon equipped with a shield, punch with one hand //no weapon equipped with a shield, punch with one hand
processAttack(attacker, target, Enum.EquipSlotType.RHELD); processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
} else if (mainWeapon != null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block")) { } else if (mainWeapon != null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block")) {
//one weapon equipped with a shield, swing with one hand //one weapon equipped with a shield, swing with one hand
processAttack(attacker, target, Enum.EquipSlotType.RHELD); processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
} else if (mainWeapon != null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block") == false) { } else if (mainWeapon != null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block") == false) {
//two weapons equipped, swing both hands //two weapons equipped, swing both hands
processAttack(attacker, target, Enum.EquipSlotType.RHELD); processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
processAttack(attacker, target, Enum.EquipSlotType.LHELD); processAttack(attacker, target, mbEnums.EquipSlotType.LHELD);
} else if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block") == false) { } else if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block") == false) {
//swing left hand only //swing left hand only
processAttack(attacker, target, Enum.EquipSlotType.LHELD); processAttack(attacker, target, mbEnums.EquipSlotType.LHELD);
} else if (mainWeapon != null && offWeapon == null) { } else if (mainWeapon != null && offWeapon == null) {
//swing left hand only //swing left hand only
processAttack(attacker, target, Enum.EquipSlotType.RHELD); processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
} }
} }
public static void processAttack(AbstractCharacter attacker, AbstractWorldObject target, Enum.EquipSlotType slot) { public static void processAttack(AbstractCharacter attacker, AbstractWorldObject target, mbEnums.EquipSlotType slot) {
// heck if character can even attack yet // heck if character can even attack yet
@ -98,12 +98,12 @@ public enum CombatManager {
if (weapon != null) { if (weapon != null) {
if (bonus != null) if (bonus != null)
rangeMod += bonus.getFloatPercentAll(Enum.ModType.WeaponRange, Enum.SourceType.None); rangeMod += bonus.getFloatPercentAll(mbEnums.ModType.WeaponRange, mbEnums.SourceType.None);
attackRange = weapon.template.item_weapon_max_range * rangeMod; attackRange = weapon.template.item_weapon_max_range * rangeMod;
} }
if (attacker.getObjectType().equals(Enum.GameObjectType.Mob)) if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
if (((Mob) attacker).isSiege()) if (((Mob) attacker).isSiege())
attackRange = 300; attackRange = 300;
@ -133,7 +133,7 @@ public enum CombatManager {
//get the proper stats based on which slot is attacking //get the proper stats based on which slot is attacking
if (slot == Enum.EquipSlotType.LHELD) { if (slot == mbEnums.EquipSlotType.LHELD) {
min = attacker.minDamageHandTwo; min = attacker.minDamageHandTwo;
max = attacker.maxDamageHandTwo; max = attacker.maxDamageHandTwo;
atr = attacker.atrHandTwo; atr = attacker.atrHandTwo;
@ -156,10 +156,10 @@ public enum CombatManager {
else else
hitChance = ((int) (450 * (dif - 0.8f)) + 4); hitChance = ((int) (450 * (dif - 0.8f)) + 4);
if (target.getObjectType() == Enum.GameObjectType.Building) if (target.getObjectType() == mbEnums.GameObjectType.Building)
hitChance = 100; hitChance = 100;
int passiveAnim = getSwingAnimation(null, null, slot.equals(Enum.EquipSlotType.RHELD)); int passiveAnim = getSwingAnimation(null, null, slot.equals(mbEnums.EquipSlotType.RHELD));
if (attacker.charItemManager.getEquipped().get(slot) != null) { if (attacker.charItemManager.getEquipped().get(slot) != null) {
passiveAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, true); passiveAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, true);
} }
@ -167,8 +167,8 @@ public enum CombatManager {
if (ThreadLocalRandom.current().nextInt(100) > hitChance) { if (ThreadLocalRandom.current().nextInt(100) > hitChance) {
TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim); TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim);
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter) if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
DispatchMessage.dispatchMsgToInterestArea(target, msg, Enum.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); DispatchMessage.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
else else
DispatchMessage.sendToAllInRange(attacker, msg); DispatchMessage.sendToAllInRange(attacker, msg);
@ -177,8 +177,8 @@ public enum CombatManager {
//calculate passive chances only if target is AbstractCharacter //calculate passive chances only if target is AbstractCharacter
if (EnumSet.of(Enum.GameObjectType.PlayerCharacter, Enum.GameObjectType.NPC, Enum.GameObjectType.Mob).contains(target.getObjectType())) { if (EnumSet.of(mbEnums.GameObjectType.PlayerCharacter, mbEnums.GameObjectType.NPC, mbEnums.GameObjectType.Mob).contains(target.getObjectType())) {
Enum.PassiveType passiveType = Enum.PassiveType.None; mbEnums.PassiveType passiveType = mbEnums.PassiveType.None;
int hitRoll = ThreadLocalRandom.current().nextInt(100); int hitRoll = ThreadLocalRandom.current().nextInt(100);
float dodgeChance = ((AbstractCharacter) target).getPassiveChance("Dodge", attacker.getLevel(), true); float dodgeChance = ((AbstractCharacter) target).getPassiveChance("Dodge", attacker.getLevel(), true);
@ -192,18 +192,18 @@ public enum CombatManager {
parryChance = Math.max(0, Math.min(75, parryChance)); parryChance = Math.max(0, Math.min(75, parryChance));
if (hitRoll < dodgeChance) if (hitRoll < dodgeChance)
passiveType = Enum.PassiveType.Dodge; passiveType = mbEnums.PassiveType.Dodge;
else if (hitRoll < blockChance) else if (hitRoll < blockChance)
passiveType = Enum.PassiveType.Block; passiveType = mbEnums.PassiveType.Block;
else if (hitRoll < parryChance) else if (hitRoll < parryChance)
passiveType = Enum.PassiveType.Parry; passiveType = mbEnums.PassiveType.Parry;
if (passiveType.equals(Enum.PassiveType.None) == false) { if (passiveType.equals(mbEnums.PassiveType.None) == false) {
TargetedActionMsg msg = new TargetedActionMsg(attacker, passiveAnim, target, passiveType.value); TargetedActionMsg msg = new TargetedActionMsg(attacker, passiveAnim, target, passiveType.value);
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter) if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
DispatchMessage.dispatchMsgToInterestArea(target, msg, Enum.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); DispatchMessage.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
else else
DispatchMessage.sendToAllInRange(attacker, msg); DispatchMessage.sendToAllInRange(attacker, msg);
@ -218,15 +218,15 @@ public enum CombatManager {
//get the damage type //get the damage type
Enum.DamageType damageType; mbEnums.DamageType damageType;
if (attacker.charItemManager.getEquipped().get(slot) == null) { if (attacker.charItemManager.getEquipped().get(slot) == null) {
damageType = Enum.DamageType.CRUSHING; damageType = mbEnums.DamageType.CRUSHING;
if (attacker.getObjectType().equals(Enum.GameObjectType.Mob)) if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
if (((Mob) attacker).isSiege()) if (((Mob) attacker).isSiege())
damageType = Enum.DamageType.SIEGE; damageType = mbEnums.DamageType.SIEGE;
} else { } else {
damageType = (Enum.DamageType) attacker.charItemManager.getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0]; damageType = (mbEnums.DamageType) attacker.charItemManager.getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0];
} }
//get resists //get resists
@ -298,16 +298,16 @@ public enum CombatManager {
else else
((Building) target).setCurrentHitPoints(target.getCurrentHitpoints() - damage); ((Building) target).setCurrentHitPoints(target.getCurrentHitpoints() - damage);
int attackAnim = getSwingAnimation(null, null, slot.equals(Enum.EquipSlotType.RHELD)); int attackAnim = getSwingAnimation(null, null, slot.equals(mbEnums.EquipSlotType.RHELD));
if (attacker.charItemManager.getEquipped().get(slot) != null) { if (attacker.charItemManager.getEquipped().get(slot) != null) {
attackAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, slot.equals(Enum.EquipSlotType.RHELD)); attackAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, slot.equals(mbEnums.EquipSlotType.RHELD));
} }
TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) damage, attackAnim); TargetedActionMsg cmm = new TargetedActionMsg(attacker, target, (float) damage, attackAnim);
DispatchMessage.sendToAllInRange(target, cmm); DispatchMessage.sendToAllInRange(target, cmm);
} }
DeferredPowerJob dpj = null; DeferredPowerJob dpj = null;
if (attacker.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) { if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
dpj = ((PlayerCharacter) attacker).getWeaponPower(); dpj = ((PlayerCharacter) attacker).getWeaponPower();
@ -326,11 +326,11 @@ public enum CombatManager {
int wepSpeed = (int) (weapon.template.item_weapon_wepspeed); int wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
if (weapon.getBonusPercent(Enum.ModType.WeaponSpeed, Enum.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(Enum.ModType.WeaponSpeed, Enum.SourceType.None)); wepSpeed *= (1 + weapon.getBonus(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None));
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.None) != 0f) //add effects speed bonus if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None) != 0f) //add effects speed bonus
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.None)); wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None));
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.
@ -368,7 +368,7 @@ public enum CombatManager {
UpdateStateMsg rwss = new UpdateStateMsg(); UpdateStateMsg rwss = new UpdateStateMsg();
rwss.setPlayer(playerCharacter); rwss.setPlayer(playerCharacter);
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, Enum.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false); DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, false);
} }
public static void toggleSit(boolean toggle, ClientConnection origin) { public static void toggleSit(boolean toggle, ClientConnection origin) {
@ -381,7 +381,7 @@ public enum CombatManager {
playerCharacter.setSit(toggle); playerCharacter.setSit(toggle);
UpdateStateMsg rwss = new UpdateStateMsg(); UpdateStateMsg rwss = new UpdateStateMsg();
rwss.setPlayer(playerCharacter); rwss.setPlayer(playerCharacter);
DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, Enum.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); DispatchMessage.dispatchMsgToInterestArea(playerCharacter, rwss, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
} }
@ -395,7 +395,7 @@ public enum CombatManager {
if (attacker.equals(target)) if (attacker.equals(target))
return; return;
if (target.isMoving() && target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) if (target.isMoving() && target.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))
return; return;
if (!target.isAlive() || !attacker.isAlive()) if (!target.isAlive() || !attacker.isAlive())

4
src/engine/gameManager/ConfigManager.java

@ -12,7 +12,7 @@ package engine.gameManager;
is loaded from environment variables. is loaded from environment variables.
*/ */
import engine.Enum; import engine.mbEnums;
import engine.server.login.LoginServer; import engine.server.login.LoginServer;
import engine.server.world.WorldServer; import engine.server.world.WorldServer;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -106,7 +106,7 @@ public enum ConfigManager {
public static final String DEFAULT_DATA_DIR = "mb.data/"; public static final String DEFAULT_DATA_DIR = "mb.data/";
public static Map<String, String> configMap = new HashMap(System.getenv()); public static Map<String, String> configMap = new HashMap(System.getenv());
public static Enum.ServerType serverType = Enum.ServerType.NONE; public static mbEnums.ServerType serverType = mbEnums.ServerType.NONE;
public static WorldServer worldServer; public static WorldServer worldServer;
public static LoginServer loginServer; public static LoginServer loginServer;
public static Map<ConfigManager, Pattern> regex = new HashMap<>(); public static Map<ConfigManager, Pattern> regex = new HashMap<>();

6
src/engine/gameManager/DbManager.java

@ -10,8 +10,8 @@ package engine.gameManager;
import com.zaxxer.hikari.HikariConfig; import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource; import com.zaxxer.hikari.HikariDataSource;
import engine.Enum; import engine.mbEnums;
import engine.Enum.GameObjectType; import engine.mbEnums.GameObjectType;
import engine.db.handlers.*; import engine.db.handlers.*;
import engine.objects.*; import engine.objects.*;
import engine.server.MBServerStatics; import engine.server.MBServerStatics;
@ -176,7 +176,7 @@ public enum DbManager {
public static boolean addToCache(AbstractGameObject gameObject) { public static boolean addToCache(AbstractGameObject gameObject) {
boolean isWorldServer = ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER); boolean isWorldServer = ConfigManager.serverType.equals(mbEnums.ServerType.WORLDSERVER);
if (!isWorldServer) { if (!isWorldServer) {
if (MBServerStatics.SKIP_CACHE_LOGIN) if (MBServerStatics.SKIP_CACHE_LOGIN)

4
src/engine/gameManager/DevCmdManager.java

@ -8,7 +8,7 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum; import engine.mbEnums;
import engine.devcmd.AbstractDevCmd; import engine.devcmd.AbstractDevCmd;
import engine.devcmd.cmds.*; import engine.devcmd.cmds.*;
import engine.objects.AbstractGameObject; import engine.objects.AbstractGameObject;
@ -156,7 +156,7 @@ public enum DevCmdManager {
//kill any commands not available to everyone on production server //kill any commands not available to everyone on production server
//only admin level can run dev commands on production //only admin level can run dev commands on production
if (a.status.equals(Enum.AccountStatus.ADMIN) == false) { if (a.status.equals(mbEnums.AccountStatus.ADMIN) == false) {
Logger.info("Account " + a.getUname() + "attempted to use dev command " + cmd); Logger.info("Account " + a.getUname() + "attempted to use dev command " + cmd);
return false; return false;
} }

22
src/engine/gameManager/GroupManager.java

@ -8,7 +8,7 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum; import engine.mbEnums;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
@ -80,7 +80,7 @@ public enum GroupManager {
groupUpdateMsg.setMessageType(3); groupUpdateMsg.setMessageType(3);
groupUpdateMsg.setPlayer(groupMember); groupUpdateMsg.setPlayer(groupMember);
Dispatch dispatch = Dispatch.borrow(source, groupUpdateMsg); Dispatch dispatch = Dispatch.borrow(source, groupUpdateMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
@ -160,7 +160,7 @@ public enum GroupManager {
gum.setPlayerUUID(groupMember.getObjectUUID()); gum.setPlayerUUID(groupMember.getObjectUUID());
Dispatch dispatch = Dispatch.borrow(groupMember, gum); Dispatch dispatch = Dispatch.borrow(groupMember, gum);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }
@ -189,7 +189,7 @@ public enum GroupManager {
gum.setMessageType(1); gum.setMessageType(1);
gum.setPlayer(groupMember); gum.setPlayer(groupMember);
Dispatch dispatch = Dispatch.borrow(groupMember, gum); Dispatch dispatch = Dispatch.borrow(groupMember, gum);
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
} }
@ -217,7 +217,7 @@ public enum GroupManager {
gum.setPlayer(playerToRefresh); gum.setPlayer(playerToRefresh);
Dispatch dispatch = Dispatch.borrow(source, gum); Dispatch dispatch = Dispatch.borrow(source, gum);
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
public static void RefreshOthersGroupList(PlayerCharacter source) { public static void RefreshOthersGroupList(PlayerCharacter source) {
@ -309,7 +309,7 @@ public enum GroupManager {
return false; return false;
} }
if (!item.template.item_type.equals(Enum.ItemType.GOLD)) //only split goldItem if (!item.template.item_type.equals(mbEnums.ItemType.GOLD)) //only split goldItem
return false; return false;
Group group = getGroup(pc); Group group = getGroup(pc);
@ -343,7 +343,7 @@ public enum GroupManager {
int dif = total - (size * amount); int dif = total - (size * amount);
if (AbstractWorldObject.IsAbstractCharacter(tar)) { if (AbstractWorldObject.IsAbstractCharacter(tar)) {
} else if (tar.getObjectType().equals(Enum.GameObjectType.Corpse)) { } else if (tar.getObjectType().equals(mbEnums.GameObjectType.Corpse)) {
Corpse corpse = (Corpse) tar; Corpse corpse = (Corpse) tar;
corpse.getInventory().remove(item); corpse.getInventory().remove(item);
} else { } else {
@ -351,8 +351,8 @@ public enum GroupManager {
return false; return false;
} }
if (item.getObjectType() == Enum.GameObjectType.MobLoot) { if (item.getObjectType() == mbEnums.GameObjectType.MobLoot) {
if (tar.getObjectType() == Enum.GameObjectType.Mob) { if (tar.getObjectType() == mbEnums.GameObjectType.Mob) {
((Mob) tar).charItemManager.delete(item); ((Mob) tar).charItemManager.delete(item);
} else } else
item.setNumOfItems(0); item.setNumOfItems(0);
@ -372,12 +372,12 @@ public enum GroupManager {
ugm.configure(); ugm.configure();
Dispatch dispatch = Dispatch.borrow(splitPlayer, ugm); Dispatch dispatch = Dispatch.borrow(splitPlayer, ugm);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
UpdateGoldMsg updateTargetGold = new UpdateGoldMsg(tar); UpdateGoldMsg updateTargetGold = new UpdateGoldMsg(tar);
updateTargetGold.configure(); updateTargetGold.configure();
DispatchMessage.dispatchMsgToInterestArea(tar, updateTargetGold, Enum.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false); DispatchMessage.dispatchMsgToInterestArea(tar, updateTargetGold, mbEnums.DispatchChannel.SECONDARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
// //TODO send group split message // //TODO send group split message
String text = "Group Split: " + amount; String text = "Group Split: " + amount;

10
src/engine/gameManager/GuildManager.java

@ -8,9 +8,9 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum; import engine.mbEnums;
import engine.Enum.BuildingGroup; import engine.mbEnums.BuildingGroup;
import engine.Enum.GuildHistoryType; import engine.mbEnums.GuildHistoryType;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -89,7 +89,7 @@ public enum GuildManager {
if (fromTeleportScreen) { if (fromTeleportScreen) {
dispatch = Dispatch.borrow(playerCharacter, msg); dispatch = Dispatch.borrow(playerCharacter, msg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
} }
if (DbManager.GuildQueries.ADD_TO_GUILDHISTORY(guild.getObjectUUID(), playerCharacter, DateTime.now(), historyType)) { if (DbManager.GuildQueries.ADD_TO_GUILDHISTORY(guild.getObjectUUID(), playerCharacter, DateTime.now(), historyType)) {
GuildHistory guildHistory = new GuildHistory(guild.getObjectUUID(), guild.getName(), DateTime.now(), historyType); GuildHistory guildHistory = new GuildHistory(guild.getObjectUUID(), guild.getName(), DateTime.now(), historyType);
@ -202,7 +202,7 @@ public enum GuildManager {
} }
public static Boolean meetsLoreRequirements(Guild guild, PlayerCharacter player) { public static Boolean meetsLoreRequirements(Guild guild, PlayerCharacter player) {
Enum.GuildCharterType charter = guild.getGuildType(); mbEnums.GuildCharterType charter = guild.getGuildType();
if (charter.requiredClasses.contains(player.absPromotionClass)) if (charter.requiredClasses.contains(player.absPromotionClass))
if (charter.requiredRaces.contains(player.absRace)) if (charter.requiredRaces.contains(player.absRace))
if (charter.sexRequired.contains(player.absGender)) if (charter.sexRequired.contains(player.absGender))

34
src/engine/gameManager/ItemManager.java

@ -1,6 +1,6 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum; import engine.mbEnums;
import engine.objects.*; import engine.objects.*;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -17,7 +17,7 @@ import java.util.concurrent.ConcurrentHashMap;
public enum ItemManager { public enum ItemManager {
ITEMMANAGER; ITEMMANAGER;
public static Boolean ValidRace(Item item, Enum.MonsterType race) { public static Boolean ValidRace(Item item, mbEnums.MonsterType race) {
if (item.template.item_race_req.isEmpty() && item.template.item_race_res.isEmpty()) if (item.template.item_race_req.isEmpty() && item.template.item_race_res.isEmpty())
return true; return true;
@ -33,7 +33,7 @@ public enum ItemManager {
return false; return false;
} }
public static Boolean ValidClass(Item item, Enum.ClassType base, Enum.ClassType profession) { public static Boolean ValidClass(Item item, mbEnums.ClassType base, mbEnums.ClassType profession) {
// Early exit if no entry // Early exit if no entry
@ -51,14 +51,14 @@ public enum ItemManager {
return false; return false;
} }
public static Boolean ValidDiscipline(Item item, EnumSet<Enum.DisciplineType> discs) { public static Boolean ValidDiscipline(Item item, EnumSet<mbEnums.DisciplineType> discs) {
// Early exit if no entry // Early exit if no entry
if (item.template.item_disc_req.isEmpty() && item.template.item_disc_res.isEmpty()) if (item.template.item_disc_req.isEmpty() && item.template.item_disc_res.isEmpty())
return true; return true;
EnumSet<Enum.DisciplineType> workSet = EnumSet.copyOf(discs); EnumSet<mbEnums.DisciplineType> workSet = EnumSet.copyOf(discs);
if (item.template.item_disc_req.isEmpty() == false) { if (item.template.item_disc_req.isEmpty() == false) {
@ -108,18 +108,18 @@ public enum ItemManager {
public static boolean isTwoHanded(Item item) { public static boolean isTwoHanded(Item item) {
if (!item.template.item_type.equals(Enum.ItemType.WEAPON)) if (!item.template.item_type.equals(mbEnums.ItemType.WEAPON))
return false; return false;
return item.template.item_eq_slots_and.contains(EnumSet.of(Enum.EquipSlotType.LHELD, Enum.EquipSlotType.RHELD)); return item.template.item_eq_slots_and.contains(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD));
} }
public static boolean isTwoHanded(ItemTemplate template) { public static boolean isTwoHanded(ItemTemplate template) {
if (!template.item_type.equals(Enum.ItemType.WEAPON)) if (!template.item_type.equals(mbEnums.ItemType.WEAPON))
return false; return false;
return template.item_eq_slots_and.contains(EnumSet.of(Enum.EquipSlotType.LHELD, Enum.EquipSlotType.RHELD)); return template.item_eq_slots_and.contains(EnumSet.of(mbEnums.EquipSlotType.LHELD, mbEnums.EquipSlotType.RHELD));
} }
public static boolean isShield(Item item) { public static boolean isShield(Item item) {
@ -138,7 +138,7 @@ public enum ItemManager {
return false; return false;
} }
public static boolean validForSlot(Enum.EquipSlotType slot, ConcurrentHashMap<Enum.EquipSlotType, Item> equipped, Item item) { public static boolean validForSlot(mbEnums.EquipSlotType slot, ConcurrentHashMap<mbEnums.EquipSlotType, Item> equipped, Item item) {
boolean validSlot = false; boolean validSlot = false;
@ -157,18 +157,18 @@ public enum ItemManager {
// Two handed weapons take up two slots // Two handed weapons take up two slots
if ((isTwoHanded(item)) && if ((isTwoHanded(item)) &&
((slot == Enum.EquipSlotType.LHELD && equipped.get(Enum.EquipSlotType.RHELD) != null) || ((slot == mbEnums.EquipSlotType.LHELD && equipped.get(mbEnums.EquipSlotType.RHELD) != null) ||
(slot == Enum.EquipSlotType.RHELD && equipped.get(Enum.EquipSlotType.LHELD) != null))) (slot == mbEnums.EquipSlotType.RHELD && equipped.get(mbEnums.EquipSlotType.LHELD) != null)))
return false; return false;
if (item.template.item_type.equals(Enum.ItemType.WEAPON)) if (item.template.item_type.equals(mbEnums.ItemType.WEAPON))
if (equipped.get(slot) != null && equipped.get(slot).equals(item) == false) if (equipped.get(slot) != null && equipped.get(slot).equals(item) == false)
return false; return false;
return true; return true;
} }
public static boolean canEquip(Enum.EquipSlotType slot, CharacterItemManager itemManager, AbstractCharacter abstractCharacter, Item item) { public static boolean canEquip(mbEnums.EquipSlotType slot, CharacterItemManager itemManager, AbstractCharacter abstractCharacter, Item item) {
if (itemManager == null || abstractCharacter == null) if (itemManager == null || abstractCharacter == null)
return false; return false;
@ -176,7 +176,7 @@ public enum ItemManager {
// Early exit for mobiles and NPCS. // Early exit for mobiles and NPCS.
// Perhaps not needed now that mobs have skills. // Perhaps not needed now that mobs have skills.
if (EnumSet.of(Enum.GameObjectType.NPC, Enum.GameObjectType.Mob).contains(abstractCharacter.getObjectType())) if (EnumSet.of(mbEnums.GameObjectType.NPC, mbEnums.GameObjectType.Mob).contains(abstractCharacter.getObjectType()))
return false; return false;
if (!validForSlot(slot, itemManager.getEquipped(), item)) if (!validForSlot(slot, itemManager.getEquipped(), item))
@ -201,8 +201,8 @@ public enum ItemManager {
Item item = new Item(templateID); Item item = new Item(templateID);
item.ownerID = reciever.getObjectUUID(); item.ownerID = reciever.getObjectUUID();
item.ownerType = Enum.OwnerType.PlayerCharacter; item.ownerType = mbEnums.OwnerType.PlayerCharacter;
item.containerType = Enum.ItemContainerType.INVENTORY; item.containerType = mbEnums.ItemContainerType.INVENTORY;
item.numberOfItems = amount; item.numberOfItems = amount;
try { try {

16
src/engine/gameManager/LootManager.java

@ -8,8 +8,8 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum;
import engine.loot.*; import engine.loot.*;
import engine.mbEnums;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ErrorPopupMsg;
import engine.net.client.msg.chat.ChatSystemMsg; import engine.net.client.msg.chat.ChatSystemMsg;
@ -92,7 +92,7 @@ public enum LootManager {
if ((it.templateID > 2499 && it.templateID <= 3050) || template.item_base_name.toLowerCase().contains("of the gods")) { if ((it.templateID > 2499 && it.templateID <= 3050) || template.item_base_name.toLowerCase().contains("of the gods")) {
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + template.item_base_name + ". Are you tough enough to take it?"); ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + template.item_base_name + ". Are you tough enough to take it?");
chatMsg.setMessageType(10); chatMsg.setMessageType(10);
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg); DispatchMessage.dispatchMsgToAll(chatMsg);
} }
} }
@ -177,7 +177,7 @@ public enum LootManager {
if (itemUUID == 0) if (itemUUID == 0)
return null; return null;
if (ItemTemplate.templates.get(itemUUID).item_type.equals(Enum.ItemType.RESOURCE)) { if (ItemTemplate.templates.get(itemUUID).item_type.equals(mbEnums.ItemType.RESOURCE)) {
int amount = ThreadLocalRandom.current().nextInt(tableRow.minSpawn, tableRow.maxSpawn + 1); int amount = ThreadLocalRandom.current().nextInt(tableRow.minSpawn, tableRow.maxSpawn + 1);
return new MobLoot(mob, ItemTemplate.templates.get(itemUUID), amount, false); return new MobLoot(mob, ItemTemplate.templates.get(itemUUID), amount, false);
} }
@ -187,7 +187,7 @@ public enum LootManager {
if (selectedRow.pModTable != 0) if (selectedRow.pModTable != 0)
try { try {
outItem = GeneratePrefix(mob, outItem, genTableID, genRoll, inHotzone); outItem = GeneratePrefix(mob, outItem, genTableID, genRoll, inHotzone);
outItem.flags.remove(Enum.ItemFlags.Identified); outItem.flags.remove(mbEnums.ItemFlags.Identified);
} catch (Exception e) { } catch (Exception e) {
Logger.error("Failed to GeneratePrefix for item: " + outItem.getName()); Logger.error("Failed to GeneratePrefix for item: " + outItem.getName());
} }
@ -195,7 +195,7 @@ public enum LootManager {
if (selectedRow.sModTable != 0) if (selectedRow.sModTable != 0)
try { try {
outItem = GenerateSuffix(mob, outItem, genTableID, genRoll, inHotzone); outItem = GenerateSuffix(mob, outItem, genTableID, genRoll, inHotzone);
outItem.flags.remove(Enum.ItemFlags.Identified); outItem.flags.remove(mbEnums.ItemFlags.Identified);
} catch (Exception e) { } catch (Exception e) {
Logger.error("Failed to GenerateSuffix for item: " + outItem.getName()); Logger.error("Failed to GenerateSuffix for item: " + outItem.getName());
} }
@ -338,7 +338,7 @@ public enum LootManager {
public static void GenerateEquipmentDrop(Mob mob) { public static void GenerateEquipmentDrop(Mob mob) {
if (mob.behaviourType.equals(Enum.MobBehaviourType.HamletGuard)) if (mob.behaviourType.equals(mbEnums.MobBehaviourType.HamletGuard))
return; // safehold guards don't drop their equipment return; // safehold guards don't drop their equipment
//do equipment here //do equipment here
int dropCount = 0; int dropCount = 0;
@ -358,7 +358,7 @@ public enum LootManager {
MobLoot ml = new MobLoot(mob, item.template, false); MobLoot ml = new MobLoot(mob, item.template, false);
if (ml != null && dropCount < 1) { if (ml != null && dropCount < 1) {
ml.flags.add(Enum.ItemFlags.Identified); ml.flags.add(mbEnums.ItemFlags.Identified);
ml.setCombat_health_current((short) ((short) ml.combat_health_current - ThreadLocalRandom.current().nextInt(5) + 1)); ml.setCombat_health_current((short) ((short) ml.combat_health_current - ThreadLocalRandom.current().nextInt(5) + 1));
mob.charItemManager.addItemToInventory(ml); mob.charItemManager.addItemToInventory(ml);
dropCount = 1; dropCount = 1;
@ -453,7 +453,7 @@ public enum LootManager {
if (suffix != null) if (suffix != null)
winnings.addPermanentEnchantment(suffix.action, 0, suffix.level, true); winnings.addPermanentEnchantment(suffix.action, 0, suffix.level, true);
} }
winnings.flags.add(Enum.ItemFlags.Identified); winnings.flags.add(mbEnums.ItemFlags.Identified);
//remove gift from inventory //remove gift from inventory

66
src/engine/gameManager/MaintenanceManager.java

@ -11,7 +11,7 @@ package engine.gameManager;
// Defines static methods which comprise the magicbane // Defines static methods which comprise the magicbane
// building maintenance system. // building maintenance system.
import engine.Enum; import engine.mbEnums;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.City; import engine.objects.City;
import engine.objects.Warehouse; import engine.objects.Warehouse;
@ -44,7 +44,7 @@ public enum MaintenanceManager {
// Build list of buildings to apply maintenance on. // Build list of buildings to apply maintenance on.
buildingList = new ArrayList(DbManager.getList(Enum.GameObjectType.Building)); buildingList = new ArrayList(DbManager.getList(mbEnums.GameObjectType.Building));
HashMap<String, ArrayList<Building>> maintMap = new HashMap<>(); HashMap<String, ArrayList<Building>> maintMap = new HashMap<>();
maintMap = buildMaintList(buildingList); maintMap = buildMaintList(buildingList);
@ -119,7 +119,7 @@ public enum MaintenanceManager {
// No maintenance on NPC owned buildings (Cache loaded) // No maintenance on NPC owned buildings (Cache loaded)
if (building.getProtectionState() == Enum.ProtectionState.NPC) if (building.getProtectionState() == mbEnums.ProtectionState.NPC)
continue; continue;
// No maintenance on constructing meshes // No maintenance on constructing meshes
@ -141,12 +141,12 @@ public enum MaintenanceManager {
// No maintenance on banestones omfg // No maintenance on banestones omfg
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.BANESTONE)) if (building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.BANESTONE))
continue; continue;
// no maintenance on Mines omfg // no maintenance on Mines omfg
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.MINE)) if (building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.MINE))
continue; continue;
// Null Maintenance date? // Null Maintenance date?
@ -169,7 +169,7 @@ public enum MaintenanceManager {
// Add building to maintenance queue // Add building to maintenance queue
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL)) if (building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.TOL))
tolList.add(building); tolList.add(building);
else else
maintList.add(building); maintList.add(building);
@ -220,14 +220,14 @@ public enum MaintenanceManager {
// the overdraft for us. // the overdraft for us.
if (hasFunds == false && (building.assetIsProtected() || building.getBlueprint().getBuildingGroup() == Enum.BuildingGroup.WAREHOUSE)) { if (hasFunds == false && (building.assetIsProtected() || building.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.WAREHOUSE)) {
overDraft = maintCost - building.getStrongboxValue(); overDraft = maintCost - building.getStrongboxValue();
} }
if ((overDraft > 0)) if ((overDraft > 0))
if ((building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.SHRINE) == false) && if ((building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.SHRINE) == false) &&
(warehouse != null) && building.assetIsProtected() == true && (warehouse != null) && building.assetIsProtected() == true &&
(warehouse.resources.get(Enum.ResourceType.GOLD)) >= overDraft) { (warehouse.resources.get(mbEnums.ResourceType.GOLD)) >= overDraft) {
hasFunds = true; hasFunds = true;
} }
@ -242,22 +242,22 @@ public enum MaintenanceManager {
hasResources = false; hasResources = false;
else { else {
resourceValue = warehouse.resources.get(Enum.ResourceType.STONE); resourceValue = warehouse.resources.get(mbEnums.ResourceType.STONE);
if (resourceValue < 1500) if (resourceValue < 1500)
hasResources = false; hasResources = false;
resourceValue = warehouse.resources.get(Enum.ResourceType.LUMBER); resourceValue = warehouse.resources.get(mbEnums.ResourceType.LUMBER);
if (resourceValue < 1500) if (resourceValue < 1500)
hasResources = false; hasResources = false;
resourceValue = warehouse.resources.get(Enum.ResourceType.GALVOR); resourceValue = warehouse.resources.get(mbEnums.ResourceType.GALVOR);
if (resourceValue < 5) if (resourceValue < 5)
hasResources = false; hasResources = false;
resourceValue = warehouse.resources.get(Enum.ResourceType.WORMWOOD); resourceValue = warehouse.resources.get(mbEnums.ResourceType.WORMWOOD);
if (resourceValue < 5) if (resourceValue < 5)
hasResources = false; hasResources = false;
@ -290,16 +290,16 @@ public enum MaintenanceManager {
if (overDraft > 0) { if (overDraft > 0) {
resourceValue = warehouse.resources.get(Enum.ResourceType.GOLD); resourceValue = warehouse.resources.get(mbEnums.ResourceType.GOLD);
warehouse.resources.put(Enum.ResourceType.GOLD, resourceValue - overDraft); warehouse.resources.put(mbEnums.ResourceType.GOLD, resourceValue - overDraft);
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) { if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
warehouse.resources.put(Enum.ResourceType.GOLD, resourceValue); warehouse.resources.put(mbEnums.ResourceType.GOLD, resourceValue);
Logger.error("gold update failed for warehouse of city:" + warehouse.city.getName()); Logger.error("gold update failed for warehouse of city:" + warehouse.city.getName());
return true; return true;
} }
Warehouse.AddTransactionToWarehouse(warehouse, Enum.GameObjectType.Building, building.getObjectUUID(), Enum.TransactionType.WITHDRAWL, Enum.ResourceType.GOLD, overDraft); Warehouse.AddTransactionToWarehouse(warehouse, mbEnums.GameObjectType.Building, building.getObjectUUID(), mbEnums.TransactionType.WITHDRAWL, mbEnums.ResourceType.GOLD, overDraft);
} }
// Early exit as we're done if we're not an R8 tree // Early exit as we're done if we're not an R8 tree
@ -311,54 +311,54 @@ public enum MaintenanceManager {
// Withdraw Stone // Withdraw Stone
resourceValue = warehouse.resources.get(Enum.ResourceType.STONE); resourceValue = warehouse.resources.get(mbEnums.ResourceType.STONE);
warehouse.resources.put(Enum.ResourceType.STONE, resourceValue - 1500); warehouse.resources.put(mbEnums.ResourceType.STONE, resourceValue - 1500);
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) { if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
warehouse.resources.put(Enum.ResourceType.STONE, resourceValue); warehouse.resources.put(mbEnums.ResourceType.STONE, resourceValue);
Logger.error("stone update failed for warehouse of city:" + warehouse.city.getName()); Logger.error("stone update failed for warehouse of city:" + warehouse.city.getName());
return true; return true;
} }
Warehouse.AddTransactionToWarehouse(warehouse, Enum.GameObjectType.Building, building.getObjectUUID(), Enum.TransactionType.WITHDRAWL, Enum.ResourceType.STONE, 1500); Warehouse.AddTransactionToWarehouse(warehouse, mbEnums.GameObjectType.Building, building.getObjectUUID(), mbEnums.TransactionType.WITHDRAWL, mbEnums.ResourceType.STONE, 1500);
// Withdraw Lumber // Withdraw Lumber
resourceValue = warehouse.resources.get(Enum.ResourceType.LUMBER); resourceValue = warehouse.resources.get(mbEnums.ResourceType.LUMBER);
warehouse.resources.put(Enum.ResourceType.LUMBER, resourceValue - 1500); warehouse.resources.put(mbEnums.ResourceType.LUMBER, resourceValue - 1500);
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) { if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
warehouse.resources.put(Enum.ResourceType.STONE, resourceValue); warehouse.resources.put(mbEnums.ResourceType.STONE, resourceValue);
Logger.error("lumber update failed for warehouse of city:" + warehouse.city.getName()); Logger.error("lumber update failed for warehouse of city:" + warehouse.city.getName());
return true; return true;
} }
Warehouse.AddTransactionToWarehouse(warehouse, Enum.GameObjectType.Building, building.getObjectUUID(), Enum.TransactionType.WITHDRAWL, Enum.ResourceType.LUMBER, 1500); Warehouse.AddTransactionToWarehouse(warehouse, mbEnums.GameObjectType.Building, building.getObjectUUID(), mbEnums.TransactionType.WITHDRAWL, mbEnums.ResourceType.LUMBER, 1500);
// Withdraw Galvor // Withdraw Galvor
resourceValue = warehouse.resources.get(Enum.ResourceType.GALVOR); resourceValue = warehouse.resources.get(mbEnums.ResourceType.GALVOR);
warehouse.resources.put(Enum.ResourceType.GALVOR, resourceValue - 5); warehouse.resources.put(mbEnums.ResourceType.GALVOR, resourceValue - 5);
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) { if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
warehouse.resources.put(Enum.ResourceType.GALVOR, resourceValue); warehouse.resources.put(mbEnums.ResourceType.GALVOR, resourceValue);
Logger.error("GALVOR update failed for warehouse of city:" + warehouse.city.getName()); Logger.error("GALVOR update failed for warehouse of city:" + warehouse.city.getName());
return true; return true;
} }
Warehouse.AddTransactionToWarehouse(warehouse, Enum.GameObjectType.Building, building.getObjectUUID(), Enum.TransactionType.WITHDRAWL, Enum.ResourceType.GALVOR, 5); Warehouse.AddTransactionToWarehouse(warehouse, mbEnums.GameObjectType.Building, building.getObjectUUID(), mbEnums.TransactionType.WITHDRAWL, mbEnums.ResourceType.GALVOR, 5);
// Withdraw GWORMWOOD // Withdraw GWORMWOOD
resourceValue = warehouse.resources.get(Enum.ResourceType.WORMWOOD); resourceValue = warehouse.resources.get(mbEnums.ResourceType.WORMWOOD);
warehouse.resources.put(Enum.ResourceType.WORMWOOD, resourceValue - 5); warehouse.resources.put(mbEnums.ResourceType.WORMWOOD, resourceValue - 5);
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) { if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
warehouse.resources.put(Enum.ResourceType.GALVOR, resourceValue); warehouse.resources.put(mbEnums.ResourceType.GALVOR, resourceValue);
Logger.error("wyrmwood update failed for warehouse of city:" + warehouse.city.getName()); Logger.error("wyrmwood update failed for warehouse of city:" + warehouse.city.getName());
return true; return true;
} }
Warehouse.AddTransactionToWarehouse(warehouse, Enum.GameObjectType.Building, building.getObjectUUID(), Enum.TransactionType.WITHDRAWL, Enum.ResourceType.WORMWOOD, 5); Warehouse.AddTransactionToWarehouse(warehouse, mbEnums.GameObjectType.Building, building.getObjectUUID(), mbEnums.TransactionType.WITHDRAWL, mbEnums.ResourceType.WORMWOOD, 5);
return true; return true;
} }

8
src/engine/gameManager/MovementManager.java

@ -8,15 +8,15 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum.DispatchChannel;
import engine.Enum.GameObjectType;
import engine.Enum.ModType;
import engine.Enum.SourceType;
import engine.InterestManagement.InterestManager; import engine.InterestManagement.InterestManager;
import engine.exception.MsgSendException; import engine.exception.MsgSendException;
import engine.math.Bounds; import engine.math.Bounds;
import engine.math.Vector3f; import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums.DispatchChannel;
import engine.mbEnums.GameObjectType;
import engine.mbEnums.ModType;
import engine.mbEnums.SourceType;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
import engine.net.client.msg.MoveToPointMsg; import engine.net.client.msg.MoveToPointMsg;

50
src/engine/gameManager/NPCManager.java

@ -8,11 +8,11 @@
package engine.gameManager; package engine.gameManager;
import engine.Enum;
import engine.InterestManagement.WorldGrid; import engine.InterestManagement.WorldGrid;
import engine.math.Quaternion; import engine.math.Quaternion;
import engine.math.Vector3f; import engine.math.Vector3f;
import engine.math.Vector3fImmutable; import engine.math.Vector3fImmutable;
import engine.mbEnums;
import engine.net.Dispatch; import engine.net.Dispatch;
import engine.net.DispatchMessage; import engine.net.DispatchMessage;
import engine.net.client.ClientConnection; import engine.net.client.ClientConnection;
@ -66,7 +66,7 @@ public enum NPCManager {
PetMsg petMsg = new PetMsg(5, null); PetMsg petMsg = new PetMsg(5, null);
Dispatch dispatch = Dispatch.borrow(petOwner, petMsg); Dispatch dispatch = Dispatch.borrow(petOwner, petMsg);
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY); DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
} }
} }
@ -96,7 +96,7 @@ public enum NPCManager {
for (Mob necroPet : player.necroPets) for (Mob necroPet : player.necroPets)
if (necroPet.isPet()) if (necroPet.isPet())
necroPet.agentType = Enum.AIAgentType.MOBILE; necroPet.agentType = mbEnums.AIAgentType.MOBILE;
} }
public static void spawnNecroPet(PlayerCharacter playerCharacter, Mob mob) { public static void spawnNecroPet(PlayerCharacter playerCharacter, Mob mob) {
@ -170,10 +170,10 @@ public enum NPCManager {
if (b.getBlueprint() == null) if (b.getBlueprint() == null)
continue; continue;
if (b.getProtectionState().equals(Enum.ProtectionState.CONTRACT)) if (b.getProtectionState().equals(mbEnums.ProtectionState.CONTRACT))
protectedBuildings.add(b); protectedBuildings.add(b);
if (b.getProtectionState().equals(Enum.ProtectionState.PENDING)) if (b.getProtectionState().equals(mbEnums.ProtectionState.PENDING))
protectedBuildings.add(b); protectedBuildings.add(b);
} }
@ -191,14 +191,14 @@ public enum NPCManager {
// to add the NPC to the building's hireling list // to add the NPC to the building's hireling list
// Account for R8's having slots reversed. // Account for R8's having slots reversed.
if (abstractCharacter.building.getBlueprint() != null && abstractCharacter.building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL) && abstractCharacter.building.getRank() == 8) if (abstractCharacter.building.getBlueprint() != null && abstractCharacter.building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.TOL) && abstractCharacter.building.getRank() == 8)
buildingSlot = BuildingManager.getLastAvailableSlot(abstractCharacter.building); buildingSlot = BuildingManager.getLastAvailableSlot(abstractCharacter.building);
else else
buildingSlot = BuildingManager.getAvailableSlot(abstractCharacter.building); buildingSlot = BuildingManager.getAvailableSlot(abstractCharacter.building);
// Override slot for siege engines // Override slot for siege engines
if (abstractCharacter.getObjectType().equals(Enum.GameObjectType.Mob) && ((Mob) abstractCharacter).behaviourType.equals(Enum.MobBehaviourType.SiegeEngine)) { if (abstractCharacter.getObjectType().equals(mbEnums.GameObjectType.Mob) && ((Mob) abstractCharacter).behaviourType.equals(mbEnums.MobBehaviourType.SiegeEngine)) {
Mob siegeMobile = (Mob) abstractCharacter; Mob siegeMobile = (Mob) abstractCharacter;
buildingSlot = siegeMobile.guardCaptain.minions.size() + 2; buildingSlot = siegeMobile.guardCaptain.minions.size() + 2;
} }
@ -265,7 +265,7 @@ public enum NPCManager {
float attackSpeedModifier = 1; float attackSpeedModifier = 1;
float powerDamageModifier = 1; float powerDamageModifier = 1;
//handle stance modifiers for guard mob //handle stance modifiers for guard mob
if (guard.agentType.equals(Enum.AIAgentType.GUARDWALLARCHER)) { if (guard.agentType.equals(mbEnums.AIAgentType.GUARDWALLARCHER)) {
//apply rogue bonuses //apply rogue bonuses
attackRatingModifier += 0.5f; attackRatingModifier += 0.5f;
defenseModifier += 0.5f; defenseModifier += 0.5f;
@ -273,12 +273,12 @@ public enum NPCManager {
attackSpeedModifier -= 0.36f; attackSpeedModifier -= 0.36f;
} else { } else {
Integer contractID; Integer contractID;
if (guard.agentType.equals(Enum.AIAgentType.GUARDMINION)) { if (guard.agentType.equals(mbEnums.AIAgentType.GUARDMINION)) {
contractID = guard.guardCaptain.contract.getContractID(); contractID = guard.guardCaptain.contract.getContractID();
} else { } else {
contractID = guard.contract.getContractID(); contractID = guard.contract.getContractID();
} }
if (Enum.MinionType.ContractToMinionMap.get(contractID) != null && Enum.MinionType.ContractToMinionMap.get(contractID).isMage()) { if (mbEnums.MinionType.ContractToMinionMap.get(contractID) != null && mbEnums.MinionType.ContractToMinionMap.get(contractID).isMage()) {
//apply mage offensive Stance //apply mage offensive Stance
powerDamageModifier += 0.5f; powerDamageModifier += 0.5f;
} else { } else {
@ -309,11 +309,11 @@ public enum NPCManager {
guard.maxDamageHandOne = (int) ((guard.mobBase.getDamageMax()) * rankModifier); guard.maxDamageHandOne = (int) ((guard.mobBase.getDamageMax()) * rankModifier);
guard.speedHandOne = 30.0f; guard.speedHandOne = 30.0f;
} else { } else {
if (guard.charItemManager.equipped.containsKey(Enum.EquipSlotType.RHELD)) { if (guard.charItemManager.equipped.containsKey(mbEnums.EquipSlotType.RHELD)) {
//has main hand weapon //has main hand weapon
Item weapon = guard.charItemManager.equipped.get(Enum.EquipSlotType.RHELD); Item weapon = guard.charItemManager.equipped.get(mbEnums.EquipSlotType.RHELD);
if (weapon.template.item_primary_attr.equals(Enum.AttributeType.Strength)) if (weapon.template.item_primary_attr.equals(mbEnums.AttributeType.Strength))
primaryStat = guard.getStatStrCurrent(); primaryStat = guard.getStatStrCurrent();
else else
primaryStat = guard.getStatDexCurrent(); primaryStat = guard.getStatDexCurrent();
@ -322,10 +322,10 @@ public enum NPCManager {
guard.maxDamageHandOne = (int) ((guard.mobBase.getDamageMax() + weapon.template.item_weapon_damage.values().iterator().next()[1]) * rankModifier) + primaryStat; guard.maxDamageHandOne = (int) ((guard.mobBase.getDamageMax() + weapon.template.item_weapon_damage.values().iterator().next()[1]) * rankModifier) + primaryStat;
guard.speedHandOne = weapon.template.item_weapon_wepspeed; guard.speedHandOne = weapon.template.item_weapon_wepspeed;
guard.rangeHandOne = weapon.template.item_weapon_max_range; guard.rangeHandOne = weapon.template.item_weapon_max_range;
} else if (guard.charItemManager.equipped.containsKey(Enum.EquipSlotType.LHELD) && !ItemManager.isShield(guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD).template)) { } else if (guard.charItemManager.equipped.containsKey(mbEnums.EquipSlotType.LHELD) && !ItemManager.isShield(guard.charItemManager.equipped.get(mbEnums.EquipSlotType.LHELD).template)) {
//has off hand weapon //has off hand weapon
Item weapon = guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD); Item weapon = guard.charItemManager.equipped.get(mbEnums.EquipSlotType.LHELD);
if (weapon.template.item_primary_attr.equals(Enum.AttributeType.Strength)) if (weapon.template.item_primary_attr.equals(mbEnums.AttributeType.Strength))
primaryStat = guard.getStatStrCurrent(); primaryStat = guard.getStatStrCurrent();
else else
primaryStat = guard.getStatDexCurrent(); primaryStat = guard.getStatDexCurrent();
@ -350,7 +350,7 @@ public enum NPCManager {
int baseDef = guard.mobBase.getDefenseRating(); int baseDef = guard.mobBase.getDefenseRating();
int armorDefense = 0; int armorDefense = 0;
for (Item equipped : guard.charItemManager.equipped.values()) for (Item equipped : guard.charItemManager.equipped.values())
if (equipped.template.item_type.equals(Enum.ItemType.ARMOR) || ItemManager.isShield(equipped.template)) if (equipped.template.item_type.equals(mbEnums.ItemType.ARMOR) || ItemManager.isShield(equipped.template))
armorDefense += equipped.template.item_defense_rating; armorDefense += equipped.template.item_defense_rating;
guard.defenseRating = dexterity + baseDef + armorDefense; guard.defenseRating = dexterity + baseDef + armorDefense;
} }
@ -358,10 +358,10 @@ public enum NPCManager {
public static void setAttackRatingForGuard(Mob guard) { public static void setAttackRatingForGuard(Mob guard) {
int strength = guard.getStatStrCurrent(); int strength = guard.getStatStrCurrent();
int baseAtr = guard.mobBase.getAttackRating(); int baseAtr = guard.mobBase.getAttackRating();
if (guard.charItemManager.equipped.get(Enum.EquipSlotType.RHELD) != null) if (guard.charItemManager.equipped.get(mbEnums.EquipSlotType.RHELD) != null)
guard.atrHandOne = baseAtr + (int) ((strength * 0.5f) + ((int) guard.charItemManager.equipped.get(Enum.EquipSlotType.RHELD).template.item_skill_required.values().toArray()[0] * 4) + ((int) guard.charItemManager.equipped.get(Enum.EquipSlotType.RHELD).template.item_skill_required.values().toArray()[0] * 3)); guard.atrHandOne = baseAtr + (int) ((strength * 0.5f) + ((int) guard.charItemManager.equipped.get(mbEnums.EquipSlotType.RHELD).template.item_skill_required.values().toArray()[0] * 4) + ((int) guard.charItemManager.equipped.get(mbEnums.EquipSlotType.RHELD).template.item_skill_required.values().toArray()[0] * 3));
else if (guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD) != null && !ItemManager.isShield(guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD).template)) else if (guard.charItemManager.equipped.get(mbEnums.EquipSlotType.LHELD) != null && !ItemManager.isShield(guard.charItemManager.equipped.get(mbEnums.EquipSlotType.LHELD).template))
guard.atrHandTwo = baseAtr + (int) ((strength * 0.5f) + ((int) guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD).template.item_skill_required.values().toArray()[0] * 4) + ((int) guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD).template.item_skill_required.values().toArray()[0] * 3)); guard.atrHandTwo = baseAtr + (int) ((strength * 0.5f) + ((int) guard.charItemManager.equipped.get(mbEnums.EquipSlotType.LHELD).template.item_skill_required.values().toArray()[0] * 4) + ((int) guard.charItemManager.equipped.get(mbEnums.EquipSlotType.LHELD).template.item_skill_required.values().toArray()[0] * 3));
else else
guard.atrHandOne = baseAtr; guard.atrHandOne = baseAtr;
} }
@ -440,10 +440,10 @@ public enum NPCManager {
return; return;
for (Item equipped : mob.charItemManager.equipped.values()) { for (Item equipped : mob.charItemManager.equipped.values()) {
if (equipped.template.item_type.equals(Enum.ItemType.ARMOR)) { if (equipped.template.item_type.equals(mbEnums.ItemType.ARMOR)) {
mob.resists.setResist(Enum.DamageType.SLASHING, mob.resists.getResist(Enum.DamageType.SLASHING, 0) + equipped.template.combat_attack_resist.get("SLASHING")); mob.resists.setResist(mbEnums.DamageType.SLASHING, mob.resists.getResist(mbEnums.DamageType.SLASHING, 0) + equipped.template.combat_attack_resist.get("SLASHING"));
mob.resists.setResist(Enum.DamageType.CRUSHING, mob.resists.getResist(Enum.DamageType.CRUSHING, 0) + equipped.template.combat_attack_resist.get("CRUSHING")); mob.resists.setResist(mbEnums.DamageType.CRUSHING, mob.resists.getResist(mbEnums.DamageType.CRUSHING, 0) + equipped.template.combat_attack_resist.get("CRUSHING"));
mob.resists.setResist(Enum.DamageType.PIERCING, mob.resists.getResist(Enum.DamageType.PIERCING, 0) + equipped.template.combat_attack_resist.get("PIERCING")); mob.resists.setResist(mbEnums.DamageType.PIERCING, mob.resists.getResist(mbEnums.DamageType.PIERCING, 0) + equipped.template.combat_attack_resist.get("PIERCING"));
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save