Fixed NPC level and champion titles.

This commit is contained in:
MobiusDev
2015-05-09 15:46:25 +00:00
parent eed6caaad4
commit 50f5ab0751
5 changed files with 31 additions and 3 deletions

View File

@ -697,6 +697,7 @@ public final class Config
public static boolean L2JMOD_CHAMPION_PASSIVE;
public static int L2JMOD_CHAMPION_FREQUENCY;
public static String L2JMOD_CHAMP_TITLE;
public static boolean L2JMOD_SHOW_CHAMPION_AURA;
public static int L2JMOD_CHAMP_MIN_LVL;
public static int L2JMOD_CHAMP_MAX_LVL;
public static int L2JMOD_CHAMPION_HP;
@ -2220,6 +2221,7 @@ public final class Config
L2JMOD_CHAMPION_PASSIVE = CustomSettings.getBoolean("ChampionPassive", false);
L2JMOD_CHAMPION_FREQUENCY = CustomSettings.getInt("ChampionFrequency", 0);
L2JMOD_CHAMP_TITLE = CustomSettings.getString("ChampionTitle", "Champion");
L2JMOD_SHOW_CHAMPION_AURA = CustomSettings.getBoolean("ChampionAura", true);
L2JMOD_CHAMP_MIN_LVL = CustomSettings.getInt("ChampionMinLevel", 20);
L2JMOD_CHAMP_MAX_LVL = CustomSettings.getInt("ChampionMaxLevel", 60);
L2JMOD_CHAMPION_HP = CustomSettings.getInt("ChampionHp", 7);

View File

@ -41,6 +41,7 @@ import com.l2jserver.gameserver.datatables.EventDroplist.DateDrop;
import com.l2jserver.gameserver.datatables.ItemTable;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.enums.InstanceType;
import com.l2jserver.gameserver.enums.Team;
import com.l2jserver.gameserver.instancemanager.CursedWeaponsManager;
import com.l2jserver.gameserver.instancemanager.PcCafePointsManager;
import com.l2jserver.gameserver.instancemanager.WalkingManager;
@ -1707,6 +1708,10 @@ public class L2Attackable extends L2Npc
public void setChampion(boolean champ)
{
_champion = champ;
if (champ)
{
setTeam(Team.RED);
}
}
@Override

View File

@ -3140,6 +3140,19 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
*/
public final String getTitle()
{
if (isChampion())
{
return Config.L2JMOD_CHAMP_TITLE;
}
if (Config.SHOW_NPC_LVL && isMonster())
{
String t = "Lv " + getLevel();
if (_title != null)
{
t += " " + _title;
}
return t;
}
return _title != null ? _title : "";
}

View File

@ -67,7 +67,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
_masks[2] |= 0x10;
}
addComponentType(NpcInfoType.ATTACKABLE, NpcInfoType.UNKNOWN1, NpcInfoType.TITLE, NpcInfoType.ID, NpcInfoType.POSITION, NpcInfoType.ALIVE, NpcInfoType.RUNNING);
addComponentType(NpcInfoType.ATTACKABLE, NpcInfoType.UNKNOWN1, NpcInfoType.ID, NpcInfoType.POSITION, NpcInfoType.ALIVE, NpcInfoType.RUNNING);
if (npc.getHeading() > 0)
{
@ -89,7 +89,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
addComponentType(NpcInfoType.EQUIPPED);
}
if (npc.getTeam() != Team.NONE)
if ((npc.getTeam() != Team.NONE) || (Config.L2JMOD_SHOW_CHAMPION_AURA && npc.isChampion()))
{
addComponentType(NpcInfoType.TEAM);
}
@ -129,11 +129,16 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
addComponentType(NpcInfoType.CURRENT_MP);
}
if (npc.getTemplate().getDisplayId() != npc.getTemplate().getId())
if (npc.getTemplate().isUsingServerSideName())
{
addComponentType(NpcInfoType.NAME);
}
if (npc.getTemplate().isUsingServerSideTitle() || (Config.SHOW_NPC_LVL && npc.isMonster()) || npc.isChampion())
{
addComponentType(NpcInfoType.TITLE);
}
if (!_abnormalVisualEffects.isEmpty())
{
addComponentType(NpcInfoType.ABNORMALS);