Secret Experience

Secret Experience (https://secretexperience.net/)
-   [Lineage] Java Mods (https://secretexperience.net/lineage-java-mods/)
-   -   [L2JFree] PvP Color System. (https://secretexperience.net/lineage-java-mods/9765-pvp-color-system.html)

KaL 20-06-2009 02:36 AM

PvP Color System.
 
Segue os códigos Java para adicionar o PvP Color System no seu servidor :
Código:

Index: config/options.properties
===================================================================
--- config/options.properties    (revision 4339)
+++ config/options.properties    (working copy)
@@ -350,4 +350,33 @@
EnableJythonShell = False

# Interval in ms to check for deadlocks, 0 to disable
-DeadLockCheck =10000
\ No newline at end of file
+DeadLockCheck =10000
+
+# ---------------------------------------
+# Section: PvP Nick Color System
+# ---------------------------------------
+# Each Ammount will set The proper Color
+# Ex:  PvpAmmount1 = 10, when character reaches 10 pvps, will get Name Color correspondent to ColorForAmmount1 and Title Color correspondent to TitleForAmmount1
+# WAN: Colors Must Use RBG format
+PvPColorSystem = true
+
+# Pvp Ammounts
+PvpAmmount1 = 25
+PvpAmmount2 = 50
+PvpAmmount3 = 100
+PvpAmmount4 = 500
+PvpAmmount5 = 1000
+PvpAmmount6 = 2000
+PvpAmmount7 = 3000
+PvpAmmount8 = 4500
+PvpAmmount9 = 5500
+PvpAmmount10 = 7000
+
+# Name Colors
+ColorForAmmount1 = 99FF99
+ColorForAmmount2 = FFFF66
+ColorForAmmount3 = 66FFFF
+ColorForAmmount4 = 00FFFF
+ColorForAmmount5 = 0099FF
+ColorForAmmount6 = 99FF99
+ColorForAmmount7 = FFFF66
+ColorForAmmount8 = 66FFFF
+ColorForAmmount9 = 00FFFF
+ColorForAmmount10 = 0099FF
+
+# Title Colors
+TitleForAmmount1 = 99FF99
+TitleForAmmount2 = FFFF66
+TitleForAmmount3 = 66FFFF
+TitleForAmmount4 = 00FFFF
+TitleForAmmount5 = 0099FF
+TitleForAmmount6 = 99FF99
+TitleForAmmount7 = FFFF66
+TitleForAmmount8 = 66FFFF
+TitleForAmmount9 = 00FFFF
+TitleForAmmount10 = 0099FF
\ No newline at end of file
Index: src/main/java/com/l2jfree/Config.java
===================================================================
--- src/main/java/com/l2jfree/Config.java    (revision 4339)
+++ src/main/java/com/l2jfree/Config.java    (working copy)
@@ -1121,6 +1121,24 @@
    public static boolean            ONLY_GM_ITEMS_FREE;                            // Only GM buy items for free
    public static int                DEADLOCKCHECK_INTERVAL;

+    public static int            COLOR_FOR_AMMOUNT1;
+    public static int            COLOR_FOR_AMMOUNT2;
+    public static int            COLOR_FOR_AMMOUNT3;
+    public static int            COLOR_FOR_AMMOUNT4;
+    public static int            COLOR_FOR_AMMOUNT5;
+    public static int            COLOR_FOR_AMMOUNT6;
+    public static int            COLOR_FOR_AMMOUNT7;
+    public static int            COLOR_FOR_AMMOUNT8;
+    public static int            COLOR_FOR_AMMOUNT9;
+    public static int            COLOR_FOR_AMMOUNT10;
+    public static int            PVP_AMMOUNT1;
+    public static int            PVP_AMMOUNT2;
+    public static int            PVP_AMMOUNT3;
+    public static int            PVP_AMMOUNT4;
+    public static int            PVP_AMMOUNT5;
+    public static int            PVP_AMMOUNT6;
+    public static int            PVP_AMMOUNT7;
+    public static int            PVP_AMMOUNT8;
+    public static int            PVP_AMMOUNT9;
+    public static int            PVP_AMMOUNT10;
+    public static boolean        PVP_COLOR_SYSTEM;
+
+    public static int            TITLE_COLOR_FOR_AMMOUNT1;
+    public static int            TITLE_COLOR_FOR_AMMOUNT2;
+    public static int            TITLE_COLOR_FOR_AMMOUNT3;
+    public static int            TITLE_COLOR_FOR_AMMOUNT4;
+    public static int            TITLE_COLOR_FOR_AMMOUNT5;
+    public static int            TITLE_COLOR_FOR_AMMOUNT6;
+    public static int            TITLE_COLOR_FOR_AMMOUNT7;
+    public static int            TITLE_COLOR_FOR_AMMOUNT8;
+    public static int            TITLE_COLOR_FOR_AMMOUNT9;
+    public static int            TITLE_COLOR_FOR_AMMOUNT10;
+
    // ********************************************************************************
***********
    public static void loadOptionsConfig()
    {
@@ -1294,6 +1312,23 @@
            ALT_DEV_NO_SPAWNS = Boolean.parseBoolean(optionsSettings.getProperty("AltDevNoSpawns", "False"));
            ENABLE_JYTHON_SHELL = Boolean.parseBoolean(optionsSettings.getProperty("EnableJythonShell", "False"));
            DEADLOCKCHECK_INTERVAL = Integer.parseInt(optionsSettings.getProperty("DeadLockCheck", "10000"));
+            // ------ PVP Color System-----------
+            PVP_COLOR_SYSTEM = Boolean.parseBoolean(optionsSettings.getProperty("PvPColorSystem", "false"));
+            COLOR_FOR_AMMOUNT1 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount1", "00FF00"));
+            COLOR_FOR_AMMOUNT2 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount2", "00FF00"));
+            COLOR_FOR_AMMOUNT3 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount3", "00FF00"));
+            COLOR_FOR_AMMOUNT4 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount4", "00FF00"));
+            COLOR_FOR_AMMOUNT5 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount5", "00FF00"));
+            COLOR_FOR_AMMOUNT1 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount6", "00FF00"));
+            COLOR_FOR_AMMOUNT2 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount7", "00FF00"));
+            COLOR_FOR_AMMOUNT3 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount8", "00FF00"));
+            COLOR_FOR_AMMOUNT4 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount9", "00FF00"));
+            COLOR_FOR_AMMOUNT5 = Integer.decode("0x" + optionsSettings.getProperty("ColorForAmmount9", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT1 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount1", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT2 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount2", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT3 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount3", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT4 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount4", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT5 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount5", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT1 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount6", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT2 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount7", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT3 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount8", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT4 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount9", "00FF00"));
+            TITLE_COLOR_FOR_AMMOUNT5 = Integer.decode("0x" + optionsSettings.getProperty("TitleForAmmount10", "00FF00"));
+            PVP_AMMOUNT1 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount1", "25"));
+            PVP_AMMOUNT2 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount2", "50"));
+            PVP_AMMOUNT3 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount3", "100"));
+            PVP_AMMOUNT4 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount4", "500"));
+            PVP_AMMOUNT5 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount5", "100"));
+            PVP_AMMOUNT1 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount6", "2000"));
+            PVP_AMMOUNT2 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount7", "3000"));
+            PVP_AMMOUNT3 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount8", "4500"));
+            PVP_AMMOUNT4 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount9", "5500"));
+            PVP_AMMOUNT5 = Integer.parseInt(optionsSettings.getProperty("PvpAmmount10", "7000"));
        }
        catch (Exception e)
        {
Index: src/main/java/com/l2jfree/gameserver/network/clientpackets/EnterWorld.java
===================================================================
--- src/main/java/com/l2jfree/gameserver/network/clientpackets/EnterWorld.java    (revision 4339)
+++ src/main/java/com/l2jfree/gameserver/network/clientpackets/EnterWorld.java    (working copy)
@@ -44,6 +44,7 @@
import com.l2jfree.gameserver.model.L2Object;
import com.l2jfree.gameserver.model.L2ShortCut;
import com.l2jfree.gameserver.model.L2World;
+import com.l2jfree.gameserver.model.actor.appearance.PcAppearance;
import com.l2jfree.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfree.gameserver.model.entity.ClanHall;
import com.l2jfree.gameserver.model.entity.Couple;
@@ -186,6 +187,46 @@
                activeChar.getAppearance().setNameColor(Config.CHAR_VIP_COLOR);
        }

+        //Custom PVP Color System
+        if (!activeChar.isGM()) // skip gms.;)
+        {
+            int pvpAmmount = activeChar.getPvpKills();
+            PcAppearance charAppearance = activeChar.getAppearance();
+
+            if (Config.PVP_COLOR_SYSTEM)
+            {
+                //can't use a switch here , cause the ammount aren't constants and we cant convert to final in Config.
+                // since need to be parsed :S
+                if (pvpAmmount >= Config.PVP_AMMOUNT1 && pvpAmmount < Config.PVP_AMMOUNT2)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT1);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT1);
+                }
+                else if (pvpAmmount >= Config.PVP_AMMOUNT2 && pvpAmmount < Config.PVP_AMMOUNT3)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT2);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT2);
+                }
+                else if (pvpAmmount >= Config.PVP_AMMOUNT3 && pvpAmmount < Config.PVP_AMMOUNT4)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT3);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT3);
+                }
+
+                else if (pvpAmmount >= Config.PVP_AMMOUNT4 && pvpAmmount < Config.PVP_AMMOUNT5)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT4);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT4);
+                }
+                else if (pvpAmmount >= Config.PVP_AMMOUNT5 && pvpAmmount < Config.PVP_AMMOUNT6)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT5);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT5);
+                }
+                else if (pvpAmmount >= Config.PVP_AMMOUNT5 && pvpAmmount < Config.PVP_AMMOUNT7)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT6);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT6);
+                }
+                else if (pvpAmmount >= Config.PVP_AMMOUNT5 && pvpAmmount < Config.PVP_AMMOUNT8)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT7);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT7);
+                }
+                else if (pvpAmmount >= Config.PVP_AMMOUNT5 && pvpAmmount < Config.PVP_AMMOUNT9)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT8);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT8);
+                }
+                else if (pvpAmmount >= Config.PVP_AMMOUNT5 && pvpAmmount < Config.PVP_AMMOUNT10)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT9);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT9);
+                }
+                else if (pvpAmmount >= Config.PVP_AMMOUNT5 && pvpAmmount > Config.PVP_AMMOUNT9)
+                {
+                    charAppearance.setNameColor(Config.COLOR_FOR_AMMOUNT10);
+                    charAppearance.setTitleColor(Config.TITLE_COLOR_FOR_AMMOUNT10);
+                }
+            }
+        }
+        // Custom PVP Color System
+
        if (activeChar.getStatus().getCurrentHp() < 0.5) // is dead
            activeChar.setIsDead(true);

