Jump to content
  • 0

One Other Problem...


Extreamer

Question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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);

Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

  • 0

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
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



  • Posts

    • to my store : https://topestore.mysellix.io/fr/ 2015-2022 Aged Discord Account 2015 Discord Account : 50.99 $ 2016 Discord Account : 10$ 2017 Discord Account :3.99 $ 2018 Discord Account : 3.50$ 2019 Discord Account : 2.70 $ 2020 Discord Account :1.50$ 2021 Discord Account :0.99$ 2022 Discord Account :0.70$ Warranty :Lifetime Payment Methods : Crypto/ PayPal Contact Me On Discord Or Telegram Discord : @ultrasstore11 Telegram : https://t.me/ultrastore11 Whatsapp ; +212614849119
    • This is my first and last topic created on a Lineage Forum, because if there's one thing that causes headaches for a lot of people, it's the critical error, that's why I decided to share it...   I'm creating a server again and before starting configurations I started collecting dozens of customs, without realizing my system folder had 950MB of files, so I started to enter the game, every 1 to 2 hours my client was reaching the maximum limit of virtual memory of the game due to the absurd amount of customs inside the system folder, reaching the maximum limit of 2047MB virtual ram, automatically we get critical, regardless of the error that appears on your screen, "THE WORDS ARE IRRELEVANT, unless it is a critical error before the ram memory limit reaches its limit", if you are seeing "2047 MB", it means that the game's virtual memory has reached its limit, and this memory is not configurable due to the game being created on 32-bit architecture, so I significantly reduced the amount of customs within the system from 950MB to 625MB, so my client started to reach the maximum memory limit every 10 to 12h, a huge progress, but my goal was at least 24h before reaching the virtual memory limit (playing frantically), so I reduced the system's custom files from 625MB to 267MB, the result was a first virtual memory limit critical error appearing after 41h.   My client is H5, the only types of customs I added to the game were focused only on equipment, one of the main causes were these skins and cloaks, they consume a huge amount of MB's within the "system", the problem is not adding customs to the client, the problem is adapting a custom and adding it inside the system folder, the system folder was not created with the intention of storing a huge amount of files.   Adding customs to the system folder means significantly reducing the time your client can remain open before reaching the virtual ram limit and make no mistake, there are hundreds of different critical errors with a small summary of the cause of the error, but if the critical table shows 2047MB of RAM, the problem is only 1. Example: I can see 3, 5, 9 critical error with different messages, but if this table is showing 2047MB ram, the reason was the virtual memory limit, an important detail is that this 2047MB ram is not a "fixed message or information from your computer", this 2047MB only appear when the cause is the virtual ram limit, it means that when you get a critical error with random numbers of ram memory appearing, such as 358MB ram, 715MB ram, it means that the cause of this error has no connection with ram virtual memory.
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products  https://discord.gg/hoodservices https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...