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.

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


  • Posts

    • OpenCV bot working for all l2 clients... but need special set for each server
    • Use l2tower for free, or try adrenaline. @Alex K.
    • 🎁 Double the Impact, Half the Cost! from 25/10/2025 until 25/12/2025 Buy or Renew your Donation Panel now and save 50% because supporting others should reward you too. 💡 Use code BLACKFRIDAY at checkout! https://hopzone.eu/store/product/26-donate-panel-v5/   About Donate Panel v5 PAYMENT IN EASY 5 STEPS Login with your character name. Select the donation service (Paypal Stripe Payeer MercadoPago 🆕). Select the amount of payment. Pay. 😎 Automatically recieve the reward ingame (and yes) while he is online! 🤯 PAYMENT METHODS Paypal Stripe accepts credit cards, debit cards, ACH transfers, Apple Pay, Google Pay, Microsoft Pay, and various local payment methods from around the world. Payeer accepts BTC, LTC, ETH, DASH, BCH, USD, EUR, RUB wallets MercadoPago accepts ARS, BRL, CLP, MXN, COP, PEN, UYU. PROTECTION Full SSL website (can be forced by htaccess) XSS Protection just in case. Remove vulnerability headers in htaccess level Session Validation COOKIE, POST, GET global inputs are sanitized SQL Injection protection Query String protetion Prepared statements of PDO driver (no sql injection there) Google Invisible Captcha v3 (NEW) Last but not least security through obscurity SEO & PUBLIC MANAGEMENT SEO Friendly urls (in htaccess level) Google Analytics and GTAG Code ready. Terms of use ready to go Refund policy ready to go Contact All the TERMS text are showing config dynamic item images/text with server's name and more OPTIMIZATION AND SPEED Zip Content (faster load) Memory save (unloading global vars) Using CDN’s for bootstrap Scripts are loaded in footer Images are soft to max 10kb Small and smart organized code style FUNCTIONALITIES Multilanguage (4 languages so far) EN ES NL EL (Easy to add more) Payment methods Paypal, Stripe, Payeer and MercadoPago After payment or cancel the user is redirected back to “Thank you” page. TECHNOLOGIES Bootstrap 5x CSS PHP 5.6+ (for l2off) and PHP 7.4+ (for java) Extensions for php: MySQL (L2Java), pdo_dblib(L2OFF), pdo_sqlsrv(L2OFF), mssql_connect (L2OFF) and PDO Drivers that support MariaDB, MySQL, MsSQL. SYSTEMS Stripe and MercadoPago supports sandbox and live. Detailed and seperated Logs (ERROR, DEVELOPER, INFO, WARNING, PAYMENT) for website and Rest APIs. Detailed Log in database for Payments and services used. Google Analytics (You know when players are in the panel and if they pay) Google Captcha V3 Dynamic Icons to show according your Donate Item ID Multiple servers L2OFF or L2JAVA servers can be added together as server network     BE AWARE: Leaked versions of old v2 panels (year 2018 with bugs) are still out sold by scammers without support or knowledge of the files.
    • I work with Kenrix and he is a  next level coder. Hugely Recommended.
    • Follow our Telegram channel, because exciting events are coming very soon! Halloween, 11.11, and also a giveaway related to 3000 subscribers in our Telegram channel are ahead! What do you think we have prepared? Subscribe to our Telegram channel and stay updated on all the news: https://t.me/accsforyou_shop Active links to SOCNET stores: Digital goods store (Website): Go Telegram store bot: Go – convenient access to the store via Telegram messenger. Telegram Stars purchasing bot: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We would like to introduce you to the current list of promotions and special offers for purchasing products and services of our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, Bot) in October! You can also use a promo code for the first purchase: SOCNET (15% discount) 2. Get $1 to your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write it in our forum thread! 3. Get $1 for the first trial launch of the SMM Panel — just open a ticket with the topic “Get Trial Bonus” on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our Stars purchasing bot! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts & Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
  • 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