Jump to content
  • 0

[Help] Hellbound Island


Question

Posted

Hello again ;)

 

I have a problem with hellbound now.

I have completed a quest Path to Hellbound, and warpgate is teleporting me to hellbound already?

You have to complete Thats Bloody Hot quest too to enter hellbound, but i can enter the island without completion of the quest.

 

package custom.HellboundIsland;

import L2j.Infinity.gameserver.instancemanager.hellbound.HellboundManager;
import L2j.Infinity.gameserver.model.actor.L2Npc;
import L2j.Infinity.gameserver.model.actor.instance.L2PcInstance;
import L2j.Infinity.gameserver.model.quest.Quest;
import L2j.Infinity.gameserver.model.quest.State;
import L2j.Infinity.gameserver.model.quest.QuestState;

public class HellboundIsland extends Quest
{
private static final String THATS_BLOODY_HOT = "133_ThatsBloodyHot";
private static final String PATH_TO_HELLBOUND = "130_PathToHellbound";

private final static int[] npcIds = { 32314, 32315, 32316, 32317, 32318, 32319 };

public HellboundIsland(int questId, String name, String descr)
{
	super(questId, name, descr);
	for (final int id : npcIds)
	{
		addStartNpc(id);
		addFirstTalkId(id);
		addTalkId(id);
	}
}

private static final boolean canEnter(L2PcInstance player)
{
	if (player.isFlying())
		return false;

	QuestState st;
	if (!HellboundManager.getInstance().isLocked())
	{
		st = player.getQuestState(PATH_TO_HELLBOUND);
		if (st != null && st.getState() == State.COMPLETED)
			return true;
	}

	st = player.getQuestState(THATS_BLOODY_HOT);
	if (st != null && st.getState() == State.COMPLETED)
		return true;

	return false;
}

@Override
public final String onFirstTalk(L2Npc npc, L2PcInstance player)
{
	if (!canEnter(player))
	{
		if (HellboundManager.getInstance().isLocked())
			return "warpgate-locked.htm";
	}

	return npc.getNpcId() + ".htm";
}

@Override
public final String onTalk(L2Npc npc, L2PcInstance player)
{
	if (!canEnter(player))
		return "warpgate-no.htm";

	player.teleToLocation(-11272, 236464, -3248, true);
	HellboundManager.getInstance().unlock();
	return null;
}

public static void main(String[] args)
{
	new HellboundIsland(-1, "HellboundIsland", "custom");
}
}

 

I think, that this code shows, that it is checking, if Thats bloody Hot quest is completed, but then why it allows to teleport??

 

- estaz

3 answers to this question

Recommended Posts

  • 0
Posted

private static final boolean canEnter(L2PcInstance player)

{

if (player.isFlying())

return false;

 

QuestState st;

if (!HellboundManager.getInstance().isLocked())

{

st = player.getQuestState(PATH_TO_HELLBOUND);

if (st != null && st.getState() == State.COMPLETED)

return true;

}

 

st = player.getQuestState(THATS_BLOODY_HOT);

if (st != null && st.getState() == State.COMPLETED)

return true;

 

return false;

}

 

The bold letters should be removed i think

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock