In the game, it is not possible to craft the "Echo Crystal" using the two NPCs with IDs "31043" and "31042".
Note: The client and login I used were downloaded from here without any modifications.
Client (password L2jMobius):
https://drive.google.com/file/d/1ZTSBA5yo8-2OpxQnlA04yPSH6FWeI47rSystem:
https://mega.nz/file/o4tWnDZA#gjlvizlNYQoNd9fq5Q9zPtTTMPNmrDiD2TJ1fk9K2QcDescription of the Discovered Issue:
In the game, it is not possible to craft the "Echo Crystal" using the two NPCs with IDs "31043" and "31042."
The issue arises when clicking on the respective links, as there are no prompts or reactions after clicking.
The corresponding htm file "L2J_Mobius_CT_2.6_HighFive\game\data\html\default\31043.htm" has been located, and the code is...
<html><body>Melody Maestro Octavia:<br>
I am a magician of melody! I put music into crystals for your listning pleasure!<br>
Tra La La~! What sound would you like me to put into a crystal~? It only costs 200 adena, a very reasonable price!<br><br>
<a action="bypass -h npc_%objectId%_Quest EchoCrystals">[Create an Echo Crystal - Travel Theme]</a><br>
<a action="bypass -h npc_%objectId%_Quest EchoCrystals">[Create an Echo Crystal - Battle Theme]</a><br>
<a action="bypass -h npc_%objectId%_Quest EchoCrystals">[Create an Echo Crystal - Love Theme]</a><br>
<a action="bypass -h npc_%objectId%_Quest EchoCrystals">[Create an Echo Crystal - Theme of Solitude]</a><br>
<a action="bypass -h npc_%objectId%_Quest EchoCrystals">[Create an Echo Crystal - Theme of the Feast]</a><br>
<a action="bypass -h npc_%objectId%_Quest EchoCrystals">[Create an Echo Crystal - Comedy Theme]</a><br>
<a action="bypass -h npc_%objectId%_Quest EchoCrystals">[Create an Echo Crystal - Celebration Theme]</a><br>
<a action="bypass -h npc_%objectId%_Quest">Quest</a>
</body></html>When clicking on the link mentioned above, it redirects to the following file "1.htm". The corresponding htm file located is "L2J_Mobius_CT_2.6_HighFive\game\data\scripts\custom\EchoCrystals\1.htm," and the code is... :
<html><body><table width=200>
<tr><td align="center">Echo Crystals </td></tr>
</table><br>
<a action="bypass -h Quest EchoCrystals 4410">[Create an Echo Crystal - Theme of Journey]</a><br>
<a action="bypass -h Quest EchoCrystals 4409">[Create an Echo Crystal - Theme of Battle]</a><br>
<a action="bypass -h Quest EchoCrystals 4408">[Create an Echo Crystal - Theme of Love]</a><br>
<a action="bypass -h Quest EchoCrystals 4420">[Create an Echo Crystal - Theme of Solitude]</a><br>
<a action="bypass -h Quest EchoCrystals 4421">[Create an Echo Crystal - Theme of Feast]</a><br>
<a action="bypass -h Quest EchoCrystals 4419">[Create an Echo Crystal - Theme of Comedy]</a><br>
<a action="bypass -h Quest EchoCrystals 4418">[Create an Echo Crystal - Theme of Celebration]</a>
</body></html>After reaching this interface, clicking in the game does not yield any response.
Is there a problem with the code here? How can I fix this issue? Thank you all in advance! EchoCrystals.java
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package custom.EchoCrystals;
import java.util.HashMap;
import java.util.Map;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.util.Util;
import ai.AbstractNpcAI;
/**
* Echo Crystals AI.
* @author Plim
*/
public class EchoCrystals extends AbstractNpcAI
{
private static final int[] NPCs =
{
31042,
31043
};
private static final int ADENA = 57;
private static final int COST = 200;
private static final Map<Integer, ScoreData> SCORES = new HashMap<>();
private class ScoreData
{
private final int crystalId;
private final String okMsg;
private final String noAdenaMsg;
private final String noScoreMsg;
public ScoreData(int crystalId, String okMsg, String noAdenaMsg, String noScoreMsg)
{
super();
this.crystalId = crystalId;
this.okMsg = okMsg;
this.noAdenaMsg = noAdenaMsg;
this.noScoreMsg = noScoreMsg;
}
public int getCrystalId()
{
return crystalId;
}
public String getOkMsg()
{
return okMsg;
}
public String getNoAdenaMsg()
{
return noAdenaMsg;
}
public String getNoScoreMsg()
{
return noScoreMsg;
}
}
private EchoCrystals()
{
// Initialize Map
SCORES.put(4410, new ScoreData(4411, "01", "02", "03"));
SCORES.put(4409, new ScoreData(4412, "04", "05", "06"));
SCORES.put(4408, new ScoreData(4413, "07", "08", "09"));
SCORES.put(4420, new ScoreData(4414, "10", "11", "12"));
SCORES.put(4421, new ScoreData(4415, "13", "14", "15"));
SCORES.put(4419, new ScoreData(4417, "16", "05", "06"));
SCORES.put(4418, new ScoreData(4416, "17", "05", "06"));
for (int npc : NPCs)
{
addStartNpc(npc);
addTalkId(npc);
}
}
@Override
public String onEvent(String event, Npc npc, Player player)
{
String htmltext = "";
final QuestState qs = player.getQuestState(EchoCrystals.class.getSimpleName());
if ((qs != null) && Util.isDigit(event))
{
final int score = Integer.parseInt(event);
if (SCORES.containsKey(score))
{
final int crystal = SCORES.get(score).getCrystalId();
final String ok = SCORES.get(score).getOkMsg();
final String noadena = SCORES.get(score).getNoAdenaMsg();
final String noscore = SCORES.get(score).getNoScoreMsg();
if (!hasQuestItems(player, score))
{
htmltext = npc.getId() + "-" + noscore + ".htm";
}
else if (getQuestItemsCount(player, ADENA) < COST)
{
htmltext = npc.getId() + "-" + noadena + ".htm";
}
else
{
takeItems(player, ADENA, COST);
giveItems(player, crystal, 1);
htmltext = npc.getId() + "-" + ok + ".htm";
}
}
}
return htmltext;
}
@Override
public String onTalk(Npc npc, Player player)
{
return "1.htm";
}
public static void main(String[] args)
{
new EchoCrystals();
}
}