Jump to content
  • 0

[Help][Semi-Fixed]Adding Heroic Skills


Question

Posted

I'm trying to put this in the core but it shows me a mistake, you could find it easily but the thing is that I'm not a java knower so I need your help.

I'm sure that it's a simple syntax mistake, but as I said, I can't find it!

    public void increasePvpKills()

    {

        // Add karma to attacker and increase its PK counter

        setPvpKills(getPvpKills() + 1);

 

        // Increase the kill count for a special hero aura

        heroConsecutiveKillCount++;

     

        // If heroConsecutiveKillCount > 4 (5+ kills) give hero aura

        if(heroConsecutiveKillCount > 29)

 

        switch(heroConsecutiveKillCount){

        case 30:

        setHeroAura(true);

        Announcements.getInstance().announceToAll("" + this.getName()+ " went on a Killing Spree with 30 kills in row.");

        break;

        case 60:

          Announcements.getInstance().announceToAll("" + this.getName()+ " is Dominating with 60 kills in row, somebody kill him! ");       

        default:

        ;

        }

        // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter

        sendPacket(new UserInfo(this));

        sendPacket(new ExBrExtraUserInfo(this));

    }

 

    /**

    * Increase pk count, karma and send the info to the player

    *

    * @param targLVL : level of the killed player

    * @param increasePk : true if PK counter should be increased too

    */

The red ";" it's the underlined error.

Edit: Forgot tell you that I'm using L2J Latest Revision, Gracia Final[/s]

 

Edit2:

 

I fixed it and updated it on the quote above but I still want to make it apart from the aura, hero aura to give hero skills to the player too, is that possible?

12 answers to this question

Recommended Posts

  • 0
Posted

u didnt close it with '}'   ?

   public void increasePvpKills()
   {
       // Add karma to attacker and increase its PK counter
       setPvpKills(getPvpKills() + 1);

       // Increase the kill count for a special hero aura
       heroConsecutiveKillCount++;
      
       // If heroConsecutiveKillCount > 4 (5+ kills) give hero aura
       if(heroConsecutiveKillCount > 29)

          switch(heroConsecutiveKillCount){
          case 30:
          setHeroAura(true);
          Announcements.getInstance().announceToAll("" + this.getName()+ " went on a Killing Spree with 30 kills in row.");
          break;
          case 60:
            Announcements.getInstance().announceToAll("" + this.getName()+ " is Dominating with 60 kills in row, somebody kill him! ");           
          default:
          ; }
       // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
       sendPacket(new UserInfo(this));
       sendPacket(new ExBrExtraUserInfo(this));
   }

   /**
    * Increase pk count, karma and send the info to the player
    *
    * @param targLVL : level of the killed player
    * @param increasePk : true if PK counter should be increased too
    */

  • 0
Posted

That was the problem, I already fixed it I was about to come down here and tell you. I still need some help though, as you already saw in the code, it just announces that the player is eather on killing spree or dominating and gives hero aura. I would also like to give except from the hero aura, to give to the player hero skills too, is that possible?

Edit: Also I would like to add the abnormal effect when you get hero in retail, ya know which one!

  • 0
Posted

try this

for(L2Skill skill: HeroSkillTable.getHeroSkills())
{
   player.addSkill(skill,false);
}

 

and the glow

broadcastPacket(new SocialAction(this.getObjectId(), 16));
broadcastUserInfo();

  • 0
Posted

just change this number :)

 

broadcastPacket(new SocialAction(this.getObjectId(), 16));

 

Log in with gm char and try effects with //social #

#- it should be the same as effect number 1-17 i think

  • 0
Posted

It says that "ID 16" Social 16 does not exist.

To be more specific, I want that glow. Like retail when hero comes out, it makes that bright glow on your charachter and then when it goes away you are normally hero.

  • 0
Posted

yea :)

well, dunno mate, it should work with this:

 

broadcastPacket(new SocialAction(this.getObjectId(), 16));
broadcastUserInfo();

 

which pack do u use anyway?

  • 0
Posted

L2J Latest Revision - Gracia Final

 

Ok Listen, that's a big problem which I can't solve.

If I make it give the hero skills to the player when he reaches the X PvPs in row it will work fine, the problem in the part where I need to take the skills.

If I put to take the heroic skills from the player the moment when the row counter reaches zero (0) every time a player dies it's going to remove his hero skills which means if the player is hero normal (from the Olympiad) or the admin set him as a hero (with //sethero command) he is going to lose his hero skills when he is going to die.

  • 0
Posted

use something like this in l2pcinstance / increasepvpkills

setFakeHero(true);

 

and in doDie

if (isFakeHero())

and in the end of code put
setFakeHero(false):

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