Jump to content

Recommended Posts

Posted

first you need some program to work with java.

you need:

 

java jdk: http://java.sun.com/javase/downloads/index.jsp

eclipse: http://www.maxcheaters.com/forum/index.php?topic=22102.0 (Guide how to install it and set it up)

maven: http://maven.apache.org/download.html

 

install them.(for easier use copy maven to c:/maven folder)

 

When you finish open the eclipse and start to work:)

Its really simple server maker teams have their own SVN repository thats the url where you download their DP.

Go to window->show window->others...->SVN->SVN repository now a window appear in eclipse.

right click in the window go to new->repository location

in the popup window you need to enter the svn link.The SVN links are:

 

l2jfree: svn://www.l2jfree.com/repo/l2j-free

L2j: http://www.l2jserver.com/svn/ (core svn) http://www.l2jdp.com/svn/ (DP svn)

L2emu: http://svn.assembla.com/svn/L2Emu/

 

I use l2jfree server pack so the guide based on l2jfree!

Now when you press ok you see the server pack in the SVN window.

The newest pack is in the trunk folder.We want the core and datapack right click on it and checkout.

Now its downloaded you see the downloaded pack in the package explorer window.

 

ABOUT COMPILING

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.

HOW TO MAKE JAVA MODIFICATIONS:

VOICED COMMAND:

You have the voiced commands in the com.l2jfree.gameserver.handler.voicedcommand folder

Voiced commands ingame starts with . for example .info

Insert the Info.java for example to voiced commands folder thats the first step.

After that you need to register it.

Open voicedcommandhandler.java

Search for the private VoiceCommandHandler() section there you can register your command

To register the .info command for example type this under the last registered command.

registerVoicedCommandHandler(new info());

Compile your core and you are done.

ITEM HANDLERS:

You have the item handlers in the com.l2jfree.gameserver.handler.itemhandler folder

The itemhandlers ingame works like for example you click on it and it summon your pet.

Same like the voiced commands just insert the java file into the itemhandler folder.

Registering in itemhandler.java

Go to private ItemHandler() section

and register your command under the last command like

registerItemHandler(new example());

Compile your core and you are done.

 

REGISTER NEW SQL COLUMN IN A TABLE AT JAVA:

open the L2PCinstance.java (com.l2jfree.gameserver.model.actor.instance)

to register it you need 2 easy step.

1st you see SQL string definitions named with the name of sql table.

For example look at // Character Character SQL String Definitions:

Lets an example you have a patch for vitality system but you need to register a new column at character table.

You see update and restore you need to insert your colums name into these two line like this:

trust_level=? WHERE charId=?"; thats the end of the update line if you want to insert a new one(example vitality)write this.

trust_level=?, vitality=? WHERE charId=?";

Now look at the restore line

trust_level FROM characters WHERE charId=?"; thats the end of the line to insert vitality column write this.

trust_level,vitality FROM characters WHERE charId=?";

Now thats ok you need to set a statement.

Search for the private void storeCharBase() section at L2PCinstance

you find statement's here go to statement.setInt(52, getObjectId());

Thats the end of it its gat the characters objectid(at which character the tables effect applyes)

Now insert vitality here.Insert above statement.setInt(52, getObjectId()); this:

statement.setInt(52, getvitality()); and rename the statement.setInt(52, getObjectId()); to statement.setInt(53, getObjectId());

compile your core and your done.

 

HOW TO MAKE CONFIG OPTIONS:

You can make config options for everything what you want i show you a simple.

You want to create config Option for a voiced command.

Go to voicedcommandhandler.java where you register the command.

Use this syntax for registering with config option:

		if (Config.ALLOW_EXAMPLE)
	{
		registerVoicedCommandHandler(new yourcommand());

	}

Thats the first step now open the Config.java (com.l2jfree)

You want to register it for example at other.properties.

Search for other.properties the section is ending with this line:

// *******************************************************************************************

// *******************************************************************************************

Above that search for the latest option press enter at the and of the line now you have a new line

For a false/true config you need to use public static boolean so to register the example use this:

public static boolean ALLOW_EXAMPLE;

Now search for public static void loadOtherConfig() (thats load the configuration of the other.properties)

Search for catch (Exception e) above that you see config options in other syntax.

Search for the latest option and press enter.In the new line register the config like this:

ALLOW_EXAMPLE = Integer.parseBoolean(otherSettings.getProperty("Example.properties", "default value false or true"));

Now thats ok lets write the config.

Open the properties file(Other in my example)

go to the end of it and press enter.

Example = false or true

If you want to write about the config option make it like this

# -----------

# Allow example

# -----------

Example = false or true

 

HOW TO CREATE/APPLY DIFF PATCH:

apply diff patch:

right click on the core->team->apply patch than select your destination.

if you get error for a diff dont apply it open it with notepad and with search function add it to the right place.

make diff patch:

right click on the edited file->team->create patch here you can choose copy to clipboard and then paste or save it to a file.

 

