public static final void login(String username, MapleClient c, String pwd) {
    String login = username;
    int loginok = 0;
    boolean isBanned = c.hasBannedIP() || c.hasBannedMac() || c.hasProxyBan();
    loginok = c.login(login, pwd, isBanned);
    Calendar tempbannedTill = c.getTempBanCalendar();

    if ((loginok == 0) && (isBanned)) {
      loginok = 3;
    }
    if (loginok != 0) {
      if (!loginFailCount(c)) {
        c.clearInformation();
        c.getSession().write(LoginPacket.getLoginFailed(loginok));
      } else {
        c.getSession().close(true);
      }
    } else if (tempbannedTill.getTimeInMillis() != 0L) {
      if (!loginFailCount(c)) {
        c.clearInformation();
        c.getSession()
            .write(
                LoginPacket.getTempBan(
                    PacketHelper.getTime(tempbannedTill.getTimeInMillis()), c.getBanReason()));
      } else {
        c.getSession().close(true);
      }
    } else {
      c.loginAttempt = 0;
      LoginWorker.registerClient(c);
    }
  }
Beispiel #2
0
  public static final void CharlistRequest(final LittleEndianAccessor slea, final MapleClient c) {
    if (!c.isLoggedIn()) {
      c.getSession().close();
      return;
    }
    if (GameConstants.GMS) {
      slea.readByte(); // 2?
    }
    final int server = slea.readByte();
    final int channel = slea.readByte() + 1;
    if (!World.isChannelAvailable(channel) || server != 0) { // TODOO: MULTI WORLDS
      c.getSession().write(LoginPacket.getLoginFailed(10)); // cannot process so many
      return;
    }

    // System.out.println("Client " + c.getSession().getRemoteAddress().toString().split(":")[0] + "
    // is connecting to server " + server + " channel " + channel + "");

    final List<MapleCharacter> chars = c.loadCharacters(server);
    if (chars != null && ChannelServer.getInstance(channel) != null) {
      c.setWorld(server);
      c.setChannel(channel);
      c.getSession().write(LoginPacket.getSecondAuthSuccess(c));
      c.getSession()
          .write(LoginPacket.getCharList(c.getSecondPassword(), chars, c.getCharacterSlots()));
    } else {
      c.getSession().close();
    }
  }
  public static final void CharlistRequest(LittleEndianAccessor slea, MapleClient c) {
    if (!c.isLoggedIn()) {
      c.getSession().close(true);
      return;
    }
    if (GameConstants.GMS) {
      slea.readByte();
    }
    int server = slea.readByte();
    int channel = slea.readByte() + 1;
    if ((!World.isChannelAvailable(channel)) || (server != 0)) {
      c.getSession().write(LoginPacket.getLoginFailed(10));
      return;
    }

    List chars = c.loadCharacters(server);
    if ((chars != null) && (ChannelServer.getInstance(channel) != null)) {
      c.setWorld(server);
      c.setChannel(channel);

      c.getSession()
          .write(LoginPacket.getCharList(c.getSecondPassword(), chars, c.getCharacterSlots()));
    } else {
      c.getSession().close(true);
    }
  }
  public static void CreateChar(LittleEndianAccessor slea, MapleClient c) {
    String name = slea.readMapleAsciiString();
    slea.skip(4);
    final JobType jobType =
        JobType.getByType(
            slea
                .readInt()); // BIGBANG: 0 = Resistance, 1 = Adventurer, 2 = Cygnus, 3 = Aran, 4 =
                             // Evan, 5 = Mercedes
    final short subCategory = slea.readShort(); // whether dual blade = 1 or adventurer = 0
    final byte gender = slea.readByte();
    byte skinColor = slea.readByte(); // 01
    int hairColor = 0;
    slea.skip(1);
    boolean mercedes = (jobType == JobType.Mercedes);
    boolean demon = (jobType == JobType.Demon);
    boolean adventurer = (jobType == JobType.Adventurer);
    int face = slea.readInt();
    int hair = slea.readInt();

    final int demonMark = demon ? slea.readInt() : 0;
    int top = slea.readInt();
    int bottom = (mercedes || demon || adventurer) ? 0 : slea.readInt();
    int shoes = slea.readInt();
    int weapon = slea.readInt();
    int shield = demon ? slea.readInt() : (mercedes ? 1352000 : 0);

    MapleCharacter newchar = MapleCharacter.getDefault(c);
    newchar.setWorld((byte) c.getWorld());
    newchar.setFace(face);
    newchar.setHair(hair + hairColor);
    newchar.setGender(gender);
    newchar.setName(name);
    newchar.setSkinColor(skinColor);
    newchar.setDemonMarking(demonMark);
    newchar.setSubcategory(subCategory);

    MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);
    Item eq_top = MapleItemInformationProvider.getInstance().getEquipById(top);
    eq_top.setPosition((byte) -5);
    equip.addFromDB(eq_top);
    Item eq_bottom = MapleItemInformationProvider.getInstance().getEquipById(bottom);
    eq_bottom.setPosition((byte) -6);
    Item eq_shoes = MapleItemInformationProvider.getInstance().getEquipById(shoes);
    eq_shoes.setPosition((byte) -7);
    equip.addFromDB(eq_shoes);
    Item eq_weapon = MapleItemInformationProvider.getInstance().getEquipById(weapon);
    eq_weapon.setPosition((byte) -11);
    equip.addFromDB(eq_weapon);

    if (MapleCharacterUtil.canCreateChar(name, false)
        && !LoginInformationProvider.getInstance().isForbiddenName(name)) {
      MapleCharacter.saveNewCharToDB(newchar, (short) 0);
      c.getSession().write(LoginPacket.addNewCharEntry(newchar, true));
      c.createdChar(newchar.getId());
    } else {
      c.getSession().write(LoginPacket.addNewCharEntry(newchar, false));
    }
    newchar = null;
  }
 public static final void ServerStatusRequest(MapleClient c) {
   int numPlayer = LoginServer.getUsersOn();
   int userLimit = LoginServer.getUserLimit();
   if (numPlayer >= userLimit) {
     c.getSession().write(LoginPacket.getServerStatus(2));
   } else if (numPlayer * 2 >= userLimit) {
     c.getSession().write(LoginPacket.getServerStatus(1));
   } else {
     c.getSession().write(LoginPacket.getServerStatus(0));
   }
 }
