TeleporterQuestRecommendationHolder support for more than one conditions.

This commit is contained in:
MobiusDevelopment
2019-04-11 21:23:38 +00:00
parent de2d8b316e
commit a96e5e99f3
22 changed files with 169 additions and 141 deletions

View File

@@ -54,8 +54,8 @@ public final class TeleporterInstance extends Npc
// static // static
// { // {
// QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // QUEST_RECOMENDATIONS.put(30848, new ArrayList<>());
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{-1}, "30848-Q561-Q562"));
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-561-562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{-1}, "30848-561-562"));
// } // }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -177,16 +177,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -54,8 +54,8 @@ public final class TeleporterInstance extends Npc
// static // static
// { // {
// QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // QUEST_RECOMENDATIONS.put(30848, new ArrayList<>());
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{-1}, "30848-Q561-Q562"));
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-561-562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{-1}, "30848-561-562"));
// } // }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -177,16 +177,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -54,8 +54,8 @@ public final class TeleporterInstance extends Npc
// static // static
// { // {
// QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // QUEST_RECOMENDATIONS.put(30848, new ArrayList<>());
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{-1}, "30848-Q561-Q562"));
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-561-562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{-1}, "30848-561-562"));
// } // }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -177,16 +177,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -54,8 +54,8 @@ public final class TeleporterInstance extends Npc
// static // static
// { // {
// QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // QUEST_RECOMENDATIONS.put(30848, new ArrayList<>());
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{-1}, "30848-Q561-Q562"));
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-561-562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{-1}, "30848-561-562"));
// } // }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -177,16 +177,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -54,15 +54,17 @@ public final class TeleporterInstance extends Npc
private static final Map<Integer, List<TeleporterQuestRecommendationHolder>> QUEST_RECOMENDATIONS = new HashMap<>(); private static final Map<Integer, List<TeleporterQuestRecommendationHolder>> QUEST_RECOMENDATIONS = new HashMap<>();
static static
{ {
// @formatter:off
QUEST_RECOMENDATIONS.put(30006, new ArrayList<>()); // Gatekeeper Milia QUEST_RECOMENDATIONS.put(30006, new ArrayList<>()); // Gatekeeper Milia
QUEST_RECOMENDATIONS.get(30006).add(new TeleporterQuestRecommendationHolder(30006, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30006-Q561")); QUEST_RECOMENDATIONS.get(30006).add(new TeleporterQuestRecommendationHolder(30006, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{3}, "30006-Q561"));
QUEST_RECOMENDATIONS.put(30134, new ArrayList<>()); // Dark Elf Village Teleport Device QUEST_RECOMENDATIONS.put(30134, new ArrayList<>()); // Dark Elf Village Teleport Device
QUEST_RECOMENDATIONS.get(30134).add(new TeleporterQuestRecommendationHolder(30134, "Q00562_BasicMissionAltarOfEvil", -1, "30134-Q562")); QUEST_RECOMENDATIONS.get(30134).add(new TeleporterQuestRecommendationHolder(30134, "Q00562_BasicMissionAltarOfEvil", new int[]{4}, "30134-Q562"));
QUEST_RECOMENDATIONS.put(30256, new ArrayList<>()); // Gatekeeper Bella QUEST_RECOMENDATIONS.put(30256, new ArrayList<>()); // Gatekeeper Bella
QUEST_RECOMENDATIONS.get(30256).add(new TeleporterQuestRecommendationHolder(30256, "Q00562_BasicMissionAltarOfEvil", -1, "30256-Q562")); QUEST_RECOMENDATIONS.get(30256).add(new TeleporterQuestRecommendationHolder(30256, "Q00562_BasicMissionAltarOfEvil", new int[]{3}, "30256-Q562"));
QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // Gatekeeper Elisa QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // Gatekeeper Elisa
QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{2,4}, "30848-Q561-Q562"));
QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-Q561-Q562")); QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{2,4}, "30848-Q561-Q562"));
// @formatter:on
} }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -184,16 +186,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -54,15 +54,17 @@ public final class TeleporterInstance extends Npc
private static final Map<Integer, List<TeleporterQuestRecommendationHolder>> QUEST_RECOMENDATIONS = new HashMap<>(); private static final Map<Integer, List<TeleporterQuestRecommendationHolder>> QUEST_RECOMENDATIONS = new HashMap<>();
static static
{ {
// @formatter:off
QUEST_RECOMENDATIONS.put(30006, new ArrayList<>()); // Gatekeeper Milia QUEST_RECOMENDATIONS.put(30006, new ArrayList<>()); // Gatekeeper Milia
QUEST_RECOMENDATIONS.get(30006).add(new TeleporterQuestRecommendationHolder(30006, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30006-Q561")); QUEST_RECOMENDATIONS.get(30006).add(new TeleporterQuestRecommendationHolder(30006, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{3}, "30006-Q561"));
QUEST_RECOMENDATIONS.put(30134, new ArrayList<>()); // Dark Elf Village Teleport Device QUEST_RECOMENDATIONS.put(30134, new ArrayList<>()); // Dark Elf Village Teleport Device
QUEST_RECOMENDATIONS.get(30134).add(new TeleporterQuestRecommendationHolder(30134, "Q00562_BasicMissionAltarOfEvil", -1, "30134-Q562")); QUEST_RECOMENDATIONS.get(30134).add(new TeleporterQuestRecommendationHolder(30134, "Q00562_BasicMissionAltarOfEvil", new int[]{4}, "30134-Q562"));
QUEST_RECOMENDATIONS.put(30256, new ArrayList<>()); // Gatekeeper Bella QUEST_RECOMENDATIONS.put(30256, new ArrayList<>()); // Gatekeeper Bella
QUEST_RECOMENDATIONS.get(30256).add(new TeleporterQuestRecommendationHolder(30256, "Q00562_BasicMissionAltarOfEvil", -1, "30256-Q562")); QUEST_RECOMENDATIONS.get(30256).add(new TeleporterQuestRecommendationHolder(30256, "Q00562_BasicMissionAltarOfEvil", new int[]{3}, "30256-Q562"));
QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // Gatekeeper Elisa QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // Gatekeeper Elisa
QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{2,4}, "30848-Q561-Q562"));
QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-Q561-Q562")); QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{2,4}, "30848-Q561-Q562"));
// @formatter:on
} }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -184,16 +186,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -54,15 +54,17 @@ public final class TeleporterInstance extends Npc
private static final Map<Integer, List<TeleporterQuestRecommendationHolder>> QUEST_RECOMENDATIONS = new HashMap<>(); private static final Map<Integer, List<TeleporterQuestRecommendationHolder>> QUEST_RECOMENDATIONS = new HashMap<>();
static static
{ {
// @formatter:off
QUEST_RECOMENDATIONS.put(30006, new ArrayList<>()); // Gatekeeper Milia QUEST_RECOMENDATIONS.put(30006, new ArrayList<>()); // Gatekeeper Milia
QUEST_RECOMENDATIONS.get(30006).add(new TeleporterQuestRecommendationHolder(30006, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30006-Q561")); QUEST_RECOMENDATIONS.get(30006).add(new TeleporterQuestRecommendationHolder(30006, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{3}, "30006-Q561"));
QUEST_RECOMENDATIONS.put(30134, new ArrayList<>()); // Dark Elf Village Teleport Device QUEST_RECOMENDATIONS.put(30134, new ArrayList<>()); // Dark Elf Village Teleport Device
QUEST_RECOMENDATIONS.get(30134).add(new TeleporterQuestRecommendationHolder(30134, "Q00562_BasicMissionAltarOfEvil", -1, "30134-Q562")); QUEST_RECOMENDATIONS.get(30134).add(new TeleporterQuestRecommendationHolder(30134, "Q00562_BasicMissionAltarOfEvil", new int[]{4}, "30134-Q562"));
QUEST_RECOMENDATIONS.put(30256, new ArrayList<>()); // Gatekeeper Bella QUEST_RECOMENDATIONS.put(30256, new ArrayList<>()); // Gatekeeper Bella
QUEST_RECOMENDATIONS.get(30256).add(new TeleporterQuestRecommendationHolder(30256, "Q00562_BasicMissionAltarOfEvil", -1, "30256-Q562")); QUEST_RECOMENDATIONS.get(30256).add(new TeleporterQuestRecommendationHolder(30256, "Q00562_BasicMissionAltarOfEvil", new int[]{3}, "30256-Q562"));
QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // Gatekeeper Elisa QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // Gatekeeper Elisa
QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{2,4}, "30848-Q561-Q562"));
QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-Q561-Q562")); QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{2,4}, "30848-Q561-Q562"));
// @formatter:on
} }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -184,16 +186,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -46,8 +46,8 @@ public final class TeleporterInstance extends Npc
// static // static
// { // {
// QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // QUEST_RECOMENDATIONS.put(30848, new ArrayList<>());
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{-1}, "30848-Q561-Q562"));
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-561-562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{-1}, "30848-561-562"));
// } // }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -159,16 +159,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -46,8 +46,8 @@ public final class TeleporterInstance extends Npc
// static // static
// { // {
// QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // QUEST_RECOMENDATIONS.put(30848, new ArrayList<>());
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{-1}, "30848-Q561-Q562"));
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-561-562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{-1}, "30848-561-562"));
// } // }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -159,16 +159,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -46,8 +46,8 @@ public final class TeleporterInstance extends Npc
// static // static
// { // {
// QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // QUEST_RECOMENDATIONS.put(30848, new ArrayList<>());
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{-1}, "30848-Q561-Q562"));
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-561-562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{-1}, "30848-561-562"));
// } // }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -159,16 +159,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()

View File

@@ -46,8 +46,8 @@ public final class TeleporterInstance extends Npc
// static // static
// { // {
// QUEST_RECOMENDATIONS.put(30848, new ArrayList<>()); // QUEST_RECOMENDATIONS.put(30848, new ArrayList<>());
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", -1, "30848-Q561-Q562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00561_BasicMissionHarnakUndergroundRuins", new int[]{-1}, "30848-Q561-Q562"));
// QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", -1, "30848-561-562")); // QUEST_RECOMENDATIONS.get(30848).add(new TeleporterQuestRecommendationHolder(30848, "Q00562_BasicMissionAltarOfEvil", new int[]{-1}, "30848-561-562"));
// } // }
public TeleporterInstance(NpcTemplate template) public TeleporterInstance(NpcTemplate template)
@@ -159,16 +159,18 @@ public final class TeleporterInstance extends Npc
pom = String.valueOf(npcId); pom = String.valueOf(npcId);
if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId)) if ((player != null) && QUEST_RECOMENDATIONS.containsKey(npcId))
{ {
for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId)) CHECK: for (TeleporterQuestRecommendationHolder rec : QUEST_RECOMENDATIONS.get(npcId))
{ {
final QuestState qs = player.getQuestState(rec.getQuestName()); final QuestState qs = player.getQuestState(rec.getQuestName());
if ((qs != null) && qs.isStarted()) if ((qs != null) && qs.isStarted())
{ {
final int cond = rec.getCond(); for (int cond : rec.getConditions())
if ((cond == -1) || qs.isCond(cond))
{ {
pom = rec.getHtml(); if ((cond == -1) || qs.isCond(cond))
break; {
pom = rec.getHtml();
break CHECK;
}
} }
} }
} }

View File

@@ -23,14 +23,14 @@ public class TeleporterQuestRecommendationHolder
{ {
private final int _npcId; private final int _npcId;
private final String _questName; private final String _questName;
private final int _cond; // -1 = all conditions private final int[] _conditions; // -1 = all conditions
private final String _html; private final String _html;
public TeleporterQuestRecommendationHolder(int npcId, String questName, int cond, String html) public TeleporterQuestRecommendationHolder(int npcId, String questName, int[] conditions, String html)
{ {
_npcId = npcId; _npcId = npcId;
_questName = questName; _questName = questName;
_cond = cond; _conditions = conditions;
_html = html; _html = html;
} }
@@ -44,9 +44,9 @@ public class TeleporterQuestRecommendationHolder
return _questName; return _questName;
} }
public int getCond() public int[] getConditions()
{ {
return _cond; return _conditions;
} }
public String getHtml() public String getHtml()