Jump to content

Recommended Posts

Posted

Since i got bored like hell today, i translated this one from python to java.

package quests.Q025_HidingBehindTheTruth;

import quests.Q024_InhabitantsOfTheForrestOfTheDead.Q024_InhabitantsOfTheForrestOfTheDead;
import net.sf.l2j.gameserver.ai.CtrlIntention;
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;

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

//Items
private static final int Contract = 7066;
private static final int Dress = 7155;
private static final int SuspiciousTotem = 7156;
private static final int GemstoneKey = 7157;
private static final int TotemDoll = 7158;

//NPCs
private static final int Agripel = 31348;
private static final int Benedict = 31349;
private static final int Wizard = 31522;
private static final int Tombstone = 31531;
private static final int Lidia = 31532;
private static final int Bookshelf = 31533;
private static final int Bookshelf2 = 31534;
private static final int Bookshelf3 = 31535;
private static final int Coffin = 31536;
private static final int Triol = 27218;

public Q025_HidingBehindTheTruth(int questId, String name, String descr)
{
	super(questId, name, descr);
	questItemIds = new int[]
			{
			Contract,
			Dress,
			SuspiciousTotem,
			GemstoneKey,
			TotemDoll,
			};
	addStartNpc(Benedict);
	addTalkId(Agripel,Benedict,Wizard,Tombstone,Lidia,Bookshelf,Bookshelf2,Bookshelf3,Coffin,Triol);
}

