Jump to content

Recommended Posts

Posted

Hello , latest not share done so i will share a shit now .. its nothing to be serius with .. just some small crappy codes that will make your server great :D

 

Lets start ,

 

*L2PcInstance

 

find

public void increasePvpKills()

 

you will see under it thoose

 

{
        // Add karma to attacker and increase its PK counter
        setPvpKills(getPvpKills() + 1);
        CustomHeroSystem();

         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
        sendPacket(new UserInfo(this));
        sendPacket(new ExBrExtraUserInfo(this));
    }

 

Now , after this you have to add

 

public void CustomHeroSystem()
    {
    	L2PcInstance activeChar = L2PcInstance.getClient().getActiveChar();
    	
        if (activeChar.getPvpKills() >= 5000)
        {
        	activeChar.sendMessage("You are now a server hero for beign so great fighter!");
      Announcements.getInstance().announceToAll(activeChar.getName() + "Is now a server's hero!");
        	activeChar.setHero(true); 
        }

 

 

 

If it gives you errors in announcements , you simple press right click on the error and select import announcements , and TADAMM

 

 

ps , code is tested on L2JServer Gracia Final part ;) thanks!

Posted

fix the typo on the

activeChar.sendMessage("You are now a server hero for beign so great fighter!");

beign =P

 

Thanks for sharing it for mxc.

Added at the list.

Posted

I've told you EXACTLY the same thing with your previous share..

 

So what this code does as we see it now.. Each time someone with more than 5000 pvps gets a pvp, he's being announced as a hero. Which is wrong. Should be displayed only the first time.

 

Anyway thanks for trying, but try more & improve it =)

Posted

put a check if the char is already a hero? it can cause some NPE's and this what fakoykas said :)

 

if (!activeChar.isHero() && activeChar.getPvpCount() >= 5000)

{

;

}

Posted

put a check if the char is already a hero? it can cause some NPE's and this what fakoykas said :)

 

if (!activeChar.isHero() && activeChar.getPvpCount() >= 5000)

{

;

}

Exactly what i told him at his other hero-related share. But he doesn't want to listen =(

Posted

put a check if the char is already a hero? it can cause some NPE's and this what fakoykas said :)

 

if (!activeChar.isHero() && activeChar.getPvpCount() >= 5000)

{

;

}

 

ahh you are right. sorry :d (my mistake)

Posted

Ok.. here's how it should be :D

 

public void CustomHeroSystem()

   {

       if (!isHero() && getPvpKills() == 5000)

       {

          //announce & message ONLY when they reach 5000 pvp.

          sendMessage("You are now a server hero for being so great fighter!");

          Announcements.getInstance().announceToAll(getName() + " Is now a server's hero!");

          setHero(true);

       }

 

and Now in EnterWorld.java

 

    if (!activeChar.isHero() && activeChar.getPvPKills > 5000)

          setHero(true);

 

So now the announce is only been announced if the char is not hero already and ONLY when he reaches 5000 pvps..

Also he doesn't lose hero at his relogin =)

 

Regards.

Posted

Ok.. here's how it should be :D

 

public void CustomHeroSystem()

    {

        L2PcInstance activeChar = L2PcInstance.getClient().getActiveChar();

        if (!activeChar.isHero() && activeChar.getPvpKills() == 5000)

        {

          //announce & message ONLY when they reach 5000 pvp.

          activeChar.sendMessage("You are now a server hero for being so great fighter!");

          Announcements.getInstance().announceToAll(activeChar.getName() + "Is now a server's hero!");

          activeChar.setHero(true);

        }

 

and Now in EnterWorld.java

 

    if (!activeChar.isHero() && activeChar.getPvPKills > 5000)

          setHero(true);

 

So now the announce is only been announced if the char is not hero already and ONLY when he reaches 5000 pvps..

Also he doesn't lose hero at his relogin =)

 

Regards.

 

the only problem with this is this only for enterworld not after they make the pvp.

also you missed an if(activeChar == null) check.

 

Posted

the only problem with this is this only for enterworld not after they make the pvp.

also you missed an if(activeChar == null) check.

Check the whole topic, it's just an addition to what HαRǾC« shared.

 

He has already added the method after setPvpKills(getPvpKills() + 1); so activeChar == null is not needed and neither in enterworld is needed as they are already there =)

Posted

Check the whole topic, it's just an addition to what HαRǾC« shared.

 

He has already added the method after setPvpKills(getPvpKills() + 1); so activeChar == null is not needed and neither in enterworld is needed as they are already there =)

 

