Rename and clean up MapleCharacter

This commit is contained in:
P0nk
2021-09-09 21:09:45 +02:00
parent 46bd0570d7
commit 7dc3a2159a
379 changed files with 3418 additions and 3373 deletions

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import config.YamlConfig;
@@ -35,7 +35,7 @@ public class ApCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !ap [<playername>] <newap>");
return;
@@ -48,7 +48,7 @@ public class ApCommand extends Command {
player.changeRemainingAp(newAp, false);
} else {
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim != null) {
int newAp = Integer.parseInt(params[1]);
if (newAp < 0) newAp = 0;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import net.server.Server;
@@ -37,9 +37,9 @@ public class BombCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length > 0) {
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim != null) {
victim.getMap().spawnMonsterOnGroundBelow(MapleLifeFactory.getMonster(9300166), victim.getPosition());
Server.getInstance().broadcastGMMessage(c.getWorld(), PacketCreator.serverNotice(5, player.getName() + " used !bomb on " + victim.getName()));

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.Skill;
import client.SkillFactory;
@@ -36,7 +36,7 @@ public class BuffCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !buff <buffid>");
return;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.SkillFactory;
import client.command.Command;
@@ -35,7 +35,7 @@ public class BuffMapCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
SkillFactory.getSkill(9101001).getEffect(SkillFactory.getSkill(9101001).getMaxLevel()).applyTo(player, true);
SkillFactory.getSkill(9101002).getEffect(SkillFactory.getSkill(9101002).getMaxLevel()).applyTo(player, true);
SkillFactory.getSkill(9101003).getEffect(SkillFactory.getSkill(9101003).getMaxLevel()).applyTo(player, true);

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
@@ -34,7 +34,7 @@ public class ClearDropsCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
player.getMap().clearDrops(player);
player.dropMessage(5, "Cleared dropped items");
}

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import server.maps.SavedLocationType;
@@ -35,7 +35,7 @@ public class ClearSavedLocationsCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer(), victim;
Character player = c.getPlayer(), victim;
if (params.length > 0) {
victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import client.inventory.InventoryType;
@@ -37,7 +37,7 @@ public class ClearSlotCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !clearslot <all, equip, use, setup, etc or cash.>");
return;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
@@ -34,13 +34,13 @@ public class DcCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !dc <playername>");
return;
}
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim == null) {
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim == null) {

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.SkillFactory;
import client.command.Command;
@@ -35,7 +35,7 @@ public class EmpowerMeCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
final int[] array = {2311003, 2301004, 1301007, 4101004, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002};
for (int i : array) {
SkillFactory.getSkill(i).getEffect(SkillFactory.getSkill(i).getMaxLevel()).applyTo(player);

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
@@ -34,7 +34,7 @@ public class HealCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
player.healHpMp();
}

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.SkillFactory;
import client.command.Command;
@@ -35,7 +35,7 @@ public class HideCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player);
}

View File

