Jump to content

Recommended Posts

Posted

Well, since i found some free time and aCis runs it's quests in java (plus many quests are missing) i have translated this quest from Python to Java. So...

 

Q024_InhabitantsOfTheForrestOfTheDead.java

package quests.Q024_InhabitantsOfTheForrestOfTheDead;

import quests.Q023_LidiasHeart.Q023_LidiasHeart;
import net.sf.l2j.gameserver.datatables.SpawnTable;
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 Q024_InhabitantsOfTheForrestOfTheDead extends Quest
{
private final static String qn = "Q024_InhabitantsOfTheForrestOfTheDead";

//Items
private static final int Letter = 7065;
private static final int Hairpin = 7148;
private static final int Totem = 7151;
private static final int Flower = 7152;
private static final int SilverCross = 7153;
private static final int BrokenSilverCross = 7154;
private static final int SuspiciousTotem = 7156;

//NPCs
private static final int Dorian = 31389;
private static final int Wizard = 31522;
private static final int Tombstone = 31531;
private static final int MaidOfLidia = 31532;


public Q024_InhabitantsOfTheForrestOfTheDead(int questId, String name, String descr)
{
	super(questId, name, descr);
	questItemIds = new int[]
			{
			Letter,
			Hairpin,
			Totem,
			Flower,
			SilverCross,
			BrokenSilverCross,
			SuspiciousTotem
			};
	addStartNpc(Dorian);
	addTalkId(Dorian,Wizard,Tombstone,MaidOfLidia);
}

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("31389-02.htm"))
	{
		st.giveItems(Flower,1);
		st.set("cond","1");
		st.playSound("ItemSound.quest_accept");
		st.setState(STATE_STARTED);
	}
	else if (event.equalsIgnoreCase("31389-11.htm"))
	{
		st.set("cond","3");
		st.playSound("ItemSound.quest_middle");
		st.giveItems(SilverCross,1);
	}
	else if (event.equalsIgnoreCase("31389-16.htm"))
	{
		st.playSound("InterfaceSound.charstat_open_01");
	}
	else if (event.equalsIgnoreCase("31389-17.htm"))
	{
		st.takeItems(BrokenSilverCross,-1);
		st.giveItems(Hairpin,1);
		st.set("cond","5");
	}
	else if (event.equalsIgnoreCase("31522-03.htm"))
	{
		st.takeItems(Totem,-1);
	}
	else if (event.equalsIgnoreCase("31522-07.htm"))
	{
		st.set("cond","11");
	}
	else if (event.equalsIgnoreCase("31522-19.htm"))
	{
		st.giveItems(SuspiciousTotem,1);
		st.rewardExpAndSp(242105,22529);
		st.exitQuest(false);
		st.playSound("ItemSound.quest_finish");
	}
	else if (event.equalsIgnoreCase("31531-02.htm"))
	{
		st.playSound("ItemSound.quest_middle");
		st.set("cond","2");
		st.takeItems(Flower,-1);
	}
	else if (event.equalsIgnoreCase("31532-04.htm"))
	{
		st.playSound("ItemSound.quest_middle");
		st.giveItems(Letter,1);
		st.set("cond","6");
	}
	else if (event.equalsIgnoreCase("31532-06.htm"))
	{
		st.takeItems(Hairpin,-1);
		st.takeItems(Letter,-1);
	}
	else if (event.equalsIgnoreCase("31532-16.htm"))
	{
		st.playSound("ItemSound.quest_middle");
		st.set("cond","9");
	}

	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_CREATED: //0
		QuestState st2 = player.getQuestState("Q023_LidiasHeart");
		if (st2 != null && st2.isCompleted())
		{
			if (player.getLevel() >= 65)
				htmltext = "31389-01.htm";
			else
			{
				htmltext = "31389-00.htm";
				st.exitQuest(true);
			}
		}
			else
			{
				htmltext = "31389-00.htm";
				st.exitQuest(true);
			}
			break;

case STATE_STARTED:
	int cond = st.getInt("cond");
	switch (npc.getNpcId())
	{
	case Dorian:
		if (cond == 1)
			htmltext = "31389-03.htm";
		else if (cond == 2)
			htmltext = "31389-04.htm";
		else if (cond == 3)
			htmltext = "31389-12.htm";
		else if (cond >= 4)
			htmltext = "31389-13.htm";
		else if (cond >= 4)
			htmltext = "31389-18.htm";
		break;
	case Tombstone:
		if (cond == 1)
		{
			st.playSound("AmdSound.d_wind_loot_02");
			htmltext = "31531-01.htm";
		}
		if (cond == 2)
		{
			htmltext = "31531-03.htm";
		}
	case MaidOfLidia:
		if (cond == 5)
			htmltext = "31532-01.htm";
		else if (cond ==6)
		{
			//if (st.getQuestItemsCount(Letter) && st.getQuestItemsCount(Hairpin))
			if (st.getQuestItemsCount(Letter) == st.getQuestItemsCount(Hairpin))	
				htmltext = "31532-05.htm";
			else
				htmltext = "31532-07.htm";
		}
		else if (cond ==9)
		{
			htmltext = "31532-16.htm";
		}
	case Wizard:
		if (cond==10)
			htmltext = "31522-01.htm";
		else if (cond == 11)
			htmltext = "31522-08.htm";
	}

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

	switch (npc.getNpcId())
	{
	case 21557:
	case 21558:
	case 21560:
	case 21563:
	case 21564:	
	case 21565:
	case 21566:
	case 21567:
		st.giveItems(Totem,1);
		st.set("cond","10");
		st.playSound("ItemSound.quest_middle");
		break;
	}

	return null;
}
public static void main(String[] args)
{
	new Q024_InhabitantsOfTheForrestOfTheDead(24, qn, "Inhabitants of the forrest of the dead");
}
}

 

