Rename and clean up MapleCharacter
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
package client.processor.action; // thanks Alex for pointing out some package structures containing broad modules
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import server.maps.MapleMap;
|
||||
import tools.PacketCreator;
|
||||
@@ -31,7 +31,7 @@ import tools.PacketCreator;
|
||||
public class BuybackProcessor {
|
||||
|
||||
public static void processBuyback(MapleClient c) {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
Character chr = c.getPlayer();
|
||||
boolean buyback;
|
||||
|
||||
c.lockClient();
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
package client.processor.action;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.inventory.Equip;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -304,7 +304,7 @@ public class MakerProcessor {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getMakerSkillLevel(MapleCharacter chr) {
|
||||
public static int getMakerSkillLevel(Character chr) {
|
||||
return chr.getSkillLevel((chr.getJob().getId() / 1000) * 10000000 + 1007);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
package client.processor.action;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -53,7 +53,7 @@ public class PetAutopotProcessor {
|
||||
private int maxHp, maxMp, curHp, curMp;
|
||||
private double incHp, incMp;
|
||||
|
||||
private boolean cursorOnNextAvailablePot(MapleCharacter chr) {
|
||||
private boolean cursorOnNextAvailablePot(Character chr) {
|
||||
if(toUseList == null) {
|
||||
toUseList = chr.getInventory(InventoryType.USE).linkedListById(itemId);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class PetAutopotProcessor {
|
||||
|
||||
public void run() {
|
||||
MapleClient c = this.c;
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
Character chr = c.getPlayer();
|
||||
if (!chr.isAlive()) {
|
||||
c.sendPacket(PacketCreator.enableActions());
|
||||
return;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
package client.processor.action;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.SkillFactory;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -43,7 +43,7 @@ public class SpawnPetProcessor {
|
||||
public static void processSpawnPet(MapleClient c, byte slot, boolean lead) {
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
Character chr = c.getPlayer();
|
||||
Pet pet = chr.getInventory(InventoryType.CASH).getItem(slot).getPet();
|
||||
if (pet == null) return;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
package client.processor.npc;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Inventory;
|
||||
@@ -106,7 +106,7 @@ public class DueyProcessor {
|
||||
return ids;
|
||||
}
|
||||
|
||||
private static void showDueyNotification(MapleClient c, MapleCharacter player) {
|
||||
private static void showDueyNotification(MapleClient c, Character player) {
|
||||
try (Connection con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT SenderName, Type FROM dueypackages WHERE ReceiverId = ? AND Checked = 1 ORDER BY Type DESC")) {
|
||||
|
||||
@@ -167,7 +167,7 @@ public class DueyProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
private static List<DueyPackage> loadPackages(MapleCharacter chr) {
|
||||
private static List<DueyPackage> loadPackages(Character chr) {
|
||||
List<DueyPackage> packages = new LinkedList<>();
|
||||
try (Connection con = DatabaseConnection.getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM dueypackages dp WHERE ReceiverId = ?")) {
|
||||
@@ -348,7 +348,7 @@ public class DueyProcessor {
|
||||
if (channel > -1) {
|
||||
Channel rcserv = c.getWorldServer().getChannel(channel);
|
||||
if (rcserv != null) {
|
||||
MapleCharacter rChr = rcserv.getPlayerStorage().getCharacterByName(recipient);
|
||||
Character rChr = rcserv.getPlayerStorage().getCharacterByName(recipient);
|
||||
if (rChr != null) {
|
||||
rClient = rChr.getClient();
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
package client.processor.npc;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.inventory.Inventory;
|
||||
import client.inventory.InventoryType;
|
||||
@@ -52,7 +52,7 @@ public class FredrickProcessor {
|
||||
|
||||
private static int[] dailyReminders = new int[]{2, 5, 10, 15, 30, 60, 90, Integer.MAX_VALUE};
|
||||
|
||||
private static byte canRetrieveFromFredrick(MapleCharacter chr, List<Pair<Item, InventoryType>> items) {
|
||||
private static byte canRetrieveFromFredrick(Character chr, List<Pair<Item, InventoryType>> items) {
|
||||
if (!Inventory.checkSpotsAndOwnership(chr, items)) {
|
||||
List<Integer> itemids = new LinkedList<>();
|
||||
for (Pair<Item, InventoryType> it : items) {
|
||||
@@ -132,7 +132,7 @@ public class FredrickProcessor {
|
||||
private static void removeFredrickReminders(List<Pair<Integer, Integer>> expiredCids) {
|
||||
List<String> expiredCnames = new LinkedList<>();
|
||||
for (Pair<Integer, Integer> id : expiredCids) {
|
||||
String name = MapleCharacter.getNameById(id.getLeft());
|
||||
String name = Character.getNameById(id.getLeft());
|
||||
if (name != null) {
|
||||
expiredCnames.add(name);
|
||||
}
|
||||
@@ -209,7 +209,7 @@ public class FredrickProcessor {
|
||||
|
||||
World wserv = Server.getInstance().getWorld(cid.getRight());
|
||||
if (wserv != null) {
|
||||
MapleCharacter chr = wserv.getPlayerStorage().getCharacterById(cid.getLeft());
|
||||
Character chr = wserv.getPlayerStorage().getCharacterById(cid.getLeft());
|
||||
if (chr != null) {
|
||||
chr.setMerchantMeso(0);
|
||||
}
|
||||
@@ -239,7 +239,7 @@ public class FredrickProcessor {
|
||||
ps.addBatch();
|
||||
|
||||
String msg = fredrickReminderMessage(cid.getRight() - 1);
|
||||
MapleCharacter.sendNote(cid.getLeft().getRight(), "FREDRICK", msg, (byte) 0);
|
||||
Character.sendNote(cid.getLeft().getRight(), "FREDRICK", msg, (byte) 0);
|
||||
}
|
||||
|
||||
ps.executeBatch();
|
||||
@@ -267,7 +267,7 @@ public class FredrickProcessor {
|
||||
public static void fredrickRetrieveItems(MapleClient c) { // thanks Gustav for pointing out the dupe on Fredrick handling
|
||||
if (c.tryacquireClient()) {
|
||||
try {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
Character chr = c.getPlayer();
|
||||
|
||||
List<Pair<Item, InventoryType>> items;
|
||||
try {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
*/
|
||||
package client.processor.npc;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Inventory;
|
||||
@@ -46,7 +46,7 @@ public class StorageProcessor {
|
||||
|
||||
public static void storageAction(InPacket p, MapleClient c) {
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
Character chr = c.getPlayer();
|
||||
MapleStorage storage = chr.getStorage();
|
||||
byte mode = p.readByte();
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
*/
|
||||
package client.processor.stat;
|
||||
|
||||
import client.Character;
|
||||
import client.*;
|
||||
import client.autoban.AutobanFactory;
|
||||
import client.inventory.Equip;
|
||||
@@ -46,7 +47,7 @@ import java.util.List;
|
||||
public class AssignAPProcessor {
|
||||
|
||||
public static void APAutoAssignAction(InPacket inPacket, MapleClient c) {
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
Character chr = c.getPlayer();
|
||||
if (chr.getRemainingAp() < 1) return;
|
||||
|
||||
Collection<Item> equippedC = chr.getInventory(InventoryType.EQUIPPED).list();
|
||||
@@ -420,7 +421,7 @@ public class AssignAPProcessor {
|
||||
public static boolean APResetAction(MapleClient c, int APFrom, int APTo) {
|
||||
c.lockClient();
|
||||
try {
|
||||
MapleCharacter player = c.getPlayer();
|
||||
Character player = c.getPlayer();
|
||||
|
||||
switch (APFrom) {
|
||||
case 64: // str
|
||||
@@ -566,7 +567,7 @@ public class AssignAPProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean addStat(MapleCharacter chr, int apTo, boolean usedAPReset) {
|
||||
private static boolean addStat(Character chr, int apTo, boolean usedAPReset) {
|
||||
switch (apTo) {
|
||||
case 64:
|
||||
if (!chr.assignStr(1)) {
|
||||
@@ -617,7 +618,7 @@ public class AssignAPProcessor {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static int calcHpChange(MapleCharacter player, boolean usedAPReset) {
|
||||
private static int calcHpChange(Character player, boolean usedAPReset) {
|
||||
MapleJob job = player.getJob();
|
||||
int MaxHP = 0;
|
||||
|
||||
@@ -710,7 +711,7 @@ public class AssignAPProcessor {
|
||||
return MaxHP;
|
||||
}
|
||||
|
||||
private static int calcMpChange(MapleCharacter player, boolean usedAPReset) {
|
||||
private static int calcMpChange(Character player, boolean usedAPReset) {
|
||||
MapleJob job = player.getJob();
|
||||
int MaxMP = 0;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
package client.processor.stat;
|
||||
|
||||
import client.MapleCharacter;
|
||||
import client.Character;
|
||||
import client.MapleClient;
|
||||
import client.Skill;
|
||||
import client.SkillFactory;
|
||||
@@ -45,7 +45,7 @@ public class AssignSPProcessor {
|
||||
return false;
|
||||
}
|
||||
|
||||
MapleCharacter player = c.getPlayer();
|
||||
Character player = c.getPlayer();
|
||||
if ((!GameConstants.isPqSkillMap(player.getMapId()) && GameConstants.isPqSkill(skillid)) || (!player.isGM() && GameConstants.isGMSkills(skillid)) || (!GameConstants.isInJobTree(skillid, player.getJob().getId()) && !player.isGM())) {
|
||||
AutobanFactory.PACKET_EDIT.alert(player, "tried to packet edit in distributing sp.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skillid + " without it being in their job.");
|
||||
@@ -64,7 +64,7 @@ public class AssignSPProcessor {
|
||||
return;
|
||||
}
|
||||
|
||||
MapleCharacter player = c.getPlayer();
|
||||
Character player = c.getPlayer();
|
||||
int remainingSp = player.getRemainingSps()[GameConstants.getSkillBook(skillid/10000)];
|
||||
boolean isBeginnerSkill = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user