Jump to content
  • 0

[request] Detailed, how to adopt mods for java!


Question

Posted

Hello guys!

 

I having difficulties on adopting mods for java, like tracing lines where to add some script, and I don't know what are some symbols means!

example:

@@ -0,0 +1,65 @@

and what is the significance of the "+" in the java codes that are provided and shared here!

 

I hope you will enlighten my mind!

 

thanks!

 

 

6 answers to this question

Recommended Posts

  • 0
Posted

yhe "+" significate you need to add the line 'without' the + in the file..

 

exemple

 

It's is an exmple

Of what you will doing

For make a

java mod

For make a

java mod

+ Good luck

 

So the file will be

It's is an exmple

Of what you will doing

For make a

java mod

Good luck

  • 0
Posted

Let's take for an example this share => http://www.maxcheaters.com/forum/index.php?topic=183542.0

 

 

Index: /Freya/java/l2j/gameserver/model/actor/instance/L2PcInstance.java

===================================================================

--- /Freya/java/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 381)

+++ /Freya/java/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 394)

@@ -8755,4 +8755,5 @@

case TARGET_SELF:

case TARGET_AREA_SUMMON:

+ case TARGET_SELF_AND_PET:

target = this;

break;

@@ -9020,4 +9021,5 @@

case TARGET_AREA_CORPSE_MOB:

case TARGET_GROUND:

+ case TARGET_SELF_AND_PET:

break;

default:

Index: /Freya/java/l2j/gameserver/model/actor/L2Character.java

===================================================================

--- /Freya/java/l2j/gameserver/model/actor/L2Character.java (revision 381)

+++ /Freya/java/l2j/gameserver/model/actor/L2Character.java (revision 394)

@@ -1546,4 +1546,5 @@

case TARGET_PARTY_CLAN:

case TARGET_ALLY:

+ case TARGET_SELF_AND_PET:

doit = true;

default:

Index: /Freya/java/l2j/gameserver/model/L2Skill.java

===================================================================

--- /Freya/java/l2j/gameserver/model/L2Skill.java (revision 381)

+++ /Freya/java/l2j/gameserver/model/L2Skill.java (revision 394)

@@ -75,4 +75,5 @@

TARGET_NONE,

TARGET_SELF,

+ TARGET_SELF_AND_PET,

TARGET_ONE,

TARGET_PARTY,

@@ -1349,4 +1350,17 @@

{

return new L2Character[] {activeChar};

+ }

+ case TARGET_SELF_AND_PET:

+ {

+ if (activeChar instanceof L2PcInstance)

+ {

+ final int radius = getSkillRadius();

+ if(!activeChar.isDead())

+ targetList.add(activeChar);

+ if (addSummon(activeChar, (L2PcInstance)activeChar, radius, false))

+ targetList.add(activeChar.getPet());

+ return targetList.toArray(new L2Character[targetList.size()]);

+ }

+ return _emptyTargetList;

}

case TARGET_HOLY:

 

Index: /Freya/java/l2j/gameserver/model/actor/instance/L2PcInstance.java

===================================================================

--- /Freya/java/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 381)

+++ /Freya/java/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 394)

 

This means that the file you must go to is located in l2j/gameserver/model/actor/instance/ and the file is L2PcInstance.java

 

--- /Freya/java/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 381)

+++ /Freya/java/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 394)

 

