Jump to content
  • 0

[Request]java code to become hero 4 ever


Question

Recommended Posts

  • 0
Posted

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

 

 

 

  • 0
Posted

player.setHero(true)

 

done.

 

It is not already at sethero? ^.^

 

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

  • 0
Posted

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.

  • 0
Posted

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

  • 0
Posted

activeChar.setHero(true);

 

just in enterworld.java

 

so when a players login, he is always hero.

 

it would make every player hero..

  • 0
Posted

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.

  • 0
Posted

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.

  • 0
Posted

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

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