Thursday, May 15, 2014

Guide for Making your own Ragnarok Server (Client side)

Before we start,you need to download these things first:

1) kRO clients - [ DOWNLOAD LINK ]
2) Loki Launcher - [ DOWNLOAD LINK ]
3) xDiffPatcher v2 - [ DOWNLOAD LINK ]
4) Grf Builder - [ DOWNLOAD LINK ]
5) Ro Open Setup - [ DOWNLOAD LINK ]
6) TortoiseSVN - [ DOWNLOAD LINK ]

Download all files and install it/extract it.

Okay,Lets Start! Follow these steps:

1. Open your kro client and update it to the latest version.

2. Download Ragexe File from [ HERE ] Which i used is 2013-08-07aRagexe
3. Download xDiff File from [ HERE ] Note: Must Same Version With Your Ragexe File. (Which i used is 2013-08-07aRagexe so i should download 2013-08-07aRagexe.xDiff)

4. Open xDiffPatcher.exe input your Ragexe File and xDiff File then click the Load button.
    After it Load Complete,Look at the below section and Tick these option:

- Disable  Ragexe Filename Check
- Disable HShield
- Disable Packet Encryption
- Enable Multiple GRFs
-@ Bug Fix
- Ignore Missing File Error
- Ignore Missing Palette Error
- Increase Headgear ViewID to 5000
- Increase Zoom
- Load ItemInfo.lua before lub
- Read Data Folder First
- Read msgstringtable.txt
- Read questid2display.txt
- Translate Client In English
- Use Normal Guild Brackets
- Use Ragnarok Icon
- eXtract MsgStringTable.txt
- eXtract txt file strings

Click the 'Diff'n'Save!' button when you've done.
Close the xDiffPatcher and move the RagexePatched.exe into your kRO folder.

5. Open Loki Launcher Folder and edit the loki.ini, Edit it like this:

; Must be on same dir of Loki

Exe = "2013-07-03aRagexe_patched.exe"
(I change into 2013-07-03aRagexe_patched.exe because I patched my
2013-07-03aRagexe.exe. if you use another ragexe please changed into yours)

Save it when you've done.
Move the launcher and loki.ini into your kRO folder.

6. Create a new Folder named it ''Data Translation Folder'' then right click on the folder and click 'SVN Checkout...' Fill in this url [https://subversion.assembla.com/svn/client-side-translation/] into the 'Url of Reposity' and click ok.
It will start to download and wait it until complete then click ok.

7. After it download complete,open the folder and go to ''Data'' folder then right click the ''clientinfo.xml'' and click edit. (Note: If you can't find it,just create it with your Notepad and save it as ''clientinfo.xml''.)

Find this line:

<version>38</version>
Change it to your version (Which i used is 45 for 2013-08-07 client)

You can find your version in folder Server\trunk\db\packet_db.txt (rAthena File)
Note: You can skip step 7 if you haven't setup for the rathena server but you must remember to change it after you've setup the rathena server. For server side please refer to Here.

8. Open your grfbuilder click ''new'' to create grf, named it ''rathena'' and save it, then choose ''merge dir'' find your data translation folder you download before. And then choose the folder ''data'' inside data translation folder then click Ok. Wait until it complete. Click close and move the rathena.grf to kRO client folder.

9. Now change all lua extension to lub extension in your data translation folder. Place this script into your data translation folder ''data/luafiles514'' and run it.
Download the Script from here: [ DOWNLOAD LINK ]
Rename the ''luatolub.bat.txt'' into ''luatolub.bat'' then run it. It will change all the lua files to lub automatically.

10. Edit your DATA.ini in your kRO client folder like this:

      [Data]
      0=rathena.grf
      1=data.grf
      2=rdata.grf

Then save it. (Note: If you can't find it,just make one with your notepad.)

11. Move the ''opensetup.exe'' that you've downloaded just now into your kRO Folder.

Now your client is ready. :D


































Guide for making your own Ragnarok Server (Setup for rAthena Server)

Before we start,
you need to download these things:
1) TortoiseSVN - [ DOWNLOAD LINK ]
2) Visual C++ Express - [ DOWNLOAD LINK ]
3) MySQL - [ DOWNLOAD LINK ]
4) MySQL Workbench 5.2.47 - [ DOWNLOAD LINK ]
After you've downloaded finish,follow these steps:
Install TortoiseSVN
Install Visual C++ Express
Install MySQL - Remember your root password.(Recommend you to use default password "root")
Install MySQL Workbench 5.2.47

Okay,here we start!

rAthena Settings

1) Create a new folder for rAthena files.

2) Right Click on the folder and click "SVN Checkout...".

3) Fill in this url [http://svn.rathena.org/svn/rathena/trunk/] into the "URL of Repository"
   and click ok, it will start to download all files from the url. Wait until it complete then click ok.

4) Open the folder "\trunk\conf" then rename 'import-tmp' folder into 'import'

5) Open (char_athena.conf,map_athena.conf) file in your "\trunk\conf" and edit this:

Char_athena.conf

/ Server Communication username and password.
userid: s1 (change ‘s1’ to whatever you want but here I use ‘username’ as userid for tutorial only)
passwd: p1 (change ‘p1’ to whatever you want but here I  used ‘password’ as password)

//login_ip: 127.0.0.1 (REMOVE THE ‘//’ IN FRONT OF login_ip: 127.0.0.1 so it will look like this login_ip: 127.0.0.1)

//char_ip: 127.0.0.1 (REMOVE THE ‘//’ IN FRONT OF char_ip: 127.0.0.1 so it will look like this char_ip: 127.0.0.1)

Map_athena.conf

// Interserver communication passwords, set in account.txt (or equiv.)
userid: s1 (Change ‘s1’ into ‘username’ because  as I explain on up there before)
passwd: p1 (Change ‘p1’ into ‘password’ because as I explain on up there before)

// Character Server IP
// The map server connects to the character server using this IP address.
// NOTE: This is useful when you are running behind a firewall or are on
// a machine with multiple interfaces.
//char_ip: 127.0.0.1 (Remove the ‘//’)

// Map Server IP
// The IP address which clients will use to connect.
// Set this to what your server's public IP address is.
//map_ip: 127.0.0.1 (Remove the ‘//’)

Save it when you've done.

6) Open "subnet_athena.conf" and edit this:

subnet: 255.0.0.0:127.0.0.1:127.0.0.1 (change your subnet mask)

Here is the way to find your subnet address:
Start>All Programs>Accessories>Command Prompt
Open Command Prompt type ipconfig then press enter.
You will find your subnet mask.

Save it when you've done.

7) Open "inter_athena.conf" and edit these things:

sql.db_username: ragnarok (change ‘ragnarok’ into your MySQL username which is I use default ‘root’)
sql.db_password: ragnarok (change ‘ragnarok’ into your MySQL password which is I use default ‘root’)
sql.db_database: ragnarok

char_server_id: ragnarok (change ‘ragnarok’ into ‘root’)
char_server_pw: ragnarok (change ‘ragnarok’ into ‘root’)
char_server_db: ragnarok

map_server_id: ragnarok (change ‘ragnarok’ into ‘root’)
map_server_pw: ragnarok (change ‘ragnarok’ into ‘root’)
map_server_db: ragnarok

log_db_id: ragnarok (change ‘ragnarok’ into ‘root’)
log_db_pw: ragnarok (change ‘ragnarok’ into ‘root’)
log_db_db: ragnarok (THIS ONE YOU CHANGE INTO ‘logs’ because later we make database ‘logs’

Save it when you've done.

8) Open folder ''trunk\src\common'' find mmo.h then right click it and click edit.
Find this line:

#define PACKETEVER YYYYMMDD

Change it to your client version
Example:

#define PACKETEVER 20130807

9) Go to ''trunk\db'' and open ''packet_db.txt'' with notepad.
Find this line:

packet_db_ver: 45

Change the 'packet_db_ver' to your packet version.
You can find your packet version below there.
(Tips: Press Ctrl + F then input your Ragexe version EX: 2013-08-07Ragexe)
Note: If you can't find your packet version below there, you can download it from HERE and paste it at bottom.(Remember to change the 'packet_db_ver')

Save it when you've done.

MySQL Settings

  1. Open your MySQL Workbench that you've downloaded and double click on 'Local Instance MySQL' then enter your password. (which i used is ''root'')
  2. We need to install a new "Schema", this is like a folder where all the database tables are stored. Click the yellow cylinder looking thing in the upper left to create a new Schema. Name it "ragnarok" - NOTE! Lower case is important here, make sure it is exactly "ragnarok". The server collation should be "Server Default".
  3. Click "Apply" to create the Schema. A window will pop up with the actual commands that are going to take place; click "Apply" again to finalize your order.
  4. Now right click 'ragnarok' under "Object Browser" and click "Set as default schema", a line will appear through it telling the browser that any commands you make now will be ordered to that Schema.
  5. Next, click the button directly to the left of the one you just did,it says "SQL" with a tiny folder. Navigate to your rAthena/sql-files/ folder, and open the sql script file "main.sql".
  6. You'll see a bunch of code appear, these are commands that will tell the browser to create plain databases for your rAthena server. Click the yellow lightning bolt in the upper left hand corner to execute it and allow it to finish (ensure you click the first lightning bolt, the one without a cursor symbol or a magnifying glass over it).
  7. After it finishes, a bunch of executed commands will appear on the bottom of the screen. You can now expand the ragnarok schema to see a bunch of tables. (Image)
  8. Now, do the same thing for a schema called "logs", but open and execute logs.sql. Ensure the tables are there as well.
  9. Close the existing query tabs by hitting the "X" in the upper right of the tab. With the ragnarok tables still open, scroll down to the "login" table and RIGHT click it, then select "Edit Table Data".
  10. Here you'll see existing account information that players can log in with to make characters. If you remember, the first account is the server communication account and it has the default password that you were asked to reset earlier. For our example we chose "username" and "password". Enter these in the "username" and "password" field. And then create your first GM account by clicking where the word "null" is on the row with a ' * ' and enter "2000000" for the "account_id" field, with a username and password that you like. For this guide we chose a username of "AthenaGM" and a password of "12345" and a sex of "M". To enable full administrator GM, just set the "group_id" to "99". Zero out everything else. When you are finished it should look like THIS.
  11. Hit the "Apply" button in the corner and then again when the code prompt appears. This should modify your tables. After it is done, you may close the SQL Editor by clicking the "X" on the tab at upper left corner. Hitting the "X" in the upper right closes the whole workbench. If you accidentally close it, just open it again.

Compiling Your Server

  • Open rAthena-10.sln in your rAthena folder. (Open with Microsoft Visual C++ Express 2010)
  • Select the desired compile configuration (marked red). Use Release when you compile the server, where players will be playing on.Debug compiles the server without optimizations and with debugging information.
  • Right-click the solution node (marked blue) and select Build solution. If you have compiled the server before, it is recommended to use Rebuild solution, as it forces the compiling of all components, not just those, which seem to have changed since last compile.
  • If the compilation was successful, the resulting executables are in the same folder as the solution named login-server_sql.exe, char-server_sql.exe, map-server_sql.exe and mapcache.exe.



Congratulations! You are ready to run your server now. :D

For full information please refer to HERE.