Jump to content

[Contest Guide]Starter Guide for L2j


Emrys

Recommended Posts

This guide is 100% made by me... A bug part of this creates before a long time but none see it....

So l2t's start


I.Eclipse

II.Patches, modifications

III.Compiling

IV.Update Revision

V.Preconfigure Packs

VI.Datapack Modifications

VII.Q&A

VII.Packs

VIII.Add Skills

IX.Java basics

X.Becoming familiar with l2j projects

 


Part I: Eclipse

Download Eclipse From here : http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.5-200906111540/eclipse-SDK-3.5-win32.zip

Also Dont forget to Install Java JDK.

 

Select your workspace etc. Now go on Install Updates --> Add---> Name: SubEclipse Site : http://subclipse.tigris.org/update_1.6.x --> Press Next and Select subeclipse-->The Install.Now your eclipse will be restart.


After That We are Ready For starting Developing Our Project :D

From killer_007:

 

Now we have to configure java. Go to window (upper right corner of program's screen) and then preferences. Check that cross on java (in order to expand that box) and then click on Installed JREs. Select jdk and unselect jre (if you have both of them installed). Press ok. (Remember that if it can't find it, you have to add the path manually using the add button... for me the path is: C:\Program Files\Java\jdk1.5.0_04

guide12ik9.jpg

guide13cf6.jpg

1st of all go to Windows-->Show and Vew--> SvN --> SvN Repository

Now use right click on the new tab on the white space, then new and finally Repository location.

For Example : http://www.l2jserver.com/svn/

Then We open the repository and We checkOut The Trunk.

Do the same with l2jdb : http://www.l2jdb.com/svn/

After The DP is Checked-Out, Right click on Our DP, select Properties and then Build Path (only L2j Latest Realease) then click Projects and we add our Gameserver, then go Libraries and add all the files in Gameserver/libs....

With that way we make a syntax highlighting in l2jdb.


Part 2 : Patches,Modifications

If you want to make your own Patches then u must do 2 things :D

1st Learn Java , (best Book out there: http://java.sun.com/docs/books/tutorial/index.html )

2nd Learn most of l2j Classes. (Most difficultpart for me :D )

Note: This isnt 1 day work....

 

Now We find for example this patch :

 Index: C:/workspace/L2J-Archid-Game/config/mods/customs.properties
===================================================================
--- C:/workspace/L2J-Archid-Game/config/mods/customs.properties	(revision 721)
+++ C:/workspace/L2J-Archid-Game/config/mods/customs.properties	(working copy)
@@ -212,6 +212,11 @@
# Syntax: .autoherbs_on .autoherbs_off 
AllowAutoHerbsCommand = false

+# Allow NullKarma Command
+# Usage : .nokarma
+# When a Player has >0 karma , it gets nullified.
+AllowNullKarmaCommand = False
+
# Show the GM's name who made the announcement.
# example: "Announce: hi [GM]"
AnnounceGmName = False
Index: C:/workspace/L2J-Archid-Game/src/main/java/com/l2jarchid/gameserver/handler/MasterHandler.java
===================================================================
--- C:/workspace/L2J-Archid-Game/src/main/java/com/l2jarchid/gameserver/handler/MasterHandler.java	(revision 721)
+++ C:/workspace/L2J-Archid-Game/src/main/java/com/l2jarchid/gameserver/handler/MasterHandler.java	(working copy)
@@ -177,6 +177,7 @@
import com.l2jarchid.gameserver.handler.voicedcommandhandlers.Away;
import com.l2jarchid.gameserver.handler.voicedcommandhandlers.Banking;
import com.l2jarchid.gameserver.handler.voicedcommandhandlers.JoinVIP;
+import com.l2jarchid.gameserver.handler.voicedcommandhandlers.NullKarma;
import com.l2jarchid.gameserver.handler.voicedcommandhandlers.Online;
import com.l2jarchid.gameserver.handler.voicedcommandhandlers.Wedding;
import com.l2jarchid.gameserver.handler.voicedcommandhandlers.stat;
@@ -403,6 +404,10 @@
		if(Config.ALLOW_ONLINE_VCOMMAND)
		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new Online());

+		if(Config.ALLOW_NULLKARMA_COMMAND)
+		{
+		VoicedCommandHandler.getInstance().registerVoicedCommandHandler(new NullKarma());
+		}
	}

	public static void load()