@@ -1,6 +1,6 @@
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import server.ThreadManager;
@@ -31,7 +31,7 @@ public class IdCommand extends Command {
@Override
public void execute(MapleClient client, final String[] params) {
final MapleCharacter player = client.getPlayer();
final Character player = client.getPlayer();
if (params.length < 2) {
player.yellowMessage("Syntax: !id <type> <query>");
return;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import client.inventory.Pet;
@@ -39,7 +39,7 @@ public class ItemCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !item <itemid> <quantity>");

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import client.inventory.InventoryType;
@@ -40,7 +40,7 @@ public class ItemDropCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !drop <itemid> <quantity>");

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import server.maps.MapleMap;
@@ -36,7 +36,7 @@ public class JailCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !jail <playername> [<minutes>]");
return;
@@ -51,7 +51,7 @@ public class JailCommand extends Command {
}
}
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim != null) {
victim.addJailExpirationTime(minutesJailed * 60 * 1000);

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.MapleJob;
import client.command.Command;
@@ -35,7 +35,7 @@ public class JobCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length == 1) {
int jobid = Integer.parseInt(params[0]);
if (jobid < 0 || jobid >= 2200) {
@@ -46,7 +46,7 @@ public class JobCommand extends Command {
player.changeJob(MapleJob.getById(jobid));
player.equipChanged();
} else if (params.length == 2) {
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim != null) {
int jobid = Integer.parseInt(params[1]);

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import config.YamlConfig;
@@ -35,7 +35,7 @@ public class LevelCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !level <newlevel>");
return;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
@@ -34,7 +34,7 @@ public class LevelProCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !levelpro <newlevel>");
return;

View File

@@ -23,6 +23,7 @@
*/
package client.command.commands.gm2;
import client.Character;
import client.*;
import client.command.Command;
import provider.MapleData;
@@ -36,7 +37,7 @@ public class MaxSkillCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
try {
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.MapleStat;
import client.command.Command;
@@ -36,7 +36,7 @@ public class MaxStatCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
player.loseExp(player.getExp(), false, false);
player.setLevel(255);
player.resetPlayerRates();

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import server.maps.MapleMap;
@@ -35,13 +35,13 @@ public class ReachCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !reach <playername>");
return;
}
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim != null && victim.isLoggedin()) {
if (player.getClient().getChannel() != victim.getClient().getChannel()) {
player.dropMessage(5, "Player '" + victim.getName() + "' is at channel " + victim.getClient().getChannel() + ".");

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import client.inventory.InventoryType;
@@ -38,7 +38,7 @@ public class RechargeCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
for (Item torecharge : c.getPlayer().getInventory(InventoryType.USE).list()) {
if (ItemConstants.isThrowingStar(torecharge.getItemId())){

View File

@@ -23,6 +23,7 @@
*/
package client.command.commands.gm2;
import client.Character;
import client.*;
import client.command.Command;
import provider.MapleData;
@@ -36,7 +37,7 @@ public class ResetSkillCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
for (MapleData skill_ : MapleDataProviderFactory.getDataProvider(WZFiles.STRING).getData("Skill.img").getChildren()) {
try {
Skill skill = SkillFactory.getSkill(Integer.parseInt(skill_.getName()));

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import provider.MapleData;
@@ -53,7 +53,7 @@ public class SearchCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 2) {
player.yellowMessage("Syntax: !search <type> <name>");
return;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
@@ -34,7 +34,7 @@ public class SetSlotCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !setslot <newlevel>");
return;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
@@ -34,7 +34,7 @@ public class SetStatCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !setstat <newstat>");
return;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import config.YamlConfig;
@@ -35,7 +35,7 @@ public class SpCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !sp [<playername>] <newsp>");
return;
@@ -48,7 +48,7 @@ public class SpCommand extends Command {
player.updateRemainingSp(newSp);
} else {
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim != null) {
int newSp = Integer.parseInt(params[1]);
if (newSp < 0) newSp = 0;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import net.server.Server;
@@ -37,13 +37,13 @@ public class SummonCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !warphere <playername>");
return;
}
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
Character victim = c.getChannelServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim == null) {
//If victim isn't on current channel, loop all channels on current world.

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.SkillFactory;
import client.command.Command;
@@ -35,7 +35,7 @@ public class UnHideCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
SkillFactory.getSkill(9101004).getEffect(SkillFactory.getSkill(9101004).getMaxLevel()).applyTo(player);
}

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
@@ -34,13 +34,13 @@ public class UnJailCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !unjail <playername>");
return;
}
MapleCharacter victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
Character victim = c.getWorldServer().getPlayerStorage().getCharacterByName(params[0]);
if (victim != null) {
if (victim.getJailExpirationTimeLeft() <= 0) {
player.message("This player is already free.");

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import server.maps.MapleMap;
@@ -38,7 +38,7 @@ public class WarpAreaCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !warparea <mapid>");
return;
@@ -53,9 +53,9 @@ public class WarpAreaCommand extends Command {
Point pos = player.getPosition();
Collection<MapleCharacter> characters = player.getMap().getAllPlayers();
Collection<Character> characters = player.getMap().getAllPlayers();
for (MapleCharacter victim : characters) {
for (Character victim : characters) {
if (victim.getPosition().distanceSq(pos) <= 50000) {
victim.saveLocationOnWarp();
victim.changeMap(target, target.getRandomPlayerSpawnpoint());

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import server.maps.FieldLimit;
@@ -37,7 +37,7 @@ public class WarpCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !warp <mapid>");
return;

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import server.maps.MapleMap;
@@ -37,7 +37,7 @@ public class WarpMapCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
if (params.length < 1) {
player.yellowMessage("Syntax: !warpmap <mapid>");
return;
@@ -50,9 +50,9 @@ public class WarpMapCommand extends Command {
return;
}
Collection<MapleCharacter> characters = player.getMap().getAllPlayers();
Collection<Character> characters = player.getMap().getAllPlayers();
for (MapleCharacter victim : characters) {
for (Character victim : characters) {
victim.saveLocationOnWarp();
victim.changeMap(target, target.getRandomPlayerSpawnpoint());
}

View File

@@ -23,7 +23,7 @@
*/
package client.command.commands.gm2;
import client.MapleCharacter;
import client.Character;
import client.MapleClient;
import client.command.Command;
import server.life.MapleMonster;
@@ -40,9 +40,9 @@ public class WhereaMiCommand extends Command {
@Override
public void execute(MapleClient c, String[] params) {
MapleCharacter player = c.getPlayer();
Character player = c.getPlayer();
HashSet<MapleCharacter> chars = new HashSet<>();
HashSet<Character> chars = new HashSet<>();
HashSet<MapleNPC> npcs = new HashSet<>();
HashSet<MaplePlayerNPC> playernpcs = new HashSet<>();
HashSet<MapleMonster> mobs = new HashSet<>();
@@ -51,8 +51,8 @@ public class WhereaMiCommand extends Command {
if (mmo instanceof MapleNPC) {
MapleNPC npc = (MapleNPC) mmo;
npcs.add(npc);
} else if (mmo instanceof MapleCharacter) {
MapleCharacter mc = (MapleCharacter) mmo;
} else if (mmo instanceof Character) {
Character mc = (Character) mmo;
chars.add(mc);
} else if (mmo instanceof MapleMonster) {
MapleMonster mob = (MapleMonster) mmo;
@@ -68,7 +68,7 @@ public class WhereaMiCommand extends Command {
player.yellowMessage("Map ID: " + player.getMap().getId());
player.yellowMessage("Players on this map:");
for (MapleCharacter chr : chars) {
for (Character chr : chars) {
player.dropMessage(5, ">> " + chr.getName() + " - " + chr.getId() + " - Oid: " + chr.getObjectId());
}