forked from MagicBane/Server
Renamed class to not conflict with the java.lang version.
This commit is contained in:
@@ -9,8 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.InterestManager;
|
||||
import engine.InterestManagement.Terrain;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
@@ -25,6 +23,8 @@ import engine.jobs.TrackJob;
|
||||
import engine.math.AtomicFloat;
|
||||
import engine.math.Bounds;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.*;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -130,10 +130,10 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
||||
public ArrayList<CharacterRune> runes;
|
||||
|
||||
|
||||
public Enum.MonsterType absRace;
|
||||
public mbEnums.MonsterType absRace;
|
||||
public ClassType absBaseClass = null;
|
||||
public ClassType absPromotionClass = null;
|
||||
public Enum.SexType absGender = null;
|
||||
public mbEnums.SexType absGender = null;
|
||||
public EnumSet<DisciplineType> absDisciplines;
|
||||
|
||||
// Modifiers
|
||||
@@ -355,7 +355,7 @@ public abstract class AbstractCharacter extends AbstractWorldObject {
|
||||
|
||||
this.bindLoc = new Vector3fImmutable(rs.getFloat("spawnX"), rs.getFloat("spawnY"), rs.getFloat("spawnZ"));
|
||||
|
||||
if (ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER))
|
||||
if (ConfigManager.serverType.equals(mbEnums.ServerType.WORLDSERVER))
|
||||
this.setLoc(this.bindLoc);
|
||||
this.endLoc = Vector3fImmutable.ZERO;
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.job.JobContainer;
|
||||
import engine.job.JobScheduler;
|
||||
import engine.jobs.DatabaseUpdateJob;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
package engine.objects;
|
||||
|
||||
import ch.claude_martin.enumbitset.EnumBitSet;
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.ModType;
|
||||
import engine.mbEnums.SourceType;
|
||||
import engine.mobileAI.Threads.MobAIThread;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -31,13 +31,13 @@ import java.util.ArrayList;
|
||||
public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
||||
protected Vector3fImmutable lastBindLoc;
|
||||
public boolean assist = false;
|
||||
public Enum.AIAgentType agentType = Enum.AIAgentType.MOBILE;
|
||||
public mbEnums.AIAgentType agentType = mbEnums.AIAgentType.MOBILE;
|
||||
|
||||
public AbstractCharacter guardCaptain;
|
||||
public EnumBitSet<Enum.MonsterType> notEnemy = EnumBitSet.noneOf(Enum.MonsterType.class);
|
||||
public EnumBitSet<Enum.MonsterType> enemy = EnumBitSet.noneOf(Enum.MonsterType.class);
|
||||
public EnumBitSet<mbEnums.MonsterType> notEnemy = EnumBitSet.noneOf(mbEnums.MonsterType.class);
|
||||
public EnumBitSet<mbEnums.MonsterType> enemy = EnumBitSet.noneOf(mbEnums.MonsterType.class);
|
||||
;
|
||||
public Enum.MobBehaviourType behaviourType;
|
||||
public mbEnums.MobBehaviourType behaviourType;
|
||||
public ArrayList<Vector3fImmutable> patrolPoints;
|
||||
public int lastPatrolPointIndex = 0;
|
||||
public long stopPatrolTime = 0;
|
||||
@@ -96,9 +96,9 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
||||
public void setPet(PlayerCharacter owner, boolean summoned) {
|
||||
|
||||
if (summoned)
|
||||
this.agentType = Enum.AIAgentType.PET; //summoned
|
||||
this.agentType = mbEnums.AIAgentType.PET; //summoned
|
||||
else
|
||||
this.agentType = Enum.AIAgentType.CHARMED;
|
||||
this.agentType = mbEnums.AIAgentType.CHARMED;
|
||||
|
||||
if (this.getObjectType().equals(GameObjectType.Mob)) {
|
||||
|
||||
@@ -109,8 +109,8 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
||||
|
||||
public boolean isPet() {
|
||||
|
||||
return (this.agentType.equals(Enum.AIAgentType.PET) ||
|
||||
this.agentType.equals(Enum.AIAgentType.CHARMED));
|
||||
return (this.agentType.equals(mbEnums.AIAgentType.PET) ||
|
||||
this.agentType.equals(mbEnums.AIAgentType.CHARMED));
|
||||
}
|
||||
|
||||
public void toggleAssist() {
|
||||
@@ -150,7 +150,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
||||
|
||||
if (this.isPet()) {
|
||||
|
||||
if ((this.agentType.equals(Enum.AIAgentType.PET))) { //delete summoned pet
|
||||
if ((this.agentType.equals(mbEnums.AIAgentType.PET))) { //delete summoned pet
|
||||
|
||||
WorldGrid.RemoveWorldObject(this);
|
||||
|
||||
@@ -159,7 +159,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
||||
((Mob) this).getParentZone().zoneMobSet.remove(this);
|
||||
|
||||
} else { //revert charmed pet
|
||||
this.agentType = Enum.AIAgentType.MOBILE;
|
||||
this.agentType = mbEnums.AIAgentType.MOBILE;
|
||||
this.setCombatTarget(null);
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ public abstract class AbstractIntelligenceAgent extends AbstractCharacter {
|
||||
|
||||
PetMsg petMsg = new PetMsg(5, null);
|
||||
Dispatch dispatch = Dispatch.borrow(owner, petMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
if (pet != null && pet.getObjectUUID() == this.getObjectUUID())
|
||||
owner.setPet(null);
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.Enum.EffectSourceType;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.GridObjectType;
|
||||
import engine.InterestManagement.Terrain;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.job.AbstractScheduleJob;
|
||||
@@ -23,6 +19,10 @@ import engine.math.AtomicFloat;
|
||||
import engine.math.Bounds;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.mbEnums.EffectSourceType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.GridObjectType;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.Enum.ItemContainerType;
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.NPCManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.mbEnums.ItemContainerType;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
@@ -42,7 +42,7 @@ public class Account extends AbstractGameObject {
|
||||
public HashMap<Integer, PlayerCharacter> characterMap = new HashMap<>();
|
||||
public Item vaultGold = null;
|
||||
public long lastPasswordCheck = 0;
|
||||
public Enum.AccountStatus status;
|
||||
public mbEnums.AccountStatus status;
|
||||
private String passwd;
|
||||
private int lastCharIDUsed;
|
||||
private String salt;
|
||||
@@ -58,7 +58,7 @@ public class Account extends AbstractGameObject {
|
||||
this.lastCharIDUsed = resultSet.getInt("acct_lastCharUID");
|
||||
this.salt = resultSet.getString("acct_salt");
|
||||
this.discordAccount = resultSet.getString("discordAccount");
|
||||
this.status = Enum.AccountStatus.valueOf(resultSet.getString("status"));
|
||||
this.status = mbEnums.AccountStatus.valueOf(resultSet.getString("status"));
|
||||
}
|
||||
|
||||
public ArrayList<Item> getVault() {
|
||||
@@ -161,7 +161,7 @@ public class Account extends AbstractGameObject {
|
||||
|
||||
try {
|
||||
|
||||
if (ConfigManager.serverType.equals(Enum.ServerType.LOGINSERVER)) {
|
||||
if (ConfigManager.serverType.equals(mbEnums.ServerType.LOGINSERVER)) {
|
||||
ArrayList<PlayerCharacter> playerList = DbManager.PlayerCharacterQueries.GET_CHARACTERS_FOR_ACCOUNT(this.getObjectUUID());
|
||||
|
||||
for (PlayerCharacter player : playerList) {
|
||||
@@ -172,11 +172,11 @@ public class Account extends AbstractGameObject {
|
||||
playerList.clear();
|
||||
}
|
||||
|
||||
if (ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER)) {
|
||||
if (ConfigManager.serverType.equals(mbEnums.ServerType.WORLDSERVER)) {
|
||||
this.vault = DbManager.ItemQueries.GET_ITEMS_FOR_ACCOUNT(this.getObjectUUID());
|
||||
|
||||
for (Item item : this.vault) {
|
||||
if (item.template.item_type.equals(Enum.ItemType.GOLD)) {
|
||||
if (item.template.item_type.equals(mbEnums.ItemType.GOLD)) {
|
||||
this.vaultGold = item;
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ public class Account extends AbstractGameObject {
|
||||
if (!item.validForInventory(origin, player, player.charItemManager))
|
||||
return;
|
||||
|
||||
if (item.containerType == Enum.ItemContainerType.INVENTORY && player.charItemManager.isVaultOpen()) {
|
||||
if (item.containerType == mbEnums.ItemContainerType.INVENTORY && player.charItemManager.isVaultOpen()) {
|
||||
if (!player.charItemManager.hasRoomVault(item.template.item_wt)) {
|
||||
ItemToVaultMsgHandler.forceTransferFromVaultToInventory(msg, origin, "There is no room in your vault.");
|
||||
return;
|
||||
@@ -265,7 +265,7 @@ public class Account extends AbstractGameObject {
|
||||
if (!item.validForVault(origin, player, itemManager))
|
||||
return;
|
||||
|
||||
if (item.containerType == Enum.ItemContainerType.VAULT && itemManager.isVaultOpen()) {
|
||||
if (item.containerType == mbEnums.ItemContainerType.VAULT && itemManager.isVaultOpen()) {
|
||||
if (!itemManager.hasRoomInventory(item.template.item_wt)) {
|
||||
ItemFromVaultMsgHandler.forceTransferFromInventoryToVault(msg, origin, "There is no room in your inventory.");
|
||||
return;
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ProtectionState;
|
||||
import engine.Enum.SiegePhase;
|
||||
import engine.Enum.SiegeResult;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.db.archive.BaneRecord;
|
||||
import engine.db.archive.DataWarehouse;
|
||||
@@ -24,6 +20,10 @@ import engine.job.JobScheduler;
|
||||
import engine.jobs.ActivateBaneJob;
|
||||
import engine.jobs.BaneDefaultTimeJob;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ProtectionState;
|
||||
import engine.mbEnums.SiegePhase;
|
||||
import engine.mbEnums.SiegeResult;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
import engine.net.client.msg.PlaceAssetMsg;
|
||||
@@ -256,13 +256,13 @@ public final class Bane {
|
||||
|
||||
ChatSystemMsg chatMsg = new ChatSystemMsg(null, "[Bane Channel] " + targetCity.getCityName() + " has been baned by " + baningGuild.getName() + ". Standoff phase has begun!");
|
||||
chatMsg.setMessageType(4);
|
||||
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||
chatMsg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
|
||||
|
||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
||||
|
||||
// Push this event to the DataWarehouse
|
||||
|
||||
BaneRecord baneRecord = BaneRecord.borrow(bane, Enum.RecordEventType.PENDING);
|
||||
BaneRecord baneRecord = BaneRecord.borrow(bane, mbEnums.RecordEventType.PENDING);
|
||||
DataWarehouse.pushToWarehouse(baneRecord);
|
||||
|
||||
return true;
|
||||
@@ -403,7 +403,7 @@ public final class Bane {
|
||||
}
|
||||
|
||||
public PlayerCharacter getOwner() {
|
||||
return (PlayerCharacter) DbManager.getObject(Enum.GameObjectType.PlayerCharacter, ownerUUID);
|
||||
return (PlayerCharacter) DbManager.getObject(mbEnums.GameObjectType.PlayerCharacter, ownerUUID);
|
||||
}
|
||||
|
||||
public boolean remove() {
|
||||
@@ -538,7 +538,7 @@ public final class Bane {
|
||||
|
||||
// Push event to warehouse
|
||||
|
||||
BaneRecord.updateResolution(this, Enum.RecordEventType.DEFEND);
|
||||
BaneRecord.updateResolution(this, mbEnums.RecordEventType.DEFEND);
|
||||
|
||||
baneRemoved = remove();
|
||||
|
||||
@@ -552,7 +552,7 @@ public final class Bane {
|
||||
|
||||
ChatSystemMsg msg = new ChatSystemMsg(null, "[Bane Channel]" + this.getCity().getGuild().getName() + " has rallied against " + this.getOwner().getGuild().getName() + ". The siege on " + this.getCity().getCityName() + " has been broken!");
|
||||
msg.setMessageType(4);
|
||||
msg.setChannel(engine.Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||
msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
|
||||
|
||||
DispatchMessage.dispatchMsgToAll(msg);
|
||||
|
||||
@@ -563,7 +563,7 @@ public final class Bane {
|
||||
|
||||
// Push event to warehouse
|
||||
|
||||
BaneRecord.updateResolution(this, Enum.RecordEventType.CAPTURE);
|
||||
BaneRecord.updateResolution(this, mbEnums.RecordEventType.CAPTURE);
|
||||
|
||||
baneRemoved = this.remove();
|
||||
|
||||
@@ -571,7 +571,7 @@ public final class Bane {
|
||||
|
||||
ChatSystemMsg msg = new ChatSystemMsg(null, "[Bane Channel]" + this.getOwner().getGuild().getName() + " have defeated " + this.getCity().getGuild().getName() + " and captured " + this.getCity().getCityName() + '!');
|
||||
msg.setMessageType(4);
|
||||
msg.setChannel(engine.Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||
msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
|
||||
|
||||
DispatchMessage.dispatchMsgToAll(msg);
|
||||
}
|
||||
@@ -580,7 +580,7 @@ public final class Bane {
|
||||
|
||||
// Push event to warehouse
|
||||
|
||||
BaneRecord.updateResolution(this, Enum.RecordEventType.DESTROY);
|
||||
BaneRecord.updateResolution(this, mbEnums.RecordEventType.DESTROY);
|
||||
|
||||
baneRemoved = this.remove();
|
||||
|
||||
@@ -588,7 +588,7 @@ public final class Bane {
|
||||
|
||||
ChatSystemMsg msg = new ChatSystemMsg(null, "[Bane Channel]" + this.getOwner().getGuild().getName() + " have defeated " + this.getCity().getGuild().getName() + " and razed " + this.getCity().getCityName() + '!');
|
||||
msg.setMessageType(4);
|
||||
msg.setChannel(engine.Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||
msg.setChannel(mbEnums.ChatChannelType.SYSTEM.getChannelID());
|
||||
|
||||
DispatchMessage.dispatchMsgToAll(msg);
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@ package engine.objects;
|
||||
// www.magicbane.com
|
||||
|
||||
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.math.Vector2f;
|
||||
import engine.mbEnums.BuildingGroup;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.RealmMap;
|
||||
import engine.InterestManagement.Terrain;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
@@ -27,6 +25,8 @@ import engine.jobs.SiegeSpireWithdrawlJob;
|
||||
import engine.math.Bounds;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.*;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ApplyBuildingEffectMsg;
|
||||
@@ -1502,7 +1502,7 @@ public class Building extends AbstractWorldObject {
|
||||
if (!DbManager.BuildingQueries.acceptTaxes(this))
|
||||
return false;
|
||||
|
||||
this.setProtectionState(Enum.ProtectionState.CONTRACT);
|
||||
this.setProtectionState(mbEnums.ProtectionState.CONTRACT);
|
||||
this.taxDateTime = LocalDateTime.now().plusDays(7);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.gameManager.*;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.ItemType;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
@@ -36,7 +36,7 @@ public class CharacterItemManager {
|
||||
private final ConcurrentHashMap<Integer, Integer> itemIDtoType = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
// Mapping of all items equipped in this Manager
|
||||
// Key = Item Slot
|
||||
public ConcurrentHashMap<Enum.EquipSlotType, Item> equipped = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
public ConcurrentHashMap<mbEnums.EquipSlotType, Item> equipped = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
private final HashSet<Item> inventory = new HashSet<>();
|
||||
private final HashSet<Item> bank = new HashSet<>();
|
||||
private final HashSet<Item> vault = new HashSet<>();
|
||||
@@ -73,7 +73,7 @@ public class CharacterItemManager {
|
||||
|
||||
public void loadGoldItems() {
|
||||
|
||||
if (ConfigManager.serverType.equals(Enum.ServerType.LOGINSERVER)) {
|
||||
if (ConfigManager.serverType.equals(mbEnums.ServerType.LOGINSERVER)) {
|
||||
//other server, just make generic
|
||||
this.goldInventory = new MobLoot(this.absCharacter, 0);
|
||||
this.goldBank = new MobLoot(this.absCharacter, 0);
|
||||
@@ -84,14 +84,14 @@ public class CharacterItemManager {
|
||||
//create inventory gold if needed
|
||||
if (this.goldInventory == null)
|
||||
if (this.absCharacter != null && (this.absCharacter.getObjectType().equals(GameObjectType.PlayerCharacter) || this.absCharacter.getObjectType().equals(GameObjectType.NPC)))
|
||||
this.goldInventory = Item.newGoldItem(this.absCharacter, Enum.ItemContainerType.INVENTORY);
|
||||
this.goldInventory = Item.newGoldItem(this.absCharacter, mbEnums.ItemContainerType.INVENTORY);
|
||||
else
|
||||
this.goldInventory = new MobLoot(this.absCharacter, 0);
|
||||
|
||||
//create bank gold if needed
|
||||
if (this.goldBank == null)
|
||||
if (this.absCharacter != null && this.absCharacter.getObjectType().equals(GameObjectType.PlayerCharacter))
|
||||
this.goldBank = Item.newGoldItem(this.absCharacter, Enum.ItemContainerType.BANK);
|
||||
this.goldBank = Item.newGoldItem(this.absCharacter, mbEnums.ItemContainerType.BANK);
|
||||
else
|
||||
this.goldBank = new MobLoot(this.absCharacter, 0);
|
||||
|
||||
@@ -115,7 +115,7 @@ public class CharacterItemManager {
|
||||
this.account = ((PlayerCharacter) this.absCharacter).getAccount();
|
||||
|
||||
// Get Items for player and vault
|
||||
if (ConfigManager.serverType.equals(Enum.ServerType.LOGINSERVER)) //login, only need equipped items
|
||||
if (ConfigManager.serverType.equals(mbEnums.ServerType.LOGINSERVER)) //login, only need equipped items
|
||||
al = DbManager.ItemQueries.GET_EQUIPPED_ITEMS(this.absCharacter.getObjectUUID());
|
||||
else
|
||||
al = DbManager.ItemQueries.GET_ITEMS_FOR_PC(this.absCharacter.getObjectUUID());
|
||||
@@ -300,7 +300,7 @@ public class CharacterItemManager {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!Warehouse.withdraw(warehouse, (PlayerCharacter) this.absCharacter, Enum.ResourceType.GOLD, amount * -1, true, true)) {
|
||||
if (!Warehouse.withdraw(warehouse, (PlayerCharacter) this.absCharacter, mbEnums.ResourceType.GOLD, amount * -1, true, true)) {
|
||||
|
||||
ErrorPopupMsg.sendErrorPopup((PlayerCharacter) this.absCharacter, 203);
|
||||
return false;
|
||||
@@ -365,7 +365,7 @@ public class CharacterItemManager {
|
||||
ugm.configure();
|
||||
|
||||
Dispatch dispatch = Dispatch.borrow(player, ugm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -393,7 +393,7 @@ public class CharacterItemManager {
|
||||
return false;
|
||||
|
||||
dispatch = Dispatch.borrow(target, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -403,7 +403,7 @@ public class CharacterItemManager {
|
||||
Dispatch dispatch;
|
||||
|
||||
dispatch = Dispatch.borrow(requester, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
|
||||
}
|
||||
@@ -431,10 +431,10 @@ public class CharacterItemManager {
|
||||
if (playerA.lastBuildingAccessed != 0) {
|
||||
ManageCityAssetsMsg mca = new ManageCityAssetsMsg();
|
||||
mca.actionType = 4;
|
||||
mca.setTargetType(Enum.GameObjectType.Building.ordinal());
|
||||
mca.setTargetType(mbEnums.GameObjectType.Building.ordinal());
|
||||
mca.setTargetID(playerA.lastBuildingAccessed);
|
||||
Dispatch dispatch = Dispatch.borrow(playerA, mca);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
playerA.lastBuildingAccessed = 0;
|
||||
}
|
||||
|
||||
@@ -459,10 +459,10 @@ public class CharacterItemManager {
|
||||
man2.getTradeCommitted());
|
||||
|
||||
dispatch = Dispatch.borrow((PlayerCharacter) this.getOwner(), modify);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
dispatch = Dispatch.borrow((PlayerCharacter) man2.getOwner(), modify);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -486,7 +486,7 @@ public class CharacterItemManager {
|
||||
CloseTradeWindowMsg closeMsg = new CloseTradeWindowMsg(source, tradeID);
|
||||
|
||||
dispatch = Dispatch.borrow(source, closeMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
if (!sourceTrade) {
|
||||
sourceItemMan.endTrade();
|
||||
@@ -601,7 +601,7 @@ public class CharacterItemManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.doesCharOwnThisItem(i.getObjectUUID()) == false && this.absCharacter.getObjectType() != GameObjectType.Mob && (i.containerType != Enum.ItemContainerType.FORGE))
|
||||
if (this.doesCharOwnThisItem(i.getObjectUUID()) == false && this.absCharacter.getObjectType() != GameObjectType.Mob && (i.containerType != mbEnums.ItemContainerType.FORGE))
|
||||
return false;
|
||||
|
||||
// remove it from other lists:
|
||||
@@ -632,7 +632,7 @@ public class CharacterItemManager {
|
||||
synchronized (this) {
|
||||
|
||||
//Skip if NOT in vault.
|
||||
if (item.containerType != Enum.ItemContainerType.VAULT)
|
||||
if (item.containerType != mbEnums.ItemContainerType.VAULT)
|
||||
if (this.doesCharOwnThisItem(item.getObjectUUID()) == false)
|
||||
return false;
|
||||
|
||||
@@ -907,7 +907,7 @@ public class CharacterItemManager {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equipItem(Item i, Enum.EquipSlotType slot) {
|
||||
public boolean equipItem(Item i, mbEnums.EquipSlotType slot) {
|
||||
|
||||
synchronized (this) {
|
||||
|
||||
@@ -1369,7 +1369,7 @@ public class CharacterItemManager {
|
||||
return equipped.containsValue(i);
|
||||
}
|
||||
|
||||
public synchronized Item getItemFromEquipped(Enum.EquipSlotType slot) {
|
||||
public synchronized Item getItemFromEquipped(mbEnums.EquipSlotType slot) {
|
||||
return equipped.get(slot);
|
||||
}
|
||||
|
||||
@@ -1470,9 +1470,9 @@ public class CharacterItemManager {
|
||||
return false;
|
||||
|
||||
|
||||
for (Enum.EquipSlotType slot : this.equipped.keySet()) {
|
||||
for (mbEnums.EquipSlotType slot : this.equipped.keySet()) {
|
||||
|
||||
if (slot == Enum.EquipSlotType.HAIR || slot == Enum.EquipSlotType.BEARD)
|
||||
if (slot == mbEnums.EquipSlotType.HAIR || slot == mbEnums.EquipSlotType.BEARD)
|
||||
continue;
|
||||
|
||||
Item item = this.equipped.get(slot);
|
||||
@@ -1498,13 +1498,13 @@ public class CharacterItemManager {
|
||||
*
|
||||
* @return the equipped
|
||||
*/
|
||||
public ConcurrentHashMap<Enum.EquipSlotType, Item> getEquipped() {
|
||||
public ConcurrentHashMap<mbEnums.EquipSlotType, Item> getEquipped() {
|
||||
synchronized (this.equipped) {
|
||||
return new ConcurrentHashMap<>(this.equipped);
|
||||
}
|
||||
}
|
||||
|
||||
public Item getEquipped(Enum.EquipSlotType slot) {
|
||||
public Item getEquipped(mbEnums.EquipSlotType slot) {
|
||||
synchronized (this.equipped) {
|
||||
return this.equipped.get(slot);
|
||||
}
|
||||
@@ -1600,7 +1600,7 @@ public class CharacterItemManager {
|
||||
|
||||
//MobLoot
|
||||
item.zeroItem();
|
||||
item.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
item.containerType = mbEnums.ItemContainerType.INVENTORY;
|
||||
|
||||
if (item.template.item_type.equals(ItemType.GOLD))
|
||||
//only add gold item once
|
||||
@@ -1613,7 +1613,7 @@ public class CharacterItemManager {
|
||||
item.setNumOfItems(0);
|
||||
MobLoot ml = new MobLoot(this.absCharacter, amt);
|
||||
ml.zeroItem();
|
||||
ml.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
ml.containerType = mbEnums.ItemContainerType.INVENTORY;
|
||||
if (!corpse.hasGold()) {
|
||||
corpse.setHasGold(true);
|
||||
newInventory.add(ml);
|
||||
@@ -1829,11 +1829,11 @@ public class CharacterItemManager {
|
||||
|
||||
UpdateInventoryMsg updateInventoryMsg = new UpdateInventoryMsg(inventory, this.getBank(), this.getGoldInventory(), add);
|
||||
Dispatch dispatch = Dispatch.borrow(pc, updateInventoryMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
}
|
||||
|
||||
public void forceToInventory(Enum.EquipSlotType slot, Item item, PlayerCharacter player, boolean initialized) {
|
||||
public void forceToInventory(mbEnums.EquipSlotType slot, Item item, PlayerCharacter player, boolean initialized) {
|
||||
|
||||
if (item == null || player == null)
|
||||
return;
|
||||
@@ -1854,7 +1854,7 @@ public class CharacterItemManager {
|
||||
|
||||
if (initialized) {
|
||||
TransferItemFromEquipToInventoryMsg back = new TransferItemFromEquipToInventoryMsg(player, slot);
|
||||
DispatchMessage.dispatchMsgToInterestArea(player, back, engine.Enum.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
DispatchMessage.dispatchMsgToInterestArea(player, back, mbEnums.DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, true, false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2005,7 +2005,7 @@ public class CharacterItemManager {
|
||||
return;
|
||||
|
||||
//verify the item is equipped by this player
|
||||
Enum.EquipSlotType slot = item.equipSlot;
|
||||
mbEnums.EquipSlotType slot = item.equipSlot;
|
||||
|
||||
if (!this.equipped.containsKey(slot))
|
||||
return;
|
||||
@@ -2046,7 +2046,7 @@ public class CharacterItemManager {
|
||||
|
||||
ItemHealthUpdateMsg itemHealthUpdateMsg = new ItemHealthUpdateMsg(slot.ordinal(), (float) dur);
|
||||
Dispatch dispatch = Dispatch.borrow(pc, itemHealthUpdateMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.powers.PowersBase;
|
||||
@@ -99,7 +99,7 @@ public class CharacterPower extends AbstractGameObject {
|
||||
* Don't Call this directly. Instead call pc.calculateSkills().
|
||||
*/
|
||||
public static void calculatePowers(AbstractCharacter absChar) {
|
||||
if (absChar == null || absChar.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) == false)
|
||||
if (absChar == null || absChar.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter) == false)
|
||||
return;
|
||||
|
||||
PlayerCharacter pc = (PlayerCharacter) absChar;
|
||||
@@ -245,7 +245,7 @@ public class CharacterPower extends AbstractGameObject {
|
||||
}
|
||||
|
||||
public static void grantTrains(AbstractCharacter absChar) {
|
||||
if (absChar == null || absChar.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) == false)
|
||||
if (absChar == null || absChar.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter) == false)
|
||||
return;
|
||||
|
||||
PlayerCharacter pc = (PlayerCharacter) absChar;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ApplyRuneMsg;
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ModType;
|
||||
import engine.mbEnums.SourceType;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -260,7 +260,7 @@ public class CharacterSkill extends AbstractGameObject {
|
||||
this.numTrains.set(trains);
|
||||
this.ownerUID = mob.getObjectUUID();
|
||||
this.isMobOwner = true;
|
||||
boolean isGuard = mob.agentType.equals(Enum.AIAgentType.GUARDCAPTAIN) || mob.agentType.equals(Enum.AIAgentType.GUARDMINION);
|
||||
boolean isGuard = mob.agentType.equals(mbEnums.AIAgentType.GUARDCAPTAIN) || mob.agentType.equals(mbEnums.AIAgentType.GUARDMINION);
|
||||
calculateMobBaseAmount(isGuard);
|
||||
calculateModifiedAmount(isGuard);
|
||||
|
||||
@@ -388,8 +388,8 @@ public class CharacterSkill extends AbstractGameObject {
|
||||
int available = 0;
|
||||
|
||||
//get racial bonus;
|
||||
if (pc.race.getRaceType().equals(Enum.RaceType.HUMANMALE) ||
|
||||
pc.race.getRaceType().equals(Enum.RaceType.HUMANFEMALE))
|
||||
if (pc.race.getRaceType().equals(mbEnums.RaceType.HUMANMALE) ||
|
||||
pc.race.getRaceType().equals(mbEnums.RaceType.HUMANFEMALE))
|
||||
raceBonus = 1; //Human racial bonus;
|
||||
|
||||
//get base class trains
|
||||
@@ -481,7 +481,7 @@ public class CharacterSkill extends AbstractGameObject {
|
||||
* Don't Call this directly. Instead call pc.calculateSkills().
|
||||
*/
|
||||
public static void calculateSkills(AbstractCharacter absChar) {
|
||||
if (absChar == null && absChar.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) == false)
|
||||
if (absChar == null && absChar.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter) == false)
|
||||
return;
|
||||
|
||||
PlayerCharacter pc = (PlayerCharacter) absChar;
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.RealmMap;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.db.archive.CityRecord;
|
||||
@@ -20,6 +18,8 @@ import engine.math.Bounds;
|
||||
import engine.math.FastMath;
|
||||
import engine.math.Vector2f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.*;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -287,7 +287,7 @@ public class City extends AbstractWorldObject {
|
||||
city = City.getCity(cityID);
|
||||
|
||||
if (city == null)
|
||||
return Enum.Ruins.getRandomRuin().getLocation();
|
||||
return mbEnums.Ruins.getRandomRuin().getLocation();
|
||||
|
||||
return city.getBindLoc();
|
||||
}
|
||||
@@ -301,7 +301,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
Guild pcG = pc.getGuild();
|
||||
|
||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(Enum.GameObjectType.City);
|
||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
||||
|
||||
//add npc cities
|
||||
|
||||
@@ -375,7 +375,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
Guild pcG = playerCharacter.getGuild();
|
||||
|
||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(Enum.GameObjectType.City);
|
||||
ConcurrentHashMap<Integer, AbstractGameObject> worldCities = DbManager.getMap(mbEnums.GameObjectType.City);
|
||||
|
||||
//add npc cities
|
||||
|
||||
@@ -440,7 +440,7 @@ public class City extends AbstractWorldObject {
|
||||
if (cityId == 0)
|
||||
return null;
|
||||
|
||||
City city = (City) DbManager.getFromCache(Enum.GameObjectType.City, cityId);
|
||||
City city = (City) DbManager.getFromCache(mbEnums.GameObjectType.City, cityId);
|
||||
|
||||
if (city != null)
|
||||
return city;
|
||||
@@ -454,7 +454,7 @@ public class City extends AbstractWorldObject {
|
||||
if (cityId == 0)
|
||||
return null;
|
||||
|
||||
return (City) DbManager.getFromCache(Enum.GameObjectType.City, cityId);
|
||||
return (City) DbManager.getFromCache(mbEnums.GameObjectType.City, cityId);
|
||||
}
|
||||
|
||||
public boolean renameCity(String cityName) {
|
||||
@@ -723,7 +723,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
Bounds cityBounds = Bounds.borrow();
|
||||
cityBounds.setBounds(new Vector2f(this.location.x + 64, this.location.z + 64), // location x and z are offset by 64 from the center of the city.
|
||||
new Vector2f(Enum.CityBoundsType.GRID.halfExtents, Enum.CityBoundsType.GRID.halfExtents),
|
||||
new Vector2f(mbEnums.CityBoundsType.GRID.halfExtents, mbEnums.CityBoundsType.GRID.halfExtents),
|
||||
0.0f);
|
||||
this.setBounds(cityBounds);
|
||||
|
||||
@@ -775,12 +775,12 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
// Add city entry to data warehouse if newly created
|
||||
|
||||
if ((ConfigManager.serverType.equals(Enum.ServerType.WORLDSERVER)) && (this.getHash() == null)) {
|
||||
if ((ConfigManager.serverType.equals(mbEnums.ServerType.WORLDSERVER)) && (this.getHash() == null)) {
|
||||
|
||||
this.setHash();
|
||||
|
||||
if (DataWarehouse.recordExists(Enum.DataRecordType.CITY, this.getObjectUUID()) == false) {
|
||||
CityRecord cityRecord = CityRecord.borrow(this, Enum.RecordEventType.CREATE);
|
||||
if (DataWarehouse.recordExists(mbEnums.DataRecordType.CITY, this.getObjectUUID()) == false) {
|
||||
CityRecord cityRecord = CityRecord.borrow(this, mbEnums.RecordEventType.CREATE);
|
||||
DataWarehouse.pushToWarehouse(cityRecord);
|
||||
}
|
||||
}
|
||||
@@ -1225,7 +1225,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
}
|
||||
this.setForceRename(true);
|
||||
CityRecord cityRecord = CityRecord.borrow(this, Enum.RecordEventType.TRANSFER);
|
||||
CityRecord cityRecord = CityRecord.borrow(this, mbEnums.RecordEventType.TRANSFER);
|
||||
DataWarehouse.pushToWarehouse(cityRecord);
|
||||
return true;
|
||||
|
||||
@@ -1258,7 +1258,7 @@ public class City extends AbstractWorldObject {
|
||||
|
||||
// Write hash to player character table
|
||||
|
||||
DataWarehouse.writeHash(Enum.DataRecordType.CITY, this.getObjectUUID());
|
||||
DataWarehouse.writeHash(mbEnums.DataRecordType.CITY, this.getObjectUUID());
|
||||
}
|
||||
|
||||
public boolean setRealmTaxDate(LocalDateTime realmTaxDate) {
|
||||
@@ -1392,9 +1392,9 @@ public class City extends AbstractWorldObject {
|
||||
vrm.setWarehouseBuilding(BuildingManager.getBuildingFromCache(building.getCity().warehouse.building.getObjectUUID()));
|
||||
vrm.configure();
|
||||
Dispatch dispatch = Dispatch.borrow(player, vrm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
package engine.objects;
|
||||
|
||||
import ch.claude_martin.enumbitset.EnumBitSet;
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
@@ -36,7 +36,7 @@ public class Contract extends AbstractGameObject {
|
||||
private ArrayList<Integer> npcModSuffixTable = new ArrayList<>();
|
||||
private ArrayList<Byte> itemModTable = new ArrayList<>();
|
||||
private ArrayList<Item> sellInventory = new ArrayList<>();
|
||||
private EnumBitSet<Enum.BuildingGroup> allowedBuildings;
|
||||
private EnumBitSet<mbEnums.BuildingGroup> allowedBuildings;
|
||||
private ArrayList<Integer> buyItemType = new ArrayList<>();
|
||||
private ArrayList<Integer> buySkillToken = new ArrayList<>();
|
||||
private ArrayList<Integer> buyUnknownToken = new ArrayList<>();
|
||||
@@ -85,7 +85,7 @@ public class Contract extends AbstractGameObject {
|
||||
this.vendorDialog = VendorDialog.getVendorDialog(rs.getInt("dialogID"));
|
||||
this.iconID = rs.getInt("iconID");
|
||||
this.vendorID = rs.getInt("vendorID");
|
||||
this.allowedBuildings = EnumBitSet.asEnumBitSet(rs.getLong("allowedBuildingTypeID"), Enum.BuildingGroup.class);
|
||||
this.allowedBuildings = EnumBitSet.asEnumBitSet(rs.getLong("allowedBuildingTypeID"), mbEnums.BuildingGroup.class);
|
||||
this.equipmentSet = rs.getInt("equipSetID");
|
||||
this.inventorySet = rs.getInt("inventorySet");
|
||||
|
||||
@@ -220,7 +220,7 @@ public class Contract extends AbstractGameObject {
|
||||
DbManager.ContractQueries.updateDatabase(this);
|
||||
}
|
||||
|
||||
public EnumBitSet<Enum.BuildingGroup> getAllowedBuildings() {
|
||||
public EnumBitSet<mbEnums.BuildingGroup> getAllowedBuildings() {
|
||||
return allowedBuildings;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.GridObjectType;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.exception.SerializationException;
|
||||
import engine.gameManager.BuildingManager;
|
||||
@@ -19,6 +16,9 @@ import engine.gameManager.DbManager;
|
||||
import engine.job.JobContainer;
|
||||
import engine.job.JobScheduler;
|
||||
import engine.jobs.RemoveCorpseJob;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.GridObjectType;
|
||||
import engine.mbEnums.ItemType;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.UnloadObjectsMsg;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.EffectSourceType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.EffectSourceType;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.job.AbstractJob;
|
||||
import engine.job.AbstractScheduleJob;
|
||||
@@ -592,7 +592,7 @@ public class Effect {
|
||||
}
|
||||
|
||||
//Used for verifying when damage absorbers fails
|
||||
public boolean cancelOnTakeDamage(Enum.DamageType type, float amount) {
|
||||
public boolean cancelOnTakeDamage(mbEnums.DamageType type, float amount) {
|
||||
if (!this.eb.cancelOnTakeDamage())
|
||||
return false;
|
||||
if (this.eb == null || amount < 0f)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.TargetColor;
|
||||
import engine.mbEnums.TargetColor;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
@@ -12,6 +12,7 @@ package engine.objects;
|
||||
import engine.gameManager.GroupManager;
|
||||
import engine.job.JobScheduler;
|
||||
import engine.jobs.UpdateGroupJob;
|
||||
import engine.mbEnums;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.group.GroupUpdateMsg;
|
||||
@@ -132,7 +133,7 @@ public class Group extends AbstractWorldObject {
|
||||
|
||||
for (PlayerCharacter pc : this.members) {
|
||||
Dispatch dispatch = Dispatch.borrow(pc, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, engine.Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.*;
|
||||
import engine.db.archive.DataWarehouse;
|
||||
import engine.db.archive.GuildRecord;
|
||||
import engine.db.handlers.dbGuildHandler;
|
||||
@@ -326,7 +326,7 @@ public class Guild extends AbstractWorldObject {
|
||||
|
||||
if (objectUUID == 0)
|
||||
return Guild.getErrantGuild();
|
||||
Guild guild = (Guild) DbManager.getFromCache(Enum.GameObjectType.Guild, objectUUID);
|
||||
Guild guild = (Guild) DbManager.getFromCache(mbEnums.GameObjectType.Guild, objectUUID);
|
||||
if (guild != null)
|
||||
return guild;
|
||||
|
||||
@@ -346,7 +346,7 @@ public class Guild extends AbstractWorldObject {
|
||||
|
||||
if (Guild.sameGuild(player.getGuild(), toUpdate)) {
|
||||
Dispatch dispatch = Dispatch.borrow(player, ucam);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
|
||||
@@ -356,7 +356,7 @@ public class Guild extends AbstractWorldObject {
|
||||
public static void UpdateClientAlliancesForPlayer(PlayerCharacter toUpdate) {
|
||||
UpdateClientAlliancesMsg ucam = new UpdateClientAlliancesMsg(toUpdate.getGuild());
|
||||
Dispatch dispatch = Dispatch.borrow(toUpdate, ucam);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
|
||||
}
|
||||
@@ -806,8 +806,8 @@ public class Guild extends AbstractWorldObject {
|
||||
|
||||
this.setHash();
|
||||
|
||||
if (DataWarehouse.recordExists(Enum.DataRecordType.GUILD, this.getObjectUUID()) == false) {
|
||||
GuildRecord guildRecord = GuildRecord.borrow(this, Enum.RecordEventType.CREATE);
|
||||
if (DataWarehouse.recordExists(mbEnums.DataRecordType.GUILD, this.getObjectUUID()) == false) {
|
||||
GuildRecord guildRecord = GuildRecord.borrow(this, mbEnums.RecordEventType.CREATE);
|
||||
DataWarehouse.pushToWarehouse(guildRecord);
|
||||
}
|
||||
|
||||
@@ -962,7 +962,7 @@ public class Guild extends AbstractWorldObject {
|
||||
public void setHash() {
|
||||
this.hash = DataWarehouse.hasher.encrypt(this.getObjectUUID());
|
||||
|
||||
DataWarehouse.writeHash(Enum.DataRecordType.GUILD, this.getObjectUUID());
|
||||
DataWarehouse.writeHash(mbEnums.DataRecordType.GUILD, this.getObjectUUID());
|
||||
}
|
||||
|
||||
public GuildCharterType getGuildType() {
|
||||
@@ -996,7 +996,7 @@ public class Guild extends AbstractWorldObject {
|
||||
if (!Guild.sameGuild(player.getGuild(), this)) {
|
||||
msg.setMsgType(AllianceChangeMsg.ERROR_NOT_SAME_GUILD);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1004,7 +1004,7 @@ public class Guild extends AbstractWorldObject {
|
||||
if (!GuildStatusController.isInnerCouncil(player.getGuildStatus()) && !GuildStatusController.isGuildLeader(player.getGuildStatus())) {
|
||||
msg.setMsgType(AllianceChangeMsg.ERROR_NOT_AUTHORIZED);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1012,7 +1012,7 @@ public class Guild extends AbstractWorldObject {
|
||||
if (!GuildStatusController.isFullMember(player.getGuildStatus())) {
|
||||
msg.setMsgType(AllianceChangeMsg.ERROR_NOT_AUTHORIZED);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1030,7 +1030,7 @@ public class Guild extends AbstractWorldObject {
|
||||
if (recommendList.size() == 10) {
|
||||
msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1038,7 +1038,7 @@ public class Guild extends AbstractWorldObject {
|
||||
ErrorPopupMsg.sendErrorMsg(player, "This guild is already recommonded!");
|
||||
msg.setMsgType((byte) 15);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1061,7 +1061,7 @@ public class Guild extends AbstractWorldObject {
|
||||
if (recommendList.size() == 10) {
|
||||
msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1069,7 +1069,7 @@ public class Guild extends AbstractWorldObject {
|
||||
ErrorPopupMsg.sendErrorMsg(player, "This guild is already recommonded!");
|
||||
msg.setMsgType((byte) 15);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1091,7 +1091,7 @@ public class Guild extends AbstractWorldObject {
|
||||
if (allyList.size() == 10) {
|
||||
msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1099,7 +1099,7 @@ public class Guild extends AbstractWorldObject {
|
||||
ErrorPopupMsg.sendErrorMsg(player, "This guild is already an Ally!");
|
||||
msg.setMsgType((byte) 15);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1108,7 +1108,7 @@ public class Guild extends AbstractWorldObject {
|
||||
Logger.error(this.getObjectUUID() + " Could not find alliance Guild");
|
||||
msg.setMsgType((byte) 15);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1118,7 +1118,7 @@ public class Guild extends AbstractWorldObject {
|
||||
Logger.error(this.getObjectUUID() + " failed to update alliance Database");
|
||||
msg.setMsgType((byte) 15);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
|
||||
}
|
||||
@@ -1135,7 +1135,7 @@ public class Guild extends AbstractWorldObject {
|
||||
if (enemyList.size() == 10) {
|
||||
msg.setMsgType(AllianceChangeMsg.ERROR_TOO_MANY);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1143,7 +1143,7 @@ public class Guild extends AbstractWorldObject {
|
||||
ErrorPopupMsg.sendErrorMsg(player, "This guild is already an Enemy!");
|
||||
msg.setMsgType((byte) 15);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1152,7 +1152,7 @@ public class Guild extends AbstractWorldObject {
|
||||
Logger.error(this.getObjectUUID() + " Could not find alliance Guild");
|
||||
msg.setMsgType((byte) 15);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1162,7 +1162,7 @@ public class Guild extends AbstractWorldObject {
|
||||
Logger.error(this.getObjectUUID() + " failed to update alliance Database");
|
||||
msg.setMsgType((byte) 15);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
|
||||
}
|
||||
@@ -1180,7 +1180,7 @@ public class Guild extends AbstractWorldObject {
|
||||
// once here everything passed, send successMsg;
|
||||
msg.setMsgType(AllianceChangeMsg.INFO_SUCCESS);
|
||||
dispatch = Dispatch.borrow(player, msg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.AllianceType;
|
||||
import engine.mbEnums.AllianceType;
|
||||
import engine.gameManager.DbManager;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
package engine.objects;
|
||||
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.GuildHistoryType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.GuildHistoryType;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.exception.SerializationException;
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.*;
|
||||
import engine.net.ByteBufferReader;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.Dispatch;
|
||||
@@ -41,15 +41,15 @@ public class Item extends AbstractWorldObject {
|
||||
private static ConcurrentHashMap<String, Integer> enchantValues = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
private final ConcurrentHashMap<AbstractEffectModifier, Float> bonuses = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
private final ArrayList<String> effectNames = new ArrayList<>();
|
||||
public Enum.ItemContainerType containerType;
|
||||
public mbEnums.ItemContainerType containerType;
|
||||
public ReentrantLock lootLock = new ReentrantLock();
|
||||
public int ownerID; //may be character, account, npc, mob
|
||||
public float drop_chance;
|
||||
public EnumSet<Enum.ItemFlags> flags = EnumSet.noneOf(ItemFlags.class);
|
||||
public EnumSet<mbEnums.ItemFlags> flags = EnumSet.noneOf(ItemFlags.class);
|
||||
public int numberOfItems;
|
||||
public float combat_health_current;
|
||||
public int chargesRemaining;
|
||||
public Enum.EquipSlotType equipSlot;
|
||||
public mbEnums.EquipSlotType equipSlot;
|
||||
private boolean canDestroy;
|
||||
private boolean isRandom = false;
|
||||
public int value;
|
||||
@@ -105,19 +105,19 @@ public class Item extends AbstractWorldObject {
|
||||
|
||||
switch (container) {
|
||||
case "inventory":
|
||||
this.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
this.containerType = mbEnums.ItemContainerType.INVENTORY;
|
||||
break;
|
||||
case "bank":
|
||||
this.containerType = Enum.ItemContainerType.BANK;
|
||||
this.containerType = mbEnums.ItemContainerType.BANK;
|
||||
break;
|
||||
case "vault":
|
||||
this.containerType = Enum.ItemContainerType.VAULT;
|
||||
this.containerType = mbEnums.ItemContainerType.VAULT;
|
||||
break;
|
||||
case "equip":
|
||||
this.containerType = Enum.ItemContainerType.EQUIPPED;
|
||||
this.containerType = mbEnums.ItemContainerType.EQUIPPED;
|
||||
break;
|
||||
case "forge":
|
||||
this.containerType = Enum.ItemContainerType.FORGE;
|
||||
this.containerType = mbEnums.ItemContainerType.FORGE;
|
||||
break;
|
||||
case "warehouse":
|
||||
this.containerType = ItemContainerType.WAREHOUSE;
|
||||
@@ -160,7 +160,7 @@ public class Item extends AbstractWorldObject {
|
||||
|
||||
if (flagString.isEmpty() == false)
|
||||
for (String itemFlag : flagString.split(";"))
|
||||
this.flags.add(Enum.ItemFlags.valueOf(itemFlag));
|
||||
this.flags.add(mbEnums.ItemFlags.valueOf(itemFlag));
|
||||
|
||||
this.dateToUpgrade = rs.getLong("dateToUpgrade");
|
||||
this.value = rs.getInt("value");
|
||||
@@ -530,16 +530,16 @@ public class Item extends AbstractWorldObject {
|
||||
return (Item) DbManager.getFromCache(GameObjectType.Item, id);
|
||||
}
|
||||
|
||||
public static Item newGoldItem(AbstractWorldObject awo, Enum.ItemContainerType containerType) {
|
||||
public static Item newGoldItem(AbstractWorldObject awo, mbEnums.ItemContainerType containerType) {
|
||||
return newGoldItem(awo, containerType, true);
|
||||
}
|
||||
|
||||
//used for vault!
|
||||
public static Item newGoldItem(int accountID, Enum.ItemContainerType containerType) {
|
||||
public static Item newGoldItem(int accountID, mbEnums.ItemContainerType containerType) {
|
||||
return newGoldItem(accountID, containerType, true);
|
||||
}
|
||||
|
||||
private static Item newGoldItem(int accountID, Enum.ItemContainerType containerType, boolean persist) {
|
||||
private static Item newGoldItem(int accountID, mbEnums.ItemContainerType containerType, boolean persist) {
|
||||
|
||||
int ownerID;
|
||||
OwnerType ownerType;
|
||||
@@ -565,7 +565,7 @@ public class Item extends AbstractWorldObject {
|
||||
return newGold;
|
||||
}
|
||||
|
||||
private static Item newGoldItem(AbstractWorldObject awo, Enum.ItemContainerType containerType, boolean persist) {
|
||||
private static Item newGoldItem(AbstractWorldObject awo, mbEnums.ItemContainerType containerType, boolean persist) {
|
||||
|
||||
int ownerID;
|
||||
OwnerType ownerType;
|
||||
@@ -573,7 +573,7 @@ public class Item extends AbstractWorldObject {
|
||||
if (awo.getObjectType().equals(GameObjectType.Mob))
|
||||
return null;
|
||||
|
||||
if (containerType == Enum.ItemContainerType.VAULT) {
|
||||
if (containerType == mbEnums.ItemContainerType.VAULT) {
|
||||
if (!(awo.getObjectType().equals(GameObjectType.PlayerCharacter))) {
|
||||
Logger.error("AWO is not a PlayerCharacter");
|
||||
return null;
|
||||
@@ -748,19 +748,19 @@ public class Item extends AbstractWorldObject {
|
||||
this.ownerID = 0;
|
||||
|
||||
this.ownerType = null;
|
||||
this.containerType = Enum.ItemContainerType.NONE;
|
||||
this.containerType = mbEnums.ItemContainerType.NONE;
|
||||
this.equipSlot = EquipSlotType.NONE;
|
||||
}
|
||||
|
||||
protected void validateItemContainer() {
|
||||
|
||||
if (this.containerType == Enum.ItemContainerType.NONE)
|
||||
if (this.containerType == mbEnums.ItemContainerType.NONE)
|
||||
|
||||
if (this.ownerID != 0)
|
||||
// Item has an owner, just somehow the flags got messed up.
|
||||
// Default to bank.
|
||||
// TODO NEED LOG EVENT HERE.
|
||||
this.containerType = Enum.ItemContainerType.BANK;
|
||||
this.containerType = mbEnums.ItemContainerType.BANK;
|
||||
else
|
||||
// This item is on the ground. Nothing to worry about.
|
||||
this.zeroItem();
|
||||
@@ -811,7 +811,7 @@ public class Item extends AbstractWorldObject {
|
||||
this.zeroItem();
|
||||
this.ownerID = npc.getObjectUUID();
|
||||
this.ownerType = OwnerType.Npc;
|
||||
this.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
this.containerType = mbEnums.ItemContainerType.INVENTORY;
|
||||
this.equipSlot = EquipSlotType.NONE;
|
||||
return true;
|
||||
}
|
||||
@@ -829,7 +829,7 @@ public class Item extends AbstractWorldObject {
|
||||
this.zeroItem();
|
||||
this.ownerID = 0;
|
||||
this.ownerType = null;
|
||||
this.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
this.containerType = mbEnums.ItemContainerType.INVENTORY;
|
||||
this.equipSlot = EquipSlotType.NONE;
|
||||
return true;
|
||||
}
|
||||
@@ -847,7 +847,7 @@ public class Item extends AbstractWorldObject {
|
||||
this.zeroItem();
|
||||
this.ownerID = pc.getObjectUUID();
|
||||
this.ownerType = OwnerType.PlayerCharacter;
|
||||
this.containerType = Enum.ItemContainerType.BANK;
|
||||
this.containerType = mbEnums.ItemContainerType.BANK;
|
||||
this.equipSlot = EquipSlotType.NONE;
|
||||
return true;
|
||||
}
|
||||
@@ -865,7 +865,7 @@ public class Item extends AbstractWorldObject {
|
||||
this.zeroItem();
|
||||
this.ownerID = npc.getObjectUUID();
|
||||
this.ownerType = OwnerType.Npc;
|
||||
this.containerType = Enum.ItemContainerType.BANK;
|
||||
this.containerType = mbEnums.ItemContainerType.BANK;
|
||||
this.equipSlot = EquipSlotType.NONE;
|
||||
return true;
|
||||
}
|
||||
@@ -883,12 +883,12 @@ public class Item extends AbstractWorldObject {
|
||||
this.zeroItem();
|
||||
this.ownerID = a.getObjectUUID();
|
||||
this.ownerType = OwnerType.Account;
|
||||
this.containerType = Enum.ItemContainerType.VAULT;
|
||||
this.containerType = mbEnums.ItemContainerType.VAULT;
|
||||
this.equipSlot = EquipSlotType.NONE;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected synchronized boolean equipItem(PlayerCharacter pc, Enum.EquipSlotType slot) {
|
||||
protected synchronized boolean equipItem(PlayerCharacter pc, mbEnums.EquipSlotType slot) {
|
||||
|
||||
if (!DbManager.ItemQueries.UPDATE_OWNER(this,
|
||||
pc.getObjectUUID(), //tableID
|
||||
@@ -902,26 +902,26 @@ public class Item extends AbstractWorldObject {
|
||||
this.zeroItem();
|
||||
this.ownerID = pc.getObjectUUID();
|
||||
this.ownerType = OwnerType.PlayerCharacter;
|
||||
this.containerType = Enum.ItemContainerType.EQUIPPED;
|
||||
this.containerType = mbEnums.ItemContainerType.EQUIPPED;
|
||||
this.equipSlot = slot;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected synchronized boolean equipItem(NPC npc, Enum.EquipSlotType slot) {
|
||||
protected synchronized boolean equipItem(NPC npc, mbEnums.EquipSlotType slot) {
|
||||
this.zeroItem();
|
||||
this.ownerID = npc.getObjectUUID();
|
||||
this.ownerType = OwnerType.Npc;
|
||||
this.containerType = Enum.ItemContainerType.EQUIPPED;
|
||||
this.containerType = mbEnums.ItemContainerType.EQUIPPED;
|
||||
this.equipSlot = slot;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected synchronized boolean equipItem(Mob mobile, Enum.EquipSlotType slot) {
|
||||
protected synchronized boolean equipItem(Mob mobile, mbEnums.EquipSlotType slot) {
|
||||
|
||||
this.zeroItem();
|
||||
this.ownerID = mobile.getObjectUUID();
|
||||
this.ownerType = OwnerType.Mob;
|
||||
this.containerType = Enum.ItemContainerType.EQUIPPED;
|
||||
this.containerType = mbEnums.ItemContainerType.EQUIPPED;
|
||||
this.equipSlot = slot;
|
||||
return true;
|
||||
}
|
||||
@@ -930,7 +930,7 @@ public class Item extends AbstractWorldObject {
|
||||
|
||||
EffectsBase effect;
|
||||
|
||||
if (ConfigManager.serverType.equals(Enum.ServerType.LOGINSERVER))
|
||||
if (ConfigManager.serverType.equals(mbEnums.ServerType.LOGINSERVER))
|
||||
return;
|
||||
|
||||
|
||||
@@ -1062,7 +1062,7 @@ public class Item extends AbstractWorldObject {
|
||||
DeleteItemMsg deleteItemMsg = new DeleteItemMsg(this.getObjectType().ordinal(), this.getObjectUUID());
|
||||
charItemMan.cleanupDupe(this);
|
||||
Dispatch dispatch = Dispatch.borrow(pc, deleteItemMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1085,7 +1085,7 @@ public class Item extends AbstractWorldObject {
|
||||
DeleteItemMsg deleteItemMsg = new DeleteItemMsg(this.getObjectType().ordinal(), this.getObjectUUID());
|
||||
charItemMan.cleanupDupe(this);
|
||||
Dispatch dispatch = Dispatch.borrow(pc, deleteItemMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.ContainerType;
|
||||
import engine.mbEnums.ContainerType;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ItemContainerType;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.Enum.OwnerType;
|
||||
import engine.gameManager.*;
|
||||
import engine.loot.ModTableEntry;
|
||||
import engine.loot.ModTypeTableEntry;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ItemContainerType;
|
||||
import engine.mbEnums.ItemType;
|
||||
import engine.mbEnums.OwnerType;
|
||||
import engine.net.ItemProductionManager;
|
||||
import engine.net.ItemQueue;
|
||||
import engine.net.client.ClientConnection;
|
||||
@@ -123,7 +123,7 @@ public class ItemFactory {
|
||||
// ROLL BANE SCROLL.
|
||||
|
||||
if (templateID > 910010 && templateID < 910019) {
|
||||
ConcurrentHashMap<Enum.ResourceType, Integer> resources = cityWarehouse.resources;
|
||||
ConcurrentHashMap<mbEnums.ResourceType, Integer> resources = cityWarehouse.resources;
|
||||
|
||||
|
||||
int buildingWithdraw = BuildingManager.GetWithdrawAmountForRolling(forge, template.item_value);
|
||||
@@ -135,13 +135,13 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + " " + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse for overdraft." + " " + template.item_base_name);
|
||||
return null;
|
||||
@@ -154,7 +154,7 @@ public class ItemFactory {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Building does not have enough gold to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
} else {
|
||||
if (overdraft > resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
@@ -162,14 +162,14 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (overdraft > 0)
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, Enum.ResourceType.GOLD, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, mbEnums.ResourceType.GOLD, overdraft, true)) {
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + " Failed to Create Item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
ml = new MobLoot(npc, template, false);
|
||||
|
||||
ml.containerType = Enum.ItemContainerType.FORGE;
|
||||
ml.containerType = mbEnums.ItemContainerType.FORGE;
|
||||
ml.setValue(0);
|
||||
ml.loadEnchantments();
|
||||
|
||||
@@ -251,13 +251,13 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (galvorAmount > 0) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.GALVOR)) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.GALVOR)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Galvor is locked." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (cityWarehouse.resources.get(Enum.ResourceType.GALVOR) < galvorAmount) {
|
||||
if (cityWarehouse.resources.get(mbEnums.ResourceType.GALVOR) < galvorAmount) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Galvor in warehouse to roll this item." + template.item_base_name);
|
||||
return null;
|
||||
@@ -265,20 +265,20 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (wormwoodAmount > 0) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.WORMWOOD)) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.WORMWOOD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Wormwood is locked." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (cityWarehouse.resources.get(Enum.ResourceType.WORMWOOD) < wormwoodAmount) {
|
||||
if (cityWarehouse.resources.get(mbEnums.ResourceType.WORMWOOD) < wormwoodAmount) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Wormwood in warehouse to roll this item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
ConcurrentHashMap<Enum.ResourceType, Integer> suffixResourceCosts = null;
|
||||
ConcurrentHashMap<Enum.ResourceType, Integer> prefixResourceCosts = null;
|
||||
ConcurrentHashMap<mbEnums.ResourceType, Integer> suffixResourceCosts = null;
|
||||
ConcurrentHashMap<mbEnums.ResourceType, Integer> prefixResourceCosts = null;
|
||||
|
||||
EffectsBase prefix = null;
|
||||
|
||||
@@ -309,20 +309,20 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > cityWarehouse.resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > cityWarehouse.resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse for overdraft." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
prefixResourceCosts = prefix.getResourcesForEffect();
|
||||
|
||||
for (Enum.ResourceType ibResources : prefixResourceCosts.keySet()) {
|
||||
for (mbEnums.ResourceType ibResources : prefixResourceCosts.keySet()) {
|
||||
int warehouseAmount = cityWarehouse.resources.get(ibResources);
|
||||
int creationAmount = prefixResourceCosts.get(ibResources);
|
||||
|
||||
@@ -361,20 +361,20 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > cityWarehouse.resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > cityWarehouse.resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse for overdraft." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
for (Enum.ResourceType ibResources : suffixResourceCosts.keySet()) {
|
||||
for (mbEnums.ResourceType ibResources : suffixResourceCosts.keySet()) {
|
||||
int warehouseAmount = cityWarehouse.resources.get(ibResources);
|
||||
int creationAmount = suffixResourceCosts.get(ibResources);
|
||||
|
||||
@@ -396,13 +396,13 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && useWarehouse && Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > 0 && useWarehouse && Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (useWarehouse && overdraft > cityWarehouse.resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (useWarehouse && overdraft > cityWarehouse.resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse for overdraft." + template.item_base_name);
|
||||
return null;
|
||||
@@ -422,7 +422,7 @@ public class ItemFactory {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Building does not have enough gold to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
} else {
|
||||
if (overdraft > cityWarehouse.resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > cityWarehouse.resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
@@ -430,7 +430,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (overdraft > 0 && useWarehouse)
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, Enum.ResourceType.GOLD, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, mbEnums.ResourceType.GOLD, overdraft, true)) {
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + " Failed to Create Item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
@@ -444,7 +444,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
|
||||
for (Enum.ResourceType ibResources : prefixResourceCosts.keySet()) {
|
||||
for (mbEnums.ResourceType ibResources : prefixResourceCosts.keySet()) {
|
||||
|
||||
int creationAmount = prefixResourceCosts.get(ibResources);
|
||||
|
||||
@@ -467,7 +467,7 @@ public class ItemFactory {
|
||||
|
||||
if (suffix != null) {
|
||||
|
||||
for (Enum.ResourceType ibResources : suffixResourceCosts.keySet()) {
|
||||
for (mbEnums.ResourceType ibResources : suffixResourceCosts.keySet()) {
|
||||
int creationAmount = suffixResourceCosts.get(ibResources);
|
||||
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, ibResources) == true) {
|
||||
@@ -505,14 +505,14 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.GOLD)) {
|
||||
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (useWarehouse && overdraft > cityWarehouse.resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (useWarehouse && overdraft > cityWarehouse.resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse for overdraft." + template.item_base_name);
|
||||
@@ -527,7 +527,7 @@ public class ItemFactory {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Building does not have enough gold to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
} else {
|
||||
if (overdraft > cityWarehouse.resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > cityWarehouse.resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
@@ -535,7 +535,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (overdraft > 0)
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, Enum.ResourceType.GOLD, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, mbEnums.ResourceType.GOLD, overdraft, true)) {
|
||||
//ChatManager.chatGuildError(pc, "Failed to create Item");
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + " Failed to Create Item." + template.item_base_name);
|
||||
return null;
|
||||
@@ -544,7 +544,7 @@ public class ItemFactory {
|
||||
// ChatManager.chatGuildInfo(pc, "Gold Cost = " + total);
|
||||
|
||||
if (galvorAmount > 0) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, Enum.ResourceType.GALVOR, galvorAmount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, mbEnums.ResourceType.GALVOR, galvorAmount, true)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Failed to withdraw Galvor from warehouse!" + template.item_base_name);
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
@@ -552,7 +552,7 @@ public class ItemFactory {
|
||||
}
|
||||
|
||||
if (wormwoodAmount > 0) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, Enum.ResourceType.WORMWOOD, wormwoodAmount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, mbEnums.ResourceType.WORMWOOD, wormwoodAmount, true)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Failed to withdraw Wormwood from warehouse!" + template.item_base_name);
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
@@ -561,7 +561,7 @@ public class ItemFactory {
|
||||
|
||||
ml = new MobLoot(npc, template, false);
|
||||
|
||||
ml.containerType = Enum.ItemContainerType.FORGE;
|
||||
ml.containerType = mbEnums.ItemContainerType.FORGE;
|
||||
|
||||
if (customName.isEmpty() == false)
|
||||
ml.name = customName;
|
||||
@@ -795,7 +795,7 @@ public class ItemFactory {
|
||||
if (cityWarehouse != null && forge.assetIsProtected())
|
||||
useWarehouse = true;
|
||||
|
||||
ConcurrentHashMap<Enum.ResourceType, Integer> resources = null;
|
||||
ConcurrentHashMap<mbEnums.ResourceType, Integer> resources = null;
|
||||
|
||||
if (useWarehouse)
|
||||
resources = cityWarehouse.resources;
|
||||
@@ -833,24 +833,24 @@ public class ItemFactory {
|
||||
return null;
|
||||
|
||||
if (galvorAmount > 0) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.GALVOR)) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.GALVOR)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Galvor is locked." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (cityWarehouse.resources.get(Enum.ResourceType.GALVOR) < galvorAmount) {
|
||||
if (cityWarehouse.resources.get(mbEnums.ResourceType.GALVOR) < galvorAmount) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Galvor in warehouse to roll this item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (wormwoodAmount > 0) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.WORMWOOD)) {
|
||||
if (Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.WORMWOOD)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Galvor is locked." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (cityWarehouse.resources.get(Enum.ResourceType.WORMWOOD) < wormwoodAmount) {
|
||||
if (cityWarehouse.resources.get(mbEnums.ResourceType.WORMWOOD) < wormwoodAmount) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Galvor in warehouse to roll this item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
@@ -887,13 +887,13 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (useWarehouse && overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.GOLD)) {
|
||||
if (useWarehouse && overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (useWarehouse && overdraft > resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (useWarehouse && overdraft > resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse for overdraft." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
@@ -905,7 +905,7 @@ public class ItemFactory {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Building does not have enough gold to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
} else {
|
||||
if (overdraft > resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
@@ -915,12 +915,12 @@ public class ItemFactory {
|
||||
// there was an overdraft, withdraw the rest from warehouse.
|
||||
if (overdraft > 0) {
|
||||
if (pc != null) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, pc, Enum.ResourceType.GOLD, overdraft, false, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, pc, mbEnums.ResourceType.GOLD, overdraft, false, true)) {
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, Enum.ResourceType.GOLD, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, mbEnums.ResourceType.GOLD, overdraft, true)) {
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
}
|
||||
@@ -938,13 +938,13 @@ public class ItemFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (useWarehouse && overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, Enum.ResourceType.GOLD)) {
|
||||
if (useWarehouse && overdraft > 0 && Warehouse.isResourceLocked(cityWarehouse, mbEnums.ResourceType.GOLD)) {
|
||||
if (pc != null)
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Warehouse gold is barred! Overdraft cannot be withdrawn from warehouse." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (useWarehouse && overdraft > resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (useWarehouse && overdraft > resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse for overdraft." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
@@ -956,7 +956,7 @@ public class ItemFactory {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Building does not have enough gold to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
} else {
|
||||
if (overdraft > resources.get(Enum.ResourceType.GOLD)) {
|
||||
if (overdraft > resources.get(mbEnums.ResourceType.GOLD)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Not enough Gold in Warehouse to produce this item." + template.item_base_name);
|
||||
return null;
|
||||
}
|
||||
@@ -966,12 +966,12 @@ public class ItemFactory {
|
||||
if (overdraft > 0 && useWarehouse) {
|
||||
|
||||
if (pc != null) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, pc, Enum.ResourceType.GOLD, overdraft, false, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, pc, mbEnums.ResourceType.GOLD, overdraft, false, true)) {
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, Enum.ResourceType.GOLD, overdraft, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, mbEnums.ResourceType.GOLD, overdraft, true)) {
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
}
|
||||
@@ -981,7 +981,7 @@ public class ItemFactory {
|
||||
|
||||
if (galvorAmount > 0 && useWarehouse) {
|
||||
//ChatManager.chatGuildInfo(pc, "Withdrawing " + galvorAmount + " galvor from warehouse");
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, Enum.ResourceType.GALVOR, galvorAmount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, mbEnums.ResourceType.GALVOR, galvorAmount, true)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Failed to withdraw Galvor from warehouse!" + template.item_base_name);
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + "Failed to Withdrawl ");
|
||||
return null;
|
||||
@@ -990,7 +990,7 @@ public class ItemFactory {
|
||||
|
||||
if (wormwoodAmount > 0 && useWarehouse) {
|
||||
//ChatManager.chatGuildInfo(pc, "Withdrawing " + wormwoodAmount + " wormwood from warehouse");
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, Enum.ResourceType.WORMWOOD, wormwoodAmount, true)) {
|
||||
if (!Warehouse.withdraw(cityWarehouse, npc, mbEnums.ResourceType.WORMWOOD, wormwoodAmount, true)) {
|
||||
ErrorPopupMsg.sendErrorMsg(pc, "Failed to withdraw Wormwood from warehouse for " + template.item_base_name);
|
||||
Logger.error("Warehouse for city " + cityWarehouse.city.getName() + "Failed to Withdrawl ");
|
||||
|
||||
@@ -1000,7 +1000,7 @@ public class ItemFactory {
|
||||
|
||||
ml = new MobLoot(npc, template, false);
|
||||
|
||||
ml.containerType = Enum.ItemContainerType.FORGE;
|
||||
ml.containerType = mbEnums.ItemContainerType.FORGE;
|
||||
|
||||
if (prefix != null) {
|
||||
ml.addPermanentEnchantment(prefix.getIDString(), 0, 0, true);
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -36,11 +36,11 @@ public class ItemTemplate {
|
||||
public float combat_health_current;
|
||||
public float combat_health_full;
|
||||
public final HashMap<String, Float> combat_attack_resist = new HashMap<>();
|
||||
public Enum.ItemType item_type;
|
||||
public mbEnums.ItemType item_type;
|
||||
public int item_eq_slots_value;
|
||||
public boolean item_eq_slots_type;
|
||||
public final EnumSet<Enum.EquipSlotType> item_eq_slots_or = EnumSet.noneOf(Enum.EquipSlotType.class);
|
||||
public final EnumSet<Enum.EquipSlotType> item_eq_slots_and = EnumSet.noneOf(Enum.EquipSlotType.class);
|
||||
public final EnumSet<mbEnums.EquipSlotType> item_eq_slots_or = EnumSet.noneOf(mbEnums.EquipSlotType.class);
|
||||
public final EnumSet<mbEnums.EquipSlotType> item_eq_slots_and = EnumSet.noneOf(mbEnums.EquipSlotType.class);
|
||||
public boolean item_takeable;
|
||||
public int item_value;
|
||||
public int item_wt;
|
||||
@@ -53,34 +53,34 @@ public class ItemTemplate {
|
||||
public String item_skill_mastery_used = "";
|
||||
public int item_parry_anim_id;
|
||||
public float item_bulk_factor;
|
||||
public final HashMap<Enum.ShrineType, Integer> item_offering_info = new HashMap<>();
|
||||
public final HashMap<mbEnums.ShrineType, Integer> item_offering_info = new HashMap<>();
|
||||
public int item_defense_rating;
|
||||
public float item_weapon_wepspeed;
|
||||
public float item_weapon_max_range;
|
||||
public int item_weapon_projectile_id;
|
||||
public float item_weapon_projectile_speed;
|
||||
public int item_weapon_combat_idle_anim;
|
||||
public final HashMap<Enum.DamageType, int[]> item_weapon_damage = new HashMap<>();
|
||||
public final HashMap<mbEnums.DamageType, int[]> item_weapon_damage = new HashMap<>();
|
||||
public final ArrayList<int[]> weapon_attack_anim_right = new ArrayList<>();
|
||||
public final ArrayList<int[]> weapon_attack_anim_left = new ArrayList<>();
|
||||
public Enum.AttributeType item_primary_attr = Enum.AttributeType.None;
|
||||
public Enum.AttributeType item_secondary_attr = Enum.AttributeType.None;
|
||||
public final EnumSet<Enum.ItemFlags> item_flags = EnumSet.noneOf(Enum.ItemFlags.class);
|
||||
public final EnumSet<Enum.ItemUseFlags> item_use_flags = EnumSet.noneOf(Enum.ItemUseFlags.class);
|
||||
public mbEnums.AttributeType item_primary_attr = mbEnums.AttributeType.None;
|
||||
public mbEnums.AttributeType item_secondary_attr = mbEnums.AttributeType.None;
|
||||
public final EnumSet<mbEnums.ItemFlags> item_flags = EnumSet.noneOf(mbEnums.ItemFlags.class);
|
||||
public final EnumSet<mbEnums.ItemUseFlags> item_use_flags = EnumSet.noneOf(mbEnums.ItemUseFlags.class);
|
||||
public int item_initial_charges;
|
||||
public final HashMap<String, Integer> item_skill_required = new HashMap<>();
|
||||
public final EnumSet<Enum.MonsterType> item_race_req = EnumSet.noneOf(Enum.MonsterType.class);
|
||||
public final EnumSet<Enum.MonsterType> item_race_res = EnumSet.noneOf(Enum.MonsterType.class);
|
||||
public final EnumSet<Enum.ClassType> item_class_req = EnumSet.noneOf(Enum.ClassType.class);
|
||||
public final EnumSet<Enum.ClassType> item_class_res = EnumSet.noneOf(Enum.ClassType.class);
|
||||
public final EnumSet<Enum.DisciplineType> item_disc_req = EnumSet.noneOf(Enum.DisciplineType.class);
|
||||
public final EnumSet<Enum.DisciplineType> item_disc_res = EnumSet.noneOf(Enum.DisciplineType.class);
|
||||
public final EnumSet<mbEnums.MonsterType> item_race_req = EnumSet.noneOf(mbEnums.MonsterType.class);
|
||||
public final EnumSet<mbEnums.MonsterType> item_race_res = EnumSet.noneOf(mbEnums.MonsterType.class);
|
||||
public final EnumSet<mbEnums.ClassType> item_class_req = EnumSet.noneOf(mbEnums.ClassType.class);
|
||||
public final EnumSet<mbEnums.ClassType> item_class_res = EnumSet.noneOf(mbEnums.ClassType.class);
|
||||
public final EnumSet<mbEnums.DisciplineType> item_disc_req = EnumSet.noneOf(mbEnums.DisciplineType.class);
|
||||
public final EnumSet<mbEnums.DisciplineType> item_disc_res = EnumSet.noneOf(mbEnums.DisciplineType.class);
|
||||
public int item_level_req;
|
||||
public Enum.SexType item_sex_req;
|
||||
public mbEnums.SexType item_sex_req;
|
||||
public final HashMap<String, int[]> item_user_power_action = new HashMap<>();
|
||||
public final HashMap<String, Integer> item_power_grant = new HashMap<>();
|
||||
public final HashMap<String, int[]> item_power_action = new HashMap<>();
|
||||
public final HashMap<Enum.ResourceType, Integer> item_resource_cost = new HashMap<>();
|
||||
public final HashMap<mbEnums.ResourceType, Integer> item_resource_cost = new HashMap<>();
|
||||
public int modTable;
|
||||
public int deed_type;
|
||||
public int deed_furniture_id;
|
||||
@@ -93,8 +93,8 @@ public class ItemTemplate {
|
||||
public float deed_namelookup_val;
|
||||
public boolean deed_custom_city;
|
||||
public int deed_structure_id;
|
||||
public final HashMap<Enum.AttributeType, Integer> rune_attr_adj = new HashMap<>();
|
||||
public final HashMap<Enum.AttributeType, Integer> rune_max_attr_adj = new HashMap<>();
|
||||
public final HashMap<mbEnums.AttributeType, Integer> rune_attr_adj = new HashMap<>();
|
||||
public final HashMap<mbEnums.AttributeType, Integer> rune_max_attr_adj = new HashMap<>();
|
||||
public final HashMap<String, Integer> rune_skill_grant = new HashMap<>();
|
||||
public final HashMap<String, Integer> skill_granted_skills = new HashMap<>();
|
||||
public final HashMap<String, Integer> power_granted_skills = new HashMap<>();
|
||||
@@ -105,7 +105,7 @@ public class ItemTemplate {
|
||||
public int rune_rank;
|
||||
public int rune_pracs_per_level;
|
||||
public float rune_exp_req_to_level;
|
||||
public Enum.SexType rune_sex;
|
||||
public mbEnums.SexType rune_sex;
|
||||
public int rune_class_icon;
|
||||
public int rune_health;
|
||||
public int rune_mana;
|
||||
@@ -115,22 +115,22 @@ public class ItemTemplate {
|
||||
public int rune_attack;
|
||||
public int rune_defense;
|
||||
public int rune_level;
|
||||
public final HashMap<Enum.MovementType, Float> rune_speed = new HashMap<>();
|
||||
public final HashMap<mbEnums.MovementType, Float> rune_speed = new HashMap<>();
|
||||
public int rune_group_type;
|
||||
public boolean rune_group_is_faction = false;
|
||||
public boolean rune_group_is_guild = false;
|
||||
public String rune_dsc;
|
||||
public String rune_fx_txt;
|
||||
public EnumSet<Enum.MobBehaviourType> rune_group_tactics = EnumSet.noneOf(Enum.MobBehaviourType.class);
|
||||
public EnumSet<mbEnums.MobBehaviourType> rune_group_tactics = EnumSet.noneOf(mbEnums.MobBehaviourType.class);
|
||||
;
|
||||
public EnumSet<Enum.MobBehaviourType> rune_group_role_set = EnumSet.noneOf(Enum.MobBehaviourType.class);
|
||||
public EnumSet<mbEnums.MobBehaviourType> rune_group_role_set = EnumSet.noneOf(mbEnums.MobBehaviourType.class);
|
||||
;
|
||||
public boolean rune_renderable = false;
|
||||
public int rune_natural_power_attack;
|
||||
public final HashMap<String, String> rune_sparse_data = new HashMap<>();
|
||||
public final HashMap<String, int[]> rune_skill_adj = new HashMap<>();
|
||||
public final EnumSet<Enum.MonsterType> rune_enemy_monster_types = EnumSet.noneOf(Enum.MonsterType.class);
|
||||
public final EnumSet<Enum.MonsterType> rune_not_enemy_monster_types = EnumSet.noneOf(Enum.MonsterType.class);
|
||||
public final EnumSet<mbEnums.MonsterType> rune_enemy_monster_types = EnumSet.noneOf(mbEnums.MonsterType.class);
|
||||
public final EnumSet<mbEnums.MonsterType> rune_not_enemy_monster_types = EnumSet.noneOf(mbEnums.MonsterType.class);
|
||||
public final ArrayList<Integer> rune_groupee_monster_types = new ArrayList<>();
|
||||
public final ArrayList<Integer> rune_helper_monster_types = new ArrayList<>();
|
||||
|
||||
@@ -194,7 +194,7 @@ public class ItemTemplate {
|
||||
|
||||
// Parsing an enum
|
||||
|
||||
item_type = Enum.ItemType.valueOf((String) jsonObject.get("item_type"));
|
||||
item_type = mbEnums.ItemType.valueOf((String) jsonObject.get("item_type"));
|
||||
item_eq_slots_value = ((Long) jsonObject.get("item_eq_slots_value")).intValue();
|
||||
item_eq_slots_type = (boolean) jsonObject.get("item_eq_slots_type");
|
||||
|
||||
@@ -204,13 +204,13 @@ public class ItemTemplate {
|
||||
|
||||
if (eq_slots_or.isEmpty() == false)
|
||||
for (Object o : eq_slots_or)
|
||||
item_eq_slots_or.add(Enum.EquipSlotType.valueOf((String) o));
|
||||
item_eq_slots_or.add(mbEnums.EquipSlotType.valueOf((String) o));
|
||||
|
||||
JSONArray eq_slots_and = (JSONArray) jsonObject.get("item_eq_slots_and");
|
||||
|
||||
if (eq_slots_and.isEmpty() == false)
|
||||
for (Object o : eq_slots_and)
|
||||
item_eq_slots_and.add(Enum.EquipSlotType.valueOf((String) o));
|
||||
item_eq_slots_and.add(mbEnums.EquipSlotType.valueOf((String) o));
|
||||
|
||||
item_takeable = (boolean) jsonObject.get("item_takeable");
|
||||
item_value = ((Long) jsonObject.get("item_value")).intValue();
|
||||
@@ -243,19 +243,19 @@ public class ItemTemplate {
|
||||
JSONObject offering_entry = (JSONObject) entry;
|
||||
String offering_type = ((String) offering_entry.get("offering_type")).replaceAll("-", "");
|
||||
int offering_value = ((Long) offering_entry.get("offering_value")).intValue();
|
||||
item_offering_info.put(Enum.ShrineType.valueOf(offering_type), offering_value);
|
||||
item_offering_info.put(mbEnums.ShrineType.valueOf(offering_type), offering_value);
|
||||
}
|
||||
|
||||
// Fields only present for ARMOR
|
||||
|
||||
if (item_type.equals(Enum.ItemType.ARMOR)) {
|
||||
if (item_type.equals(mbEnums.ItemType.ARMOR)) {
|
||||
item_bulk_factor = ((Double) jsonObject.get("item_bulk_factor")).floatValue();
|
||||
item_defense_rating = ((Long) jsonObject.get("item_defense_rating")).intValue();
|
||||
}
|
||||
|
||||
// Fields only present for WEAPON
|
||||
|
||||
if (item_type.equals(Enum.ItemType.WEAPON)) {
|
||||
if (item_type.equals(mbEnums.ItemType.WEAPON)) {
|
||||
|
||||
JSONObject item_weapon = (JSONObject) jsonObject.get("item_weapon");
|
||||
item_weapon_wepspeed = ((Double) item_weapon.get("weapon_wepspeed")).floatValue();
|
||||
@@ -269,7 +269,7 @@ public class ItemTemplate {
|
||||
if (weapon_damage.isEmpty() == false)
|
||||
for (Object o : weapon_damage) {
|
||||
JSONObject damage_entry = (JSONObject) o;
|
||||
Enum.DamageType damageType = Enum.DamageType.getDamageType(((String) damage_entry.get("damage_type")));
|
||||
mbEnums.DamageType damageType = mbEnums.DamageType.getDamageType(((String) damage_entry.get("damage_type")));
|
||||
int min = ((Long) damage_entry.get("damage_min")).intValue();
|
||||
int max = ((Long) damage_entry.get("damage_max")).intValue();
|
||||
int[] minMax = {min, max};
|
||||
@@ -296,8 +296,8 @@ public class ItemTemplate {
|
||||
weapon_attack_anim_left.add(new int[]{animation, duration});
|
||||
}
|
||||
|
||||
item_primary_attr = Enum.AttributeType.valueOf((String) jsonObject.get("item_primary_attr"));
|
||||
item_secondary_attr = Enum.AttributeType.valueOf((String) jsonObject.get("item_secondary_attr"));
|
||||
item_primary_attr = mbEnums.AttributeType.valueOf((String) jsonObject.get("item_primary_attr"));
|
||||
item_secondary_attr = mbEnums.AttributeType.valueOf((String) jsonObject.get("item_secondary_attr"));
|
||||
}
|
||||
|
||||
JSONArray itemflags = (JSONArray) jsonObject.get("item_flags");
|
||||
@@ -306,14 +306,14 @@ public class ItemTemplate {
|
||||
for (Object o : itemflags) {
|
||||
String flag = (String) o;
|
||||
if (flag.equals("None") == false)
|
||||
item_flags.add(Enum.ItemFlags.valueOf((String) o));
|
||||
item_flags.add(mbEnums.ItemFlags.valueOf((String) o));
|
||||
}
|
||||
|
||||
JSONArray itemUseflags = (JSONArray) jsonObject.get("item_use_flags");
|
||||
|
||||
if (itemUseflags.isEmpty() == false)
|
||||
for (Object o : itemUseflags)
|
||||
item_use_flags.add(Enum.ItemUseFlags.valueOf((String) o));
|
||||
item_use_flags.add(mbEnums.ItemUseFlags.valueOf((String) o));
|
||||
|
||||
item_initial_charges = ((Long) jsonObject.get("item_initial_charges")).intValue();
|
||||
|
||||
@@ -341,9 +341,9 @@ public class ItemTemplate {
|
||||
race = race.replaceAll("-", "");
|
||||
|
||||
if (restrict)
|
||||
item_race_res.add(Enum.MonsterType.valueOf(race));
|
||||
item_race_res.add(mbEnums.MonsterType.valueOf(race));
|
||||
else
|
||||
item_race_req.add(Enum.MonsterType.valueOf(race));
|
||||
item_race_req.add(mbEnums.MonsterType.valueOf(race));
|
||||
}
|
||||
|
||||
JSONObject class_required = (JSONObject) jsonObject.get("item_class_req");
|
||||
@@ -357,9 +357,9 @@ public class ItemTemplate {
|
||||
classEntry = classEntry.replaceAll(",", "");
|
||||
|
||||
if (restrict)
|
||||
item_class_res.add(Enum.ClassType.valueOf(classEntry));
|
||||
item_class_res.add(mbEnums.ClassType.valueOf(classEntry));
|
||||
else
|
||||
item_class_req.add(Enum.ClassType.valueOf(classEntry));
|
||||
item_class_req.add(mbEnums.ClassType.valueOf(classEntry));
|
||||
}
|
||||
|
||||
JSONObject disc_required = (JSONObject) jsonObject.get("item_disc_req");
|
||||
@@ -373,13 +373,13 @@ public class ItemTemplate {
|
||||
disc = disc.replaceAll(",", "");
|
||||
|
||||
if (restrict)
|
||||
item_disc_res.add(Enum.DisciplineType.valueOf(disc));
|
||||
item_disc_res.add(mbEnums.DisciplineType.valueOf(disc));
|
||||
else
|
||||
item_disc_req.add(Enum.DisciplineType.valueOf(disc));
|
||||
item_disc_req.add(mbEnums.DisciplineType.valueOf(disc));
|
||||
}
|
||||
|
||||
item_level_req = ((Long) jsonObject.get("item_level_req")).intValue();
|
||||
item_sex_req = Enum.SexType.valueOf((String) jsonObject.get("item_sex_req"));
|
||||
item_sex_req = mbEnums.SexType.valueOf((String) jsonObject.get("item_sex_req"));
|
||||
|
||||
JSONArray userPowerActions = (JSONArray) jsonObject.get("item_user_power_action");
|
||||
|
||||
@@ -432,14 +432,14 @@ public class ItemTemplate {
|
||||
if (resource_costs.isEmpty() == false)
|
||||
for (Object o : resource_costs) {
|
||||
JSONObject resource_entry = (JSONObject) o;
|
||||
Enum.ResourceType resource_type = Enum.ResourceType.valueOf(((String) resource_entry.get("resource_type")).toUpperCase());
|
||||
mbEnums.ResourceType resource_type = mbEnums.ResourceType.valueOf(((String) resource_entry.get("resource_type")).toUpperCase());
|
||||
int resource_value = ((Long) resource_entry.get("resource_value")).intValue();
|
||||
item_resource_cost.put(resource_type, resource_value);
|
||||
}
|
||||
|
||||
// Deed related fields
|
||||
|
||||
if (item_type.equals(Enum.ItemType.DEED)) {
|
||||
if (item_type.equals(mbEnums.ItemType.DEED)) {
|
||||
|
||||
deed_type = ((Long) jsonObject.get("deed_type")).intValue();
|
||||
deed_furniture_id = ((Long) jsonObject.get("deed_furniture_id")).intValue();
|
||||
@@ -454,7 +454,7 @@ public class ItemTemplate {
|
||||
deed_structure_id = ((Long) jsonObject.get("deed_structure_id")).intValue();
|
||||
}
|
||||
|
||||
if (item_type.equals(Enum.ItemType.RUNE)) {
|
||||
if (item_type.equals(mbEnums.ItemType.RUNE)) {
|
||||
|
||||
rune_type = (String) jsonObject.get("rune_type");
|
||||
|
||||
@@ -468,7 +468,7 @@ public class ItemTemplate {
|
||||
rune_rank = ((Long) jsonObject.get("rune_rank")).intValue();
|
||||
rune_pracs_per_level = ((Long) jsonObject.get("rune_pracs_per_level")).intValue();
|
||||
rune_exp_req_to_level = ((Double) jsonObject.get("rune_exp_req_to_level")).floatValue();
|
||||
rune_sex = Enum.SexType.valueOf((String) jsonObject.get("rune_sex"));
|
||||
rune_sex = mbEnums.SexType.valueOf((String) jsonObject.get("rune_sex"));
|
||||
rune_class_icon = ((Long) jsonObject.get("rune_class_icon")).intValue();
|
||||
rune_health = ((Long) jsonObject.get("rune_health")).intValue();
|
||||
rune_mana = ((Long) jsonObject.get("rune_mana")).intValue();
|
||||
@@ -482,7 +482,7 @@ public class ItemTemplate {
|
||||
JSONObject rune_speed_json = (JSONObject) jsonObject.get("rune_speed");
|
||||
|
||||
for (Object key : rune_speed_json.keySet()) {
|
||||
Enum.MovementType movementType = Enum.MovementType.valueOf((String) key);
|
||||
mbEnums.MovementType movementType = mbEnums.MovementType.valueOf((String) key);
|
||||
float speed = ((Double) rune_speed_json.get(key)).floatValue();
|
||||
rune_speed.put(movementType, speed);
|
||||
}
|
||||
@@ -497,18 +497,18 @@ public class ItemTemplate {
|
||||
|
||||
int group_tactics_bitvector = ((Long) jsonObject.get("rune_group_tactics")).intValue();
|
||||
|
||||
rune_group_tactics.addAll(Enum.fromLong(group_tactics_bitvector, Enum.MobBehaviourType.class));
|
||||
rune_group_tactics.addAll(mbEnums.fromLong(group_tactics_bitvector, mbEnums.MobBehaviourType.class));
|
||||
|
||||
int group_role_bitvector = ((Long) jsonObject.get("rune_group_role_set")).intValue();
|
||||
|
||||
rune_group_role_set.addAll(Enum.fromLong(group_role_bitvector, Enum.MobBehaviourType.class));
|
||||
rune_group_role_set.addAll(mbEnums.fromLong(group_role_bitvector, mbEnums.MobBehaviourType.class));
|
||||
|
||||
JSONArray enemy_types_json = (JSONArray) jsonObject.get("rune_enemy_monster_types");
|
||||
|
||||
for (Object o : enemy_types_json) {
|
||||
String enemy = (String) o;
|
||||
enemy = enemy.replaceAll("-", "");
|
||||
Enum.MonsterType monsterType = Enum.MonsterType.valueOf(enemy);
|
||||
mbEnums.MonsterType monsterType = mbEnums.MonsterType.valueOf(enemy);
|
||||
rune_enemy_monster_types.add(monsterType);
|
||||
}
|
||||
|
||||
@@ -517,7 +517,7 @@ public class ItemTemplate {
|
||||
for (Object o : not_enemy_types_json) {
|
||||
String notenemy = (String) o;
|
||||
notenemy = notenemy.replaceAll("-", "");
|
||||
Enum.MonsterType monsterType = Enum.MonsterType.valueOf(notenemy);
|
||||
mbEnums.MonsterType monsterType = mbEnums.MonsterType.valueOf(notenemy);
|
||||
rune_not_enemy_monster_types.add(monsterType);
|
||||
}
|
||||
|
||||
@@ -565,7 +565,7 @@ public class ItemTemplate {
|
||||
for (Object attributeEntry : attr_adj_json) {
|
||||
JSONObject attribute = (JSONObject) attributeEntry;
|
||||
String typeString = (String) attribute.get("attr_type");
|
||||
Enum.AttributeType attributeType = Enum.AttributeType.valueOf(typeString);
|
||||
mbEnums.AttributeType attributeType = mbEnums.AttributeType.valueOf(typeString);
|
||||
int attributeValue = ((Long) attribute.get("attr_value")).intValue();
|
||||
rune_attr_adj.put(attributeType, attributeValue);
|
||||
}
|
||||
@@ -575,7 +575,7 @@ public class ItemTemplate {
|
||||
for (Object attributeEntry : max_attr_adj_json) {
|
||||
JSONObject attribute = (JSONObject) attributeEntry;
|
||||
String typeString = (String) attribute.get("attr_type");
|
||||
Enum.AttributeType attributeType = Enum.AttributeType.valueOf(typeString);
|
||||
mbEnums.AttributeType attributeType = mbEnums.AttributeType.valueOf(typeString);
|
||||
int attributeValue = ((Long) attribute.get("attr_value")).intValue();
|
||||
rune_max_attr_adj.put(attributeType, attributeValue);
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ItemContainerType;
|
||||
import engine.Enum.OwnerType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ItemContainerType;
|
||||
import engine.mbEnums.OwnerType;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
@@ -111,7 +111,7 @@ public class Kit extends AbstractGameObject {
|
||||
* Getters
|
||||
*/
|
||||
|
||||
private static boolean kitItemCreator(PlayerCharacter pc, int templateID, Enum.EquipSlotType slot) {
|
||||
private static boolean kitItemCreator(PlayerCharacter pc, int templateID, mbEnums.EquipSlotType slot) {
|
||||
|
||||
Item item = new Item(templateID);
|
||||
item.ownerID = pc.getObjectUUID();
|
||||
@@ -409,15 +409,15 @@ public class Kit extends AbstractGameObject {
|
||||
|
||||
public void equipPCwithKit(PlayerCharacter pc) {
|
||||
if (weapon != 0)
|
||||
kitItemCreator(pc, weapon, Enum.EquipSlotType.RHELD);
|
||||
kitItemCreator(pc, weapon, mbEnums.EquipSlotType.RHELD);
|
||||
if (offhand != 0)
|
||||
kitItemCreator(pc, offhand, Enum.EquipSlotType.LHELD);
|
||||
kitItemCreator(pc, offhand, mbEnums.EquipSlotType.LHELD);
|
||||
if (chest != 0)
|
||||
kitItemCreator(pc, chest, Enum.EquipSlotType.CHEST);
|
||||
kitItemCreator(pc, chest, mbEnums.EquipSlotType.CHEST);
|
||||
if (legs != 0)
|
||||
kitItemCreator(pc, legs, Enum.EquipSlotType.LEGS);
|
||||
kitItemCreator(pc, legs, mbEnums.EquipSlotType.LEGS);
|
||||
if (feet != 0)
|
||||
kitItemCreator(pc, feet, Enum.EquipSlotType.FEET);
|
||||
kitItemCreator(pc, feet, mbEnums.EquipSlotType.FEET);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.ZoneManager;
|
||||
import engine.mbEnums;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -45,7 +45,7 @@ public class Mine extends AbstractGameObject {
|
||||
public GuildTag guildTag;
|
||||
public String nationName;
|
||||
public GuildTag nationTag;
|
||||
private Enum.ResourceType production;
|
||||
private mbEnums.ResourceType production;
|
||||
private Guild owningGuild;
|
||||
private int flags;
|
||||
private int buildingID;
|
||||
@@ -88,7 +88,7 @@ public class Mine extends AbstractGameObject {
|
||||
this.nationTag = GuildTag.ERRANT;
|
||||
}
|
||||
|
||||
this.production = Enum.ResourceType.valueOf(rs.getString("mine_resource"));
|
||||
this.production = mbEnums.ResourceType.valueOf(rs.getString("mine_resource"));
|
||||
this.lastClaimer = null;
|
||||
|
||||
}
|
||||
@@ -114,7 +114,7 @@ public class Mine extends AbstractGameObject {
|
||||
if (mine.getBlueprint() == null)
|
||||
return;
|
||||
|
||||
if (mine.getBlueprint().getBuildingGroup() != Enum.BuildingGroup.MINE)
|
||||
if (mine.getBlueprint().getBuildingGroup() != mbEnums.BuildingGroup.MINE)
|
||||
return;
|
||||
|
||||
|
||||
@@ -310,7 +310,7 @@ public class Mine extends AbstractGameObject {
|
||||
return mineCnt <= tolRank;
|
||||
}
|
||||
|
||||
public boolean changeProductionType(Enum.ResourceType resource) {
|
||||
public boolean changeProductionType(mbEnums.ResourceType resource) {
|
||||
if (!this.validForMine(resource))
|
||||
return false;
|
||||
//update resource in database;
|
||||
@@ -333,7 +333,7 @@ public class Mine extends AbstractGameObject {
|
||||
return this.zoneName;
|
||||
}
|
||||
|
||||
public Enum.ResourceType getProduction() {
|
||||
public mbEnums.ResourceType getProduction() {
|
||||
return this.production;
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ public class Mine extends AbstractGameObject {
|
||||
building.isDeranking.compareAndSet(true, false);
|
||||
}
|
||||
|
||||
public boolean validForMine(Enum.ResourceType r) {
|
||||
public boolean validForMine(mbEnums.ResourceType r) {
|
||||
if (this.mineType == null)
|
||||
return false;
|
||||
return this.mineType.validForMine(r, this.isExpansion());
|
||||
@@ -444,7 +444,7 @@ public class Mine extends AbstractGameObject {
|
||||
|
||||
// remove hirelings
|
||||
|
||||
Building building = (Building) getObject(Enum.GameObjectType.Building, this.buildingID);
|
||||
Building building = (Building) getObject(mbEnums.GameObjectType.Building, this.buildingID);
|
||||
BuildingManager.cleanupHirelings(building);
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ public class Mine extends AbstractGameObject {
|
||||
if (this.owningGuild.getOwnedCity().warehouse == null)
|
||||
return false;
|
||||
|
||||
return Warehouse.depositFromMine(this, Enum.ResourceType.resourceLookup.get(this.production.templateID), this.getModifiedProductionAmount(), this.owningGuild.getOwnedCity().warehouse);
|
||||
return Warehouse.depositFromMine(this, mbEnums.ResourceType.resourceLookup.get(this.production.templateID), this.getModifiedProductionAmount(), this.owningGuild.getOwnedCity().warehouse);
|
||||
}
|
||||
|
||||
public boolean updateGuildOwner(PlayerCharacter playerCharacter) {
|
||||
|
||||
@@ -9,24 +9,24 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public enum MineProduction {
|
||||
|
||||
LUMBER("Lumber Camp", new HashMap<>(), Enum.ResourceType.WORMWOOD, 1618637196, 1663491950),
|
||||
ORE("Ore Mine", new HashMap<>(), Enum.ResourceType.OBSIDIAN, 518103023, -788976428),
|
||||
GOLD("Gold Mine", new HashMap<>(), Enum.ResourceType.GALVOR, -662193002, -1227205358),
|
||||
MAGIC("Magic Mine", new HashMap<>(), Enum.ResourceType.BLOODSTONE, 504746863, -1753567069);
|
||||
LUMBER("Lumber Camp", new HashMap<>(), mbEnums.ResourceType.WORMWOOD, 1618637196, 1663491950),
|
||||
ORE("Ore Mine", new HashMap<>(), mbEnums.ResourceType.OBSIDIAN, 518103023, -788976428),
|
||||
GOLD("Gold Mine", new HashMap<>(), mbEnums.ResourceType.GALVOR, -662193002, -1227205358),
|
||||
MAGIC("Magic Mine", new HashMap<>(), mbEnums.ResourceType.BLOODSTONE, 504746863, -1753567069);
|
||||
|
||||
public final String name;
|
||||
public final HashMap<Integer, Enum.ResourceType> resources;
|
||||
public final Enum.ResourceType xpac;
|
||||
public final HashMap<Integer, mbEnums.ResourceType> resources;
|
||||
public final mbEnums.ResourceType xpac;
|
||||
public final int hash;
|
||||
public final int xpacHash;
|
||||
|
||||
MineProduction(String name, HashMap<Integer, Enum.ResourceType> resources, Enum.ResourceType xpac, int hash, int xpacHash) {
|
||||
MineProduction(String name, HashMap<Integer, mbEnums.ResourceType> resources, mbEnums.ResourceType xpac, int hash, int xpacHash) {
|
||||
this.name = name;
|
||||
this.resources = resources;
|
||||
this.xpac = xpac;
|
||||
@@ -36,34 +36,34 @@ public enum MineProduction {
|
||||
|
||||
public static void addResources() {
|
||||
if (MineProduction.LUMBER.resources.size() == 0) {
|
||||
MineProduction.LUMBER.resources.put(7, Enum.ResourceType.GOLD);
|
||||
MineProduction.LUMBER.resources.put(1580004, Enum.ResourceType.LUMBER);
|
||||
MineProduction.LUMBER.resources.put(1580005, Enum.ResourceType.OAK);
|
||||
MineProduction.LUMBER.resources.put(1580006, Enum.ResourceType.BRONZEWOOD);
|
||||
MineProduction.LUMBER.resources.put(1580007, Enum.ResourceType.MANDRAKE);
|
||||
MineProduction.LUMBER.resources.put(7, mbEnums.ResourceType.GOLD);
|
||||
MineProduction.LUMBER.resources.put(1580004, mbEnums.ResourceType.LUMBER);
|
||||
MineProduction.LUMBER.resources.put(1580005, mbEnums.ResourceType.OAK);
|
||||
MineProduction.LUMBER.resources.put(1580006, mbEnums.ResourceType.BRONZEWOOD);
|
||||
MineProduction.LUMBER.resources.put(1580007, mbEnums.ResourceType.MANDRAKE);
|
||||
}
|
||||
if (MineProduction.ORE.resources.size() == 0) {
|
||||
MineProduction.ORE.resources.put(7, Enum.ResourceType.GOLD);
|
||||
MineProduction.ORE.resources.put(1580000, Enum.ResourceType.STONE);
|
||||
MineProduction.ORE.resources.put(1580001, Enum.ResourceType.TRUESTEEL);
|
||||
MineProduction.ORE.resources.put(1580002, Enum.ResourceType.IRON);
|
||||
MineProduction.ORE.resources.put(1580003, Enum.ResourceType.ADAMANT);
|
||||
MineProduction.ORE.resources.put(7, mbEnums.ResourceType.GOLD);
|
||||
MineProduction.ORE.resources.put(1580000, mbEnums.ResourceType.STONE);
|
||||
MineProduction.ORE.resources.put(1580001, mbEnums.ResourceType.TRUESTEEL);
|
||||
MineProduction.ORE.resources.put(1580002, mbEnums.ResourceType.IRON);
|
||||
MineProduction.ORE.resources.put(1580003, mbEnums.ResourceType.ADAMANT);
|
||||
}
|
||||
if (MineProduction.GOLD.resources.size() == 0) {
|
||||
MineProduction.GOLD.resources.put(7, Enum.ResourceType.GOLD);
|
||||
MineProduction.GOLD.resources.put(1580000, Enum.ResourceType.STONE);
|
||||
MineProduction.GOLD.resources.put(1580008, Enum.ResourceType.COAL);
|
||||
MineProduction.GOLD.resources.put(1580009, Enum.ResourceType.AGATE);
|
||||
MineProduction.GOLD.resources.put(1580010, Enum.ResourceType.DIAMOND);
|
||||
MineProduction.GOLD.resources.put(1580011, Enum.ResourceType.ONYX);
|
||||
MineProduction.GOLD.resources.put(7, mbEnums.ResourceType.GOLD);
|
||||
MineProduction.GOLD.resources.put(1580000, mbEnums.ResourceType.STONE);
|
||||
MineProduction.GOLD.resources.put(1580008, mbEnums.ResourceType.COAL);
|
||||
MineProduction.GOLD.resources.put(1580009, mbEnums.ResourceType.AGATE);
|
||||
MineProduction.GOLD.resources.put(1580010, mbEnums.ResourceType.DIAMOND);
|
||||
MineProduction.GOLD.resources.put(1580011, mbEnums.ResourceType.ONYX);
|
||||
}
|
||||
if (MineProduction.MAGIC.resources.size() == 0) {
|
||||
MineProduction.MAGIC.resources.put(7, Enum.ResourceType.GOLD);
|
||||
MineProduction.MAGIC.resources.put(1580012, Enum.ResourceType.AZOTH);
|
||||
MineProduction.MAGIC.resources.put(1580013, Enum.ResourceType.ORICHALK);
|
||||
MineProduction.MAGIC.resources.put(1580014, Enum.ResourceType.ANTIMONY);
|
||||
MineProduction.MAGIC.resources.put(1580015, Enum.ResourceType.SULFUR);
|
||||
MineProduction.MAGIC.resources.put(1580016, Enum.ResourceType.QUICKSILVER);
|
||||
MineProduction.MAGIC.resources.put(7, mbEnums.ResourceType.GOLD);
|
||||
MineProduction.MAGIC.resources.put(1580012, mbEnums.ResourceType.AZOTH);
|
||||
MineProduction.MAGIC.resources.put(1580013, mbEnums.ResourceType.ORICHALK);
|
||||
MineProduction.MAGIC.resources.put(1580014, mbEnums.ResourceType.ANTIMONY);
|
||||
MineProduction.MAGIC.resources.put(1580015, mbEnums.ResourceType.SULFUR);
|
||||
MineProduction.MAGIC.resources.put(1580016, mbEnums.ResourceType.QUICKSILVER);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public enum MineProduction {
|
||||
return MineProduction.MAGIC;
|
||||
}
|
||||
|
||||
public boolean validForMine(Enum.ResourceType r, boolean isXpac) {
|
||||
public boolean validForMine(mbEnums.ResourceType r, boolean isXpac) {
|
||||
if (r == null)
|
||||
return false;
|
||||
if (this.resources.containsKey(r.templateID))
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
package engine.objects;
|
||||
|
||||
import ch.claude_martin.enumbitset.EnumBitSet;
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.exception.SerializationException;
|
||||
import engine.gameManager.*;
|
||||
@@ -20,6 +18,8 @@ import engine.jobs.DeferredPowerJob;
|
||||
import engine.jobs.UpgradeNPCJob;
|
||||
import engine.math.Bounds;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.*;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -144,8 +144,8 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
this.runeSet = rs.getInt("runeSet");
|
||||
this.bootySet = rs.getInt("bootySet");
|
||||
|
||||
this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), Enum.MonsterType.class);
|
||||
this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), Enum.MonsterType.class);
|
||||
this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), mbEnums.MonsterType.class);
|
||||
this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), mbEnums.MonsterType.class);
|
||||
this.firstName = rs.getString("mob_name");
|
||||
|
||||
if (rs.getString("fsm").length() > 1)
|
||||
@@ -459,7 +459,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
minionMobile.deathTime = System.currentTimeMillis();
|
||||
minionMobile.guardCaptain = guardCaptain;
|
||||
minionMobile.spawnDelay = (int) (-2.500 * guardCaptain.building.getRank() + 22.5) * 60;
|
||||
minionMobile.behaviourType = Enum.MobBehaviourType.GuardMinion;
|
||||
minionMobile.behaviourType = mbEnums.MobBehaviourType.GuardMinion;
|
||||
minionMobile.agentType = AIAgentType.GUARDMINION;
|
||||
minionMobile.guardedCity = guardCaptain.guardedCity;
|
||||
minionMobile.patrolPoints = guardCaptain.building.patrolPoints;
|
||||
@@ -469,7 +469,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
|
||||
//grab name from minionbase.
|
||||
|
||||
Enum.MinionType minionType = Enum.MinionType.ContractToMinionMap.get(guardCaptain.contract.getContractID());
|
||||
mbEnums.MinionType minionType = mbEnums.MinionType.ContractToMinionMap.get(guardCaptain.contract.getContractID());
|
||||
|
||||
if (minionType != null) {
|
||||
String rank;
|
||||
@@ -882,7 +882,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
this.hasLoot = false;
|
||||
this.playerAgroMap.clear();
|
||||
|
||||
if (this.behaviourType.ordinal() == Enum.MobBehaviourType.GuardMinion.ordinal())
|
||||
if (this.behaviourType.ordinal() == mbEnums.MobBehaviourType.GuardMinion.ordinal())
|
||||
this.spawnDelay = (int) (-2.500 * this.guardCaptain.building.getRank() + 22.5) * 60;
|
||||
|
||||
if (this.isPet()) {
|
||||
@@ -897,7 +897,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
|
||||
|
||||
dispatch = Dispatch.borrow((PlayerCharacter) this.guardCaptain, petMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -925,7 +925,7 @@ public class Mob extends AbstractIntelligenceAgent implements Delayed {
|
||||
petOwner.setPet(null);
|
||||
PetMsg petMsg = new PetMsg(5, null);
|
||||
dispatch = Dispatch.borrow(petOwner, petMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
package engine.objects;
|
||||
|
||||
import ch.claude_martin.enumbitset.EnumBitSet;
|
||||
import engine.Enum;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.LootManager;
|
||||
import engine.loot.BootySetEntry;
|
||||
import engine.mbEnums;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
@@ -29,16 +29,16 @@ public class MobBase extends AbstractGameObject {
|
||||
private final float scale;
|
||||
public final ArrayList<MobBaseEffects> effectsList;
|
||||
public int bootySet;
|
||||
public Enum.MobBehaviourType fsm;
|
||||
public EnumBitSet<Enum.MonsterType> notEnemy;
|
||||
public EnumBitSet<Enum.MonsterType> enemy;
|
||||
public mbEnums.MobBehaviourType fsm;
|
||||
public EnumBitSet<mbEnums.MonsterType> notEnemy;
|
||||
public EnumBitSet<mbEnums.MonsterType> enemy;
|
||||
private float healthMax;
|
||||
private int attackRating;
|
||||
private int defenseRating;
|
||||
private float damageMin;
|
||||
private float damageMax;
|
||||
private float hitBoxRadius;
|
||||
private EnumBitSet<Enum.MobFlagType> flags;
|
||||
private EnumBitSet<mbEnums.MobFlagType> flags;
|
||||
private int mask;
|
||||
private int goldMod;
|
||||
private int seeInvis;
|
||||
@@ -74,11 +74,11 @@ public class MobBase extends AbstractGameObject {
|
||||
this.attackRange = rs.getFloat("attackRange");
|
||||
this.bootySet = rs.getInt("bootySet");
|
||||
|
||||
this.fsm = Enum.MobBehaviourType.valueOf(rs.getString("fsm"));
|
||||
this.fsm = mbEnums.MobBehaviourType.valueOf(rs.getString("fsm"));
|
||||
|
||||
this.flags = EnumBitSet.asEnumBitSet(rs.getLong("flags"), Enum.MobFlagType.class);
|
||||
this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), Enum.MonsterType.class);
|
||||
this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), Enum.MonsterType.class);
|
||||
this.flags = EnumBitSet.asEnumBitSet(rs.getLong("flags"), mbEnums.MobFlagType.class);
|
||||
this.notEnemy = EnumBitSet.asEnumBitSet(rs.getLong("notEnemy"), mbEnums.MonsterType.class);
|
||||
this.enemy = EnumBitSet.asEnumBitSet(rs.getLong("enemy"), mbEnums.MonsterType.class);
|
||||
|
||||
this.seeInvis = rs.getInt("seeInvis");
|
||||
this.scale = rs.getFloat("scale");
|
||||
@@ -88,19 +88,19 @@ public class MobBase extends AbstractGameObject {
|
||||
if (this.getObjectUUID() == 12021 || this.getObjectUUID() == 12022)
|
||||
this.isNecroPet = true;
|
||||
|
||||
if (Enum.MobFlagType.HUMANOID.elementOf(this.flags))
|
||||
if (mbEnums.MobFlagType.HUMANOID.elementOf(this.flags))
|
||||
this.mask += MBServerStatics.MASK_HUMANOID;
|
||||
|
||||
if (Enum.MobFlagType.UNDEAD.elementOf(this.flags))
|
||||
if (mbEnums.MobFlagType.UNDEAD.elementOf(this.flags))
|
||||
this.mask += MBServerStatics.MASK_UNDEAD;
|
||||
|
||||
if (Enum.MobFlagType.BEAST.elementOf(this.flags))
|
||||
if (mbEnums.MobFlagType.BEAST.elementOf(this.flags))
|
||||
this.mask += MBServerStatics.MASK_BEAST;
|
||||
|
||||
if (Enum.MobFlagType.DRAGON.elementOf(this.flags))
|
||||
if (mbEnums.MobFlagType.DRAGON.elementOf(this.flags))
|
||||
this.mask += MBServerStatics.MASK_DRAGON;
|
||||
|
||||
if (Enum.MobFlagType.RAT.elementOf(this.flags))
|
||||
if (mbEnums.MobFlagType.RAT.elementOf(this.flags))
|
||||
this.mask += MBServerStatics.MASK_RAT;
|
||||
|
||||
this.mobBaseStats = DbManager.MobBaseQueries.LOAD_STATS(this.loadID);
|
||||
@@ -110,10 +110,10 @@ public class MobBase extends AbstractGameObject {
|
||||
|
||||
}
|
||||
|
||||
public static ConcurrentHashMap<Enum.EquipSlotType, Item> loadEquipmentSet(int equipmentSetID) {
|
||||
public static ConcurrentHashMap<mbEnums.EquipSlotType, Item> loadEquipmentSet(int equipmentSetID) {
|
||||
|
||||
ArrayList<BootySetEntry> equipList;
|
||||
ConcurrentHashMap<Enum.EquipSlotType, Item> equip = new ConcurrentHashMap<>();
|
||||
ConcurrentHashMap<mbEnums.EquipSlotType, Item> equip = new ConcurrentHashMap<>();
|
||||
|
||||
if (equipmentSetID == 0)
|
||||
return equip;
|
||||
@@ -203,7 +203,7 @@ public class MobBase extends AbstractGameObject {
|
||||
return this.defenseRating;
|
||||
}
|
||||
|
||||
public EnumBitSet<Enum.MobFlagType> getFlags() {
|
||||
public EnumBitSet<mbEnums.MobFlagType> getFlags() {
|
||||
return this.flags;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ItemType;
|
||||
import engine.Enum.OwnerType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ItemType;
|
||||
import engine.mbEnums.OwnerType;
|
||||
import engine.powers.poweractions.AbstractPowerAction;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
@@ -38,7 +38,7 @@ public final class MobLoot extends Item {
|
||||
}
|
||||
|
||||
public MobLoot(AbstractCharacter mob, int qtyOfGold) {
|
||||
this(mob, ItemTemplate.templates.get(Enum.ResourceType.GOLD.templateID), qtyOfGold, false);
|
||||
this(mob, ItemTemplate.templates.get(mbEnums.ResourceType.GOLD.templateID), qtyOfGold, false);
|
||||
}
|
||||
|
||||
public MobLoot(AbstractCharacter mob, ItemTemplate template, int quantity, boolean noSteal) {
|
||||
@@ -68,7 +68,7 @@ public final class MobLoot extends Item {
|
||||
* @return MobLoot object
|
||||
*/
|
||||
public static MobLoot getFromCache(int id) {
|
||||
return (MobLoot) DbManager.getFromCache(Enum.GameObjectType.MobLoot, id);
|
||||
return (MobLoot) DbManager.getFromCache(mbEnums.GameObjectType.MobLoot, id);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,7 +114,7 @@ public final class MobLoot extends Item {
|
||||
Item item = this;
|
||||
|
||||
item.setOwner(looter);
|
||||
item.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
item.containerType = mbEnums.ItemContainerType.INVENTORY;
|
||||
item.setValue(0);
|
||||
|
||||
if (this.getNumOfItems() > 1)
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.exception.SerializationException;
|
||||
import engine.gameManager.*;
|
||||
@@ -20,6 +18,8 @@ import engine.jobs.UpgradeNPCJob;
|
||||
import engine.math.Bounds;
|
||||
import engine.math.Vector3f;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.*;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -671,7 +671,7 @@ public class NPC extends AbstractCharacter {
|
||||
|
||||
PetMsg petMsg = new PetMsg(5, null);
|
||||
Dispatch dispatch = Dispatch.borrow(petOwner, petMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.PRIMARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.PRIMARY);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -940,7 +940,7 @@ public class NPC extends AbstractCharacter {
|
||||
|
||||
ml.setValue(producedItem.getValue());
|
||||
ml.setDateToUpgrade(producedItem.getDateToUpgrade().getMillis());
|
||||
ml.containerType = Enum.ItemContainerType.FORGE;
|
||||
ml.containerType = mbEnums.ItemContainerType.FORGE;
|
||||
this.addItemToForge(ml);
|
||||
|
||||
} else {
|
||||
@@ -956,7 +956,7 @@ public class NPC extends AbstractCharacter {
|
||||
}
|
||||
|
||||
ml.setDateToUpgrade(producedItem.getDateToUpgrade().getMillis());
|
||||
ml.containerType = Enum.ItemContainerType.INVENTORY;
|
||||
ml.containerType = mbEnums.ItemContainerType.INVENTORY;
|
||||
ml.flags.add(ItemFlags.Identified);
|
||||
|
||||
this.charItemManager.addItemToInventory(ml);
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.ProfitType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums.ProfitType;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ModType;
|
||||
import engine.mbEnums.SourceType;
|
||||
import engine.powers.DamageShield;
|
||||
import engine.powers.EffectsBase;
|
||||
import engine.powers.effectmodifiers.AbstractEffectModifier;
|
||||
@@ -53,7 +53,7 @@ public class PlayerBonuses {
|
||||
public static void InitializeBonuses(PlayerCharacter player) {
|
||||
if (player.bonuses == null)
|
||||
return;
|
||||
if (ConfigManager.serverType.equals(Enum.ServerType.LOGINSERVER))
|
||||
if (ConfigManager.serverType.equals(mbEnums.ServerType.LOGINSERVER))
|
||||
return;
|
||||
|
||||
player.bonuses.calculateRuneBaseEffects(player);
|
||||
@@ -61,9 +61,9 @@ public class PlayerBonuses {
|
||||
|
||||
public static PlayerBonuses grantBonuses(AbstractCharacter ac) {
|
||||
|
||||
if (ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter))
|
||||
if (ac.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter))
|
||||
return new PlayerBonuses((PlayerCharacter) ac);
|
||||
else if (ac.getObjectType().equals(Enum.GameObjectType.Mob))
|
||||
else if (ac.getObjectType().equals(mbEnums.GameObjectType.Mob))
|
||||
return new PlayerBonuses((Mob) ac);
|
||||
else
|
||||
return null;
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.*;
|
||||
import engine.InterestManagement.InterestManager;
|
||||
import engine.InterestManagement.RealmMap;
|
||||
import engine.InterestManagement.Terrain;
|
||||
@@ -29,6 +27,8 @@ import engine.jobs.NoTimeJob;
|
||||
import engine.math.Bounds;
|
||||
import engine.math.FastMath;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.*;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
@@ -364,7 +364,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
writer.putInt(0); // Pad
|
||||
writer.putInt(playerCharacter.subRaceID);
|
||||
|
||||
writer.putInt(Enum.GameObjectType.Race.ordinal());
|
||||
writer.putInt(mbEnums.GameObjectType.Race.ordinal());
|
||||
writer.putInt(playerCharacter.subRaceID);
|
||||
} else
|
||||
playerCharacter.race.serializeForClientMsg(writer);
|
||||
@@ -2156,14 +2156,14 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
//handle rented room binds.
|
||||
|
||||
if (bindBuilding == null) {
|
||||
bindLocation = Enum.Ruins.getRandomRuin().getLocation();
|
||||
bindLocation = mbEnums.Ruins.getRandomRuin().getLocation();
|
||||
return bindLocation;
|
||||
}
|
||||
|
||||
bindLocation = BuildingManager.GetBindLocationForBuilding(bindBuilding);
|
||||
|
||||
if (bindLocation == null)
|
||||
bindLocation = Enum.Ruins.getRandomRuin().getLocation();
|
||||
bindLocation = mbEnums.Ruins.getRandomRuin().getLocation();
|
||||
|
||||
return bindLocation;
|
||||
|
||||
@@ -4030,7 +4030,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
|
||||
//assign enum values for restrictions
|
||||
String race = this.race.getName().replace("-", "").replace(", Male", "").replace(", Female", "");
|
||||
this.absRace = Enum.MonsterType.valueOf(race);
|
||||
this.absRace = mbEnums.MonsterType.valueOf(race);
|
||||
|
||||
if (this.baseClass != null)
|
||||
this.absBaseClass = ClassType.valueOf(this.baseClass.getName());
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.SessionManager;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.UpdateFriendStatusMessage;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.PortalType;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.gameManager.ConfigManager;
|
||||
import engine.job.JobScheduler;
|
||||
import engine.jobs.CloseGateJob;
|
||||
import engine.math.Vector3fImmutable;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.PortalType;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
import java.util.HashSet;
|
||||
@@ -19,7 +19,7 @@ import java.util.HashSet;
|
||||
public class Portal {
|
||||
|
||||
public final Vector3fImmutable portalLocation;
|
||||
public Enum.PortalType portalType;
|
||||
public mbEnums.PortalType portalType;
|
||||
public Building sourceGate;
|
||||
public Building targetGate;
|
||||
private boolean active;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.msg.ItemProductionMsg;
|
||||
import engine.powers.EffectsBase;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.net.ByteBufferWriter;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.RaceType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.RaceType;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class Race {
|
||||
private final ArrayList<BaseClass> baseClasses;
|
||||
private final ArrayList<SkillReq> skillsGranted;
|
||||
private final ArrayList<PowerReq> powersGranted;
|
||||
private Enum.RaceType raceType;
|
||||
private mbEnums.RaceType raceType;
|
||||
private int token = 0;
|
||||
private HashSet<Integer> hairStyles;
|
||||
private HashSet<Integer> beardStyles;
|
||||
@@ -69,7 +69,7 @@ public class Race {
|
||||
public Race(ResultSet rs) throws SQLException {
|
||||
|
||||
this.raceRuneID = rs.getInt("ID");
|
||||
this.raceType = Enum.RaceType.getRaceTypebyRuneID(raceRuneID);
|
||||
this.raceType = mbEnums.RaceType.getRaceTypebyRuneID(raceRuneID);
|
||||
this.name = rs.getString("name");
|
||||
this.description = rs.getString("description");
|
||||
this.strStart = rs.getShort("strStart");
|
||||
@@ -335,7 +335,7 @@ public class Race {
|
||||
writer.putInt(0); // Pad
|
||||
writer.putInt(this.raceRuneID);
|
||||
|
||||
writer.putInt(Enum.GameObjectType.Race.ordinal());
|
||||
writer.putInt(mbEnums.GameObjectType.Race.ordinal());
|
||||
writer.putInt(raceRuneID);
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ public class Race {
|
||||
return raceRuneID;
|
||||
}
|
||||
|
||||
public Enum.RaceType getRaceType() {
|
||||
public mbEnums.RaceType getRaceType() {
|
||||
return raceType;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.InterestManagement.RealmMap;
|
||||
import engine.InterestManagement.WorldGrid;
|
||||
import engine.db.archive.DataWarehouse;
|
||||
@@ -18,6 +17,7 @@ import engine.gameManager.BuildingManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.gameManager.GuildManager;
|
||||
import engine.gameManager.PowersManager;
|
||||
import engine.mbEnums;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.net.client.msg.ErrorPopupMsg;
|
||||
import engine.powers.PowersBase;
|
||||
@@ -32,7 +32,7 @@ import java.time.ZoneId;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import static engine.Enum.CharterType;
|
||||
import static engine.mbEnums.CharterType;
|
||||
|
||||
|
||||
public class Realm {
|
||||
@@ -234,27 +234,27 @@ public class Realm {
|
||||
return false;
|
||||
}
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.GOLD);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.GOLD);
|
||||
|
||||
if (resourceValue < 5000000)
|
||||
hasResources = false;
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.STONE);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.STONE);
|
||||
|
||||
if (resourceValue < 8000)
|
||||
hasResources = false;
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.LUMBER);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.LUMBER);
|
||||
|
||||
if (resourceValue < 8000)
|
||||
hasResources = false;
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.GALVOR);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.GALVOR);
|
||||
|
||||
if (resourceValue < 15)
|
||||
hasResources = false;
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.WORMWOOD);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.WORMWOOD);
|
||||
|
||||
if (resourceValue < 15)
|
||||
hasResources = false;
|
||||
@@ -266,50 +266,50 @@ public class Realm {
|
||||
|
||||
// Remove resources from warehouse before claiming realm
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.GOLD);
|
||||
warehouse.resources.put(Enum.ResourceType.GOLD, resourceValue - 5000000);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.GOLD);
|
||||
warehouse.resources.put(mbEnums.ResourceType.GOLD, resourceValue - 5000000);
|
||||
|
||||
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
|
||||
Logger.error("gold update failed for warehouse of city:" + warehouse.city.getName());
|
||||
warehouse.resources.put(Enum.ResourceType.GOLD, resourceValue);
|
||||
warehouse.resources.put(mbEnums.ResourceType.GOLD, resourceValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
Warehouse.AddTransactionToWarehouse(warehouse, Enum.GameObjectType.Building, tol.getObjectUUID(), Enum.TransactionType.WITHDRAWL, Enum.ResourceType.GOLD, 5000000);
|
||||
Warehouse.AddTransactionToWarehouse(warehouse, mbEnums.GameObjectType.Building, tol.getObjectUUID(), mbEnums.TransactionType.WITHDRAWL, mbEnums.ResourceType.GOLD, 5000000);
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.STONE);
|
||||
warehouse.resources.put(Enum.ResourceType.STONE, resourceValue - 8000);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.STONE);
|
||||
warehouse.resources.put(mbEnums.ResourceType.STONE, resourceValue - 8000);
|
||||
|
||||
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
|
||||
Logger.error("stone update failed for warehouse of city:" + warehouse.city.getName());
|
||||
warehouse.resources.put(Enum.ResourceType.STONE, resourceValue);
|
||||
warehouse.resources.put(mbEnums.ResourceType.STONE, resourceValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.LUMBER);
|
||||
warehouse.resources.put(Enum.ResourceType.LUMBER, resourceValue - 8000);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.LUMBER);
|
||||
warehouse.resources.put(mbEnums.ResourceType.LUMBER, resourceValue - 8000);
|
||||
|
||||
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
|
||||
Logger.error("lumber update failed for warehouse of city:" + warehouse.city.getName());
|
||||
warehouse.resources.put(Enum.ResourceType.LUMBER, resourceValue);
|
||||
warehouse.resources.put(mbEnums.ResourceType.LUMBER, resourceValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.GALVOR);
|
||||
warehouse.resources.put(Enum.ResourceType.GALVOR, resourceValue - 15);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.GALVOR);
|
||||
warehouse.resources.put(mbEnums.ResourceType.GALVOR, resourceValue - 15);
|
||||
|
||||
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
|
||||
Logger.error("GALVOR update failed for warehouse of city:" + warehouse.city.getName());
|
||||
warehouse.resources.put(Enum.ResourceType.GALVOR, resourceValue);
|
||||
warehouse.resources.put(mbEnums.ResourceType.GALVOR, resourceValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
resourceValue = warehouse.resources.get(Enum.ResourceType.WORMWOOD);
|
||||
warehouse.resources.put(Enum.ResourceType.WORMWOOD, resourceValue - 15);
|
||||
resourceValue = warehouse.resources.get(mbEnums.ResourceType.WORMWOOD);
|
||||
warehouse.resources.put(mbEnums.ResourceType.WORMWOOD, resourceValue - 15);
|
||||
|
||||
if (!DbManager.WarehouseQueries.UPDATE_WAREHOUSE(warehouse)) {
|
||||
Logger.error("WORMWOOD update failed for warehouse of city:" + warehouse.city.getName());
|
||||
warehouse.resources.put(Enum.ResourceType.WORMWOOD, resourceValue);
|
||||
warehouse.resources.put(mbEnums.ResourceType.WORMWOOD, resourceValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ public class Realm {
|
||||
if (building.getBlueprintUUID() != 0) {
|
||||
|
||||
// TOL Health set through regular linear equation
|
||||
if (building.getBlueprint().getBuildingGroup() == Enum.BuildingGroup.TOL) {
|
||||
if (building.getBlueprint().getBuildingGroup() == mbEnums.BuildingGroup.TOL) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -442,13 +442,13 @@ public class Realm {
|
||||
writer.putString(this.realmName);
|
||||
|
||||
if (isRuled() == true) {
|
||||
writer.putInt(Enum.GameObjectType.Guild.ordinal());
|
||||
writer.putInt(mbEnums.GameObjectType.Guild.ordinal());
|
||||
writer.putInt(rulingNationUUID);
|
||||
|
||||
writer.putInt(rulingCharacterOrdinal);
|
||||
writer.putInt(rulingCharacterUUID);
|
||||
|
||||
writer.putInt(Enum.GameObjectType.City.ordinal());
|
||||
writer.putInt(mbEnums.GameObjectType.City.ordinal());
|
||||
writer.putInt(rulingCityUUID);
|
||||
|
||||
writer.putLocalDateTime(this.ruledSince);
|
||||
@@ -505,7 +505,7 @@ public class Realm {
|
||||
|
||||
// Push event to warehouse
|
||||
|
||||
RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.LOST);
|
||||
RealmRecord realmRecord = RealmRecord.borrow(this, mbEnums.RecordEventType.LOST);
|
||||
DataWarehouse.pushToWarehouse(realmRecord);
|
||||
|
||||
// No longer own a realm
|
||||
@@ -532,7 +532,7 @@ public class Realm {
|
||||
|
||||
// Push event to warehouse
|
||||
|
||||
RealmRecord realmRecord = RealmRecord.borrow(this, Enum.RecordEventType.CAPTURE);
|
||||
RealmRecord realmRecord = RealmRecord.borrow(this, mbEnums.RecordEventType.CAPTURE);
|
||||
DataWarehouse.pushToWarehouse(realmRecord);
|
||||
|
||||
}
|
||||
|
||||
+110
-110
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ModType;
|
||||
import engine.Enum.SourceType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.ModType;
|
||||
import engine.mbEnums.SourceType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -26,9 +26,9 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
public class Resists {
|
||||
|
||||
private static ConcurrentHashMap<Integer, Resists> mobResists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
private ConcurrentHashMap<Enum.DamageType, Float> resists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
private ConcurrentHashMap<Enum.DamageType, Boolean> immuneTo = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
private Enum.DamageType protection;
|
||||
private ConcurrentHashMap<mbEnums.DamageType, Float> resists = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
private ConcurrentHashMap<mbEnums.DamageType, Boolean> immuneTo = new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);
|
||||
private mbEnums.DamageType protection;
|
||||
private int protectionTrains = 0;
|
||||
private boolean immuneToAll;
|
||||
|
||||
@@ -51,9 +51,9 @@ public class Resists {
|
||||
}
|
||||
|
||||
public Resists(Resists r) {
|
||||
for (Enum.DamageType dt : r.resists.keySet())
|
||||
for (mbEnums.DamageType dt : r.resists.keySet())
|
||||
this.resists.put(dt, r.resists.get(dt));
|
||||
for (Enum.DamageType dt : r.immuneTo.keySet())
|
||||
for (mbEnums.DamageType dt : r.immuneTo.keySet())
|
||||
this.immuneTo.put(dt, r.immuneTo.get(dt));
|
||||
this.protection = r.protection;
|
||||
this.protectionTrains = r.protectionTrains;
|
||||
@@ -83,30 +83,30 @@ public class Resists {
|
||||
*/
|
||||
public Resists(ResultSet rs) throws SQLException {
|
||||
this.immuneToAll = false;
|
||||
this.resists.put(Enum.DamageType.SLASHING, rs.getFloat("slash"));
|
||||
this.resists.put(Enum.DamageType.CRUSHING, rs.getFloat("crush"));
|
||||
this.resists.put(Enum.DamageType.PIERCING, rs.getFloat("pierce"));
|
||||
this.resists.put(Enum.DamageType.MAGIC, rs.getFloat("magic"));
|
||||
this.resists.put(Enum.DamageType.BLEEDING, rs.getFloat("bleed"));
|
||||
this.resists.put(Enum.DamageType.POISON, rs.getFloat("poison"));
|
||||
this.resists.put(Enum.DamageType.MENTAL, rs.getFloat("mental"));
|
||||
this.resists.put(Enum.DamageType.HOLY, rs.getFloat("holy"));
|
||||
this.resists.put(Enum.DamageType.UNHOLY, rs.getFloat("unholy"));
|
||||
this.resists.put(Enum.DamageType.LIGHTNING, rs.getFloat("lightning"));
|
||||
this.resists.put(Enum.DamageType.FIRE, rs.getFloat("fire"));
|
||||
this.resists.put(Enum.DamageType.COLD, rs.getFloat("cold"));
|
||||
this.resists.put(Enum.DamageType.HEALING, 0f);
|
||||
this.resists.put(mbEnums.DamageType.SLASHING, rs.getFloat("slash"));
|
||||
this.resists.put(mbEnums.DamageType.CRUSHING, rs.getFloat("crush"));
|
||||
this.resists.put(mbEnums.DamageType.PIERCING, rs.getFloat("pierce"));
|
||||
this.resists.put(mbEnums.DamageType.MAGIC, rs.getFloat("magic"));
|
||||
this.resists.put(mbEnums.DamageType.BLEEDING, rs.getFloat("bleed"));
|
||||
this.resists.put(mbEnums.DamageType.POISON, rs.getFloat("poison"));
|
||||
this.resists.put(mbEnums.DamageType.MENTAL, rs.getFloat("mental"));
|
||||
this.resists.put(mbEnums.DamageType.HOLY, rs.getFloat("holy"));
|
||||
this.resists.put(mbEnums.DamageType.UNHOLY, rs.getFloat("unholy"));
|
||||
this.resists.put(mbEnums.DamageType.LIGHTNING, rs.getFloat("lightning"));
|
||||
this.resists.put(mbEnums.DamageType.FIRE, rs.getFloat("fire"));
|
||||
this.resists.put(mbEnums.DamageType.COLD, rs.getFloat("cold"));
|
||||
this.resists.put(mbEnums.DamageType.HEALING, 0f);
|
||||
}
|
||||
|
||||
//Handle Fortitudes
|
||||
private static float handleFortitude(AbstractCharacter target, Enum.DamageType type, float damage) {
|
||||
if (target == null || !(target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)))
|
||||
private static float handleFortitude(AbstractCharacter target, mbEnums.DamageType type, float damage) {
|
||||
if (target == null || !(target.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)))
|
||||
return damage;
|
||||
PlayerBonuses bonus = target.getBonuses();
|
||||
|
||||
//see if there is a fortitude
|
||||
float damageCap = bonus.getFloatPercentAll(ModType.DamageCap, SourceType.None);
|
||||
if (damageCap == 0f || type == Enum.DamageType.HEALING)
|
||||
if (damageCap == 0f || type == mbEnums.DamageType.HEALING)
|
||||
return damage;
|
||||
|
||||
//is fortitude, Are we under the cap?
|
||||
@@ -133,11 +133,11 @@ public class Resists {
|
||||
}
|
||||
|
||||
//Test if Damagetype is valid for foritude
|
||||
private static boolean isValidDamageCapType(HashSet<SourceType> forts, Enum.DamageType damageType, boolean exclusive) {
|
||||
private static boolean isValidDamageCapType(HashSet<SourceType> forts, mbEnums.DamageType damageType, boolean exclusive) {
|
||||
for (SourceType fort : forts) {
|
||||
Enum.DamageType dt = Enum.DamageType.getDamageType(fort.name());
|
||||
mbEnums.DamageType dt = mbEnums.DamageType.getDamageType(fort.name());
|
||||
|
||||
if (dt.equals(Enum.DamageType.NONE))
|
||||
if (dt.equals(mbEnums.DamageType.NONE))
|
||||
continue;
|
||||
|
||||
if (dt.equals(damageType)) {
|
||||
@@ -162,7 +162,7 @@ public class Resists {
|
||||
if (armor == null)
|
||||
return phys;
|
||||
|
||||
if (armor.template.item_type.equals(Enum.ItemType.ARMOR)) {
|
||||
if (armor.template.item_type.equals(mbEnums.ItemType.ARMOR)) {
|
||||
phys[0] += armor.template.combat_attack_resist.get("SLASHING");
|
||||
phys[1] += armor.template.combat_attack_resist.get("CRUSHING");
|
||||
phys[2] += armor.template.combat_attack_resist.get("PIERCING");
|
||||
@@ -195,19 +195,19 @@ public class Resists {
|
||||
*/
|
||||
public final void setBuildingResists() {
|
||||
this.immuneToAll = false;
|
||||
this.resists.put(Enum.DamageType.SLASHING, 85f);
|
||||
this.resists.put(Enum.DamageType.CRUSHING, 85f);
|
||||
this.resists.put(Enum.DamageType.SIEGE, 0f);
|
||||
this.immuneTo.put(Enum.DamageType.PIERCING, true);
|
||||
this.immuneTo.put(Enum.DamageType.MAGIC, true);
|
||||
this.immuneTo.put(Enum.DamageType.BLEEDING, true);
|
||||
this.immuneTo.put(Enum.DamageType.POISON, true);
|
||||
this.immuneTo.put(Enum.DamageType.MENTAL, true);
|
||||
this.immuneTo.put(Enum.DamageType.HOLY, true);
|
||||
this.immuneTo.put(Enum.DamageType.UNHOLY, true);
|
||||
this.immuneTo.put(Enum.DamageType.LIGHTNING, true);
|
||||
this.immuneTo.put(Enum.DamageType.FIRE, true);
|
||||
this.immuneTo.put(Enum.DamageType.COLD, true);
|
||||
this.resists.put(mbEnums.DamageType.SLASHING, 85f);
|
||||
this.resists.put(mbEnums.DamageType.CRUSHING, 85f);
|
||||
this.resists.put(mbEnums.DamageType.SIEGE, 0f);
|
||||
this.immuneTo.put(mbEnums.DamageType.PIERCING, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.MAGIC, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.BLEEDING, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.POISON, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.MENTAL, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.HOLY, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.UNHOLY, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.LIGHTNING, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.FIRE, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.COLD, true);
|
||||
|
||||
}
|
||||
|
||||
@@ -216,19 +216,19 @@ public class Resists {
|
||||
*/
|
||||
public final void setMineResists() {
|
||||
this.immuneToAll = false;
|
||||
this.immuneTo.put(Enum.DamageType.SLASHING, true);
|
||||
this.immuneTo.put(Enum.DamageType.CRUSHING, true);
|
||||
this.immuneTo.put(Enum.DamageType.PIERCING, true);
|
||||
this.immuneTo.put(Enum.DamageType.MAGIC, true);
|
||||
this.immuneTo.put(Enum.DamageType.BLEEDING, true);
|
||||
this.immuneTo.put(Enum.DamageType.POISON, true);
|
||||
this.immuneTo.put(Enum.DamageType.MENTAL, true);
|
||||
this.immuneTo.put(Enum.DamageType.HOLY, true);
|
||||
this.immuneTo.put(Enum.DamageType.UNHOLY, true);
|
||||
this.immuneTo.put(Enum.DamageType.LIGHTNING, true);
|
||||
this.immuneTo.put(Enum.DamageType.FIRE, true);
|
||||
this.immuneTo.put(Enum.DamageType.COLD, true);
|
||||
this.resists.put(Enum.DamageType.SIEGE, 0f);
|
||||
this.immuneTo.put(mbEnums.DamageType.SLASHING, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.CRUSHING, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.PIERCING, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.MAGIC, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.BLEEDING, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.POISON, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.MENTAL, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.HOLY, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.UNHOLY, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.LIGHTNING, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.FIRE, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.COLD, true);
|
||||
this.resists.put(mbEnums.DamageType.SIEGE, 0f);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -236,27 +236,27 @@ public class Resists {
|
||||
*/
|
||||
public final void setGenericResists() {
|
||||
this.immuneToAll = false;
|
||||
this.resists.put(Enum.DamageType.SLASHING, 0f);
|
||||
this.resists.put(Enum.DamageType.CRUSHING, 0f);
|
||||
this.resists.put(Enum.DamageType.PIERCING, 0f);
|
||||
this.resists.put(Enum.DamageType.MAGIC, 0f);
|
||||
this.resists.put(Enum.DamageType.BLEEDING, 0f);
|
||||
this.resists.put(Enum.DamageType.POISON, 0f);
|
||||
this.resists.put(Enum.DamageType.MENTAL, 0f);
|
||||
this.resists.put(Enum.DamageType.HOLY, 0f);
|
||||
this.resists.put(Enum.DamageType.UNHOLY, 0f);
|
||||
this.resists.put(Enum.DamageType.LIGHTNING, 0f);
|
||||
this.resists.put(Enum.DamageType.FIRE, 0f);
|
||||
this.resists.put(Enum.DamageType.COLD, 0f);
|
||||
this.resists.put(Enum.DamageType.HEALING, 0f);
|
||||
this.immuneTo.put(Enum.DamageType.SIEGE, true);
|
||||
this.resists.put(mbEnums.DamageType.SLASHING, 0f);
|
||||
this.resists.put(mbEnums.DamageType.CRUSHING, 0f);
|
||||
this.resists.put(mbEnums.DamageType.PIERCING, 0f);
|
||||
this.resists.put(mbEnums.DamageType.MAGIC, 0f);
|
||||
this.resists.put(mbEnums.DamageType.BLEEDING, 0f);
|
||||
this.resists.put(mbEnums.DamageType.POISON, 0f);
|
||||
this.resists.put(mbEnums.DamageType.MENTAL, 0f);
|
||||
this.resists.put(mbEnums.DamageType.HOLY, 0f);
|
||||
this.resists.put(mbEnums.DamageType.UNHOLY, 0f);
|
||||
this.resists.put(mbEnums.DamageType.LIGHTNING, 0f);
|
||||
this.resists.put(mbEnums.DamageType.FIRE, 0f);
|
||||
this.resists.put(mbEnums.DamageType.COLD, 0f);
|
||||
this.resists.put(mbEnums.DamageType.HEALING, 0f);
|
||||
this.immuneTo.put(mbEnums.DamageType.SIEGE, true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a resist
|
||||
*/
|
||||
public float getResist(Enum.DamageType type, int trains) {
|
||||
public float getResist(mbEnums.DamageType type, int trains) {
|
||||
//get resisted amount
|
||||
Float amount = 0f;
|
||||
if (this.resists.containsKey(type))
|
||||
@@ -278,7 +278,7 @@ public class Resists {
|
||||
/**
|
||||
* get immuneTo
|
||||
*/
|
||||
public boolean immuneTo(Enum.DamageType type) {
|
||||
public boolean immuneTo(mbEnums.DamageType type) {
|
||||
if (this.immuneTo.containsKey(type))
|
||||
return this.immuneTo.get(type);
|
||||
else
|
||||
@@ -293,13 +293,13 @@ public class Resists {
|
||||
}
|
||||
|
||||
public boolean immuneToAttacks() {
|
||||
return immuneTo(Enum.DamageType.ATTACK);
|
||||
return immuneTo(mbEnums.DamageType.ATTACK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a resist
|
||||
*/
|
||||
public void setResist(Enum.DamageType type, float value) {
|
||||
public void setResist(mbEnums.DamageType type, float value) {
|
||||
this.resists.put(type, value);
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ public class Resists {
|
||||
* get Damage after resist
|
||||
* Expects heals as negative damage and damage as positive damage for fortitudes.
|
||||
*/
|
||||
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, Enum.DamageType type, float damage, int trains) {
|
||||
public float getResistedDamage(AbstractCharacter source, AbstractCharacter target, mbEnums.DamageType type, float damage, int trains) {
|
||||
//handle fortitudes
|
||||
damage = handleFortitude(target, type, damage);
|
||||
|
||||
@@ -347,25 +347,25 @@ public class Resists {
|
||||
if (rb != null) {
|
||||
// Handle immunities
|
||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Stun))
|
||||
this.immuneTo.put(Enum.DamageType.STUN, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.STUN, true);
|
||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Blind))
|
||||
this.immuneTo.put(Enum.DamageType.BLIND, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.BLIND, true);
|
||||
if (rb.getBool(ModType.ImmuneToAttack, SourceType.None))
|
||||
this.immuneTo.put(Enum.DamageType.ATTACK, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.ATTACK, true);
|
||||
if (rb.getBool(ModType.ImmuneToPowers, SourceType.None))
|
||||
this.immuneTo.put(Enum.DamageType.POWERS, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.POWERS, true);
|
||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Powerblock))
|
||||
this.immuneTo.put(Enum.DamageType.POWERBLOCK, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.POWERBLOCK, true);
|
||||
if (rb.getBool(ModType.ImmuneTo, SourceType.DeBuff))
|
||||
this.immuneTo.put(Enum.DamageType.DEBUFF, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.DEBUFF, true);
|
||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Fear))
|
||||
this.immuneTo.put(Enum.DamageType.FEAR, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.FEAR, true);
|
||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Charm))
|
||||
this.immuneTo.put(Enum.DamageType.CHARM, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.CHARM, true);
|
||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Root))
|
||||
this.immuneTo.put(Enum.DamageType.ROOT, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.ROOT, true);
|
||||
if (rb.getBool(ModType.ImmuneTo, SourceType.Snare))
|
||||
this.immuneTo.put(Enum.DamageType.SNARE, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.SNARE, true);
|
||||
|
||||
// Handle resists
|
||||
slash += rb.getFloat(ModType.Resistance, SourceType.Slashing);
|
||||
@@ -385,18 +385,18 @@ public class Resists {
|
||||
}
|
||||
|
||||
// get resists from equipment
|
||||
if (ac.getObjectType().equals(Enum.GameObjectType.PlayerCharacter)) {
|
||||
if (ac.getObjectType().equals(mbEnums.GameObjectType.PlayerCharacter)) {
|
||||
if (ac.charItemManager != null && ac.charItemManager.getEquipped() != null) {
|
||||
float[] phys = {0f, 0f, 0f};
|
||||
ConcurrentHashMap<Enum.EquipSlotType, Item> equip = ac.charItemManager.getEquipped();
|
||||
ConcurrentHashMap<mbEnums.EquipSlotType, Item> equip = ac.charItemManager.getEquipped();
|
||||
|
||||
// get base physical resists
|
||||
phys = Resists.getArmorResists(equip.get(Enum.EquipSlotType.HELM), phys);
|
||||
phys = Resists.getArmorResists(equip.get(Enum.EquipSlotType.CHEST), phys);
|
||||
phys = Resists.getArmorResists(equip.get(Enum.EquipSlotType.UPARM), phys);
|
||||
phys = Resists.getArmorResists(equip.get(Enum.EquipSlotType.HANDS), phys);
|
||||
phys = Resists.getArmorResists(equip.get(Enum.EquipSlotType.LEGS), phys);
|
||||
phys = Resists.getArmorResists(equip.get(Enum.EquipSlotType.FEET), phys);
|
||||
phys = Resists.getArmorResists(equip.get(mbEnums.EquipSlotType.HELM), phys);
|
||||
phys = Resists.getArmorResists(equip.get(mbEnums.EquipSlotType.CHEST), phys);
|
||||
phys = Resists.getArmorResists(equip.get(mbEnums.EquipSlotType.UPARM), phys);
|
||||
phys = Resists.getArmorResists(equip.get(mbEnums.EquipSlotType.HANDS), phys);
|
||||
phys = Resists.getArmorResists(equip.get(mbEnums.EquipSlotType.LEGS), phys);
|
||||
phys = Resists.getArmorResists(equip.get(mbEnums.EquipSlotType.FEET), phys);
|
||||
slash += phys[0];
|
||||
crush += phys[1];
|
||||
pierce += phys[2];
|
||||
@@ -404,30 +404,30 @@ public class Resists {
|
||||
}
|
||||
}
|
||||
|
||||
this.resists.put(Enum.DamageType.SLASHING, slash);
|
||||
this.resists.put(Enum.DamageType.CRUSHING, crush);
|
||||
this.resists.put(Enum.DamageType.PIERCING, pierce);
|
||||
this.resists.put(Enum.DamageType.MAGIC, magic);
|
||||
this.resists.put(Enum.DamageType.BLEEDING, bleed);
|
||||
this.resists.put(Enum.DamageType.POISON, poison);
|
||||
this.resists.put(Enum.DamageType.MENTAL, mental);
|
||||
this.resists.put(Enum.DamageType.HOLY, holy);
|
||||
this.resists.put(Enum.DamageType.UNHOLY, unholy);
|
||||
this.resists.put(Enum.DamageType.LIGHTNING, lightning);
|
||||
this.resists.put(Enum.DamageType.FIRE, fire);
|
||||
this.resists.put(Enum.DamageType.COLD, cold);
|
||||
this.resists.put(Enum.DamageType.HEALING, healing);
|
||||
this.resists.put(mbEnums.DamageType.SLASHING, slash);
|
||||
this.resists.put(mbEnums.DamageType.CRUSHING, crush);
|
||||
this.resists.put(mbEnums.DamageType.PIERCING, pierce);
|
||||
this.resists.put(mbEnums.DamageType.MAGIC, magic);
|
||||
this.resists.put(mbEnums.DamageType.BLEEDING, bleed);
|
||||
this.resists.put(mbEnums.DamageType.POISON, poison);
|
||||
this.resists.put(mbEnums.DamageType.MENTAL, mental);
|
||||
this.resists.put(mbEnums.DamageType.HOLY, holy);
|
||||
this.resists.put(mbEnums.DamageType.UNHOLY, unholy);
|
||||
this.resists.put(mbEnums.DamageType.LIGHTNING, lightning);
|
||||
this.resists.put(mbEnums.DamageType.FIRE, fire);
|
||||
this.resists.put(mbEnums.DamageType.COLD, cold);
|
||||
this.resists.put(mbEnums.DamageType.HEALING, healing);
|
||||
|
||||
this.immuneTo.put(Enum.DamageType.SIEGE, true);
|
||||
this.immuneTo.put(mbEnums.DamageType.SIEGE, true);
|
||||
|
||||
// debug printing of resists
|
||||
// printResists(pc);
|
||||
}
|
||||
|
||||
public void printResistsToClient(PlayerCharacter pc) {
|
||||
for (Enum.DamageType dt : resists.keySet())
|
||||
for (mbEnums.DamageType dt : resists.keySet())
|
||||
ChatManager.chatSystemInfo(pc, " resist." + dt.name() + ": " + resists.get(dt));
|
||||
for (Enum.DamageType dt : immuneTo.keySet())
|
||||
for (mbEnums.DamageType dt : immuneTo.keySet())
|
||||
ChatManager.chatSystemInfo(pc, " immuneTo." + dt.name() + ": " + immuneTo.get(dt));
|
||||
ChatManager.chatSystemInfo(pc, " immuneToAll: " + this.immuneToAll);
|
||||
if (protection != null)
|
||||
@@ -440,9 +440,9 @@ public class Resists {
|
||||
String out = pc.getName();
|
||||
|
||||
out += "Resists: ";
|
||||
Iterator<Enum.DamageType> it = this.resists.keySet().iterator();
|
||||
Iterator<mbEnums.DamageType> it = this.resists.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Enum.DamageType damType = it.next();
|
||||
mbEnums.DamageType damType = it.next();
|
||||
String dtName = damType.name();
|
||||
out += dtName + '=' + this.resists.get(dtName) + ", ";
|
||||
}
|
||||
@@ -450,7 +450,7 @@ public class Resists {
|
||||
out += "ImmuneTo: ";
|
||||
it = this.immuneTo.keySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Enum.DamageType damType = it.next();
|
||||
mbEnums.DamageType damType = it.next();
|
||||
|
||||
String dtName = damType.name();
|
||||
out += dtName + '=' + this.resists.get(dtName) + ", ";
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.server.MBServerStatics;
|
||||
@@ -83,7 +83,7 @@ public class RuneBase extends AbstractGameObject {
|
||||
if (tableId == 0)
|
||||
return null;
|
||||
|
||||
RuneBase rb = (RuneBase) DbManager.getFromCache(Enum.GameObjectType.RuneBase, tableId);
|
||||
RuneBase rb = (RuneBase) DbManager.getFromCache(mbEnums.GameObjectType.RuneBase, tableId);
|
||||
|
||||
if (rb != null)
|
||||
return rb;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.gameManager.DbManager;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.net.ByteBufferWriter;
|
||||
|
||||
@@ -32,9 +32,9 @@ public class Runegate {
|
||||
|
||||
// Chaos, Khar and Oblivion are on by default
|
||||
|
||||
_portals[Enum.PortalType.CHAOS.ordinal()].activate(false);
|
||||
_portals[Enum.PortalType.OBLIV.ordinal()].activate(false);
|
||||
_portals[Enum.PortalType.MERCHANT.ordinal()].activate(false);
|
||||
_portals[mbEnums.PortalType.CHAOS.ordinal()].activate(false);
|
||||
_portals[mbEnums.PortalType.OBLIV.ordinal()].activate(false);
|
||||
_portals[mbEnums.PortalType.MERCHANT.ordinal()].activate(false);
|
||||
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class Runegate {
|
||||
|
||||
for (int gateID : gateList) {
|
||||
|
||||
Building gateBuilding = (Building) DbManager.getObject(Enum.GameObjectType.Building, gateID);
|
||||
Building gateBuilding = (Building) DbManager.getObject(mbEnums.GameObjectType.Building, gateID);
|
||||
|
||||
Runegate runegate = new Runegate(gateBuilding);
|
||||
_runegates.put(gateID, runegate);
|
||||
@@ -68,13 +68,13 @@ public class Runegate {
|
||||
return openGateIDStrings;
|
||||
}
|
||||
|
||||
public void activatePortal(Enum.PortalType portalType) {
|
||||
public void activatePortal(mbEnums.PortalType portalType) {
|
||||
|
||||
this._portals[portalType.ordinal()].activate(true);
|
||||
|
||||
}
|
||||
|
||||
public void deactivatePortal(Enum.PortalType portalType) {
|
||||
public void deactivatePortal(mbEnums.PortalType portalType) {
|
||||
|
||||
this._portals[portalType.ordinal()].deactivate();
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.BuildingGroup;
|
||||
import engine.Enum.ShrineType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.BuildingGroup;
|
||||
import engine.mbEnums.ShrineType;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import org.pmw.tinylog.Logger;
|
||||
@@ -218,7 +218,7 @@ public class Shrine extends AbstractWorldObject implements Comparable<Shrine> {
|
||||
if (shrine != null) {
|
||||
shrine.shrineType.RemoveShrineFromServerList(shrine);
|
||||
Shrine.shrinesByBuildingUUID.remove(building.getObjectUUID());
|
||||
DbManager.removeFromCache(Enum.GameObjectType.Shrine,
|
||||
DbManager.removeFromCache(mbEnums.GameObjectType.Shrine,
|
||||
shrine.getObjectUUID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum.SourceType;
|
||||
import engine.mbEnums.SourceType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.server.MBServerStatics;
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.GameObjectType;
|
||||
import engine.Enum.TransactionType;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.GameObjectType;
|
||||
import engine.mbEnums.TransactionType;
|
||||
import org.joda.time.DateTime;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
@@ -23,7 +23,7 @@ public class Transaction implements Comparable<Transaction> {
|
||||
|
||||
private final int warehouseUUID;
|
||||
private final int targetUUID;
|
||||
private final Enum.ResourceType resource;
|
||||
private final mbEnums.ResourceType resource;
|
||||
private final DateTime date;
|
||||
private final int amount;
|
||||
private final TransactionType transactionType;
|
||||
@@ -35,7 +35,7 @@ public class Transaction implements Comparable<Transaction> {
|
||||
this.targetUUID = rs.getInt("targetUID");
|
||||
this.targetType = GameObjectType.valueOf(rs.getString("targetType"));
|
||||
this.transactionType = TransactionType.valueOf(rs.getString("type").toUpperCase());
|
||||
this.resource = Enum.ResourceType.valueOf(rs.getString("resource").toUpperCase());
|
||||
this.resource = mbEnums.ResourceType.valueOf(rs.getString("resource").toUpperCase());
|
||||
this.amount = rs.getInt("amount");
|
||||
|
||||
Date sqlDateTime = rs.getTimestamp("date");
|
||||
@@ -48,7 +48,7 @@ public class Transaction implements Comparable<Transaction> {
|
||||
}
|
||||
|
||||
|
||||
public Transaction(int warehouseUUID, GameObjectType targetType, int targetUUID, TransactionType transactionType, Enum.ResourceType resource, int amount,
|
||||
public Transaction(int warehouseUUID, GameObjectType targetType, int targetUUID, TransactionType transactionType, mbEnums.ResourceType resource, int amount,
|
||||
DateTime date) {
|
||||
this.warehouseUUID = warehouseUUID;
|
||||
this.targetUUID = targetUUID;
|
||||
@@ -70,7 +70,7 @@ public class Transaction implements Comparable<Transaction> {
|
||||
}
|
||||
|
||||
|
||||
public Enum.ResourceType getResource() {
|
||||
public mbEnums.ResourceType getResource() {
|
||||
return resource;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.net.Dispatch;
|
||||
@@ -30,11 +30,11 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class Warehouse {
|
||||
|
||||
public EnumSet<Enum.ResourceType> locked = EnumSet.noneOf(Enum.ResourceType.class);
|
||||
public EnumSet<mbEnums.ResourceType> locked = EnumSet.noneOf(mbEnums.ResourceType.class);
|
||||
public Building building;
|
||||
public City city;
|
||||
public ArrayList<Transaction> transactions = new ArrayList<>();
|
||||
public ConcurrentHashMap<Enum.ResourceType, Integer> resources = new ConcurrentHashMap<>();
|
||||
public ConcurrentHashMap<mbEnums.ResourceType, Integer> resources = new ConcurrentHashMap<>();
|
||||
|
||||
public Warehouse(Building building) {
|
||||
|
||||
@@ -43,12 +43,12 @@ public class Warehouse {
|
||||
|
||||
// New empty warehouse
|
||||
|
||||
for (Enum.ResourceType resourceType : EnumSet.allOf(Enum.ResourceType.class))
|
||||
for (mbEnums.ResourceType resourceType : EnumSet.allOf(mbEnums.ResourceType.class))
|
||||
this.resources.put(resourceType, 0);
|
||||
|
||||
// With no locks
|
||||
|
||||
this.locked = EnumSet.noneOf(Enum.ResourceType.class);
|
||||
this.locked = EnumSet.noneOf(mbEnums.ResourceType.class);
|
||||
}
|
||||
|
||||
public Warehouse(JSONObject warehouse) throws SQLException {
|
||||
@@ -56,7 +56,7 @@ public class Warehouse {
|
||||
JSONObject resources = (JSONObject) warehouse.get("resources");
|
||||
|
||||
for (Object key : resources.keySet()) {
|
||||
Enum.ResourceType resourceType = Enum.ResourceType.valueOf((String) key);
|
||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.valueOf((String) key);
|
||||
int value = ((Long) resources.get(key)).intValue();
|
||||
this.resources.put(resourceType, value);
|
||||
}
|
||||
@@ -65,16 +65,16 @@ public class Warehouse {
|
||||
|
||||
if (lockedResources.isEmpty() == false)
|
||||
for (Object o : lockedResources)
|
||||
this.locked.add(Enum.ResourceType.valueOf((String) o));
|
||||
this.locked.add(mbEnums.ResourceType.valueOf((String) o));
|
||||
|
||||
}
|
||||
|
||||
public static HashMap<Enum.ResourceType, Integer>
|
||||
calculateWarehouseOverdraft(Warehouse warehouse, HashMap<Enum.ResourceType, Integer> costMap) {
|
||||
public static HashMap<mbEnums.ResourceType, Integer>
|
||||
calculateWarehouseOverdraft(Warehouse warehouse, HashMap<mbEnums.ResourceType, Integer> costMap) {
|
||||
|
||||
HashMap<Enum.ResourceType, Integer> overdraft = new HashMap<>();
|
||||
HashMap<mbEnums.ResourceType, Integer> overdraft = new HashMap<>();
|
||||
|
||||
for (Enum.ResourceType resourceType : costMap.keySet()) {
|
||||
for (mbEnums.ResourceType resourceType : costMap.keySet()) {
|
||||
|
||||
int cost = costMap.get(resourceType);
|
||||
|
||||
@@ -123,7 +123,7 @@ public class Warehouse {
|
||||
vrm.setWarehouseBuilding(warehouseBuilding);
|
||||
vrm.configure();
|
||||
dispatch = Dispatch.borrow(player, vrm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
public static void warehouseWithdraw(MerchantMsg msg, PlayerCharacter player, NPC npc) {
|
||||
@@ -152,7 +152,7 @@ public class Warehouse {
|
||||
if (warehouse == null)
|
||||
return;
|
||||
|
||||
Enum.ResourceType resourceType = Enum.ResourceType.hashLookup.get(msg.getHashID());
|
||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.hashLookup.get(msg.getHashID());
|
||||
|
||||
if (isResourceLocked(warehouse, resourceType)) {
|
||||
ChatManager.chatSystemInfo(player, "You cannot withdrawl a locked resource.");
|
||||
@@ -169,7 +169,7 @@ public class Warehouse {
|
||||
vrm.setWarehouseBuilding(warehouseBuilding);
|
||||
vrm.configure();
|
||||
dispatch = Dispatch.borrow(player, vrm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
}
|
||||
|
||||
public static void warehouseLock(MerchantMsg msg, PlayerCharacter player, NPC npc) {
|
||||
@@ -194,7 +194,7 @@ public class Warehouse {
|
||||
|
||||
warehouse = city.warehouse;
|
||||
|
||||
Enum.ResourceType resourceType = Enum.ResourceType.hashLookup.get(hashID);
|
||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.hashLookup.get(hashID);
|
||||
|
||||
// toggle lock
|
||||
|
||||
@@ -210,7 +210,7 @@ public class Warehouse {
|
||||
vrm.setWarehouseBuilding(warehouseBuilding);
|
||||
vrm.configure();
|
||||
dispatch = Dispatch.borrow(player, vrm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
} else
|
||||
warehouse.locked.add(resourceType);
|
||||
|
||||
@@ -227,7 +227,7 @@ public class Warehouse {
|
||||
vrm.setWarehouseBuilding(warehouseBuilding);
|
||||
vrm.configure();
|
||||
dispatch = Dispatch.borrow(player, vrm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
} else
|
||||
warehouse.locked.remove(resourceType);
|
||||
|
||||
@@ -245,7 +245,7 @@ public class Warehouse {
|
||||
return false;
|
||||
}
|
||||
|
||||
Enum.ResourceType resourceType = Enum.ResourceType.resourceLookup.get(resource.templateID);
|
||||
mbEnums.ResourceType resourceType = mbEnums.ResourceType.resourceLookup.get(resource.templateID);
|
||||
|
||||
if (warehouse.resources.get(resourceType) == null)
|
||||
return false;
|
||||
@@ -273,11 +273,11 @@ public class Warehouse {
|
||||
|
||||
int newAmount = oldAmount + amount;
|
||||
|
||||
if (newAmount > Enum.ResourceType.resourceLookup.get(resource.templateID).deposit_limit)
|
||||
if (newAmount > mbEnums.ResourceType.resourceLookup.get(resource.templateID).deposit_limit)
|
||||
return false;
|
||||
|
||||
if (removeFromInventory) {
|
||||
if (resourceType.equals(Enum.ResourceType.GOLD)) {
|
||||
if (resourceType.equals(mbEnums.ResourceType.GOLD)) {
|
||||
|
||||
if (itemMan.getGoldInventory().getNumOfItems() - amount < 0)
|
||||
return false;
|
||||
@@ -291,7 +291,7 @@ public class Warehouse {
|
||||
UpdateGoldMsg ugm = new UpdateGoldMsg(pc);
|
||||
ugm.configure();
|
||||
Dispatch dispatch = Dispatch.borrow(pc, ugm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
itemMan.updateInventory();
|
||||
|
||||
@@ -313,18 +313,18 @@ public class Warehouse {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (resource.template.item_type.equals(Enum.ItemType.GOLD))
|
||||
resourceType = Enum.ResourceType.GOLD;
|
||||
if (resource.template.item_type.equals(mbEnums.ItemType.GOLD))
|
||||
resourceType = mbEnums.ResourceType.GOLD;
|
||||
else
|
||||
resourceType = Enum.ResourceType.valueOf(ItemTemplate.templates.get(resource.templateID).item_base_name.toUpperCase());
|
||||
resourceType = mbEnums.ResourceType.valueOf(ItemTemplate.templates.get(resource.templateID).item_base_name.toUpperCase());
|
||||
|
||||
if (transaction)
|
||||
AddTransactionToWarehouse(warehouse, pc.getObjectType(), pc.getObjectUUID(), Enum.TransactionType.DEPOSIT, resourceType, amount);
|
||||
AddTransactionToWarehouse(warehouse, pc.getObjectType(), pc.getObjectUUID(), mbEnums.TransactionType.DEPOSIT, resourceType, amount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static synchronized boolean depositFromMine(Mine mine, Enum.ResourceType resourceType, int amount, Warehouse warehouse) {
|
||||
public static synchronized boolean depositFromMine(Mine mine, mbEnums.ResourceType resourceType, int amount, Warehouse warehouse) {
|
||||
|
||||
int oldAmount = warehouse.resources.get(resourceType);
|
||||
int newAmount = oldAmount + amount;
|
||||
@@ -340,12 +340,12 @@ public class Warehouse {
|
||||
}
|
||||
|
||||
if (mine != null)
|
||||
AddTransactionToWarehouse(warehouse, Enum.GameObjectType.Building, mine.getBuildingID(), Enum.TransactionType.MINE, resourceType, amount);
|
||||
AddTransactionToWarehouse(warehouse, mbEnums.GameObjectType.Building, mine.getBuildingID(), mbEnums.TransactionType.MINE, resourceType, amount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static synchronized void depositRealmTaxes(PlayerCharacter taxer, Enum.ResourceType resourceType, int amount, Warehouse warehouse) {
|
||||
public static synchronized void depositRealmTaxes(PlayerCharacter taxer, mbEnums.ResourceType resourceType, int amount, Warehouse warehouse) {
|
||||
|
||||
int oldAmount = warehouse.resources.get(resourceType);
|
||||
int newAmount = oldAmount + amount;
|
||||
@@ -356,11 +356,11 @@ public class Warehouse {
|
||||
return;
|
||||
}
|
||||
|
||||
AddTransactionToWarehouse(warehouse, taxer.getObjectType(), taxer.getObjectUUID(), Enum.TransactionType.TAXRESOURCEDEPOSIT, resourceType, amount);
|
||||
AddTransactionToWarehouse(warehouse, taxer.getObjectType(), taxer.getObjectUUID(), mbEnums.TransactionType.TAXRESOURCEDEPOSIT, resourceType, amount);
|
||||
|
||||
}
|
||||
|
||||
public static synchronized void depositProfitTax(Enum.ResourceType resourceType, int amount, Building building, Warehouse warehouse) {
|
||||
public static synchronized void depositProfitTax(mbEnums.ResourceType resourceType, int amount, Building building, Warehouse warehouse) {
|
||||
|
||||
if (warehouse.resources.get(resourceType) == null)
|
||||
return;
|
||||
@@ -379,11 +379,11 @@ public class Warehouse {
|
||||
}
|
||||
|
||||
if (building != null)
|
||||
AddTransactionToWarehouse(warehouse, Enum.GameObjectType.Building, building.getObjectUUID(), Enum.TransactionType.DEPOSIT, resourceType, amount);
|
||||
AddTransactionToWarehouse(warehouse, mbEnums.GameObjectType.Building, building.getObjectUUID(), mbEnums.TransactionType.DEPOSIT, resourceType, amount);
|
||||
|
||||
}
|
||||
|
||||
public static synchronized boolean withdraw(Warehouse warehouse, NPC npc, Enum.ResourceType resourceType, int amount, boolean transaction) {
|
||||
public static synchronized boolean withdraw(Warehouse warehouse, NPC npc, mbEnums.ResourceType resourceType, int amount, boolean transaction) {
|
||||
|
||||
int oldAmount = warehouse.resources.get(resourceType);
|
||||
|
||||
@@ -406,14 +406,14 @@ public class Warehouse {
|
||||
}
|
||||
|
||||
if (transaction)
|
||||
AddTransactionToWarehouse(warehouse, npc.getObjectType(), npc.getObjectUUID(), Enum.TransactionType.WITHDRAWL, resourceType, amount);
|
||||
AddTransactionToWarehouse(warehouse, npc.getObjectType(), npc.getObjectUUID(), mbEnums.TransactionType.WITHDRAWL, resourceType, amount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static synchronized void transferResources(Warehouse warehouse, PlayerCharacter taxer, TaxResourcesMsg msg, ArrayList<Enum.ResourceType> realmResources, float taxPercent) {
|
||||
public static synchronized void transferResources(Warehouse warehouse, PlayerCharacter taxer, TaxResourcesMsg msg, ArrayList<mbEnums.ResourceType> realmResources, float taxPercent) {
|
||||
|
||||
for (Enum.ResourceType resourceType : realmResources) {
|
||||
for (mbEnums.ResourceType resourceType : realmResources) {
|
||||
|
||||
if (warehouse.resources.get(resourceType) == null)
|
||||
return;
|
||||
@@ -445,14 +445,14 @@ public class Warehouse {
|
||||
|
||||
warehouse.resources.put(resourceType, newAmount);
|
||||
depositRealmTaxes(taxer, resourceType, amount, warehouse);
|
||||
Enum.ResourceType resource;
|
||||
mbEnums.ResourceType resource;
|
||||
|
||||
AddTransactionToWarehouse(warehouse, taxer.getObjectType(), taxer.getObjectUUID(), Enum.TransactionType.TAXRESOURCE, resourceType, amount);
|
||||
AddTransactionToWarehouse(warehouse, taxer.getObjectType(), taxer.getObjectUUID(), mbEnums.TransactionType.TAXRESOURCE, resourceType, amount);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized boolean withdraw(Warehouse warehouse, PlayerCharacter pc, Enum.ResourceType resourceType, int amount, boolean addToInventory, boolean transaction) {
|
||||
public static synchronized boolean withdraw(Warehouse warehouse, PlayerCharacter pc, mbEnums.ResourceType resourceType, int amount, boolean addToInventory, boolean transaction) {
|
||||
|
||||
if (pc == null)
|
||||
return false;
|
||||
@@ -476,7 +476,7 @@ public class Warehouse {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (addToInventory && resourceType.equals(Enum.ResourceType.GOLD)) {
|
||||
if (addToInventory && resourceType.equals(mbEnums.ResourceType.GOLD)) {
|
||||
if (pc.charItemManager.getGoldInventory().getNumOfItems() + amount > MBServerStatics.PLAYER_GOLD_LIMIT)
|
||||
return false;
|
||||
|
||||
@@ -498,13 +498,13 @@ public class Warehouse {
|
||||
}
|
||||
|
||||
if (addToInventory) {
|
||||
if (resourceType.equals(Enum.ResourceType.GOLD)) {
|
||||
if (resourceType.equals(mbEnums.ResourceType.GOLD)) {
|
||||
|
||||
itemMan.addGoldToInventory(amount, false);
|
||||
UpdateGoldMsg ugm = new UpdateGoldMsg(pc);
|
||||
ugm.configure();
|
||||
Dispatch dispatch = Dispatch.borrow(pc, ugm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
itemMan.updateInventory();
|
||||
} else {
|
||||
@@ -512,8 +512,8 @@ public class Warehouse {
|
||||
|
||||
Item item = new Item(resourceType.templateID);
|
||||
item.ownerID = pc.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 {
|
||||
@@ -530,12 +530,12 @@ public class Warehouse {
|
||||
}
|
||||
|
||||
if (transaction)
|
||||
AddTransactionToWarehouse(warehouse, pc.getObjectType(), pc.getObjectUUID(), Enum.TransactionType.WITHDRAWL, resourceType, amount);
|
||||
AddTransactionToWarehouse(warehouse, pc.getObjectType(), pc.getObjectUUID(), mbEnums.TransactionType.WITHDRAWL, resourceType, amount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static synchronized boolean loot(Warehouse warehouse, PlayerCharacter pc, Enum.ResourceType resourceType, int amount, boolean addToInventory) {
|
||||
public static synchronized boolean loot(Warehouse warehouse, PlayerCharacter pc, mbEnums.ResourceType resourceType, int amount, boolean addToInventory) {
|
||||
|
||||
if (pc == null)
|
||||
return false;
|
||||
@@ -571,21 +571,21 @@ public class Warehouse {
|
||||
warehouse.resources.put(resourceType, newAmount);
|
||||
|
||||
if (addToInventory) {
|
||||
if (resourceType.equals(Enum.ResourceType.GOLD)) {
|
||||
if (resourceType.equals(mbEnums.ResourceType.GOLD)) {
|
||||
|
||||
itemMan.addGoldToInventory(amount, false);
|
||||
UpdateGoldMsg ugm = new UpdateGoldMsg(pc);
|
||||
ugm.configure();
|
||||
Dispatch dispatch = Dispatch.borrow(pc, ugm);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, mbEnums.DispatchChannel.SECONDARY);
|
||||
|
||||
itemMan.updateInventory();
|
||||
} else {
|
||||
boolean itemWorked = false;
|
||||
Item item = new Item(resourceType.templateID);
|
||||
item.ownerID = pc.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 {
|
||||
@@ -607,7 +607,7 @@ public class Warehouse {
|
||||
public static boolean isEmpty(Warehouse warehouse) {
|
||||
int amount = 0;
|
||||
|
||||
for (Enum.ResourceType resourceType : EnumSet.allOf(Enum.ResourceType.class)) {
|
||||
for (mbEnums.ResourceType resourceType : EnumSet.allOf(mbEnums.ResourceType.class)) {
|
||||
amount += warehouse.resources.get(resourceType);
|
||||
|
||||
if (amount > 0)
|
||||
@@ -620,7 +620,7 @@ public class Warehouse {
|
||||
warehouse.transactions = DbManager.WarehouseQueries.GET_TRANSACTIONS_FOR_WAREHOUSE(warehouse.building.getObjectUUID());
|
||||
}
|
||||
|
||||
public static void AddTransactionToWarehouse(Warehouse warehouse, Enum.GameObjectType targetType, int targetUUID, Enum.TransactionType transactionType, Enum.ResourceType resource, int amount) {
|
||||
public static void AddTransactionToWarehouse(Warehouse warehouse, mbEnums.GameObjectType targetType, int targetUUID, mbEnums.TransactionType transactionType, mbEnums.ResourceType resource, int amount) {
|
||||
|
||||
|
||||
if (!DbManager.WarehouseQueries.CREATE_TRANSACTION(warehouse.building.getObjectUUID(), targetType, targetUUID, transactionType, resource, amount, DateTime.now()))
|
||||
@@ -630,13 +630,13 @@ public class Warehouse {
|
||||
warehouse.transactions.add(transaction);
|
||||
}
|
||||
|
||||
public static boolean isAboveCap(Warehouse warehouse, Enum.ResourceType resourceType, int deposit) {
|
||||
public static boolean isAboveCap(Warehouse warehouse, mbEnums.ResourceType resourceType, int deposit) {
|
||||
int newAmount = warehouse.resources.get(resourceType) + deposit;
|
||||
return newAmount > resourceType.deposit_limit;
|
||||
|
||||
}
|
||||
|
||||
public static boolean isResourceLocked(Warehouse warehouse, Enum.ResourceType resourceType) {
|
||||
public static boolean isResourceLocked(Warehouse warehouse, mbEnums.ResourceType resourceType) {
|
||||
return resourceType.elementOf(warehouse.locked);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.mbEnums;
|
||||
import engine.InterestManagement.Terrain;
|
||||
import engine.db.archive.DataWarehouse;
|
||||
import engine.gameManager.ZoneManager;
|
||||
@@ -106,8 +106,8 @@ public class Zone extends AbstractWorldObject {
|
||||
|
||||
if (zone.playerCityUUID > 0) {
|
||||
writer.put((byte) 1); // Player City - True
|
||||
writer.putFloat(Enum.CityBoundsType.ZONE.halfExtents);
|
||||
writer.putFloat(Enum.CityBoundsType.ZONE.halfExtents);
|
||||
writer.putFloat(mbEnums.CityBoundsType.ZONE.halfExtents);
|
||||
writer.putFloat(mbEnums.CityBoundsType.ZONE.halfExtents);
|
||||
} else
|
||||
writer.put((byte) 0); // Player City - False
|
||||
|
||||
@@ -165,8 +165,8 @@ public class Zone extends AbstractWorldObject {
|
||||
// stored within its template.
|
||||
|
||||
if (this.template == null) {
|
||||
this.minor_radius = Enum.CityBoundsType.ZONE.halfExtents;
|
||||
this.major_radius = Enum.CityBoundsType.ZONE.halfExtents;
|
||||
this.minor_radius = mbEnums.CityBoundsType.ZONE.halfExtents;
|
||||
this.major_radius = mbEnums.CityBoundsType.ZONE.halfExtents;
|
||||
} else {
|
||||
this.minor_radius = this.template.minor_radius;
|
||||
this.major_radius = this.template.major_radius;
|
||||
@@ -312,7 +312,7 @@ public class Zone extends AbstractWorldObject {
|
||||
|
||||
// Write hash to player character table
|
||||
|
||||
DataWarehouse.writeHash(Enum.DataRecordType.ZONE, this.getObjectUUID());
|
||||
DataWarehouse.writeHash(mbEnums.DataRecordType.ZONE, this.getObjectUUID());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user