Jump to content
  • 0

Code To Adapt To 340. Acis Pvp/enchant


Question

Posted

Hello, someone would have some code in order to adapt to 340. ACIS server?
I'm interested that after killing 100 players become the weapon +1.
After 1000 after killing players become the weapon +2
That is by way of example, excuse my English.

 

As it was in the Good vs Evil server.

3 answers to this question

Recommended Posts

  • 0
Posted (edited)

Create a switch which checks pvp count and add a method to enchant the equipped weapon.

Edited by SweeTs
  • 0
Posted

I found this code for frozen, someone help me adapt to acis 340 ?, have no idea that changes to the code to work properly in ACIS.

### Eclipse Workspace Patch 1.0
#P trunk2
Index: gameserver/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- gameserver/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java   (revision 1004)
+++ gameserver/head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
@@ -678,7 +678,8 @@
     private int heroConsecutiveKillCount = 0;
     private boolean isPVPHero = false;
     
-   
+   /** Pvp enchant System **/
+    private int rewardConsecutiveKillCount = 0;
    /** character away mode **/
    private boolean _awaying = false;
    private boolean _isAway = false;
@@ -6822,6 +6823,10 @@
        // Increase the kill count for a special hero aura
        heroConsecutiveKillCount++;
       
+       
+        // Increase item +1 enchant as a reward
+        rewardConsecutiveKillCount++;
+        
        // If heroConsecutiveKillCount == 30 give hero aura
        if(heroConsecutiveKillCount == Config.KILLS_TO_GET_WAR_LEGEND_AURA && Config.WAR_LEGEND_AURA)
        {
@@ -6830,6 +6835,85 @@
           
        }
        
