Jump to content

Question

Posted

hey i have a java code problem and i cant fix it... it is a code for killing spree reward...

 

* Increase the pvp kills count and send the info to the player

*

    */

  private int impro = 0;

    public void increasePvpKills()

    {

      impro++;

             

            switch(impro){

           

                      case 5:

              ShowMessage case5 = new showMessage("You reached 5 killing spree!", 10000);

              sendPacket(case5);

            Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 5 kill in a row!");

                            addItem("Loot", 57, 100, this, true);

              break;

             

            case 10:

              showMessage case10 = new showMessage("You reached 10 killing spree!", 10000);

              sendPacket(case10);

            Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 10 kill in a row!");

                              addItem("Loot", 57, 100, this, true);

              break;

             

            case 15:

              ExShowScreenMessage case15 = new showMessage("You reached 15 killing spree!", 10000);

              sendPacket(case15);

              Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 15 kill in a row!");

                              addItem("Loot", 57, 100, this, true);

              break;

             

            case 20:

              showMessage case20 = new showMessage("You reached 20 killing spree!", 10000);

              sendPacket(case20);

              Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 20 kill in a row!");

                              addItem("Loot", 57, 100, this, true);

              break;

             

            case 25:

              showMessage case25 = new showMessage("You reached 25 killing spree!", 10000);

              sendPacket(case25);

              Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 25 kill in a row!");

                                addItem("Loot", 57, 100, this, true);

              break;

             

            case 30:

              showMessage case30 = new showMessage("You reached 30 killing spree!", 10000);

              sendPacket(case30);

              Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 30 kill in a row!");

                              addItem("Loot", 57, 100, this, true);

              break;

                default:

                ;

              }

 

     

      if ((TvT._started && _inEventTvT) || (DM._started && _inEventDM) || (VIP._started && _inEventVIP) || (CTF._started && _inEventCTF))

          return;

 

      // temp fix here

      if (isMounted())

          dismount();

     

      impro = 0;

 

      if (isTransformed() && !isCursedWeaponEquipped())

      {

if (target instanceof L2PcInstance

&& AntiFeedManager.getInstance().check(this, target))

 

// Add karma to attacker and increase its PK counter

setPvpKills(getPvpKills() + 1);

 

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

    sendPacket(new UserInfo(this));

sendPacket(new ExBrExtraUserInfo(this));

 

there are some problems and i cant add the code in my server because i cant fix them... can any1 help me? thanks...

7 answers to this question

Recommended Posts

  • 0
Posted

Buildfile: C:\????\????????\workspace\L2_GameServer\build.xml

clean:

  [delete] Deleting directory C:\????\????????\workspace\L2_GameServer\build

verifyRequirements:

init:

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build\classes

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build\dist

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build\dist\login

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build\dist\gameserver

version:

    [exec] Execute failed: java.io.IOException: Cannot run program "svnversion": CreateProcess error=2, ??? ????? ?????? ? ?????? ??? ???????????? ??????? ??? ?? ???????

compile:

    [javac] Compiling 1526 source files to C:\????\????????\workspace\L2_GameServer\build\classes

    [javac] C:\????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5715: illegal start of type

    [javac] if (target instanceof L2PcInstance

    [javac] ^

    [javac] C:?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5715: <identifier> expected

    [javac] if (target instanceof L2PcInstance

    [javac]           ^

    [javac] C:\????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5715: ';' expected

    [javac] if (target instanceof L2PcInstance

    [javac]                     ^

    [javac] C:\????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5716: illegal start of type

    [javac] && AntiFeedManager.getInstance().check(this, target))

    [javac] ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5716: ';' expected

    [javac] && AntiFeedManager.getInstance().check(this, target))

    [javac]                   ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5716: invalid method declaration; return type required

    [javac] && AntiFeedManager.getInstance().check(this, target))

    [javac]                   ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5716: ';' expected

    [javac] && AntiFeedManager.getInstance().check(this, target))

    [javac]                                 ^

    [javac] C:?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: invalid method declaration; return type required

    [javac]     sendPacket(new UserInfo(this));

    [javac]     ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: illegal start of type

    [javac]     sendPacket(new UserInfo(this));

    [javac]               ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: ')' expected

    [javac]     sendPacket(new UserInfo(this));

    [javac]                   ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: ';' expected

    [javac]     sendPacket(new UserInfo(this));

    [javac]                           ^

    [javac] C:\??????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: illegal start of type

    [javac]     sendPacket(new UserInfo(this));

    [javac]                             ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: <identifier> expected

    [javac]     sendPacket(new UserInfo(this));

    [javac]                                 ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: ';' expected

    [javac]     sendPacket(new UserInfo(this));

    [javac]                                 ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: invalid method declaration; return type required

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac] ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: illegal start of type

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]           ^

    [javac] C:\??????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: ')' expected

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]               ^

    [javac] C:\??????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: ';' expected

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]                                 ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: illegal start of type

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]                                 ^

    [javac] C:\Users\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: <identifier> expected

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]                                     ^

    [javac] C:\Users\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: ';' expected

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]                                       ^

    [javac] 21 errors

 

BUILD FAILED

