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 sent you in discord i think already the link seen you asking in mobius forum  anyway here you go  https://www.mediafire.com/folder/6oh7l7hf34xr9/C1
    • Hello all.   I have some strange errors on server side and the right bar of Open Beta STORE is not showing anymore after changing server ip.   Errors: [11:34:12] TriggerParser: Exception: l2.gameserver.data.xml.parser.exception.InvalidAttributeValueException: Bypass trigger is calling "classMaster#tryShowIcon" action which is missing! l2.gameserver.data.xml.parser.exception.InvalidAttributeValueException: Bypass trigger is calling "classMaster#tryShowIcon" action which is missing! at l2.gameserver.data.xml.parser.TriggerParser.parseBypasses(Unknown Source) ~[server.jar:?] at l2.gameserver.data.xml.parser.TriggerParser.parseTrigger(Unknown Source) ~[server.jar:?] at l2.gameserver.data.xml.parser.TriggerParser.readData(Unknown Source) ~[server.jar:?] at l2.commons.data.xml.AbstractParser.parseDocument(Unknown Source) ~[server.jar:?] at l2.commons.data.xml.AbstractFileParser.parse(Unknown Source) [server.jar:?] at l2.commons.data.xml.AbstractParser.load(Unknown Source) [server.jar:?] at l2.gameserver.data.xml.Parsers.parseAll(Unknown Source) [server.jar:?] at l2.gameserver.GameServer.<init>(Unknown Source) [server.jar:?] at l2.gameserver.GameServer.main(Unknown Source) [server.jar:?]   java.lang.IllegalArgumentException: Couldn't find Config "closedBeta" in file "shop" at l2.commons.config.ConfigManager.getConfigValue(Unknown Source) ~[server.jar:?] at l2.commons.config.ConfigManager.getObjectValue(Unknown Source) ~[server.jar:?] at l2.ext.closedbeta.ClosedBeta.isBetaTester(ClosedBeta.java:32) ~[?:?] at l2.ext.closedbeta.ClosedBeta$OnEnterWorld.onEnterWorld(ClosedBeta.java:23) ~[?:?] at l2.gameserver.model.actor.listener.PlayerListenerList.onEnterWorld(Unknown Source) ~[server.jar:?] at l2.gameserver.network.l2.c2s.EnterWorld.runImpl(Unknown Source) [server.jar:?] at l2.gameserver.utils.ExecutionRecorder.wrapInPacketExecution(Unknown Source) [server.jar:?] at l2.gameserver.network.l2.c2s.L2GameClientPacket.run(Unknown Source) [server.jar:?] at l2.commons.net.nio.impl.MMOExecutableQueue.run(Unknown Source) [server.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?] at java.lang.Thread.run(Thread.java:840) [?:?] Caught at: l2.gameserver.network.l2.c2s.EnterWorld.runImpl(Unknown Source)   I am using lucera files, Ertheia version.   Any help would be gladly appreciated. Thank you.
    • u cant change anything in facebook without a password, so my tiktok case wasnt a hijack.
    • Exactly, if somebody hijacks ur sessions, then u wont see a new device in your "Devices List". And with that hijacked session you are able to change whatever you want unless you have 2FA enabled. And I believe changing a group owner doesn't trigger 2FA.
  • 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