This commit is contained in:
mobius
2015-01-01 20:02:50 +00:00
parent eeae660458
commit a6a3718849
17894 changed files with 2818932 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
<html><body>Grand Olympiad Manager:<br>
You do not meet the requirements for taking on this mission.<br>
(Only noblesse characters above level 75 who have completed a third class transfer can undertake this quest.)
</body></html>

View File

@@ -0,0 +1,5 @@
<html><body>Grand Olympiad Manager:<br>
If you receive a mission involving challenging the Olympiad before you enter the Grand Olympiad, you can receive additional rewards. If you're qualified, why don't you try making the challenge?<br>
<a action="bypass -h Quest Q00551_OlympiadStarter 31688-03.html">Accept</a><br>
<a action="bypass -h Quest Q00551_OlympiadStarter 31688-02.htm">"Can you tell me more?"</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Grand Olympiad Manager:<br>
There is a reward for entering 10 games. But you will receive a reward by participating in 3 games, then in 5 games. You will also get rewared with the <font color="LEVEL">Medal of Honor</font> if you participate in <font color="LEVEL">5 and 10</font> games.<br>
<a action="bypass -h Quest Q00551_OlympiadStarter 31688-03.html">Accept</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Grand Olympiad Manager:<br>
The mission has been accepted. Please check to see if there are any other missions. Once preparations are complete, challenge the Olympiad.<br>
<a action="bypass -h npc_%objectId%_Quest">See other missions.</a>
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Grand Olympiad Manager:<br>
Well done. Please come back tomorrow.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Grand Olympiad Manager:<br>
You have already received the reward for this mission. You should rest before you try again!<br>
(This quest can only be undertaken once a day. This quest resets everyday at 6:30 AM.)
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Grand Olympiad Manager:<br>
You did not fulfil the requirements for receiving a reward.<br>
You must participate in more than 3 Olympiad matches in order to receive a reward. If you participate 5 times, the reward will increase, and if you participate more than 10 times, you will receive the promised ultimate reward.
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Grand Olympiad Manager:<br>
I will give you an incomplete reward. Please remember that once you receive the reward, you cannot take on the mission anymore today. Do you still want to go ahead?<br>
<a action="bypass -h Quest Q00551_OlympiadStarter 31688-04.html">"Yes please."</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Grand Olympiad Manager:<br>
I will give you an incomplete reward. Please remember that once you receive the reward, you cannot take on the mission anymore today. Do you still want to go ahead?<br>
<a action="bypass -h Quest Q00551_OlympiadStarter 31688-04.html">"Yes please."</a>
</body></html>

View File

