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.

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...