Jump to content
  • 0

Question

Posted

I want to add this code: http://www.maxcheaters.com/topic/49498-sharehero-reward-for-pvps/?hl=%2Bhero+%2Breward+%2Bpvps

Its about giving hero at x pvp's.
 

+public void increasePvpKills(L2PcInstance activeChar)

+if (activeChar.getPvpKills() >= 5000)
        {
       activeChar.sendMessage ("Congratz , you are now a hero ");
        activeChar.setHero(true);
        }

I wonder if there is a way of keeping 

- public void increasePvpKills()

beacause when i change the public void to

public void increasePvpKills(L2PcInstance activeChar) 

  i get erros in some other codes.

Recommended Posts

  • 0
Posted (edited)

I want to add this code: http://www.maxcheaters.com/topic/49498-sharehero-reward-for-pvps/?hl=%2Bhero+%2Breward+%2Bpvps

 

Its about giving hero at x pvp's.

 

+public void increasePvpKills(L2PcInstance activeChar)

+if (activeChar.getPvpKills() >= 5000)
        {
       activeChar.sendMessage ("Congratz , you are now a hero ");
        activeChar.setHero(true);
        }

I wonder if there is a way of keeping 

- public void increasePvpKills()

beacause when i change the public void to

public void increasePvpKills(L2PcInstance activeChar) 

  i get erros in some other codes.

bad code but... ok 

 

 