i checked and i dont see the npe check it needs to be in the public void CustomHeroSystem() because okay the activeChar is defined but the null check no

Posted

Stef u cant get an npe if its already hero...

 

Definition of NPE: A null value where it shoulnt be null. full name of NPE = Null Pointer Exception extended class of RuntimeException.

 

And Inter.. u dont need a null check...

 

whats so hard?

L2PcInstance.java:

public void parsePvPCustomHero()
{
       if (!isHero() && getPvpKills() >= 5000)
       {
          //announce & message ONLY when they reach 5000 pvp.
          sendMessage("You are now a server hero for being such a great fighter!");
          Announcements.getInstance().announceToAll(activeChar.getName() + "Is now a server's hero!");
          setHero(true);
       }
}

EnterWorld.java

// You know the deal...
activeChar.parsePvPCustomHero();

 

And everything is manage in pc instance doooh!!

Is that hard?

 

Anyway nice work HαRǾC« ur getting better and better, keep it up :P

PS: And it shoud be getPvpKills() >= 5000 (biger or equal) else it will give hero status only if the player has 5000 if its 5001 bby hero :D

Posted

Stef u cant get an npe if its already hero...

 

Definition of NPE: A null value where it shoulnt be null. full name of NPE = Null Pointer Exception extended class of RuntimeException.

 

And Inter.. u dont need a null check...

 

whats so hard?

L2PcInstance.java:

public void parsePvPCustomHero()
{
        if (!isHero() && getPvpKills() >= 5000)
        {
           //announce & message ONLY when they reach 5000 pvp.
           sendMessage("You are now a server hero for being such a great fighter!");
           Announcements.getInstance().announceToAll(activeChar.getName() + "Is now a server's hero!");
           setHero(true);
        }
}

EnterWorld.java

// You know the deal...
activeChar.parsePvPCustomHero();

 

And everything is manage in pc instance doooh!!

Is that hard?

 

Anyway nice work HαRǾC« ur getting better and better, keep it up :P

PS: And it shoud be getPvpKills() >= 5000 (biger or equal) else it will give hero status only if the player has 5000 if its 5001 bby hero :D

 

still only for enterworld not by instant after the pvp...and yes you can use the isHero() to avoid the null check anyway the check method should be in the increasePvpKills() too

Posted

omg dude.. u just add in increasePvpKills() the call method: parsePvPCustomHero().

And its instantly after pvp doooh... besides that u dont need that check into increasePvpKills() if u can use it in parsePvPCustomHero(), it keeps the code clean... lolz