public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
	String htmltext = event;
	QuestState st = player.getQuestState(qn);
	if (st == null)
		return htmltext;

	if (event.equalsIgnoreCase("31349-02.htm"))
	{
		st.playSound(QuestState.SOUND_ACCEPT);
		st.set("cond","1");
		st.setState(STATE_STARTED);
	}
	else if (event.equalsIgnoreCase("31349-03.htm"))
	{
		if (!st.hasQuestItems(SuspiciousTotem))
			htmltext = "31349-05.htm";
		else
		{
			st.playSound(QuestState.SOUND_MIDDLE);
			st.set("cond","2");
		}
	}
	else if (event.equalsIgnoreCase("31349-10.htm"))
	{
		st.playSound(QuestState.SOUND_MIDDLE);
		st.set("cond","4");
	}
	else if (event.equalsIgnoreCase("31348-02.htm"))
	{
		st.takeItems(SuspiciousTotem,-1);
	}
	else if (event.equalsIgnoreCase("31348-07.htm"))
	{
		st.playSound(QuestState.SOUND_MIDDLE);
		st.set("cond","5");
		st.giveItems(GemstoneKey,1);
	}
	else if (event.equalsIgnoreCase("31522-04.htm"))
	{
		st.playSound(QuestState.SOUND_MIDDLE);
		st.set("cond","6");
	}
	else if (event.equalsIgnoreCase("31535-03.htm"))
	{
		if (st.getInt("step") == 0)
		{
			st.set("step","1");
			L2Npc triol = addSpawn(Triol,59712,-47568,-2712,0,false,300000,true);
			triol.broadcastNpcSay( "That box was sealed by my master. Don't touch it!");
			triol.setRunning();
			triol.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
			st.playSound(QuestState.SOUND_MIDDLE);
			st.set("cond","7");
		}
		else if (st.getInt("step") == 2)
		{
				htmltext = "31535-04.htm";
		}
		else if (event.equalsIgnoreCase("31535-05.htm"))
		{
			st.giveItems(Contract,1);
			st.takeItems(GemstoneKey,-1);
			st.playSound(QuestState.SOUND_MIDDLE);
			st.set("cond","9");
		}
		else if (event.equalsIgnoreCase("31532-02.htm"))
		{
			st.takeItems(Contract,-1);
		}
		else if (event.equalsIgnoreCase("31532-06.htm"))
		{
			st.playSound(QuestState.SOUND_MIDDLE);
			st.set("cond","11");
		}
		else if (event.equalsIgnoreCase("31531-02.htm"))
		{
			st.playSound(QuestState.SOUND_MIDDLE);
			st.set("cond","12");
			addSpawn(Coffin,60104,-35820,-664,0,false,20000,true);
		}
		else if (event.equalsIgnoreCase("31532-18.htm"))
		{
			st.playSound(QuestState.SOUND_MIDDLE);
			st.set("cond","15");
		}
		else if (event.equalsIgnoreCase("31522-12.htm"))
		{
			st.playSound(QuestState.SOUND_MIDDLE);
			st.set("cond","16");
		}
		else if (event.equalsIgnoreCase("31348-10.htm"))
			st.takeItems(TotemDoll,-1);
		else if (event.equalsIgnoreCase("31348-15.htm"))
		{
			st.playSound(QuestState.SOUND_MIDDLE);
			st.set("cond","17");
		}
		else if (event.equalsIgnoreCase("31348-16.htm"))
		{
			st.playSound(QuestState.SOUND_MIDDLE);
			st.set("cond","18");
		}
		else if (event.equalsIgnoreCase("31532-20.htm"))
		{
			st.giveItems(905,2);
			st.giveItems(874,1);
			st.takeItems(7063,-1);
			st.rewardExpAndSp(572277,53750);
			st.unset("cond");
			st.exitQuest(false);
			st.playSound(QuestState.SOUND_FINISH);
		}
		else if (event.equalsIgnoreCase("31522-15.htm"))
		{
			st.giveItems(936,1);
			st.giveItems(874,1);
			st.takeItems(7063,-1);
			st.rewardExpAndSp(572277,53750);
			st.unset("cond");
			st.exitQuest(false);
			st.playSound(QuestState.SOUND_FINISH);
		}
	}
	return htmltext;
}
public String onTalk(L2Npc npc, L2PcInstance player)
{
	String htmltext = getNoQuestMsg();
	QuestState st = player.getQuestState(qn);
	if (st == null)
		return htmltext;

	switch (st.getState())
	{
	case STATE_COMPLETED:
		htmltext = getAlreadyCompletedMsg();
	case STATE_CREATED:
		QuestState st2 = player.getQuestState("Q025_HidingBehindTheTruth");
		if (npc.getNpcId() == Benedict)
		{
			st2 = st.getPlayer().getQuestState("Q025_HidingBehindTheTruth");
			if (st2!=null && st2.getState() == STATE_COMPLETED && player.getLevel() >= 66)
				htmltext = "31349-01.htm";
			else
				htmltext = "31349-00.htm";
		}
	case STATE_STARTED:
		int cond = st.getInt("cond");
		if (npc.getNpcId() == Benedict)
		{
			if (cond == 1)
				htmltext = "31349-02.htm";
				else if (cond==2 || cond ==3)
					htmltext = "31349-04.htm";
				else if (cond == 4)
					htmltext = "31349-10.htm";
		}
		else if (npc.getNpcId() == Wizard)
		{
			if (cond == 2)
			{
				htmltext = "31522-01.htm";
				st.playSound(QuestState.SOUND_MIDDLE);
				st.set("cond","3");
				st.giveItems(SuspiciousTotem,1);
			}
			else if (cond == 3)
				htmltext = "31522-02.htm";
			else if (cond == 5)
				htmltext = "31522-03.htm";
			else if (cond == 6)
				htmltext = "31522-04.htm";
			else if (cond == 9)
			{
				htmltext = "31522-05.htm";
				st.playSound(QuestState.SOUND_MIDDLE);
				st.set("cond","10");
			}
			else if (cond == 10)
				htmltext = "31522-05.htm";
			else if (cond == 15)
				htmltext = "31522-06.htm";
			else if (cond == 16)
				htmltext = "31522-13.htm";
			else if (cond == 17)
				htmltext = "31522-16.htm";
			else if (cond == 18)
				htmltext = "31522-14.htm";
		}
		else if (npc.getNpcId() == Agripel)
		{
			if (cond == 4 )	
				htmltext = "31348-01.htm";
			else if (cond == 5)
				htmltext = "31348-08.htm";
			else if (cond == 16)
				htmltext = "31348-09.htm";
			else if (cond == 17)
				htmltext = "31348-17.htm";
			else if (cond == 18)
				htmltext = "31348-18.htm";
		}
		else if (npc.getNpcId() == Bookshelf)
		{
			if (cond == 6)
				htmltext = "31533-01.htm";
		}
		else if (npc.getNpcId() == Bookshelf2)
		{
			if (cond == 6)
				htmltext = "31534-01.htm";
		}
		else if (npc.getNpcId() == Bookshelf3)
		{
			if (cond==6 || cond==7 || cond==8)
				htmltext = "31535-01.htm";
			else if (cond == 9)
				htmltext = "31535-06.htm";
		}
		else if (npc.getNpcId() == Lidia)
		{
			if (cond == 10)
				htmltext = "31532-01.htm";
			else if (cond==11 || cond==12)
				htmltext = "31532-06.htm";
			else if (cond == 13)
			{
				htmltext = "31532-07.htm";
				st.set("cond","14");
				st.takeItems(Dress,-1);
			}
			else if (cond == 14)
				htmltext = "31532-08.htm";
			else if (cond == 15)
				htmltext = "31532-18.htm";
			else if (cond == 17)
				htmltext = "31532-19.htm";
			else if (cond == 18)
				htmltext = "31532-21.htm";
		}
		else if (npc.getNpcId() == Tombstone)
		{
			if (cond == 11 || cond ==12)
				htmltext = "31531-01.htm";
			else if (cond == 13)
				htmltext = "31531-03.htm";
		}
		else if (npc.getNpcId() == Coffin)
			if (cond == 12)
			{
				htmltext = "31536-01.htm";
				st.giveItems(Dress,1);
				st.playSound(QuestState.SOUND_MIDDLE);
				st.set("cond","13");
				npc.deleteMe();
			}
	}

	return htmltext;
}

public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
{
	QuestState st = checkPlayerCondition(player, npc, "cond", "1");
	if (st == null)
		return null;

	if (st.getInt("cond") == 7)
	{
		st.playSound(QuestState.SOUND_ITEMGET);
		st.set("cond","8");
		npc.broadcastNpcSay("You've ended my immortal life! You've protected by the feudal lord, aren't you?");
		st.giveItems(TotemDoll,1);
		st.set("step","2");
	}

	return null;
}
public static void main(String[] args)
{
	new Q025_HidingBehindTheTruth(25, qn, "Hiding Before the Truth");
}
}

 

Html Part

Posted

Hello Zake, you got errors and some others stuffs which can be improved, here's the list. Btw you should post directly on aCis board. The section is this one : http://acis.i-live.eu/index.php?board=35.0 SweeTs shared it on my boards, so if you manage to fix it with my suggestions, feel free to repost it.

 

else
st.playSound("ItemSound.quest_middle");
st.set("cond","2");

is wrong, you miss brackets. Currently your code means than cond 2 is applied for any case. Must be

else {
st.playSound("ItemSound.quest_middle");
st.set("cond","2");
}

  • st.getQuestItemsCount(SuspiciousTotem) ==0 can be replaced by (more sexy) !st.hasQuestItems(SuspiciousTotem). Use that way ONLY if the count doesn't care, and you only have to know if yes or no you got the given item. If you need to count items (== 10 for ex), then your first is ok.
  • All sounds have been finalized. Don't use "ItemSound.quest_middle", but use QuestState.SOUND_MIDDLE. Complete list can be found on QuestState.
  • You don't need to st.unset("cond"); as it is made automatically at exitQuest(param).
  • I doubt the rewards match IL criterias. Reward is generally 10 times lower.
  • htmltext = "<html><body>This quest has already been completed.</body></html>"; got also a finalized counterpart : getAlreadyCompletedMsg().
  • you could use a switch for npcIds in STARTED case (just the common way I use for aCis quests, no big deal)
  • onKill( section can be shortened, because you currently do checkPlayerCondition(player, npc, "cond", "1") - checking cond == 1, but if you change 1 to 7 you can drop if (st.getInt("cond") == 7) check.
  • "Hiding before the truth" name got typos for sure. NCSoft way is generally "Hiding Before the Truth". Verify fast on client side, in some rare cases they don't match their own criterias.
  • As reminder : spawns are (for speaking NPCs) instanced. It means you can have only one instance of the NPC living, if 2 players are doing the quest it can't spawn it. The other must wait. Some HTMs related to that NPC can also go in that sense.

 

I didn't test your quest, I just read it fast. I don't know if it is simply works, notably if you edited correctly HTM bypasses.

 

Finally, if you need stuff like L2OFF HTMs or particular retail behavior of a NPC, I can send you.

 

I hope you will keep the good work and take in consideration my suggestions for your future quests (if any), or the edition of this one.

 

Regards,

 

Tk.

  • 2 weeks later...
Posted

Hello Zake, you got errors and some others stuffs which can be improved, here's the list. Btw you should post directly on aCis board. The section is this one : http://acis.i-live.eu/index.php?board=35.0 SweeTs shared it on my boards, so if you manage to fix it with my suggestions, feel free to repost it.

 

else
st.playSound("ItemSound.quest_middle");
st.set("cond","2");

is wrong, you miss brackets. Currently your code means than cond 2 is applied for any case. Must be

else {
st.playSound("ItemSound.quest_middle");
st.set("cond","2");
}

  • st.getQuestItemsCount(SuspiciousTotem) ==0 can be replaced by (more sexy) !st.hasQuestItems(SuspiciousTotem). Use that way ONLY if the count doesn't care, and you only have to know if yes or no you got the given item. If you need to count items (== 10 for ex), then your first is ok.
  • All sounds have been finalized. Don't use "ItemSound.quest_middle", but use QuestState.SOUND_MIDDLE. Complete list can be found on QuestState.
  • You don't need to st.unset("cond"); as it is made automatically at exitQuest(param).
  • I doubt the rewards match IL criterias. Reward is generally 10 times lower.
  • htmltext = "<html><body>This quest has already been completed.</body></html>"; got also a finalized counterpart : getAlreadyCompletedMsg().
  • you could use a switch for npcIds in STARTED case (just the common way I use for aCis quests, no big deal)
  • onKill( section can be shortened, because you currently do checkPlayerCondition(player, npc, "cond", "1") - checking cond == 1, but if you change 1 to 7 you can drop if (st.getInt("cond") == 7) check.
  • "Hiding before the truth" name got typos for sure. NCSoft way is generally "Hiding Before the Truth". Verify fast on client side, in some rare cases they don't match their own criterias.
  • As reminder : spawns are (for speaking NPCs) instanced. It means you can have only one instance of the NPC living, if 2 players are doing the quest it can't spawn it. The other must wait. Some HTMs related to that NPC can also go in that sense.

 

I didn't test your quest, I just read it fast. I don't know if it is simply works, notably if you edited correctly HTM bypasses.

 

Finally, if you need stuff like L2OFF HTMs or particular retail behavior of a NPC, I can send you.

 

I hope you will keep the good work and take in consideration my suggestions for your future quests (if any), or the edition of this one.

 

Regards,

 

Tk.

Hello Tryskell, i just found some time. I've implemented all of those stuff except the "switch" part, i'm bored to add cases :P I'll update the main post later or tomorrow and share it on aCis forum too. By the way, it would be helpful to send me the L2OFF html's of the quests that you're missing, maybe i'll find some more time to translate.

Regards,

Zake.

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
Reply to this topic...

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



  • Posts

    • Sell ready interlude server files, with all popular features and tested, stable source + fully functional premium geodata for free.   Features include: Events: DM CTF TVT LM Dressme system Custom Buffer GM Shop Custom community board Donation manager  Auto Farm   Album: sell c6 — ImgBB   Test Server online: Patch link: https://drive.google.com/file/d/1mvEbv9XESsvfWwc638xFyyzyESeE2U95/view?usp=drive_link Auto acc create and auto admin   Price: 300$. Discord: l2retro
    • Faltan demasiados archivos,  y lógicas en clases claves como L2pcInstance, entre otras. si bien muchas cosas están y el flujo es valorable.  Gracias por tu esfuerzo es bastante... pero realmente no esta completo el código, falta que subas todas las modificaciones en clases colaterales... podrías intentar subir un diff de todo el mod  completo de tu pack y bueno ahí si que cada uno adapte... pero faltan muchas cosas, dudo que haya gente que lo haya echo funcionar con esto... 
    • I know people who have fully bypassed and reversed AAC. One day, they might even release the full source code, but for now, they’re still making money off it. I won’t name anyone, but it’s clear that there aren’t any truly solid anticheats for Lineage2. As I’ve said before, kernel level anticheats are the only real solution. Anything that runs as Internal and injects gets flagged, and your account ends up getting kicked or banned. That’s just how most games handle it nowadays. To TL;DR the whole thing cheating will always exist because there are people out there smart enough to bypass any protection and run private cheats. Public cheats are always detected eventually, so I don’t see any point in buying AAC, especially when they claim it blocks adr, which simply isn’t true.
    • 🌐 Website: https://l2adonis.com 📅 GRAND OPENING: July 18, 2025 – 20:00 (UTC+2) 💬 Discord: https://discord.com/invite/tZBj8JxAwx 🚫 No auto-farm • No auto-macro • No pay-to-win • No custom   Some Basic Info's (More detalied info's on website)  EXP/SP: x25  Adena: x15  Drop: x15  Spoil: x15  Seal Stones: x15  Raid Boss Drop: x10  Epic Boss Drop: x1  Manor: x10  Safe Enchant: +4  Max Enchant: +16  Normal Scroll Chance: 50%  Blessed Scroll Chance: 66% (If enchant fail item remain +4)  Buff Slots (30+4 extra with Divine Inspiration)  Dances/Songs Slots 14  Auto-learn skills  ⚔️ Real PvP • Real Progression • Retail-like experience JOIN NOW and relive the real L2 experience!
    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market Auto Buy Store  : https://utchihamkt.mysellauth.com/ Not sure if we’re legit? Check Our server — real reviews, real buyers https://discord.gg/uthciha-servicess  | https://campsite.bio/utchihaamkt
  • Topics

×
×
  • 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