L2JMobius

High Five Quest name not showing (just "[ ]") on High Five.HMP.

JPaulo · 4 · 273

Offline JPaulo

  • Vassal
  • *
    • Posts: 6
I'm creating a quest to learn more about how it works in the High Five version. I've never created anything in High Five before.

Although the test quest worked as I wrote it, I can't get any NPC to show the quest name—it only appears as "[]". I edited the "questname-e" file and it didn't work. I also added public String getQuestName() { return "Teste Quest"; } in the quest's Java file, but it didn't work either. I've been searching through the Java files trying to find which class actually handles this, hoping it exists.

If any of you could share a bit of your knowledge with me, I'd be very grateful.

Thank you very much in advance, just for reading this post.

https://ibb.co/RT8dVcqG

Java>

package quests.Q10506_Quest999;

import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.enums.ItemProcessType;
import org.l2jmobius.gameserver.model.script.Quest;
import org.l2jmobius.gameserver.model.script.QuestSound;
import org.l2jmobius.gameserver.model.script.QuestState;
import org.l2jmobius.gameserver.network.serverpackets.PlaySound;

public class Q10506_Quest999 extends Quest
{
   private static final int NPC_INICIAL = 30829;
   private static final int ID_MONSTRO = 20815;
   private static final int ID_RECOMPENSA = 3423;
   private static final int QUANTIDADE_MORTES = 5;
   private static final int NIVEL_MINIMO = 10;

   public Q10506_Quest999()
   {
      super(10506);
      
      addStartNpc(NPC_INICIAL);
      addTalkId(NPC_INICIAL);
      addKillId(ID_MONSTRO);
      
      System.out.println("[Quest 10506] Carregada - Mate " + QUANTIDADE_MORTES + " Hound Dog of Hallate!");
   }
   
   @Override
   public String onEvent(String event, Npc npc, Player player)
   {
      System.out.println("-------------| DEBUG QUEST 10506 |-------------");
      System.out.println("EVENTO RECEBIDO: " + event);
      
      if (event.equalsIgnoreCase("quest_accept"))
      {
         QuestState qs = newQuestState(player);
         qs.startQuest();
         qs.set("killCount", "0");
         
         player.sendPacket(new PlaySound(QuestSound.ITEMSOUND_QUEST_ACCEPT.getSoundName()));
         
         System.out.println("QUEST INICIADA PARA: " + player.getName());
         System.out.println("COND: " + qs.getCond());
         System.out.println("KILLCOUNT: " + qs.get("killCount"));
         return "npc_aceitou.htm";
      }
      else if (event.equalsIgnoreCase("quest_finish"))
      {
         QuestState qs = player.getQuestState(getName());
         if ((qs != null) && (qs.getCond() == 2))
         {
            int kills = qs.getInt("killCount");
            player.addItem(ItemProcessType.QUEST, ID_RECOMPENSA, kills, null, true);
            qs.exitQuest(true, true);
            player.sendPacket(new PlaySound(QuestSound.ITEMSOUND_QUEST_FINISH.getSoundName()));
            return "npc_recompensa.htm";
         }
         return "npc_nao_concluiu.htm";
      }
      return event;
   }
   
   @Override
   public String onTalk(Npc npc, Player player)
   {
      QuestState qs = player.getQuestState(getName());
      
      if (npc.getId() == NPC_INICIAL)
      {
         if ((qs != null) && qs.isCompleted())
         {
            return "npc_completada.htm";
         }
         
         if (player.getLevel() < NIVEL_MINIMO)
         {
            return "npc_sem_level.htm";
         }
         
         if ((qs == null) || qs.isCreated())
         {
            return "npc_inicio.htm";
         }
         
         if (qs.isStarted())
         {
            if (qs.getCond() == 1)
            {
               return "npc_andamento.htm";
            }
            else if (qs.getCond() == 2)
            {
               return "npc_finalizar.htm";
            }
         }
      }
      
      return getNoQuestMsg(player);
   }
   
   @Override
   public void onKill(Npc npc, Player player, boolean isSummon)
   {
      QuestState qs = player.getQuestState(getName());
      if ((qs == null) || !qs.isStarted() || (qs.getCond() != 1))
      {
         return;
      }
      
      if (npc.getId() == ID_MONSTRO)
      {
         int killCount = qs.getInt("killCount") + 1;
         
         if (killCount >= QUANTIDADE_MORTES)
         {
            qs.setCond(2);
            qs.set("killCount", String.valueOf(QUANTIDADE_MORTES));
            player.sendPacket(new PlaySound(QuestSound.ITEMSOUND_QUEST_MIDDLE.getSoundName()));
            player.sendMessage("Voce eliminou todos os " + QUANTIDADE_MORTES + " Hound Dogs!");
         }
         else
         {
            qs.set("killCount", String.valueOf(killCount));
            player.sendPacket(new PlaySound(QuestSound.ITEMSOUND_QUEST_ITEMGET.getSoundName()));
            player.sendMessage("Hound Dogs eliminados: " + killCount + "/" + QUANTIDADE_MORTES);
         }
      }
   }
}


Online Stayway

  • Grand Duke
  • *****
    • Posts: 754
    • http://l2ahyura.com
Quests name are from client as all info too Script just put them working calling packets.


Offline JPaulo

  • Vassal
  • *
    • Posts: 6
Quests name are from client as all info too Script just put them working calling packets.

Thanks for the comment.

Would you happen to know which file that is? I already tried editing the questname-e file and it didn't work.

Could you tell me another one?


Offline JPaulo

  • Vassal
  • *
    • Posts: 6
I found it. Just add it to "npcstring-e.dat" and it will appear. Also edit "npcStringId.java".

Thanks, @Stayway, for the help.