Index: C:/workspace/L2J-Archid-Game/src/main/java/com/l2jarchid/Config.java
===================================================================
--- C:/workspace/L2J-Archid-Game/src/main/java/com/l2jarchid/Config.java	(revision 721)
+++ C:/workspace/L2J-Archid-Game/src/main/java/com/l2jarchid/Config.java	(working copy)
@@ -1567,7 +1567,8 @@
     **************************************************************************/
	public static boolean CURSED_WEAPON_PLAYER_USE_POTS;
	public static boolean NOBLE_STATUS_NEEDED_TO_USE_HERO_ITEM;
-
+	public static boolean ALLOW_NULLKARMA_COMMAND;
+	
	// Four Sepulchers
	public static int FS_TIME_ATTACK;
	public static int FS_TIME_COOLDOWN;
@@ -1679,7 +1680,7 @@
	        ARCHID_AWAY_TIMER = Integer.parseInt(CustomMod.getProperty("AwayTimer", "30"));
	        ARCHID_BACK_TIMER = Integer.parseInt(CustomMod.getProperty("BackTimer", "30"));
	        ARCHID_AWAY_PEACE_ZONE = Boolean.parseBoolean(CustomMod.getProperty("AwayOnlyInPeaceZone", "False"));
-
+	        ALLOW_NULLKARMA_COMMAND = Boolean.parseBoolean(CustomMod.getProperty("AllowNullKarmaCommand", "False"));
	        CHAR_TITLE = Boolean.parseBoolean(CustomMod.getProperty("CharTitle", "false"));
	    	ADD_CHAR_TITLE = CustomMod.getProperty("CharAddTitle", "Welcome");
            NOBLE_CUSTOM_ITEMS = Boolean.parseBoolean(CustomMod.getProperty("EnableNobleCustomItem", "true"));

(by Stefoulis15)

And We dont know how to add it!!!And u ask : What should I do???

Simply Read my Guide :

http://www.maxcheaters.com/forum/index.php?topic=64593.0

 

Simply Now U have Add Your Patch :D

 

Now go to gameserver/config and open each config with eclipse and edit them.....

 


Part 3 : Compiling

The Most Important Part :D

After u Did all the Modifications, u will need to compile your Pack :D

 

If you are using an l2j based pack Like : l2j,l2jdot,l2jarchid(I think),l2jequal,l2emu and l2jofficial

Then Simply go to gamerver/build.xml and right Click-->Run-->Ant Build

And you Simply Build your Own gs pack... u will see that in build folder there are 2 files : l2jserver.java and l2jgameserver.zip , In l2jgamerver.zip there is our pack, the l2jserver.java is our java modifications......

Datapack:Really simple right click on Build.xml->Run as->1 Ant build.

Core:l2jfree use maven so you need to compile it with maven.(Other pack use Build.xml to core too)

Compile l2jfree core:

before you compile you need to do 2 things.

1st open control panel->system->special->variables

You need to add new system variable for java jdk.Add these lines to user and system variables.

Variable name:JAVA_HOME

Varible path:C:\Program Files\Java\jdk1.6.0_11

Now restart your PC.

Open maven\bin\mvn.bat with notepad go to line 157 and write this:

old one:%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR%

new one:%MAVEN_JAVA_EXE% %MAVEN_OPTS% "-Xmx1024m" -classpath %CLASSWORLDS_JAR%

Now compile the core:

open a command line(start->run->cmd)

go to your core folder(for example the core is c:\workspace\l2jfree-core)

type cd C:\

type cd workspace

type cd l2jfree-core

Now you need to compile:

type C:\maven\bin\mvn clean:clean

thats delete the excisting compile(Target folder)if you have.

type C:\maven\bin\mvn assembly:assembly -Dmaven.test.skip=true

thats build your core and place it to l2jfree-core\target folder.

If you are using an l2jfree based pack like : l2jfree  where there is only a pom.xml u will need to use maven ...Thx Intrepid


Part IV : Updating Rev

Everyday all the projects Updates The l2j projects, the updates are in java and properties files....

To Update our Core we simply : Right Click on gameserver --->Team-->Update to Head

Now It will download all the files :D

After that is finished, We simply Build again our project and we replace our old files :D

 

Now to update our DP, we do the same but, If we have sql Updates u will need to update your DB , How?

Look:

1. Make sure you have a working database of your new rev installed on MySQL (preferable a separate PC / laptop)