Credits to ALEX2008GR for the eclipse guide!And for me to that guide!

 

[move]When i have time i try to keep it updated whit other java basics :)[/move]

Posted

updated create and apply diff patches.

 

nice Guide..

 

+1 for that...

 

keep sharing ;)

 

Thanks for karma:)

 

Br0 this is awesome ... ;D i love you  :P also i'm w8ting for the photo :)

 

Keep up m8 !!!!

 

Edit:It will be added at my collection  :)

 

As i said on msn my vista has its own life when he dont want photos i dont make photos:D

Posted

lol 1st time from july (when i register)i see this post...

interpid It's very helpfull omG!

I try to do my best:)

Also i have some very good project i'm working on i think if its ready i share it(like automated 1v1 event engine and others)

Posted

I try to do my best:)

Also i have some very good project i'm working on i think if its ready i share it(like automated 1v1 event engine and others)

hmmm...

at school my pc proffesor say me that many codes of java

want open/close what i mean?

e.g. at html u cant make two path about left/right align

you must open

<div align="left">text

and then close

</div>

and the the right align

the java has this?

and if it easy give via pm your msn :P

Posted

In java it's { }

 

public void NameOfMethidHere()
{
      Code goes here
}

and if u make it at code? like

{ code goes here }

any difference?

Posted

No difference, it's about what you like, but it's easier the way I do it, especially if you have more lines within the { }

i know that..

at html all code i make to another line from text...

it's easily to understand when is the error if u have...

anyway thnx!

 

dont tell me nQQb :D

i'm at first steps with java :D

and if u want to know my age?

you laugh :P

i'm 14 years old...

4 feb i'll become 15

 

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • Posts

    • https://file.kiwi/85ded214#HP0EQ54upx_76JaA90zfOQ    
    • No complicated KYC, instant setup after purchase!  Boost your connection speed and secure your privacy today!  Official Website: https://novproxy.com?kwd=tt-max
    • Passa o conhecimento mano, só mercenários no mundo do l2.
    • I participate in "forum deal" in role middleman. I will advertise free your product with discounted from your "street store" on different forums. I know these forum addresses,i can post your advertisement on different forums.   Street store must be licensed(i will check license through website),store must pay taxes(i will check payment taxes through tax service website). Please note:seller(you) will decide "will like" to buyer or "not will like" total discount(total discount is price your product with discounted  plus my percentage above). Seller(you) decides what will be my percentage .   If you need free advertising,please write me in messenger for contact who are you by nationality and in which country you live. If you owner street store or you employee street store i will advertise free your product from your street store on different forums.   Country Location:i accept all countries except Ukraine. I will not conduct deals with buyers and sellers from Ukraine. I do not cooperate with country Ukraine. If you Ukrainian by nationality or live in Ukraine,ignore this topic.   Shoes,clothing,furniture,bags,televisions,music centers,telephones,laptops,tablets,refrigerators,washing machines,microwaves,fans.   Advertising process. Buyer sees product with discounted. To buyer likes price. Buyer pays my percentage on to payment details guarantor on forum,seller decides what will be my percentage. Buyer and seller through me decide what will be deadline in days for forum transaction(i will either receive money in specified deadline or i won't receive money).   Guarantor on forum notifies me that buyer paid money to payment details guarantor. I'm sending in "forum deal" address "street store" which ready to sell product with discount to buyer. Buyer arrives on given address,enters in street store,finds employee(seller) and asks "in stock?" this product with discount. If this product in stock employee(seller) shows buyer this product,which buyer saw on forum with discount. Buyer inspects product and if to buyer like product,buyer pays money seller and receives receipt for purchase. If buyer product doesn't like,buyer product doesn't purchase,according to clause in "forum questionnaire" seller must register on forum and write in "forum deal" that buyer has declined refused to purchase this product. Guarantor will return money to buyer(in full amount). If you in role seller don't want to register on forum,then advertising won't be(from me) on different forums. How it will be possible to prove that exactly this buyer,exactly from forum,on which this buyer saw my advertising topic,successfully purchased product. When buyer pays my percentage to guarantor on payment details guarantor,buyer writes to guarantor in private message "code word". When buyer meets with seller in store,buyer informs seller exactly same "code word". Then seller registers on forum and sends to guarantor in private message this "code word"(seller will have such right according to clause in "forum questionnaire"). Guarantor confirms to seller that "code word" is correct. If buyer purchases product,but buyer messages in "forum deal" that he not buy this product(buyer is lying in "forum deal"),then according to clause in "forum questionnaire" seller is connected to "forum deal"(i'll let you know via messenger when you need to connect to "forum deal"). Seller sends in "forum deal" "code word" and sends in "forum deal" screenshot receipt about successful sale product(seller will have such right according to clause "forum questionnaire"). On based "code word" and screenshot receipt about successful sale product guarantor makes decision:send money to middleman or return money to buyer.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..