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?

  • 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

    • Good day! Due to the increasing number of questions, "Do you provide services for the client?" - I decided to answer with a separate topic. I provide services for editing/modifying the client and individual files, namely: 1. Transfer/Creation/Editing locations, geodata.   2. All kinds of work with NPCs, including transfer, animation, adding effects to them and logos.   3. Actually, Transfer/Creation/Edit any EFFECTS, including Abnormal Effects.   4. Any work with weapons, armor, accessories and everything related to it.   5. Create or edit textures, including dynamic textures.   6. Creating a Lobby Screen, Lobby Char Selection (character selection window) and Lobby Char Creation (character creation window). What I don't do: 1. Coding in any form (except for CB).   I started publishing my work recently, here - YouTube And here - RuTube If required, I respect confidentiality. Any other questions? Welcome to Telegram or PM.
    • 🎮https://discord.gg/yyVRtna9RB 🌎https://l2-forever.com L2 Forever was the best mid rates PvP server back in C4 and C5 and we want to give players the same experience with Interlude!   # L2-Forever * EXP: 50x * Adena: 200x * Spoil: 5x * Drops: 5x   # ENCHANTS *Safe Enchant : 3 *Max. Enchant : 20 *Normal Scroll chance : 65% *Blessed Scroll chance : 70%   # NEW PLAYERS * Start with Coupons allowing you to get free top D-grade * Start at level 20 * Main Town Giran Harbor   # BOOSTED AREA'S * Execution Grounds [ 20 - 40] * Cruma Tower [40-52] * Antharas Lair [52-61] * Antharas Heart [61-80] * Giran Harbor - Shopping Area   # END GAME FARMING AREAS * Monastery of Silence and Primeval Island customized for group farm # PLATINUM ARMORS * Platinum Armors get dropped by raids, allowing everyone to obtain a set and not only donators * Many Raids all over the L2 world drop parts of the Platinum Armors   # BUFFS * Buff duration is set at 1 hour for normal buffs (Buffs and Songs / Dances) * Town Buffers in all main towns with all available buffs Giran Harbor (GH) is the place to be for all your trades and item needs! Platinum Armors   # FOREVER ITEMS * Unique Forever weapons & armors # UNIQUE L2 FOREVER AUGMENTATION SYSTEM * We don't use retail augmentations, we use our own unique system and glows!   # OTHER CUSTOM FEATURES * Global Gatekeeper * NPC Class Changer * Auction House * Unique Augmenter * Subclass with Adena or from Cabrio * Nobless - Barakiel * Useless S weapon Special abilities like (Cheap shot) are changed
    • 🎮https://discord.gg/yyVRtna9RB 🌎https://l2-forever.com L2 Forever was the best mid rates PvP server back in C4 and C5 and we want to give players the same experience with Interlude!   # L2-Forever * EXP: 50x * Adena: 200x * Spoil: 5x * Drops: 5x   # ENCHANTS *Safe Enchant : 3 *Max. Enchant : 20 *Normal Scroll chance : 65% *Blessed Scroll chance : 70%   # NEW PLAYERS * Start with Coupons allowing you to get free top D-grade * Start at level 20 * Main Town Giran Harbor   # BOOSTED AREA'S * Execution Grounds [ 20 - 40] * Cruma Tower [40-52] * Antharas Lair [52-61] * Antharas Heart [61-80] * Giran Harbor - Shopping Area   # END GAME FARMING AREAS * Monastery of Silence and Primeval Island customized for group farm # PLATINUM ARMORS * Platinum Armors get dropped by raids, allowing everyone to obtain a set and not only donators * Many Raids all over the L2 world drop parts of the Platinum Armors   # BUFFS * Buff duration is set at 1 hour for normal buffs (Buffs and Songs / Dances) * Town Buffers in all main towns with all available buffs Giran Harbor (GH) is the place to be for all your trades and item needs! Platinum Armors   # FOREVER ITEMS * Unique Forever weapons & armors # UNIQUE L2 FOREVER AUGMENTATION SYSTEM * We don't use retail augmentations, we use our own unique system and glows!   # OTHER CUSTOM FEATURES * Global Gatekeeper * NPC Class Changer * Auction House * Unique Augmenter * Subclass with Adena or from Cabrio * Nobless - Barakiel * Useless S weapon Special abilities like (Cheap shot) are changed
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...