Client Timestamp update + Cosmetic NPCs & H Beacon patch + Log rework
Fixed Music command not playing soundtracks at all. Fixed stylish scripts stucking player NPC interactions in certain cases. Reviewed client mistimed view on items, quest expirations, BBS threads, etc. Fixed Homing Beacon skill provoking autoflag in mobs with same objectid in different maps. Solved DB leak cases with removing pets from inventory. Reviewed logging throughout the source, aiming to normalize the varied-spaced log content within the facilities. Fixed a bug that would occur when trying to reaccess Horntail expedition.
This commit is contained in:
@@ -187,7 +187,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
private MapleFamily family;
|
||||
private int familyId;
|
||||
private int bookCover;
|
||||
private int markedMonster = 0;
|
||||
private int battleshipHp = 0;
|
||||
private int mesosTraded = 0;
|
||||
private int possibleReports = 10;
|
||||
@@ -2785,11 +2784,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
deletedCoupon = true;
|
||||
}
|
||||
} else {
|
||||
if (item.getPetId() > -1) {
|
||||
int petIdx = getPetIndex(item.getPetId());
|
||||
if(petIdx > -1) unequipPet(getPet(petIdx), true);
|
||||
}
|
||||
|
||||
if (ItemConstants.isExpirablePet(item.getItemId())) {
|
||||
client.announce(MaplePacketCreator.itemExpired(item.getItemId()));
|
||||
toberemove.add(item);
|
||||
@@ -4638,10 +4632,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
return mapid;
|
||||
}
|
||||
|
||||
public int getMarkedMonster() {
|
||||
return markedMonster;
|
||||
}
|
||||
|
||||
public MapleRing getMarriageRing() {
|
||||
return partnerId > 0 ? marriageRing : null;
|
||||
}
|
||||
@@ -8003,10 +7993,10 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
String message = getName() + " received this - " + text;
|
||||
if (Server.getInstance().isGmOnline(this.getWorld())) { //Alert and log if a GM is online
|
||||
Server.getInstance().broadcastGMMessage(this.getWorld(), MaplePacketCreator.sendYellowTip(message));
|
||||
FilePrinter.printError("autobanwarning.txt", message + "\r\n");
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, message);
|
||||
} else { //Auto DC and log if no GM is online
|
||||
client.disconnect(false, false);
|
||||
FilePrinter.printError("autobandced.txt", message + "\r\n");
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_DC, message);
|
||||
}
|
||||
//Server.getInstance().broadcastGMMessage(0, MaplePacketCreator.serverNotice(1, getName() + " received this - " + text));
|
||||
//announce(MaplePacketCreator.sendPolice(text));
|
||||
@@ -8357,10 +8347,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
|
||||
public void setMap(MapleMap newmap) {
|
||||
this.map = newmap;
|
||||
}
|
||||
|
||||
public void setMarkedMonster(int markedMonster) {
|
||||
this.markedMonster = markedMonster;
|
||||
}
|
||||
|
||||
public void setMessenger(MapleMessenger messenger) {
|
||||
this.messenger = messenger;
|
||||
|
||||
@@ -91,7 +91,7 @@ public enum AutobanFactory {
|
||||
Server.getInstance().broadcastGMMessage((chr != null ? chr.getWorld() : 0), MaplePacketCreator.sendYellowTip((chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason));
|
||||
}
|
||||
if (ServerConstants.USE_AUTOBAN_LOG) {
|
||||
FilePrinter.printError("autobanwarning.txt", (chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason + "\r\n");
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, (chr != null ? MapleCharacter.makeMapleReadable(chr.getName()) : "") + " caused " + this.name() + " " + reason);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class AutobanManager {
|
||||
}
|
||||
if (ServerConstants.USE_AUTOBAN_LOG) {
|
||||
// Lets log every single point too.
|
||||
FilePrinter.printError("autobanwarning.txt", MapleCharacter.makeMapleReadable(chr.getName()) + " caused " + fac.name() + " " + reason + "\r\n");
|
||||
FilePrinter.print(FilePrinter.AUTOBAN_WARNING, MapleCharacter.makeMapleReadable(chr.getName()) + " caused " + fac.name() + " " + reason);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ public class CommandsExecutor {
|
||||
private void writeLog(MapleClient client, String command){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm");
|
||||
FilePrinter.print(FilePrinter.USED_COMMANDS, client.getPlayer().getName() + " used: " + command + " on "
|
||||
+ sdf.format(Calendar.getInstance().getTime()) + "\r\n");
|
||||
+ sdf.format(Calendar.getInstance().getTime()));
|
||||
}
|
||||
|
||||
private void addCommandInfo(String name, Class<? extends Command> commandClass) {
|
||||
@@ -262,7 +262,7 @@ public class CommandsExecutor {
|
||||
addCommand("ignored", 3, IgnoredCommand.class);
|
||||
addCommand("pos", 3, PosCommand.class);
|
||||
addCommand("togglecoupon", 3, ToggleCouponCommand.class);
|
||||
addCommand("chat", 3, ChatCommand.class);
|
||||
addCommand("togglewhitechat", 3, ChatCommand.class);
|
||||
addCommand("fame", 3, FameCommand.class);
|
||||
addCommand("givenx", 3, GiveNxCommand.class);
|
||||
addCommand("givevp", 3, GiveVpCommand.class);
|
||||
|
||||
@@ -61,6 +61,7 @@ public class GachaCommand extends Command {
|
||||
}
|
||||
}
|
||||
talkStr += "\r\nPlease keep in mind that there are items that are in all gachapons and are not listed here.";
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, talkStr, "00 00", (byte) 0));
|
||||
|
||||
c.getAbstractPlayerInteraction().npcTalk(9010000, talkStr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class GmCommand extends Command {
|
||||
String message = joinStringFrom(params, 0);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[GM MESSAGE]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(1, message));
|
||||
FilePrinter.printError("gm.txt", MapleCharacter.makeMapleReadable(player.getName()) + ": " + message + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.COMMAND_GM, MapleCharacter.makeMapleReadable(player.getName()) + ": " + message);
|
||||
player.dropMessage(5, "Your message '" + message + "' was sent to GMs.");
|
||||
player.dropMessage(5, tips[Randomizer.nextInt(tips.length)]);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ReportBugCommand extends Command {
|
||||
String message = joinStringFrom(params, 0);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[BUG]:" + MapleCharacter.makeMapleReadable(player.getName()) + ": " + message));
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.serverNotice(1, message));
|
||||
FilePrinter.printError("bug.txt", MapleCharacter.makeMapleReadable(player.getName()) + ": " + message + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.COMMAND_BUG, MapleCharacter.makeMapleReadable(player.getName()) + ": " + message);
|
||||
player.dropMessage(5, "Your bug '" + message + "' was submitted successfully to our developers. Thank you!");
|
||||
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GotoCommand extends Command {
|
||||
}
|
||||
|
||||
if (player.getEventInstance() != null || MapleMiniDungeonInfo.isDungeonMap(player.getMapId()) || FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit()) || !player.isAlive()) {
|
||||
player.yellowMessage("This command can not be used in this map.");
|
||||
player.dropMessage(1, "This command can not be used in this map.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ public class WhatDropsFromCommand extends Command {
|
||||
output += "\r\n";
|
||||
}
|
||||
}
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, output, "00 00", (byte) 0));
|
||||
|
||||
c.getAbstractPlayerInteraction().npcTalk(9010000, output);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,8 @@ public class WhoDropsCommand extends Command {
|
||||
player.dropMessage(5, "The item you searched for doesn't exist.");
|
||||
return;
|
||||
}
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, output, "00 00", (byte) 0));
|
||||
|
||||
c.getAbstractPlayerInteraction().npcTalk(9010000, output);
|
||||
} finally {
|
||||
c.releaseClient();
|
||||
}
|
||||
|
||||
@@ -136,6 +136,6 @@ public class SearchCommand extends Command {
|
||||
}
|
||||
sb.append("\r\n#kLoaded within ").append((double) (System.currentTimeMillis() - start) / 1000).append(" seconds.");//because I can, and it's free
|
||||
|
||||
c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, sb.toString(), "00 00", (byte) 0));
|
||||
c.getAbstractPlayerInteraction().npcTalk(9010000, sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,9 @@ package client.command.commands.gm2;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import server.maps.FieldLimit;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleMiniDungeonInfo;
|
||||
|
||||
public class WarpCommand extends Command {
|
||||
{
|
||||
@@ -48,6 +50,11 @@ public class WarpCommand extends Command {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getEventInstance() != null || MapleMiniDungeonInfo.isDungeonMap(player.getMapId()) || FieldLimit.CANNOTMIGRATE.check(player.getMap().getFieldLimit()) || !player.isAlive()) {
|
||||
player.dropMessage(1, "This command cannot be used in this map.");
|
||||
return;
|
||||
}
|
||||
|
||||
// expedition issue with this command detected thanks to Masterrulax
|
||||
player.saveLocationOnWarp();
|
||||
player.changeMap(target, target.getRandomPlayerSpawnpoint());
|
||||
|
||||
@@ -26,6 +26,7 @@ package client.command.commands.gm3;
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
import client.MapleCharacter;
|
||||
import constants.GameConstants;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
public class MusicCommand extends Command {
|
||||
@@ -33,181 +34,42 @@ public class MusicCommand extends Command {
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
private static String getSongList() {
|
||||
String songList = "Song:\r\n";
|
||||
for (String s : GameConstants.GAME_SONGS) {
|
||||
songList += (" " + s + "\r\n");
|
||||
}
|
||||
|
||||
return songList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
final String[] songs = {
|
||||
"Jukebox/Congratulation",
|
||||
"Bgm00/SleepyWood",
|
||||
"Bgm00/FloralLife",
|
||||
"Bgm00/GoPicnic",
|
||||
"Bgm00/Nightmare",
|
||||
"Bgm00/RestNPeace",
|
||||
"Bgm01/AncientMove",
|
||||
"Bgm01/MoonlightShadow",
|
||||
"Bgm01/WhereTheBarlogFrom",
|
||||
"Bgm01/CavaBien",
|
||||
"Bgm01/HighlandStar",
|
||||
"Bgm01/BadGuys",
|
||||
"Bgm02/MissingYou",
|
||||
"Bgm02/WhenTheMorningComes",
|
||||
"Bgm02/EvilEyes",
|
||||
"Bgm02/JungleBook",
|
||||
"Bgm02/AboveTheTreetops",
|
||||
"Bgm03/Subway",
|
||||
"Bgm03/Elfwood",
|
||||
"Bgm03/BlueSky",
|
||||
"Bgm03/Beachway",
|
||||
"Bgm03/SnowyVillage",
|
||||
"Bgm04/PlayWithMe",
|
||||
"Bgm04/WhiteChristmas",
|
||||
"Bgm04/UponTheSky",
|
||||
"Bgm04/ArabPirate",
|
||||
"Bgm04/Shinin'Harbor",
|
||||
"Bgm04/WarmRegard",
|
||||
"Bgm05/WolfWood",
|
||||
"Bgm05/DownToTheCave",
|
||||
"Bgm05/AbandonedMine",
|
||||
"Bgm05/MineQuest",
|
||||
"Bgm05/HellGate",
|
||||
"Bgm06/FinalFight",
|
||||
"Bgm06/WelcomeToTheHell",
|
||||
"Bgm06/ComeWithMe",
|
||||
"Bgm06/FlyingInABlueDream",
|
||||
"Bgm06/FantasticThinking",
|
||||
"Bgm07/WaltzForWork",
|
||||
"Bgm07/WhereverYouAre",
|
||||
"Bgm07/FunnyTimeMaker",
|
||||
"Bgm07/HighEnough",
|
||||
"Bgm07/Fantasia",
|
||||
"Bgm08/LetsMarch",
|
||||
"Bgm08/ForTheGlory",
|
||||
"Bgm08/FindingForest",
|
||||
"Bgm08/LetsHuntAliens",
|
||||
"Bgm08/PlotOfPixie",
|
||||
"Bgm09/DarkShadow",
|
||||
"Bgm09/TheyMenacingYou",
|
||||
"Bgm09/FairyTale",
|
||||
"Bgm09/FairyTalediffvers",
|
||||
"Bgm09/TimeAttack",
|
||||
"Bgm10/Timeless",
|
||||
"Bgm10/TimelessB",
|
||||
"Bgm10/BizarreTales",
|
||||
"Bgm10/TheWayGrotesque",
|
||||
"Bgm10/Eregos",
|
||||
"Bgm11/BlueWorld",
|
||||
"Bgm11/Aquarium",
|
||||
"Bgm11/ShiningSea",
|
||||
"Bgm11/DownTown",
|
||||
"Bgm11/DarkMountain",
|
||||
"Bgm12/AquaCave",
|
||||
"Bgm12/DeepSee",
|
||||
"Bgm12/WaterWay",
|
||||
"Bgm12/AcientRemain",
|
||||
"Bgm12/RuinCastle",
|
||||
"Bgm12/Dispute",
|
||||
"Bgm13/CokeTown",
|
||||
"Bgm13/Leafre",
|
||||
"Bgm13/Minar'sDream",
|
||||
"Bgm13/AcientForest",
|
||||
"Bgm13/TowerOfGoddess",
|
||||
"Bgm14/DragonLoad",
|
||||
"Bgm14/HonTale",
|
||||
"Bgm14/CaveOfHontale",
|
||||
"Bgm14/DragonNest",
|
||||
"Bgm14/Ariant",
|
||||
"Bgm14/HotDesert",
|
||||
"Bgm15/MureungHill",
|
||||
"Bgm15/MureungForest",
|
||||
"Bgm15/WhiteHerb",
|
||||
"Bgm15/Pirate",
|
||||
"Bgm15/SunsetDesert",
|
||||
"Bgm16/Duskofgod",
|
||||
"Bgm16/FightingPinkBeen",
|
||||
"Bgm16/Forgetfulness",
|
||||
"Bgm16/Remembrance",
|
||||
"Bgm16/Repentance",
|
||||
"Bgm16/TimeTemple",
|
||||
"Bgm17/MureungSchool1",
|
||||
"Bgm17/MureungSchool2",
|
||||
"Bgm17/MureungSchool3",
|
||||
"Bgm17/MureungSchool4",
|
||||
"Bgm18/BlackWing",
|
||||
"Bgm18/DrillHall",
|
||||
"Bgm18/QueensGarden",
|
||||
"Bgm18/RaindropFlower",
|
||||
"Bgm18/WolfAndSheep",
|
||||
"Bgm19/BambooGym",
|
||||
"Bgm19/CrystalCave",
|
||||
"Bgm19/MushCatle",
|
||||
"Bgm19/RienVillage",
|
||||
"Bgm19/SnowDrop",
|
||||
"Bgm20/GhostShip",
|
||||
"Bgm20/NetsPiramid",
|
||||
"Bgm20/UnderSubway",
|
||||
"Bgm21/2021year",
|
||||
"Bgm21/2099year",
|
||||
"Bgm21/2215year",
|
||||
"Bgm21/2230year",
|
||||
"Bgm21/2503year",
|
||||
"Bgm21/KerningSquare",
|
||||
"Bgm21/KerningSquareField",
|
||||
"Bgm21/KerningSquareSubway",
|
||||
"Bgm21/TeraForest",
|
||||
"BgmEvent/FunnyRabbit",
|
||||
"BgmEvent/FunnyRabbitFaster",
|
||||
"BgmEvent/wedding",
|
||||
"BgmEvent/weddingDance",
|
||||
"BgmEvent/wichTower",
|
||||
"BgmGL/amoria",
|
||||
"BgmGL/Amorianchallenge",
|
||||
"BgmGL/chapel",
|
||||
"BgmGL/cathedral",
|
||||
"BgmGL/Courtyard",
|
||||
"BgmGL/CrimsonwoodKeep",
|
||||
"BgmGL/CrimsonwoodKeepInterior",
|
||||
"BgmGL/GrandmastersGauntlet",
|
||||
"BgmGL/HauntedHouse",
|
||||
"BgmGL/NLChunt",
|
||||
"BgmGL/NLCtown",
|
||||
"BgmGL/NLCupbeat",
|
||||
"BgmGL/PartyQuestGL",
|
||||
"BgmGL/PhantomForest",
|
||||
"BgmJp/Feeling",
|
||||
"BgmJp/BizarreForest",
|
||||
"BgmJp/Hana",
|
||||
"BgmJp/Yume",
|
||||
"BgmJp/Bathroom",
|
||||
"BgmJp/BattleField",
|
||||
"BgmJp/FirstStepMaster",
|
||||
"BgmMY/Highland",
|
||||
"BgmMY/KualaLumpur",
|
||||
"BgmSG/BoatQuay_field",
|
||||
"BgmSG/BoatQuay_town",
|
||||
"BgmSG/CBD_field",
|
||||
"BgmSG/CBD_town",
|
||||
"BgmSG/Ghostship",
|
||||
"BgmUI/ShopBgm",
|
||||
"BgmUI/Title"
|
||||
};
|
||||
|
||||
MapleCharacter player = c.getPlayer();
|
||||
if (params.length < 1) {
|
||||
player.yellowMessage("Syntax: !music <song>");
|
||||
for (String s : songs) {
|
||||
player.yellowMessage(s);
|
||||
}
|
||||
String sendMsg = "";
|
||||
|
||||
sendMsg += "Syntax: #r!music <song>#k\r\n\r\n";
|
||||
sendMsg += getSongList();
|
||||
|
||||
c.announce(MaplePacketCreator.getNPCTalk(1052015, (byte) 0, sendMsg, "00 00", (byte) 0));
|
||||
return;
|
||||
}
|
||||
|
||||
String song = joinStringFrom(params, 0);
|
||||
for (String s : songs) {
|
||||
if (s.equals(song)) {
|
||||
for (String s : GameConstants.GAME_SONGS) {
|
||||
if (s.equalsIgnoreCase(song)) { // thanks Masterrulax for finding an issue here
|
||||
player.getMap().broadcastMessage(MaplePacketCreator.musicChange(s));
|
||||
player.yellowMessage("Now playing song " + song + ".");
|
||||
break;
|
||||
player.yellowMessage("Now playing song " + s + ".");
|
||||
return;
|
||||
}
|
||||
}
|
||||
player.yellowMessage("Song not found, please enter a song below.");
|
||||
for (String s : songs) {
|
||||
player.yellowMessage(s);
|
||||
}
|
||||
|
||||
String sendMsg = "";
|
||||
sendMsg += "Song not found, please enter a song below.\r\n\r\n";
|
||||
sendMsg += getSongList();
|
||||
|
||||
c.announce(MaplePacketCreator.getNPCTalk(1052015, (byte) 0, sendMsg, "00 00", (byte) 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,11 +45,18 @@ public class ProItemCommand extends Command {
|
||||
player.yellowMessage("Syntax: !proitem <itemid> <stat value> [<spdjmp value>]");
|
||||
return;
|
||||
}
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
int itemid = Integer.parseInt(params[0]);
|
||||
|
||||
if(ii.getName(itemid) == null) {
|
||||
player.yellowMessage("Item id '" + params[0] + "' does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
short stat = (short) Math.max(0, Short.parseShort(params[1]));
|
||||
short spdjmp = params.length >= 3 ? (short) Math.max(0, Short.parseShort(params[2])) : 0;
|
||||
|
||||
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
|
||||
|
||||
MapleInventoryType type = ItemConstants.getInventoryType(itemid);
|
||||
if (type.equals(MapleInventoryType.EQUIP)) {
|
||||
Item it = ii.getEquipById(itemid);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class DebugCommand extends Command {
|
||||
msgTypes += ("#L" + i + "#" + debugTypes[i] + "#l\r\n");
|
||||
}
|
||||
|
||||
player.announce(MaplePacketCreator.getNPCTalk(9201143, (byte) 0, msgTypes, "00 00", (byte) 0));
|
||||
c.getAbstractPlayerInteraction().npcTalk(9201143, msgTypes);
|
||||
break;
|
||||
|
||||
case "monster":
|
||||
|
||||
@@ -28,6 +28,7 @@ import client.inventory.MapleInventoryType;
|
||||
import constants.ServerConstants;
|
||||
import net.server.Server;
|
||||
import server.MapleItemInformationProvider;
|
||||
import tools.FilePrinter;
|
||||
import tools.MaplePacketCreator;
|
||||
|
||||
/**
|
||||
@@ -93,6 +94,7 @@ public abstract class CharacterFactory {
|
||||
|
||||
Server.getInstance().createCharacterEntry(newchar);
|
||||
Server.getInstance().broadcastGMMessage(c.getWorld(), MaplePacketCreator.sendYellowTip("[NEW CHAR]: " + c.getAccountName() + " has created a new character with IGN " + name));
|
||||
FilePrinter.print(FilePrinter.CREATED_CHAR + c.getAccountName() + ".txt", c.getAccountName() + " created character with IGN " + name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -81,17 +81,24 @@ public class MaplePet extends Item {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteFromDb() {
|
||||
|
||||
public static void deleteFromDb(int petid) {
|
||||
try {
|
||||
Connection con = DatabaseConnection.getConnection();
|
||||
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM pets WHERE `petid` = ?");
|
||||
ps.setInt(1, this.getUniqueId());
|
||||
ps.setInt(1, petid);
|
||||
ps.executeUpdate();
|
||||
ps.close();
|
||||
|
||||
ps = con.prepareStatement("DELETE FROM petignores WHERE `petid` = ?"); // thanks Vcoc for detecting petignores remaining after deletion
|
||||
ps.setInt(1, petid);
|
||||
ps.executeUpdate();
|
||||
ps.close();
|
||||
|
||||
con.close();
|
||||
|
||||
MapleCashidGenerator.freeCashId(this.getUniqueId());
|
||||
MapleCashidGenerator.freeCashId(petid);
|
||||
} catch (SQLException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import client.inventory.Equip;
|
||||
import client.inventory.Item;
|
||||
import client.inventory.MapleInventory;
|
||||
import client.inventory.MapleInventoryType;
|
||||
import client.inventory.MaplePet;
|
||||
import client.inventory.ModifyInventory;
|
||||
import client.newyear.NewYearCardRecord;
|
||||
import constants.ItemConstants;
|
||||
@@ -361,14 +362,15 @@ public class MapleInventoryManipulator {
|
||||
}
|
||||
|
||||
public static void removeFromSlot(MapleClient c, MapleInventoryType type, short slot, short quantity, boolean fromDrop, boolean consume) {
|
||||
MapleInventory inv = c.getPlayer().getInventory(type);
|
||||
MapleCharacter chr = c.getPlayer();
|
||||
MapleInventory inv = chr.getInventory(type);
|
||||
Item item = inv.getItem(slot);
|
||||
boolean allowZero = consume && ItemConstants.isRechargeable(item.getItemId());
|
||||
|
||||
if(type == MapleInventoryType.EQUIPPED) {
|
||||
inv.lockInventory();
|
||||
try {
|
||||
c.getPlayer().unequippedItem((Equip) item);
|
||||
chr.unequippedItem((Equip) item);
|
||||
inv.removeItem(slot, quantity, allowZero);
|
||||
} finally {
|
||||
inv.unlockInventory();
|
||||
@@ -376,10 +378,25 @@ public class MapleInventoryManipulator {
|
||||
|
||||
announceModifyInventory(c, item, fromDrop, allowZero);
|
||||
} else {
|
||||
inv.removeItem(slot, quantity, allowZero);
|
||||
int petid = item.getPetId();
|
||||
if (petid > -1) { // thanks Vcoc for finding a d/c issue with equipped pets & pets remaining on DB here
|
||||
int petIdx = chr.getPetIndex(petid);
|
||||
if(petIdx > -1) {
|
||||
MaplePet pet = chr.getPet(petIdx);
|
||||
chr.unequipPet(pet, true);
|
||||
}
|
||||
|
||||
if(type != MapleInventoryType.CANHOLD) {
|
||||
announceModifyInventory(c, item, fromDrop, allowZero);
|
||||
inv.removeItem(slot, quantity, allowZero);
|
||||
if(type != MapleInventoryType.CANHOLD) {
|
||||
announceModifyInventory(c, item, fromDrop, allowZero);
|
||||
}
|
||||
|
||||
MaplePet.deleteFromDb(petid);
|
||||
} else {
|
||||
inv.removeItem(slot, quantity, allowZero);
|
||||
if(type != MapleInventoryType.CANHOLD) {
|
||||
announceModifyInventory(c, item, fromDrop, allowZero);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class AssignSPProcessor {
|
||||
boolean isBeginnerSkill = false;
|
||||
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.\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use skill " + skillid + " without it being in their job.");
|
||||
|
||||
final MapleClient client = c;
|
||||
ThreadManager.getInstance().newTask(new Runnable() {
|
||||
|
||||
@@ -351,7 +351,7 @@ public class DueyProcessor {
|
||||
final long sendMesos = (long) mesos + fee;
|
||||
if (mesos < 0 || sendMesos > Integer.MAX_VALUE || (amount < 1 && mesos == 0)) {
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with duey.");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use duey with mesos " + mesos + " and amount " + amount + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to use duey with mesos " + mesos + " and amount " + amount);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
@@ -464,7 +464,7 @@ public class DueyProcessor {
|
||||
dp = dueypack;
|
||||
if(dp == null) {
|
||||
c.announce(MaplePacketCreator.sendDueyMSG(Actions.TOCLIENT_RECV_UNKNOWN_ERROR.getCode()));
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to receive package from duey with id " + packageid + "\r\n");
|
||||
FilePrinter.printError(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to receive package from duey with id " + packageid);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public class FredrickProcessor {
|
||||
Item item = it.getLeft();
|
||||
MapleInventoryManipulator.addFromDrop(chr.getClient(), item, false);
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId());
|
||||
FilePrinter.print(FilePrinter.FREDRICK + chr.getName() + ".txt", chr.getName() + " gained " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")\r\n");
|
||||
FilePrinter.print(FilePrinter.FREDRICK + chr.getName() + ".txt", chr.getName() + " gained " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")");
|
||||
}
|
||||
|
||||
chr.announce(MaplePacketCreator.fredrickMessage((byte) 0x1E));
|
||||
|
||||
@@ -62,7 +62,7 @@ public class SpawnPetProcessor {
|
||||
long expiration = chr.getInventory(MapleInventoryType.CASH).getItem(slot).getExpiration();
|
||||
MapleInventoryManipulator.removeById(c, MapleInventoryType.CASH, petid, (short) 1, false, false);
|
||||
MapleInventoryManipulator.addById(c, evolveid, (short) 1, null, petId, expiration);
|
||||
pet.deleteFromDb();
|
||||
MaplePet.deleteFromDb(petId);
|
||||
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
return;
|
||||
|
||||
@@ -61,7 +61,7 @@ public class StorageProcessor {
|
||||
byte slot = slea.readByte();
|
||||
if (slot < 0 || slot > storage.getSlots()) { // removal starts at zero
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with storage.");
|
||||
FilePrinter.print(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to work with storage slot " + slot + "\r\n");
|
||||
FilePrinter.print(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to work with storage slot " + slot);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class StorageProcessor {
|
||||
if (MapleInventoryManipulator.checkSpace(c, item.getItemId(), item.getQuantity(), item.getOwner())) {
|
||||
item = storage.takeOut(slot);//actually the same but idc
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId());
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " took out " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")\r\n");
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " took out " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")");
|
||||
chr.setUsedStorage();
|
||||
MapleKarmaManipulator.toggleKarmaFlagToUntradeable(item);
|
||||
MapleInventoryManipulator.addFromDrop(c, item, false);
|
||||
@@ -101,7 +101,7 @@ public class StorageProcessor {
|
||||
MapleInventory Inv = chr.getInventory(slotType);
|
||||
if (slot < 1 || slot > Inv.getSlotLimit()) { //player inv starts at one
|
||||
AutobanFactory.PACKET_EDIT.alert(c.getPlayer(), c.getPlayer().getName() + " tried to packet edit with storage.");
|
||||
FilePrinter.print(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to store item at slot " + slot + "\r\n");
|
||||
FilePrinter.print(FilePrinter.EXPLOITS + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + " tried to store item at slot " + slot);
|
||||
c.disconnect(true, false);
|
||||
return;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public class StorageProcessor {
|
||||
storage.store(item);
|
||||
storage.sendStored(c, ItemConstants.getInventoryType(itemId));
|
||||
String itemName = MapleItemInformationProvider.getInstance().getName(item.getItemId());
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " stored " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")\r\n");
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getAccountName() + ".txt", c.getPlayer().getName() + " stored " + item.getQuantity() + " " + itemName + " (" + item.getItemId() + ")");
|
||||
chr.setUsedStorage();
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class StorageProcessor {
|
||||
}
|
||||
storage.setMeso(storageMesos - meso);
|
||||
chr.gainMeso(meso, false, true, false);
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + (meso > 0 ? " took out " : " stored ") + Math.abs(meso) + " mesos\r\n");
|
||||
FilePrinter.print(FilePrinter.STORAGE + c.getPlayer().getName() + ".txt", c.getPlayer().getName() + (meso > 0 ? " took out " : " stored ") + Math.abs(meso) + " mesos");
|
||||
chr.setUsedStorage();
|
||||
} else {
|
||||
c.announce(MaplePacketCreator.enableActions());
|
||||
|
||||
Reference in New Issue
Block a user