2. Work all of your new rev files just like being a full new release and you had none before (config, data, new NPC's, etc.)

3. Start login server and game server to make sure it's really working without errors

4. If everything is OK, dump your database to an SQL file

 

...and now for the "complicated" part...

 

5. If you had that on a separate PC, copy new rev on your server machine, along with your dumped SQL file

6. Make a separate DB on your server MySQL connection, like l2clean or whatever Smiley

7. Make sure you have altered server.properties and login.properties to match your internal / external IP

8. Stop your server (nasty !!!)

9. Go on Navicat to Tools -> Structure Syncronization

10. Left side -> (your connection name) -> (your new rev db)

11. Right side -> (your connection name) -> (your GS db)

12. Press "Compare" button

13. After compare has been done -> press "Run query" button

14. After successful completion go to Tools -> Data Syncronization

15. Left side -> (your connection name) -> (your GS db)

16. Right side -> (your connection name) -> (your new rev db)

17. Go "Advanced" and remove the mark from "Delete records"

 

Remark: BE SURE YOU REMOVED THAT MARK BEFORE STARTING !!!

 

18. Press "Preview" button

 

You will get 6 or 7 errors, tables which you should copy to a temporary DB FROM YOUR NEW REV DB and copy back after completion...

 

Normally this tables are:

boxaccess

clan_wars

pledge_skill_trees

posts

skill_spellbooks

topic

zone

 

19. If on "Preview" is everything OK then press "Start" to upgrade

 

BE SURE YOU HAVE COMPLETED POINT 17 BEFORE !!!

 

20. Now just dump SQL file of your old DB and copy your new DB instead

21. start your login server

22. start your game server

23. YOU'RE DONE !!!!!

Thx A-style aka GodOfAden

And Like this we update our DB :D


Part V: Preconfigure Packs

 

Most of the people are start with a Preconfigure Pack, That's very bad, because :

You dont have the source, and u cant do any modifications in Java, that means that: u cant fix L2 phx hacks (client packets) and u cant add any modification, and the most important think for me : U cant update your server.....

 

What I want to say ,  Reconfigure Packs are the worst packs for a l2j server.....

Do U want a server???? Just Compile it!!!


Part VI : DataPack Modifications

 

If you are using l2j, u can see that from gracia , the admin-players commands have been tranfered to Datapack... That's Why We Use Syntax hightlighting, because many java files have transfered to DP.

Except Of Them, DP has all the HTML,Xml,Quest Scripts etc <--- All of that, are use a big ammount of Ram , which may cause sometimes Lag....

When U make a server x100+ with class manager, there are several files that can be deleted...

Let's Go to scripts/Quest , there are more than 800+ quest .... But because We have a "PvP" Server , we dont need them , so we delete them....

Delete all the quest that you dont need.... ( Better all except , Nobless quest)

Also u can also delete some (if not all) multisell files if you want.., also there are some HtmL files that can also removed, check the id : id.html , and  if you dont need them then delete the  htm + for the spawnlist.



Part VII: Q&A :

Q: How Can I run my server??

A: Simply Look this topic: http://www.maxcheaters.com/forum/index.php?topic=50068.0

 

Q: How Can I change the buff time?

A: If you are using an l2j pack hellbound or later, then go to character.properties and find this Line: SkillDurationList =

After that add :

271,4200;272,4200;273,4200;274,4200;275,4200;276,4 200;277,4200;307,4200;309,4200;310,4200;311,4200;3 66,4200;367,4200;530,4200;\

264,4200;265,4200;266,4200;267,4200;268,4200;269,4 200;270,4200;304,4200;305,4200;306,4200;308,4200;3 49,4200;363,4200;364,4200;437,4200;529,4200;\

1002,4200;1003,4200;1005,4200;1006,4200;1007,4200; 1009,4200;1010,4200;1229,4200;1251,4200;1252,4200; 1253,4200;1284,4200;1308,4200;1309,4200;1310,4200; 1362,4200;1363,4200;1390,4200;1391,4200;1413,4200; 1461,4200;\

1353,4200;1311,4200;1307,4200;1204,4200;1085,4200; 1078,4200;1077,4200;1062,4200;1044,4200;1043,4200; 1035,4200;1068,4200;1040,4200;1073,4200;\

1191,4200;1189,4200;1182,4200;1033,4200;1259,4200; \

1032,4200;1036,4200;1045,4200;1048,4200;1086,4200; 1240,4200;1242,4200;1243,4200;1388,4200;1389,4200; 1392,4200;1393,4200;1352,4200;\

1355,4200;1356,4200;1357,4200;\

1087,4200;1257,4200;1397,4200;1304,4200;1303,4200; 1354,4200;\

1059,4200;1268,4200

 

U can change the time by changing to 4200(s) number.

If you are using another pack, then u have to go to Stats/skills find your skill, and change the duration : 3600 for 1 hour etc ...

 

Q:How can I execute an SQL?

A: Simply , go to navicat/localhost/l2jdb right click execute SQL...

 

Q:How can i change a stat of a(n) armor/weapon?

A: Go to Stats/Armors or Weapons/find your weapon ID, find it in a file,And change the Val of stats, Stats are : pDef ,mDef,pAtk,mAtk etc

 

Part VIII: Packs

In this part, I will help you to choose a Pack.

Gracia Final Packs:


l2jserverlogo.png

TimeLine: http://www.l2jserver.com/trac/timeline and http://www.l2jdb.com/trac/timeline

SvN: http://www.l2jserver.com/svn/ && http://www.l2jdb.com/svn/


L2jOfficial:

TimeLine: http://trac.assembla.com/L2jOfficial/timeline

SvN: http://svn.assembla.com/svn/L2jOfficial/



Now For IL:

l2jArchid:

SVN Url: http://svn.assembla.com/svn/L2J-Archid

TimeLine: http://trac.assembla.com/L2J-Archid/timeline

 


IIX. Add Skills

To do the character to auto Learn skills that you created or other classes simply. Ceate an sql like this:

INSERT INTO `skill_trees` VALUES ('0', '3', '1', 'Power Strike', '50', '5');

0 = the class ID

3 = skill ID

1= level

50 = SP needed

and

5 is the level needed to be to learn the skill :D easy


IX.Java Basics

First of all we are going to learn some Operators....

Most common are:

+ plus

- minus

* multiplier

etc...

also:

++ = +1

-- = -1

==  =  equal

!= = not equal

>= greater or equal to

<= less or qua; to

> greater

< less

&& = and

|| = or


About If,else:

For me if is like a check...

some examples...

If:

if (activeChar.isHero()) // check if player is hero
{
activeChar.sendMessage("you are a hero LoL"); //send message
}
else {//if he isnt hero
activeChar.sendMessage("you arent a hero");
} 

About int :

int number = 1 // Now number is the number 1
number = number + 2 //Now number is 3
etc

This is a Variable like X in maths , it can be any number etc ....


Now it java there isnt any space, we use dots (.) as you have noticed... we dont say : activeChar isNewbie , we say activeChar.isNewbie.

Never forget  ( ; ) Greek question-mark.


X.Becoming familiar with l2j projects

In my opinion this is the most difficult part...After all the time you spent on learning java, you have to spent a few more hours to become familiar....

Fist of all , we are going to learn how the configs are used in l2j.... To find that , you should go to net.sf.l2j.Config and start reading the file ....

Then u should see the Handlers which are very important...  which are in DP/scripts/handlers

After that check how DB is stored in datatables , net.sf.l2j.datatables

In The End another branch of files that you can read are : net.sf.l2j.gameserver.model & net.sf.l2j.gameserver.skills

 

That's all!

 

-TheEnd

Link to comment
Share on other sites

Awesome Guide, Good Job TheEnd, now new admin's can easier make server... Thanks For Share.

+1 this guide is awesome for two reason

1st the operating is correctly so  the other can understand all

2nd cuz mxc have 1-2 guides like this (revenger + maestroluke )

Gratz Bro :)

