Jump to content
  • 0

[help]how to make hero until restart


Question

Posted

hello mxc...

i have this code(copy paste from revenger )

if (activeChar.getPvpKills() >= 3000)
        {
        	activeChar.sendMessage("You are now on a killing spree!");
      Announcements.getInstance().announceToAll(activeChar.getName() + "Is now on a killing spree!");
        	activeChar.setHero(true); 
        }

how i can make it hero until restart ?

i am not sure but this is for the player when he get 3000 in a row or when he gain 3000?

 if (activeChar.getPvpKills() >= 3000)

 

 

Recommended Posts

  • 0
Posted

how i can make it in a row ?

example 50 pvp's ina row..

in the increasePvpKills method: killstreak++. After that check if it is ==50 and execute your code (sethero, change title, etc). In the dodie method add killstreak=0.

  • 0
Posted

well this didnt help me  http://www.maxcheaters.com/forum/index.php?topic=126820.0

i want to create my code...i just need to understand what methods what imports and what everything i must do to make all thinks better(for me) coz i am trying to learn java..i am not a pro..

can any1 help me ?

  • 0
Posted

Something like that will prolly work.

 

find public void increasePvpKills() inside L2PcInstance

 

        int KillsInARow = 0;
        KillsInARow++;
        if (KillsInARow > put your number here)
        {
        	setHero(true);
        }

  • 0
Posted

It wont work because he is defining the variable inside the method.

You need to store it in the class (instanced variable) else the var will always be 0 and then 1.

  • 0
Posted

Also dont forget to add a check on rr / logout..

if (KillsInARow > 0) KillsInARow = 0;

idk about this but it might not reset the Kills count on exit/rr.

Horus knows the best , he'll tell u :P

  • 0
Posted

It does.

The L2PcInstance class is cast on each 'player'. Meaning, a new class is created. Hence when the player leaves all classes related to him (including L2PcInstance) are deleted.

  • 0
Posted

However you do have to reset the kill spree counter on death.

Find doDie() in L2PcInstace and add the reset.

 

If you want send me a .patch and I'll see if its correct else, just make sure you don't make public vars that don't need to be public (just make getters and setters) and be sure to add your code after the checks. Good luck.

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


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock