• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

v117 Fredrick GMS-Like fix

Joined
Oct 22, 2011
Messages
658
Reaction score
338
Ok, so here's the release RageZone people. hmm?

edit the file called: HiredMerchantHandler.java search for displayMerch and replace with this:
then COMPILE make a store, close it and you'll see.
claps claps claps enjoy

Code:
public static void displayMerch(MapleClient c) {
        final int conv = c.getPlayer().getConversation();
        boolean merch = World.hasMerchant(c.getPlayer().getAccountID(), c.getPlayer().getId());
        if (merch) {
            c.getPlayer().dropMessage(1, "Please close the existing store and try again.");
            c.getPlayer().setConversation(0);
        } else if (c.getChannelServer().isShutdown()) {
            c.getPlayer().dropMessage(1, "The world is going to shut down.");
            c.getPlayer().setConversation(0);
        } else if (conv == 3) { // Hired Merch
            final MerchItemPackage pack = loadItemFrom_Database(c.getPlayer().getAccountID());

            if (pack == null) {
                c.getSession().write(NPCPacket.getNPCTalk(9030000, (byte) 0, "I don't think you have any items or money to retrieve here.\r\nThis is where you retrieve the items and mesos that you couldn't get from your Hired Merchant. You'll also need to see me as the character that opened the Personal Store.", "00 00", (byte) 0));
                c.getPlayer().setConversation(0);
            } else if (pack.getItems().size() <= 0) { //error fix for complainers.
                if (!check(c.getPlayer(), pack)) {
                    c.getSession().write(PlayerShopPacket.merchItem_Message((byte) 0x21));
                    return;
                }
                if (deletePackage(c.getPlayer().getAccountID(), pack.getPackageid(), c.getPlayer().getId())) {
                    //c.getPlayer().fakeRelog();
                    c.getPlayer().gainMeso(pack.getMesos(), false);
                    c.getSession().write(PlayerShopPacket.merchItem_Message((byte) 0x1d));
                    c.getSession().write(NPCPacket.getNPCTalk(9030000, (byte) 0, "I see that you forgot something here right?\r\nHere is your money sir " + pack.getMesos(), "00 00", (byte) 0));
                    c.getPlayer().setConversation(0);
                } else {
                    c.getPlayer().dropMessage(1, "An unknown error occured.");
                }
                c.getPlayer().setConversation(0);
            } else {
               c.getSession().write(PlayerShopPacket.merchItemStore_ItemData(pack));
                MapleInventoryManipulator.checkSpace(c, conv, conv, null);
                for (final Item item : pack.getItems()) {
                    if(c.getPlayer().getInventory(GameConstants.getInventoryType(item.getItemId())).isFull()){
                        c.getSession().write(NPCPacket.getNPCTalk(9030000, (byte) 0, "Sir, if you want your items back please clean up your inventory before you come here!", "00 00", (byte) 0));
                        c.getPlayer().setConversation(0);
                        break;
                    }
                    MapleInventoryManipulator.addFromDrop(c, item, true);
                    deletePackage(c.getPlayer().getAccountID(), pack.getPackageid(), c.getPlayer().getId());
                    c.getSession().write(NPCPacket.getNPCTalk(9030000, (byte) 0, "I saved your items sir, next time don't forget them, have a nice day.", "00 00", (byte) 0));
                    c.getPlayer().setConversation(0);
                }
                
            }
        }
        c.getSession().write(CWvsContext.enableActions());
    }
 
Newbie Spellweaver
Joined
Aug 31, 2012
Messages
17
Reaction score
1
Ok, so here's the release RageZone people. hmm?

edit the file called: HiredMerchantHandler.java search for displayMerch and replace with this:
then COMPILE make a store, close it and you'll see.
claps claps claps enjoy

