New way to show NPC level and aggression.

Thanks to Edoo.
This commit is contained in:
MobiusDevelopment 2019-12-06 16:22:34 +00:00
parent 8af413c0b3
commit 3b5ce2f7fa
73 changed files with 753 additions and 211 deletions

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -0,0 +1,11 @@
# ---------------------------------------------------------------------------
# NPC Settings
# ---------------------------------------------------------------------------
# Show the level of monsters.
# Default: False
ShowNpcLevel = False
# Show aggression of monsters.
# Default: False
ShowNpcAggression = False

View File

@ -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);
}
}

View File

@ -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()

View File

@ -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);

View File

@ -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

View File

@ -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"));

View File

@ -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();

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}

View File

@ -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

View File

@ -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);

View File

@ -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))
{

View File

@ -170,7 +170,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
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);
}