A library of Node.js modules that help bring MapleStory private server development to the npm ecosystem.
npm i --save @perion/perion
- Note this project is in early development, use with caution
- calc
A calculator library that implements standard MapleStory specific calculations such as damage, stat modifiers, experience, and levels.
constcalc=require('@perion/calc');/** Example player stats object */constplayerStats={base: {str: 4, ...},hyper: {str: 1, ...}};/** crypto.calc example */constmodifiedStats=calc.HyperStats(playerStats).applyAll().get();/** Returns {str: 34, ...} */- crypto
A cryptography library that exposes everything you need to encrypt/decrypt data for MapleStory.
constcrypto=require('@perion/crypto');/** Example data */constpayload=Buffer.from([0x1]);constsendIv=Buffer.from([0x0,0x2,0x3,0x4]);constrecvIv=Buffer.from([0x4,0x2,0x1,0x0]);/** crypto.Shanda example */constencrypted=crypto.Shanda.encrypt(payload);constdecrypted=crypto.Shanda.decrypt(payload);/** Returns the input buffer with the payload encrypted/decrypted using Maple Custom Shanda *//** crypto.AES example *//** * You must initialize the AES class with: * - an IV (Initialization Vector) * - a MapleStory version number * * The IV must have a length of 4 * As the server, you must send the IV for both send and recv to the client */constsendAES=newcrypto.AES(sendIv,83);constrecvAES=newcrypto.AES(recvIv,83);constencryptedOut=sendAES.transform(payload);constdecryptedIn=recvAES.transform(payload);/** Returns the input buffer with the payload encrypted/decryped using Maple AES */- net
A packet parser using method-chaining syntax for compact and efficient parsing/writing of packet structures.
constnet=require('@perion/net');/** Example buffer */constdata=Buffer.from([1,2]);/** net.Packet.Parser example */constpacket=newnet.Packet.Parser(data);constfields=['id','name','hp'];constunpacked=packet.int().mapleascii().int().collect(fields);/** Returns {id: <number>, name: <string>, hp: <number>} *//** net.Packet.Writer example *//** Initialize with length */letpacket=newnet.Packet.Writer(5);packet=packet.byte(0x0).int(9).buffer();/** Returns the buffer with data */- script
A generic scripting engine for NPCs, events, maps, etc.
- wz
A WZ library that can read and write to the WZ file format.
- Uses Google's recommended JS style guidelines, fully documented code including full JSDoc comments
- Modular packages, so use what you want
- Full test coverage, with a minimum coverage threshold of 90%
- Zero dependencies
- Networking protocol
- Damage calculations
- Event timers
- WZ and NX file format
- Generic MapleStory abstractions
- Multiple MapleStory versions
npm run lint
npm run test
npm run lcov
Click here for the code documentation!
For now, there are no contribution guidelines. I only ask that you follow the eslint rules when contributing a pull request. Thanks!