All packet creating methods now create Packet instead of byte[]

This commit got way too big...
- Remove deprecated methods for sending packets
- Favor OutPacket & Packet over MaplePacketLittleEndianWriter, LittleEndianWriter, and byte array
- Split up some packet creating methods into separate classes
This commit is contained in:
P0nk
2021-08-21 01:36:51 +02:00
parent b5cd6887ae
commit 8f6860d7d7
231 changed files with 6403 additions and 6927 deletions

View File

@@ -527,8 +527,8 @@ public class AbstractPlayerInteraction {
getPlayer().addPet(evolved);
getPlayer().getMap().broadcastMessage(c.getPlayer(), PacketCreator.showPet(c.getPlayer(), evolved, false, false), true);
c.announce(PacketCreator.petStatUpdate(c.getPlayer()));
c.announce(PacketCreator.enableActions());
c.sendPacket(PacketCreator.petStatUpdate(c.getPlayer()));
c.sendPacket(PacketCreator.enableActions());
chr.getClient().getWorldServer().registerPetHunger(chr, chr.getPetIndex(evolved));
*/
@@ -635,7 +635,7 @@ public class AbstractPlayerInteraction {
MapleInventoryManipulator.removeById(c, ItemConstants.getInventoryType(id), id, -quantity, true, false);
}
if (showMessage) {
c.announce(PacketCreator.getShowItemGain(id, quantity, true));
c.sendPacket(PacketCreator.getShowItemGain(id, quantity, true));
}
return item;
@@ -650,7 +650,7 @@ public class AbstractPlayerInteraction {
}
public void playerMessage(int type, String message) {
c.announce(PacketCreator.serverNotice(type, message));
c.sendPacket(PacketCreator.serverNotice(type, message));
}
public void message(String message) {
@@ -666,11 +666,11 @@ public class AbstractPlayerInteraction {
}
public void mapEffect(String path) {
c.announce(PacketCreator.mapEffect(path));
c.sendPacket(PacketCreator.mapEffect(path));
}
public void mapSound(String path) {
c.announce(PacketCreator.mapSound(path));
c.sendPacket(PacketCreator.mapSound(path));
}
public void displayAranIntro() {
@@ -699,12 +699,12 @@ public class AbstractPlayerInteraction {
}
public void showIntro(String path) {
c.announce(PacketCreator.showIntro(path));
c.sendPacket(PacketCreator.showIntro(path));
}
public void showInfo(String path) {
c.announce(PacketCreator.showInfo(path));
c.announce(PacketCreator.enableActions());
c.sendPacket(PacketCreator.showInfo(path));
c.sendPacket(PacketCreator.enableActions());
}
public void guildMessage(int type, String message) {
@@ -754,7 +754,7 @@ public class AbstractPlayerInteraction {
} else {
MapleInventoryManipulator.removeById(cl, ItemConstants.getInventoryType(id), id, -quantity, true, false);
}
cl.announce(PacketCreator.getShowItemGain(id, quantity, true));
cl.sendPacket(PacketCreator.getShowItemGain(id, quantity, true));
}
}
@@ -847,7 +847,7 @@ public class AbstractPlayerInteraction {
int possesed = iv.countById(id);
if (possesed > 0) {
MapleInventoryManipulator.removeById(c, ItemConstants.getInventoryType(id), id, possesed, true, false);
chr.announce(PacketCreator.getShowItemGain(id, (short) -possesed, true));
chr.sendPacket(PacketCreator.getShowItemGain(id, (short) -possesed, true));
}
}
}
@@ -861,13 +861,13 @@ public class AbstractPlayerInteraction {
int possessed = cl.getPlayer().getInventory(invType).countById(id);
if (possessed > 0) {
MapleInventoryManipulator.removeById(cl, ItemConstants.getInventoryType(id), id, possessed, true, false);
cl.announce(PacketCreator.getShowItemGain(id, (short) -possessed, true));
cl.sendPacket(PacketCreator.getShowItemGain(id, (short) -possessed, true));
}
if(invType == MapleInventoryType.EQUIP) {
if(cl.getPlayer().getInventory(MapleInventoryType.EQUIPPED).countById(id) > 0) {
MapleInventoryManipulator.removeById(cl, MapleInventoryType.EQUIPPED, id, 1, true, false);
cl.announce(PacketCreator.getShowItemGain(id, (short) -1, true));
cl.sendPacket(PacketCreator.getShowItemGain(id, (short) -1, true));
}
}
}
@@ -881,12 +881,12 @@ public class AbstractPlayerInteraction {
}
public void showInstruction(String msg, int width, int height) {
c.announce(PacketCreator.sendHint(msg, width, height));
c.announce(PacketCreator.enableActions());
c.sendPacket(PacketCreator.sendHint(msg, width, height));
c.sendPacket(PacketCreator.enableActions());
}
public void disableMinimap() {
c.announce(PacketCreator.disableMinimap());
c.sendPacket(PacketCreator.disableMinimap());
}
public boolean isAllReactorState(final int reactorId, final int state) {
@@ -904,7 +904,7 @@ public class AbstractPlayerInteraction {
public void useItem(int id) {
MapleItemInformationProvider.getInstance().getItemEffect(id).applyTo(c.getPlayer());
c.announce(PacketCreator.getItemMessage(id));//Useful shet :3
c.sendPacket(PacketCreator.getItemMessage(id));//Useful shet :3
}
public void cancelItem(final int id) {
@@ -924,7 +924,7 @@ public class AbstractPlayerInteraction {
return;
}
} else if (GameConstants.isAranSkills(skillid)) {
c.announce(PacketCreator.showInfo("Effect/BasicEff.img/AranGetSkill"));
c.sendPacket(PacketCreator.showInfo("Effect/BasicEff.img/AranGetSkill"));
}
getPlayer().changeSkillLevel(skill, level, masterLevel, expiration);
@@ -943,7 +943,7 @@ public class AbstractPlayerInteraction {
final Item newItem = MapleItemInformationProvider.getInstance().getEquipById(itemid);
newItem.setPosition(slot);
c.getPlayer().getInventory(MapleInventoryType.EQUIPPED).addItemFromDB(newItem);
c.announce(PacketCreator.modifyInventory(false, Collections.singletonList(new ModifyInventory(0, newItem))));
c.sendPacket(PacketCreator.modifyInventory(false, Collections.singletonList(new ModifyInventory(0, newItem))));
}
public void spawnNpc(int npcId, Point pos, MapleMap map) {
@@ -974,19 +974,19 @@ public class AbstractPlayerInteraction {
}
public void spawnGuide() {
c.announce(PacketCreator.spawnGuide(true));
c.sendPacket(PacketCreator.spawnGuide(true));
}
public void removeGuide() {
c.announce(PacketCreator.spawnGuide(false));
c.sendPacket(PacketCreator.spawnGuide(false));
}
public void displayGuide(int num) {
c.announce(PacketCreator.showInfo("UI/tutorial.img/" + num));
c.sendPacket(PacketCreator.showInfo("UI/tutorial.img/" + num));
}
public void goDojoUp() {
c.announce(PacketCreator.dojoWarpUp());
c.sendPacket(PacketCreator.dojoWarpUp());
}
public void resetDojoEnergy() {
@@ -1000,28 +1000,28 @@ public class AbstractPlayerInteraction {
}
public void enableActions() {
c.announce(PacketCreator.enableActions());
c.sendPacket(PacketCreator.enableActions());
}
public void showEffect(String effect){
c.announce(PacketCreator.showEffect(effect));
c.sendPacket(PacketCreator.showEffect(effect));
}
public void dojoEnergy() {
c.announce(PacketCreator.getEnergy("energy", getPlayer().getDojoEnergy()));
c.sendPacket(PacketCreator.getEnergy("energy", getPlayer().getDojoEnergy()));
}
public void talkGuide(String message) {
c.announce(PacketCreator.talkGuide(message));
c.sendPacket(PacketCreator.talkGuide(message));
}
public void guideHint(int hint) {
c.announce(PacketCreator.guideHint(hint));
c.sendPacket(PacketCreator.guideHint(hint));
}
public void updateAreaInfo(Short area, String info) {
c.getPlayer().updateAreaInfo(area, info);
c.announce(PacketCreator.enableActions());//idk, nexon does the same :P
c.sendPacket(PacketCreator.enableActions());//idk, nexon does the same :P
}
public boolean containsAreaInfo(short area, String info) {
@@ -1029,25 +1029,25 @@ public class AbstractPlayerInteraction {
}
public void earnTitle(String msg) {
c.announce(PacketCreator.earnTitleMessage(msg));
c.sendPacket(PacketCreator.earnTitleMessage(msg));
}
public void showInfoText(String msg) {
c.announce(PacketCreator.showInfoText(msg));
c.sendPacket(PacketCreator.showInfoText(msg));
}
public void openUI(byte ui) {
c.announce(PacketCreator.openUI(ui));
c.sendPacket(PacketCreator.openUI(ui));
}
public void lockUI() {
c.announce(PacketCreator.disableUI(true));
c.announce(PacketCreator.lockUI(true));
c.sendPacket(PacketCreator.disableUI(true));
c.sendPacket(PacketCreator.lockUI(true));
}
public void unlockUI() {
c.announce(PacketCreator.disableUI(false));
c.announce(PacketCreator.lockUI(false));
c.sendPacket(PacketCreator.disableUI(false));
c.sendPacket(PacketCreator.lockUI(false));
}
public void playSound(String sound) {
@@ -1183,7 +1183,7 @@ public class AbstractPlayerInteraction {
}
public void npcTalk(int npcid, String message) {
c.announce(PacketCreator.getNPCTalk(npcid, (byte) 0, message, "00 00", (byte) 0));
c.sendPacket(PacketCreator.getNPCTalk(npcid, (byte) 0, message, "00 00", (byte) 0));
}
public long getCurrentTime() {

View File

@@ -282,7 +282,7 @@ public class EventInstanceManager {
eventTime = time;
for(MapleCharacter chr: getPlayers()) {
chr.announce(PacketCreator.getClock((int) (time / 1000)));
chr.sendPacket(PacketCreator.getClock((int) (time / 1000)));
}
event_schedule = TimerManager.getInstance().schedule(() -> {
@@ -295,7 +295,7 @@ public class EventInstanceManager {
}
}, time);
}
public void addEventTimer(long time) {
if (event_schedule != null) {
if (event_schedule.cancel(false)) {
@@ -316,23 +316,23 @@ public class EventInstanceManager {
startEventTimer(time);
}
}
private void dismissEventTimer() {
for(MapleCharacter chr: getPlayers()) {
chr.getClient().announce(PacketCreator.removeClock());
for (MapleCharacter chr : getPlayers()) {
chr.sendPacket(PacketCreator.removeClock());
}
event_schedule = null;
eventTime = 0;
timeStarted = 0;
}
public void stopEventTimer() {
if(event_schedule != null) {
if (event_schedule != null) {
event_schedule.cancel(false);
event_schedule = null;
}
dismissEventTimer();
}
@@ -1262,7 +1262,7 @@ public class EventInstanceManager {
}
if(gateData != null) {
chr.announce(PacketCreator.environmentChange(gateData.getLeft(), gateData.getRight()));
chr.sendPacket(PacketCreator.environmentChange(gateData.getLeft(), gateData.getRight()));
}
}

View File

@@ -40,26 +40,26 @@ public class MapScriptMethods extends AbstractPlayerInteraction {
switch (c.getPlayer().getMapId()) {
case 913040100:
lockUI();
c.announce(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene0"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene0"));
break;
case 913040101:
c.announce(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene1"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene1"));
break;
case 913040102:
c.announce(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene2"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene2"));
break;
case 913040103:
c.announce(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene3"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene3"));
break;
case 913040104:
c.announce(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene4"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene4"));
break;
case 913040105:
c.announce(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene5"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene5"));
break;
case 913040106:
lockUI();
c.announce(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene6"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction.img/cygnusJobTutorial/Scene6"));
break;
}
}
@@ -68,20 +68,20 @@ public class MapScriptMethods extends AbstractPlayerInteraction {
switch (c.getPlayer().getMapId()) {
case 914090010:
lockUI();
c.announce(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene0"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene0"));
break;
case 914090011:
c.announce(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene1" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene1" + c.getPlayer().getGender()));
break;
case 914090012:
c.announce(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene2" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene2" + c.getPlayer().getGender()));
break;
case 914090013:
c.announce(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene3"));
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/Scene3"));
break;
case 914090100:
lockUI();
c.announce(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/HandedPoleArm" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction1.img/aranTutorial/HandedPoleArm" + c.getPlayer().getGender()));
break;
}
}
@@ -89,30 +89,30 @@ public class MapScriptMethods extends AbstractPlayerInteraction {
public void startExplorerExperience() {
if (c.getPlayer().getMapId() == 1020100) //Swordman
{
c.announce(PacketCreator.showIntro("Effect/Direction3.img/swordman/Scene" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction3.img/swordman/Scene" + c.getPlayer().getGender()));
} else if (c.getPlayer().getMapId() == 1020200) //Magician
{
c.announce(PacketCreator.showIntro("Effect/Direction3.img/magician/Scene" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction3.img/magician/Scene" + c.getPlayer().getGender()));
} else if (c.getPlayer().getMapId() == 1020300) //Archer
{
c.announce(PacketCreator.showIntro("Effect/Direction3.img/archer/Scene" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction3.img/archer/Scene" + c.getPlayer().getGender()));
} else if (c.getPlayer().getMapId() == 1020400) //Rogue
{
c.announce(PacketCreator.showIntro("Effect/Direction3.img/rogue/Scene" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction3.img/rogue/Scene" + c.getPlayer().getGender()));
} else if (c.getPlayer().getMapId() == 1020500) //Pirate
{
c.announce(PacketCreator.showIntro("Effect/Direction3.img/pirate/Scene" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction3.img/pirate/Scene" + c.getPlayer().getGender()));
}
}
public void goAdventure() {
lockUI();
c.announce(PacketCreator.showIntro("Effect/Direction3.img/goAdventure/Scene" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction3.img/goAdventure/Scene" + c.getPlayer().getGender()));
}
public void goLith() {
lockUI();
c.announce(PacketCreator.showIntro("Effect/Direction3.img/goLith/Scene" + c.getPlayer().getGender()));
c.sendPacket(PacketCreator.showIntro("Effect/Direction3.img/goLith/Scene" + c.getPlayer().getGender()));
}
public void explorerQuest(short questid, String questName) {
@@ -134,13 +134,13 @@ public class MapScriptMethods extends AbstractPlayerInteraction {
if (status.equals(infoex)) {
etm.append("Earned the ").append(questName).append(" title!");
smp.append("You have earned the <").append(questName).append(">").append(rewardstring);
getPlayer().announce(PacketCreator.getShowQuestCompletion(quest.getId()));
getPlayer().sendPacket(PacketCreator.getShowQuestCompletion(quest.getId()));
} else {
getPlayer().announce(PacketCreator.earnTitleMessage(status + "/" + infoex + " regions explored."));
getPlayer().sendPacket(PacketCreator.earnTitleMessage(status + "/" + infoex + " regions explored."));
etm.append("Trying for the ").append(questName).append(" title.");
smp.append("You made progress on the ").append(questName).append(" title. ").append(status).append("/").append(infoex);
}
getPlayer().announce(PacketCreator.earnTitleMessage(etm.toString()));
getPlayer().sendPacket(PacketCreator.earnTitleMessage(etm.toString()));
showInfoText(smp.toString());
}
@@ -157,11 +157,11 @@ public class MapScriptMethods extends AbstractPlayerInteraction {
}
String status = Integer.toString(qs.getMedalProgress());
getPlayer().announceUpdateQuest(DelayedQuestUpdate.UPDATE, qs, true);
getPlayer().announce(PacketCreator.earnTitleMessage(status + "/5 Completed"));
getPlayer().announce(PacketCreator.earnTitleMessage("The One Who's Touched the Sky title in progress."));
getPlayer().sendPacket(PacketCreator.earnTitleMessage(status + "/5 Completed"));
getPlayer().sendPacket(PacketCreator.earnTitleMessage("The One Who's Touched the Sky title in progress."));
if (Integer.toString(qs.getMedalProgress()).equals(qs.getInfoEx(0))) {
showInfoText("The One Who's Touched the Sky" + rewardstring);
getPlayer().announce(PacketCreator.getShowQuestCompletion(quest.getId()));
getPlayer().sendPacket(PacketCreator.getShowQuestCompletion(quest.getId()));
} else {
showInfoText("The One Who's Touched the Sky title in progress. " + status + "/5 Completed");
}

View File

@@ -32,6 +32,7 @@ import constants.string.LanguageConstants;
import net.server.Server;
import net.server.channel.Channel;
import net.server.coordinator.matchchecker.MatchCheckerListenerFactory.MatchCheckerType;
import net.server.guild.GuildPackets;
import net.server.guild.MapleAlliance;
import net.server.guild.MapleGuild;
import net.server.world.MapleParty;
@@ -60,7 +61,7 @@ import server.partyquest.Pyramid.PyramidMode;
import tools.FilePrinter;
import tools.LogHelper;
import tools.PacketCreator;
import tools.packets.Wedding;
import tools.packets.WeddingPackets;
import java.awt.*;
import java.sql.SQLException;
@@ -133,23 +134,23 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
public void dispose() {
NPCScriptManager.getInstance().dispose(this);
getClient().announce(PacketCreator.enableActions());
getClient().sendPacket(PacketCreator.enableActions());
}
public void sendNext(String text) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0, text, "00 01", (byte) 0));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0, text, "00 01", (byte) 0));
}
public void sendPrev(String text) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0, text, "01 00", (byte) 0));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0, text, "01 00", (byte) 0));
}
public void sendNextPrev(String text) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0, text, "01 01", (byte) 0));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0, text, "01 01", (byte) 0));
}
public void sendOk(String text) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0, text, "00 00", (byte) 0));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0, text, "00 00", (byte) 0));
}
public void sendDefault() {
@@ -157,48 +158,48 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
}
public void sendYesNo(String text) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 1, text, "", (byte) 0));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 1, text, "", (byte) 0));
}
public void sendAcceptDecline(String text) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0x0C, text, "", (byte) 0));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0x0C, text, "", (byte) 0));
}
public void sendSimple(String text) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 4, text, "", (byte) 0));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 4, text, "", (byte) 0));
}
public void sendNext(String text, byte speaker) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0, text, "00 01", speaker));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0, text, "00 01", speaker));
}
public void sendPrev(String text, byte speaker) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0, text, "01 00", speaker));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0, text, "01 00", speaker));
}
public void sendNextPrev(String text, byte speaker) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0, text, "01 01", speaker));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0, text, "01 01", speaker));
}
public void sendOk(String text, byte speaker) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0, text, "00 00", speaker));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0, text, "00 00", speaker));
}
public void sendYesNo(String text, byte speaker) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 1, text, "", speaker));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 1, text, "", speaker));
}
public void sendAcceptDecline(String text, byte speaker) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 0x0C, text, "", speaker));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 0x0C, text, "", speaker));
}
public void sendSimple(String text, byte speaker) {
getClient().announce(PacketCreator.getNPCTalk(npc, (byte) 4, text, "", speaker));
getClient().sendPacket(PacketCreator.getNPCTalk(npc, (byte) 4, text, "", speaker));
}
public void sendStyle(String text, int[] styles) {
if (styles.length > 0) {
getClient().announce(PacketCreator.getNPCTalkStyle(npc, text, styles));
getClient().sendPacket(PacketCreator.getNPCTalkStyle(npc, text, styles));
} else { // thanks Conrad for noticing empty styles crashing players
sendOk("Sorry, there are no options of cosmetics available for you here at the moment.");
dispose();
@@ -206,11 +207,11 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
}
public void sendGetNumber(String text, int def, int min, int max) {
getClient().announce(PacketCreator.getNPCTalkNum(npc, text, def, min, max));
getClient().sendPacket(PacketCreator.getNPCTalkNum(npc, text, def, min, max));
}
public void sendGetText(String text) {
getClient().announce(PacketCreator.getNPCTalkText(npc, text, ""));
getClient().sendPacket(PacketCreator.getNPCTalkText(npc, text, ""));
}
/*
@@ -223,7 +224,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
* 6 = Kerning Subway
*/
public void sendDimensionalMirror(String text) {
getClient().announce(PacketCreator.getDimensionalMirror(text));
getClient().sendPacket(PacketCreator.getDimensionalMirror(text));
}
public void setGetText(String text) {
@@ -418,10 +419,10 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
MapleAlliance alliance = Server.getInstance().getAlliance(c.getPlayer().getGuild().getAllianceId());
alliance.increaseCapacity(1);
Server.getInstance().allianceMessage(alliance.getId(), PacketCreator.getGuildAlliances(alliance, c.getWorld()), -1, -1);
Server.getInstance().allianceMessage(alliance.getId(), PacketCreator.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1);
Server.getInstance().allianceMessage(alliance.getId(), GuildPackets.getGuildAlliances(alliance, c.getWorld()), -1, -1);
Server.getInstance().allianceMessage(alliance.getId(), GuildPackets.allianceNotice(alliance.getId(), alliance.getNotice()), -1, -1);
c.announce(PacketCreator.updateAllianceInfo(alliance, c.getWorld())); // thanks Vcoc for finding an alliance update to leader issue
c.sendPacket(GuildPackets.updateAllianceInfo(alliance, c.getWorld())); // thanks Vcoc for finding an alliance update to leader issue
}
public void disbandAlliance(MapleClient c, int allianceId) {
@@ -461,7 +462,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
}
public void showFredrick() {
c.announce(PacketCreator.getFredrick(getPlayer()));
c.sendPacket(PacketCreator.getFredrick(getPlayer()));
}
public int partyMembersInMap() {
@@ -677,7 +678,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
if (mc != null) {
mc.setChallenged(false);
mc.changeMap(map, map.getPortal(0));
mc.announce(PacketCreator.serverNotice(6, LanguageConstants.getMessage(mc, LanguageConstants.CPQEntryLobby)));
mc.sendPacket(PacketCreator.serverNotice(6, LanguageConstants.getMessage(mc, LanguageConstants.CPQEntryLobby)));
TimerManager tMan = TimerManager.getInstance();
tMan.schedule(() -> mapClock(3 * 60), 1500);
@@ -926,7 +927,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
if (mc != null) {
mc.setChallenged(false);
mc.changeMap(map, map.getPortal(0));
mc.announce(PacketCreator.serverNotice(6, LanguageConstants.getMessage(mc, LanguageConstants.CPQEntryLobby)));
mc.sendPacket(PacketCreator.serverNotice(6, LanguageConstants.getMessage(mc, LanguageConstants.CPQEntryLobby)));
TimerManager tMan = TimerManager.getInstance();
tMan.schedule(() -> mapClock(3 * 60), 1500);
@@ -1070,17 +1071,17 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
MapleCharacter chr = marriage.getPlayerById(cid);
if (chr != null) {
if (chr.getId() == player.getId()) {
player.announce(Wedding.OnWeddingGiftResult((byte) 0xA, marriage.getWishlistItems(groom), marriage.getGiftItems(player.getClient(), groom)));
player.sendPacket(WeddingPackets.onWeddingGiftResult((byte) 0xA, marriage.getWishlistItems(groom), marriage.getGiftItems(player.getClient(), groom)));
} else {
marriage.setIntProperty("wishlistSelection", groom ? 0 : 1);
player.announce(Wedding.OnWeddingGiftResult((byte) 0x09, marriage.getWishlistItems(groom), marriage.getGiftItems(player.getClient(), groom)));
player.sendPacket(WeddingPackets.onWeddingGiftResult((byte) 0x09, marriage.getWishlistItems(groom), marriage.getGiftItems(player.getClient(), groom)));
}
}
}
}
public void sendMarriageGifts(List<Item> gifts) {
this.getPlayer().announce(Wedding.OnWeddingGiftResult((byte) 0xA, Collections.singletonList(""), gifts));
this.getPlayer().sendPacket(WeddingPackets.onWeddingGiftResult((byte) 0xA, Collections.singletonList(""), gifts));
}
public boolean createMarriageWishlist() {
@@ -1096,7 +1097,7 @@ public class NPCConversationManager extends AbstractPlayerInteraction {
}
if (marriage.getProperty(wlKey).contentEquals("")) {
getClient().announce(Wedding.sendWishList());
getClient().sendPacket(WeddingPackets.sendWishList());
return true;
}
}

View File

@@ -151,7 +151,7 @@ public class NPCScriptManager extends AbstractScriptManager {
}
}
} else {
c.announce(PacketCreator.enableActions());
c.sendPacket(PacketCreator.enableActions());
}
return true;
} catch (final Exception ute) {

View File

@@ -78,6 +78,6 @@ public class PortalPlayerInteraction extends AbstractPlayerInteraction {
}
public void playPortalSound() {
c.announce(PacketCreator.playPortalSound());
c.sendPacket(PacketCreator.playPortalSound());
}
}