Jump to content
  • 0

Question

Posted

Hi guys, I want to make coffer of the dead, chest of hallate, chest of kernon and chest of golkonda to give me the items needed for subclass without the quest itself.

 

When I talk to boxes it says: You are either not on  a quest that involves this npc or you dont meet this NPC requirements

 

here is the code:

package custom.Subclass;

import java.util.HashMap;
import java.util.Map;


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;




public class Subclass extends Quest
{
	// Items
	private static final int REIRIA_SOUL_ORB = 4666;
	private static final int KERMON_INFERNIUM_SCEPTER = 4667;
	private static final int GOLKONDA_INFERNIUM_SCEPTER = 4668;
	private static final int HALLATE_INFERNIUM_SCEPTER = 4669;
	
	// Chest Spawn
	private static final Map<Integer, Integer> CHEST_SPAWN = new HashMap<>();
	{
		CHEST_SPAWN.put(25035, 31027);
		CHEST_SPAWN.put(25054, 31028);
		CHEST_SPAWN.put(25126, 31029);
		CHEST_SPAWN.put(25220, 31030);
	}
	
	public Subclass()
	{
		super(-1, "Subclass", "custom");
		
		addTalkId(31027, 31028, 31029, 31030);
		
		// The 4 bosses which spawn chests
		addKillId(25035, 25054, 25126, 25220);
	}
	
	@Override
	public String onTalk(L2Npc npc, L2PcInstance player)
	{
		String htmltext = "";

	
		switch (npc.getNpcId())
		{
					case 31027:
						if (player.getLevel() >=  75)
						{
							htmltext = "31027-01.htm";
							player.addItem("AutoLoot", REIRIA_SOUL_ORB, 1, player,  true);
						}
						else
							htmltext = "31027-02.htm";
						break;
					
					case 31028:
						if (player.getLevel() >= 75)
						{
							htmltext = "31028-01.htm";
							player.addItem("AutoLoot", KERMON_INFERNIUM_SCEPTER, 1, player, true);
						}
						else
							htmltext = "31028-02.htm";
						break;
						
						
						case 31029:
						if (player.getLevel() >= 75)
						{
							htmltext = "31029-01.htm";
							player.addItem("AutoLoot", GOLKONDA_INFERNIUM_SCEPTER, 1, player, true);
						}
						else
							htmltext = "31029-02.htm";
						break;
						
					
					case 31030:
						if (player.getLevel() >= 75)
						{
							htmltext = "31030-01.htm";
							player.addItem("AutoLoot", HALLATE_INFERNIUM_SCEPTER, 1, player, true);
						}
						else
							htmltext = "31030-02.htm";
						break;
						
						
				}
			return htmltext;	
			
		}
						
	@Override
	public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
	{
		addSpawn(CHEST_SPAWN.get(npc.getNpcId()), npc, true, 120000, false);
		
		return null;
	}
	
	
	
	public static void main(String args[])
	{
		new Subclass();
	}
}

can anyone point me what is wrong? thank you

5 answers to this question

Recommended Posts

  • 0
Posted

They are removed on a purpose, to don't check if you have the quest started. :P

 

 

No idea personally, I hate quests :)

  • 0
Posted

They are removed on a purpose, to don't check if you have the quest started. :P

 

 

No idea personally, I hate quests :)

well he can make the items droppable when boss dies via L2RaidBossInstance with switch, case break; 

but the problem is how he will call the items on sub i mean he should modify the requirements somehow, from me no clue

  • 0
Posted

well he can make the items droppable when boss dies via L2RaidBossInstance with switch, case break; 

but the problem is how he will call the items on sub i mean he should modify the requirements somehow, from me no clue

the only problem using this way is, not all players will get the items. I did something like this

 

when boss die he spawn a merchant and player buy the quest  item from him but now im facing another problem, how to give subclass to a player from a npc who ask u for 4 items? I tried looking into mimirs elixir like you said but no luck until now.

  • 0
Posted

you can make it the same way as i did with barakiel and all players will receive the item that are in party ? if not , next time :P

about the npc... well easies way is to remove sub button from all existing village masters and write a whole new instance or check l2villagemaster and add a check for those items... Sorry but no clue how to do it, if someone tell me where to look for it well i could do it but.. too lazy also :P

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...