C:\??????\????????\workspace\L2_GameServer\build.xml:63: Compile failed; see the compiler error output for details.

 

Total time: 5 seconds

 

this is what it displays me after running ant build 1 in eclipse...

  • 0
Posted

Buildfile: C:\????\????????\workspace\L2_GameServer\build.xml

clean:

  [delete] Deleting directory C:\????\????????\workspace\L2_GameServer\build

verifyRequirements:

init:

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build\classes

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build\dist

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build\dist\login

    [mkdir] Created dir: C:\????\????????\workspace\L2_GameServer\build\dist\gameserver

version:

    [exec] Execute failed: java.io.IOException: Cannot run program "svnversion": CreateProcess error=2, ??? ????? ?????? ? ?????? ??? ???????????? ??????? ??? ?? ???????

compile:

    [javac] Compiling 1526 source files to C:\????\????????\workspace\L2_GameServer\build\classes

    [javac] C:\????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5715: illegal start of type

    [javac] if (target instanceof L2PcInstance

    [javac] ^

    [javac] C:?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5715: <identifier> expected

    [javac] if (target instanceof L2PcInstance

    [javac]           ^

    [javac] C:\????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5715: ';' expected

    [javac] if (target instanceof L2PcInstance

    [javac]                     ^

    [javac] C:\????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5716: illegal start of type

    [javac] && AntiFeedManager.getInstance().check(this, target))

    [javac] ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5716: ';' expected

    [javac] && AntiFeedManager.getInstance().check(this, target))

    [javac]                   ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5716: invalid method declaration; return type required

    [javac] && AntiFeedManager.getInstance().check(this, target))

    [javac]                   ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5716: ';' expected

    [javac] && AntiFeedManager.getInstance().check(this, target))

    [javac]                                 ^

    [javac] C:?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: invalid method declaration; return type required

    [javac]     sendPacket(new UserInfo(this));

    [javac]     ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: illegal start of type

    [javac]     sendPacket(new UserInfo(this));

    [javac]               ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: ')' expected

    [javac]     sendPacket(new UserInfo(this));

    [javac]                   ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: ';' expected

    [javac]     sendPacket(new UserInfo(this));

    [javac]                           ^

    [javac] C:\??????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: illegal start of type

    [javac]     sendPacket(new UserInfo(this));

    [javac]                             ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: <identifier> expected

    [javac]     sendPacket(new UserInfo(this));

    [javac]                                 ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5722: ';' expected

    [javac]     sendPacket(new UserInfo(this));

    [javac]                                 ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: invalid method declaration; return type required

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac] ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: illegal start of type

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]           ^

    [javac] C:\??????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: ')' expected

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]               ^

    [javac] C:\??????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: ';' expected

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]                                 ^

    [javac] C:\?????\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: illegal start of type

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]                                 ^

    [javac] C:\Users\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: <identifier> expected

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]                                     ^

    [javac] C:\Users\????????\workspace\L2_GameServer\java\com\l2jserver\gameserver\model\actor\instance\L2PcInstance.java:5723: ';' expected

    [javac] sendPacket(new ExBrExtraUserInfo(this));

    [javac]                                       ^

    [javac] 21 errors

 

BUILD FAILED

C:\??????\????????\workspace\L2_GameServer\build.xml:63: Compile failed; see the compiler error output for details.

 

Total time: 5 seconds

 

this is what it displays me after running ant build 1 in eclipse...

hey i have a java code problem and i cant fix it... it is a code for killing spree reward...

 

* Increase the pvp kills count and send the info to the player

