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.

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 think that solves the freeze thing, anyway great share! 
    • Introducing: Daily & Weekly Missions!   I've released a major panel update with a new Missions system and expanded language support.   Players can now complete daily and weekly missions directly through the panel and claim rewards such as balance or items. Mission progress is tied to in-game activity and supported panel actions, and the update also adds a dedicated Missions page, dashboard mission previews, claimable mission indicators, and full admin tools for creating and managing missions.   The Roll page now shows the potential reward drops below the roll container.   Alongside this, I’ve expanded the panel’s language support with new locale options, including Bulgarian, Czech, Georgian, Lithuanian, Polish, Romanian, Japanese, Simplified Chinese, and Traditional Chinese.     The Demo is now updated with the new features for you to try out!
    • I sell complete packs. If you want to add an item, NPC, etc., you have to do that yourselves. Your friend bought the pack; he's the one who needs to configure his server type. He received what he bought as agreed, and I'm saying this without knowing who you're talking about, because anyone who buys something receives what was agreed upon.   Regards. mmmmm L2Velmore ????   If that's the one, I see everything went well... if I remember correctly you were crying over $100, I gave you a better price, and I suppose you made thousands with that... And you're still coming back to complain? :=)
    • I know many people have struggled with this specific issue and had trouble setting up the correct behavior for Toggle skills in aCis. By default, toggles interrupt the player's movement (retail-like), which often feels clunky to players who prefer a smoother, more modern experience. I've prepared a clean solution that eliminates this "freeze" and allows for fluid movement while toggling your auras. Below is the code on how to achieve this. Hope it helps! Changes in PlayerAI.java: Modified doActiveIntention to properly update the active state without stalling. Removed the forced stop() during toggle casting. Added a MoveToLocation broadcast to ensure other players see your movement correctly (prevents visual "teleporting" or desync). Best regards 😃 diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/ai/type/PlayerAI.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/ai/type/PlayerAI.java index ba0425a..1b2658d 100644 --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/ai/type/PlayerAI.java +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/actor/ai/type/PlayerAI.java @@ -28,6 +28,7 @@  import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;  import net.sf.l2j.gameserver.network.serverpackets.AutoAttackStart;  import net.sf.l2j.gameserver.network.serverpackets.ChairSit; +import net.sf.l2j.gameserver.network.serverpackets.MoveToLocation;  import net.sf.l2j.gameserver.network.serverpackets.MoveToLocationInVehicle;  import net.sf.l2j.gameserver.network.serverpackets.MoveToPawn;  import net.sf.l2j.gameserver.network.serverpackets.StopMove; @@ -159,7 +160,10 @@      @Override      public synchronized void doActiveIntention()      { -        doIdleIntention(); +        prepareIntention(); +        _currentIntention.updateAsActive(); +        if (!getActor().isMoving()) +            thinkIdle();      }            @Override @@ -280,8 +284,9 @@                    if (skill.isToggle())          { -            getActor().getMove().stop();              getActor().getCast().doToggleCast(skill, target); +            if (getActor().isMoving()) +                getActor().broadcastPacket(new MoveToLocation(getActor()));          }          else          { https://pastebin.com/twZujZ3Y
  • 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..