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!

[Add-On] Load hairs and faces id.

Experienced Elementalist
Joined
Oct 15, 2011
Messages
261
Reaction score
140
Week ago, my sister asked me to add all new hairs and faces to npc :rolleyes: I made program and now I want to release it.
PHP:
/*
	This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 ~ 2010 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 tools;

import java.io.FileOutputStream;
import java.io.IOException;
import provider.MapleDataDirectoryEntry;
import provider.MapleDataFileEntry;
import provider.MapleDataProvider;
import provider.MapleDataProviderFactory;
/*
 * Author: Xerdox
*/
public class HairAndEyeCreator {
    public static void main(String args[]) throws IOException {
	MapleDataProvider hairSource = MapleDataProviderFactory.getDataProvider(MapleDataProviderFactory.fileInWZPath("Character.wz/Hair"));
        MapleDataProvider faceSource = MapleDataProviderFactory.getDataProvider(MapleDataProviderFactory.fileInWZPath("Character.wz/Face"));
        final MapleDataDirectoryEntry root = hairSource.getRoot();
        StringBuilder sb = new StringBuilder();
        FileOutputStream out = new FileOutputStream("hairAndFacesID.txt", true);
        System.out.println("Loading Male Hairs!");
        sb.append("hairMale:\r\n");
        for (MapleDataFileEntry topDir : root.getFiles()) {
            int id = Integer.parseInt(topDir.getName().substring(0, 8));
            if ((id / 1000 == 30 || id / 1000 == 33) && id % 10 == 0) {
                sb.append(id).append(", ");
            }
        }
        System.out.println("Loading Female Hairs!");
        sb.append("\r\n\r\n");        
        sb.append("hairFemale:\r\n");
        for (MapleDataFileEntry topDir : root.getFiles()) {
            int id = Integer.parseInt(topDir.getName().substring(0, 8));
            if ((id / 1000 == 31 || id / 1000 == 34) && id % 10 == 0) {
                sb.append(id).append(", ");
            }
        }
        System.out.println("Loading Male Faces!");
        sb.append("\r\n\r\n");       
        sb.append("faceMale:\r\n");
        final MapleDataDirectoryEntry root2 = faceSource.getRoot();
        for (MapleDataFileEntry topDir2 : root2.getFiles()) {
            int id = Integer.parseInt(topDir2.getName().substring(0, 8));
            if ((id / 1000 == 20) && id % 1000 < 100) {
                sb.append(id).append(", ");
            }
        }
        System.out.println("Loading Female Faces!");
        sb.append("\r\n\r\n");   
        sb.append("faceFemale:\r\n");
        for (MapleDataFileEntry topDir2 : root2.getFiles()) {
            int id = Integer.parseInt(topDir2.getName().substring(0, 8));
            if ((id / 1000 == 21) && id % 1000 < 100) {
                sb.append(id).append(", ");
            }
        }
        sb.append("\r\n\r\n");
        sb.append("Author: Xerdox\r\n");
        sb.append("Happy Mapling!");
        out.write(sb.toString().getBytes());
    }
}
And .bat file
PHP:
@echo off
set CLASSPATH=.;dist\*
java -Dwzpath=wz\ tools.HairAndEyeCreator false
pause
Happy Mapling ^^
 
Last edited:
Experienced Elementalist
Joined
Oct 15, 2011
Messages
261
Reaction score
140
Re: Load hairs and faces id.

I forgot to say it works for all version ;)
 
Legendary Battlemage
Loyal Member
Joined
Dec 13, 2010
Messages
649
Reaction score
140
Re: Load hairs and faces id.

I'll look at it more when I'm home, but from what I can see now it looks excessive... for lack of better words. But nevertheless good job.

Edit: Getting a better look at it I retract my former statement, but the exceptions are mostly unnecessary to throw and I question your use of FileOutputStream and of splitting it into 4 files. Otherwise, good job, as I said before.
 
