Released by Weaxer, and all the content below is written by Sparks. Original release by Akakori, and converted to v.59 by Sparks.
ALL CREDITS TO AKAKORI
I only take credit for Updating it to v.59 to fit my v.59 Pin Script.
EDIT: Turns out not much has changed from v.55 - v.59 As far as Gender Selection goes.
Ok, a lot of people have been asking me where to get the script so here.
Kori let me know if you want me to take it down, or better yet, you release it yourself on the forum.
Open up recvops.properties.
Find:
Add bellow it:
Next open up sendops.properties.
Find:
Add bellow it:
Now open up MapleClient.java.
Find:
And right bellow it add:
Replace it with:
Find:
Add bellow it:
Now open up Notepad and make a whole new file, name it SetGenderHandler.java.
Add the following content in it:
Now open up LoginWorker.java.
Find:
Replace it with this:
Open up PacketProcessor.java.
Find:
Add bellow it:
Find:
Add bellow it:
Open up RecvPacketOpcode.java.
Find:
Add Bellow it:
Now open up SendPacketOpcode.java.
Find:
Add bellow it:
Now open up MaplePacketCreator.java.
Find:
Replace it with:
Find this whole set:
Replace it with this set:
Find this part under all that:
And add this under it:
Now remember, I give and left ALL CREDITS TO AKAKORI! Remember that, I merely take credit for updating this to v.59 IF THAT.
And: Evo-Networks is the place to be! For more things and future releases please check
ALL CREDITS TO AKAKORI
I only take credit for Updating it to v.59 to fit my v.59 Pin Script.
EDIT: Turns out not much has changed from v.55 - v.59 As far as Gender Selection goes.
Ok, a lot of people have been asking me where to get the script so here.
Kori let me know if you want me to take it down, or better yet, you release it yourself on the forum.
Open up recvops.properties.
Find:
PHP:
LOGIN_PASSWORD = RELOG 1
PHP:
SET_GENDER = CHAR_SELECT 1 //V59 = 0x08
Find:
PHP:
RELOG_RESPONSE = CHARLIST 2
PHP:
GENDER_SET = PIN_OPERATION 1 //V59 = 0x04
Find:
PHP:
private byte greason = 1;
PHP:
private int gender = 0;
private int status = 0;
[php]
Find:
[php].prepareStatement("SELECT id,password,salt,tempban,banned,gm,macs,greason FROM accounts WHERE name = ?");
PHP:
.prepareStatement("SELECT id,password,salt,tempban,banned,gm,macs,greason,gender FROM accounts WHERE name = ?");
PHP:
tempban = getTempBanCalendar(rs);
PHP:
gender = rs.getInt("gender");
if (gender != 0 || gender != 1) {
setStatus(1);
}
[php]
Find:
[php]
this.accountName = accountName;
}
[php]
Add bellow it:
[php]
public int status() {
return this.status;
}
public void setStatus(int status) {
this.status = status;
}
public int getGender() {
return this.gender;
}
public void setGender(int gender) {
this.gender = gender;
}
Add the following content in it:
PHP:
/*
This file is part of the OdinMS Maple Story Server
Copyright (C) 2008 Patrick Huy <[email protected]>
Matthias Butz <[email protected]>
Jan Christian Meyer <[email protected]>
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 java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import net.sf.odinms.client.MapleClient;
import net.sf.odinms.net.AbstractMaplePacketHandler;
import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;
import net.sf.odinms.database.DatabaseConnection;
import net.sf.odinms.tools.MaplePacketCreator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
*
* @author akakori
*/
public class SetGenderHandler extends AbstractMaplePacketHandler {
private static final Logger log = LoggerFactory.getLogger(MapleClient.class);
@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
int status = slea.readByte();
int gender = slea.readByte();
if(status == 1) {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps;
try {
ps = con.prepareStatement("update accounts set gender = ? where id = ?");
ps.setInt(1, gender);
ps.setInt(2, c.getAccID());
ps.executeUpdate();
ps.close();
c.getSession().write(MaplePacketCreator.setGender(gender));
//c.getSession().write(MaplePacketCreator.getLoginFailed(8));
} catch (SQLException e) {
log.error("ERROR", e);
}
}
}
}
Find:
PHP:
client.getSession().write(MaplePacketCreator.getAuthSuccessRequestPin(client.getAccountName()));
PHP:
client.getSession().write(MaplePacketCreator.getAuthSuccessRequestPin(client.getAccountName(), client.getAccID(), client.status(), client.getGender()));
Find:
PHP:
import net.sf.odinms.net.channel.handler.BBSOperationHandler;
PHP:
import net.sf.odinms.net.channel.handler.SetGenderHandler;
PHP:
registerHandler(RecvPacketOpcode.SKILL_EFFECT, new SkillEffectHandler());
PHP:
registerHandler(RecvPacketOpcode.SET_GENDER, new SetGenderHandler());
Find:
PHP:
SERVERSTATUS_REQUEST,
PHP:
SET_GENDER, //V59 = 0x08
Find:
PHP:
DELETE_CHAR_RESPONSE, // 0xf
PHP:
GENDER_SET, //V59 = 0x04
Find:
PHP:
public static MaplePacket getAuthSuccessRequestPin(String account) {
PHP:
public static MaplePacket getAuthSuccessRequestPin(String account, int acid, int status, int gender) {
PHP:
mplew.writeShort(SendPacketOpcode.LOGIN_STATUS.getValue());
mplew.write(new byte[] { 0, 0, 0, 0, 0, 0, (byte) 0xFF, 0x6A, 1, 0, 0, 0, 0x4E });
mplew.writeMapleAsciiString(account);
mplew
.write(new byte[] { 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (byte) 0xDC, 0x3D, 0x0B, 0x28, 0x64, (byte) 0xC5, 1, 8, 0, 0, 0 });
PHP:
mplew.writeInt(0);
mplew.writeShort(0);
mplew.writeInt(acid);
switch(status) {
case 1 : mplew.write(0x0a); break; //Gender Select
case 2 : mplew.write(0x0b); break; //Pin Select
default : mplew.write(gender); break;
}
mplew.write(HexTool.getByteArrayFromHexString("0465"));
mplew.writeInt(0);
mplew.writeInt(0);
mplew.write(HexTool.getByteArrayFromHexString("000000A6B89C2B4CC701"));
mplew.writeInt(0);
PHP:
/**
PHP:
* Gets a successful gender set Packet
* @param gender The account gender.
* @return The gender set packet.
*/
public static MaplePacket setGender(int gender) {
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(3);
mplew.writeShort(SendPacketOpcode.GENDER_SET.getValue());
mplew.write(gender);
mplew.write(1);
return mplew.getPacket();
}
/**
And: Evo-Networks is the place to be! For more things and future releases please check
To view the content, you need to sign in or register
.