Jump to content

Question

Posted

Hello guys i am searching for an interlude (simple) quest that asks a player to farm some items and then give them to the NPC and trade them for an item. I am not asking a new quest, but because i don't know what exactly do every quest i am simple asking if someone knows a similar quest(s) just tell me the number of the quests.

 

3 answers to this question

Recommended Posts

  • 0
Posted

Take a look at the current custom quests.

 

nothing to help me on custom folder. i need a simple quest. accept farm  trade them. nothing more

  • 0
Posted

nothing to help me on custom folder. i need a simple quest. accept farm  trade them. nothing more

 

package custom.QuestClass;

import net.sf.l2j.Config;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.model.quest.Quest;
import net.sf.l2j.gameserver.model.quest.QuestState;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;

public class QuestClass extends Quest
{
private static final String qn = "QuestClass";

private static final int TAKE_ITEM_TEST = 9999;
private static final int GIVE_ITEM_TEST = 9999;

    private final static int[] NPCs =
    {
    	9999
    };
   
    public QuestClass(int id, String name, String descr)
{
	super(id, name, descr);

	for (int i : NPCs)
	{
		addStartNpc(i);
		addFirstTalkId(i);
		addTalkId(i);
	}
}
    
    @Override
    public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
    {
    	String htmltext = event;
        QuestState st = player.getQuestState(qn);
        
        if (event.equalsIgnoreCase("press_button"))
        {
        	if (player.getLevel() != 80)
                htmltext = "main-no-level.htm";
            else
            {
            	st.takeItems(TAKE_ITEM_TEST, 1);
			st.giveItems(GIVE_ITEM_TEST, 1);
                htmltext = "main-success.htm";
            }
        }
        return htmltext;
    }
    
    @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
	QuestState st = player.getQuestState(qn);
	if (st == null)
		st = newQuestState(player);
	return showWindow(player);
}
    
    public String showWindow(L2PcInstance player)
    {
    	StringBuilder tb = new StringBuilder();
    	tb.append("<html><body>");
    	tb.append("<center><a action=\"bypass -h Quest QuestClass press_button\">CONFIRM</a></center>");
    	tb.append("</body></html>");
    	NpcHtmlMessage msg = new NpcHtmlMessage(7);
    	msg.setHtml(tb.toString());
    	player.sendPacket(msg);
	return null;
    }
   
    public static void main(String[] args)
    {
        new QuestClass(-1, qn, "custom");
    }
}

Guest
This topic is now closed to further replies.


×
×
  • Create New...