L2JMobius

how to modify hero requirements in the olympics

BazookaRpm · 1 · 1019

Online BazookaRpm

  • Count
  • *****
    • Posts: 445
  • Lineage II - lover - Heirophant
Hello, good afternoon, here I will leave you a tip on how to modify the number of fights and requirements, so that you can obtain the hero status, related to Olympiad.java​ and Hero.java​


First we must locate the file related to Olympiad.java​ and Hero.java​ which controls the requirements of our characters to be able to rank and obtain hero status on our server.

Path of both files: git\master\L2J_Mobius_CT_0_Interlude\java\org\l2jmobius\gameserver\model\olympiad\Olympiad.java​
Path of both files: git\master\L2J_Mobius_CT_0_Interlude\java\org\l2jmobius\gameserver\model\olympiad\Hero.java​

Here inside we will find the two java files that configure these options, edit according to your expectations or needs.

For example, we know that by default you have to participate in 9 fights and win at least 1 to become a hero. To modify the fight requirements in the Olympics and the Hero status according to your request (minimum 15 fights participated and at least 3 won), you must make the following changes in Olympiad.java and Hero.java

Modify the minimum number of fights necessary to qualify for the Olympics In Olympiad.java​ , look for the following lines and change 9 original to 15 custom:
I only changed the line, but I put them separately for convenience, although they are both together.

Code Original part 1
Code: [Select]
private static final String GET_ALL_CLASSIFIED_NOBLESS = "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= 9 ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";
Code Original part 2
Code: [Select]
private static final String GET_EACH_CLASS_LEADER = "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= 9 ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";

Modify  Part 1. add
Code: [Select]
private static final String GET_ALL_CLASSIFIED_NOBLESS =
    "SELECT charId from olympiad_nobles_eom WHERE competitions_done >= 15 ORDER BY olympiad_points DESC, competitions_done DESC, competitions_won DESC";

Modify  Part 2. add
Code: [Select]
private static final String GET_EACH_CLASS_LEADER =
    "SELECT characters.char_name from olympiad_nobles_eom, characters WHERE characters.charId = olympiad_nobles_eom.charId AND olympiad_nobles_eom.class_id = ? AND olympiad_nobles_eom.competitions_done >= 15 ORDER BY olympiad_nobles_eom.olympiad_points DESC, olympiad_nobles_eom.competitions_done DESC, olympiad_nobles_eom.competitions_won DESC LIMIT 10";

We manage to integrate our first requirement as we show in the example above.

Second Part.
Modify the requirements to claim hero status
Also in Olympiad.java, find the query that determines the heroes and adjusts the values:

Hero Requeriment 3 fight wins
Code: [Select]
private static final String OLYMPIAD_GET_HEROS =
    "SELECT olympiad_nobles.charId, characters.char_name FROM olympiad_nobles, characters WHERE characters.charId = olympiad_nobles.charId AND olympiad_nobles.class_id = ? AND olympiad_nobles.competitions_done >= 15 AND olympiad_nobles.competitions_won >= 3 ORDER BY olympiad_nobles.olympiad_points DESC, olympiad_nobles.competitions_done DESC, olympiad_nobles.competitions_won DESC";

Important in case of applying ( but ignore)
In Hero.java​ , if there is an SQL query related to the number of fights required for Hero status, you should also ensure that it reflects the new values ​​(competitions_done >= 15 and competitions_won >= 3).

ADDITIONAL INFO


If you use this configuration very well, on your test server, or a small community, it can be useful by reducing the number of heroes per player, encouraging others to have a chance.

If there is any error or something that should be modified, feel free to correct me in my error, I am just trying to contribute within the little knowledge that I have, thank you



No matter how basic it is, it can help new users.
Atte Bazooka


Atte BazooKa.RPM

Lineage II Lovers