Beispiel #6
0
  public static final void login(final LittleEndianAccessor slea, final MapleClient c) {
    String login = c.isLocalhost() ? "admin" : slea.readMapleAsciiString();
    String pwd = c.isLocalhost() ? "admin" : slea.readMapleAsciiString();

    int loginok = 0;
    final boolean ipBan = c.hasBannedIP();
    final boolean macBan = c.hasBannedMac();

    if (AutoRegister.getAccountExists(login) != false) {
      loginok = c.login(login, pwd, ipBan || macBan);
    } else if (AutoRegister.autoRegister != false && (!c.hasBannedIP() || !c.hasBannedMac())) {
      AutoRegister.createAccount(login, pwd, c.getSession().getRemoteAddress().toString());
      if (AutoRegister.success != false) {
        loginok = c.login(login, pwd, ipBan || macBan);
      }
    }
    final Calendar tempbannedTill = c.getTempBanCalendar();

    if (loginok == 0 && (ipBan || macBan) && !c.isGm()) {
      loginok = 3;
      if (macBan) {
        // this is only an ipban o.O" - maybe we should refactor this a bit so it's more readable
        MapleCharacter.ban(
            c.getSession().getRemoteAddress().toString().split(":")[0],
            "Enforcing account ban, account " + login,
            false,
            4,
            false);
      }
    }
    if (loginok != 0) {
      if (!loginFailCount(c)) {
        c.clearInformation();
        c.getSession().write(LoginPacket.getLoginFailed(loginok));
      } else {
        c.getSession().close();
      }
    } else if (tempbannedTill.getTimeInMillis() != 0) {
      if (!loginFailCount(c)) {
        c.clearInformation();
        c.getSession()
            .write(
                LoginPacket.getTempBan(
                    PacketHelper.getTime(tempbannedTill.getTimeInMillis()), c.getBanReason()));
      } else {
        c.getSession().close();
      }
    } else {
      c.loginAttempt = 0;
      LoginWorker.registerClient(c);
    }
  }
