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

    • I'll give you my wallet if you want, haha
    • To make up for some of the waiting time we’re hosting a 3v3 Tournament on open Beta, and this time we’re raising the stakes with a $1,300 prize pool 💰   🏆 PRIZE POOL BREAKDOWN (Over 2000$ Worth of prices total)   🥇 1st Place — $700 🥈 2nd Place —$300 🥉 3rd Place — $200 🏅 4th Place — $100  5th -6th Place - $100 in Gold Coins each    All Participating Teams: $50 in Gold!   All Prices will be Paid out instantly after the tour, no waiting time and conditions. This is not simply a marketing move, we want to give back to the community.   📅 Date: Wednesday 06.05.2026 ⏰ Time: 20:00 Central European Timezone (Berlin) 📍Format: 3v3   ⚔️Why join? Cash Prices for top 4 and rewards for all participants Payments to winners sent out straight after the tournament - No waiting time or rules that you have to play live server to obtain the reward. Clean format, smooth matches, and solid prize pool and a chance to experience our brand new files   📝How to join: Form your 3-player team Group Leader Sign up here: ⁠📍・3v3-tour-registration (Include Name of Group, Name of Group Leader)   Be ready on match day!     A separate post with rules for the tournament and class setups will follow shortly.   Tag your teammates, lock in your roster, and get ready to compete. We'll be happy to see you on the OBT!   💬 Questions? Ask in ⁠🎫・ticket or send us a message   See you on L2Dark! 😏   Discord: https://discord.gg/FAJwnFpb8M
    • You should check if that condition is supported by your current sources. You can find this in  DocumentBase#parsePlayerCondition If it isnt there and you want to follow the same pattern of the other item conditions, create a custom condition to parse the classId (or multiple class ids) (there are examples to copy the code). Alternatively, you can create your own condition handler. Your condition should look like this: <cond msgId="1518"> <player classId="ADVENTURER,PALADIN" /> </cond> or <cond msgId="1518"> <player classId="93,5" /> </cond>  
    • it's Interlude client forgot to mention
    • idk if acis have this option, but you can put inside item smth like that atleast on H5         <cond msgId="1518">             <player class_id_restriction="93, 101, 108, 117" /> <!-- Dagger Masters -->         </cond>
  • 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..