increasePvpKills(L2PcInstance activeChar

 

if (activeChar.getPvpKills() >= 5000)

{

activeChar.sendMessage ("Congratz , you are now a hero ");

activeChar.setHero(true);

}

remove red letters  no need since we are already inside L2PcInstance class.

Edited by AbSoLuTePoWeR
  • 0
Posted (edited)

bad code but... ok 

 

 

increasePvpKills(L2PcInstance activeChar

 

if (activeChar.getPvpKills() >= 5000)

{

activeChar.sendMessage ("Congratz , you are now a hero ");

activeChar.setHero(true);

}

remove red letters  no need since we are already inside L2PcInstance class.

well i did not find any better version of this code so i guess i have to deal with it.

 

Thanks again for your answer it worked.

How can i make it to give hero forever? After restarting hero was gone.

Edited by Rio
  • 0
Posted

well i did not find any better version of this code so i guess i have to deal with it.

 

Thanks again for your answer it worked.

How can i make it to give hero forever? After restarting hero was gone.

pack? in gameserver.model.entity.Hero.java there is a method activatehero or puthero look this method and you can make your own like this.

  • 0
Posted

Im using l2jfrozen.

im a bit confused should i post this code

in gamserver.model.entity.hero.java?

no. read the code. and try to understand how is working.

i am not talking about the whole hero.java. i am talking about the methods-voids inside hero.java about the void puthero or activehero.

 

this void will help you to understand how to make your char hero with out gone in restart.

  • 0
Posted

Here is the code 

public void putHero(L2PcInstance player, boolean isComplete)
    {
        try
        {
            if (Config.DEBUG)
            {
                System.out.println("Adding new hero");
                System.out.println("Name:" + player.getName());
                System.out.println("ClassId:" + player.getClassId().getId());
            }
            StatsSet newHero = new StatsSet();
            newHero.set(Olympiad.CHAR_NAME, player.getName());
            newHero.set(Olympiad.CLASS_ID, player.getClassId().getId());
            newHero.set(COUNT, 1);
            newHero.set(PLAYED, 1);
            _heroes.put(player.getObjectId(),newHero);
            if (isComplete)
                _completeHeroes.put(player.getObjectId(),newHero);
        }
        catch (Exception e)
        {
            /*   */
        }
    }

but i have not idea how to modify it.

  • 0
Posted

Here is the code 

You can go with tessa's way OR you can add putHero anywhere in L2PcInstance.java

public void putHero(L2PcInstance player, boolean isComplete)
    {
        try
        {
            StatsSet newHero = new StatsSet();
            newHero.set(Olympiad.CHAR_NAME, player.getName());
            newHero.set(Olympiad.CLASS_ID, player.getClassId().getId());
            newHero.set(COUNT, 1);
            newHero.set(PLAYED, 1);
            _heroes.put(player.getObjectId(),newHero);
            if (isComplete)
                _completeHeroes.put(player.getObjectId(),newHero);
        }
        catch (Exception e)
        {

        }
    }

and then find the method increasePvPKills()  at L2PcInstance.java

and add a check if (player.getPvPkills() == XX && !_completeHeroes.contains(player.getObjectId))

 

 

which basicaly will make the player hero if he reach the proper pvp kills and no contained in the list.

Even tho u need to save and load it somewhere and this way suck.. but is kinda an idea on how to make it.

  • 0
Posted (edited)

OR you can add putHero anywhere in L2PcInstance.java

 

Nonnonnonononononnonononnnonono sir. Leave Britney the method alone (and where it belongs) !

 

All in one it's a terrible idea to put it permanent, you will probably mess Olympiads system.

Edited by Tryskell
  • 0
Posted (edited)

Nonnonnonononononnonononnnonono sir. Leave Britney the method alone (and where it belongs) !

 

All in one it's a terrible idea to put it permanent, you will probably mess Olympiads system.

Wait the "will probably mess olympiad system" ok but he ask about the code, normally he should make a row in characters "isHero" and store it as int there even tho again it wont appear in olympiad manager.

 

So about the code, open your navicat and characters find isNoble row and also find it inside L2PcInstance at the 2 sql

RESTORE_CHARACTER, UPDATE_CHARACTER      and add a new one and call it  isHero and basicaly do the same as isNoble does.. add the line at statement and where it loads, store values

and make two methods isPermaHero() that return the boolean _isPermaHero  and another one setPermaHero(boolean h) that set value at _isPermaHero = h;

 

and then find the method increasePvPKills(L2PcInstance activeChar) at L2PcInstance and add your check

 

if (activeChar.getPvPKills() == 1000 && !activeChar.isPermaHero())

{

    activeChar.setPermaHero(true); //set var as true so it can be stored

    activeChar.setHero(true); //set current hero

    activeChar.sendMessage("Congrats, you reached 1000 pvp's, you earned hero's status!");

}

 

even if server shutdown or character logs out, it will store at characters as if it was noble or vip or whatever.

 

Ps. tryskell first time you write a comment without being 333 lines, im proud of you honey <3

Edited by AccessDenied
  • 0
Posted

I write big posts only when there is a need to argue or to explain, nothing more, nothing less.

 

And my disease seems to spread, as you act like that. My machiavelic plan works !

  • 0
Posted

You have to add only on l2pcinstance.java all the code..

There is some better quake pvp systems and add your own effects/hero/annoounce

  • 0
Posted

I write big posts only when there is a need to argue or to explain, nothing more, nothing less.

 

And my disease seems to spread, as you act like that. My machiavelic plan works !

to be honest i love it when u do it :3

Guest
This topic is now closed to further replies.


  • Posts

    • https://web.archive.org/web/20260306183214/https://maxcheaters.com/topic/241828-l2j-l2damage/page/3/ https://l2topzone.com/forum/l2-server-support-problems/9/l2damage-stopped/30514 Also we will try to push longer seasons ever ! (1135-100)/9 = 115 online
    • ONE SIDE – AND EVERYTHING BREAKS ▪ Looks like a simple case: Florida DL, back side, barcode – “clean and minimal”. ▪ In reality, these are exactly the tasks that fail most often. – data provided as plain text – request only for the back side – focus on the barcode (PDF417) ▪ And here’s the key point: ▪ A barcode is not just a “picture on the back”. It’s compressed logic of the entire document. ▪ If it doesn’t match the front, format, and data structure – the system flags it instantly. ▪ Many create a “similar-looking” code. But systems don’t read “similar” – they read by specification. ▪ In cases like this, it’s not about design. It’s about correct data assembly and how it behaves inside the format. ▪ Today only – 15% off for verification cases. ▪ Want it to pass, not just look right? Describe your case – we’ll show where even clean files break. › TG: @mustang_service ( https:// t.me/ mustang_service ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #editing #photoshop #documents #verification #case
    • Your anonymity is a corpse. Blockchain forgets nothing. Your transactions are direct footprints in the hands of anyone who takes an interest. [✘] Still believe in "mixing"? Forget it. Classic Bitcoin mixers are an illusion of security. For Chainalysis and Elliptic algorithms, any attempt to hide tracks in the ledger is transparent. Your "mixing" is an artifact that gets filtered out in seconds. Every transaction leaves a trail that leads to frozen assets or unwanted questions from exchanges.  We don't mix. We break the link. [-] Input: Your "dirty" coins (Dirty BTC/ETH) with all their history and digital markers stay with us. [+] Output: You receive absolutely clean assets (Clean Crypto) from our reserves, which have never intersected with your past. This isn't a game of hide and seek. This is the surgical removal of your financial history from the system.   ------------------------------------------------------------------- Technical indexing: Bitcoin Mixer, Crypto Mixer, Clean BTC, Clean ETH, Anti-Chainalysis, Best Bitcoin Mixer, Anonymous Crypto Exchange, NoLog Mixing Service.
    • Here you are: https://l2crypt.com/l2-tools/l2editor-source/
  • 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..