Beispiel #7
0
 public static final void ServerListRequest(final MapleClient c) {
   // c.getSession().write(LoginPacket.getLoginWelcome());
   c.getSession().write(LoginPacket.getServerList(0, LoginServer.getLoad()));
   // c.getSession().write(CField.getServerList(1, "Scania",
   // LoginServer.getInstance().getChannels(), 1200));
   // c.getSession().write(CField.getServerList(2, "Scania",
   // LoginServer.getInstance().getChannels(), 1200));
   // c.getSession().write(CField.getServerList(3, "Scania",
   // LoginServer.getInstance().getChannels(), 1200));
   c.getSession().write(LoginPacket.getEndOfServerList());
   c.getSession().write(LoginPacket.enableRecommended());
   c.getSession().write(LoginPacket.sendRecommended(0, LoginServer.getEventMessage()));
 }
Beispiel #8
0
 public static final void ServerStatusRequest(final MapleClient c) {
   // 0 = Select world normally
   // 1 = "Since there are many users, you may encounter some..."
   // 2 = "The concurrent users in this world have reached the max"
   final int numPlayer = LoginServer.getUsersOn();
   final int userLimit = LoginServer.getUserLimit();
   if (numPlayer >= userLimit) {
     c.getSession().write(LoginPacket.getServerStatus(2));
   } else if (numPlayer * 2 >= userLimit) {
     c.getSession().write(LoginPacket.getServerStatus(1));
   } else {
     c.getSession().write(LoginPacket.getServerStatus(0));
   }
 }
  public static final void DeleteChar(LittleEndianAccessor slea, MapleClient c) {
    String Secondpw_Client = GameConstants.GMS ? slea.readMapleAsciiString() : null;
    if (Secondpw_Client == null) {
      if (slea.readByte() > 0) {
        Secondpw_Client = slea.readMapleAsciiString();
      }
      slea.readMapleAsciiString();
    }

    int Character_ID = slea.readInt();

    if ((!c.login_Auth(Character_ID)) || (!c.isLoggedIn()) || (loginFailCount(c))) {
      c.getSession().close(true);
      return;
    }
    byte state = 0;

    if (c.getSecondPassword() != null) {
      if (Secondpw_Client == null) {
        c.getSession().close(true);
        return;
      }
      if (!c.CheckSecondPassword(Secondpw_Client)) {
        state = 20;
      }
    }

    if (state == 0) {
      state = (byte) c.deleteCharacter(Character_ID);
    }
    c.getSession().write(LoginPacket.deleteCharResponse(Character_ID, state));
  }
Beispiel #10
0
  public static final void DeleteChar(final LittleEndianAccessor slea, final MapleClient c) {
    String Secondpw_Client = GameConstants.GMS ? slea.readMapleAsciiString() : null;
    if (Secondpw_Client == null) {
      if (slea.readByte() > 0) { // Specific if user have second password or not
        Secondpw_Client = slea.readMapleAsciiString();
      }
      slea.readMapleAsciiString();
    }

    final int Character_ID = slea.readInt();

    if (!c.login_Auth(Character_ID) || !c.isLoggedIn() || loginFailCount(c)) {
      c.getSession().close();
      return; // Attempting to delete other character
    }
    byte state = 0;

    if (c.getSecondPassword() != null) { // On the server, there's a second password
      if (Secondpw_Client == null) { // Client's hacking
        c.getSession().close();
        return;
      } else {
        if (!c.CheckSecondPassword(Secondpw_Client)) { // Wrong Password
          state = 20;
        }
      }
    }

    if (state == 0) {
      state = (byte) c.deleteCharacter(Character_ID);
    }
    c.getSession().write(LoginPacket.deleteCharResponse(Character_ID, state));
  }
 public static final void CheckCharName(String name, MapleClient c) {
   c.getSession()
       .write(
           LoginPacket.charNameResponse(
               name,
               (!MapleCharacterUtil.canCreateChar(name, c.isGm()))
                   || ((LoginInformationProvider.getInstance().isForbiddenName(name))
                       && (!c.isGm()))));
 }