Code:
public static void displayMerch(MapleClient c) {
        final int conv = c.getPlayer().getConversation();
        boolean merch = World.hasMerchant(c.getPlayer().getAccountID(), c.getPlayer().getId());
        if (merch) {
            c.getPlayer().dropMessage(1, "Please close the existing store and try again.");
            c.getPlayer().setConversation(0);
        } else if (c.getChannelServer().isShutdown()) {
            c.getPlayer().dropMessage(1, "The world is going to shut down.");
            c.getPlayer().setConversation(0);
        } else if (conv == 3) { // Hired Merch
            final MerchItemPackage pack = loadItemFrom_Database(c.getPlayer().getAccountID());

            if (pack == null) {
                c.getSession().write(NPCPacket.getNPCTalk(9030000, (byte) 0, "I don't think you have any items or money to retrieve here.\r\nThis is where you retrieve the items and mesos that you couldn't get from your Hired Merchant. You'll also need to see me as the character that opened the Personal Store.", "00 00", (byte) 0));
                c.getPlayer().setConversation(0);
            } else if (pack.getItems().size() <= 0) { //error fix for complainers.
                if (!check(c.getPlayer(), pack)) {
                    c.getSession().write(PlayerShopPacket.merchItem_Message((byte) 0x21));
                    return;
                }
                if (deletePackage(c.getPlayer().getAccountID(), pack.getPackageid(), c.getPlayer().getId())) {
                    //c.getPlayer().fakeRelog();
                    c.getPlayer().gainMeso(pack.getMesos(), false);
                    c.getSession().write(PlayerShopPacket.merchItem_Message((byte) 0x1d));
                    c.getSession().write(NPCPacket.getNPCTalk(9030000, (byte) 0, "I see that you forgot something here right?\r\nHere is your money sir " + pack.getMesos(), "00 00", (byte) 0));
                    c.getPlayer().setConversation(0);
                } else {
                    c.getPlayer().dropMessage(1, "An unknown error occured.");
                }
                c.getPlayer().setConversation(0);
            } else {
               c.getSession().write(PlayerShopPacket.merchItemStore_ItemData(pack));
                MapleInventoryManipulator.checkSpace(c, conv, conv, null);
                for (final Item item : pack.getItems()) {
                    if(c.getPlayer().getInventory(GameConstants.getInventoryType(item.getItemId())).isFull()){
                        c.getSession().write(NPCPacket.getNPCTalk(9030000, (byte) 0, "Sir, if you want your items back please clean up your inventory before you come here!", "00 00", (byte) 0));
                        c.getPlayer().setConversation(0);
                        break;
                    }
                    MapleInventoryManipulator.addFromDrop(c, item, true);
                    deletePackage(c.getPlayer().getAccountID(), pack.getPackageid(), c.getPlayer().getId());
                    c.getSession().write(NPCPacket.getNPCTalk(9030000, (byte) 0, "I saved your items sir, next time don't forget them, have a nice day.", "00 00", (byte) 0));
                    c.getPlayer().setConversation(0);
                }
                
            }
        }
        c.getSession().write(CWvsContext.enableActions());
    }

THANK YOU :scared:
 
Skilled Illusionist
Joined
Jul 3, 2011
Messages
372
Reaction score
18
Wow Mr.Paul

thank for the release


but the NPCPacket should change to be CField?
 
may web.very maple.pls.
Loyal Member
Joined
Aug 12, 2009
Messages
1,810
Reaction score
606
shouldn't this be like an npc or somn o_O??
 
Skilled Illusionist
Joined
Jul 3, 2011
Messages
372
Reaction score
18
lol got the red line at NPCPacket there...

should change to CField?
 
Custom Title Activated
Loyal Member
Joined
Jun 30, 2008
Messages
3,451
Reaction score
1,616
One thing to be added to make it GMS-like. If you let you items in there for some time, you will have to pay him money. ohlol
 
Skilled Illusionist
Joined
Jul 3, 2011
Messages
372
Reaction score
18
oh man Aristo Cat, your explain make me learn alot!!

i finaly know how to import :D , now i the NPCPacket red line error is gone :drool:
 
Newbie Spellweaver
Joined
Feb 9, 2009
Messages
76
Reaction score
11
Um.. I have 1 problem. Some people doesn't get their mesos from fredrick when their store is closed. and they're losing like 200m+.
 
Initiate Mage
Joined
Sep 30, 2012
Messages
1
Reaction score
0
Um.. I have 1 problem. Some people doesn't get their mesos from fredrick when their store is closed. and they're losing like 200m+.

I Have the same problem. Can anyone help?
 
Back
Top