@@ -0,0 +1,251 @@
/*
* Copyright (C) 2004-2014 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* L2J DataPack is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package quests.Q00551_OlympiadStarter;
import com.l2jserver.gameserver.enums.QuestType;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.olympiad.CompetitionType;
import com.l2jserver.gameserver.model.olympiad.Participant;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State;
/**
* Olympiad Starter (551)<br>
* @author Gnacik
* @since Nov. 5, 2011, improved by jurchiks
* @version 2011-02-04 Based on official H5 PTS server
*/
public class Q00551_OlympiadStarter extends Quest
{
private static final int MANAGER = 31688;
private static final int CERT_3 = 17238;
private static final int CERT_5 = 17239;
private static final int CERT_10 = 17240;
private static final int OLY_CHEST = 17169;
private static final int MEDAL_OF_GLORY = 21874;
public Q00551_OlympiadStarter()
{
super(551, Q00551_OlympiadStarter.class.getSimpleName(), "Olympiad Starter");
addStartNpc(MANAGER);
addTalkId(MANAGER);
registerQuestItems(CERT_3, CERT_5, CERT_10);
addOlympiadMatchFinishId();
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState st = getQuestState(player, false);
if (st == null)
{
return getNoQuestMsg(player);
}
String htmltext = event;
if (event.equalsIgnoreCase("31688-03.html"))
{
st.startQuest();
}
else if (event.equalsIgnoreCase("31688-04.html"))
{
final long count = st.getQuestItemsCount(CERT_3) + st.getQuestItemsCount(CERT_5);
if (count > 0)
{
st.giveItems(OLY_CHEST, count); // max 2
if (count == 2)
{
st.giveItems(MEDAL_OF_GLORY, 3);
}
st.exitQuest(QuestType.DAILY, true);
}
else
{
htmltext = super.getNoQuestMsg(player); // missing items
}
}
return htmltext;
}
@Override
public void onOlympiadLose(L2PcInstance loser, CompetitionType type)
{
if (loser != null)
{
final QuestState st = getQuestState(loser, false);
if ((st != null) && st.isStarted())
{
final int matches = st.getInt("matches") + 1;
switch (matches)
{
case 3:
if (!st.hasQuestItems(CERT_3))
{
st.giveItems(CERT_3, 1);
}
break;
case 5:
if (!st.hasQuestItems(CERT_5))
{
st.giveItems(CERT_5, 1);
}
break;
case 10:
if (!st.hasQuestItems(CERT_10))
{
st.giveItems(CERT_10, 1);
}
break;
}
st.set("matches", String.valueOf(matches));
}
}
}
@Override
public void onOlympiadMatchFinish(Participant winner, Participant looser, CompetitionType type)
{
if (winner != null)
{
final L2PcInstance player = winner.getPlayer();
if (player == null)
{
return;
}
final QuestState st = getQuestState(player, false);
if ((st != null) && st.isStarted())
{
final int matches = st.getInt("matches") + 1;
switch (matches)
{
case 3:
if (!st.hasQuestItems(CERT_3))
{
st.giveItems(CERT_3, 1);
}
break;
case 5:
if (!st.hasQuestItems(CERT_5))
{
st.giveItems(CERT_5, 1);
}
break;
case 10:
if (!st.hasQuestItems(CERT_10))
{
st.giveItems(CERT_10, 1);
}
break;
}
st.set("matches", String.valueOf(matches));
}
}
if (looser != null)
{
final L2PcInstance player = looser.getPlayer();
if (player == null)
{
return;
}
final QuestState st = getQuestState(player, false);
if ((st != null) && st.isStarted())
{
final int matches = st.getInt("matches") + 1;
switch (matches)
{
case 3:
if (!st.hasQuestItems(CERT_3))
{
st.giveItems(CERT_3, 1);
}
break;
case 5:
if (!st.hasQuestItems(CERT_5))
{
st.giveItems(CERT_5, 1);
}
break;
case 10:
if (!st.hasQuestItems(CERT_10))
{
st.giveItems(CERT_10, 1);
}
break;
}
st.set("matches", String.valueOf(matches));
}
}
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = getNoQuestMsg(player);
final QuestState st = getQuestState(player, true);
if (st == null)
{
return htmltext;
}
if ((player.getLevel() < 75) || !player.isNoble())
{
htmltext = "31688-00.htm";
}
else if (st.isCreated())
{
htmltext = "31688-01.htm";
}
else if (st.isCompleted())
{
if (st.isNowAvailable())
{
st.setState(State.CREATED);
if ((player.getLevel() < 75) || !player.isNoble())
{
htmltext = "31688-00.htm";
}
}
else
{
htmltext = "31688-05.html";
}
}
else if (st.isStarted())
{
final long count = st.getQuestItemsCount(CERT_3) + st.getQuestItemsCount(CERT_5) + st.getQuestItemsCount(CERT_10);
if (count == 3)
{
htmltext = "31688-04.html";
st.giveItems(OLY_CHEST, 4);
st.giveItems(MEDAL_OF_GLORY, 5);
st.exitQuest(QuestType.DAILY, true);
}
else
{
htmltext = "31688-s" + count + ".html";
}
}
return htmltext;
}
}