O código tem suporte para até 10 cores diferentes.
Funciona em L2jFree

Créditos : Equipe de Desenvolvimento da L2jFree

bertone 20-06-2009 08:34 AM

Sabe se esse codigo ja está inserido nas novas Rev's do JFree?

KaL 20-06-2009 02:48 PM

Não está não. Por isso eu coloquei pra que vocês mesmos inserissem

GLODOOM 22-06-2009 12:26 PM

Pode enssina a por ele?
e onde por?

KaL 22-06-2009 01:18 PM

Siga os prefixos :
Index : <- Arquivo onde será inserido o código
revision <- Não importa muita coisa...caso seja 0, você deverá criar tal arquivo
- <- Linha que deve ser apagada
+ <- Linha que deve ser adicionada
@@ mais ou menos onde se deve adicionar o código
Linhas que não possuem prefixo +/-, são apenas como referência, para saber onde adicionar as demais.
Para colocar tal código, você precisará descompilar o pack e depois recompilar o mesmo...

flavinhoda40@ho 16-07-2009 12:24 PM

ajuda
 
pow eu tbm não estou conseguindo.
minha rev. é do critiano .
ajauda ai por favor
brigadão:daydreaming:

Loki 16-07-2009 10:35 PM

mano para vc add isso ae na rev do cristiano vc tem que ter o source dele
no caso os arquivos .java
e caso nao tenha sem tem que descompilar os que vc tem em .java e depois recompilalos use o java decompiler
vou ver se eu tenho aqui se eu tiver eu coloco para download
abraços ae

italope 26-12-2010 01:45 PM

esse mod serve pra qual tipo de versao free j2010 teon? etc..


Horários baseados na GMT -3. Agora são 03:26 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0