Jump to content
  • 0

[Request]java code to become hero 4 ever


TsIpIzTiK®

Question

Recommended Posts

  • 0

player.setHero(true)

 

done.

it gives hero until restart..

 

The easiest and shortest way is just writing something like:

if(activeChar.getName().equals("Nick")){

  activeChar.setHero(true);

}

in enterworld.java

and if u want more ppl, then just write || acitveChar....................

 

 

 

Link to comment
Share on other sites

  • 0

player.setHero(true)

 

done.

 

It is not already at sethero? ^.^

 

I can't understand what he want or maybe his sethero is until restart.

Link to comment
Share on other sites

  • 0

You have to make a connection to the database, and execute an sql file that will set the character name and info to heroes.sql table, but via java. It's not difficult. Just search for other stuff that connect to database and edit them.

Link to comment
Share on other sites

  • 0

You have to make a connection to the database, and execute an sql file that will set the character name and info to heroes.sql table, but via java. It's not difficult. Just search for other stuff that connect to database and edit them.

yeah you can make that or sethero in enterworld as i said since its kinda same

Link to comment
Share on other sites

  • 0

activeChar.setHero(true);

 

just in enterworld.java

 

so when a players login, he is always hero.

 

it would make every player hero..

Link to comment
Share on other sites

  • 0

Yes, but maybe he can't every time write player's name when he wants someone to be hero forever.

 

Dude, if i have time later or tomorrow, i will share it for you.

Link to comment
Share on other sites

  • 0

Some simple ways:

 

a) - expand 'characters' table and add new boolean field, for example 'is_hero' (true/false)

    - onLogin / enterworld packet - add proper check and make player hero if there is true.

 

b) - create new table for permanent heroes.

    - the same step as before.

 

Your choice.

Link to comment
Share on other sites

  • 0

As said higher, setHero have been made in link with the Hero table, it put hero ppl in this table, but only for the play's session time.

 

Matim's solutions are fine. The b) has the advantage to don't touch to L2PcInstance, when the a) is simplier to do (when you know what to do).

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
Answer this question...

×   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