Jump to content

Question

Recommended Posts

  • 0
Posted
Use character_variables Sql table:

INSERT INTO character_variables VALUES (playerObjectId, "CustomTitle", titleValue);

  • 0
Posted

I ment, that's the table where Title Colors can be stored.

 

You can do it in this way:

1. While color is changed, run method(done by you) storeTitleColor(player, newTitle); - player variable should be instance of L2PcInstance class(or however you have it called), newTitle should be String containing new Title(for example "FFFFFF")

2. Create private static void method named storeTitleColor and taking 2 arguments(L2PcInstance and String)

3. Create new Database Connection in the method(look for examples of similar usage in your pack, you can search by key words: "INSERT INTO")

4. Create query, that will insert into character_variables. Also think about the case when title is already stored, then you can delete current record(slower way) or add awesome word to query ON DUPLICATE KEY(look in google to know more, also to use it, you should set charId column and var column as Primary Keys.

5. To complete the query, just add statement.executeUpdate(); like in examples you have found.

 

HF

  • 0
Posted (edited)

Connection con = L2DatabaseFactory.getConnection();

Statement st = con.createStatement();

st.executeUpdate("UPDATE characters SET title_color = x WHERE charId = x");

 

the x are the getters u have to make from the l2PcInstance

 

code handwritten, maybe there are typos

Edited by xdem
  • 0
Guest Elfocrash
Posted

Connection con = L2DatabaseFactory.getConnection();

Statement st = con.createStatement();

st.executeUpdate("UPDATE characters SET title_color = x WHERE charId = x");

 

the x are the getters u have to make from the l2PcInstance

 

code handwritten, maybe there are typos

you obviously need preparedstatement for something like that

  • 0
Posted (edited)

you obviously need preparedstatement for something like that

 

works with statement too, but for this prepared is faster so yes

 

PreparedStatement extends Statement

Edited by xdem
  • 0
Guest Elfocrash
Posted

works with statement too, but for this prepared is faster so yes

 

PreparedStatement extends Statement

Statement cannot support the ?

  • 0
Posted (edited)

Statement cannot support the ?

 

where is the ?

 

both x u have the values from L2PcInstance, st.executeUpdate("UPDATE characters SET title_color = "+player.getAppearance().getTitlteColor()+" WHERE charId = "+player.getObjectId());

 

i was just bored to write the getters into the String

Edited by xdem
  • 0
Guest Elfocrash
Posted

where is the ?

 

both x u have the values from L2PcInstance, st.executeUpdate("UPDATE characters SET title_color = "+player.getAppearance().getTitlteColor()+" WHERE charId = "+player.getObjectId());

 

i was just bored to write the getters into the String

oh i though that you meant that you gonna have ? indicators and 

statement.setString(1, shit);

under the preparedstatement

 

Yeah it can be done as you wrote too, however it is way too unefficient

  • 0
Posted
 

Connection con = L2DatabaseFactory.getConnection();

Statement st = con.createStatement();

st.executeUpdate("UPDATE characters SET title_color = x WHERE charId = x");

 

the x are the getters u have to make from the l2PcInstance

 

code handwritten, maybe there are typos

you obviously need different query for something like that

  • 0
Posted

it works like a charm dude

1. It will change something, only if its previously inserted to character_variables table

2. "title_color" column name is wrong("val" is correct)

3. It will update all values of the character in that table, not only those regarding title.

  • 0
Posted

1. It will change something, only if its previously inserted to character_variables table

2. "title_color" column name is wrong("val" is correct)

3. It will update all values of the character in that table, not only those regarding title.

 

1. no

2. no

3. Nope

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

    • I just found it funny that you reversed the reverse engineer champions. They won't like this for sure.    Anyway, the project vision is very good it is aligned with what the players need and want something that both e-global and l2reborn has failed to provide. These are stable projects, they are not good "games". And players play "games" they don't play "projects".  When no good "games" exist, they flock towards good "projects". Lineage 2 private scene has produced decent projects the last years, but no decent "game". I hope you are the first ones to do so.   Generally there are two axis that Lineage 2 needs to evolve on. Modern gaming concepts and the need to respect the aging player's time. So far, most projects treat these aspects as taboo, they seem so afraid to deviate from what they call "true" Lineage 2. But the reality is that times change, you can't stay static forever, you have to evolve. NCSoft failed,they are not paving the way no more. It is us now, the collective community that have to pave our own pathways. WoW has went the same way, private projects took initiative because the company (while not failed) could not steer the game towards what players want and need in 2026.    For that reason I believe your project is going towards the right direction. The four keystones listed in the vision is what I believe is the community really needs but clearly doesn't understand it wants, because noone so far has give them a glimspe of what is beyond their retail-like garden.    I personally don't respect projects like reborn and e-global. As "games", they are simply trash, regardless of their high professionalism as endeavors. They lack innovation, they lack creativity, they are simply good software products,     
    • Giving up has never been part of my mindset. I respect projects like Reborn and E-Global they've earned their reputation. But every successful project started with people saying it would fail. If everyone gave up because there was competition, nothing new would ever exist. Skepticism is completely fair, and I'm not asking anyone to blindly believe in promises. Judge us by what we release, not by assumptions. That's exactly why we're taking our time instead of rushing something unfinished. At the end of the day, time will tell. I'd rather try to build something different and fail than never try at all.
    • Good luck beating projects like reborn eglobal and other crap l can bet you will give up after 1 year or first grand opening after online drops😁  l am very sceptical if honestly, at least run test server first or make something to show 🙂
    • Dunno, I have a friend who's really good at reverse engineering, so I don't really see a reason for anyone to be mad about it. At the end of the day, if someone has the skills and knowledge to do something, that's just part of the scene. 
    • O boy are the russians gonna get mad now that you connected to their client 😛
  • 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..