Rename and clean up MapleMapObject
This commit is contained in:
@@ -26,7 +26,7 @@ package client.command.commands.gm2;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import server.maps.MapItem;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -40,8 +40,8 @@ public class LootCommand extends Command {
|
||||
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
List<MapleMapObject> items = c.getPlayer().getMap().getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapleMapObject item : items) {
|
||||
List<MapObject> items = c.getPlayer().getMap().getMapObjectsInRange(c.getPlayer().getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapObject item : items) {
|
||||
MapItem mapItem = (MapItem) item;
|
||||
if (mapItem.getOwnerId() == c.getPlayer().getId() || mapItem.getOwnerId() == c.getPlayer().getPartyId()) {
|
||||
c.getPlayer().pickupItem(mapItem);
|
||||
|
||||
@@ -29,7 +29,7 @@ import client.command.Command;
|
||||
import server.life.Monster;
|
||||
import server.life.NPC;
|
||||
import server.life.PlayerNPC;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
|
||||
import java.util.HashSet;
|
||||
|
||||
@@ -47,7 +47,7 @@ public class WhereaMiCommand extends Command {
|
||||
HashSet<PlayerNPC> playernpcs = new HashSet<>();
|
||||
HashSet<Monster> mobs = new HashSet<>();
|
||||
|
||||
for (MapleMapObject mmo : player.getMap().getMapObjects()) {
|
||||
for (MapObject mmo : player.getMap().getMapObjects()) {
|
||||
if (mmo instanceof NPC) {
|
||||
NPC npc = (NPC) mmo;
|
||||
npcs.add(npc);
|
||||
|
||||
@@ -29,7 +29,7 @@ import client.Disease;
|
||||
import client.command.Command;
|
||||
import server.life.MobSkill;
|
||||
import server.life.MobSkillFactory;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -107,7 +107,7 @@ public class DebuffCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
for (MapleMapObject mmo : player.getMap().getMapObjectsInRange(player.getPosition(), 777777.7, Arrays.asList(MapleMapObjectType.PLAYER))) {
|
||||
for (MapObject mmo : player.getMap().getMapObjectsInRange(player.getPosition(), 777777.7, Arrays.asList(MapleMapObjectType.PLAYER))) {
|
||||
Character chr = (Character) mmo;
|
||||
|
||||
if (chr.getId() != player.getId()) {
|
||||
|
||||
@@ -27,8 +27,8 @@ import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import server.life.Monster;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -43,9 +43,9 @@ public class KillAllCommand extends Command {
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
MapleMap map = player.getMap();
|
||||
List<MapleMapObject> monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
List<MapObject> monsters = map.getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
int count = 0;
|
||||
for (MapleMapObject monstermo : monsters) {
|
||||
for (MapObject monstermo : monsters) {
|
||||
Monster monster = (Monster) monstermo;
|
||||
if (!monster.getStats().isFriendly() && !(monster.getId() >= 8810010 && monster.getId() <= 8810018)) {
|
||||
map.damageMonster(player, monster, Integer.MAX_VALUE);
|
||||
|
||||
@@ -29,7 +29,7 @@ import client.command.Command;
|
||||
import client.inventory.Pet;
|
||||
import client.inventory.manipulator.InventoryManipulator;
|
||||
import server.maps.MapItem;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
import tools.PacketCreator;
|
||||
|
||||
@@ -44,8 +44,8 @@ public class ForceVacCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
List<MapleMapObject> items = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapleMapObject item : items) {
|
||||
List<MapObject> items = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapObject item : items) {
|
||||
MapItem mapItem = (MapItem) item;
|
||||
|
||||
mapItem.lockItem();
|
||||
|
||||
@@ -26,7 +26,7 @@ package client.command.commands.gm4;
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.command.Command;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -40,8 +40,8 @@ public class ItemVacCommand extends Command {
|
||||
@Override
|
||||
public void execute(Client c, String[] params) {
|
||||
Character player = c.getPlayer();
|
||||
List<MapleMapObject> list = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapleMapObject item : list) {
|
||||
List<MapObject> list = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
|
||||
for (MapObject item : list) {
|
||||
player.pickupItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import net.server.Server;
|
||||
import server.TimerManager;
|
||||
import server.life.Monster;
|
||||
import server.life.SpawnPoint;
|
||||
import server.maps.MapleMapObject;
|
||||
import server.maps.MapObject;
|
||||
import server.maps.MapleMapObjectType;
|
||||
import server.maps.MaplePortal;
|
||||
import server.maps.MapleReactor;
|
||||
@@ -67,8 +67,8 @@ public class DebugCommand extends Command {
|
||||
break;
|
||||
|
||||
case "monster":
|
||||
List<MapleMapObject> monsters = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
for (MapleMapObject monstermo : monsters) {
|
||||
List<MapObject> monsters = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.MONSTER));
|
||||
for (MapObject monstermo : monsters) {
|
||||
Monster monster = (Monster) monstermo;
|
||||
Character controller = monster.getController();
|
||||
player.message("Monster ID: " + monster.getId() + " Aggro target: " + ((controller != null) ? controller.getName() + " Has aggro: " + monster.isControllerHasAggro() + " Knowns aggro: " + monster.isControllerKnowsAboutAggro() : "<none>"));
|
||||
@@ -123,7 +123,7 @@ public class DebugCommand extends Command {
|
||||
case "reactors":
|
||||
player.dropMessage(6, "Current reactor states on map " + player.getMapId() + ":");
|
||||
|
||||
for (MapleMapObject mmo : player.getMap().getReactors()) {
|
||||
for (MapObject mmo : player.getMap().getReactors()) {
|
||||
MapleReactor mr = (MapleReactor) mmo;
|
||||
player.dropMessage(6, "Id: " + mr.getId() + " Oid: " + mr.getObjectId() + " name: '" + mr.getName() + "' -> Type: " + mr.getReactorType() + " State: " + mr.getState() + " Event State: " + mr.getEventState() + " Position: x " + mr.getPosition().getX() + " y " + mr.getPosition().getY() + ".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user