Link to comment
Share on other sites

Fuckingggggggggg Cooooolllllllll!!!!

 

You cant even imagine how many days i was searching and i was waiting for smth like this!!!

 

I suggest sticky!

 

Thnx you so much TheEnd

 

<3 Mate!

Link to comment
Share on other sites

  • 5 weeks later...
  • 4 weeks later...

I did not understand a thing :D

 

As a newbie at these things I may say

if i find this helpful or not for newbies since

I am one...

 

I personally didn't find it helpful... maybe you guys like it...

I don't... Sorry, it's just my personal opinion :P

 

It just... doesn't make any sense :D

Link to comment
Share on other sites

I did not understand a thing :D

 

As a newbie at these things I may say

if i find this helpful or not for newbies since

I am one...

 

I personally didn't find it helpful... maybe you guys like it...

I don't... Sorry, it's just my personal opinion :P

 

It just... doesn't make any sense :D

 

What's the problem?

It is quite analyzed with many images..

I mean.. What don't you understand? xD

Link to comment
Share on other sites

What's the problem?

It is quite analyzed with many images..

I mean.. What don't you understand? xD

 

Are you serious?

 

Ok, I'm going to show this to 5 of my friends that

never tried l2j developing and see if they'll understand this.

Link to comment
Share on other sites

Are you serious?

 

Ok, I'm going to show this to 5 of my friends that

never tried l2j developing and see if they'll understand this.

 

Well, okay it is for more experienced users..

But not with professional java experience, just compile skills =P

 

There are still a few guides to read though, which are dedicated to beginers ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock