Jump to content

Recommended Posts

Posted

I have Updated the PvP/Pk System to the courent version of L2J core (2771).

Credits goes to the real inventor of this system (as i know Vago), and to the L2J forums.

 

Here is the Patch :

 

Index: /java/config/l2jmods.properties

===================================================================

--- /java/config/l2jmods.properties (revision 2771)

+++ /java/config/l2jmods.properties (working copy)

@@ -161,4 +161,62 @@

#----------------------------------

EnableWarehouseSortingClan = False

EnableWarehouseSortingPrivate = False

-EnableWarehouseSortingFreight = False

\ No newline at end of file

+EnableWarehouseSortingFreight = False

+

+# ---------------------------------------

+# Section: PvP Title Color Change System by Level

+# ---------------------------------------

+# Each Amount will change the name color to the values defined here.

+# Example: PvpAmmount1 = 500, when a character's PvP counter reaches 500, their name color will change

+# according to the ColorForAmount value.

+# Note: Colors Must Use RBG format

+EnablePvPColorSystem = false

+

+# Pvp Amount & Name color level 1.

+PvpAmount1 = 500

+ColorForAmount1 = CCFF00

+

+# Pvp Amount & Name color level 2.

+PvpAmount2 = 1000

+ColorForAmount2 = 00FF00

+

+# Pvp Amount & Name color level 3.

+PvpAmount3 = 1500

+ColorForAmount3 = 00FF00

+

+# Pvp Amount & Name color level 4.

+PvpAmount4 = 2500

+ColorForAmount4 = 00FF00

+

+# Pvp Amount & Name color level 5.

+PvpAmount5 = 5000

+ColorForAmount5 = 00FF00

+

+# ---------------------------------------

+# Section: PK Title Color System by Level

+# ---------------------------------------

+# Same as above, with the difference that the PK counter changes the title color.

+# Example:  PkAmmount1 = 500, when a character's PK counter reaches 500, their title color will change

+# according to the Title For Amount

+# WAN: Colors Must Use RBG format

+EnablePkColorSystem = false

+

+# Pk Amount & Title color level 1.

+PkAmount1 = 500

+TitleForAmount1 = 00FF00

+

+# Pk Amount & Title color level 2.

+PkAmount2 = 1000

+TitleForAmount2 = 00FF00

+

+# Pk Amount & Title color level 3.

+PkAmount3 = 1500

+TitleForAmount3 = 00FF00

+

+# Pk Amount & Title color level 4.

+PkAmount4 = 2500

+TitleForAmount4 = 00FF00

+

+# Pk Amount & Title color level 5.

+PkAmount5 = 5000

+TitleForAmount5 = 00FF00

 

Index: /java/net/sf/l2j/Config.java

===================================================================

--- /java/net/sf/l2j/Config.java (revision 2771)

+++ /java/net/sf/l2j/Config.java (working copy)

@@ -564,6 +564,28 @@

     public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_CLAN;

     public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE;

     public static boolean L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT;

+ public static boolean PVP_COLOR_SYSTEM_ENABLED;

+ public static int PVP_AMOUNT1;

+    public static int PVP_AMOUNT2;

+    public static int PVP_AMOUNT3;

+    public static int PVP_AMOUNT4;

+    public static int PVP_AMOUNT5;

+    public static int NAME_COLOR_FOR_PVP_AMOUNT1;

+    public static int NAME_COLOR_FOR_PVP_AMOUNT2;

+    public static int NAME_COLOR_FOR_PVP_AMOUNT3;

+    public static int NAME_COLOR_FOR_PVP_AMOUNT4;

+    public static int NAME_COLOR_FOR_PVP_AMOUNT5;

+    public static boolean PK_COLOR_SYSTEM_ENABLED;

+    public static int PK_AMOUNT1;

+    public static int PK_AMOUNT2;

+    public static int PK_AMOUNT3;

+    public static int PK_AMOUNT4;

+    public static int PK_AMOUNT5;

+    public static int TITLE_COLOR_FOR_PK_AMOUNT1;

+    public static int TITLE_COLOR_FOR_PK_AMOUNT2;

+    public static int TITLE_COLOR_FOR_PK_AMOUNT3;

+    public static int TITLE_COLOR_FOR_PK_AMOUNT4;

+    public static int TITLE_COLOR_FOR_PK_AMOUNT5;

     

     /** ************************************************** **/

/** L2JMods Settings -End                              **/

@@ -1783,7 +1805,34 @@

                L2JMOD_ENABLE_WAREHOUSESORTING_CLAN     = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingClan", "False"));

                L2JMOD_ENABLE_WAREHOUSESORTING_PRIVATE  = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingPrivate", "False"));

                L2JMOD_ENABLE_WAREHOUSESORTING_FREIGHT  = Boolean.valueOf(L2JModSettings.getProperty("EnableWarehouseSortingFreight", "False"));

-

+     // PVP Name Color System configs - Start

+     PVP_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePvPColorSystem", "false"));

+     PVP_AMOUNT1 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount1", "500"));

+             PVP_AMOUNT2 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount2", "1000"));

+             PVP_AMOUNT3 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount3", "1500"));

+         PVP_AMOUNT4 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount4", "2500"));

+         PVP_AMOUNT5 = Integer.parseInt(L2JModSettings.getProperty("PvpAmount5", "5000"));

+             NAME_COLOR_FOR_PVP_AMOUNT1 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount1", "00FF00"));

+             NAME_COLOR_FOR_PVP_AMOUNT2 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount2", "00FF00"));

+             NAME_COLOR_FOR_PVP_AMOUNT3 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount3", "00FF00"));

+             NAME_COLOR_FOR_PVP_AMOUNT4 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount4", "00FF00"));

+             NAME_COLOR_FOR_PVP_AMOUNT5 = Integer.decode("0x" + L2JModSettings.getProperty("ColorForAmount4", "00FF00"));

+               // PvP Name Color System configs - End

+          

+             // PK Title Color System configs - Start

+             PK_COLOR_SYSTEM_ENABLED = Boolean.parseBoolean(L2JModSettings.getProperty("EnablePkColorSystem", "false"));

+       PK_AMOUNT1 = Integer.parseInt(L2JModSettings.getProperty("PkAmount1", "500"));

+           PK_AMOUNT2 = Integer.parseInt(L2JModSettings.getProperty("PkAmount2", "1000"));

+         PK_AMOUNT3 = Integer.parseInt(L2JModSettings.getProperty("PkAmount3", "1500"));

+             PK_AMOUNT4 = Integer.parseInt(L2JModSettings.getProperty("PkAmount4", "2500"));

+           PK_AMOUNT5 = Integer.parseInt(L2JModSettings.getProperty("PkAmount5", "5000"));

+           TITLE_COLOR_FOR_PK_AMOUNT1 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount1", "00FF00"));

+         TITLE_COLOR_FOR_PK_AMOUNT2 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount2", "00FF00"));

+           TITLE_COLOR_FOR_PK_AMOUNT3 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount3", "00FF00"));

+         TITLE_COLOR_FOR_PK_AMOUNT4 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount4", "00FF00"));

+           TITLE_COLOR_FOR_PK_AMOUNT5 = Integer.decode("0x" + L2JModSettings.getProperty("TitleForAmount5", "00FF00"));

+             //PK Title Color System configs - End

+                

                if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)

                {

                    TVT_EVENT_ENABLED = false;

Index: /java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java

===================================================================

--- /java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 2771)

+++ /java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)

@@ -226,7 +226,18 @@

         Quest.playerEnter(activeChar);

         activeChar.sendPacket(new QuestList());

         loadTutorial(activeChar);

+

         

+                // =================================================================================

+                // Color System checks - Start =====================================================

+                // Check if the custom PvP and PK color systems are enabled and if so ==============

+                // check the character's counters and apply any color changes that must be done. ===

+                if (activeChar.getPvpKills()>=(Config.PVP_AMOUNT1) && (Config.PVP_COLOR_SYSTEM_ENABLED)) activeChar.updatePvPColor(activeChar.getPvpKills());

+                if (activeChar.getPkKills()>=(Config.PK_AMOUNT1) && (Config.PK_COLOR_SYSTEM_ENABLED)) activeChar.updatePkColor(activeChar.getPkKills());

+                // Color System checks - End =======================================================

+                // =================================================================================

+         

+       

         if (Config.PLAYER_SPAWN_PROTECTION > 0)

             activeChar.setProtection(true);

 

Index: /java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

===================================================================

--- /java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 2771)

+++ /java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)

@@ -3915,7 +3915,75 @@

          DuelManager.getInstance().broadcastToOppositTeam(this, update);

         }

}

-   

+

+ // Custom PVP Color System - Start

+ public void updatePvPColor(int pvpKillAmount)

+ {

+ if (Config.PVP_COLOR_SYSTEM_ENABLED)

+ {

+ //Check if the character has GM access and if so, let them be.

+ if (isGM())

+ return;

+ {

+ if ((pvpKillAmount >= (Config.PVP_AMOUNT1)) && (pvpKillAmount < (Config.PVP_AMOUNT2)))

+ {

+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT1);

+ }

+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT2)) && (pvpKillAmount < (Config.PVP_AMOUNT3)))

+ {

+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT2);

+ }

+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT3)) && (pvpKillAmount < (Config.PVP_AMOUNT4)))

+ {

+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT3);

+ }

+ else if ((pvpKillAmount >= (Config.PVP_AMOUNT4)) && (pvpKillAmount < (Config.PVP_AMOUNT5)))

+ {

+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT4);

+ }

+ else if (pvpKillAmount >= (Config.PVP_AMOUNT5))

+ {

+ getAppearance().setNameColor(Config.NAME_COLOR_FOR_PVP_AMOUNT5);

+ }

+ }

+ }

+ }

+ //Custom PVP Color System - End

+

+ // Custom Pk Color System - Start

+ public void updatePkColor(int pkKillAmount)

+ {

+ if (Config.PK_COLOR_SYSTEM_ENABLED)

+ {

+ //Check if the character has GM access and if so, let them be, like above.

+ if (isGM())

+ return;

+ {

+ if ((pkKillAmount >= (Config.PK_AMOUNT1)) && (pkKillAmount < (Config.PVP_AMOUNT2)))

+ {

+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT1);

+ }

+ else if ((pkKillAmount >= (Config.PK_AMOUNT2)) && (pkKillAmount < (Config.PVP_AMOUNT3)))

+ {

+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT2);

+ }

+ else if ((pkKillAmount >= (Config.PK_AMOUNT3)) && (pkKillAmount < (Config.PVP_AMOUNT4)))

+ {

+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT3);

+ }

+ else if ((pkKillAmount >= (Config.PK_AMOUNT4)) && (pkKillAmount < (Config.PVP_AMOUNT5)))

+ {

+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT4);

+ }

+ else if (pkKillAmount >= (Config.PK_AMOUNT5))

+ {

+ getAppearance().setTitleColor(Config.TITLE_COLOR_FOR_PK_AMOUNT5);

+ }

+ }

+ }

+ }

+ //Custom Pk Color System - End

+    

     @Override

     public final void updateEffectIcons(boolean partyOnly)

     {

@@ -5265,7 +5333,11 @@

     {

         // Add karma to attacker and increase its PK counter

         setPvpKills(getPvpKills() + 1);

-

+           

+        //Update the character's name color if they reached any of the 5 PvP levels.

+        updatePvPColor(getPvpKills());

+        broadcastUserInfo();

+       

         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter

         sendPacket(new UserInfo(this));

     }

@@ -5317,6 +5389,11 @@

         setPkKills(getPkKills() + 1);

         setKarma(getKarma() + newKarma);

 

+               //Update the character's title color if they reached any of the 5 PK levels.

+               updatePkColor(getPkKills());

+               broadcastUserInfo();

+       

+       

         // Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter

         sendPacket(new UserInfo(this));

     }

 

 

Soon with more Shares ;)

Posted

Vago shared it and its ok everybody can insert it so the only thing you do is a diff patch(2sec work)and reshare alredy shared things its not an updated just c/p...ahhh...

Posted

It isnt just a c/p of Vago, cuz this has been discuted here =>

http://l2jserver.com/forum/thread.php?threadid=29406

 

Also, I Updated it to the lastes revision possible. Think before you write. Also, the credits is given, what you worry about ? If you dont like the topic, just dont reply. ;)

Posted

It isnt just a c/p of Vago, cuz this has been discuted here =>

http://l2jserver.com/forum/thread.php?threadid=29406

 

Also, I Updated it to the lastes revision possible. Think before you write. Also, the credits is given, what you worry about ? If you dont like the topic, just dont reply. ;)

 

man...update something to the latest revision lol...you need put the patch under the same thing but in other line so you insert the shared color system into a pack and you make a diff thats what you did:D

 

and i dont worry about credits you dont understand my comment:D

  • 4 weeks later...
  • 1 month later...
  • 2 weeks later...
