Addition of quest Advent of Krofin Subspecies (683).

Contributed by Liamxroy.
This commit is contained in:
MobiusDevelopment 2019-04-16 12:24:24 +00:00
parent 1fd53af3b4
commit c95aae2716
12 changed files with 266 additions and 38 deletions

View File

@ -52,7 +52,6 @@
680 Hunter Guild Request - Sea of Spores
681 Hunter Guild Request - Shadow of the Mother Tree
682 The Strong in the Closed Space
683 Advent of Krofin Subspecies
684 Disturbed Fields
690 |Attack| Begin Alliance Base Defense - 1
691 |Attack| Begin Alliance Base Defense - 2

View File

@ -406,6 +406,7 @@ import quests.Q10841_DeepInsideAteliaFortress.Q10841_DeepInsideAteliaFortress;
import quests.Q10843_AnomalyInTheEnchantedValley.Q10843_AnomalyInTheEnchantedValley;
import quests.custom.Q00529_RegularBarrierMaintenance.Q00529_RegularBarrierMaintenance;
import quests.custom.Q00560_HowToOvercomeFear.Q00560_HowToOvercomeFear;
import quests.custom.Q00683_AdventOfKrofinSubspecies.Q00683_AdventOfKrofinSubspecies;
import quests.custom.Q10516_UnveiledFafurionTemple.Q10516_UnveiledFafurionTemple;
import quests.custom.Q10517_FafurionsMinions.Q10517_FafurionsMinions;
import quests.custom.Q10529_IvoryTowersResearchFloatingSeaJournal.Q10529_IvoryTowersResearchFloatingSeaJournal;
@ -577,7 +578,7 @@ public class QuestMasterHandler
Q00674_ChangesInTheShadowOfTheMotherTree.class, // TODO: Not done.
Q00675_WhatTheThreadOfThePastShows.class, // TODO: Not done.
Q00682_TheStrongInTheClosedSpace.class, // TODO: Not done.
Q00683_AdventOfKrofinSubspecies.class, // TODO: Not done.
Q00683_AdventOfKrofinSubspecies.class, // FIXME: Custom.
Q00684_DisturbedFields.class, // TODO: Not done.
Q00726_LightWithinTheDarkness.class,
Q00727_HopeWithinTheDarkness.class,

View File