Beispiel #12
0
 public static void ViewChar(LittleEndianAccessor slea, MapleClient c) {
   Map<Byte, ArrayList<MapleCharacter>> worlds = new HashMap<Byte, ArrayList<MapleCharacter>>();
   List<MapleCharacter> chars = c.loadCharacters(0); // TODO multi world
   c.getSession().write(LoginPacket.showAllCharacter(chars.size()));
   for (MapleCharacter chr : chars) {
     if (chr != null) {
       ArrayList<MapleCharacter> chrr;
       if (!worlds.containsKey(chr.getWorld())) {
         chrr = new ArrayList<MapleCharacter>();
         worlds.put(chr.getWorld(), chrr);
       } else {
         chrr = worlds.get(chr.getWorld());
       }
       chrr.add(chr);
     }
   }
   for (Entry<Byte, ArrayList<MapleCharacter>> w : worlds.entrySet()) {
     c.getSession()
         .write(LoginPacket.showAllCharacterInfo(w.getKey(), w.getValue(), c.getSecondPassword()));
   }
 }
Beispiel #13
0
  public static final void Character_WithoutSecondPassword(
      final LittleEndianAccessor slea,
      final MapleClient c,
      final boolean haspic,
      final boolean view) {
    slea.readByte(); // 1?
    slea.readByte(); // 1?
    final int charId = slea.readInt();
    if (view) {
      c.setChannel(1);
      c.setWorld(slea.readInt());
    }
    final String currentpw = c.getSecondPassword();
    if (!c.isLoggedIn()
        || loginFailCount(c)
        || (currentpw != null && (!currentpw.equals("") || haspic))
        || !c.login_Auth(charId)
        || ChannelServer.getInstance(c.getChannel()) == null
        || c.getWorld() != 0) { // TODOO: MULTI WORLDS
      c.getSession().close();
      return;
    }
    c.updateMacs(slea.readMapleAsciiString());
    slea.readMapleAsciiString();
    if (slea.available() != 0) {
      final String setpassword = slea.readMapleAsciiString();

      if (setpassword.length() >= 6 && setpassword.length() <= 16) {
        c.setSecondPassword(setpassword);
        c.updateSecondPassword();
      } else {
        c.getSession().write(LoginPacket.secondPwError((byte) 0x14));
        return;
      }
    } else if (GameConstants.GMS && haspic) {
      return;
    }
    if (c.getIdleTask() != null) {
      c.getIdleTask().cancel(true);
    }
    final String s = c.getSessionIPAddress();
    LoginServer.putLoginAuth(
        charId, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP(), c.getChannel());
    c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
    c.getSession()
        .write(
            CField.getServerIP(
                c,
                Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]),
                charId));
  }
 public static final void Character_WithSecondPassword(
     LittleEndianAccessor slea, MapleClient c, boolean view) {
   String password = slea.readMapleAsciiString();
   int charId = slea.readInt();
   if (view) {
     c.setChannel(1);
     c.setWorld(slea.readInt());
   }
   if ((!c.isLoggedIn())
       || (loginFailCount(c))
       || (c.getSecondPassword() == null)
       || (!c.login_Auth(charId))
       || (ChannelServer.getInstance(c.getChannel()) == null)
       || (c.getWorld() != 0)) {
     c.getSession().close(true);
     return;
   }
   if (GameConstants.GMS) {
     c.updateMacs(slea.readMapleAsciiString());
   }
   if ((c.CheckSecondPassword(password))
       && (password.length() >= 6)
       && (password.length() <= 16)) {
     if (c.getIdleTask() != null) {
       c.getIdleTask().cancel(true);
     }
     String s = c.getSessionIPAddress();
     LoginServer.putLoginAuth(charId, s.substring(s.indexOf('/') + 1, s.length()), c.getTempIP());
     c.updateLoginState(MapleClient.LOGIN_SERVER_TRANSITION, s);
     c.getSession()
         .write(
             CField.getServerIP(
                 c,
                 Integer.parseInt(ChannelServer.getInstance(c.getChannel()).getIP().split(":")[1]),
                 charId));
     System.out.println("Sent serverIp");
   } else {
     c.getSession().write(LoginPacket.secondPwError((byte) 0x14));
   }
 }
  public static void ServerListRequest(MapleClient c) {
    c.getSession().write(LoginPacket.getServerList(0, LoginServer.getLoad()));

    c.getSession().write(LoginPacket.getEndOfServerList());
  }
