Noticias:

Debes de estar registrado para poder ver el contenido indicado. Registrate o Conectate

Menú Principal

Color del nombre para Nobles

Iniciado por Swarlog, Ago 12, 2022, 02:23 AM

Tema anterior - Siguiente tema

Swarlog

Aquí os dejo este código creado por Ventic para que cuando un pj sea noble, su nombre tendra el color que nosotros le especifquemos en la configuración de nuestro servidor. Espero que les guste!

CitarL2J-Server

    Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 4088)
    +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
    @@ -8223,6 +8223,9 @@
        public void setNoble(boolean val)
        {
    +       if (val)
    +       getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
    +       
           if (val)
              for (L2Skill s : NobleSkillTable.getInstance().GetNobleSkills())
                 addSkill(s, false); //Dont Save Noble skills to Sql
           else
    Index: java/net/sf/l2j/Config.java
    ===================================================================
    --- java/net/sf/l2j/Config.java   (revision 4088)
    +++ java/net/sf/l2j/Config.java   (working copy)
    @@ -881,6 +881,9 @@
        public static boolean L2JMOD_WEDDING_SAMESEX;
        public static boolean L2JMOD_WEDDING_FORMALWEAR;
        public static int L2JMOD_WEDDING_DIVORCE_COSTS;
    +   
    +    public static boolean ENABLE_NOBLESS_COLOR;
    +    public static int NOBLESS_COLOR_NAME;
     
        // Packet information
        /** Count the a-beep-t of packets per minute ? */
    @@ -1858,6 +1861,9 @@
       public static String PVP1_CUSTOM_MESSAGE;
       public static String PVP2_CUSTOM_MESSAGE;
       public static boolean ENABLE_NOBLESS_COLOR;
            public static int NOBLESS_COLOR_NAME;
     
                    if (TVT_EVENT_PARTICIPATION_NPC_ID == 0)
                    {
    Index: java/config/l2jmods.properties
    ===================================================================
    --- java/config/l2jmods.properties   (revision 4088)
    +++ java/config/l2jmods.properties   (working copy)
    @@ -132,3 +132,13 @@
     # ex.: 1;2;3;4;5;6
     # no ";" at the start or end
     TvTEventDoorsCloseOpenOnStartEnd =
    +
    +#---------------------------------------------------------------
    +# Nobless Color Name                                              -
    +#---------------------------------------------------------------
    +# Enable Nobless Color Name?
    +# Deafult: False
    +EnableNoblessColor = False
    +
    +# Set Nobless Color
    +NoblessColorName = 000000
    Index: java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java   (revision 4088)
    +++ java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java   (working copy)
    @@ -174,6 +174,15 @@
                engage(activeChar);
                notifyPartner(activeChar,activeChar.getPartnerId());
            }
    +       
    +        if (Config.ENABLE_NOBLESS_COLOR)
    +        {
    +           if (activeChar.isNoble())
    +           {
    +               activeChar.getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
    +           }
    +        }
    +       
     
            if (activeChar.getAllEffects() != null)
            {

CitarL2J-Frozen

    Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (revision 4088)
    +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java   (working copy)
    @@ +14337 +14338 @@
       public void setNoble(boolean val)
       {
    +      if (val)
    +      getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
          if (val)
          {
             for(L2Skill s : NobleSkillTable.getInstance().GetNobleSkills())
             {
                addSkill(s, false); //Dont Save Noble skills to Sql
    Index: java/net/sf/l2j/Config.java
    ===================================================================
    --- java/net/sf/l2j/Config.java   (revision 4088)
    +++ java/net/sf/l2j/Config.java   (working copy)
    @@ +2381 +2382 @@
       public static String FARM1_CUSTOM_MESSAGE;
       public static String FARM2_CUSTOM_MESSAGE;
       public static String PVP1_CUSTOM_MESSAGE;
       public static String PVP2_CUSTOM_MESSAGE;
    +   public static boolean ENABLE_NOBLESS_COLOR;
    +    public static int NOBLESS_COLOR_NAME;
     
        // Packet information
        /** Count the a-beep-t of packets per minute ? */
    @@ +2502 +2503 @@
             FARM1_CUSTOM_MESSAGE = L2JFrozenSettings.getProperty("Farm1CustomMeesage", "You have been teleported to Farm Zone 1!");
             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!");
    +            ENABLE_NOBLESS_COLOR = Boolean.parseBoolean(L2JFrozenSettings.getProperty("EnableNoblessColor", "False"));
    +            NOBLESS_COLOR_NAME = Integer.decode("0x" + L2JFrozenSettings.getProperty("NoblessColorName", "000000"));
          }
          catch(Exception e)
    Index: java/config/l2jfrozen.properties
    ===================================================================
    --- java/config/l2jfrozen.properties   (revision 4088)
    +++ java/config/l2jfrozen.properties   (working copy)
    @@ +286 +284 @@
    ProtectorSkillLevel = 13
    ProtectorSkillTime = 600
    # Npc Protector Message
    ProtectorMessage = Hey You!, Never Kill On This Area, Go Read The Rules!
    +
    +#---------------------------------------------------------------
    +# Nobless Color Name                                              -
    +#---------------------------------------------------------------
    +# Enable Nobless Color Name?
    +# Deafult: False
    +EnableNoblessColor = False
    +
    +# Set Nobless Color
    +NoblessColorName = 000000
    Index: java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java   (revision 4088)
    +++ java/net/sf/l2j/gameserver/clientpackets/EnterWorld.java   (working copy)
    @@ +194 +202 @@
          final L2Effect[] effects = activeChar.getAllEffects();
    +     
    +        if (Config.ENABLE_NOBLESS_COLOR)
    +        {
    +          if (activeChar.isNoble())
    +          {
    +              activeChar.getAppearance().setNameColor(Config.NOBLESS_COLOR_NAME);
    +          }
    +        }
    +   
          if (effects != null)
          {
             for (L2Effect e : effects)
            {