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 are not satisfied with just participating in the Grand Olympiad, and you wish to fight for victory, I have a suitable mission for you. Will you accept the challenge? If you prove your abilities, I promise to give you a fitting reward.<br>
<a action="bypass -h Quest Q00553_OlympiadUndefeated 31688-03.html">Accept</a><br>
<a action="bypass -h Quest Q00553_OlympiadUndefeated 31688-02.htm">"Tell me more first."</a>
</body></html>

View File

@@ -0,0 +1,4 @@
<html><body>Grand Olympiad Manager:<br>
Enter the Olympiad and take on the challenge of <font color="LEVEL">10 consecutive wins</font>! As you know, consecutive wins means not losing along the way. Whether you have <font color="LEVEL">2 consecutive wins</font> or <font color="LEVEL">5 consecutive wins</font>, you will receive a reward. But it will be nothing compared to the reward for 10 consecutive wins. Also, <font color="LEVEL">5 and 10 consecutive wins</font> will get you the <font color="LEVEL">Medal of Honor</font>. If you're ready, you can come to me. But please remember that once you receive the reward, you cannot take on this mission again today.<br>
<a action="bypass -h Quest Q00553_OlympiadUndefeated 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 fulfill the requirements for receiving a reward.<br>
Please remember about the consecutive wins - you must not be defeated in the middle! There is a reward for 2 consecutive wins or for 5 consecutive wins, but they are nothing compared to the reward for 10 consecutive wins! If you're still satisfied, you can come to me.
</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 can;t take on the mission again today. Still want the reward?<br>
<a action="bypass -h Quest Q00553_OlympiadUndefeated 31688-04.html">"Yes."</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 can;t take on the mission again today. Still want the reward?<br>
<a action="bypass -h Quest Q00553_OlympiadUndefeated 31688-04.html">"Yes."</a>
</body></html>

View File

@@ -0,0 +1,201 @@
/*
* 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.Q00553_OlympiadUndefeated;
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 Undefeated (553)<br>
* @author lion
* @since Nov. 5, 2011, improved by jurchiks
* @version 2011-02-05 Based on official H5 PTS server and 551 quest ;)
*/
public class Q00553_OlympiadUndefeated extends Quest
{
// NPC
private static final int MANAGER = 31688;
// Items
private static final int WIN_CONF_2 = 17244;
private static final int WIN_CONF_5 = 17245;
private static final int WIN_CONF_10 = 17246;
private static final int OLY_CHEST = 17169;
private static final int MEDAL_OF_GLORY = 21874;
public Q00553_OlympiadUndefeated()
{
super(553, Q00553_OlympiadUndefeated.class.getSimpleName(), "Olympiad Undefeated");
addStartNpc(MANAGER);
addTalkId(MANAGER);
registerQuestItems(WIN_CONF_2, WIN_CONF_5, WIN_CONF_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(WIN_CONF_2) + st.getQuestItemsCount(WIN_CONF_5);
if (count > 0)
{
st.giveItems(OLY_CHEST, count);
if (count == 2)
{
st.giveItems(MEDAL_OF_GLORY, 3);
}
st.exitQuest(QuestType.DAILY, true);
}
else
{
htmltext = getNoQuestMsg(player); // missing items
}
}
return htmltext;
}
@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() && (st.isCond(1)))
{
final int matches = st.getInt("undefeatable") + 1;
st.set("undefeatable", String.valueOf(matches));
switch (matches)
{
case 2:
if (!st.hasQuestItems(WIN_CONF_2))
{
st.giveItems(WIN_CONF_2, 1);
}
break;
case 5:
if (!st.hasQuestItems(WIN_CONF_5))
{
st.giveItems(WIN_CONF_5, 1);
}
break;
case 10:
if (!st.hasQuestItems(WIN_CONF_10))
{
st.giveItems(WIN_CONF_10, 1);
st.setCond(2);
}
break;
}
}
}
if (looser != null)
{
final L2PcInstance player = looser.getPlayer();
if (player == null)
{
return;
}
final QuestState st = getQuestState(player, false);
if ((st != null) && st.isStarted() && (st.isCond(1)))
{
st.unset("undefeatable");
st.takeItems(WIN_CONF_2, -1);
st.takeItems(WIN_CONF_5, -1);
st.takeItems(WIN_CONF_10, -1);
}
}
}
@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
{
final long count = st.getQuestItemsCount(WIN_CONF_2) + st.getQuestItemsCount(WIN_CONF_5) + st.getQuestItemsCount(WIN_CONF_10);
if ((count == 3) && st.isCond(2))
{
st.giveItems(OLY_CHEST, 4);
st.giveItems(MEDAL_OF_GLORY, 5);
st.exitQuest(QuestType.DAILY, true);
htmltext = "31688-04.html";
}
else
{
htmltext = "31688-w" + count + ".html";
}
}
return htmltext;
}
}