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

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...