*

    */

  private int impro = 0;

    public void increasePvpKills()

    {

      impro++;

             

            switch(impro){

           

                      case 5:

              ShowMessage case5 = new showMessage("You reached 5 killing spree!", 10000);

              sendPacket(case5);

            Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 5 kill in a row!");

                            addItem("Loot", 57, 100, this, true);

              break;

             

            case 10:

              showMessage case10 = new showMessage("You reached 10 killing spree!", 10000);

              sendPacket(case10);

            Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 10 kill in a row!");

                              addItem("Loot", 57, 100, this, true);

              break;

             

            case 15:

              ExShowScreenMessage case15 = new showMessage("You reached 15 killing spree!", 10000);

              sendPacket(case15);

              Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 15 kill in a row!");

                              addItem("Loot", 57, 100, this, true);

              break;

             

            case 20:

              showMessage case20 = new showMessage("You reached 20 killing spree!", 10000);

              sendPacket(case20);

              Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 20 kill in a row!");

                              addItem("Loot", 57, 100, this, true);

              break;

             

            case 25:

              showMessage case25 = new showMessage("You reached 25 killing spree!", 10000);

              sendPacket(case25);

              Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 25 kill in a row!");

                                addItem("Loot", 57, 100, this, true);

              break;

             

            case 30:

              showMessage case30 = new showMessage("You reached 30 killing spree!", 10000);

              sendPacket(case30);

              Announcements.getInstance().announceToAll("Player: " + getName() + " :reached 30 kill in a row!");

                              addItem("Loot", 57, 100, this, true);

              break;

                default:

                ;

              }

 

     

      if ((TvT._started && _inEventTvT) || (DM._started && _inEventDM) || (VIP._started && _inEventVIP) || (CTF._started && _inEventCTF))

          return;

 

      // temp fix here

      if (isMounted())

          dismount();

     

      impro = 0;

 

      if (isTransformed() && !isCursedWeaponEquipped())

      {

if (target instanceof L2PcInstance

&& AntiFeedManager.getInstance().check(this, target))

 

// Add karma to attacker and increase its PK counter

setPvpKills(getPvpKills() + 1);

 

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

    sendPacket(new UserInfo(this));

sendPacket(new ExBrExtraUserInfo(this));

 

there are some problems and i cant add the code in my server because i cant fix them... can any1 help me? thanks...

  • 0
Posted

Cant find anything wrong in code, atleast not in this part. All the errors are at that part of the code wich has nothing to do with kill spree. It may be that some of the  {} bracket were not closed somewhere before, or something like that.

if ((TvT._started && _inEventTvT) || (DM._started && _inEventDM) || (VIP._started && _inEventVIP) || (CTF._started && _inEventCTF))
          return;

       // temp fix here
       if (isMounted())
          dismount();
      
      impro = 0;

       if (isTransformed() && !isCursedWeaponEquipped())
       {
      if (target instanceof L2PcInstance
            && AntiFeedManager.getInstance().check(this, target))
       
         // Add karma to attacker and increase its PK counter
         setPvpKills(getPvpKills() + 1);
      
         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
          sendPacket(new UserInfo(this));
         sendPacket(new ExBrExtraUserInfo(this));

 

Did you copy this part of code from somewhere aswell? Cause this part of code shouldnt be modifyed in your case.

  • 0
Posted

i copied it from the topic which had the code for killing spree. you mean that if i delete this part that has nothing to do with the code, i will do the code work??

No. That part of code was allready in your L2PcInstance.java. It may have been allitle different due to different packs/revs. Just look at the code, first part of code is about kill sprees, later its just regular checks after pvp kill. Dont just copy code blindly, try to understand wich line does what and you will know what you need and what is unesscesary.

When someone posts part of code for something (in this case kill spree), they usualy post it this way:

some original code (not modyfied)

modyfied part (in this case kill spree)

some original code again.

 

This is being done so that you would know where to add/replace the modyfied code. Do not copy part with original code, just find that oroginal code in your files and compare whats the difference. And apply only the difference :)

I hope you'll get what I mean.

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

    • Hi, could someone please share a C1 L2 Off cheat code for local play?
    • I’ve worked with a web designer Tacoma before, and it really reminded me how much smoother projects run when design and development stay in sync. Your setup looks solid, and pairing clean UI work with steady backend support can save a ton of back‑and‑forth later. If you ever decide to push harder on conversions or need outside perspective on structure, that mix helped me spot gaps early on.
    • If you’re juggling mixed payment methods and tricky setups, I’ve found that easing the pressure on the subscription side can make the whole flow smoother. I started using Subscription Revenue Growth for handling my own recurring payments, upgrades, and all that messy churn stuff, and it took a big weight off. Pairing something stable for subs with your gateway setup can keep cashflow from going off the rails.
    • L2Avalon launches February 20 High Five project (Salvation client) focused on classic world progression — not instance spam and not “twink” metas. What is L2Avalon? L2Avalon is built around real Lineage 2 gameplay: farming spots, open world conflict, raids, epics, economy and competition. No Kamael Reduced instanced content **Discord:** https://discord.gg/NbM2cXmAem 🌐 **Website:** https://l2avalon.net Balance & Economy Every class is tuned to be viable in PvE and PvP Off-meta classes get buffed instead of adding power-creep garbage Adena-based economy Farming matters: boosted Drop/Spoil for each stage of progression Rates & Settings Dynamic XP: 50x (Lv 1–40) → 1x (Lv 78+) Staged progression with new content unlocking weekly Adena / Drop / Spoil: 3x / 5x / 5x NPC Buffer: 2 hours (Premium: 3 hours) Box limit: 2+1 windows per PC MP potion: 1000 MP, 10s cooldown Free2Play System (earn Donate Coins by playing) You don’t have to donate to progress. Donate Coins drop in-game, so everything is achievable through playtime and activity. Where Donate Coins drop: Mobs Lv 76+, Raid Bosses Lv 70+, Epic Bosses Auto-farm (controlled) Limit: only 1 window can use auto-farm at the same time Daily time: 1 hour/day without Premium Extra tickets: purchasable with PC Bang points (earned by being online) Disabled zones: CC / IT / FOG / VARKA / KETRA Equipment Changes Reworked set bonuses Reworked SA system Enchanted set bonuses Enchanted shirt bonuses Fake Epic jewelry (weakened alternative) Skills (High Five mechanics) New skills added Old skills updated New enchant branches + updated existing ones Subclass skills Clan skills Daily Activities (solo-friendly) Events / Missions / Instances Stages Soon — stage schedule and weekly unlocks will be published February 20 — we start. **Discord:** https://discord.gg/NbM2cXmAem 🌐 **Website:** https://l2avalon.net
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

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