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

    • Had to set up a bunch of virtual numbers for a small project last month, and SMS-Activate worked fine for quick testing. For longer-term stuff, I ended up using Telxi — their service made it easy to handle voice and messaging without extra headaches. It kept things simple and reliable, which mattered a lot when I was juggling other tasks.
    • So how to build this. As a concept. Farming actions should be done by coding. Target choose AI. Avoid getting stuck.   What is AI actually needed for inside a game?.   Chatting moving and choosing Example call for custom town event. Second example come for pvp at that area. It Is amazing to have players respond.   Is there a way to run something on each players PC? Like what boting programs do? Do it. To avoid server lag.   Second. AI for monster's. To be able to feel each monster like a pvp. is what makes a game a masterpiece. Plus insulting. In real Time.   AI for npcs. It can help but is not Worth if it causes even a fragment of lag.   AI and party. Clan. Can it be smart enough to have any meaning to use it as a real player?  If yes it should be added. AI should also be used on pets.   Chatting  with allied AI. If you can explain to it to focus the healer and it does. it's becoming perfect.   It should be like a friend and an assistant.    How this should be done. Different AI for fake players Different for monsters. Why? Monsters are easy to manage. Players are not. You must add also the events rules. Example. CTF go and try to score.   How to make AI for pvp. Set rules to avoid feeding. How? Smart call for friends. Events go all in unless something is wrong. Overseer needed.  Should npc try to be a real player? No. Unless it's a custom server. Npc must try to buy or auto earn only with fixed prices. To avoid getting scammed exploited. Should they farm forever? Yes. Should they progress? Yes. Having people on farm zones makes the game alive.   Now.  What is needed.   An AI as an overseer. Check and correct the rest. An AI for the players. An AI for the monsters. Npc really optional not worth. How it should be done.   Make the training data you want. Via interface assist. And copy paste them inside the main mother model. So people can actually use and train the AI for their own unique server.   If it is possible to explain as GM char  And the AI can be asked to save it. It would be the perfect scenario. Also option to showcase to you.   So one program for the AI. And another for training. Can AI be used for low rate servers? No it will never work. Can it be used for custom server's? Yes it will be able to thrive.   If there is anything you can't understand in general.   Or if you don't understand why everything should be done exactly as explained above. I can help you with it  in absolute detail.
    • 我们的 Telegram 频道 已达到 3000 名订阅者! 感谢大家对我们项目的支持与关注! 我们即将举办一场精彩的抽奖或比赛,专为您准备! 不要错过参与的机会 — 立即订阅:https://t.me/accsforyou_shop✅ 活跃链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 用于购买 Telegram Stars 的机器人:前往 SMM 面板:前往 – 推广您的社交媒体账户。 我们向您展示当前的 促销与特别优惠,可用于购买我们平台的产品与服务: 1. 使用优惠码 OCTOBER2025(8% 折扣)在十月期间通过我们的网站或机器人购物!首次购买还可使用优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在我们网站注册后在论坛留言:“SEND ME BONUS, MY USERNAME IS...”。 3. 首次试用 SMM 面板可获得 $1 奖励 —— 只需在我们网站(支持页面)提交标题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和用于购买 Stars 的机器人中赠送 Telegram Stars!
    • 我们的 Telegram 频道 已达到 3000 名订阅者! 感谢大家对我们项目的支持与关注! 我们即将举办一场精彩的抽奖或比赛,专为您准备! 不要错过参与的机会 — 立即订阅:https://t.me/accsforyou_shop✅ 活跃链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 用于购买 Telegram Stars 的机器人:前往 SMM 面板:前往 – 推广您的社交媒体账户。 我们向您展示当前的 促销与特别优惠,可用于购买我们平台的产品与服务: 1. 使用优惠码 OCTOBER2025(8% 折扣)在十月期间通过我们的网站或机器人购物!首次购买还可使用优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在我们网站注册后在论坛留言:“SEND ME BONUS, MY USERNAME IS...”。 3. 首次试用 SMM 面板可获得 $1 奖励 —— 只需在我们网站(支持页面)提交标题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和用于购买 Stars 的机器人中赠送 Telegram Stars!
    • 我们的 Telegram 频道 已达到 3000 名订阅者! 感谢大家对我们项目的支持与关注! 我们即将举办一场精彩的抽奖或比赛,专为您准备! 不要错过参与的机会 — 立即订阅:https://t.me/accsforyou_shop✅ 活跃链接: 数字商品商店(网站):前往 商店 Telegram 机器人:前往 用于购买 Telegram Stars 的机器人:前往 SMM 面板:前往 – 推广您的社交媒体账户。 我们向您展示当前的 促销与特别优惠,可用于购买我们平台的产品与服务: 1. 使用优惠码 OCTOBER2025(8% 折扣)在十月期间通过我们的网站或机器人购物!首次购买还可使用优惠码 SOCNET(15% 折扣)。 2. 获得 $1 商店余额或 10–20% 折扣 —— 只需在我们网站注册后在论坛留言:“SEND ME BONUS, MY USERNAME IS...”。 3. 首次试用 SMM 面板可获得 $1 奖励 —— 只需在我们网站(支持页面)提交标题为 “Get Trial Bonus” 的工单。 4. 每周在我们的 Telegram 频道和用于购买 Stars 的机器人中赠送 Telegram Stars!
  • 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