Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

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