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


  • Posts

    • Hello guys, gh0t from gh0tstudio here. This time we are putting to sale this beafitul landing page for your next server. Lineage 2 Server Landing Page Template u can check it here LINEAGE 2 DEMO SITE   Technology Stack - React 18 with TypeScript - Tailwind CSS for styling - Framer Motion for animations - Vite for fast development and builds - Multi-language support (i18n ready) Responsive Design The template is fully responsive and optimized for all screen sizes. Desktop, tablet, and mobile layouts have been carefully crafted to provide the best user experience on any device. The mobile version includes a unique notch-style hero design with custom clip paths. What is Included - Complete landing page source code - Hero section with parallax scroll effect - Server information section with animated cards - Character classes showcase with interactive gallery - Registration form (frontend only, styled and validated) - Donation packages display section - Download section for game client - Sticky navigation with transparency effects - Footer with social links - Multi-language system (Spanish/English ready) - All animations and transitions - Clean, documented code structure - Easy to customize colors and content   What is Not Included - Backend server or API - User registration panel/dashboard - Payment processing system for donations - Database integration - Connection to L2 game server - Online player counter module - Account management system - Hosting or domain   The template provides the complete frontend experience.  Price: $150 USD     Contact For purchase inquiries or questions about the template, please reach out directly.
    • 流量套利 + SMM 面板 — 强大的增长组合. 通过社交信号加强推广活动,提高信任度和转化率,加速扩张。 为套利专员和 SMM 提供的所有工具 — 在一个地方. 有效链接: SMM 面板: 前往 – 推广您的社交媒体账户。 其他服务和产品: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram 信使方便访问商店。 虚拟号码服务: 前往 用于购买 Telegram Stars 的 Telegram 机器人: 前往 – 在 Telegram 中快速且优惠地购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们想向您展示当前促销和特别优惠列表,用于购买我们服务的产品和服务: 1. 您可以在首次购买时使用促销代码:SOCNET(15% 折扣) 2. 获取 $1 商店余额或 10–20% 折扣——只需在我们网站注册后按以下模板填写您的用户名:"SEND ME BONUS, MY USERNAME IS..." ——您需要在我们的论坛主题中发布! 3. SMM 面板首次试用可获得 $1:只需在我们的网站(Support)提交主题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道和 Stars 购买机器人中每周都会赠送 Telegram Stars! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式和支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • Topics

×
×
  • 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