Last active
August 29, 2015 14:14
-
-
Save St3eT/d1f6768c39fd556ac302 to your computer and use it in GitHub Desktop.
Quest link update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/L2J_DataPack/dist/game/data/scripts/handlers/bypasshandlers/QuestLink.java b/L2J_DataPack/dist/game/data/scripts/handlers/bypasshandlers/QuestLink.java | |
index 235d4ff..33f7ed2 100644 | |
--- a/L2J_DataPack/dist/game/data/scripts/handlers/bypasshandlers/QuestLink.java | |
+++ b/L2J_DataPack/dist/game/data/scripts/handlers/bypasshandlers/QuestLink.java | |
@@ -130,7 +130,17 @@ | |
} | |
else | |
{ | |
- StringUtil.append(sb, "<fstring>", String.valueOf(quest.getId()), state, "</fstring>"); | |
+ int questId = quest.getId(); | |
+ if (quest.getId() > 10000) | |
+ { | |
+ questId -= 5000; | |
+ } | |
+ else if (questId == 146) | |
+ { | |
+ questId = 640; | |
+ } | |
+ | |
+ StringUtil.append(sb, "<fstring>", String.valueOf(questId), state, "</fstring>"); | |
} | |
sb.append("</button></font><br>"); | |
} | |
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/L2J_Server/java/com/l2jserver/gameserver/model/quest/Quest.java b/L2J_Server/java/com/l2jserver/gameserver/model/quest/Quest.java | |
index 716cd7b..2b9eb62 100644 | |
--- a/L2J_Server/java/com/l2jserver/gameserver/model/quest/Quest.java | |
+++ b/L2J_Server/java/com/l2jserver/gameserver/model/quest/Quest.java | |
@@ -27,6 +27,7 @@ | |
import java.util.List; | |
import java.util.Map; | |
import java.util.Map.Entry; | |
+import java.util.Set; | |
import java.util.concurrent.ConcurrentHashMap; | |
import java.util.concurrent.locks.ReentrantReadWriteLock; | |
import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock; | |
@@ -34,6 +35,7 @@ | |
import java.util.function.Predicate; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
+import java.util.stream.Collectors; | |
import com.l2jserver.Config; | |
import com.l2jserver.L2DatabaseFactory; | |
@@ -608,8 +610,18 @@ | |
String res = null; | |
try | |
{ | |
+ //@formatter:off | |
+ final Set<Quest> startingQuests = npc.getListeners(EventType.ON_NPC_QUEST_START).stream() | |
+ .map(AbstractEventListener::getOwner) | |
+ .filter(Quest.class::isInstance) | |
+ .map(Quest.class::cast) | |
+ .distinct() | |
+ .collect(Collectors.toSet()); | |
+ //@formatter:on | |
+ | |
final String startConditionHtml = getStartConditionHtml(player); | |
- if (!player.hasQuestState(_name) && (startConditionHtml != null)) | |
+ if (startingQuests.contains(this) && (startConditionHtml != null)) | |
{ | |
res = startConditionHtml; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment