Addition of quest How to Overcome Fear (560).

Contributed by Liamxroy.
This commit is contained in:
MobiusDevelopment 2019-04-03 19:52:11 +00:00
parent 75a77de926
commit 98fd413e24
10 changed files with 210 additions and 39 deletions

View File

@ -7,7 +7,6 @@
557 Red Libra Request - Fall of Etina
558 Request from the Red Libra Guild - Sea of Spores
559 Request from the Red Libra Guild - Krofins Nest
560 How to Overcome Fear
561 Basic Mission: Harnak Underground Ruins
562 Basic Mission: Altar of Evil
563 Basic Mission: Bloody Swampland

View File

@ -391,6 +391,7 @@ import quests.Q10840_TimeToRecover.Q10840_TimeToRecover;
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.Q10516_UnveiledFafurionTemple.Q10516_UnveiledFafurionTemple;
import quests.custom.Q10517_FafurionsMinions.Q10517_FafurionsMinions;
import quests.custom.Q10529_IvoryTowersResearchFloatingSeaJournal.Q10529_IvoryTowersResearchFloatingSeaJournal;
@ -502,7 +503,7 @@ public class QuestMasterHandler
Q00529_RegularBarrierMaintenance.class, // FIXME: Custom.
Q00551_OlympiadStarter.class,
Q00553_OlympiadUndefeated.class,
Q00560_HowToOvercomeFear.class, // TODO: Not done.
Q00560_HowToOvercomeFear.class, // FIXME: Custom.
Q00561_BasicMissionHarnakUndergroundRuins.class, // TODO: Not done.
Q00562_BasicMissionAltarOfEvil.class, // TODO: Not done.
Q00563_BasicMissionBloodySwampland.class, // TODO: Not done.

View File

@ -0,0 +1,191 @@
/*
* 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.Q00560_HowToOvercomeFear;
import java.util.HashSet;
import java.util.Set;
import com.l2jmobius.gameserver.enums.QuestType;
import com.l2jmobius.gameserver.model.actor.Npc;
import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import com.l2jmobius.gameserver.model.holders.NpcLogListHolder;
import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
import com.l2jmobius.gameserver.network.NpcStringId;
import quests.custom.Q10517_FafurionsMinions.Q10517_FafurionsMinions;
/**
* How to Overcome Fear (560)
* @URL https://l2wiki.com/How_to_Overcome_Fear
* @author Liamxroy
*/
public class Q00560_HowToOvercomeFear extends Quest
{
// NPCs
private static final int START_NPC = 34489;
private static final int[] MONSTERS =
{
24318,
24319,
24320,
24321,
24322,
24323,
24324,
24325,
24326,
24327,
24328,
24329,
};
// Item
private static final int MONSTER_DROP = 80324;
// Misc
private static final int REQUIRED_DROP_COUNT = 30;
private static final int KILLING_NPCSTRING_ID = NpcStringId.LV_110_HOW_TO_OVERCOME_FEAR_IN_PROGRESS.getId();
private static final QuestType QUEST_TYPE = QuestType.DAILY; // REPEATABLE, ONE_TIME, DAILY
private static final boolean PARTY_QUEST = true;
private static final int KILLING_COND = 1;
private static final int FINISH_COND = 2;
private static final int MIN_LEVEL = 110;
public Q00560_HowToOvercomeFear()
{
super(560);
addStartNpc(START_NPC);
addTalkId(START_NPC);
addKillId(MONSTERS);
registerQuestItems(MONSTER_DROP);
addCondMinLevel(MIN_LEVEL, getNoQuestMsg(null));
addCondCompletedQuest(Q10517_FafurionsMinions.class.getSimpleName(), 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":
{
if (qs.isCreated())
{
qs.startQuest();
qs.setCond(KILLING_COND);
}
break;
}
case "reward.html":
{
if (qs.isCond(FINISH_COND) && (getQuestItemsCount(player, MONSTER_DROP) >= REQUIRED_DROP_COUNT))
{
takeItems(player, MONSTER_DROP, -1);
// Reward.
addExpAndSp(player, 166685607000L, 166685580);
giveAdena(player, 4190158, 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)
{
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;
}
}
}
return htmltext;
}
@Override
public String onKill(Npc npc, PlayerInstance killer, boolean isSummon)
{
final QuestState qs = PARTY_QUEST ? getRandomPartyMemberState(killer, -1, 3, npc) : getQuestState(killer, false);
if ((qs != null) && qs.isCond(KILLING_COND))
{
if (giveItemRandomly(killer, npc, MONSTER_DROP, 1, REQUIRED_DROP_COUNT, 1, true))
{
qs.setCond(FINISH_COND);
}
sendNpcLogList(killer);
}
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, false, (int) getQuestItemsCount(player, MONSTER_DROP)));
return holder;
}
return super.getNpcLogList(player);
}
}

View File

@ -0,0 +1,3 @@
<html><body>Lupicia:<br>
You have to defeat monsters created by Fafurion, dwelling in Fafurion Temple and to bring her Fragments of Power carried by his closest minions. To hunt: <font color="LEVEL">Temple Guard Captain, Temple Guard Captain, Elite Guardian Warrior, Elite Guardian Archer, Temple Patrol Guard, Temple Knight Recruit, Temple Guard, Temple Guardian Warrior, Temple Wizard, Temple Guardian Wizard, Temple Priest, Temple Guardian Priest, Starving Water Dragon</font>. You need to get 30 <font color="LEVEL">Fragment of Power</font>.
</body></html>

View File

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

View File

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

View File

@ -0,0 +1,5 @@
<html><body>Lupicia:<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 Q00560_HowToOvercomeFear accept.htm">"Say no more. I accept."</Button>
</body></html>

View File

@ -32,7 +32,7 @@ import com.l2jmobius.gameserver.network.NpcStringId;
import quests.custom.Q10516_UnveiledFafurionTemple.Q10516_UnveiledFafurionTemple;
/**
* https://l2wiki.com/Fafurion%27s_Minions (10517)
* Fafurion's Minions (10517)
* @URL https://l2wiki.com/Fafurion%27s_Minions
* @author Liamxroy
*/

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 com.l2jmobius.Config;
import com.l2jmobius.gameserver.model.quest.Quest;
/**
* @author Mobius
*/
public class Q10517_FafurionsMinions extends Quest
{
private static final int START_NPC = 34489;
public Q10517_FafurionsMinions()
{
super(10517);
addStartNpc(START_NPC);
addTalkId(START_NPC);
addCondMinLevel(Config.PLAYER_MAXIMUM_LEVEL, getNoQuestMsg(null));
}
}

View File

@ -320,6 +320,7 @@
<set name="is_depositable" val="false" />
<set name="is_sellable" val="false" />
<set name="is_stackable" val="true" />
<set name="is_questitem" val="true" />
</item>
<item id="80325" name="Deformed Claw" type="EtcItem">
<!-- Proof of the secret relationship between Krofins and Fafurion. The deformed claws indicate that Fafurion has bestowed some of his power upon the Krofins. Gather the claws and take them to Lionel Hunter in Heine. -->