These lines will be different if in the last revision it was moved (if you are looking at l2jserver's timeline for example)

In 99% of times, they are the same.

 

@@ -8755,4 +8755,5 @@

case TARGET_SELF:

case TARGET_AREA_SUMMON:

+ case TARGET_SELF_AND_PET:

target = this;

break;

@@ -9020,4 +9021,5 @@

case TARGET_AREA_CORPSE_MOB:

case TARGET_GROUND:

+ case TARGET_SELF_AND_PET:

break;

default:

 

@@ -8755,4 +8755,5 @@

 

This means that in the mentioned above revision (revision 394) the line that the code is, is 8755.

 

case TARGET_SELF:

case TARGET_AREA_SUMMON:

+ case TARGET_SELF_AND_PET:

target = this;

break;

 

The line with the "+" is the line you must add, and the other ones are here so you can orient, where exactly you should put the code.

 

So, what I do is not to search for the line (8755). When you look the code there is "case TARGET_SELF_AND_PET", which you should add and "case TARGET_SELF" which should be already there. I copy the line "case TARGET_SELF", than I go to Eclipse and click "Ctrl + F" and paste the line. I click find and horay, you're in the correct line.  :D

 

@@ -9020,4 +9021,5 @@

case TARGET_AREA_CORPSE_MOB:

case TARGET_GROUND:

+ case TARGET_SELF_AND_PET:

break;

default:

 

This part of the patch, tells you that you must go to 9020 line, and add "case TARGET_SELF_AND_PET" after "case TARGET_GROUND". I choose one of the case's above and I copy it, paste in Eclipse and it will find the line. You make 1 new line after "case TARGET_GROUND" and add "case TARGET_SELF_AND_PET"

 

 

Index: /Freya/java/l2j/gameserver/model/actor/L2Character.java

===================================================================

--- /Freya/java/l2j/gameserver/model/actor/L2Character.java (revision 381)

+++ /Freya/java/l2j/gameserver/model/actor/L2Character.java (revision 394)

@@ -1546,4 +1546,5 @@

case TARGET_PARTY_CLAN:

case TARGET_ALLY:

+ case TARGET_SELF_AND_PET:

doit = true;

default:

 

This means that you should go to => l2j/gameserver/model/actor and open the file L2Character.java

 

Now you must find the line "case TARGET_ALLY:" or "case TARGET_PARTY_CLAN:" and add after "case TARGET_ALLY:" the new line which is "case TARGET_SELF_AND_PET:"

 

 

Index: /Freya/java/l2j/gameserver/model/L2Skill.java

===================================================================

--- /Freya/java/l2j/gameserver/model/L2Skill.java (revision 381)

+++ /Freya/java/l2j/gameserver/model/L2Skill.java (revision 394)

@@ -75,4 +75,5 @@

TARGET_NONE,

TARGET_SELF,

+ TARGET_SELF_AND_PET,

TARGET_ONE,

TARGET_PARTY,

@@ -1349,4 +1350,17 @@

{

return new L2Character[] {activeChar};

+ }

+ case TARGET_SELF_AND_PET:

+ {

+ if (activeChar instanceof L2PcInstance)

+ {

+ final int radius = getSkillRadius();

+ if(!activeChar.isDead())

+ targetList.add(activeChar);

+ if (addSummon(activeChar, (L2PcInstance)activeChar, radius, false))

+ targetList.add(activeChar.getPet());

+ return targetList.toArray(new L2Character[targetList.size()]);

+ }

+ return _emptyTargetList;

}

case TARGET_HOLY:

 

Now you must go to l2j/gameserver/model/ and open the file L2Skill.java

 

@@ -75,4 +75,5 @@

TARGET_NONE,

TARGET_SELF,

+ TARGET_SELF_AND_PET,

TARGET_ONE,

TARGET_PARTY,

 

Now find one of the lines that are below or above TARGET_SELF_AND_PET (I usually find the line above) and add the new line.

 

 

@@ -1349,4 +1350,17 @@

{

return new L2Character[] {activeChar};

+ }

+ case TARGET_SELF_AND_PET:

+ {

+ if (activeChar instanceof L2PcInstance)

+ {

+ final int radius = getSkillRadius();

+ if(!activeChar.isDead())

+ targetList.add(activeChar);

+ if (addSummon(activeChar, (L2PcInstance)activeChar, radius, false))

+ targetList.add(activeChar.getPet());

+ return targetList.toArray(new L2Character[targetList.size()]);

+ }

+ return _emptyTargetList;

}

case TARGET_HOLY:

 

Now here, you can find "return new L2Character[] {activeChar};" and add all these new lines

 

+ }

+ case TARGET_SELF_AND_PET:

+ {

+ if (activeChar instanceof L2PcInstance)

+ {

+ final int radius = getSkillRadius();

+ if(!activeChar.isDead())

+ targetList.add(activeChar);

+ if (addSummon(activeChar, (L2PcInstance)activeChar, radius, false))

+ targetList.add(activeChar.getPet());

+ return targetList.toArray(new L2Character[targetList.size()]);

+ }

+ return _emptyTargetList;

 

 

 

 

 

 

TIPS (READ THIS):

 

Always when searching a line (with a part of code..) go to the first line in the file and when you click find button, see if you click it again it won't find another time this line. If it finds another time the line, you must try with other line that is in the Patch and it ISN'T with "+"

 

 

When you add the code, probably you will get on all a red underline. Which means you must delete the "+" for example:

 

This:

 

+ }

+ case TARGET_SELF_AND_PET:

+ {

+ if (activeChar instanceof L2PcInstance)

+ {

+ final int radius = getSkillRadius();

+ if(!activeChar.isDead())

+ targetList.add(activeChar);

+ if (addSummon(activeChar, (L2PcInstance)activeChar, radius, false))

+ targetList.add(activeChar.getPet());

+ return targetList.toArray(new L2Character[targetList.size()]);

+ }

+ return _emptyTargetList;

 

In your server's core must look like this:

 

 

}

case TARGET_SELF_AND_PET:

{

if (activeChar instanceof L2PcInstance)

{

final int radius = getSkillRadius();

if(!activeChar.isDead())

targetList.add(activeChar);

if (addSummon(activeChar, (L2PcInstance)activeChar, radius, false))

targetList.add(activeChar.getPet());

return targetList.toArray(new L2Character[targetList.size()]);

}

return _emptyTargetList;

 

Without the pluses (+).

 

 

If you have minus (-) on a line, you must find it and remove this line.

 

If you can't find the you are looking for, there are some lines that in your server's core are written in 2 or 3 lines, but on the patch there is only 1. Try to copy the half of the line, and see if you will be able to find it. For example:

 

This code:

if (mainTarget == null || !(mainTarget instanceof L2Character))

return;

 

can be written like this too:

 

if (mainTarget == null ||

                            !(mainTarget instanceof L2Character))

return;

 

or this way:

 

if (mainTarget == null || !(mainTarget instanceof L2Character)) return;

 

or this way:

 

if (mainTarget == null ||

                            !(mainTarget instanceof L2Character)) return;

 

or this way:

 

if

                        (mainTarget == null || !(mainTarget instanceof L2Character))

return;

 

There are maybe 20 ways to write this code.

 

So try to search for example this part of the code:

 

(mainTarget == null

 

Now you must find it, but you must look the other part of the code if it's the same, because there can be only 1 time written this part of a code, and it can be written 20 times.

 

 

 

I hope you'll understand me, because I'm writing it real quick.  :)

 

 

 

Guest
This topic is now closed to further replies.


  • Posts

    • Продам комплекты (Custom Colour) Apella Сеты. Контакт со мной/Contact with me  Telegram. Custom Colour Apella Light YouTube Video
    • haha, I don't say it, chatgpt says it. discuss it with him if you have problems 😉 or sue chatgpt for lying, for example when he tells you that you are an idiot and tells you that I do things that are light years ahead of you.
    • hey i make enough to live comfortably you, on the other hand... doubt that'd be the case if you were as competent as you claim to be
    • all your doubts ask chatgpt, also ask what you could do yourself hahaha
    • This post originally appeared on MmoGah. Odin: Valhalla Rising is an ambitious open-world MMORPG developed with Unreal Engine 4, offering breathtaking visuals and immersive gameplay. I will share everything you need to know before starting it.     Re-rolling In Odin, re-rolling isn't a practical strategy. Unlike most gacha games, where it's common to reset for better initial pulls, Odin focuses heavily on long-term growth. The earlier you begin playing and developing your character, the more advantages you'll gain over time. Instead of spending your efforts on re-rolling for ideal equipment, it's better to dive in and start progressing right away.   Server Selection Before starting your character, selecting a server is a crucial step. Since Odin doesn't support cross-server gameplay, coordinating with your friends, family, or guildmates is essential to ensure everyone creates their characters on the same server. Take the time to plan with your group beforehand. After deciding on a server, your next major choice will be picking a class.   Class Breakdown Odin features four primary starting classes: Warrior, Sorceress, Rogue, and Priest. Each class comes with its own distinct playstyle and unique strengths, so choose wisely, as your selection is permanent. However, even free-to-play players can create up to three characters on one server, giving you the flexibility to try different options and find the one that matches your preferences.   Quest and Leveling Once your character is created, your initial objective is to work through the main questline. This acts as both a tutorial and a method for early leveling. Odin simplifies the process with a convenient quest button that handles navigation, starts dialogues, and even enables auto-combat. This user-friendly feature allows beginners to grasp the basics of the game without feeling overloaded.   Auto Combat and No Kill-steal Mode Auto combat is an essential feature in Odin, enabling your character to battle monsters autonomously. This system allows you to effortlessly gain experience and loot, even while you're busy studying, cooking, or unwinding. To optimize its use, activate the no-kill-steal mode. This setting prevents your character from targeting monsters already engaged by other players, helping you avoid conflicts or potential PvP situations. However, if a quest becomes difficult to complete due to overcrowded areas, you can temporarily disable this mode to overcome the obstacle and move forward.   Item Management and Potions Don't overlook the importance of consumable items, especially health potions. These can be purchased, along with buffs, from general merchants in villages, and they play a crucial role in improving your combat efficiency and ensuring your survival. Always aim to keep a full stock of HP potions and carry buffs that boost attack, defense, or regeneration in batches of 5-10 for convenience.   Once you've acquired your consumables, assign them to your quick slots located at the bottom center of the screen. Swiping down activates these slots, and items like potions will automatically be used when necessary, so you don't need to worry about them mid-battle. Keep a close eye on your potion reserves, as running out during a tough fight could leave you vulnerable before reaching a safe area. In the early stages of the game, it's better to return to town for a restock if supplies are low rather than risking unnecessary defeats. You can also enable notifications to alert you when your health or potion count drops too low—a handy feature for staying prepared if your attention is elsewhere.   Leveling and AFK Farming Once you've mastered the fundamentals, the next step is to focus on leveling up and enhancing your character. Gaining levels is your primary source of progression early on, as it not only improves your stats but also unlocks crucial game features and new abilities. At this stage, simply sticking to the main questline provides a reliable and efficient way to gain experience.   Additionally, Odin includes a highly convenient idle feature called AFK mode. This allows your character to keep farming for resources and experience even when the game is closed, with a maximum duration of 8 hours per day. It's an excellent option for making progress while you're asleep, commuting, or otherwise occupied.   Gear Upgrades When the time comes to improve your gear, the initial focus should be on upgrading from normal-grade equipment to high-grade items. These provide significantly better stats and can be enhanced further to increase their effectiveness. Enhancing requires enhancement stones and gold, but it's important to stay within the safe enhancement limit. Attempting upgrades beyond this limit carries the risk of destroying your gear if the enhancement fails. Stick to safe enhancements until you've gained more experience and accumulated spare equipment to mitigate potential losses.   Skill Purchases When you've accumulated enough gold, it's time to invest in skills. These are crucial for enhancing your combat abilities and provide key benefits tailored to your class, whether it's increasing damage output, improving healing capabilities, or adding valuable utility. Before purchasing, ensure your character meets the level prerequisites for each skill. Your ultimate goal will be progressing through and completing the main questline in Midgard as you continue to develop your character.   Unlocking Jotenheim Finishing this milestone grants you access to the next region, Jetunheim, unlocking a variety of new content and challenges. This marks your first significant achievement in the game and is an essential early objective to strive for as you progress.   Joining a Guild Joining a guild is a highly beneficial step in Odin. Guilds not only provide opportunities for social interaction and group activities but also offer passive bonuses that can significantly enhance your gameplay. Even if you're not particularly active socially, being part of any guild is advantageous. The guild feature becomes accessible after completing Chapter 4, Quest 19 of the main story.   Guilds provide various perks, including buffs that scale with the guild's level. Additionally, you can earn guild coins by contributing through donations, quest completions, or regular logins. These coins can be exchanged for valuable rewards, such as epic-grade armor. The more you actively contribute to your guild, the greater the overall benefits for both you and the guild itself. Joining early and staying involved will undoubtedly strengthen your progression in the game.   Conclusion Here is the end of this beginners' guide. I hope these tips will help you level fast in Odin.
  • Topics

×
×
  • Create New...