Jump to content
  • 0

Question

Recommended Posts

  • 0
Posted

everything fixed, I managed to read upon a different way of rewriting the code. now it runs smoothly and i got rid of the announcements because they were spamming the chat, instead its going to send a system message.

  • 0
Posted (edited)

Well, you can do it with switch, like (some old code)

Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (revision 198)
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java    (working copy)
@@ -4530,6 +4531,8 @@
         if (isMounted())
             stopFeed();
         
+        spreeKills = 0;
+        
         synchronized (this)
         {
             if (isFakeDeath())
@@ -4788,8 +4803,59 @@
      * Increase the pvp kills count and send the info to the player
      *
      */
+    private int spreeKills = 0;
+    
     public void increasePvpKills()
     {
+        spreeKills++;
+        
+        switch(spreeKills)
+        {
+        case 1:
+            //add skill code and w/e
+            break;
+            
+        case 2:
+            //add skill code and w/e
+            break;
+            
+        case 3:
+            //add skill code and w/e
+            break;
+            default:
+                ;
+        }   
         // Add karma to attacker and increase its PK counter
         setPvpKills(getPvpKills() + 1);

Well, it's good to put some sendMessage() so you can see if the code is working or not :P

Edited by SweeTs
  • 0
Posted (edited)

Yeah I see where you're going from, but the code might be unstable, im not really into switching.

 

 

besides if the entire code is not working, but in eclipse everything seems to be fine, I think its misplacing the code is fucking me up again.

Edited by ExtreameR
  • 0
Posted

I am checking your method right now I'll update with the result!

 

it has to be beneath

 

sendMessage("You have been rewarded with a skill.");

+addSKill(id, i);

  • 0
Posted (edited)

Yeah I know :L 

 

Edit: im currently due to some ECG scans, I will let you know in about 2 hours if it worked or not

Edited by ExtreameR
  • 0
Posted (edited)

I tried your way xdem, got nowhere.

 

 

I also tried it like this

 

if(combo == Config.COMBO1_KILLS)
{
sendMessage("You have been rewarded with a skill.");
addSkill(SkillTable.getInstance().getInfo(Config.COMBO_SKILL_ID, Config.COMBO1_LEVEL));
Announcements.getInstance().announceToAll("Player "+getName() + " is in a Combo Mode with " +combos +" pvp kills in a row!");
}
else if(combo == Config.COMBO2_KILLS)
{
sendMessage("You have been rewarded with a skill level 2.");
addSkill(SkillTable.getInstance().getInfo(Config.COMBO_SKILL_ID, Config.COMBO2_LEVEL));
Announcements.getInstance().announceToAll("Player "+getName() + " is in a Combo Mode with " +combos +" pvp kills in a row!");
}
else if(combo == Config.COMBO3_KILLS)
{
sendMessage("You have been rewarded with a skill level 3.");
addSkill(SkillTable.getInstance().getInfo(Config.COMBO_SKILL_ID, Config.COMBO3_LEVEL));
Announcements.getInstance().announceToAll("Player "+getName() + " is in a Combo Mode with " +combos +" pvp kills in a row!");
}
else if(combo == Config.COMBO4_KILLS)
{
sendMessage("You have been rewarded with a skill level 4.");
addSkill(SkillTable.getInstance().getInfo(Config.COMBO_SKILL_ID, Config.COMBO4_LEVEL));
Announcements.getInstance().announceToAll("Player "+getName() + " is in a Combo Mode with " +combos +" pvp kills in a row!");
}

that doesnt work either.

 

 

It just seem that that part of the code doesn't work at all config and Ini work perfectly fine.

Edited by ExtreameR
  • 0
Posted

debug your codes mate, the problem comes from another source, check configs and one by one the methods called

  • 0
Posted (edited)

its explained at the top devlin, I don't want to use you, i want to fix my own code :/ basically when a player reaches 5 kills without death and does not kill the guy 5 times with the same ip/clan/ally etc. he obtains a skill level 1

 

after another X amount of kills without death, he obtains skill level 2

 

after 5 more amount of kills without death obtains skill level 3

 

when he reaches the cap, skill level 5, it stops there.

 

when he dies or restarts the skills dissapears.

 

 

Nor I want newbies just to copy and paste it and claim it as theirs, i wanna make something that I've done and so it works :/

Edited by ExtreameR
Guest
This topic is now closed to further replies.



  • Posts

    • I had friends who played on Elegant and I can confirm it wasn't a bad server. I don't know about the AI bots running around, but in my opinion the price is simply too high. I don't think many people will spend that much money on Lineage 2 files when alternatives like L2Scripts already exist.   Of course it's all about personal preference, but for such an old chronicle the price seems ridiculously expensive. Modern chronicles usually offer more value.   Anyway, I wish you the best of luck with the sale. This is just my personal opinion. Whoever likes it, good for them, and whoever doesn't, that's fine too. Everyone has different preferences.
    • https://l2avokado.com/ Hello everyone,   After some time of development, we've decided to open L2Avokado to the public in its current development stage. We're looking for players who enjoy Interlude and would like to help shape the project before its official release.   This isn't a "launch" announcement. Instead, we're inviting the community to log in, explore the server, test the systems we've built, and provide honest feedback. Whether it's bug reports, balance suggestions, progression ideas, or quality-of-life improvements, we'd love to hear them.   Our goal has always been to create an Interlude server that feels familiar while offering a fresh progression experience. We've intentionally avoided custom weapons, armor, and client modifications. Instead, we've focused on redesigning progression through reworked hunting grounds, quests, crafting, and gameplay systems while remaining compatible with a clean Interlude client.   At this stage, the core progression path has been implemented, including the main hunting grounds, quests, custom systems, and events. However, as the project is still under active development, there will inevitably be bugs, balance issues, and areas that require further polishing.   This is exactly why we'd like your help.   We're looking for players who are willing to: Test gameplay and progression. Report bugs and exploits. Suggest balance improvements. Share ideas for new features or quality-of-life changes. Help us build a server that the community genuinely enjoys playing.   The Client and System downloads are already available on our website, so you can jump straight into the game. We're also working on a dedicated launcher that will simplify installation and future updates.   If you're interested in helping develop a unique Interlude project and want your feedback to genuinely influence the direction of the server, we'd love to have you with us.   We look forward to seeing you in-game and hearing your thoughts on Discord. https://l2avokado.com/
    • Mate your server used to play with full of bots, from where you find that revenue? 
  • 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..