New way to show NPC level and aggression.
Thanks to Edoo.
This commit is contained in:
@ -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);
|
||||
|
@ -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))
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user