@ -0,0 +1,234 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.custom.Q00683_AdventOfKrofinSubspecies;
import java.util.HashSet;
import java.util.Set;
import org.l2jmobius.gameserver.enums.QuestSound;
import org.l2jmobius.gameserver.enums.QuestType;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.NpcLogListHolder;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.quest.QuestState;
import org.l2jmobius.gameserver.model.quest.State;
import org.l2jmobius.gameserver.network.NpcStringId;
/**
* Advent of Krofin Subspecies (683)
* @URL https://l2wiki.com/Advent_of_Krofin_Subspecies
* @author Liamxroy
*/
public class Q00683_AdventOfKrofinSubspecies extends Quest
{
// NPCs
private static final int START_NPC_1 = 33907;
private static final int START_NPC_2 = 34480;
private static final int[] MONSTERS =
{
24309,
24310,
24311,
24312,
24313,
24314,
24315,
24316,
};
// Misc
private static final int REQUIRED_KILL_COUNT = 250;
private static final String KILL_COUNT_VAR = "KillCount";
private static final int KILLING_NPCSTRING_ID = NpcStringId.DEFEAT_KROFIN_SUBSPECIES.getId();
private static final QuestType QUEST_TYPE = QuestType.DAILY; // REPEATABLE, ONE_TIME, DAILY
private static final boolean PARTY_QUEST = false;
private static final int KILLING_COND = 1;
private static final int FINISH_COND = 2;
private static final int MIN_LEVEL = 106;
public Q00683_AdventOfKrofinSubspecies()
{
super(683);
addStartNpc(START_NPC_1, START_NPC_2);
addTalkId(START_NPC_1, START_NPC_2);
addKillId(MONSTERS);
addCondMinLevel(MIN_LEVEL, getNoQuestMsg(null));
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return null;
}
switch (event)
{
case "accept.htm":
case "accept2.htm":
{
if (qs.isCreated())
{
qs.startQuest();
qs.setCond(KILLING_COND);
}
break;
}
case "reward.html":
case "reward2.html":
{
if (qs.isCond(FINISH_COND) && (qs.getInt(KILL_COUNT_VAR) >= REQUIRED_KILL_COUNT))
{
// Reward.
addExpAndSp(player, 49763842650L, 49763790);
giveAdena(player, 3225882, false);
qs.exitQuest(QUEST_TYPE, true);
}
break;
}
default:
{
return null;
}
}
return event;
}
@Override
public String onTalk(Npc npc, PlayerInstance player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
if (npc.getId() == START_NPC_1)
{
switch (qs.getState())
{
case State.CREATED:
{
htmltext = "start.htm";
break;
}
case State.STARTED:
{
if (qs.isCond(KILLING_COND))
{
htmltext = "accept.htm";
}
else if (qs.isCond(FINISH_COND))
{
htmltext = "finish.html";
}
break;
}
case State.COMPLETED:
{
if (qs.isNowAvailable())
{
qs.setState(State.CREATED);
htmltext = "start.htm";
}
else
{
htmltext = getAlreadyCompletedMsg(player, QUEST_TYPE);
}
break;
}
}
}
if (npc.getId() == START_NPC_2)
{
switch (qs.getState())
{
case State.CREATED:
{
htmltext = "start2.htm";
break;
}
case State.STARTED:
{
if (qs.isCond(KILLING_COND))
{
htmltext = "accept2.htm";
}
else if (qs.isCond(FINISH_COND))
{
htmltext = "finish2.html";
}
break;
}
case State.COMPLETED:
{
if (qs.isNowAvailable())
{
qs.setState(State.CREATED);
htmltext = "start2.htm";
}
else
{
htmltext = getAlreadyCompletedMsg(player, QUEST_TYPE);
}
break;
}
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
QuestState qs = PARTY_QUEST ? getRandomPartyMemberState(killer, -1, 3, npc) : getQuestState(killer, false);
if ((qs != null) && qs.isCond(KILLING_COND))
{
final PlayerInstance player = qs.getPlayer();
final int killCount = qs.getInt(KILL_COUNT_VAR) + 1;
if (killCount <= REQUIRED_KILL_COUNT)
{
qs.set(KILL_COUNT_VAR, killCount);
if (killCount >= REQUIRED_KILL_COUNT)
{
qs.setCond(FINISH_COND, true);
}
else if (killCount < REQUIRED_KILL_COUNT)
{
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
sendNpcLogList(player);
}
}
}
return super.onKill(npc, killer, isSummon);
}
@Override
public Set<NpcLogListHolder> getNpcLogList(PlayerInstance player)
{
final QuestState qs = getQuestState(player, false);
if ((qs != null) && qs.isCond(KILLING_COND))
{
final Set<NpcLogListHolder> holder = new HashSet<>();
holder.add(new NpcLogListHolder(KILLING_NPCSTRING_ID, true, qs.getInt(KILL_COUNT_VAR)));
return holder;
}
return super.getNpcLogList(player);
}
}

View File

@ -0,0 +1,3 @@
<html><body>Lionel Hunter:<br>
You will have to hunt monsters in the. Hunt <font color="LEVEL">Krophy, Krotany, Kropiora, Krotania, Spiz Krophy, Spiz Krotany, Spiz Kropiora, Spiz Krotania</font>. You have to kill 250 monsters in total.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Heddy:<br>
You will have to hunt monsters in the. Hunt <font color="LEVEL">Krophy, Krotany, Kropiora, Krotania, Spiz Krophy, Spiz Krotany, Spiz Kropiora, Spiz Krotania</font>. You have to kill 250 monsters in total.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Lionel Hunter:<br>
Have you retrieved the items I asked for?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00683_AdventOfKrofinSubspecies reward.html">"Here are your items."</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Heddy:<br>
Have you retrieved the items I asked for?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00683_AdventOfKrofinSubspecies reward2.html">"Here are your items."</Button>
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Lionel Hunter:<br>
Thank you for your assistance.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Heddy:<br>
Thank you for your assistance.
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Lionel Hunter:<br>
If you have time I have a mission for you.<br1>
This area needs to be cleansed.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00683_AdventOfKrofinSubspecies accept.htm">"Say no more. I accept."</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Heddy:<br>
If you have time I have a mission for you.<br1>
This area needs to be cleansed.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00683_AdventOfKrofinSubspecies accept2.htm">"Say no more. I accept."</Button>
</body></html>

View File

@ -1,36 +0,0 @@
/*
* This file is part of the L2J Mobius project.
*
* This program 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.
*
* This program 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.not_done;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.model.quest.Quest;
/**
* @author Mobius
*/
public class Q00683_AdventOfKrofinSubspecies extends Quest
{
private static final int START_NPC = 33907;
public Q00683_AdventOfKrofinSubspecies()
{
super(683);
addStartNpc(START_NPC);
addTalkId(START_NPC);
addCondMinLevel(Config.PLAYER_MAXIMUM_LEVEL, getNoQuestMsg(null));
}
}