Guest
This topic is now closed to further replies.


  • Posts

    • Where I can buy a cheap domain .com? cheapest I found was on Godaddy for 12 euro and Hostinger for 10 euro.
    • Hello everyone, here's a simple and useful idea for any type of server.   This code applies a discount when a player makes a purchase inside a clan’s castle or clan hall, offering a benefit to clan members who own a castle or clan hall. Important: Merchant transactions must be handled through multisell, not buylist. The discount is directly applied within the multisell, so the price shown is already reduced.   "For example, if a scroll costs 1000 Adena and you set a 20% discount in the config, the final price when purchasing inside a castle or clan hall will be 800 Adena."   This code is developed on the public aCis 401 revision.   public static int CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT; CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT = clans.getProperty("ClanBaseOwnershipMechantDiscount", 20); # If clan owns a clan hall or castle, all members have a discount of X% at merchant transactions (multisell). # Discount applies only inside the base (castle or clan hall). ClanBaseOwnershipMechantDiscount = 20   /** diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java index 556e111..bbf8e69 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/MultisellData.java @@ -101,7 +101,7 @@ do { // send list at least once even if size = 0 - player.sendPacket(new MultiSellList(list, index)); + player.sendPacket(new MultiSellList(list, index, player)); index += PAGE_SIZE; } while (index < list.getEntries().size()); diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java index 7c82c5b..1654abc 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/MultiSellChoose.java @@ -6,6 +6,7 @@ import net.sf.l2j.Config; import net.sf.l2j.gameserver.enums.FloodProtector; import net.sf.l2j.gameserver.enums.StatusType; +import net.sf.l2j.gameserver.enums.ZoneId; import net.sf.l2j.gameserver.enums.items.CrystalType; import net.sf.l2j.gameserver.model.Augmentation; import net.sf.l2j.gameserver.model.actor.Player; @@ -225,6 +226,20 @@ return; } + if (player.isInsideZone(ZoneId.CLAN_HALL) && player.getClan() != null && player.getClan().hasClanHall()) + { + e.setItemCount(e.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100); + if (e.getItemCount() == 0) + e.setItemCount(1); + } + + if (player.isInsideZone(ZoneId.CASTLE) && player.getClan() != null && player.getClan().hasCastle()) + { + e.setItemCount(e.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100); + if (e.getItemCount() == 0) + e.setItemCount(1); + } + if (Config.BLACKSMITH_USE_RECIPES || !e.getMaintainIngredient()) { // if it's a stackable item, just reduce the amount from the first (only) instance that is found in the inventory diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java index 9269b06..c6102a0 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/serverpackets/MultiSellList.java @@ -2,6 +2,9 @@ import static net.sf.l2j.gameserver.data.xml.MultisellData.PAGE_SIZE; +import net.sf.l2j.Config; +import net.sf.l2j.gameserver.enums.ZoneId; +import net.sf.l2j.gameserver.model.actor.Player; import net.sf.l2j.gameserver.model.multisell.Entry; import net.sf.l2j.gameserver.model.multisell.Ingredient; import net.sf.l2j.gameserver.model.multisell.ListContainer; @@ -15,7 +18,9 @@ private boolean _finished; - public MultiSellList(ListContainer list, int index) + private Player _player; + + public MultiSellList(ListContainer list, int index, Player player) { _list = list; _index = index; @@ -28,6 +33,8 @@ } else _finished = true; + + _player = player; } @Override @@ -74,7 +81,14 @@ { writeH(ing.getItemId()); writeH(ing.getTemplate() != null ? ing.getTemplate().getType2() : 65535); - writeD(ing.getItemCount()); + + if (_player.isInsideZone(ZoneId.CLAN_HALL) && _player.getClan() != null && _player.getClan().hasClanHall()) + writeD((ing.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100) < 1 ? 1 : ing.getItemCount() * 80 / 100); + else if (_player.isInsideZone(ZoneId.CASTLE) && _player.getClan() != null && _player.getClan().hasCastle()) + writeD((ing.getItemCount() * (100 - Config.CLAN_BASE_OWNERSHIP_MERCHANT_DISCOUNT) / 100) < 1 ? 1 : ing.getItemCount() * 80 / 100); + else + writeD(ing.getItemCount()); + writeH(ing.getEnchantLevel()); writeD(0x00); // TODO: i.getAugmentId() writeD(0x00); // TODO: i.getManaLeft()  
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
    • WTB EXP ETERNAL 10x new dm.
    • This project is based on the latest public aCis sources (revision 401) and supports a multi-client system (C4 & IL), making it suitable for custom usage but not for retail.   You can configure the SelectedClient option in server.properties and loginserver.properties to switch between C4 and IL.  Both clients are fully synchronized, including login, server selection, packets, and geodata.   Notable Features: - Completed the login and server selection phase for both clients. - Synchronized all packets to support both clients (including some specific features). - Reworked the datapack and SQL files (excluding HTML files) to work seamlessly with both clients. - Added geodata support for both clients. - Adapted nearly all AI, scripts, bosses, HTML, and MULTISELL files to match C4 functionality. - Reduced the maximum clan level from 8 to 5 (C4 feature). - Rewrote clan HTML to remove C5-C6 features.   Disabled the following C5 and C6 features: - Divine Inspiration (C6 feature). - Clan skills and clan reputation points (C5 feature). - Pledge class (C5 feature). - Hero skills (C5 feature). - Dueling system (C6 feature). - Augmentations (C6 feature). - Cursed weapons (C5-C6 feature).   General Improvements: - Performed a general HTML cleanup and optimized features based on the client version. - Added an option to display the remaining time of disabled skills. - Skill timestamps now update when using the skill list.   This flexibility allows you to create a unique progression system tailored to your needs. The price for the diff patch, which can be applied to aCis public sources, is €150. For inquiries, please contact me via PM or Discord (ID: @Luminous).
  • Topics

×
×
  • Create New...