new character equip problem?

Results 1 to 19 of 19
  1. #1
    Apprentice xSteven is offline
    MemberRank
    Jul 2011 Join Date
    13Posts

    new character equip problem?

    So i was trying to make the new character have equips i want, so I was foolin around with it and finally got it. So when I make a character, you have the stuff. So now try to get in the game but my screen turns black and DC's me to my desktop. I tried restarting my computer and changing the .java find with the backup, and it still happens. Yet my friends can still get in game...

    whats going on? o-o


  2. #2
    Flow even is offline
    MemberRank
    Nov 2012 Join Date
    BaniLocation
    610Posts

    Re: new character equip problem?

    Account, or character bugged.

  3. #3
    Apprentice xSteven is offline
    MemberRank
    Jul 2011 Join Date
    13Posts

    Re: new character equip problem?

    Quote Originally Posted by even View Post
    Account, or character bugged.
    Just made new account, same thing happened.

  4. #4
    Account Upgraded | Title Enabled! Entourage is offline
    MemberRank
    Jan 2013 Join Date
    Kerning CityLocation
    290Posts

    Re: new character equip problem?

    From the looks of it, you've done something wrong when adding the equips. Did you just change the equipment ID's from the noob clothes to custom clothes?

  5. #5
    Apprentice xSteven is offline
    MemberRank
    Jul 2011 Join Date
    13Posts

    Re: new character equip problem?

    Quote Originally Posted by Entourage View Post
    From the looks of it, you've done something wrong when adding the equips. Did you just change the equipment ID's from the noob clothes to custom clothes?
    noob clothes. I put the ID's in the wrong spot the first time so when I tried to create a character it wouldent let me, so I re-did all of it, and put the ID's in the right spot. Then it worked, so I added like hat and stuff but that failed so I deleted it and went back to the one that worked. So I created my character, it had the equips that I set, then when I typed in PIC, screen turns black immediately and DC's me to my desktop.

    I honestly dunno whats wrong :P

  6. #6
    Account Upgraded | Title Enabled! Entourage is offline
    MemberRank
    Jan 2013 Join Date
    Kerning CityLocation
    290Posts

    Re: new character equip problem?

    I'm not even sure where the fuck up lays. I've done this before in v83 perfectly fine, may be a little different when it comes to higher versions of MapleStory.

  7. #7
    Apprentice xSteven is offline
    MemberRank
    Jul 2011 Join Date
    13Posts

    Re: new character equip problem?

    Quote Originally Posted by Entourage View Post
    I'm not even sure where the fuck up lays. I've done this before in v83 perfectly fine, may be a little different when it comes to higher versions of MapleStory.
    This is v83 o-o

  8. #8
    Flow even is offline
    MemberRank
    Nov 2012 Join Date
    BaniLocation
    610Posts

    Re: new character equip problem?

    can you post the code.

  9. #9
    Apprentice xSteven is offline
    MemberRank
    Jul 2011 Join Date
    13Posts

    Re: new character equip problem?

    Quote Originally Posted by even View Post
    can you post the code.
    I deleted the old one, this is the clean one thats currently being used in my source.

    /*
    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 as
    published by the Free Software Foundation 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.login.handler;

    import client.IItem;
    import client.Item;
    import client.Equip;
    import client.MapleCharacter;
    import client.MapleClient;
    import client.MapleInventory;
    import client.MapleInventoryType;
    import client.MapleSkinColor;
    import client.MapleJob;
    import net.AbstractMaplePacketHandler;
    import server.MapleItemInformationProvider;
    import tools.MaplePacketCreator;
    import tools.data.input.SeekableLittleEndianAccessor;
    import java.util.Arrays;
    import java.util.List;

    public final class CreateCharHandler extends AbstractMaplePacketHandler {

    private final int[] allowedEquips = {1040006, 1040010, 1040002, 1060002, 1060006,
    1072005, 1072001, 1072037, 1072038, 1322005, 1312004, 1042167, 1062115, 1072383,
    1442079, 1302000, 1041002, 1041006, 1041010, 1041011, 1061002, 1061008}; //sauch meinen verdammte schwanz.

    /* public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    String name = slea.readMapleAsciiString();
    if (!MapleCharacter.canCreateChar(name)) {
    return;
    }
    MapleCharacter newchar = MapleCharacter.getDefault(c);
    newchar.setWorld(c.getWorld());
    int face = slea.readInt();
    newchar.setFace(face);
    newchar.setHair(slea.readInt() + slea.readInt());
    newchar.setSkinColor(MapleSkinColor.getById(slea.readInt()));
    int top = slea.readInt();
    int bottom = slea.readInt();
    int shoes = slea.readInt();
    int weapon = slea.readInt();
    newchar.setGender(slea.readByte());
    newchar.setName(name);
    MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);
    IItem eq_top = MapleItemInformationProvider.getInstance().getEquipById(top);
    eq_top.setPosition((byte) -5);
    equip.addFromDB(eq_top);
    IItem eq_bottom = MapleItemInformationProvider.getInstance().getEquipById(bottom);
    eq_bottom.setPosition((byte) -6);
    equip.addFromDB(eq_bottom);
    IItem eq_shoes = MapleItemInformationProvider.getInstance().getEquipById(shoes);
    eq_shoes.setPosition((byte) -7);
    equip.addFromDB(eq_shoes);
    IItem eq_weapon = MapleItemInformationProvider.getInstance().getEquipById(weapon);
    eq_weapon.setPosition((byte) -11);
    equip.addFromDB(eq_weapon);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161001, (byte) 0, (short) 1));
    newchar.saveToDB(false);
    c.getSession().write(MaplePacketCreator.addNewCharEntry(newchar));
    }*/
    // public final class CreateCharHandler extends AbstractMaplePacketHandler {
    public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    String name = slea.readMapleAsciiString();
    if (!MapleCharacter.canCreateChar(name)) {
    return;
    }
    MapleCharacter newchar = MapleCharacter.getDefault(c);
    newchar.setWorld(c.getWorld());
    int job = slea.readInt();
    int face = slea.readInt();
    newchar.setFace(face);
    newchar.setHair(slea.readInt() + slea.readInt());
    newchar.setSkinColor(MapleSkinColor.getById(slea.readInt()));
    int top = slea.readInt();
    int bottom = slea.readInt();
    int shoes = slea.readInt();
    int weapon = slea.readInt();

    if (!((containsInt(allowedEquips, top) && containsInt(allowedEquips, bottom) && containsInt(allowedEquips, shoes) && containsInt(allowedEquips, weapon)))) {
    //well now.
    c.banMacs(); //*shrugs* maybe they'll have logged in before
    c.getSession().close(true);
    return;
    }

    newchar.setGender(slea.readByte());
    newchar.setName(name);
    if (job == 0) { // Knights of Cygnus
    newchar.setJob(MapleJob.NOBLESSE);
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161047, (byte) 0, (short) 1));
    } else if (job == 1) { // Adventurer
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161001, (byte) 0, (short) 1));
    } else if (job == 2) { // Aran
    newchar.setJob(MapleJob.LEGEND);
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161048, (byte) 0, (short) 1));
    } else {
    System.out.println("[CHAR CREATION] A new job ID has been found: " + job);
    }
    MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);
    IItem eq_top = MapleItemInformationProvider.getInstance().getEquipById(top);
    eq_top.setPosition((byte) -5);
    equip.addFromDB(eq_top);
    IItem eq_bottom = MapleItemInformationProvider.getInstance().getEquipById(bottom);
    eq_bottom.setPosition((byte) -6);
    equip.addFromDB(eq_bottom);
    IItem eq_shoes = MapleItemInformationProvider.getInstance().getEquipById(shoes);
    eq_shoes.setPosition((byte) -7);
    equip.addFromDB(eq_shoes);
    Equip eq_weapon = new Equip(weapon, (byte) -11, -1);
    eq_weapon.setWatk((short) 20);
    equip.addFromDB(eq_weapon.copy());
    IItem pHat = MapleItemInformationProvider.getInstance().getEquipById(1002742);
    pHat.setPosition((byte) -101);
    equip.addFromDB(pHat);
    newchar.saveToDB(false);
    c.getSession().write(MaplePacketCreator.addNewCharEntry(newchar));
    }

    private boolean containsInt(int[] array, int toCompare) {//
    for (int i : array) {
    if (i == toCompare) {
    return true;
    }
    }
    return false;
    }
    }

  10. #10
    Apprentice xSteven is offline
    MemberRank
    Jul 2011 Join Date
    13Posts

    Re: new character equip problem?

    Quote Originally Posted by xSteven View Post
    I deleted the old one, this is the clean one thats currently being used in my source.

    /*
    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 as
    published by the Free Software Foundation 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.login.handler;

    import client.IItem;
    import client.Item;
    import client.Equip;
    import client.MapleCharacter;
    import client.MapleClient;
    import client.MapleInventory;
    import client.MapleInventoryType;
    import client.MapleSkinColor;
    import client.MapleJob;
    import net.AbstractMaplePacketHandler;
    import server.MapleItemInformationProvider;
    import tools.MaplePacketCreator;
    import tools.data.input.SeekableLittleEndianAccessor;
    import java.util.Arrays;
    import java.util.List;

    public final class CreateCharHandler extends AbstractMaplePacketHandler {

    private final int[] allowedEquips = {1040006, 1040010, 1040002, 1060002, 1060006,
    1072005, 1072001, 1072037, 1072038, 1322005, 1312004, 1042167, 1062115, 1072383,
    1442079, 1302000, 1041002, 1041006, 1041010, 1041011, 1061002, 1061008}; //sauch meinen verdammte schwanz.

    /* public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    String name = slea.readMapleAsciiString();
    if (!MapleCharacter.canCreateChar(name)) {
    return;
    }
    MapleCharacter newchar = MapleCharacter.getDefault(c);
    newchar.setWorld(c.getWorld());
    int face = slea.readInt();
    newchar.setFace(face);
    newchar.setHair(slea.readInt() + slea.readInt());
    newchar.setSkinColor(MapleSkinColor.getById(slea.readInt()));
    int top = slea.readInt();
    int bottom = slea.readInt();
    int shoes = slea.readInt();
    int weapon = slea.readInt();
    newchar.setGender(slea.readByte());
    newchar.setName(name);
    MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);
    IItem eq_top = MapleItemInformationProvider.getInstance().getEquipById(top);
    eq_top.setPosition((byte) -5);
    equip.addFromDB(eq_top);
    IItem eq_bottom = MapleItemInformationProvider.getInstance().getEquipById(bottom);
    eq_bottom.setPosition((byte) -6);
    equip.addFromDB(eq_bottom);
    IItem eq_shoes = MapleItemInformationProvider.getInstance().getEquipById(shoes);
    eq_shoes.setPosition((byte) -7);
    equip.addFromDB(eq_shoes);
    IItem eq_weapon = MapleItemInformationProvider.getInstance().getEquipById(weapon);
    eq_weapon.setPosition((byte) -11);
    equip.addFromDB(eq_weapon);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161001, (byte) 0, (short) 1));
    newchar.saveToDB(false);
    c.getSession().write(MaplePacketCreator.addNewCharEntry(newchar));
    }*/
    // public final class CreateCharHandler extends AbstractMaplePacketHandler {
    public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    String name = slea.readMapleAsciiString();
    if (!MapleCharacter.canCreateChar(name)) {
    return;
    }
    MapleCharacter newchar = MapleCharacter.getDefault(c);
    newchar.setWorld(c.getWorld());
    int job = slea.readInt();
    int face = slea.readInt();
    newchar.setFace(face);
    newchar.setHair(slea.readInt() + slea.readInt());
    newchar.setSkinColor(MapleSkinColor.getById(slea.readInt()));
    int top = slea.readInt();
    int bottom = slea.readInt();
    int shoes = slea.readInt();
    int weapon = slea.readInt();

    if (!((containsInt(allowedEquips, top) && containsInt(allowedEquips, bottom) && containsInt(allowedEquips, shoes) && containsInt(allowedEquips, weapon)))) {
    //well now.
    c.banMacs(); //*shrugs* maybe they'll have logged in before
    c.getSession().close(true);
    return;
    }

    newchar.setGender(slea.readByte());
    newchar.setName(name);
    if (job == 0) { // Knights of Cygnus
    newchar.setJob(MapleJob.NOBLESSE);
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161047, (byte) 0, (short) 1));
    } else if (job == 1) { // Adventurer
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161001, (byte) 0, (short) 1));
    } else if (job == 2) { // Aran
    newchar.setJob(MapleJob.LEGEND);
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161048, (byte) 0, (short) 1));
    } else {
    System.out.println("[CHAR CREATION] A new job ID has been found: " + job);
    }
    MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);
    IItem eq_top = MapleItemInformationProvider.getInstance().getEquipById(top);
    eq_top.setPosition((byte) -5);
    equip.addFromDB(eq_top);
    IItem eq_bottom = MapleItemInformationProvider.getInstance().getEquipById(bottom);
    eq_bottom.setPosition((byte) -6);
    equip.addFromDB(eq_bottom);
    IItem eq_shoes = MapleItemInformationProvider.getInstance().getEquipById(shoes);
    eq_shoes.setPosition((byte) -7);
    equip.addFromDB(eq_shoes);
    Equip eq_weapon = new Equip(weapon, (byte) -11, -1);
    eq_weapon.setWatk((short) 20);
    equip.addFromDB(eq_weapon.copy());
    IItem pHat = MapleItemInformationProvider.getInstance().getEquipById(1002742);
    pHat.setPosition((byte) -101);
    equip.addFromDB(pHat);
    newchar.saveToDB(false);
    c.getSession().write(MaplePacketCreator.addNewCharEntry(newchar));
    }

    private boolean containsInt(int[] array, int toCompare) {//
    for (int i : array) {
    if (i == toCompare) {
    return true;
    }
    }
    return false;
    }
    }
    bumppp

  11. #11
    Flow even is offline
    MemberRank
    Nov 2012 Join Date
    BaniLocation
    610Posts

    Re: new character equip problem?

    Learn how to use bb tags.

  12. #12
    Proficient Member FreddanQ is offline
    MemberRank
    Oct 2010 Join Date
    SwedenLocation
    180Posts

    Re: new character equip problem?

    Spoiler please.

  13. #13
    Apprentice xSteven is offline
    MemberRank
    Jul 2011 Join Date
    13Posts

    Re: new character equip problem?

    Quote Originally Posted by FreddanQ View Post
    Spoiler please.
    Spoiler:
    /*
    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 as
    published by the Free Software Foundation 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.login.handler;

    import client.IItem;
    import client.Item;
    import client.Equip;
    import client.MapleCharacter;
    import client.MapleClient;
    import client.MapleInventory;
    import client.MapleInventoryType;
    import client.MapleSkinColor;
    import client.MapleJob;
    import net.AbstractMaplePacketHandler;
    import server.MapleItemInformationProvider;
    import tools.MaplePacketCreator;
    import tools.data.input.SeekableLittleEndianAccessor;
    import java.util.Arrays;
    import java.util.List;

    public final class CreateCharHandler extends AbstractMaplePacketHandler {

    private final int[] allowedEquips = {1040006, 1040010, 1040002, 1060002, 1060006,
    1072005, 1072001, 1072037, 1072038, 1322005, 1312004, 1042167, 1062115, 1072383,
    1442079, 1302000, 1041002, 1041006, 1041010, 1041011, 1061002, 1061008}; //sauch meinen verdammte schwanz.

    /* public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    String name = slea.readMapleAsciiString();
    if (!MapleCharacter.canCreateChar(name)) {
    return;
    }
    MapleCharacter newchar = MapleCharacter.getDefault(c);
    newchar.setWorld(c.getWorld());
    int face = slea.readInt();
    newchar.setFace(face);
    newchar.setHair(slea.readInt() + slea.readInt());
    newchar.setSkinColor(MapleSkinColor.getById(slea.readInt()));
    int top = slea.readInt();
    int bottom = slea.readInt();
    int shoes = slea.readInt();
    int weapon = slea.readInt();
    newchar.setGender(slea.readByte());
    newchar.setName(name);
    MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);
    IItem eq_top = MapleItemInformationProvider.getInstance().getEquipById(top);
    eq_top.setPosition((byte) -5);
    equip.addFromDB(eq_top);
    IItem eq_bottom = MapleItemInformationProvider.getInstance().getEquipById(bottom);
    eq_bottom.setPosition((byte) -6);
    equip.addFromDB(eq_bottom);
    IItem eq_shoes = MapleItemInformationProvider.getInstance().getEquipById(shoes);
    eq_shoes.setPosition((byte) -7);
    equip.addFromDB(eq_shoes);
    IItem eq_weapon = MapleItemInformationProvider.getInstance().getEquipById(weapon);
    eq_weapon.setPosition((byte) -11);
    equip.addFromDB(eq_weapon);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161001, (byte) 0, (short) 1));
    newchar.saveToDB(false);
    c.getSession().write(MaplePacketCreator.addNewCharEntry(newchar));
    }*/
    // public final class CreateCharHandler extends AbstractMaplePacketHandler {
    public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    String name = slea.readMapleAsciiString();
    if (!MapleCharacter.canCreateChar(name)) {
    return;
    }
    MapleCharacter newchar = MapleCharacter.getDefault(c);
    newchar.setWorld(c.getWorld());
    int job = slea.readInt();
    int face = slea.readInt();
    newchar.setFace(face);
    newchar.setHair(slea.readInt() + slea.readInt());
    newchar.setSkinColor(MapleSkinColor.getById(slea.readInt()));
    int top = slea.readInt();
    int bottom = slea.readInt();
    int shoes = slea.readInt();
    int weapon = slea.readInt();

    if (!((containsInt(allowedEquips, top) && containsInt(allowedEquips, bottom) && containsInt(allowedEquips, shoes) && containsInt(allowedEquips, weapon)))) {
    //well now.
    c.banMacs(); //*shrugs* maybe they'll have logged in before
    c.getSession().close(true);
    return;
    }

    newchar.setGender(slea.readByte());
    newchar.setName(name);
    if (job == 0) { // Knights of Cygnus
    newchar.setJob(MapleJob.NOBLESSE);
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161047, (byte) 0, (short) 1));
    } else if (job == 1) { // Adventurer
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161001, (byte) 0, (short) 1));
    } else if (job == 2) { // Aran
    newchar.setJob(MapleJob.LEGEND);
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161048, (byte) 0, (short) 1));
    } else {
    System.out.println("[CHAR CREATION] A new job ID has been found: " + job);
    }
    MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);
    IItem eq_top = MapleItemInformationProvider.getInstance().getEquipById(top);
    eq_top.setPosition((byte) -5);
    equip.addFromDB(eq_top);
    IItem eq_bottom = MapleItemInformationProvider.getInstance().getEquipById(bottom);
    eq_bottom.setPosition((byte) -6);
    equip.addFromDB(eq_bottom);
    IItem eq_shoes = MapleItemInformationProvider.getInstance().getEquipById(shoes);
    eq_shoes.setPosition((byte) -7);
    equip.addFromDB(eq_shoes);
    Equip eq_weapon = new Equip(weapon, (byte) -11, -1);
    eq_weapon.setWatk((short) 20);
    equip.addFromDB(eq_weapon.copy());
    IItem pHat = MapleItemInformationProvider.getInstance().getEquipById(1002742);
    pHat.setPosition((byte) -101);
    equip.addFromDB(pHat);
    newchar.saveToDB(false);
    c.getSession().write(MaplePacketCreator.addNewCharEntry(newchar));
    }

    private boolean containsInt(int[] array, int toCompare) {//
    for (int i : array) {
    if (i == toCompare) {
    return true;
    }
    }
    return false;
    }
    }


    there ya goo

  14. #14
    Account Upgraded | Title Enabled! Entourage is offline
    MemberRank
    Jan 2013 Join Date
    Kerning CityLocation
    290Posts

    Re: new character equip problem?

    Quote Originally Posted by xSteven View Post
    Spoiler:
    /*
    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 as
    published by the Free Software Foundation 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.login.handler;

    import client.IItem;
    import client.Item;
    import client.Equip;
    import client.MapleCharacter;
    import client.MapleClient;
    import client.MapleInventory;
    import client.MapleInventoryType;
    import client.MapleSkinColor;
    import client.MapleJob;
    import net.AbstractMaplePacketHandler;
    import server.MapleItemInformationProvider;
    import tools.MaplePacketCreator;
    import tools.data.input.SeekableLittleEndianAccessor;
    import java.util.Arrays;
    import java.util.List;

    public final class CreateCharHandler extends AbstractMaplePacketHandler {

    private final int[] allowedEquips = {1040006, 1040010, 1040002, 1060002, 1060006,
    1072005, 1072001, 1072037, 1072038, 1322005, 1312004, 1042167, 1062115, 1072383,
    1442079, 1302000, 1041002, 1041006, 1041010, 1041011, 1061002, 1061008}; //sauch meinen verdammte schwanz.

    /* public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    String name = slea.readMapleAsciiString();
    if (!MapleCharacter.canCreateChar(name)) {
    return;
    }
    MapleCharacter newchar = MapleCharacter.getDefault(c);
    newchar.setWorld(c.getWorld());
    int face = slea.readInt();
    newchar.setFace(face);
    newchar.setHair(slea.readInt() + slea.readInt());
    newchar.setSkinColor(MapleSkinColor.getById(slea.readInt()));
    int top = slea.readInt();
    int bottom = slea.readInt();
    int shoes = slea.readInt();
    int weapon = slea.readInt();
    newchar.setGender(slea.readByte());
    newchar.setName(name);
    MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);
    IItem eq_top = MapleItemInformationProvider.getInstance().getEquipById(top);
    eq_top.setPosition((byte) -5);
    equip.addFromDB(eq_top);
    IItem eq_bottom = MapleItemInformationProvider.getInstance().getEquipById(bottom);
    eq_bottom.setPosition((byte) -6);
    equip.addFromDB(eq_bottom);
    IItem eq_shoes = MapleItemInformationProvider.getInstance().getEquipById(shoes);
    eq_shoes.setPosition((byte) -7);
    equip.addFromDB(eq_shoes);
    IItem eq_weapon = MapleItemInformationProvider.getInstance().getEquipById(weapon);
    eq_weapon.setPosition((byte) -11);
    equip.addFromDB(eq_weapon);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161001, (byte) 0, (short) 1));
    newchar.saveToDB(false);
    c.getSession().write(MaplePacketCreator.addNewCharEntry(newchar));
    }*/
    // public final class CreateCharHandler extends AbstractMaplePacketHandler {
    public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    String name = slea.readMapleAsciiString();
    if (!MapleCharacter.canCreateChar(name)) {
    return;
    }
    MapleCharacter newchar = MapleCharacter.getDefault(c);
    newchar.setWorld(c.getWorld());
    int job = slea.readInt();
    int face = slea.readInt();
    newchar.setFace(face);
    newchar.setHair(slea.readInt() + slea.readInt());
    newchar.setSkinColor(MapleSkinColor.getById(slea.readInt()));
    int top = slea.readInt();
    int bottom = slea.readInt();
    int shoes = slea.readInt();
    int weapon = slea.readInt();

    if (!((containsInt(allowedEquips, top) && containsInt(allowedEquips, bottom) && containsInt(allowedEquips, shoes) && containsInt(allowedEquips, weapon)))) {
    //well now.
    c.banMacs(); //*shrugs* maybe they'll have logged in before
    c.getSession().close(true);
    return;
    }

    newchar.setGender(slea.readByte());
    newchar.setName(name);
    if (job == 0) { // Knights of Cygnus
    newchar.setJob(MapleJob.NOBLESSE);
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161047, (byte) 0, (short) 1));
    } else if (job == 1) { // Adventurer
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161001, (byte) 0, (short) 1));
    } else if (job == 2) { // Aran
    newchar.setJob(MapleJob.LEGEND);
    newchar.setMap(20001);
    newchar.getInventory(MapleInventoryType.ETC).addItem(new Item(4161048, (byte) 0, (short) 1));
    } else {
    System.out.println("[CHAR CREATION] A new job ID has been found: " + job);
    }
    MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);
    IItem eq_top = MapleItemInformationProvider.getInstance().getEquipById(top);
    eq_top.setPosition((byte) -5);
    equip.addFromDB(eq_top);
    IItem eq_bottom = MapleItemInformationProvider.getInstance().getEquipById(bottom);
    eq_bottom.setPosition((byte) -6);
    equip.addFromDB(eq_bottom);
    IItem eq_shoes = MapleItemInformationProvider.getInstance().getEquipById(shoes);
    eq_shoes.setPosition((byte) -7);
    equip.addFromDB(eq_shoes);
    Equip eq_weapon = new Equip(weapon, (byte) -11, -1);
    eq_weapon.setWatk((short) 20);
    equip.addFromDB(eq_weapon.copy());
    IItem pHat = MapleItemInformationProvider.getInstance().getEquipById(1002742);
    pHat.setPosition((byte) -101);
    equip.addFromDB(pHat);
    newchar.saveToDB(false);
    c.getSession().write(MaplePacketCreator.addNewCharEntry(newchar));
    }

    private boolean containsInt(int[] array, int toCompare) {//
    for (int i : array) {
    if (i == toCompare) {
    return true;
    }
    }
    return false;
    }
    }


    there ya goo
    Rather than posting another post which is pretty much the same thing as before, just with a spoiler, why didn't you just edit your previous post?

  15. #15
    Apprentice xSteven is offline
    MemberRank
    Jul 2011 Join Date
    13Posts

    Re: new character equip problem?

    Quote Originally Posted by Entourage View Post
    Rather than posting another post which is pretty much the same thing as before, just with a spoiler, why didn't you just edit your previous post?
    I dont think lol, just forget it now I got it. Thanks tho (:

  16. #16
    Enthusiast Splend is offline
    MemberRank
    Jan 2013 Join Date
    Great BritishLocation
    48Posts

    Re: new character equip problem?

    pHat.setPosition((byte) -101);

    Does position 101 even exist??

  17. #17
    Account Upgraded | Title Enabled! AristoCat is offline
    MemberRank
    Apr 2012 Join Date
    947Posts

    Re: new character equip problem?

    Quote Originally Posted by Splend View Post

    Does position 101 even exist??
    If position doesn't exists on most of source item is just being deleted.

  18. #18
    Enthusiast Splend is offline
    MemberRank
    Jan 2013 Join Date
    Great BritishLocation
    48Posts

    Re: new character equip problem?

    Quote Originally Posted by AristoCat View Post
    If position doesn't exists on most of source item is just being deleted.
    Yeah, you wish.

    We might let java code the server automatically as well.

  19. #19
    Flow even is offline
    MemberRank
    Nov 2012 Join Date
    BaniLocation
    610Posts

    Re: new character equip problem?

    @splend: Next time, so we don't have to scroll everywhere mind using the code bb-tags? (code)(/code) change the () to [].



Advertisement