EDIT:
FOR YOU ASSES THAT WANT "CREDIT" ITS ALREADY THERE!!
@author Bassoe
READ THE SCRIPT LIKE THE FUCKING DETECTIVE YOU RAGEZONERS ARE.
HEY! DON'T DELETE MY THREAD!
READ THE GUI!
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
THAT BEING SAID...
HERE IT IS!
Lets start
sendops.properties
add
PHP Code:
START_MTS = 0x5D
GET_MTS_TOKENS = 0x113
MTS_OPERATION = 0x114
recvops.properties
add
----------------------------------------------------------------------------
Replace (MaplePacketCreator.java)
PHP Code:
public static MaplePacket enableCSUse0() {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.write(HexTool.getByteArrayFromHexString("12 00 00 00 00 00 00"));
return mplew.getPacket();
}
With
PHP Code:
public static MaplePacket enableCSorMTS() {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.write(HexTool.getByteArrayFromHexString("12 00 00 00 00 00 00"));
return mplew.getPacket();
}
In BuyCSItemHandler.java
replace all
with
In CouponCodeHandler.java
replace all
with
In EnterCashShopHandler.java
replace all
with
Back to MaplePacketCreator.java
add this at the bottom
http://pastebin.com/f3c24fa47
-------------------------------------------------------------
Replace everything in EnterMTSHandler.java with
PHP Code:
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
Matthias Butz <matze@odinms.de>
Jan Christian Meyer <vimes@odinms.de>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License version 3
as published by the Free Software Foundation. You may not use, modify
or distribute this program under any other version of the
GNU Affero General Public License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.odinms.net.channel.handler;
import net.sf.odinms.client.MapleClient;
import net.sf.odinms.net.AbstractMaplePacketHandler;
//import net.sf.odinms.server.maps.FakeCharacter;
import net.sf.odinms.tools.MaplePacketCreator;
import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;
/**
*
* @author Bassoe
*/
public class EnterMTSHandler extends AbstractMaplePacketHandler {
@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
if (c.getPlayer().getNoPets() > 0) {
c.getPlayer().unequipAllPets();
}
if (c.getPlayer().getCSPoints(0) < 0) {
c.getPlayer().gainNX(-(c.getPlayer().getCSPoints(0)));
}
//if (c.getPlayer().hasFakeChar()) {
// for (FakeCharacter ch : c.getPlayer().getFakeChars()) {
// c.getPlayer().getMap().removePlayer(ch.getFakeChar());
// }
// c.getPlayer().deleteFakeChars();
//}
c.getPlayer().cancelAllBuffs();
c.getPlayer().getMap().removePlayer(c.getPlayer());
c.getSession().write(MaplePacketCreator.startMTS(c.getPlayer()));
c.getSession().write(MaplePacketCreator.enableCSorMTS());
c.getSession().write(MaplePacketCreator.enableMTS1());
c.getSession().write(MaplePacketCreator.getMTSItems(c.getPlayer(), 1, 0));
c.getSession().write(MaplePacketCreator.getMTSTransfer(c.getPlayer()));
c.getSession().write(MaplePacketCreator.getMTSNotYet(c.getPlayer()));
c.getSession().write(MaplePacketCreator.getMTSTokens(c.getPlayer()));
}
}
In SendPacketOpcode replace all mts stuff with this
PHP Code:
START_MTS,
MTS_OPERATION,
GET_MTS_TOKENS,
In RecvPacketOpcode add
In PacketProcessor add
PHP Code:
registerHandler(RecvPacketOpcode.MTS_TAB, new MTSHandler());
at net.sf.odinms.net.channel.handler
create a new empty java file called MTSHandler
put this in it
http://pastebin.com/f39ca0864
Then at last execute these SQL's
PHP Code:
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for mtsitems
-- ----------------------------
DROP TABLE IF EXISTS `mtsitems`;
CREATE TABLE `mtsitems` (
`mtsitemid` int(11) unsigned NOT NULL auto_increment,
`itemid` int(11) unsigned NOT NULL,
`type` int(11) unsigned NOT NULL default '0',
`position` int(11) NOT NULL default '0',
`price` int(11) unsigned NOT NULL default '0',
`upgradeslots` int(11) NOT NULL default '0',
`level` int(11) NOT NULL default '0',
`str` int(11) NOT NULL default '0',
`dex` int(11) NOT NULL default '0',
`int` int(11) NOT NULL default '0',
`luk` int(11) NOT NULL default '0',
`hp` int(11) NOT NULL default '0',
`mp` int(11) NOT NULL default '0',
`watk` int(11) NOT NULL default '0',
`matk` int(11) NOT NULL default '0',
`wdef` int(11) NOT NULL default '0',
`mdef` int(11) NOT NULL default '0',
`acc` int(11) NOT NULL default '0',
`avoid` int(11) NOT NULL default '0',
`hands` int(11) NOT NULL default '0',
`speed` int(11) NOT NULL default '0',
`jump` int(11) NOT NULL default '0',
`quantity` int(11) NOT NULL,
`owner` varchar(13) default NULL,
`selleraccountname` varchar(13) NOT NULL,
`sellercharname` varchar(13) NOT NULL,
`transfer` int(11) NOT NULL default '0',
`sellerid` int(11) NOT NULL default '0',
PRIMARY KEY (`mtsitemid`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;
And
PHP Code:
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for cart
-- ----------------------------
DROP TABLE IF EXISTS `cart`;
CREATE TABLE `cart` (
`characterid` int(11) NOT NULL,
`mtsitemid` int(11) NOT NULL,
PRIMARY KEY (`characterid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Please tell me if there are bugs or if i forgot something
Rep would be appreciated? =]
Updates:
Go to MTSHandler.java
change
PHP Code:
slea.readShort();//0
slea.readInt();//unknown - B9 B3 16 01
slea.readInt();//unknown - 00 00 00 7C
to
PHP Code:
slea.readInt();//0
slea.readInt();//unknown - B9 B3 16 01
slea.readInt();//unknown - 00 00 00 7C
[/quote]