forked from MagicBane/Server
Renamed class to not conflict with the java.lang version.
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
|
||||
package discord;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.mbEnums;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
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(),
|
||||
ConfigManager.MB_DATABASE_PASS.getValue());
|
||||
@@ -131,7 +131,7 @@ public class Database {
|
||||
discordAccount = new DiscordAccount();
|
||||
discordAccount.discordAccount = rs.getString("discordAccount");
|
||||
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
|
||||
|
||||
Timestamp registrationDate = rs.getTimestamp("registrationDate");
|
||||
@@ -328,7 +328,7 @@ public class Database {
|
||||
discordAccount = new DiscordAccount();
|
||||
discordAccount.discordAccount = rs.getString("discordAccount");
|
||||
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
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
|
||||
package discord;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class DiscordAccount {
|
||||
public String discordAccount;
|
||||
public String gameAccountName;
|
||||
public Enum.AccountStatus status;
|
||||
public mbEnums.AccountStatus status;
|
||||
public LocalDateTime registrationDate;
|
||||
public LocalDateTime lastUpdateRequest;
|
||||
public byte isDiscordAdmin;
|
||||
|
||||
@@ -11,7 +11,7 @@ package discord.handlers;
|
||||
import discord.Database;
|
||||
import discord.DiscordAccount;
|
||||
import discord.MagicBot;
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
|
||||
import java.util.List;
|
||||
@@ -21,7 +21,7 @@ public class AccountInfoRequest {
|
||||
public static void handleRequest(MessageReceivedEvent event) {
|
||||
|
||||
String discordAccountID = event.getAuthor().getId();
|
||||
Enum.AccountStatus accountStatus;
|
||||
mbEnums.AccountStatus accountStatus;
|
||||
|
||||
if (Database.online == false) {
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ package discord.handlers;
|
||||
import discord.DiscordAccount;
|
||||
import discord.MagicBot;
|
||||
import discord.RobotSpeak;
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -23,7 +23,7 @@ public class BanToggleHandler {
|
||||
public static void handleRequest(MessageReceivedEvent event, String[] args) {
|
||||
|
||||
String discordAccountID;
|
||||
Enum.AccountStatus accountStatus;
|
||||
mbEnums.AccountStatus accountStatus;
|
||||
|
||||
// Early exit if database unavailable or is not an admin
|
||||
|
||||
@@ -55,10 +55,10 @@ public class BanToggleHandler {
|
||||
|
||||
// toggle ban status
|
||||
|
||||
if (discordAccounts.get(0).status.equals(Enum.AccountStatus.BANNED))
|
||||
accountStatus = Enum.AccountStatus.ACTIVE;
|
||||
if (discordAccounts.get(0).status.equals(mbEnums.AccountStatus.BANNED))
|
||||
accountStatus = mbEnums.AccountStatus.ACTIVE;
|
||||
else
|
||||
accountStatus = Enum.AccountStatus.BANNED;
|
||||
accountStatus = mbEnums.AccountStatus.BANNED;
|
||||
|
||||
// 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 (accountStatus.equals(Enum.AccountStatus.ACTIVE))
|
||||
if (accountStatus.equals(mbEnums.AccountStatus.ACTIVE))
|
||||
return;
|
||||
|
||||
// Set users role to noob
|
||||
|
||||
@@ -11,7 +11,7 @@ package discord.handlers;
|
||||
import discord.Database;
|
||||
import discord.DiscordAccount;
|
||||
import discord.MagicBot;
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -53,7 +53,7 @@ public class PasswordChangeHandler {
|
||||
|
||||
// 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,
|
||||
"Sorry but that is too much work. \n" +
|
||||
"Your account detailings cannot for to log into game!");
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
|
||||
package engine.InterestManagement;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.GroupManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.job.JobScheduler;
|
||||
import engine.jobs.RefreshGroupJob;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.net.AbstractNetMsg;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -482,7 +482,7 @@ public enum InterestManager implements Runnable {
|
||||
|
||||
awonpc.playerAgroMap.put(player.getObjectUUID(), 0f);
|
||||
|
||||
if ((awonpc.agentType.equals(Enum.AIAgentType.MOBILE)))
|
||||
if ((awonpc.agentType.equals(mbEnums.AIAgentType.MOBILE)))
|
||||
((Mob) awonpc).setCombatTarget(null);
|
||||
|
||||
lcm = new LoadCharacterMsg(awonpc, PlayerCharacter.hideNonAscii());
|
||||
|
||||
@@ -12,8 +12,8 @@ package engine.InterestManagement;
|
||||
* Interest management facilities.
|
||||
*/
|
||||
|
||||
import engine.Enum;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.TerritoryChangeMessage;
|
||||
@@ -88,17 +88,17 @@ public enum RealmMap {
|
||||
if (city != null) {
|
||||
TerritoryChangeMessage tcm = new TerritoryChangeMessage((PlayerCharacter) realm.getRulingCity().getOwner(), realm);
|
||||
Dispatch dispatch = Dispatch.borrow(player, tcm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
|
||||
} else {
|
||||
TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm);
|
||||
Dispatch dispatch = Dispatch.borrow(player, tcm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
|
||||
}
|
||||
|
||||
} else {
|
||||
TerritoryChangeMessage tcm = new TerritoryChangeMessage(null, realm);
|
||||
Dispatch dispatch = Dispatch.borrow(player, tcm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
package engine.InterestManagement;
|
||||
|
||||
import engine.Enum.GridObjectType;
|
||||
import engine.mbEnums.GridObjectType;
|
||||
import engine.math.FastMath;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.archive;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Bane;
|
||||
import engine.objects.City;
|
||||
import engine.workthreads.WarehousePushThread;
|
||||
@@ -21,7 +21,7 @@ import java.sql.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import static engine.Enum.RecordEventType;
|
||||
import static engine.mbEnums.RecordEventType;
|
||||
|
||||
public class BaneRecord extends DataRecord {
|
||||
|
||||
@@ -38,7 +38,7 @@ public class BaneRecord extends DataRecord {
|
||||
private DateTime baneDropTime;
|
||||
|
||||
private BaneRecord(Bane bane) {
|
||||
this.recordType = Enum.DataRecordType.BANE;
|
||||
this.recordType = mbEnums.DataRecordType.BANE;
|
||||
this.eventType = RecordEventType.PENDING;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class BaneRecord extends DataRecord {
|
||||
baneRecord = new BaneRecord(bane);
|
||||
baneRecord.eventType = eventType;
|
||||
} else {
|
||||
baneRecord.recordType = Enum.DataRecordType.BANE;
|
||||
baneRecord.recordType = mbEnums.DataRecordType.BANE;
|
||||
baneRecord.eventType = eventType;
|
||||
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.archive;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Guild;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.workthreads.WarehousePushThread;
|
||||
@@ -33,7 +33,7 @@ public class CharacterRecord extends DataRecord {
|
||||
private PlayerCharacter player;
|
||||
|
||||
private CharacterRecord(PlayerCharacter player) {
|
||||
this.recordType = Enum.DataRecordType.CHARACTER;
|
||||
this.recordType = mbEnums.DataRecordType.CHARACTER;
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class CharacterRecord extends DataRecord {
|
||||
if (characterRecord == null) {
|
||||
characterRecord = new CharacterRecord(player);
|
||||
} else {
|
||||
characterRecord.recordType = Enum.DataRecordType.CHARACTER;
|
||||
characterRecord.recordType = mbEnums.DataRecordType.CHARACTER;
|
||||
characterRecord.player = player;
|
||||
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.archive;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.City;
|
||||
import engine.workthreads.WarehousePushThread;
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
public class CityRecord extends DataRecord {
|
||||
|
||||
private static final LinkedBlockingQueue<CityRecord> recordPool = new LinkedBlockingQueue<>();
|
||||
private Enum.RecordEventType eventType;
|
||||
private mbEnums.RecordEventType eventType;
|
||||
private City city;
|
||||
private String cityHash;
|
||||
private String cityGuildHash;
|
||||
@@ -32,13 +32,13 @@ public class CityRecord extends DataRecord {
|
||||
private java.time.LocalDateTime establishedDatetime;
|
||||
|
||||
private CityRecord(City city) {
|
||||
this.recordType = Enum.DataRecordType.CITY;
|
||||
this.recordType = mbEnums.DataRecordType.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 = recordPool.poll();
|
||||
@@ -47,7 +47,7 @@ public class CityRecord extends DataRecord {
|
||||
cityRecord = new CityRecord(city);
|
||||
cityRecord.eventType = eventType;
|
||||
} else {
|
||||
cityRecord.recordType = Enum.DataRecordType.CITY;
|
||||
cityRecord.recordType = mbEnums.DataRecordType.CITY;
|
||||
cityRecord.eventType = eventType;
|
||||
cityRecord.city = city;
|
||||
|
||||
@@ -69,7 +69,7 @@ public class CityRecord extends DataRecord {
|
||||
|
||||
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;
|
||||
else
|
||||
cityRecord.establishedDatetime = java.time.LocalDateTime.now();
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
package engine.db.archive;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
|
||||
class DataRecord {
|
||||
|
||||
public Enum.DataRecordType recordType;
|
||||
public mbEnums.DataRecordType recordType;
|
||||
|
||||
DataRecord() {
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import static engine.Enum.DataRecordType;
|
||||
import static engine.mbEnums.DataRecordType;
|
||||
|
||||
public class DataWarehouse implements Runnable {
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.db.archive;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.RecordEventType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.RecordEventType;
|
||||
import engine.objects.Guild;
|
||||
import engine.workthreads.WarehousePushThread;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class GuildRecord extends DataRecord {
|
||||
public static HashMap<Integer, GuildRecord> GuildRecordCache = null;
|
||||
public String guildHash;
|
||||
public int guildID;
|
||||
private Enum.RecordEventType eventType;
|
||||
private mbEnums.RecordEventType eventType;
|
||||
private Guild guild;
|
||||
private String guildName;
|
||||
private String charterName;
|
||||
@@ -44,9 +44,9 @@ public class GuildRecord extends DataRecord {
|
||||
private java.time.LocalDateTime eventDatetime;
|
||||
|
||||
private GuildRecord(Guild guild) {
|
||||
this.recordType = Enum.DataRecordType.GUILD;
|
||||
this.recordType = mbEnums.DataRecordType.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;
|
||||
//add
|
||||
guildRecord = recordPool.poll();
|
||||
@@ -81,7 +81,7 @@ public class GuildRecord extends DataRecord {
|
||||
guildRecord.eventType = eventType;
|
||||
} else {
|
||||
guildRecord.guild = guild;
|
||||
guildRecord.recordType = Enum.DataRecordType.GUILD;
|
||||
guildRecord.recordType = mbEnums.DataRecordType.GUILD;
|
||||
guildRecord.eventType = eventType;
|
||||
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class GuildRecord extends DataRecord {
|
||||
guildRecord.guildHash = guildRecord.guild.getHash();
|
||||
guildRecord.guildID = guildRecord.guild.getObjectUUID();
|
||||
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());
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.archive;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.Mine;
|
||||
import engine.objects.PlayerCharacter;
|
||||
@@ -23,7 +23,7 @@ import java.util.concurrent.LinkedBlockingQueue;
|
||||
public class MineRecord extends DataRecord {
|
||||
|
||||
private static final LinkedBlockingQueue<MineRecord> recordPool = new LinkedBlockingQueue<>();
|
||||
private Enum.RecordEventType eventType;
|
||||
private mbEnums.RecordEventType eventType;
|
||||
private String zoneHash;
|
||||
private String charHash;
|
||||
private String mineGuildHash;
|
||||
@@ -33,12 +33,12 @@ public class MineRecord extends DataRecord {
|
||||
private float locY;
|
||||
|
||||
private MineRecord() {
|
||||
this.recordType = Enum.DataRecordType.MINE;
|
||||
this.eventType = Enum.RecordEventType.CAPTURE;
|
||||
this.recordType = mbEnums.DataRecordType.MINE;
|
||||
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 = recordPool.poll();
|
||||
@@ -48,13 +48,13 @@ public class MineRecord extends DataRecord {
|
||||
mineRecord = new MineRecord();
|
||||
mineRecord.eventType = eventType;
|
||||
} else {
|
||||
mineRecord.recordType = Enum.DataRecordType.MINE;
|
||||
mineRecord.recordType = mbEnums.DataRecordType.MINE;
|
||||
mineRecord.eventType = eventType;
|
||||
}
|
||||
|
||||
mineRecord.zoneHash = mine.getParentZone().hash;
|
||||
|
||||
if (character.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
if (character.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||
player = (PlayerCharacter) character;
|
||||
mineRecord.charHash = player.getHash();
|
||||
} else
|
||||
|
||||
@@ -23,8 +23,8 @@ import java.time.LocalDateTime;
|
||||
import java.util.LinkedList;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import static engine.Enum.DataRecordType;
|
||||
import static engine.Enum.PvpHistoryType;
|
||||
import static engine.mbEnums.DataRecordType;
|
||||
import static engine.mbEnums.PvpHistoryType;
|
||||
|
||||
public class PvpRecord extends DataRecord {
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.archive;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Realm;
|
||||
import engine.workthreads.WarehousePushThread;
|
||||
|
||||
@@ -23,20 +23,20 @@ public class RealmRecord extends DataRecord {
|
||||
private static final LinkedBlockingQueue<RealmRecord> recordPool = new LinkedBlockingQueue<>();
|
||||
|
||||
private Realm realm;
|
||||
private Enum.RecordEventType eventType;
|
||||
private mbEnums.RecordEventType eventType;
|
||||
private String cityHash;
|
||||
private String guildHash;
|
||||
private String charterType;
|
||||
private LocalDateTime eventDateTime;
|
||||
|
||||
private RealmRecord(Realm realm) {
|
||||
this.recordType = Enum.DataRecordType.REALM;
|
||||
this.recordType = mbEnums.DataRecordType.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 = recordPool.poll();
|
||||
@@ -45,7 +45,7 @@ public class RealmRecord extends DataRecord {
|
||||
realmRecord = new RealmRecord(realm);
|
||||
realmRecord.eventType = eventType;
|
||||
} else {
|
||||
realmRecord.recordType = Enum.DataRecordType.REALM;
|
||||
realmRecord.recordType = mbEnums.DataRecordType.REALM;
|
||||
realmRecord.eventType = eventType;
|
||||
realmRecord.realm = realm;
|
||||
|
||||
@@ -53,9 +53,9 @@ public class RealmRecord extends DataRecord {
|
||||
|
||||
realmRecord.cityHash = realm.getRulingCity().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;
|
||||
else
|
||||
realmRecord.eventDateTime = LocalDateTime.now();
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.Account;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -27,7 +27,7 @@ public class dbAccountHandler extends dbHandlerBase {
|
||||
|
||||
public dbAccountHandler() {
|
||||
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) {
|
||||
@@ -204,7 +204,7 @@ public class dbAccountHandler extends dbHandlerBase {
|
||||
if (account != null) {
|
||||
account.runAfterLoad();
|
||||
|
||||
if (ConfigManager.serverType.equals(Enum.ServerType.LOGINSERVER))
|
||||
if (ConfigManager.serverType.equals(mbEnums.ServerType.LOGINSERVER))
|
||||
Account.AccountsMap.put(uname, account.getObjectUUID());
|
||||
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.BaseClass;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class dbBaseClassHandler extends dbHandlerBase {
|
||||
|
||||
public dbBaseClassHandler() {
|
||||
this.localClass = BaseClass.class;
|
||||
this.localObjectType = Enum.GameObjectType.BaseClass;
|
||||
this.localObjectType = mbEnums.GameObjectType.BaseClass;
|
||||
}
|
||||
|
||||
public BaseClass GET_BASE_CLASS(final int id) {
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
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.DbManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.DbObjectType;
|
||||
import engine.mbEnums.ProtectionState;
|
||||
import engine.mbEnums.TaxType;
|
||||
import engine.objects.*;
|
||||
import org.joda.time.DateTime;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -34,7 +34,7 @@ public class dbBuildingHandler extends dbHandlerBase {
|
||||
|
||||
public dbBuildingHandler() {
|
||||
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,
|
||||
@@ -112,7 +112,7 @@ public class dbBuildingHandler extends dbHandlerBase {
|
||||
if (uuid == 0)
|
||||
return null;
|
||||
|
||||
Building building = (Building) DbManager.getFromCache(Enum.GameObjectType.Building, uuid);
|
||||
Building building = (Building) DbManager.getFromCache(mbEnums.GameObjectType.Building, uuid);
|
||||
|
||||
if (building != null)
|
||||
return building;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.BuildingLocation;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -23,7 +24,7 @@ public class dbBuildingLocationHandler extends dbHandlerBase {
|
||||
|
||||
public dbBuildingLocationHandler() {
|
||||
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() {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Account;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.session.CSSession;
|
||||
@@ -26,7 +27,7 @@ public class dbCSSessionHandler extends dbHandlerBase {
|
||||
|
||||
public dbCSSessionHandler() {
|
||||
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) {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.CharacterPower;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -23,7 +23,7 @@ public class dbCharacterPowerHandler extends dbHandlerBase {
|
||||
|
||||
public dbCharacterPowerHandler() {
|
||||
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) {
|
||||
@@ -74,7 +74,7 @@ public class dbCharacterPowerHandler extends dbHandlerBase {
|
||||
|
||||
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)
|
||||
return characterPower;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.CharacterRune;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class dbCharacterRuneHandler extends dbHandlerBase {
|
||||
|
||||
public dbCharacterRuneHandler() {
|
||||
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) {
|
||||
@@ -49,7 +49,7 @@ public class dbCharacterRuneHandler extends dbHandlerBase {
|
||||
|
||||
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)
|
||||
return characterRune;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.CharacterSkill;
|
||||
import engine.objects.PlayerCharacter;
|
||||
@@ -24,7 +24,7 @@ public class dbCharacterSkillHandler extends dbHandlerBase {
|
||||
|
||||
public dbCharacterSkillHandler() {
|
||||
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) {
|
||||
@@ -72,7 +72,7 @@ public class dbCharacterSkillHandler extends dbHandlerBase {
|
||||
|
||||
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)
|
||||
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);
|
||||
|
||||
if (ac == null || (!(ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))))
|
||||
if (ac == null || (!(ac.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))))
|
||||
return characterSkills;
|
||||
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) ac;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.City;
|
||||
@@ -25,7 +25,7 @@ public class dbCityHandler extends dbHandlerBase {
|
||||
|
||||
public dbCityHandler() {
|
||||
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 {
|
||||
@@ -118,7 +118,7 @@ public class dbCityHandler extends dbHandlerBase {
|
||||
|
||||
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)
|
||||
return city;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Contract;
|
||||
import engine.objects.Item;
|
||||
import engine.objects.MobLoot;
|
||||
@@ -25,12 +25,12 @@ public class dbContractHandler extends dbHandlerBase {
|
||||
|
||||
public dbContractHandler() {
|
||||
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) {
|
||||
|
||||
Contract contract = (Contract) DbManager.getFromCache(Enum.GameObjectType.Contract, objectUUID);
|
||||
Contract contract = (Contract) DbManager.getFromCache(mbEnums.GameObjectType.Contract, objectUUID);
|
||||
|
||||
if (contract != null)
|
||||
return contract;
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.effectmodifiers.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -63,7 +63,7 @@ public class dbEffectsBaseHandler extends dbHandlerBase {
|
||||
|
||||
IDString = rs.getString("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
|
||||
|
||||
@@ -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) {
|
||||
case AdjustAboveDmgCap:
|
||||
abstractEffectModifier = new AdjustAboveDmgCapEffectModifier(rs);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.EffectsResourceCosts;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -23,7 +24,7 @@ public class dbEffectsResourceCostHandler extends dbHandlerBase {
|
||||
|
||||
public dbEffectsResourceCostHandler() {
|
||||
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) {
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GuildHistoryType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GuildHistoryType;
|
||||
import engine.objects.*;
|
||||
import engine.server.world.WorldServer;
|
||||
import org.joda.time.DateTime;
|
||||
@@ -24,7 +24,7 @@ public class dbGuildHandler extends dbHandlerBase {
|
||||
|
||||
public dbGuildHandler() {
|
||||
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) {
|
||||
@@ -276,7 +276,7 @@ public class dbGuildHandler extends dbHandlerBase {
|
||||
|
||||
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)
|
||||
return guild;
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -42,7 +42,7 @@ public abstract class dbHandlerBase {
|
||||
// Only call runAfterLoad() for objects instanced on the world server
|
||||
|
||||
if ((abstractGameObject != null && abstractGameObject instanceof AbstractWorldObject) &&
|
||||
(ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER) ||
|
||||
(ConfigManager.serverType.equals(mbEnums.ServerType.WORLDSERVER) ||
|
||||
(abstractGameObject.getObjectType() == GameObjectType.Guild)))
|
||||
((AbstractWorldObject) abstractGameObject).runAfterLoad();
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ItemContainerType;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ItemContainerType;
|
||||
import engine.mbEnums.ItemType;
|
||||
import engine.objects.AbstractCharacter;
|
||||
import engine.objects.CharacterItemManager;
|
||||
import engine.objects.Item;
|
||||
@@ -33,7 +33,7 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
|
||||
public dbItemHandler() {
|
||||
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) {
|
||||
@@ -92,14 +92,14 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
break;
|
||||
}
|
||||
|
||||
if (toAdd.equipSlot.equals(Enum.EquipSlotType.NONE))
|
||||
if (toAdd.equipSlot.equals(mbEnums.EquipSlotType.NONE))
|
||||
preparedStatement.setString(7, "");
|
||||
else
|
||||
preparedStatement.setString(7, toAdd.equipSlot.name());
|
||||
|
||||
String flagString = "";
|
||||
|
||||
for (Enum.ItemFlags itemflag : toAdd.flags)
|
||||
for (mbEnums.ItemFlags itemflag : toAdd.flags)
|
||||
flagString += itemflag.toString() + ";";
|
||||
|
||||
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
|
||||
public boolean UPDATE_OWNER(final Item item, int newOwnerID,
|
||||
ItemContainerType containerType, Enum.EquipSlotType slot) {
|
||||
ItemContainerType containerType, mbEnums.EquipSlotType slot) {
|
||||
|
||||
boolean worked = false;
|
||||
|
||||
@@ -401,7 +401,7 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
break;
|
||||
}
|
||||
|
||||
if (slot.equals(Enum.EquipSlotType.NONE))
|
||||
if (slot.equals(mbEnums.EquipSlotType.NONE))
|
||||
preparedStatement.setString(4, "");
|
||||
else
|
||||
preparedStatement.setString(4, slot.name());
|
||||
@@ -531,7 +531,7 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
|
||||
String flagString = "";
|
||||
|
||||
for (Enum.ItemFlags itemflag : item.flags)
|
||||
for (mbEnums.ItemFlags itemflag : item.flags)
|
||||
flagString += itemflag.toString() + ";";
|
||||
|
||||
flagString = flagString.replaceAll(";$", "");
|
||||
@@ -573,7 +573,7 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
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, "");
|
||||
else
|
||||
preparedStatement.setString(1, item.equipSlot.name());
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Kit;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -23,7 +24,7 @@ public class dbKitHandler extends dbHandlerBase {
|
||||
|
||||
public dbKitHandler() {
|
||||
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() {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.MenuOption;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -23,7 +24,7 @@ public class dbMenuHandler extends dbHandlerBase {
|
||||
|
||||
public dbMenuHandler() {
|
||||
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) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.Mine;
|
||||
import engine.objects.MineProduction;
|
||||
@@ -24,7 +24,7 @@ public class dbMineHandler extends dbHandlerBase {
|
||||
|
||||
public dbMineHandler() {
|
||||
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) {
|
||||
@@ -32,7 +32,7 @@ public class dbMineHandler extends dbHandlerBase {
|
||||
if (id == 0)
|
||||
return null;
|
||||
|
||||
Mine mine = (Mine) DbManager.getFromCache(Enum.GameObjectType.Mine, id);
|
||||
Mine mine = (Mine) DbManager.getFromCache(mbEnums.GameObjectType.Mine, id);
|
||||
|
||||
if (mine != null)
|
||||
return mine;
|
||||
@@ -83,7 +83,7 @@ public class dbMineHandler extends dbHandlerBase {
|
||||
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();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("UPDATE `obj_mine` SET `mine_resource`=? WHERE `UID`=?")) {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.MobBase;
|
||||
import engine.objects.MobBaseEffects;
|
||||
@@ -26,7 +27,7 @@ public class dbMobBaseHandler extends dbHandlerBase {
|
||||
|
||||
public dbMobBaseHandler() {
|
||||
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) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Mob;
|
||||
import org.joda.time.DateTime;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -24,7 +25,7 @@ public class dbMobHandler extends dbHandlerBase {
|
||||
|
||||
public dbMobHandler() {
|
||||
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) {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum.ProfitType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ProfitType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.NPC;
|
||||
@@ -29,7 +30,7 @@ public class dbNPCHandler extends dbHandlerBase {
|
||||
|
||||
public dbNPCHandler() {
|
||||
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() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.Petition;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -58,8 +58,8 @@ public class dbPetitionHandler extends dbHandlerBase {
|
||||
" VALUES (?,?,?,?,?,?,?,?,?);")) {
|
||||
|
||||
preparedStatement.setTimestamp(1, new java.sql.Timestamp(System.currentTimeMillis()));
|
||||
preparedStatement.setString(2, Enum.PetitionType.values()[petition.primaryType].name());
|
||||
preparedStatement.setString(3, Enum.PetitionSubType.values()[petition.subType].name());
|
||||
preparedStatement.setString(2, mbEnums.PetitionType.values()[petition.primaryType].name());
|
||||
preparedStatement.setString(3, mbEnums.PetitionSubType.values()[petition.subType].name());
|
||||
preparedStatement.setInt(4, petition.reportAccount.getObjectUUID());
|
||||
preparedStatement.setString(5, petition.reportAccount.getUname());
|
||||
preparedStatement.setInt(6, petition.reportPlayer.getObjectUUID());
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.AbstractWorldObject;
|
||||
import engine.objects.Heraldry;
|
||||
@@ -29,7 +29,7 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
|
||||
|
||||
public dbPlayerCharacterHandler() {
|
||||
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) {
|
||||
@@ -176,7 +176,7 @@ public class dbPlayerCharacterHandler extends dbHandlerBase {
|
||||
if (objectUUID == 0)
|
||||
return null;
|
||||
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(Enum.GameObjectType.PlayerCharacter, objectUUID);
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(mbEnums.GameObjectType.PlayerCharacter, objectUUID);
|
||||
|
||||
if (playerCharacter != null)
|
||||
return playerCharacter;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.objects.Mob;
|
||||
@@ -25,7 +25,7 @@ public class dbPowerHandler extends dbHandlerBase {
|
||||
|
||||
public dbPowerHandler() {
|
||||
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() {
|
||||
@@ -41,7 +41,7 @@ public class dbPowerHandler extends dbHandlerBase {
|
||||
int token = DbManager.hasher.SBStringHash(IDString);
|
||||
|
||||
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)
|
||||
EffectsBase.effectSourceTypeMap.put(token, new HashSet<>());
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.PromotionClass;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -23,7 +24,7 @@ public class dbPromotionClassHandler extends dbHandlerBase {
|
||||
|
||||
public dbPromotionClassHandler() {
|
||||
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) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.RuneBaseAttribute;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -23,7 +24,7 @@ public class dbRuneBaseAttributeHandler extends dbHandlerBase {
|
||||
|
||||
public dbRuneBaseAttributeHandler() {
|
||||
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() {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.RuneBaseEffect;
|
||||
@@ -26,7 +27,7 @@ public class dbRuneBaseEffectHandler extends dbHandlerBase {
|
||||
|
||||
public dbRuneBaseEffectHandler() {
|
||||
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) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.RuneBase;
|
||||
import engine.powers.RunePowerEntry;
|
||||
import engine.powers.RuneSkillAdjustEntry;
|
||||
@@ -26,7 +27,7 @@ public class dbRuneBaseHandler extends dbHandlerBase {
|
||||
|
||||
public dbRuneBaseHandler() {
|
||||
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() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.Portal;
|
||||
@@ -49,7 +49,7 @@ public class dbRunegateHandler extends dbHandlerBase {
|
||||
public ArrayList<Portal> GET_PORTAL_LIST(int gateUID) {
|
||||
|
||||
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();
|
||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM `static_runegate_portals` WHERE `sourceBuilding` = ?;")) {
|
||||
@@ -60,8 +60,8 @@ public class dbRunegateHandler extends dbHandlerBase {
|
||||
|
||||
while (rs.next()) {
|
||||
int targetBuildingID = rs.getInt("targetBuilding");
|
||||
Building targetBuilding = (Building) DbManager.getObject(Enum.GameObjectType.Building, targetBuildingID);
|
||||
Enum.PortalType portalType = Enum.PortalType.valueOf(rs.getString("portalType"));
|
||||
Building targetBuilding = (Building) DbManager.getObject(mbEnums.GameObjectType.Building, targetBuildingID);
|
||||
mbEnums.PortalType portalType = mbEnums.PortalType.valueOf(rs.getString("portalType"));
|
||||
Portal portal = new Portal(sourceBuilding, portalType, targetBuilding);
|
||||
portalList.add(portal);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum.ProtectionState;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ProtectionState;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractGameObject;
|
||||
@@ -28,7 +29,7 @@ public class dbShrineHandler extends dbHandlerBase {
|
||||
|
||||
public dbShrineHandler() {
|
||||
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 {
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.MaxSkills;
|
||||
import engine.objects.SkillsBase;
|
||||
@@ -27,7 +27,7 @@ public class dbSkillBaseHandler extends dbHandlerBase {
|
||||
|
||||
public dbSkillBaseHandler() {
|
||||
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) {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.SkillReq;
|
||||
import engine.powers.PowersBase;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -25,7 +26,7 @@ public class dbSkillReqHandler extends dbHandlerBase {
|
||||
|
||||
public dbSkillReqHandler() {
|
||||
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() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.VendorDialog;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -23,12 +23,12 @@ public class dbVendorDialogHandler extends dbHandlerBase {
|
||||
|
||||
public dbVendorDialogHandler() {
|
||||
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) {
|
||||
|
||||
VendorDialog vendorDialog = (VendorDialog) DbManager.getFromCache(Enum.GameObjectType.VendorDialog, objectUUID);
|
||||
VendorDialog vendorDialog = (VendorDialog) DbManager.getFromCache(mbEnums.GameObjectType.VendorDialog, objectUUID);
|
||||
|
||||
if (vendorDialog != null)
|
||||
return vendorDialog;
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.TransactionType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.TransactionType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.Building;
|
||||
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();
|
||||
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();
|
||||
|
||||
for (Enum.ResourceType resource : warehouse.locked)
|
||||
for (mbEnums.ResourceType resource : warehouse.locked)
|
||||
locks.add(resource.name());
|
||||
|
||||
warehouseJSON.put("locked", locks);
|
||||
@@ -142,7 +142,7 @@ public class dbWarehouseHandler extends dbHandlerBase {
|
||||
|
||||
// Locate warehouse building
|
||||
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;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.db.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.objects.Zone;
|
||||
@@ -26,7 +26,7 @@ public class dbZoneHandler extends dbHandlerBase {
|
||||
|
||||
public dbZoneHandler() {
|
||||
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() {
|
||||
@@ -48,7 +48,7 @@ public class dbZoneHandler extends dbHandlerBase {
|
||||
|
||||
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)
|
||||
return zone;
|
||||
@@ -90,8 +90,8 @@ public class dbZoneHandler extends dbHandlerBase {
|
||||
zoneTemplate.max_blend = 128;
|
||||
zoneTemplate.min_blend = 128;
|
||||
zoneTemplate.terrain_max_y = 5;
|
||||
zoneTemplate.major_radius = (int) Enum.CityBoundsType.ZONE.halfExtents;
|
||||
zoneTemplate.minor_radius = (int) Enum.CityBoundsType.ZONE.halfExtents;
|
||||
zoneTemplate.major_radius = (int) mbEnums.CityBoundsType.ZONE.halfExtents;
|
||||
zoneTemplate.minor_radius = (int) mbEnums.CityBoundsType.ZONE.halfExtents;
|
||||
zoneTemplate.terrain_type = "PLANAR";
|
||||
|
||||
ZoneManager._zone_templates.put(zoneTemplate.templateID, zoneTemplate);
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.devcmd;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.ProtectionState;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
@@ -17,6 +16,7 @@ import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums.ProtectionState;
|
||||
import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Mob;
|
||||
import engine.objects.PlayerCharacter;
|
||||
@@ -61,7 +61,7 @@ public class AddMobCmd extends AbstractDevCmd {
|
||||
}
|
||||
|
||||
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) {
|
||||
mob.updateDatabase();
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.*;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.PowerActionType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums.PowerActionType;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.PlayerCharacter;
|
||||
import engine.powers.ActionsBase;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.PlayerCharacter;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
@@ -27,7 +27,7 @@ public class GotoObj extends AbstractDevCmd {
|
||||
|
||||
int uuid;
|
||||
Vector3fImmutable targetLoc = Vector3fImmutable.ZERO;
|
||||
Enum.DbObjectType objectType;
|
||||
mbEnums.DbObjectType objectType;
|
||||
|
||||
try {
|
||||
uuid = Integer.parseInt(words[0]);
|
||||
@@ -41,37 +41,37 @@ public class GotoObj extends AbstractDevCmd {
|
||||
switch (objectType) {
|
||||
|
||||
case NPC:
|
||||
NPC npc = (NPC) DbManager.getFromCache(Enum.GameObjectType.NPC, uuid);
|
||||
NPC npc = (NPC) DbManager.getFromCache(mbEnums.GameObjectType.NPC, uuid);
|
||||
|
||||
if (npc != null)
|
||||
targetLoc = npc.getLoc();
|
||||
break;
|
||||
case MOB:
|
||||
Mob mob = (Mob) DbManager.getFromCache(Enum.GameObjectType.Mob, uuid);
|
||||
Mob mob = (Mob) DbManager.getFromCache(mbEnums.GameObjectType.Mob, uuid);
|
||||
|
||||
if (mob != null)
|
||||
targetLoc = mob.getLoc();
|
||||
break;
|
||||
case CHARACTER:
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(Enum.GameObjectType.PlayerCharacter, uuid);
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) DbManager.getFromCache(mbEnums.GameObjectType.PlayerCharacter, uuid);
|
||||
|
||||
if (playerCharacter != null)
|
||||
targetLoc = playerCharacter.getLoc();
|
||||
break;
|
||||
case BUILDING:
|
||||
Building building = (Building) DbManager.getFromCache(Enum.GameObjectType.Building, uuid);
|
||||
Building building = (Building) DbManager.getFromCache(mbEnums.GameObjectType.Building, uuid);
|
||||
|
||||
if (building != null)
|
||||
targetLoc = building.getLoc();
|
||||
break;
|
||||
case ZONE:
|
||||
Zone zone = (Zone) DbManager.getFromCache(Enum.GameObjectType.Zone, uuid);
|
||||
Zone zone = (Zone) DbManager.getFromCache(mbEnums.GameObjectType.Zone, uuid);
|
||||
|
||||
if (zone != null)
|
||||
targetLoc = zone.getLoc();
|
||||
break;
|
||||
case CITY:
|
||||
City city = (City) DbManager.getFromCache(Enum.GameObjectType.City, uuid);
|
||||
City city = (City) DbManager.getFromCache(mbEnums.GameObjectType.City, uuid);
|
||||
|
||||
if (city != null)
|
||||
targetLoc = city.getLoc();
|
||||
|
||||
@@ -9,14 +9,14 @@
|
||||
|
||||
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.gameManager.BuildingManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.BuildingGroup;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.TargetColor;
|
||||
import engine.objects.*;
|
||||
import engine.util.StringUtils;
|
||||
|
||||
@@ -436,7 +436,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
if (targetMob.isPet()) {
|
||||
output += "isPet: true";
|
||||
output += newline;
|
||||
if ((targetMob.agentType.equals(Enum.AIAgentType.PET)))
|
||||
if ((targetMob.agentType.equals(mbEnums.AIAgentType.PET)))
|
||||
output += "isSummonedPet: true";
|
||||
else
|
||||
output += "isSummonedPet: false";
|
||||
@@ -456,7 +456,7 @@ public class InfoCmd extends AbstractDevCmd {
|
||||
output += newline;
|
||||
|
||||
}
|
||||
if ((targetMob.agentType.equals(Enum.AIAgentType.MOBILE))) {
|
||||
if ((targetMob.agentType.equals(mbEnums.AIAgentType.MOBILE))) {
|
||||
output += "SpawnRadius: " + targetMob.getSpawnRadius();
|
||||
output += newline;
|
||||
output += "Spawn Timer: " + targetMob.getSpawnTimeAsString();
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.ProtectionState;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.BuildingManager;
|
||||
@@ -18,6 +17,7 @@ import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums.ProtectionState;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.ItemType;
|
||||
import engine.Enum.OwnerType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums.ItemType;
|
||||
import engine.mbEnums.OwnerType;
|
||||
import engine.objects.*;
|
||||
import engine.powers.EffectsBase;
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.*;
|
||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -64,7 +64,7 @@ public class PrintEquipCmd extends AbstractDevCmd {
|
||||
if (tar.getObjectType() == GameObjectType.Mob) {
|
||||
Mob tarMob = (Mob) tar;
|
||||
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);
|
||||
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) {
|
||||
NPC tarMob = (NPC) tar;
|
||||
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);
|
||||
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;
|
||||
ConcurrentHashMap<Enum.EquipSlotType, Item> list = cim.getEquipped();
|
||||
ConcurrentHashMap<mbEnums.EquipSlotType, Item> list = cim.getEquipped();
|
||||
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);
|
||||
throwbackInfo(pc, " " + item.template.item_base_name + ", slot: " + slot);
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.ItemType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.mbEnums.ItemType;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.*;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ItemManager;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.*;
|
||||
|
||||
/**
|
||||
@@ -88,7 +88,7 @@ public class PrintStatsCmd extends AbstractDevCmd {
|
||||
//get weapons
|
||||
|
||||
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
|
||||
out += "Attack Rating: " + tar.atrHandTwo + newline;
|
||||
out += "Damage: " + tar.minDamageHandTwo + " - " + tar.maxDamageHandTwo + newline;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.BuildingGroup;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -163,7 +163,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
|
||||
mob.getParentZone().zoneMobSet.remove(mob);
|
||||
}
|
||||
DbManager.NPCQueries.DELETE_NPC(npc);
|
||||
DbManager.removeFromCache(Enum.GameObjectType.NPC,
|
||||
DbManager.removeFromCache(mbEnums.GameObjectType.NPC,
|
||||
npc.getObjectUUID());
|
||||
WorldGrid.RemoveWorldObject(npc);
|
||||
} else if (mobA != null) {
|
||||
@@ -176,7 +176,7 @@ public class PurgeObjectsCmd extends AbstractDevCmd {
|
||||
mob.getParentZone().zoneMobSet.remove(mob);
|
||||
}
|
||||
DbManager.MobQueries.DELETE_MOB(mobA);
|
||||
DbManager.removeFromCache(Enum.GameObjectType.Mob,
|
||||
DbManager.removeFromCache(mbEnums.GameObjectType.Mob,
|
||||
mobA.getObjectUUID());
|
||||
WorldGrid.RemoveWorldObject(mobA);
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.SiegeResult;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.mbEnums.SiegeResult;
|
||||
import engine.objects.*;
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.Enum.DbObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.BuildingManager;
|
||||
@@ -18,6 +16,8 @@ import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums.BuildingGroup;
|
||||
import engine.mbEnums.DbObjectType;
|
||||
import engine.objects.*;
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.BuildingManager;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.DbManager;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.TargetedActionMsg;
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ProtectionState;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ProtectionState;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Building;
|
||||
@@ -59,7 +59,7 @@ public class SetInvulCmd extends AbstractDevCmd {
|
||||
// status of the entire city
|
||||
|
||||
if ((b.getBlueprint() != null) &&
|
||||
(b.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL))) {
|
||||
(b.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.TOL))) {
|
||||
|
||||
City city;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.mbEnums;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.TargetedActionMsg;
|
||||
import engine.objects.AbstractGameObject;
|
||||
@@ -31,7 +32,7 @@ public class SetManaCmd extends AbstractDevCmd {
|
||||
|
||||
//Update all surrounding clients. - NOT for Mana?
|
||||
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) {
|
||||
this.throwbackError(pc, "Supplied data: " + words[0]
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.objects.AbstractGameObject;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.DbObjectType;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.DbObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.objects.*;
|
||||
@@ -37,7 +38,7 @@ public class SetOwnerCmd extends AbstractDevCmd {
|
||||
// if it's a tol change ownership of the city
|
||||
|
||||
if (_targetBuilding.getBlueprint() != null &&
|
||||
_targetBuilding.getBlueprint().getBuildingGroup().equals(engine.Enum.BuildingGroup.TOL)) {
|
||||
_targetBuilding.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.TOL)) {
|
||||
|
||||
City city = _targetBuilding.getCity();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.InterestManagement.InterestManager;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.TargetedActionMsg;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ApplyBuildingEffectMsg;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.objects.AbstractGameObject;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.mbEnums.BuildingGroup;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.ChatManager;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
@@ -111,7 +111,7 @@ public class SplatMobCmd extends AbstractDevCmd {
|
||||
|
||||
mobile = Mob.createMob(_mobileUUID,
|
||||
Vector3fImmutable.getRandomPointInCircle(_currentLocation, _targetRange),
|
||||
null, serverZone, null, null, "", 1, Enum.AIAgentType.MOBILE);
|
||||
null, serverZone, null, null, "", 1, mbEnums.AIAgentType.MOBILE);
|
||||
|
||||
if (mobile != null) {
|
||||
mobile.updateDatabase();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.net.client.msg.LoadStructureMsg;
|
||||
import engine.net.client.msg.MoveToPointMsg;
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.devcmd.cmds;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mobileAI.MobAI;
|
||||
import engine.objects.AbstractGameObject;
|
||||
import engine.objects.Mob;
|
||||
@@ -67,7 +67,7 @@ public class aiInfoCmd extends AbstractDevCmd {
|
||||
|
||||
if (mob.isPlayerGuard() == true) {
|
||||
|
||||
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION))
|
||||
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION))
|
||||
contractID = mob.guardCaptain.contract.getContractID();
|
||||
else
|
||||
contractID = mob.contract.getContractID();
|
||||
@@ -75,7 +75,7 @@ public class aiInfoCmd extends AbstractDevCmd {
|
||||
|
||||
if (contractID != 0) {
|
||||
|
||||
if (mob.agentType.equals(Enum.AIAgentType.GUARDMINION)) {
|
||||
if (mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION)) {
|
||||
output += "Captain Contract: " + contractID + newline;
|
||||
output += "Captain UUID: " + mob.guardCaptain.getObjectUUID() + newline;
|
||||
} else
|
||||
@@ -128,7 +128,7 @@ public class aiInfoCmd extends AbstractDevCmd {
|
||||
if (mob.contract != null)
|
||||
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));
|
||||
|
||||
powerEntries.addAll(contractEntries);
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.InterestManagement.InterestManager;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.job.JobContainer;
|
||||
@@ -19,6 +16,9 @@ import engine.job.JobScheduler;
|
||||
import engine.jobs.UpgradeBuildingJob;
|
||||
import engine.math.Bounds;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.BuildingGroup;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -230,7 +230,7 @@ public enum BuildingManager {
|
||||
if (warehouse == null)
|
||||
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)) {
|
||||
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
|
||||
|
||||
if (guardCaptain.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN))
|
||||
if (guardCaptain.agentType.equals(mbEnums.AIAgentType.GUARDCAPTAIN))
|
||||
DbManager.MobQueries.REMOVE_ALL_MINIONS(hireling.getObjectUUID());
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ public enum BuildingManager {
|
||||
|
||||
Building building;
|
||||
|
||||
building = (Building) DbManager.getFromCache(Enum.GameObjectType.Building, id);
|
||||
building = (Building) DbManager.getFromCache(mbEnums.GameObjectType.Building, id);
|
||||
|
||||
if (building != null)
|
||||
return building;
|
||||
@@ -584,14 +584,14 @@ public enum BuildingManager {
|
||||
|
||||
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)
|
||||
return false;
|
||||
|
||||
// Configure AI and write new mobile to disk
|
||||
|
||||
mobile.behaviourType = Enum.MobBehaviourType.GuardWallArcher;
|
||||
mobile.behaviourType = mbEnums.MobBehaviourType.GuardWallArcher;
|
||||
mobile = DbManager.MobQueries.PERSIST(mobile);
|
||||
|
||||
// Spawn new mobile
|
||||
@@ -603,14 +603,14 @@ public enum BuildingManager {
|
||||
|
||||
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)
|
||||
return false;
|
||||
|
||||
// Configure AI and write new mobile to disk
|
||||
|
||||
mobile.behaviourType = Enum.MobBehaviourType.GuardCaptain;
|
||||
mobile.behaviourType = mbEnums.MobBehaviourType.GuardCaptain;
|
||||
mobile = DbManager.MobQueries.PERSIST(mobile);
|
||||
|
||||
// Spawn new mobile
|
||||
@@ -623,14 +623,14 @@ public enum BuildingManager {
|
||||
if (contract.getContractID() == 910) {
|
||||
|
||||
//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)
|
||||
return false;
|
||||
|
||||
// Configure AI and write new mobile to disk
|
||||
|
||||
mobile.behaviourType = Enum.MobBehaviourType.GuardCaptain;
|
||||
mobile.behaviourType = mbEnums.MobBehaviourType.GuardCaptain;
|
||||
mobile = DbManager.MobQueries.PERSIST(mobile);
|
||||
|
||||
// Spawn new mobile
|
||||
@@ -739,7 +739,7 @@ public enum BuildingManager {
|
||||
Vector3fImmutable bindLoc = null;
|
||||
|
||||
if (building == null)
|
||||
return Enum.Ruins.getRandomRuin().getLocation();
|
||||
return mbEnums.Ruins.getRandomRuin().getLocation();
|
||||
|
||||
|
||||
bindLoc = building.getLoc();
|
||||
@@ -856,7 +856,7 @@ public enum BuildingManager {
|
||||
// protection
|
||||
|
||||
if (building.rank == -1)
|
||||
building.protectionState = Enum.ProtectionState.NONE;
|
||||
building.protectionState = mbEnums.ProtectionState.NONE;
|
||||
|
||||
// update object to clients
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.db.archive.BaneRecord;
|
||||
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.DispatchMessage;
|
||||
import engine.net.MessageDispatcher;
|
||||
@@ -79,7 +79,7 @@ public enum ChatManager {
|
||||
ArrayList<AbstractWorldObject> distroList = new ArrayList<>();
|
||||
for (PlayerCharacter pc : SessionManager
|
||||
.getAllActivePlayerCharacters()) {
|
||||
if (pc.getAccount().status.equals(Enum.AccountStatus.BANNED) == false)
|
||||
if (pc.getAccount().status.equals(mbEnums.AccountStatus.BANNED) == false)
|
||||
distroList.add(pc);
|
||||
}
|
||||
// Send dispatch to each player
|
||||
@@ -87,7 +87,7 @@ public enum ChatManager {
|
||||
for (AbstractWorldObject abstractWorldObject : distroList) {
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
|
||||
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
|
||||
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);
|
||||
msg.setMessageType(4);
|
||||
msg.setChannel(engine.Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||
msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
|
||||
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
|
||||
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
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(pcRecip, chatTellMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
// Also send /tell to sender
|
||||
if (pcSender != null) {
|
||||
Dispatch dispatch = Dispatch.borrow(pcSender, chatTellMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
} else
|
||||
@@ -342,14 +342,14 @@ public enum ChatManager {
|
||||
chatGuildMsg.setUnknown04(sender.getGuild() != null ? sender.getGuild()
|
||||
.getCharter() : 0); // Charter?
|
||||
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
|
||||
|
||||
for (AbstractWorldObject abstractWorldObject : distroList) {
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
|
||||
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) {
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
|
||||
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) {
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
|
||||
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) {
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
|
||||
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 (success) {
|
||||
String name = "";
|
||||
if (item.template.item_type.equals(Enum.ItemType.GOLD))
|
||||
if (item.template.item_type.equals(mbEnums.ItemType.GOLD))
|
||||
name = amount + " gold ";
|
||||
else {
|
||||
String vowels = "aeiou";
|
||||
@@ -844,7 +844,7 @@ public enum ChatManager {
|
||||
for (AbstractWorldObject abstractWorldObject : distroList) {
|
||||
PlayerCharacter playerCharacter = (PlayerCharacter) abstractWorldObject;
|
||||
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);
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(playerCharacter, chatSystemMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.job.JobContainer;
|
||||
import engine.job.JobScheduler;
|
||||
import engine.jobs.AttackJob;
|
||||
import engine.jobs.DeferredPowerJob;
|
||||
import engine.mbEnums;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.TargetedActionMsg;
|
||||
@@ -46,40 +46,40 @@ public enum CombatManager {
|
||||
case PlayerCharacter:
|
||||
case Mob:
|
||||
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;
|
||||
break;
|
||||
case NPC:
|
||||
return;
|
||||
}
|
||||
|
||||
Item mainWeapon = attacker.charItemManager.getEquipped().get(Enum.EquipSlotType.RHELD);
|
||||
Item offWeapon = attacker.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD);
|
||||
Item mainWeapon = attacker.charItemManager.getEquipped().get(mbEnums.EquipSlotType.RHELD);
|
||||
Item offWeapon = attacker.charItemManager.getEquipped().get(mbEnums.EquipSlotType.LHELD);
|
||||
|
||||
if (mainWeapon == null && offWeapon == null) {
|
||||
//no weapons equipped, punch with both fists
|
||||
processAttack(attacker, target, Enum.EquipSlotType.RHELD);
|
||||
processAttack(attacker, target, Enum.EquipSlotType.LHELD);
|
||||
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
|
||||
processAttack(attacker, target, mbEnums.EquipSlotType.LHELD);
|
||||
} else if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block")) {
|
||||
//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")) {
|
||||
//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) {
|
||||
//two weapons equipped, swing both hands
|
||||
processAttack(attacker, target, Enum.EquipSlotType.RHELD);
|
||||
processAttack(attacker, target, Enum.EquipSlotType.LHELD);
|
||||
processAttack(attacker, target, mbEnums.EquipSlotType.RHELD);
|
||||
processAttack(attacker, target, mbEnums.EquipSlotType.LHELD);
|
||||
} else if (mainWeapon == null && offWeapon != null && offWeapon.template.item_skill_required.containsKey("Block") == false) {
|
||||
//swing left hand only
|
||||
processAttack(attacker, target, Enum.EquipSlotType.LHELD);
|
||||
processAttack(attacker, target, mbEnums.EquipSlotType.LHELD);
|
||||
} else if (mainWeapon != null && offWeapon == null) {
|
||||
//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
|
||||
|
||||
@@ -98,12 +98,12 @@ public enum CombatManager {
|
||||
|
||||
if (weapon != 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;
|
||||
}
|
||||
|
||||
if (attacker.getObjectType().equals(Enum.GameObjectType.Mob))
|
||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
||||
if (((Mob) attacker).isSiege())
|
||||
attackRange = 300;
|
||||
|
||||
@@ -133,7 +133,7 @@ public enum CombatManager {
|
||||
|
||||
//get the proper stats based on which slot is attacking
|
||||
|
||||
if (slot == Enum.EquipSlotType.LHELD) {
|
||||
if (slot == mbEnums.EquipSlotType.LHELD) {
|
||||
min = attacker.minDamageHandTwo;
|
||||
max = attacker.maxDamageHandTwo;
|
||||
atr = attacker.atrHandTwo;
|
||||
@@ -156,10 +156,10 @@ public enum CombatManager {
|
||||
else
|
||||
hitChance = ((int) (450 * (dif - 0.8f)) + 4);
|
||||
|
||||
if (target.getObjectType() == Enum.GameObjectType.Building)
|
||||
if (target.getObjectType() == mbEnums.GameObjectType.Building)
|
||||
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) {
|
||||
passiveAnim = getSwingAnimation(attacker.charItemManager.getEquipped().get(slot).template, null, true);
|
||||
}
|
||||
@@ -167,8 +167,8 @@ public enum CombatManager {
|
||||
if (ThreadLocalRandom.current().nextInt(100) > hitChance) {
|
||||
TargetedActionMsg msg = new TargetedActionMsg(attacker, target, 0f, passiveAnim);
|
||||
|
||||
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter)
|
||||
DispatchMessage.dispatchMsgToInterestArea(target, msg, Enum.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
|
||||
DispatchMessage.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
else
|
||||
DispatchMessage.sendToAllInRange(attacker, msg);
|
||||
|
||||
@@ -177,8 +177,8 @@ public enum CombatManager {
|
||||
|
||||
//calculate passive chances only if target is AbstractCharacter
|
||||
|
||||
if (EnumSet.of(Enum.GameObjectType.PlayerCharacter, Enum.GameObjectType.NPC, Enum.GameObjectType.Mob).contains(target.getObjectType())) {
|
||||
Enum.PassiveType passiveType = Enum.PassiveType.None;
|
||||
if (EnumSet.of(mbEnums.GameObjectType.PlayerCharacter, mbEnums.GameObjectType.NPC, mbEnums.GameObjectType.Mob).contains(target.getObjectType())) {
|
||||
mbEnums.PassiveType passiveType = mbEnums.PassiveType.None;
|
||||
int hitRoll = ThreadLocalRandom.current().nextInt(100);
|
||||
|
||||
float dodgeChance = ((AbstractCharacter) target).getPassiveChance("Dodge", attacker.getLevel(), true);
|
||||
@@ -192,18 +192,18 @@ public enum CombatManager {
|
||||
parryChance = Math.max(0, Math.min(75, parryChance));
|
||||
|
||||
if (hitRoll < dodgeChance)
|
||||
passiveType = Enum.PassiveType.Dodge;
|
||||
passiveType = mbEnums.PassiveType.Dodge;
|
||||
else if (hitRoll < blockChance)
|
||||
passiveType = Enum.PassiveType.Block;
|
||||
passiveType = mbEnums.PassiveType.Block;
|
||||
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);
|
||||
|
||||
if (target.getObjectType() == Enum.GameObjectType.PlayerCharacter)
|
||||
DispatchMessage.dispatchMsgToInterestArea(target, msg, Enum.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
if (target.getObjectType() == mbEnums.GameObjectType.PlayerCharacter)
|
||||
DispatchMessage.dispatchMsgToInterestArea(target, msg, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
else
|
||||
DispatchMessage.sendToAllInRange(attacker, msg);
|
||||
|
||||
@@ -218,15 +218,15 @@ public enum CombatManager {
|
||||
|
||||
//get the damage type
|
||||
|
||||
Enum.DamageType damageType;
|
||||
mbEnums.DamageType damageType;
|
||||
|
||||
if (attacker.charItemManager.getEquipped().get(slot) == null) {
|
||||
damageType = Enum.DamageType.CRUSHING;
|
||||
if (attacker.getObjectType().equals(Enum.GameObjectType.Mob))
|
||||
damageType = mbEnums.DamageType.CRUSHING;
|
||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
||||
if (((Mob) attacker).isSiege())
|
||||
damageType = Enum.DamageType.SIEGE;
|
||||
damageType = mbEnums.DamageType.SIEGE;
|
||||
} 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
|
||||
@@ -298,16 +298,16 @@ public enum CombatManager {
|
||||
else
|
||||
((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) {
|
||||
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);
|
||||
DispatchMessage.sendToAllInRange(target, cmm);
|
||||
}
|
||||
DeferredPowerJob dpj = null;
|
||||
|
||||
if (attacker.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
if (attacker.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||
|
||||
dpj = ((PlayerCharacter) attacker).getWeaponPower();
|
||||
|
||||
@@ -326,11 +326,11 @@ public enum CombatManager {
|
||||
|
||||
int wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
|
||||
|
||||
if (weapon.getBonusPercent(Enum.ModType.WeaponSpeed, Enum.SourceType.None) != 0f) //add weapon speed bonus
|
||||
wepSpeed *= (1 + weapon.getBonus(Enum.ModType.WeaponSpeed, Enum.SourceType.None));
|
||||
if (weapon.getBonusPercent(mbEnums.ModType.WeaponSpeed, mbEnums.SourceType.None) != 0f) //add weapon speed bonus
|
||||
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
|
||||
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.None));
|
||||
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None) != 0f) //add effects speed bonus
|
||||
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(mbEnums.ModType.AttackDelay, mbEnums.SourceType.None));
|
||||
|
||||
if (wepSpeed < 10)
|
||||
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();
|
||||
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) {
|
||||
@@ -381,7 +381,7 @@ public enum CombatManager {
|
||||
playerCharacter.setSit(toggle);
|
||||
UpdateStateMsg rwss = new UpdateStateMsg();
|
||||
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))
|
||||
return;
|
||||
|
||||
if (target.isMoving() && target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
|
||||
if (target.isMoving() && target.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))
|
||||
return;
|
||||
|
||||
if (!target.isAlive() || !attacker.isAlive())
|
||||
|
||||
@@ -12,7 +12,7 @@ package engine.gameManager;
|
||||
is loaded from environment variables.
|
||||
*/
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.server.login.LoginServer;
|
||||
import engine.server.world.WorldServer;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -106,7 +106,7 @@ public enum ConfigManager {
|
||||
|
||||
public static final String DEFAULT_DATA_DIR = "mb.data/";
|
||||
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 LoginServer loginServer;
|
||||
public static Map<ConfigManager, Pattern> regex = new HashMap<>();
|
||||
|
||||
@@ -10,8 +10,8 @@ package engine.gameManager;
|
||||
|
||||
import com.zaxxer.hikari.HikariConfig;
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.db.handlers.*;
|
||||
import engine.objects.*;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -176,7 +176,7 @@ public enum DbManager {
|
||||
|
||||
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 (MBServerStatics.SKIP_CACHE_LOGIN)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.devcmd.AbstractDevCmd;
|
||||
import engine.devcmd.cmds.*;
|
||||
import engine.objects.AbstractGameObject;
|
||||
@@ -156,7 +156,7 @@ public enum DevCmdManager {
|
||||
//kill any commands not available to everyone on production server
|
||||
//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);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -80,7 +80,7 @@ public enum GroupManager {
|
||||
groupUpdateMsg.setMessageType(3);
|
||||
groupUpdateMsg.setPlayer(groupMember);
|
||||
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());
|
||||
|
||||
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.setPlayer(groupMember);
|
||||
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);
|
||||
|
||||
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) {
|
||||
@@ -309,7 +309,7 @@ public enum GroupManager {
|
||||
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;
|
||||
|
||||
Group group = getGroup(pc);
|
||||
@@ -343,7 +343,7 @@ public enum GroupManager {
|
||||
int dif = total - (size * amount);
|
||||
|
||||
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.getInventory().remove(item);
|
||||
} else {
|
||||
@@ -351,8 +351,8 @@ public enum GroupManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (item.getObjectType() == Enum.GameObjectType.MobLoot) {
|
||||
if (tar.getObjectType() == Enum.GameObjectType.Mob) {
|
||||
if (item.getObjectType() == mbEnums.GameObjectType.MobLoot) {
|
||||
if (tar.getObjectType() == mbEnums.GameObjectType.Mob) {
|
||||
((Mob) tar).charItemManager.delete(item);
|
||||
} else
|
||||
item.setNumOfItems(0);
|
||||
@@ -372,12 +372,12 @@ public enum GroupManager {
|
||||
ugm.configure();
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(splitPlayer, ugm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
UpdateGoldMsg updateTargetGold = new UpdateGoldMsg(tar);
|
||||
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
|
||||
String text = "Group Split: " + amount;
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.Enum.GuildHistoryType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.BuildingGroup;
|
||||
import engine.mbEnums.GuildHistoryType;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
@@ -89,7 +89,7 @@ public enum GuildManager {
|
||||
|
||||
if (fromTeleportScreen) {
|
||||
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)) {
|
||||
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) {
|
||||
Enum.GuildCharterType charter = guild.getGuildType();
|
||||
mbEnums.GuildCharterType charter = guild.getGuildType();
|
||||
if (charter.requiredClasses.contains(player.absPromotionClass))
|
||||
if (charter.requiredRaces.contains(player.absRace))
|
||||
if (charter.sexRequired.contains(player.absGender))
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.*;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -17,7 +17,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
public enum 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())
|
||||
return true;
|
||||
@@ -33,7 +33,7 @@ public enum ItemManager {
|
||||
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
|
||||
|
||||
@@ -51,14 +51,14 @@ public enum ItemManager {
|
||||
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
|
||||
|
||||
if (item.template.item_disc_req.isEmpty() && item.template.item_disc_res.isEmpty())
|
||||
return true;
|
||||
|
||||
EnumSet<Enum.DisciplineType> workSet = EnumSet.copyOf(discs);
|
||||
EnumSet<mbEnums.DisciplineType> workSet = EnumSet.copyOf(discs);
|
||||
|
||||
if (item.template.item_disc_req.isEmpty() == false) {
|
||||
|
||||
@@ -108,18 +108,18 @@ public enum ItemManager {
|
||||
|
||||
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 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) {
|
||||
|
||||
if (!template.item_type.equals(Enum.ItemType.WEAPON))
|
||||
if (!template.item_type.equals(mbEnums.ItemType.WEAPON))
|
||||
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) {
|
||||
@@ -138,7 +138,7 @@ public enum ItemManager {
|
||||
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;
|
||||
|
||||
@@ -157,18 +157,18 @@ public enum ItemManager {
|
||||
// Two handed weapons take up two slots
|
||||
|
||||
if ((isTwoHanded(item)) &&
|
||||
((slot == Enum.EquipSlotType.LHELD && equipped.get(Enum.EquipSlotType.RHELD) != null) ||
|
||||
(slot == Enum.EquipSlotType.RHELD && equipped.get(Enum.EquipSlotType.LHELD) != null)))
|
||||
((slot == mbEnums.EquipSlotType.LHELD && equipped.get(mbEnums.EquipSlotType.RHELD) != null) ||
|
||||
(slot == mbEnums.EquipSlotType.RHELD && equipped.get(mbEnums.EquipSlotType.LHELD) != null)))
|
||||
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)
|
||||
return false;
|
||||
|
||||
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)
|
||||
return false;
|
||||
@@ -176,7 +176,7 @@ public enum ItemManager {
|
||||
// Early exit for mobiles and NPCS.
|
||||
// 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;
|
||||
|
||||
if (!validForSlot(slot, itemManager.getEquipped(), item))
|
||||
@@ -201,8 +201,8 @@ public enum ItemManager {
|
||||
Item item = new Item(templateID);
|
||||
|
||||
item.ownerID = reciever.getObjectUUID();
|
||||
item.ownerType = Enum.OwnerType.PlayerCharacter;
|
||||
item.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
item.ownerType = mbEnums.OwnerType.PlayerCharacter;
|
||||
item.containerType = mbEnums.ItemContainerType.INVENTORY;
|
||||
item.numberOfItems = amount;
|
||||
|
||||
try {
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.loot.*;
|
||||
import engine.mbEnums;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
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")) {
|
||||
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.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||
chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
|
||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,7 @@ public enum LootManager {
|
||||
if (itemUUID == 0)
|
||||
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);
|
||||
return new MobLoot(mob, ItemTemplate.templates.get(itemUUID), amount, false);
|
||||
}
|
||||
@@ -187,7 +187,7 @@ public enum LootManager {
|
||||
if (selectedRow.pModTable != 0)
|
||||
try {
|
||||
outItem = GeneratePrefix(mob, outItem, genTableID, genRoll, inHotzone);
|
||||
outItem.flags.remove(Enum.ItemFlags.Identified);
|
||||
outItem.flags.remove(mbEnums.ItemFlags.Identified);
|
||||
} catch (Exception e) {
|
||||
Logger.error("Failed to GeneratePrefix for item: " + outItem.getName());
|
||||
}
|
||||
@@ -195,7 +195,7 @@ public enum LootManager {
|
||||
if (selectedRow.sModTable != 0)
|
||||
try {
|
||||
outItem = GenerateSuffix(mob, outItem, genTableID, genRoll, inHotzone);
|
||||
outItem.flags.remove(Enum.ItemFlags.Identified);
|
||||
outItem.flags.remove(mbEnums.ItemFlags.Identified);
|
||||
} catch (Exception e) {
|
||||
Logger.error("Failed to GenerateSuffix for item: " + outItem.getName());
|
||||
}
|
||||
@@ -338,7 +338,7 @@ public enum LootManager {
|
||||
|
||||
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
|
||||
//do equipment here
|
||||
int dropCount = 0;
|
||||
@@ -358,7 +358,7 @@ public enum LootManager {
|
||||
MobLoot ml = new MobLoot(mob, item.template, false);
|
||||
|
||||
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));
|
||||
mob.charItemManager.addItemToInventory(ml);
|
||||
dropCount = 1;
|
||||
@@ -453,7 +453,7 @@ public enum LootManager {
|
||||
if (suffix != null)
|
||||
winnings.addPermanentEnchantment(suffix.action, 0, suffix.level, true);
|
||||
}
|
||||
winnings.flags.add(Enum.ItemFlags.Identified);
|
||||
winnings.flags.add(mbEnums.ItemFlags.Identified);
|
||||
|
||||
//remove gift from inventory
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ package engine.gameManager;
|
||||
// Defines static methods which comprise the magicbane
|
||||
// building maintenance system.
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.objects.Building;
|
||||
import engine.objects.City;
|
||||
import engine.objects.Warehouse;
|
||||
@@ -44,7 +44,7 @@ public enum MaintenanceManager {
|
||||
|
||||
// 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<>();
|
||||
|
||||
maintMap = buildMaintList(buildingList);
|
||||
@@ -119,7 +119,7 @@ public enum MaintenanceManager {
|
||||
|
||||
// No maintenance on NPC owned buildings (Cache loaded)
|
||||
|
||||
if (building.getProtectionState() == Enum.ProtectionState.NPC)
|
||||
if (building.getProtectionState() == mbEnums.ProtectionState.NPC)
|
||||
continue;
|
||||
|
||||
// No maintenance on constructing meshes
|
||||
@@ -141,12 +141,12 @@ public enum MaintenanceManager {
|
||||
|
||||
// No maintenance on banestones omfg
|
||||
|
||||
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.BANESTONE))
|
||||
if (building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.BANESTONE))
|
||||
continue;
|
||||
|
||||
// no maintenance on Mines omfg
|
||||
|
||||
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.MINE))
|
||||
if (building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.MINE))
|
||||
continue;
|
||||
|
||||
// Null Maintenance date?
|
||||
@@ -169,7 +169,7 @@ public enum MaintenanceManager {
|
||||
|
||||
// Add building to maintenance queue
|
||||
|
||||
if (building.getBlueprint().getBuildingGroup().equals(Enum.BuildingGroup.TOL))
|
||||
if (building.getBlueprint().getBuildingGroup().equals(mbEnums.BuildingGroup.TOL))
|
||||
tolList.add(building);
|
||||
else
|
||||
maintList.add(building);
|
||||
@@ -220,14 +220,14 @@ public enum MaintenanceManager {
|
||||
// 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();
|
||||
}
|
||||
|
||||
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.resources.get(Enum.ResourceType.GOLD)) >= overDraft) {
|
||||
(warehouse.resources.get(mbEnums.ResourceType.GOLD)) >= overDraft) {
|
||||
hasFunds = true;
|
||||
}
|
||||
|
||||
@@ -242,22 +242,22 @@ public enum MaintenanceManager {
|
||||
hasResources = false;
|
||||
else {
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.STONE);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.STONE);
|
||||
|
||||
if (resourceValue < 1500)
|
||||
hasResources = false;
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.LUMBER);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.LUMBER);
|
||||
|
||||
if (resourceValue < 1500)
|
||||
hasResources = false;
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.GALVOR);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.GALVOR);
|
||||
|
||||
if (resourceValue < 5)
|
||||
hasResources = false;
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.WORMWOOD);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.WORMWOOD);
|
||||
|
||||
if (resourceValue < 5)
|
||||
hasResources = false;
|
||||
@@ -290,16 +290,16 @@ public enum MaintenanceManager {
|
||||
|
||||
if (overDraft > 0) {
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.GOLD);
|
||||
warehouse.resources.put(Enum.ResourceType.GOLD, resourceValue - overDraft);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.GOLD);
|
||||
warehouse.resources.put(mbEnums.ResourceType.GOLD, resourceValue - overDraft);
|
||||
|
||||
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());
|
||||
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
|
||||
@@ -311,54 +311,54 @@ public enum MaintenanceManager {
|
||||
|
||||
// Withdraw Stone
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.STONE);
|
||||
warehouse.resources.put(Enum.ResourceType.STONE, resourceValue - 1500);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.STONE);
|
||||
warehouse.resources.put(mbEnums.ResourceType.STONE, resourceValue - 1500);
|
||||
|
||||
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());
|
||||
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
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.LUMBER);
|
||||
warehouse.resources.put(Enum.ResourceType.LUMBER, resourceValue - 1500);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.LUMBER);
|
||||
warehouse.resources.put(mbEnums.ResourceType.LUMBER, resourceValue - 1500);
|
||||
|
||||
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());
|
||||
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
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.GALVOR);
|
||||
warehouse.resources.put(Enum.ResourceType.GALVOR, resourceValue - 5);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.GALVOR);
|
||||
warehouse.resources.put(mbEnums.ResourceType.GALVOR, resourceValue - 5);
|
||||
|
||||
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());
|
||||
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
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.WORMWOOD);
|
||||
warehouse.resources.put(Enum.ResourceType.WORMWOOD, resourceValue - 5);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.WORMWOOD);
|
||||
warehouse.resources.put(mbEnums.ResourceType.WORMWOOD, resourceValue - 5);
|
||||
|
||||
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());
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
|
||||
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.exception.MsgSendException;
|
||||
import engine.math.Bounds;
|
||||
import engine.math.Vector3f;
|
||||
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.client.ClientConnection;
|
||||
import engine.net.client.msg.MoveToPointMsg;
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
package engine.gameManager;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.math.Quaternion;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
@@ -66,7 +66,7 @@ public enum NPCManager {
|
||||
|
||||
PetMsg petMsg = new PetMsg(5, null);
|
||||
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)
|
||||
if (necroPet.isPet())
|
||||
necroPet.agentType = Enum.AIAgentType.MOBILE;
|
||||
necroPet.agentType = mbEnums.AIAgentType.MOBILE;
|
||||
}
|
||||
|
||||
public static void spawnNecroPet(PlayerCharacter playerCharacter, Mob mob) {
|
||||
@@ -170,10 +170,10 @@ public enum NPCManager {
|
||||
if (b.getBlueprint() == null)
|
||||
continue;
|
||||
|
||||
if (b.getProtectionState().equals(Enum.ProtectionState.CONTRACT))
|
||||
if (b.getProtectionState().equals(mbEnums.ProtectionState.CONTRACT))
|
||||
protectedBuildings.add(b);
|
||||
|
||||
if (b.getProtectionState().equals(Enum.ProtectionState.PENDING))
|
||||
if (b.getProtectionState().equals(mbEnums.ProtectionState.PENDING))
|
||||
protectedBuildings.add(b);
|
||||
}
|
||||
|
||||
@@ -191,14 +191,14 @@ public enum NPCManager {
|
||||
// to add the NPC to the building's hireling list
|
||||
// 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);
|
||||
else
|
||||
buildingSlot = BuildingManager.getAvailableSlot(abstractCharacter.building);
|
||||
|
||||
// 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;
|
||||
buildingSlot = siegeMobile.guardCaptain.minions.size() + 2;
|
||||
}
|
||||
@@ -265,7 +265,7 @@ public enum NPCManager {
|
||||
float attackSpeedModifier = 1;
|
||||
float powerDamageModifier = 1;
|
||||
//handle stance modifiers for guard mob
|
||||
if (guard.agentType.equals(Enum.AIAgentType.GUARDWALLARCHER)) {
|
||||
if (guard.agentType.equals(mbEnums.AIAgentType.GUARDWALLARCHER)) {
|
||||
//apply rogue bonuses
|
||||
attackRatingModifier += 0.5f;
|
||||
defenseModifier += 0.5f;
|
||||
@@ -273,12 +273,12 @@ public enum NPCManager {
|
||||
attackSpeedModifier -= 0.36f;
|
||||
} else {
|
||||
Integer contractID;
|
||||
if (guard.agentType.equals(Enum.AIAgentType.GUARDMINION)) {
|
||||
if (guard.agentType.equals(mbEnums.AIAgentType.GUARDMINION)) {
|
||||
contractID = guard.guardCaptain.contract.getContractID();
|
||||
} else {
|
||||
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
|
||||
powerDamageModifier += 0.5f;
|
||||
} else {
|
||||
@@ -309,11 +309,11 @@ public enum NPCManager {
|
||||
guard.maxDamageHandOne = (int) ((guard.mobBase.getDamageMax()) * rankModifier);
|
||||
guard.speedHandOne = 30.0f;
|
||||
} else {
|
||||
if (guard.charItemManager.equipped.containsKey(Enum.EquipSlotType.RHELD)) {
|
||||
if (guard.charItemManager.equipped.containsKey(mbEnums.EquipSlotType.RHELD)) {
|
||||
//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();
|
||||
else
|
||||
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.speedHandOne = weapon.template.item_weapon_wepspeed;
|
||||
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
|
||||
Item weapon = guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD);
|
||||
if (weapon.template.item_primary_attr.equals(Enum.AttributeType.Strength))
|
||||
Item weapon = guard.charItemManager.equipped.get(mbEnums.EquipSlotType.LHELD);
|
||||
if (weapon.template.item_primary_attr.equals(mbEnums.AttributeType.Strength))
|
||||
primaryStat = guard.getStatStrCurrent();
|
||||
else
|
||||
primaryStat = guard.getStatDexCurrent();
|
||||
@@ -350,7 +350,7 @@ public enum NPCManager {
|
||||
int baseDef = guard.mobBase.getDefenseRating();
|
||||
int armorDefense = 0;
|
||||
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;
|
||||
guard.defenseRating = dexterity + baseDef + armorDefense;
|
||||
}
|
||||
@@ -358,10 +358,10 @@ public enum NPCManager {
|
||||
public static void setAttackRatingForGuard(Mob guard) {
|
||||
int strength = guard.getStatStrCurrent();
|
||||
int baseAtr = guard.mobBase.getAttackRating();
|
||||
if (guard.charItemManager.equipped.get(Enum.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));
|
||||
else if (guard.charItemManager.equipped.get(Enum.EquipSlotType.LHELD) != null && !ItemManager.isShield(guard.charItemManager.equipped.get(Enum.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));
|
||||
if (guard.charItemManager.equipped.get(mbEnums.EquipSlotType.RHELD) != null)
|
||||
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(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(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
|
||||
guard.atrHandOne = baseAtr;
|
||||
}
|
||||
@@ -440,10 +440,10 @@ public enum NPCManager {
|
||||
return;
|
||||
|
||||
for (Item equipped : mob.charItemManager.equipped.values()) {
|
||||
if (equipped.template.item_type.equals(Enum.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(Enum.DamageType.CRUSHING, mob.resists.getResist(Enum.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"));
|
||||
if (equipped.template.item_type.equals(mbEnums.ItemType.ARMOR)) {
|
||||
mob.resists.setResist(mbEnums.DamageType.SLASHING, mob.resists.getResist(mbEnums.DamageType.SLASHING, 0) + equipped.template.combat_attack_resist.get("SLASHING"));
|
||||
mob.resists.setResist(mbEnums.DamageType.CRUSHING, mob.resists.getResist(mbEnums.DamageType.CRUSHING, 0) + equipped.template.combat_attack_resist.get("CRUSHING"));
|
||||
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
Reference in New Issue
Block a user