I tried to rewrite Quest 551_OlympiadStarter from l2rebellion to L2jserver.
I need help from users because i have some misunderstanding.
The Problem is that i cant remake st.setState(2); st.setState(3); st.setState(1);
Sorry Maby its wrong dissision.
L2Rebellion Quest Script
package l2r.scripts.quests;
import l2r.extensions.scripts.ScriptFile;
import l2r.gameserver.model.L2Player;
import l2r.gameserver.model.L2SubClass;
import l2r.gameserver.model.entity.olympiad.Olympiad;
import l2r.gameserver.model.instances.L2NpcInstance;
import l2r.gameserver.model.quest.Quest;
import l2r.gameserver.model.quest.QuestState;
public class _551_OlympiadStarter extends Quest
implements ScriptFile
{
private static final int _npc = 31688;
private static final int _olymp3 = 17238;
private static final int _olymp5 = 17239;
private static final int _olymp10 = 17240;
private static final int _olympChest = 17169;
public _551_OlympiadStarter()
{
super(false);
addStartNpc(31688);
addTalkId(new int[] { 31688 });
addQuestItem(new int[] { 17169 });
addQuestItem(new int[] { 17240 });
addQuestItem(new int[] { 17239 });
addQuestItem(new int[] { 17238 });
}
public String onEvent(String paramString, QuestState paramQuestState, L2NpcInstance paramL2NpcInstance)
{
L2Player localL2Player = paramQuestState.getPlayer();
int i = paramQuestState.getCond();
String str = paramString;
if (paramQuestState == null)
return str;
if (paramL2NpcInstance.getNpcId() == 31688)
{
if (i == 1)
if (paramString.equals("31688-03.htm"))
{
paramQuestState.setState(2);
paramQuestState.setCond(Olympiad.getCompetitionDone(localL2Player.getObjectId()));
paramQuestState.setCond(1);
paramQuestState.playSound(SOUND_ACCEPT);
}
else if (paramString.equals("exchange"))
{
if ((paramQuestState.getQuestItemsCount(17238) >= 1L) || (paramQuestState.getQuestItemsCount(17239) >= 1L) || (paramQuestState.getQuestItemsCount(17240) >= 1L))
{
if ((i == 2) && (paramQuestState.getQuestItemsCount(17238) >= 1L))
{
paramQuestState.giveItems(17169, 1L);
paramQuestState.takeItems(17238, 1L);
paramQuestState.playSound(SOUND_ITEMGET);
}
if ((i == 3) && (paramQuestState.getQuestItemsCount(17239) >= 1L))
{
paramQuestState.giveItems(17169, 2L);
paramQuestState.takeItems(17239, 1L);
paramQuestState.playSound(SOUND_ITEMGET);
}
if ((i == 4) && (paramQuestState.getQuestItemsCount(17240) >= 1L))
{
paramQuestState.giveItems(17169, 4L);
paramQuestState.takeItems(17240, 1L);
paramQuestState.playSound(SOUND_ITEMGET);
paramQuestState.setState(3);
paramQuestState.playSound(SOUND_FINISH);
paramQuestState.exitCurrentQuest(false);
}
return "31688-06.htm";
}
return "31688-07.htm";
}
return "31688-05.htm";
}
return str;
}
public String onTalk(L2NpcInstance paramL2NpcInstance, QuestState paramQuestState)
{
L2Player localL2Player = paramQuestState.getPlayer();
String str = "noquest";
if (paramQuestState == null)
return str;
if (Olympiad._inCompPeriod)
{
if ((localL2Player.getLevel() >= 75) && (localL2Player.getActiveClass().isBase()) && (localL2Player.isNoble()))
{
if (paramQuestState.getState() == 3)
return "31688-01.htm";
return "31688-00.htm";
}
return "31688-02.htm";
}
return "31688-08.htm";
}
}
L2jServer Quest Script
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.base.SubClass;
import com.l2jserver.gameserver.model.olympiad.Olympiad;
import com.l2jserver.gameserver.model.actor.instance.L2NpcInstance;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
public class Q551_OlympiadStarter extends Quest
{
private static final String qn = "Q551_OlympiadStarter";
//Npc
private static final int OlyManager = 31688;
//Items
private static final int _olymp3 = 17238;
private static final int _olymp5 = 17239;
private static final int _olymp10 = 17240;
private static final int _olympChest = 17169;
public String onEvent(String event, QuestState st, L2PcInstance player, L2NpcInstance npc)
{
String htmltext = event;
if (st == null)
htmltext = getNoQuestMsg(player);
if (npc.getNpcId() == 31688)
{
if (event.equals("31688-03.htm"))
{
st.setState(2);
st.set("cond","Olympiad.getCompetitionDone(Player.getObjectId())");
st.set("cond", "1");
st.playSound("ItemSound.quest_accept");
}
else if (event.equals("exchange"))
{
if ((st.getQuestItemsCount(17238) >= 1L) || (st.getQuestItemsCount(17239) >= 1L) || (st.getQuestItemsCount(17240) >= 1L))
{
if ((i == 2) && (st.getQuestItemsCount(17238) >= 1L))
{
st.giveItems(17169, 1L);
st.takeItems(17238, 1L);
st.playSound("ItemSound.quest_itemget");
}
if ((i == 3) && (st.getQuestItemsCount(17239) >= 1L))
{
st.giveItems(17169, 2L);
st.takeItems(17239, 1L);
st.playSound("ItemSound.quest_itemget");
}
if ((i == 4) && (st.getQuestItemsCount(17240) >= 1L))
{
st.giveItems(17169, 4L);
st.takeItems(17240, 1L);
st.playSound("ItemSound.quest_itemget");
st.setState(3);
st.playSound("ItemSound.quest_finish");
st.exitQuest(false);
}
return "31688-06.htm";
}
return "31688-07.htm";
}
return "31688-05.htm";
}
return htmltext;
}
public String onTalk(L2NpcInstance npc, L2PcInstance player)
{
String htmltext = getNoQuestMsg(player);
QuestState st = player.getQuestState(qn);
if (st == null)
return htmltext;
if (Olympiad._inCompPeriod)
{
if ((player.getLevel() >= 75) && (player.isNoble()))
{
if (st.getInt("cond") == 3)
htmltext ="31688-01.htm";
else
htmltext ="31688-00.htm";
}
else
htmltext ="31688-02.htm";
}
else
htmltext ="31688-08.htm";
return htmltext;
}
public Q551_OlympiadStarter(int questId, String name, String descr)
{
super(questId, name, descr);
addStartNpc(OlyManager);
addTalkId(OlyManager);
questItemIds = new int[] {_olymp3};
questItemIds = new int[] {_olymp5};
questItemIds = new int[] {_olymp10};
questItemIds = new int[] {_olympChest};
}
public static void main(String[] args)
{
new Q551_OlympiadStarter(551, qn, "Olympiad Starter");
}
}
Html Files
31688-01.htm
____________
<html>
<body>
<font color="FFCC00">Менеджер великой олимпиады:</font><br>
Данное задание выполняется раз в сутки, по таймеру. Каждое утро в 6:30 таймер сбрасывается<br>
<br>
</body>
</html>
____________
31688-02.htm
___________
<html>
<body>
<font color="FFCC00">Менеджер великой олимпиады:</font><br>
Я немогу позволить тебе выполнить это задание!<br>
(Этот квест могут выполнять только персонажи выше 75 уровня основным классом)<br>
<br>
</body>
</html>
___________
31688-03.htm
___________
<html>
<body>
<font color="FFCC00">Менеджер великой олимпиады:</font><br>
Всё что тебе надо сделать - провести на олимпиаде 10 матчей. Мы не смотрим на исход, мы смотрим на твою смелость! Почему бы не подраться за хорошую награду?!<br>
Награда:<br>
Olympiad Match 3 Participation Certificate - за 3 проведенных матча.</br>
Olympiad Match 5 Participation Certificate - за 5 проведенных матчей.</br>
Olympiad Match 10 Participation Certificate- за 10 проведенных матчей.<br>
<a action="bypass -h Quest _551_OlympiadStarter 31688-05.htm">Я согласен.</a><br>
<br>
</body>
</html>
____________
31688-05.htm
____________
<html>
<body>
<font color="FFCC00">Менеджер великой олимпиады:</font><br>
Ты готов доказать свою смелость?<br>
<a action="bypass -h Quest _551_OlympiadStarter exchange">Да</a><br>
<br>
</body>
</html>
____________
31688-06.htm
____________
<html>
<body>
<font color="FFCC00">Менеджер великой олимпиады:</font><br>
Ты отлично справился, вот твоя награда!<br>
<br>
</body>
</html>
___________
31688-07.htm
___________
<html>
<body>
<font color="FFCC00">Менеджер великой олимпиады:</font><br>
Тебе не обмануть меня!<br>
(У вас недостаточно квестовых предметов)
<br>
</body>
</html>
___________
31688-08.htm
___________
<html>
<body>
<font color="FFCC00">Менеджер великой олимпиады:</font><br>
Олимпиада ещё не началась!<br>
<br>
</body>
</html>
Don’t miss the new Telegram gifts with our Telegram Stars purchasing bot!
A great opportunity to invest in a stable digital asset at an early stage while the market is still forming.
Buy other existing gifts in the official store using Telegram Stars, pay for subscriptions, donate to games and projects, pay for Premium subscriptions, and react to messages in channels!
Low prices, multiple payment options, and other cool unique features!
⚡ Try it today — SOCNET STARS BOT ⚡
Active links to SOCNET stores:
Digital Goods Store (Website): Go
Store Telegram Bot: Go – convenient access to the store via Telegram messenger.
⭐ Telegram Stars Purchase Bot: Go – fast and profitable way to buy stars in Telegram.
SMM Panel: Go – promote your social media accounts.
We present to you the current list of promotions and special offers for purchasing our products and services:
1️⃣ Promo code OCTOBER2025 (8% discount) for purchases in our store (Website, bot) in October! You can also use the promo code SOCNET (15% discount) for your first purchase.
2️⃣ Get $1 on your store balance or a 10–20% discount — just write your username after registration on our website using the template:
"SEND ME BONUS, MY USERNAME IS..." — post it in our forum thread!
3️⃣ Get $1 for your first SMM Panel trial — simply open a ticket titled “Get Trial Bonus” on our website (Support).
4️⃣ Weekly ⭐ Telegram Stars giveaways in our Telegram channel and in our Telegram Stars 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 and Support:
➡ Telegram: https://t.me/socnet_support
➡ WhatsApp: https://wa.me/79051904467
➡ Discord: socnet_support
➡ ✉ Email: solomonbog@socnet.store
When something’s inconvenient, people always find a way to make life easier.
It’s dark? Turn on a lamp — no more tripping around.
The socket’s hiding under the bed? Boom, extension cord.
Noisy neighbor? Headphones and soundproof walls.
Too lazy to move? Just have a kid, problem solved.
Lost one sock? Humanity just gave up on that one.
And for everything else — there’s VibeSMS.
Because getting your verification codes should be as simple as flipping a switch 💡⚡
Website: https://vibe-sms.net/
📱 Telegram channel: https://t.me/vibe_sms
Question
janiko
Hi EveryOne.
I tried to rewrite Quest 551_OlympiadStarter from l2rebellion to L2jserver.
I need help from users because i have some misunderstanding.
The Problem is that i cant remake st.setState(2); st.setState(3); st.setState(1);
Sorry Maby its wrong dissision.
L2Rebellion Quest Script
L2jServer Quest Script
Html Files
1 answer to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now