diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/NPC.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/NPC.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java index f34923fec7..2f7a7371c0 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java @@ -610,6 +610,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2077,6 +2078,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0f158b41fa..319198724b 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/NPC.ini b/L2J_Mobius_2.5_Underground/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/NPC.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java index 118735b1be..ba30efc01a 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java @@ -617,6 +617,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2094,6 +2095,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0f158b41fa..319198724b 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/NPC.ini b/L2J_Mobius_3.0_Helios/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/NPC.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java index 751be00a35..65e22a7374 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java @@ -617,6 +617,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2107,6 +2108,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0de4b34460..cf61d78f06 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/NPC.ini b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/NPC.ini +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java index 3eca47e835..bbcb8816ea 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java @@ -604,6 +604,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2087,6 +2088,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0de4b34460..cf61d78f06 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/config/NPC.ini b/L2J_Mobius_5.0_Salvation/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/config/NPC.ini +++ b/L2J_Mobius_5.0_Salvation/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java index 4cdf6a04b4..084c7a1786 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java @@ -599,6 +599,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2089,6 +2090,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0de4b34460..cf61d78f06 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/config/NPC.ini b/L2J_Mobius_5.5_EtinasFate/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/config/NPC.ini +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java index 4cdf6a04b4..084c7a1786 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java @@ -599,6 +599,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2089,6 +2090,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0de4b34460..cf61d78f06 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/config/NPC.ini b/L2J_Mobius_6.0_Fafurion/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/config/NPC.ini +++ b/L2J_Mobius_6.0_Fafurion/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java index 420f284379..eeb3a365ae 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java @@ -600,6 +600,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2127,6 +2128,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0de4b34460..cf61d78f06 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/NPC.ini b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/NPC.ini +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java index 6a4b643254..17ccb43f44 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java @@ -599,6 +599,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2129,6 +2130,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java index 0d7859bf54..7248035313 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_C1_HarbingersOfWar/dist/config/npc.ini b/L2J_Mobius_C1_HarbingersOfWar/dist/config/npc.ini new file mode 100644 index 0000000000..7c3c2fb94a --- /dev/null +++ b/L2J_Mobius_C1_HarbingersOfWar/dist/config/npc.ini @@ -0,0 +1,11 @@ +# --------------------------------------------------------------------------- +# NPC Settings +# --------------------------------------------------------------------------- + +# Show the level of monsters. +# Default: False +ShowNpcLevel = False + +# Show aggression of monsters. +# Default: False +ShowNpcAggression = False diff --git a/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/Config.java b/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/Config.java index 395f88b791..194cc3af72 100644 --- a/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/Config.java @@ -40,6 +40,7 @@ public class Config private static final String RATES_CONFIG_FILE = "config/rates.ini"; private static final String KARMA_CONFIG_FILE = "config/karma.ini"; private static final String THREADPOOL_CONFIG_FILE = "config/threadpool.ini"; + private static final String NPC_CONFIG_FILE = "./config/npc.ini"; // Game public static String _ip; @@ -68,6 +69,9 @@ public class Config // ThreadPool public static int SCHEDULED_THREAD_POOL_COUNT; public static int INSTANT_THREAD_POOL_COUNT; + // Npc + public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static void load() { @@ -117,5 +121,11 @@ public class Config SCHEDULED_THREAD_POOL_COUNT = threadpoolSettings.getInt("ScheduledThreadPoolCount", 40); INSTANT_THREAD_POOL_COUNT = threadpoolSettings.getInt("InstantThreadPoolCount", 20); + + // Load NPC config file (if exists) + final PropertiesParser npcSettings = new PropertiesParser(NPC_CONFIG_FILE); + + SHOW_NPC_LVL = npcSettings.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = npcSettings.getBoolean("ShowNpcAggression", false); } } diff --git a/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java index dfd87a34ef..39474e9bc3 100644 --- a/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -119,7 +119,7 @@ public abstract class Creature extends WorldObject private boolean _2ndHit = false; private boolean _currentlyAttacking = false; private WorldObject _attackTarget; - protected String title; + protected String _title; public boolean knownsObject(WorldObject object) { @@ -703,12 +703,12 @@ public abstract class Creature extends WorldObject public String getTitle() { - return title; + return _title; } public void setTitle(String title) { - this.title = title; + this._title = title; } public int getRunSpeed() diff --git a/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index 5a41b60ac5..eb6b2c6f94 100644 --- a/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_C1_HarbingersOfWar/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -17,6 +17,8 @@ */ package org.l2jmobius.gameserver.network.serverpackets; +import org.l2jmobius.Config; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; import org.l2jmobius.gameserver.model.actor.instance.NpcInstance; import org.l2jmobius.gameserver.model.actor.instance.PetInstance; @@ -24,6 +26,7 @@ public class NpcInfo extends ServerBasePacket { private NpcInstance _cha; private PetInstance _chaPet; + protected String _title = ""; public NpcInfo(NpcInstance cha) { @@ -100,7 +103,37 @@ public class NpcInfo extends ServerBasePacket } writeC(0); writeS(_cha.getName()); - writeS(_cha.getTitle()); + + _title = _cha.getTitle(); + // Custom level titles + if (_cha.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + _cha.getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + if (((MonsterInstance) _cha).isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + _title = t1; + } + + writeS(_title); writeD(0); writeD(0); writeD(0); diff --git a/L2J_Mobius_C6_Interlude/dist/game/config/main/General.ini b/L2J_Mobius_C6_Interlude/dist/game/config/main/General.ini index e1828d602f..d19a0e37a6 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/config/main/General.ini +++ b/L2J_Mobius_C6_Interlude/dist/game/config/main/General.ini @@ -582,9 +582,14 @@ MinMonsterAnimation = 5 # Default: 60 MaxMonsterAnimation = 60 -# Show the lvl and type of aggro mobs? +# Show the level of monsters. +# Default: false ShowNpcLevel = False +# Show aggression of monsters. +# Default: false +ShowNpcAggression = False + # Record the location of the characters in the file before the off / restarting the server? ActivatePositionRecorder = False diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java index ec397f59a6..56a3f475c4 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java @@ -186,6 +186,7 @@ public class Config public static int LINKED_NODE_ID; public static String NEW_NODE_TYPE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static int ZONE_TOWN; public static boolean COUNT_PACKETS = false; public static boolean DUMP_PACKET_COUNTS = false; @@ -1687,6 +1688,7 @@ public class Config MAX_MONSTER_ANIMATION = Integer.parseInt(generalSettings.getProperty("MaxMonsterAnimation", "60")); SHOW_NPC_LVL = Boolean.valueOf(generalSettings.getProperty("ShowNpcLevel", "false")); + SHOW_NPC_AGGRESSION = Boolean.valueOf(generalSettings.getProperty("ShowNpcAggression", "false")); FORCE_INVENTORY_UPDATE = Boolean.valueOf(generalSettings.getProperty("ForceInventoryUpdate", "false")); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index d1f7ce4d07..1b41ef2090 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -96,15 +96,33 @@ public class NpcInfo extends GameServerPacket _title = cha.getTitle(); } - if (Config.SHOW_NPC_LVL && (_creature instanceof MonsterInstance)) + // Custom level titles + if (cha.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) { - String t = "Lv " + cha.getLevel() + (cha.getAggroRange() > 0 ? "*" : ""); - if (_title != null) + String t1 = ""; + if (Config.SHOW_NPC_LVL) { - t += " " + _title; + t1 += "Lv " + cha.getLevel(); } - - _title = t; + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) cha; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + _title = cha.isChampion() ? Config.L2JMOD_CHAMP_TITLE + " " + t1 : t1; } _x = _creature.getX(); diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/NPC.ini b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/NPC.ini index bf8cb8b4cd..f490a02c66 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/NPC.ini +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/NPC.ini @@ -39,9 +39,12 @@ MaxAggroRange = 450 # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java index 4bc51c599a..845966f54b 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java @@ -709,6 +709,7 @@ public class Config public static int MAX_AGGRO_RANGE; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2220,6 +2221,7 @@ public class Config MAX_AGGRO_RANGE = NPC.getInt("MaxAggroRange", 450); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/AbstractNpcInfo.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/AbstractNpcInfo.java index c3a1470562..01286225ed 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/AbstractNpcInfo.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/network/serverpackets/AbstractNpcInfo.java @@ -25,6 +25,7 @@ import org.l2jmobius.gameserver.model.PlayerCondOverride; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Summon; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; import org.l2jmobius.gameserver.model.actor.instance.TrapInstance; import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; @@ -179,10 +180,6 @@ public abstract class AbstractNpcInfo implements IClientOutgoingPacket { _title = "Invisible"; } - else if (Config.CHAMPION_ENABLE && _npc.isChampion()) - { - _title = (Config.CHAMP_TITLE); // On every subclass - } else if (_localisation == null) { if (_npc.getTemplate().isUsingServerSideTitle()) @@ -194,14 +191,41 @@ public abstract class AbstractNpcInfo implements IClientOutgoingPacket _title = _npc.getTitle(); // On every subclass } } - if (Config.SHOW_NPC_LVL && _npc.isMonster()) + // Custom level titles + if (_npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) { - String t = "Lv " + _npc.getLevel() + (_npc.isAggressive() ? "*" : ""); - if (_title != null) + String t1 = ""; + if (Config.SHOW_NPC_LVL) { - t += " " + _title; + t1 += "Lv " + _npc.getLevel(); } - _title = t; + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) _npc; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + _title = _npc.isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } + else if (Config.CHAMPION_ENABLE && _npc.isChampion()) + { + _title = (Config.CHAMP_TITLE); // On every subclass } packet.writeS(_title); packet.writeD(0x00); // Title color 0=client default diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/NPC.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/NPC.ini index bf8cb8b4cd..f490a02c66 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/NPC.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/NPC.ini @@ -39,9 +39,12 @@ MaxAggroRange = 450 # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java index 0d67bb66a5..d5f614bac3 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java @@ -714,6 +714,7 @@ public class Config public static int MAX_AGGRO_RANGE; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2226,6 +2227,7 @@ public class Config MAX_AGGRO_RANGE = NPC.getInt("MaxAggroRange", 450); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/AbstractNpcInfo.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/AbstractNpcInfo.java index d1bd83c892..cc28644b04 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/AbstractNpcInfo.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/network/serverpackets/AbstractNpcInfo.java @@ -25,6 +25,7 @@ import org.l2jmobius.gameserver.model.PlayerCondOverride; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Npc; import org.l2jmobius.gameserver.model.actor.Summon; +import org.l2jmobius.gameserver.model.actor.instance.MonsterInstance; import org.l2jmobius.gameserver.model.actor.instance.TrapInstance; import org.l2jmobius.gameserver.model.clan.Clan; import org.l2jmobius.gameserver.model.skills.AbnormalVisualEffect; @@ -181,10 +182,6 @@ public abstract class AbstractNpcInfo implements IClientOutgoingPacket { _title = "Invisible"; } - else if (Config.CHAMPION_ENABLE && _npc.isChampion()) - { - _title = (Config.CHAMP_TITLE); // On every subclass - } else if (_localisation == null) { if (_npc.getTemplate().isUsingServerSideTitle()) @@ -196,14 +193,41 @@ public abstract class AbstractNpcInfo implements IClientOutgoingPacket _title = _npc.getTitle(); // On every subclass } } - if (Config.SHOW_NPC_LVL && _npc.isMonster()) + // Custom level titles + if (_npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) { - String t = "Lv " + _npc.getLevel() + (_npc.isAggressive() ? "*" : ""); - if (_title != null) + String t1 = ""; + if (Config.SHOW_NPC_LVL) { - t += " " + _title; + t1 += "Lv " + _npc.getLevel(); } - _title = t; + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) _npc; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + _title = _npc.isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } + else if (Config.CHAMPION_ENABLE && _npc.isChampion()) + { + _title = (Config.CHAMP_TITLE); // On every subclass } packet.writeS(_title); packet.writeD(0x00); // Title color 0=client default diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/NPC.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/NPC.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java index 4dac85b9d2..361a1329c8 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java @@ -609,6 +609,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2000,6 +2001,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java index a37e41550d..bcd21ecb51 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2215,21 +2215,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/NPC.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/NPC.ini +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java index 82f6effa13..f48ab8b1f6 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java @@ -609,6 +609,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2004,6 +2005,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java index a37e41550d..bcd21ecb51 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2215,21 +2215,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/NPC.ini b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/NPC.ini +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java index 82f6effa13..f48ab8b1f6 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java @@ -609,6 +609,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2004,6 +2005,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java index a37e41550d..bcd21ecb51 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2215,21 +2215,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/NPC.ini b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/NPC.ini +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java index 82f6effa13..f48ab8b1f6 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java @@ -609,6 +609,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2004,6 +2005,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java index 33b05e7ee5..f3c9590519 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/NPC.ini b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/NPC.ini +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java index 8151eabad9..47495f6d38 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java @@ -609,6 +609,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2012,6 +2013,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java index 33b05e7ee5..f3c9590519 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/NPC.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/NPC.ini +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java index cbd8aa4114..4fb67895aa 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java @@ -608,6 +608,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2010,6 +2011,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java index 25d7dcb916..50d543ab6e 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2216,21 +2216,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); } diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/NPC.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/NPC.ini index 1cd8da1e75..b2421e94d2 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/config/NPC.ini +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/NPC.ini @@ -33,9 +33,12 @@ AltGameViewNpc = False # Default: 300 MaxDriftRange = 300 -# Default: False +# Default: False ShowNpcLevel = False +# Default: False +ShowNpcAggression = False + # Show clan, alliance crests for territory NPCs without quests # Default: False ShowCrestWithoutQuest = False diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java index b1d33ea6d7..1f5ee115bb 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java @@ -611,6 +611,7 @@ public class Config public static boolean ALT_GAME_VIEWNPC; public static int MAX_DRIFT_RANGE; public static boolean SHOW_NPC_LVL; + public static boolean SHOW_NPC_AGGRESSION; public static boolean SHOW_CREST_WITHOUT_QUEST; public static boolean ENABLE_RANDOM_ENCHANT_EFFECT; public static int MIN_NPC_LVL_DMG_PENALTY; @@ -2012,6 +2013,7 @@ public class Config ALT_GAME_VIEWNPC = NPC.getBoolean("AltGameViewNpc", false); MAX_DRIFT_RANGE = NPC.getInt("MaxDriftRange", 300); SHOW_NPC_LVL = NPC.getBoolean("ShowNpcLevel", false); + SHOW_NPC_AGGRESSION = NPC.getBoolean("ShowNpcAggression", false); SHOW_CREST_WITHOUT_QUEST = NPC.getBoolean("ShowCrestWithoutQuest", false); ENABLE_RANDOM_ENCHANT_EFFECT = NPC.getBoolean("EnableRandomEnchantEffect", false); MIN_NPC_LVL_DMG_PENALTY = NPC.getInt("MinNPCLevelForDmgPenalty", 78); diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index a37e41550d..bcd21ecb51 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -2215,21 +2215,43 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe */ public String getTitle() { + // Custom level titles + if (isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) + { + String t1 = ""; + if (Config.SHOW_NPC_LVL) + { + t1 += "Lv " + getLevel(); + } + String t2 = ""; + if (Config.SHOW_NPC_AGGRESSION) + { + if (!t1.isEmpty()) + { + t2 += " "; + } + final MonsterInstance monster = (MonsterInstance) this; + if (monster.isAggressive()) + { + t2 += "[A]"; // Aggressive. + } + if ((monster.getTemplate().getClans() != null) && (monster.getTemplate().getClanHelpRange() > 0)) + { + t2 += "[G]"; // Group. + } + } + t1 += t2; + if ((_title != null) && !_title.isEmpty()) + { + t1 += " " + _title; + } + return isChampion() ? Config.CHAMP_TITLE + " " + t1 : t1; + } // Champion titles if (isChampion()) { return Config.CHAMP_TITLE; } - // Custom level titles - if (Config.SHOW_NPC_LVL && isMonster()) - { - String t = "Lv " + getLevel() + (((MonsterInstance) this).isAggressive() ? "*" : ""); - if (_title != null) - { - t += " " + _title; - } - return t; - } // Set trap title if (isTrap() && (((TrapInstance) this).getOwner() != null)) { diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index eb77b0fd17..80c04bbe08 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket addComponentType(NpcInfoType.NAME); } - if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion() || npc.isTrap()) + if (npc.getTemplate().isUsingServerSideTitle() || (npc.isMonster() && (Config.SHOW_NPC_LVL || Config.SHOW_NPC_AGGRESSION)) || npc.isChampion() || npc.isTrap()) { addComponentType(NpcInfoType.TITLE); }