Last edited:
Newbie Spellweaver
Joined
Aug 1, 2008
Messages
51
Reaction score
12
Re: Load hairs and faces id.

amazing ! Thanks for releasing !
 
Experienced Elementalist
Joined
Oct 15, 2011
Messages
261
Reaction score
140
Today I will release new version of it. It will be in one file like
Face male:
Face female:
Hair male:
Hair female:



//Edit

I release now version ;) Just look at first post.
 
Last edited:
Experienced Elementalist
Joined
Mar 21, 2011
Messages
237
Reaction score
118
Re: Load hairs and faces id.

Guys, at least read Java Section Guidelines before posting.

If you have something to contribute or add to the discussion of the release, then by all means post. If you simply want to thank the thread owner for his released code, then click the "Like" button in the bottom right hand of the post and then leave.

@OT
Nice release. I always thought it was a pain getting the ids to add to Kin/NimaKin. Thanks as I was about to just go and get all the ids myself. :8:
 
Newbie Spellweaver
Joined
Apr 30, 2010
Messages
22
Reaction score
0
Noob question: Where would I put that code? Do I put that in the npc? Is there a tutorial on how to do that?
 
Newbie Spellweaver
Joined
Nov 17, 2010
Messages
76
Reaction score
0
Help pl0x.
PHP:
C:\Users\Delta\Desktop\v97\src\server\MapleInventoryManipulator.java:225: cannot find symbol
symbol  : method isPotentialByte()
location: class client.Equip
                hasPotential = eq.isPotentialByte() == (byte)1;
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
C:\Users\Delta\Documents\NetBeansProjects\v97\nbproject\build-impl.xml:598: The following error occurred while executing this line:
C:\Users\Delta\Documents\NetBeansProjects\v97\nbproject\build-impl.xml:243: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 12 seconds)
 
Junior Spellweaver
Joined
Mar 3, 2012
Messages
118
Reaction score
0
I added the .java to tools but when i try to compile it fails.
 
Junior Spellweaver
Joined
Apr 7, 2012
Messages
126
Reaction score
25
Help pl0x.
PHP:
C:\Users\Delta\Desktop\v97\src\server\MapleInventoryManipulator.java:225: cannot find symbol
symbol  : method isPotentialByte()
location: class client.Equip
                hasPotential = eq.isPotentialByte() == (byte)1;
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
C:\Users\Delta\Documents\NetBeansProjects\v97\nbproject\build-impl.xml:598: The following error occurred while executing this line:
C:\Users\Delta\Documents\NetBeansProjects\v97\nbproject\build-impl.xml:243: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 12 seconds)

Post In help section.
Help - Java Based (Odin) - RaGEZONE forums
 
Newbie Spellweaver
Joined
Dec 21, 2011
Messages
40
Reaction score
13
Help pl0x.
PHP:
C:\Users\Delta\Desktop\v97\src\server\MapleInventoryManipulator.java:225: cannot find symbol
symbol  : method isPotentialByte()
location: class client.Equip
                hasPotential = eq.isPotentialByte() == (byte)1;
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
C:\Users\Delta\Documents\NetBeansProjects\v97\nbproject\build-impl.xml:598: The following error occurred while executing this line:
C:\Users\Delta\Documents\NetBeansProjects\v97\nbproject\build-impl.xml:243: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 12 seconds)

Where the hell did you get that error? This error has no part in this release.

To fix that, change isPotential to getPotential.
 
Newbie Spellweaver
Joined
Nov 17, 2010
Messages
76
Reaction score
0
Will the new eyes/hair be in ever shop or just kin and nimakin?
 
Last edited:
Newbie Spellweaver
Joined
Aug 8, 2011
Messages
45
Reaction score
0
I'm getting an error in the .bat file:
"Could not find or load main class tools.HairAndEye
 
Experienced Elementalist
Joined
Oct 15, 2011
Messages
261
Reaction score
140
Did you add .java file to tools folder, build and replace your .jar file?

 
Back
Top