Merge pull request #106 from cpurules/feature/explorer-titles

Fix implementation of primary explorer title quests
This commit is contained in:
Ponk
2022-08-20 10:19:26 +02:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ function start(ms) {
ms.explorerQuest(29014, "Sleepywood Explorer");//Sleepywood Explorer
} else if (ms.getPlayer().getMapId() >= 200000000 && ms.getPlayer().getMapId() <= 211041800) {
ms.explorerQuest(29006, "El Nath Mts. Explorer");//El Nath Mts. Explorer
} else if (ms.getPlayer().getMapId() >= 220000000 && ms.getPlayer().getMapId() <= 222010400) {
} else if (ms.getPlayer().getMapId() >= 220000000 && ms.getPlayer().getMapId() <= 222020000) {
ms.explorerQuest(29007, "Ludus Lake Explorer");//Ludus Lake Explorer
} else if (ms.getPlayer().getMapId() >= 230000000 && ms.getPlayer().getMapId() <= 230040401) {
ms.explorerQuest(29008, "Undersea Explorer");//Undersea Explorer

View File

@@ -103,6 +103,10 @@ public class MapScriptMethods extends AbstractPlayerInteraction {
public void explorerQuest(short questid, String questName) {
Quest quest = Quest.getInstance(questid);
if (isQuestCompleted(questid)) {
return;
}
if (!isQuestStarted(questid)) {
if (!quest.forceStart(getPlayer(), 9000066)) {
return;
@@ -114,7 +118,11 @@ public class MapScriptMethods extends AbstractPlayerInteraction {
}
String status = Integer.toString(qs.getMedalProgress());
String infoex = qs.getInfoEx(0);
getPlayer().announceUpdateQuest(DelayedQuestUpdate.UPDATE, qs, true);
// explorer quests all have an infoex/infonumber requirement that points to another quest
// THAT quest's progress needs to be updated for Quest.canComplete() to return true
getPlayer().setQuestProgress(quest.getId(), (int)quest.getInfoNumber(qs.getStatus()), status);
StringBuilder smp = new StringBuilder();
StringBuilder etm = new StringBuilder();
if (status.equals(infoex)) {