Skip to content
Snippets Groups Projects
Commit aa58a198 authored by Zoey76's avatar Zoey76
Browse files

BETA: Quest Expulsion of Evil Spirits (311) in Java.

	* Solo boss AI will be added soon.

Note: High Five feature.
parent 023bb325
No related branches found
No related tags found
No related merge requests found
Showing with 200 additions and 0 deletions
<html><body>Cheiren:<br>
How did you do? If you present proof of the courage that you displayed, I will give you a fitting reward.<br>
<a action="bypass -h npc_%objectId%_multisell 2010">Receive reward for the Ragna Orc's Amulet.</a><br>
<a action="bypass -h Quest Q00311_ExpulsionOfEvilSpirits 32655-11.html">Receive reward for 10 Soul Cores Containing Evil Spirits.</a>
</body></html>
\ No newline at end of file
<html><body>Cheiren:<br>
You have brought back 10 Soul Cores! If I combine the power of these cores with this pendant... like... so. This is the <font color="LEVEL">Guardian Spirit's Pendant</font>! This item is absolutely necessary to stand against <font color="LEVEL">Varangka</font>, the chief of the Ragna Orcs. Without this item, you will not be able to endure his evil powers.<br>
Go west to Kasha's Altar and defeat him, and the power of the evil spirits in this place will be greatly decreased.<br>
<a action="bypass -h npc_%objectId%_multisell 2010">Settle other items.</a><br>
<a action="bypass -h Quest Q00311_ExpulsionOfEvilSpirits 32655-13.html">Say that you are quitting the mission.</a><br>
<a action="bypass -h Quest Q00311_ExpulsionOfEvilSpirits 32655-15.html">Continue the mission.</a>
</body></html>
\ No newline at end of file
<html><body>Cheiren:<br>
There must be at least 10 Soul Cores Containing Evil Spirits. You did not bring back 10.<br>
Is there anything else?<br>
<a action="bypass -h npc_%objectId%_multisell 2010">Settle other items.</a><br>
<a action="bypass -h Quest Q00311_ExpulsionOfEvilSpirits 32655-13.html">Say that you are quitting the mission.</a><br>
<a action="bypass -h Quest Q00311_ExpulsionOfEvilSpirits 32655-15.html">Continue the mission.</a>
</body></html>
\ No newline at end of file
<html><body>Cheiren:<br>
Are you sure you want to stop? You still have items you haven't traded yet. Why not do so first?
</body></html>
\ No newline at end of file
/*
* 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.Q00311_ExpulsionOfEvilSpirits;
import java.util.HashMap;
import java.util.Map;
import com.l2jserver.gameserver.enums.QuestSound;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
/**
* Expulsion of Evil Spirits (311)
* @author Zoey76
*/
public final class Q00311_ExpulsionOfEvilSpirits extends Quest
{
// NPC
private static final int CHAIREN = 32655;
// Items
private static final int PROTECTION_SOULS_PENDANT = 14848;
private static final int SOUL_CORE_CONTAINING_EVIL_SPIRIT = 14881;
private static final int RAGNA_ORCS_AMULET = 14882;
// Misc
private static final int MIN_LEVEL = 80;
private static final int SOUL_CORE_COUNT = 10;
private static final int RAGNA_ORCS_KILLS_COUNT = 100;
private static final int RAGNA_ORCS_AMULET_COUNT = 10;
// Monsters
private static final Map<Integer, Double> MONSTERS = new HashMap<>();
static
{
MONSTERS.put(22691, 0.694); // Ragna Orc
MONSTERS.put(22692, 0.716); // Ragna Orc Warrior
MONSTERS.put(22693, 0.736); // Ragna Orc Hero
MONSTERS.put(22694, 0.712); // Ragna Orc Commander
MONSTERS.put(22695, 0.698); // Ragna Orc Healer
MONSTERS.put(22696, 0.692); // Ragna Orc Shaman
MONSTERS.put(22697, 0.640); // Ragna Orc Seer
MONSTERS.put(22698, 0.716); // Ragna Orc Archer
MONSTERS.put(22699, 0.752); // Ragna Orc Sniper
MONSTERS.put(22701, 0.716); // Varangka's Dre Vanul
MONSTERS.put(22702, 0.662); // Varangka's Destroyer
}
public Q00311_ExpulsionOfEvilSpirits()
{
super(311, Q00311_ExpulsionOfEvilSpirits.class.getSimpleName(), "Expulsion of Evil Spirits");
addStartNpc(CHAIREN);
addTalkId(CHAIREN);
addKillId(MONSTERS.keySet());
registerQuestItems(SOUL_CORE_CONTAINING_EVIL_SPIRIT, RAGNA_ORCS_AMULET);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return null;
}
String htmltext = null;
if (player.getLevel() < MIN_LEVEL)
{
return null;
}
switch (event)
{
case "32655-03.htm":
case "32655-15.html":
{
htmltext = event;
break;
}
case "32655-04.htm":
{
qs.startQuest();
htmltext = event;
break;
}
case "32655-11.html":
{
if (getQuestItemsCount(player, SOUL_CORE_CONTAINING_EVIL_SPIRIT) >= SOUL_CORE_COUNT)
{
takeItems(player, SOUL_CORE_CONTAINING_EVIL_SPIRIT, SOUL_CORE_COUNT);
giveItems(player, PROTECTION_SOULS_PENDANT, 1);
htmltext = event;
}
else
{
htmltext = "32655-12.html";
}
break;
}
case "32655-13.html":
{
if (!hasQuestItems(player, SOUL_CORE_CONTAINING_EVIL_SPIRIT) && (getQuestItemsCount(player, RAGNA_ORCS_AMULET) >= RAGNA_ORCS_AMULET_COUNT))
{
qs.exitQuest(true, true);
htmltext = event;
}
else
{
htmltext = "32655-14.html";
}
break;
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, 1, 2, npc);
if (qs != null)
{
final int count = qs.getMemoStateEx(1) + 1;
if ((count >= RAGNA_ORCS_KILLS_COUNT) && (getRandom(20) < ((count % 100) + 1)))
{
qs.setMemoStateEx(1, 0);
qs.giveItems(SOUL_CORE_CONTAINING_EVIL_SPIRIT, 1);
qs.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
else
{
qs.setMemoStateEx(1, count);
}
qs.giveItemRandomly(npc, RAGNA_ORCS_AMULET, 1, 0, MONSTERS.get(npc.getId()), true);
}
return super.onKill(npc, killer, isSummon);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = getNoQuestMsg(player);
if (qs == null)
{
return htmltext;
}
if (qs.isCreated())
{
htmltext = (player.getLevel() >= MIN_LEVEL) ? "32655-01.htm" : "32655-02.htm";
}
else if (qs.isStarted())
{
htmltext = !hasQuestItems(player, SOUL_CORE_CONTAINING_EVIL_SPIRIT, RAGNA_ORCS_AMULET) ? "32655-05.html" : "32655-06.html";
}
return htmltext;
}
}
...@@ -215,6 +215,7 @@ import quests.Q00307_ControlDeviceOfTheGiants.Q00307_ControlDeviceOfTheGiants; ...@@ -215,6 +215,7 @@ import quests.Q00307_ControlDeviceOfTheGiants.Q00307_ControlDeviceOfTheGiants;
import quests.Q00308_ReedFieldMaintenance.Q00308_ReedFieldMaintenance; import quests.Q00308_ReedFieldMaintenance.Q00308_ReedFieldMaintenance;
import quests.Q00309_ForAGoodCause.Q00309_ForAGoodCause; import quests.Q00309_ForAGoodCause.Q00309_ForAGoodCause;
import quests.Q00310_OnlyWhatRemains.Q00310_OnlyWhatRemains; import quests.Q00310_OnlyWhatRemains.Q00310_OnlyWhatRemains;
import quests.Q00311_ExpulsionOfEvilSpirits.Q00311_ExpulsionOfEvilSpirits;
import quests.Q00312_TakeAdvantageOfTheCrisis.Q00312_TakeAdvantageOfTheCrisis; import quests.Q00312_TakeAdvantageOfTheCrisis.Q00312_TakeAdvantageOfTheCrisis;
import quests.Q00313_CollectSpores.Q00313_CollectSpores; import quests.Q00313_CollectSpores.Q00313_CollectSpores;
import quests.Q00316_DestroyPlagueCarriers.Q00316_DestroyPlagueCarriers; import quests.Q00316_DestroyPlagueCarriers.Q00316_DestroyPlagueCarriers;
...@@ -590,6 +591,7 @@ public class QuestMasterHandler ...@@ -590,6 +591,7 @@ public class QuestMasterHandler
Q00308_ReedFieldMaintenance.class, Q00308_ReedFieldMaintenance.class,
Q00309_ForAGoodCause.class, Q00309_ForAGoodCause.class,
Q00310_OnlyWhatRemains.class, Q00310_OnlyWhatRemains.class,
Q00311_ExpulsionOfEvilSpirits.class,
Q00312_TakeAdvantageOfTheCrisis.class, Q00312_TakeAdvantageOfTheCrisis.class,
Q00313_CollectSpores.class, Q00313_CollectSpores.class,
Q00316_DestroyPlagueCarriers.class, Q00316_DestroyPlagueCarriers.class,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment