Skip to content

[Request]java code to become hero 4 ever

Featured Replies

hello mxc am need your help i want a java code to become hero 4 ever i have use searche and i diden't find it maybe some1 have it?

  • Author

u search on wrong section!

i didn't search on section i search on all forum

What kind of code? If player have a number of pvps or //sethero? Explain us.

 

  • Author

What kind of code? If player have a number of pvps or //sethero? Explain us.

 

not with admin command set him hero for ever like donate hero

player.setHero(true)

 

done.

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....................

 

 

 

player.setHero(true)

 

done.

 

It is not already at sethero? ^.^

 

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

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.

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

activeChar.setHero(true);

 

just in enterworld.java

 

so when a players login, he is always hero.

 

activeChar.setHero(true);

 

just in enterworld.java

 

so when a players login, he is always hero.

 

it would make every player hero..

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.

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.

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).

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.