+   //====================== Enchant PvP =============================   
+   //=========== Adaptacion y Modificacion CaiFacu ==================
+if (rewardConsecutiveKillCount >= Config.PVP_COUNT_TILL_ENCHANTMENT && Config.ENABLE_PVP_ENCHANTMENT)  
+                          {
+                          
+                             switch (Rnd.get(9))
+                             {
+                                   case 0:
+                                   {
+                                      /** Weapon **/     
+                                    final L2ItemInstance pvpwep = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
+                                 
+                                      if (pvpwep.getEnchantLevel() < Config.ENCHANT_WEAPON_MAX)
+                                      {
+                                      pvpwep.setEnchantLevel(pvpwep.getEnchantLevel() + 1);
+                                      sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND) + "has been enchanted by +1 due to your pvp kills");
+                                      rewardConsecutiveKillCount = 0;
+                                      break;
+                                      }
+                                   }
+                                   case 1:
+                                  {
+                                     /** Armor **/
+                                   final L2ItemInstance pvphead = getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD);
+                               if (pvphead.getEnchantLevel() < Config.ENCHANT_ARMOR_MAX)
+                                      {
+                                     pvphead.setEnchantLevel(pvphead.getEnchantLevel() + 1);
+                                     sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD) + "has been enchanted by +1 due to your pvp kills");
+                                     rewardConsecutiveKillCount = 0;
+                                     break;
+                                  }}
+                                   case 2:
+                                  {
+                                     /** Armor **/
+                                   final L2ItemInstance pvpgloves = getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
+                                   if (pvpgloves.getEnchantLevel() < Config.ENCHANT_ARMOR_MAX)
+                                      {
+                                     pvpgloves.setEnchantLevel(pvpgloves.getEnchantLevel() + 1);
+                                     sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES) + "has been enchanted by +1 due to your pvp kills");
+                                     rewardConsecutiveKillCount = 0;
+                                     break;
+                                  }}
+                                   case 3:
+                                  {
+                                     /** Armor **/
+                                   final L2ItemInstance pvpchest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
+                                   if (pvpchest.getEnchantLevel() < Config.ENCHANT_ARMOR_MAX)
+                                      {
+                                     pvpchest.setEnchantLevel(pvpchest.getEnchantLevel() + 1);
+                                     sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST) + "has been enchanted by +1 due to your pvp kills");
+                                     rewardConsecutiveKillCount = 0;
+                                     break;
+                                  }}
+                                   case 4:
+                                  {
+                                     /** Armor **/
+                                   final L2ItemInstance pvplegs = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS);
+                                   if (pvplegs.getEnchantLevel() < Config.ENCHANT_ARMOR_MAX)
+                                      {
+                                     pvplegs.setEnchantLevel(pvplegs.getEnchantLevel() + 1);
+                                     sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS) + "has been enchanted by +1 due to your pvp kills");
+                                     rewardConsecutiveKillCount = 0;
+                                     break;
+                                  }}
+                                   case 5:
+                                  {
+                                     /** Armor **/
+                                   final L2ItemInstance pvpfeet = getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET);
+                                if (pvpfeet.getEnchantLevel() < Config.ENCHANT_ARMOR_MAX)
+                                      {
+                                     pvpfeet.setEnchantLevel(pvpfeet.getEnchantLevel() + 1);
+                                     sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET) + "has been enchanted by +1 due to your pvp kills");
+                                     rewardConsecutiveKillCount = 0;
+                                     break;
+                                  }}
+                                   case 6:
+                                  {
+                                     /** Jewel **/
+                                   final L2ItemInstance pvpneck = getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK);
+                                   if (pvpneck.getEnchantLevel() < Config.ENCHANT_JEWELRY_MAX)
+                                      {
+                                     pvpneck.setEnchantLevel(pvpneck.getEnchantLevel() + 1);
+                                     sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK) + "has been enchanted by +1 due to your pvp kills");
+                                     rewardConsecutiveKillCount = 0;
+                                     break;
+                                  }}
+                                   case 7:
+                                  {
+                                     /** Jewel **/
+                                   final L2ItemInstance pvplf = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER);
+                                   if (pvplf.getEnchantLevel() < Config.ENCHANT_JEWELRY_MAX)
+                                      {
+                                     pvplf.setEnchantLevel(pvplf.getEnchantLevel() + 1);
+                                     sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER) + "has been enchanted by +1 due to your pvp kills");
+                                     rewardConsecutiveKillCount = 0;
+                                     break;
+                                  }}
+                                   case 8:
+                                  {
+                                     /** Jewel **/
+                                   final L2ItemInstance pvprf = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER);
+                               if (pvprf.getEnchantLevel() < Config.ENCHANT_JEWELRY_MAX)
+                                      {
+                                     pvprf.setEnchantLevel(pvprf.getEnchantLevel() + 1);
+                                     sendMessage("Your " + getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER) + "has been enchanted by +1 due to your pvp kills");
+                                     rewardConsecutiveKillCount = 0;
+                                     break;
+                                  }}
+                       } 
+                   }         }
+   //====================== Enchant PvP =============================   
+   //=========== Adaptacion y Modificacion CaiFacu ==================
       if(Config.PVPEXPSP_SYSTEM)
       {
Index: gameserver/head-src/com/l2jfrozen/Config.java
===================================================================
--- gameserver/head-src/com/l2jfrozen/Config.java   (revision 1004)
+++ gameserver/head-src/com/l2jfrozen/Config.java   (working copy)
@@ -2091,6 +2091,8 @@
    public static String PM_TEXT1;
    public static String PM_TEXT2;
    public static boolean NEW_PLAYER_EFFECT;
+   public static boolean ENABLE_PVP_ENCHANTMENT;
+   public static int PVP_COUNT_TILL_ENCHANTMENT;
    
 
    //============================================================
@@ -2113,7 +2115,9 @@
          PM_TEXT1  = frozenSettings.getProperty("PMText1", "Have Fun and Nice Stay on");
          PM_TEXT2  = frozenSettings.getProperty("PMText2", "Vote for us every 24h");
          NEW_PLAYER_EFFECT = Boolean.parseBoolean(frozenSettings.getProperty("NewPlayerEffect", "True"));
-
+         ENABLE_PVP_ENCHANTMENT = Boolean.parseBoolean(frozenSettings.getProperty("EnablePvpEnchantSystem", "False"));
+         PVP_COUNT_TILL_ENCHANTMENT = Integer.parseInt(frozenSettings.getProperty("PvpCountTillEnchanment", "20"));
+         
       }
       catch(Exception e)
       {
 
    //============================================================
    public static void loadL2JFrozenConfig()
@@ -2467,6 +2475,10 @@
          FARM2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("Farm2CustomMeesage", "You have been teleported to Farm Zone 2!");
          PVP1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP1CustomMeesage", "You have been teleported to PvP Zone 1!");
          PVP2_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("PvP2CustomMeesage", "You have been teleported to PvP Zone 2!");
+         
+         SKILL_GIVER_SKILL_ID = Integer.parseInt(L2JFrozenSettings.getProperty("SkillGiverSkillId", "1"));
+         SKILL_GIVER_SKILL_LEVEL = Integer.parseInt(L2JFrozenSettings.getProperty("SkillGiverSkillLevel", "1"));
+         SKILL_GIVER_ID = Integer.parseInt(L2JFrozenSettings.getProperty("SkillGiverItemId", "3470"));
       }
       catch(Exception e)
       {
Index: gameserver/config/frozen/frozen.properties
===================================================================
--- gameserver/config/frozen/frozen.properties   (revision 1004)
+++ gameserver/config/frozen/frozen.properties   (working copy)
@@ -21,4 +21,17 @@
 
 # New players get fireworks the first time they log in
 # Default: False
-NewPlayerEffect = False
\ No newline at end of file
+NewPlayerEffect = False
+
+#=================================#
+#=Elfocrash's Pvp Enchant System==#
+#=================================#
+#By enabling this then every X pvp
+#in a row the player will get randomly
+#a part of his armor,weapon or jewel that
+#is currently equiped automatically enchanted
+#To enable the system set True below
+EnablePvpEnchantSystem = True
+#Every how many kills you want the chars to be
+#awared with +1?
+PvpCountTillEnchanment = 20
\ No poner lineas nuevas al final del codigo
  • 0
Posted

That piece of code probably throw NPEs, because it doesn't check if you currently wear such piece of equipement (missing != null check). The switch can be shortcuted by 75% (3 cases instead of 9).

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.



  • Posts

    • Hello, I’m working on decrypting the Init packet that the server sends to the client during login. This packet is treated specially and contains the Blowfish keys used to encrypt and decrypt subsequent packets. Although it isn’t encrypted irreversibly and should be reversible, I haven’t succeeded yet. My goal is to extract the Blowfish key to decrypt certain client packets without disrupting the normal session flow. I can inject a DLL to sniff the packets, and with that I plan to develop a module that extends the client’s functionality. For example, after logging in, this module would capture all the data the client receives (character data, etc.). Additionally, it could listen for real-time server events, enabling integrations with Discord SDKs or other systems, thereby expanding Lineage 2’s capabilities. Init packet(0x00) LoginServer. Currently in the java Cores I checked there is no decode function for this package, only encript.
    • whats password from the archivie ?
    • All that shit are false positives of the vanganth cliext, sources are well and who sell it is a big scammer
    • Information Selling a premium Lineage 2 High Five (L2J) project with active development, available by subscription. Includes Git support and access to compiled or full source code. Ideal for serious server owners seeking stability and performance, uniqueness and well-done features.   General Project Specifications: JDK Version: 23 -> 24 Chronicle: HighFive Structure: Core & Datapack merged into a single project Database: MariaDB Database Driver: HicariCP GIT Website: gitlab.com   Features include (but are not limited to):   1. Tournament Single & Party (Check Youtube Video) 2. Faction (Check Youtube Video) 3. Event Engine (Check Youtube Video) 4. Sell Buff System (Check Youtube Video) 5. Start UP System (Check Youtube Video) 6. User Panel 7. Visual - Dress me System 8. Donate Store 9. Automatic Farm System (Check Youtube Video) 10. Captcha (Anti-BOT) (Check Youtube Video) 11. Auction (Check Youtube Video) 12. Vote (API) 13. Admin Real Time Balance (Check Youtube Video) 14. Achievements (Check Youtube Video) 15. Daily Mission (Check Youtube Video) 16. A.I. Bot (Check Youtube Video) 17. Rebirth 18. Daily Reward  19. Skill Tree - Ability System 20. Craft System 21. Twitch Automatic Reward (Check Youtube Video) 22. Quiz Game (Check Youtube Video) 23. Automatic Item Enchant (Check Youtube Video) 24. Secondary Auth Using Google Authenticator (Check Youtube Video) 25. Gm Shop - Gatekeeper - Scheme Buffer   How to get Access (Payment Subscription): To get Access you either pay monthly subscription to GIT for source or Compiled. Project is currently active and has at least 1-2 commit / day.  Clients in both Compiled & Source subscription can request features or any addon in already existing mods inside discord.   Price per Month (Source) in GIT: 250 Eur Price per Month (Compiled) in GIT: 100 Eur   Contact: To get Access or ask further information join discord  https://discord.gg/gKAsAhJNuq      
  • Topics

×
×
  • Create New...