For those who can't find the html part here you are.

 

PS: I 'll translate more quests when i find some free time, HF.

Posted

All quests can be found at l2jserver, because they already started recoding them in java.

 

By the way, you did great job.

Guest Elfocrash
Posted

They dont translate Python to Java. They find retail info in the web with retail rates and then they recode the quests from scratch. A python l2j quest for IL most

of the times does not have retail info in it like htmls, rates and stuff.

Posted

They dont translate Python to Java. They find retail info in the web with retail rates and then they recode the quests from scratch. A python l2j quest for IL most

of the times does not have retail info in it like htmls, rates and stuff.

 

Yep thats true. We rewrite it from scratch based on freya AI :)

Posted

They dont translate Python to Java. They find retail info in the web with retail rates and then they recode the quests from scratch. A python l2j quest for IL most

of the times does not have retail info in it like htmls, rates and stuff.

This way should be better but have a look at their quests. Each and everyone seems to be translated (same methods, coding style, etc).

All quests can be found at l2jserver, because they already started recoding them in java.

 

By the way, you did great job.

If this is the right DP svn, then no. They're all written in python.
Posted

This way should be better but have a look at their quests. Each and everyone seems to be translated (same methods, coding style, etc).If this is the right DP svn, then no. They're all written in python.

 

Not all of them.

 

By the way, hit meh!

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

    • I was looking for  server with a low rates,eventually i found l2 elixir.I Joined beta and after so many years since 2008 i found  a friend that we played together, memories came back. i cant wait for the grand oppening!. dont miss it!
    • Seems legit, for sure deserves a try!
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
    • SOCNET VERIFICATION SERVICE — is a universal solution for those who value security, convenience, and quality. We turn the verification process into a convenient, fast, and highly confidential experience. Thanks to our service, any of your accounts receive identity confirmation, an increased level of trust from platforms and users, as well as protection from bans, fraud, and risks.   Promotion: Pay for your first verification and get a 10% discount on the second one! 💎 We help with verification on Fragment, crypto exchanges ByBit, Gate, Bitget, OKX, Binance, PayPal, KuCoin, and social networks LinkedIn, Facebook, Instagram, Twitter (X) and many other platforms! 💎 Verification for any service: crypto exchanges, trading platforms, hosting providers, casinos and other websites. Why choose us:   Premium quality — we use the most advanced verification methods. High processing speed — accelerated verification on leading platforms, online services and social networks. Full confidentiality — your personal information is protected. Increased trust and status — a verified account boosts influence and improves conversion. Individual approach — we work with bloggers, brands, businesses, and private clients. Simplifying complexity — we handle issues when dealing with foreign services. Important! Services related to illegal activities are strictly prohibited! 💳 Service pricing   ✅ Verification of individuals — from $30 (the exact cost depends on the required location and service/app/website). Learn more 👨‍💼 The cost of business verification for companies or legal entities is discussed individually with the service administration. Learn more If you want us to register your account on the required service and verify it — you will need to additionally pay 10% of the transaction amount. Available payment methods: cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot.   ⭐ Our Online Store ⭐ SOCNET.STORE ⭐ Telegram Store ⭐ SOCNET.SHOP ⭐ Our SMS Service ⭐ SOCNET.APP ⭐ Our Telegram Bot for buying Telegram Stars ⭐ SOCNET.CC ⭐ Our SMM Panel ⭐ SOCNET.PRO   ✅ News Resources ➡ Telegram Channel ➡ WhatsApp Channel ➡ Discord Server     ⭐ We invite you to COOPERATE and EARN with us ⭐ Would you like to sell your product or service in our stores and earn money? Become our partner or offer mutually beneficial collaboration? You can contact us via the CONTACTS listed in this topic. ✅ Contacts & Support ➡ Telegram Support ➡ WhatsApp Support ➡ Discord Support: socnet_support ➡ Email Support: solomonbog@socnet.store   Terms of Use and Refund Policy If you have any questions or issues, our fast support service is ready to respond to your requests! A refund for a completed service that does not fully meet the requirements or the declared quality is possible only if the product description includes a warranty and a valid warranty period. In other cases, a full refund for the service will not be provided! By purchasing such a service, you automatically agree to our refund rules for non-provided services! Refunds for countries selected by mistake are not provided after verification. To complete verification, you must provide full access to your account. We currently accept cryptocurrency, credit cards, PayPal, and other payment methods in our online store and Telegram bot! We value every client and provide replacements in case of invalid accounts via our contact channels! Attention: Your order will be delivered to your personal Google Drive/Mega.nz via a link (check the link, click “View content”) within 24 hours after the order confirmation! If you purchased more than 1 item at once, your entire order will be delivered via the first link! The remaining links will be empty! You will automatically receive an email notification after delivery! If you pay on our website via PayPal, you must pay an additional 20% commission (minimum $1). To avoid this commission, you can pay me directly via PayPal — instructions are available on the website! Refunds for items purchased by mistake or due to “I chose the wrong product and did not use it” are not accepted! You are fully responsible for your actions before and after purchase.
  • 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