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

    • [center][img]https://l2haruna.com/images/logo.png[/img][/center] [center][size=5][b][color=#ff9900]Lineage 2 Haruna x3 – Interlude[/color][/b][/size] [size=3][b]True Classic Interlude | Fair PvP | Long-Term Server[/b][/size][/center] Welcome to [b]L2 Haruna x3[/b], a classic [b]Interlude[/b] server focused on retail-like gameplay, fair competition, and long-term stability. No pay-to-win, no broken customs — just real Lineage 2. [b]Website:[/b] https://l2haruna.com/   [b]Discord:[/b] https://discord.gg/7DDC9Dsxnh   [b]Chronicle:[/b] Interlude   [b]Rates:[/b] x3   [b]Server Time:[/b] UTC +2 [hr] [size=4][b][color=#ff9900]📈 Rates & Core Gameplay[/color][/b][/size] • EXP / SP: x3   • Classic Interlude mechanics & formulas   • Balanced economy   • Real PvP, clan wars, sieges, and Olympiad   [hr] [size=4][b][color=#ff9900]🏆 Olympiad Information[/color][/b][/size] • Olympiad starts [b]3 months after server opening[/b]   • Participation only through [b]Olympiad Master[/b]   • Competition time: [b]20:00 – 02:00 (UTC +2)[/b]   [hr] [size=4][b][color=#ff9900]⚙️ Website & Account System[/color][/b][/size] • Master Account (MA) system on website   • Game accounts must be created via MA   • Vote system inside Master Account   • Website rankings: PvP / PK / Clans / Castles   [hr] [size=4][b][color=#ff9900]🧙 NPCs, Buffs & Utilities[/color][/b][/size] • Server Manager NPC in all towns & villages   • Adventurer’s Guide (Miss Queen) in all towns & villages   • Offline Buff Shops (.buffshop) — [b]Monster Derby Track only[/b]   • In-game Mailbox system   • Start-Up Bonus for all characters   • FREE Teleport until level 40   [hr] [size=4][b][color=#ff9900]🎮 Interface & Quality of Life[/color][/b][/size] • ALT + K — Skill panel (learn & enchant skills)   • Alt + Click — Buff removal   • Shift + Click — Monster drop & spoil info   • Offline Shop system   • 35 seconds spawn protection   • Captcha system (anti-bot)   [hr] [size=4][b][color=#ff9900]💬 Chat System[/color][/b][/size] • Global chat (!) — Free, requires level 15   • Trade chat (+) — Free, requires level 15   • (!) Global chat   • (+) Regional trade chat   [hr] [size=4][b][color=#ff9900]🛡 Fair Play & Restrictions[/color][/b][/size] • Maximum [b]2 clients per IP[/b]   • Donate & Vote coins cannot be sold / dropped / traded / destroyed   • Cursed weapons disabled until first Heroes   • Wedding system disabled (will be activated later)   [hr] [size=4][b][color=#ff9900]⚔️ Class Progression[/color][/b][/size] • 1st Class Transfer — Quest required   • 2nd Class Transfer — Quest required   • 3rd Class Transfer — Full quest required   • Subclass — Full quest required   • Noblesse — Full quest required   [hr] [size=4][b][color=#ff9900]🗡 Equipment[/color][/b][/size] • Shadow Weapons (D / C / B Grade) via Shadow Weapon Manager   [hr] [size=4][b][color=#ff9900]🧠 Technical & Protection[/color][/b][/size] • High-quality geodata & geo-engine   • Advanced DDoS protection   • Protection against third-party programs   [hr] [size=4][b][color=#ff9900]🎯 Why Haruna x3?[/color][/b][/size] ✔ No Pay-to-Win   ✔ No fake population   ✔ No admin abuse   ✔ True Interlude feeling   ✔ Built for long-term competition   [center][size=4][b]Join now:[/b][/size] [url=https://l2haruna.com/]https://l2haruna.com/[/url] [b]See you in Aden.[/b] ⚔️[/center]  
    • High Five Part 5 can be uploaded?
    • do you have a Shinemaker Compiler?
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..