• 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.

Chair fix for XeonMs V97

Junior Spellweaver
Joined
Feb 11, 2010
Messages
197
Reaction score
5
I'm not sure if everyone has this, but I did.
When I changed a channel and sit, it stuck me like I was in a HUGE ENDLESS lag even tho there was no lag..
So if you got this and wanna fix it:

I'm not a coder, I took this for another thread of a fishing system and it fixed my chair issue so if you have anything bad to say about the coding.. im not your guy.

Credit to iAkira for this!


useChairHandler:

PHP:
package net.channel.handler;

import client.MapleClient;
import client.MapleInventoryType;
import net.AbstractMaplePacketHandler;
import tools.MaplePacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
import server.TimerManager;
import java.util.concurrent.ScheduledFuture;

public final class UseChairHandler extends AbstractMaplePacketHandler {
    public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
        int itemId = slea.readInt();
        if (c.getPlayer().getInventory(MapleInventoryType.SETUP).findById(itemId) == null) {
            return;
        }
       if(c.getPlayer().getMapId() == 251000100 && itemId == 3011000 && !c.getPlayer().isFishing){
        c.getPlayer().isFishing = true;
        }
        c.getPlayer().setChair(itemId);
        c.getPlayer().getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.showChair(c.getPlayer().getId(), itemId), false);
        c.getSession().write(MaplePacketCreator.enableActions());
    }
}

CancelChairHandler:

PHP:
package net.channel.handler;

import client.MapleClient;
import net.AbstractMaplePacketHandler;
import tools.MaplePacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;

public final class CancelChairHandler extends AbstractMaplePacketHandler {
    public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
        int id = slea.readShort();
        if (id == -1) { // Cancel Chair
            c.getPlayer().setChair(0);
           c.getPlayer().isFishing = false;
            c.getSession().write(MaplePacketCreator.cancelChair(-1));
            c.getPlayer().getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.showChair(c.getPlayer().getId(), 0), false);
        } else { // Use In-Map Chair
            c.getPlayer().setChair(id);
            c.getSession().write(MaplePacketCreator.cancelChair(id));
        }
    }
}

From useChairHandler remove this if you don't have fishing:

PHP:
if(c.getPlayer().getMapId() == 251000100 && itemId == 3011000 && !c.getPlayer().isFishing){
        c.getPlayer().isFishing = true;
        }

For cancelChairHandler:

PHP:
c.getPlayer().isFishing = false;
 
Last edited:
Newbie Spellweaver
Joined
May 4, 2012
Messages
37
Reaction score
2
Thank you, had that problem :)
For me it didn't if I tried to go to ch2 for example and sit it wouldnt let me stand back up and talk and stuff.
 
Back
Top