forked from MagicBane/Server
Renamed class to not conflict with the java.lang version.
This commit is contained in:
@@ -8,11 +8,11 @@
|
||||
|
||||
package engine.net.client.handlers;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.DispatchChannel;
|
||||
import engine.exception.MsgSendException;
|
||||
import engine.gameManager.ChatManager;
|
||||
import engine.gameManager.GroupManager;
|
||||
import engine.mbEnums;
|
||||
import engine.mbEnums.DispatchChannel;
|
||||
import engine.net.Dispatch;
|
||||
import engine.net.DispatchMessage;
|
||||
import engine.net.client.ClientConnection;
|
||||
@@ -60,7 +60,7 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
int targetType = msg.getTargetType();
|
||||
int targetID = msg.getTargetID();
|
||||
|
||||
if (targetType == Enum.GameObjectType.PlayerCharacter.ordinal() || targetType == Enum.GameObjectType.Mob.ordinal() || targetType == Enum.GameObjectType.Corpse.ordinal()) {
|
||||
if (targetType == mbEnums.GameObjectType.PlayerCharacter.ordinal() || targetType == mbEnums.GameObjectType.Mob.ordinal() || targetType == mbEnums.GameObjectType.Corpse.ordinal()) {
|
||||
} else { //needed for getting contracts for some reason
|
||||
targetType = msg.getSourceID2();
|
||||
targetID = msg.getUnknown01();
|
||||
@@ -73,9 +73,9 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
AbstractCharacter tar = null;
|
||||
Corpse corpse = null;
|
||||
|
||||
if (targetType == Enum.GameObjectType.PlayerCharacter.ordinal() || targetType == Enum.GameObjectType.Mob.ordinal()) {
|
||||
if (targetType == mbEnums.GameObjectType.PlayerCharacter.ordinal() || targetType == mbEnums.GameObjectType.Mob.ordinal()) {
|
||||
|
||||
if (targetType == Enum.GameObjectType.PlayerCharacter.ordinal()) {
|
||||
if (targetType == mbEnums.GameObjectType.PlayerCharacter.ordinal()) {
|
||||
tar = PlayerCharacter.getFromCache(targetID);
|
||||
|
||||
if (tar == null)
|
||||
@@ -84,9 +84,9 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
if (player.getObjectUUID() != tar.getObjectUUID() && ((PlayerCharacter) tar).isInSafeZone())
|
||||
return true;
|
||||
|
||||
} else if (targetType == Enum.GameObjectType.NPC.ordinal())
|
||||
} else if (targetType == mbEnums.GameObjectType.NPC.ordinal())
|
||||
tar = NPC.getFromCache(targetID);
|
||||
else if (targetType == Enum.GameObjectType.Mob.ordinal())
|
||||
else if (targetType == mbEnums.GameObjectType.Mob.ordinal())
|
||||
tar = Mob.getFromCache(targetID);
|
||||
|
||||
if (tar == null)
|
||||
@@ -117,10 +117,10 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
itemRet = tar.charItemManager.lootItemFromMe(item, player, origin);
|
||||
|
||||
//Take equipment off mob
|
||||
if (tar.getObjectType() == Enum.GameObjectType.Mob && itemRet != null) {
|
||||
if (tar.getObjectType() == mbEnums.GameObjectType.Mob && itemRet != null) {
|
||||
Mob mobTarget = (Mob) tar;
|
||||
|
||||
if (item != null && item.getObjectType() == Enum.GameObjectType.MobLoot) {
|
||||
if (item != null && item.getObjectType() == mbEnums.GameObjectType.MobLoot) {
|
||||
|
||||
for (Item equip : mobTarget.charItemManager.equipped.values()) {
|
||||
|
||||
@@ -137,7 +137,7 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
}
|
||||
} else if (targetType == Enum.GameObjectType.Corpse.ordinal()) {
|
||||
} else if (targetType == mbEnums.GameObjectType.Corpse.ordinal()) {
|
||||
corpse = Corpse.getCorpse(targetID);
|
||||
|
||||
if (corpse == null)
|
||||
@@ -150,7 +150,7 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
}
|
||||
|
||||
//can't loot other players in safe zone.
|
||||
if (corpse.getBelongsToType() == Enum.GameObjectType.PlayerCharacter.ordinal()) {
|
||||
if (corpse.getBelongsToType() == mbEnums.GameObjectType.PlayerCharacter.ordinal()) {
|
||||
|
||||
if (player.getObjectUUID() == corpse.getBelongsToID())
|
||||
itemRet = corpse.lootItem(item, player);
|
||||
@@ -162,7 +162,7 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
if (itemRet == null)
|
||||
return true;
|
||||
|
||||
if (item.template.item_type.equals(engine.Enum.ItemType.GOLD)) {
|
||||
if (item.template.item_type.equals(mbEnums.ItemType.GOLD)) {
|
||||
// this is done to prevent the temporary goldItem item
|
||||
// (from the mob) from appearing in player's inventory.
|
||||
// It also updates the goldItem quantity display
|
||||
@@ -188,7 +188,7 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
//TODO send group loot message if player is grouped and visible
|
||||
Group group = GroupManager.getGroup(player);
|
||||
|
||||
if (group != null && group.getSplitGold() && (item.template.item_type.equals(engine.Enum.ItemType.GOLD) == false)) {
|
||||
if (group != null && group.getSplitGold() && (item.template.item_type.equals(mbEnums.ItemType.GOLD) == false)) {
|
||||
String name = item.getName();
|
||||
String text = player.getFirstName() + " has looted " + name + '.';
|
||||
ChatManager.chatGroupInfoCanSee(player, text);
|
||||
@@ -203,7 +203,7 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
if (itemRet == null)
|
||||
return true;
|
||||
|
||||
if (item.template.item_type.equals(engine.Enum.ItemType.GOLD)) {
|
||||
if (item.template.item_type.equals(mbEnums.ItemType.GOLD)) {
|
||||
// this is done to prevent the temporary goldItem item
|
||||
// (from the mob) from appearing in player's inventory.
|
||||
// It also updates the goldItem quantity display
|
||||
@@ -232,7 +232,7 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
Dispatch dispatch = Dispatch.borrow(player, msg);
|
||||
//DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
|
||||
DispatchMessage.dispatchMsgToInterestArea(tar, msg, DispatchChannel.PRIMARY, MBServerStatics.CHARACTER_LOAD_RANGE, false, true);
|
||||
LootMsg newItemMsg = new LootMsg(Enum.GameObjectType.PlayerCharacter.ordinal(), player.getObjectUUID(), 0, 0, itemRet);
|
||||
LootMsg newItemMsg = new LootMsg(mbEnums.GameObjectType.PlayerCharacter.ordinal(), player.getObjectUUID(), 0, 0, itemRet);
|
||||
dispatch = Dispatch.borrow(player, newItemMsg);
|
||||
DispatchMessage.dispatchMsgDispatch(dispatch, DispatchChannel.PRIMARY);
|
||||
|
||||
@@ -242,7 +242,7 @@ public class LootMsgHandler extends AbstractClientMsgHandler {
|
||||
//TODO send group loot message if player is grouped and visible
|
||||
Group group = GroupManager.getGroup(player);
|
||||
|
||||
if (group != null && group.getSplitGold() && (item.template.item_type.equals(engine.Enum.ItemType.GOLD) == false)) {
|
||||
if (group != null && group.getSplitGold() && (item.template.item_type.equals(mbEnums.ItemType.GOLD) == false)) {
|
||||
String name = item.getName();
|
||||
String text = player.getFirstName() + " has looted " + name + '.';
|
||||
ChatManager.chatGroupInfoCanSee(player, text);
|
||||
|
||||
Reference in New Issue
Block a user