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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...