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