And also isHero is not a null check wtf ?:D that !ishero has to return false so that a normal hero dosent get parsed for nothing... and also its there if the player is already hero by pvp.. to skip the parsing method that way its more efficient.. dooh >.>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • I suggest you provide Test server for public and add a price.
    • Kroma — Lineage II Interlude on LU4 Client (Latest client)   I'm selling this project. Here's what it actually is and what's been done.   This is a few months of work, most of it on the reverse engineering side. I built it because I wanted to open my own Interlude server on it. That's not happening any more — I've moved on to other projects and don't have the free time left to take it the rest of the way, so I'd rather it went to someone who will.   The idea was to take the modern LU4 client and make it run an Interlude version of the game. Not a reskin of an old client — the actual current client, playing Interlude, against a server I wrote. That's what this is, and it works end to end: the client boots, authenticates, connects, and you play. There are six repositories. Roughly, it splits into three kinds of work: reverse engineering the client, writing the server, and rebuilding the client's own content so it matches Interlude.   Fully reverse engineered   The client's protocol wasn't documented anywhere, so it was derived from scratch off real traffic. I built a sniffer (bypassing anticheat packet encryption) that drops into the client's binaries folder and dumps live traffic to disk, then a separate Java toolchain that decrypts those captures — login and game traffic, both directions. Everything the server knows about the protocol came out of that loop: capture, decrypt, read, implement, test against the real client.   On top of that there's a native x64 hook and injector in C++. It points the client at your own servers and handles its authentication and session layer, plus a few client-side stability fixes that were needed to keep it from falling over once it's talking to something that isn't the official backend. The hooking is pattern-based rather than address-based, so a client patch doesn't automatically break it.   The reverse-engineering notes are in the repos — the patterns, the disassembly, the decompiled functions, what each one does and why it's hooked. That documentation is a real part of what's being sold; it's the difference between inheriting a working system and inheriting a black box.   The server   Interlude ruleset, aCis lineage, but substantially rewritten and extended to speak the LU5 client's protocol with modern features like Party matching, Offline shops or Mailbox. The geodata has been updated according to some layout changes in LU4 cities. There's also a separate login server handling the client's auth flow.   Customized client to adapt to Interlude   This is the part people underestimate. The retail client ships retail content — retail NPCs, retail items, retail zones, retail UI. All of that had to be reshaped. The whole client-side pipeline is scripted: extract the retail PAKs, apply every edit from data files, rebuild, drop the result back into the game folder. 23 purpose-built C# tools, ~6,700 lines, organised into three pipelines that are guaranteed not to write over each other. There's a documented checklist for regenerating everything from scratch when a new patch drops. The important thing is that none of it is hand-editing. Every change is a line in a data file. When the client updates, you re-run the scripts instead of redoing the work from memory.   All NPC / item / drop lists updated according to Interlude   The client's own data tables were rewritten from the real Interlude client data files — `npcname-e`, `itemname-e`, `skillname-e`, `systemmsg-e`, `npcgrp`. That means roughly 6,470 NPC and skill name/title updates and about 4,000 Drops/Spoils rows written directly into the client's `NPCDataTable` and `SkillTable`, so the client shows Interlude names, Interlude item text, Interlude system messages, and Interlude drop and spoil lists. There are also custom NPC rows on top of that, plus 304 game action rewrites.   Opened the catacombs   In the LU4 client the catacombs and necropolises are unusable — flooded, unlit, and with holes in the geometry. All three were fixed: Water removed. Water exclusion volumes were placed over all 12 of them: Rifts, Apostate, Patriots, Devotion, Dark Omens, Heretics, Pilgrims, Saints, Worship, Martyr, Forbidden Path and Witch. This was more involved than it sounds — the volumes' scale is ignored at runtime, so the tool picks the best-fitting native template per hole, and nearby lakes and rivers are separate water bodies that have to be excluded individually or you get leftover water borders. Lights added. About 28,900 light definitions imported into the client's level files. Missing walls fixed. Mesh actors replaced and spawned to close the gaps in the geometry.   Removed the modern "slop" features from the UI   The LU4 client is full of things that have no business in an Interlude server, and most of them are wired into the UI. Those are stripped out: The assistant manager — the auto-hunt / auto-play slot on the XP bar Vitality*and the XP lock button The fatigue system — updated the format to a regular VIP format The in-game browser and in-game radio buttons The "Learn Skill" tab in the player skills window Removals are scripted by path, so they survive a client patch and are trivially reversible if a buyer wants any of them back.   Reworked the UI toward an actual Lineage II feel   The original LU4 UI looks AI-generated. It doesn't feel like Lineage II. A good part of it has been reworked toward the classic look — the menu button row rebuilt as a wrapping layout with a proper background, the self status and target windows cleaned up, and 590 asset field edits covering textures, positions, colours, text and compiled Blueprint literals.   This part is not finished, and I want to be straight about that But the tooling to continue it is all there, and it's the good kind of tooling: you can target any widget property in any UI asset by dotted path, remove widgets by path without knowing their auto-generated slot names, and edit text that's dynamically bound through Blueprint bytecode rather than stored as a plain property. Continuing the UI work means adding lines to a data file, not reverse engineering anything new.   Other client-side work   A custom login scene, built in a real Unreal Engine project that's included Interlude music restored, plus ambient sound work (cities only for now) Custom splash and branding   What's included   All six git repositories, the Unreal Engine project and its custom assets, all the tooling — injector, hook, sniffer, decryptor, asset editor — every data set including geodata, XML, HTML and the SQL schema, the build and repack scripts, and the per-repo technical documentation including the reverse-engineering notes.   Happy to answer questions or show it running.   Gallery
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..