Beispiel #16
0
  public static void CreateChar(final LittleEndianAccessor slea, final MapleClient c) {
    if (!c.isLoggedIn()) {
      c.getSession().close();
      return;
    }
    final String name = slea.readMapleAsciiString();
    final JobType jobType =
        JobType.getByType(
            slea.readInt()); // BIGBANG: 0 = Resistance, 1 = Adventurer, 2 = Cygnus, 3 = Aran, 4 =
    // Evan, 5 = mercedes
    final short db = slea.readShort(); // whether dual blade = 1 or adventurer = 0
    final byte gender = slea.readByte(); // ??idk corresponds with the thing in addCharStats
    byte skinColor = slea.readByte(); // 01
    int hairColor = 0;
    final byte unk2 = slea.readByte(); // 08
    final boolean mercedes = (jobType == JobType.Mercedes);
    final boolean demon = (jobType == JobType.Demon);
    final boolean mihile = (jobType == JobType.Mihile);
    boolean jettPhantom =
        (jobType == LoginInformationProvider.JobType.Jett)
            || (jobType == LoginInformationProvider.JobType.Phantom)
            || (jobType == LoginInformationProvider.JobType.DualBlade);
    final int face = slea.readInt();
    final int hair = slea.readInt();
    if (!mercedes
        && !mihile
        && !demon
        && !jettPhantom) { // mercedes/demon dont need hair color since its already in the hair
      hairColor = slea.readInt();
      skinColor = (byte) slea.readInt();
    }
    final int demonMark = demon ? slea.readInt() : 0;
    final int top = (mihile) ? 0 : slea.readInt();
    final int bottom = (mihile) ? 0 : slea.readInt();
    final int shoes = (mihile) ? 0 : slea.readInt();
    final int weapon =
        jobType == LoginInformationProvider.JobType.Phantom
            ? 1362046
            : mercedes ? 1522038 : (mihile || demon) ? 0 : slea.readInt();
    int shield =
        jobType == LoginInformationProvider.JobType.Phantom
            ? 1352100
            : jobType == LoginInformationProvider.JobType.Mihile
                ? 1098000
                : mercedes ? 1352000 : demon ? slea.readInt() : 0;
    MapleCharacter newchar = MapleCharacter.getDefault(c, jobType);
    newchar.setWorld((byte) c.getWorld());
    newchar.setFace(face);
    newchar.setHair(hair + hairColor);
    newchar.setGender(gender);
    newchar.setName(name);
    newchar.setSkinColor(skinColor);
    newchar.setDemonMarking(demonMark);

    final MapleItemInformationProvider li = MapleItemInformationProvider.getInstance();
    final MapleInventory equip = newchar.getInventory(MapleInventoryType.EQUIPPED);

    Item item = li.getEquipById(top);
    item.setPosition((byte) -5);
    equip.addFromDB(item);

    if (bottom > 0) { // resistance have overall
      item = li.getEquipById(bottom);
      item.setPosition((short) (byte) (jettPhantom ? -9 : -6));
      equip.addFromDB(item);
    }

    item = li.getEquipById(shoes);
    item.setPosition((byte) -7);
    equip.addFromDB(item);

    item = li.getEquipById(weapon);
    item.setPosition((byte) -11);
    equip.addFromDB(item);

    if (shield > 0) {
      item = li.getEquipById(shield);
      item.setPosition((byte) -10);
      equip.addFromDB(item);
    }

    newchar
        .getInventory(MapleInventoryType.USE)
        .addItem(new Item(2000013, (byte) 0, (short) 100, (byte) 0));
    newchar
        .getInventory(MapleInventoryType.USE)
        .addItem(new Item(2000014, (byte) 0, (short) 100, (byte) 0));
    // blue/red pots
    switch (jobType) {
      case Resistance: // Resistance
        newchar
            .getInventory(MapleInventoryType.ETC)
            .addItem(new Item(4161001, (byte) 0, (short) 1, (byte) 0));
        final Map<Skill, SkillEntry> ss = new HashMap<>();
        ss.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss, false);
        break;
      case Adventurer: // Adventurer
        newchar
            .getInventory(MapleInventoryType.ETC)
            .addItem(new Item(4161001, (byte) 0, (short) 1, (byte) 0));
        final Map<Skill, SkillEntry> ss1 = new HashMap<>();
        ss1.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss1, false);
        break;
      case Cygnus: // Cygnus
        newchar
            .getInventory(MapleInventoryType.ETC)
            .addItem(new Item(4161047, (byte) 0, (short) 1, (byte) 0));
        newchar.setQuestAdd(MapleQuest.getInstance(20022), (byte) 1, "1");
        newchar.setQuestAdd(MapleQuest.getInstance(20010), (byte) 1, null); // >_>_>_> ugh
        final Map<Skill, SkillEntry> ss2 = new HashMap<>();
        ss2.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss2, false);
        break;
      case Aran: // Aran
        newchar
            .getInventory(MapleInventoryType.ETC)
            .addItem(new Item(4161048, (byte) 0, (short) 1, (byte) 0));
        final Map<Skill, SkillEntry> ss3 = new HashMap<>();
        ss3.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss3, false);
        break;
      case Evan: // Evan
        newchar
            .getInventory(MapleInventoryType.ETC)
            .addItem(new Item(4161052, (byte) 0, (short) 1, (byte) 0));
        final Map<Skill, SkillEntry> ss4 = new HashMap<>();
        ss4.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss4, false);
        break;
      case Mercedes: // Mercedes
        newchar
            .getInventory(MapleInventoryType.ETC)
            .addItem(new Item(4161079, (byte) 0, (short) 1, (byte) 0));
        final Map<Skill, SkillEntry> ss5 = new HashMap<>();
        ss5.put(SkillFactory.getSkill(20021000), new SkillEntry((byte) 0, (byte) 0, -1));
        ss5.put(SkillFactory.getSkill(20021001), new SkillEntry((byte) 0, (byte) 0, -1));
        ss5.put(SkillFactory.getSkill(20020002), new SkillEntry((byte) 0, (byte) 0, -1));
        ss5.put(SkillFactory.getSkill(20020022), new SkillEntry((byte) 1, (byte) 1, -1));
        ss5.put(SkillFactory.getSkill(20020109), new SkillEntry((byte) 1, (byte) 1, -1));
        ss5.put(SkillFactory.getSkill(20021110), new SkillEntry((byte) 1, (byte) 1, -1));
        ss5.put(SkillFactory.getSkill(20020111), new SkillEntry((byte) 1, (byte) 1, -1));
        ss5.put(SkillFactory.getSkill(20020112), new SkillEntry((byte) 1, (byte) 1, -1));
        ss5.put(SkillFactory.getSkill(20021181), new SkillEntry((byte) -1, (byte) 0, -1));
        ss5.put(SkillFactory.getSkill(20021166), new SkillEntry((byte) -1, (byte) 0, -1));
        ss5.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss5, false);
        break;
      case Demon: // Demon
        newchar
            .getInventory(MapleInventoryType.ETC)
            .addItem(new Item(4161054, (byte) 0, (short) 1, (byte) 0));
        final Map<Skill, SkillEntry> ss6 = new HashMap<>();
        ss6.put(SkillFactory.getSkill(30011000), new SkillEntry((byte) 0, (byte) 0, -1));
        ss6.put(SkillFactory.getSkill(30011001), new SkillEntry((byte) 0, (byte) 0, -1));
        ss6.put(SkillFactory.getSkill(30010002), new SkillEntry((byte) 0, (byte) 0, -1));
        ss6.put(SkillFactory.getSkill(30010185), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30010112), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30010111), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30010110), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30010022), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30011109), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30011170), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30011169), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30011168), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30011167), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(30010166), new SkillEntry((byte) 1, (byte) 1, -1));
        ss6.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss6, false);
        break;

      case Phantom:
        newchar.setLevel((short) 10);
        newchar.setJob(2400);
        newchar.getStat().maxhp += 294; // Beginner 10 levels
        newchar.getStat().maxmp += 113;
        newchar.getStat().hp += 294; // Beginner 10 levels
        newchar.getStat().mp += 113;
        newchar.getStat().str -= 8;
        newchar.getStat().dex -= 1;
        newchar.getStat().luk += 31;
        newchar.setRemainingAp((short) 23);
        newchar.setRemainingSp(5);
        final Map<Skill, SkillEntry> ss7 = new HashMap<>();
        ss7.put(SkillFactory.getSkill(20031203), new SkillEntry((byte) 1, (byte) 1, -1));
        ss7.put(SkillFactory.getSkill(20030204), new SkillEntry((byte) 1, (byte) 1, -1));
        ss7.put(SkillFactory.getSkill(20031205), new SkillEntry((byte) 1, (byte) 1, -1));
        ss7.put(SkillFactory.getSkill(20030206), new SkillEntry((byte) 1, (byte) 1, -1));
        ss7.put(SkillFactory.getSkill(20031207), new SkillEntry((byte) 1, (byte) 1, -1));
        ss7.put(SkillFactory.getSkill(20031208), new SkillEntry((byte) 1, (byte) 1, -1));
        ss7.put(SkillFactory.getSkill(20031209), new SkillEntry((byte) 1, (byte) 1, -1));
        ss7.put(SkillFactory.getSkill(20031210), new SkillEntry((byte) 1, (byte) 1, -1));
        ss7.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss7, false);
        break;

      case Jett:
        newchar.setLevel((short) 10);
        newchar.setJob(508);
        newchar.getStat().maxhp += 294; // Beginner 10
        newchar.getStat().maxmp += 113;
        newchar.getStat().hp += 294; // Beginner 10
        newchar.getStat().mp += 113;
        newchar.getStat().str -= 8;
        newchar.getStat().dex += 15;
        newchar.setRemainingAp((short) 38);
        newchar.setRemainingSp(1);
        final Map<Skill, SkillEntry> ss8 = new HashMap<>();
        ss8.put(SkillFactory.getSkill(228), new SkillEntry((byte) 1, (byte) 1, -1));
        ss8.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        // ss8.put(SkillFactory.getSkill(80001151), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss8, false);
        break;

      case Mihile:
        final Map<Skill, SkillEntry> ss9 = new HashMap<>();
        ss9.put(SkillFactory.getSkill(80001152), new SkillEntry((byte) 1, (byte) 1, -1));
        newchar.changeSkillLevel_Skip(ss9, false);
        break;
    }

    if (MapleCharacterUtil.canCreateChar(name, c.isGm())
        && (!LoginInformationProvider.getInstance().isForbiddenName(name) || c.isGm())
        && (c.isGm() || c.canMakeCharacter(c.getWorld()))) {
      MapleCharacter.saveNewCharToDB(newchar, jobType, db);
      c.getSession().write(LoginPacket.addNewCharEntry(newchar, true));
      c.createdChar(newchar.getId());
    } else {
      c.getSession().write(LoginPacket.addNewCharEntry(newchar, false));
    }
  }