Reworked Quest The Man Of Mystery (10791).

Contributed by gigilo1968.
This commit is contained in:
MobiusDev
2016-04-12 08:29:37 +00:00
parent b5a5f9ce4b
commit 5f8f6df5f6
12 changed files with 218 additions and 99 deletions

View File

@@ -42,6 +42,7 @@ ai/npc/FortressSiegeManager/FortressSiegeManager.java
ai/npc/FreyasSteward/FreyasSteward.java ai/npc/FreyasSteward/FreyasSteward.java
ai/npc/Hardin/Hardin.java ai/npc/Hardin/Hardin.java
ai/npc/Jinia/Jinia.java ai/npc/Jinia/Jinia.java
ai/npc/KainVanHalter/KainVanHalter.java
ai/npc/KetraOrcSupport/KetraOrcSupport.java ai/npc/KetraOrcSupport/KetraOrcSupport.java
ai/npc/LaVieEnRose/LaVieEnRose.java ai/npc/LaVieEnRose/LaVieEnRose.java
ai/npc/Mammons/Mammons.java ai/npc/Mammons/Mammons.java

View File

@@ -0,0 +1,4 @@
<html><body>Kain:<br>
You aren't strong enough to be out here alone.<br>
I stopped by because someone was having trouble with Stakato. How funny it's another Ertheia.<br>
</body></html>

View File

@@ -0,0 +1,6 @@
<html><body>Kain:<br>
What are Stakatos doing here?<br>
Huh? You're Ertheia. Faeron must be stable enough for you to leave town, eh?<br>
But what are you doing here? Did Stakatos attack you?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest KainVanHalter thank">"Yes. Thank you for helping me."</Button>
</body></html>

View File

@@ -0,0 +1,114 @@
/*
* 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 ai.npc.KainVanHalter;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.actor.instance.L2QuestGuardInstance;
import com.l2jmobius.gameserver.model.quest.QuestState;
import ai.npc.AbstractNpcAI;
import quests.Q10791_TheManOfMystery.Q10791_TheManOfMystery;
/**
* Kain Ven Halter AI
* @author Gigi and
*/
final class KainVanHalter extends AbstractNpcAI
{
// NPC
private static final int KAIN_VAN_HALTER = 33993;
// Monster
private static final int NEEDLE_STAKATO_CAPTAIN = 27542;
private static final int NEEDLE_STAKATO = 27543;
private KainVanHalter()
{
super(KainVanHalter.class.getSimpleName(), "ai/npc");
addStartNpc(KAIN_VAN_HALTER);
addFirstTalkId(KAIN_VAN_HALTER);
addTalkId(KAIN_VAN_HALTER);
addSeeCreatureId(KAIN_VAN_HALTER);
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = player.getQuestState(Q10791_TheManOfMystery.class.getSimpleName());
if ((qs != null) && (player.getRace() == Race.ERTHEIA))
{
return "33993.html";
}
return super.onFirstTalk(npc, player);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if ("thank".equals(event))
{
npc.deleteMe();
return "33993-01.html";
}
if (npc instanceof L2QuestGuardInstance)
{
final L2QuestGuardInstance kain = (L2QuestGuardInstance) npc;
//@formatter:off
final L2Npc stacato = (L2Npc) kain.getKnownList().getKnownCharactersInRadius(150)
.stream()
.filter(L2Object::isMonster)
.filter(obj -> ((obj.getId() == NEEDLE_STAKATO_CAPTAIN) || (obj.getId() == NEEDLE_STAKATO)))
.findFirst()
.orElse(null);
//@formatter:on
if (stacato != null)
{
addAttackDesire(kain, stacato);
kain.setCanStopAttackByTime(false);
kain.setCanReturnToSpawnPoint(false);
kain.setIsInvul(true);
}
else
{
startQuestTimer("START_ATTACK", 250, npc, null);
}
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onSeeCreature(L2Npc npc, L2Character creature, boolean isSummon)
{
if (creature.isPlayer() && (npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_ATTACK))
{
startQuestTimer("START_ATTACK", 1000, npc, null);
}
return super.onSeeCreature(npc, creature, isSummon);
}
public static void main(String[] args)
{
new KainVanHalter();
}
}

View File

@@ -1,4 +1,4 @@
<html><body>Tracker Dokara:<br> <html><body>Tracker Dokara:<br>
Wait! I thought if we felled that many Stakatos it'd be enough, but there's more of them. We'll need to find a better solution to this.<br> Wait! I thought if we felled that many Stakatos it'd be enough, but there's more of them. We'll need to find a better solution to this.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10791_TheManOfMystery 33847-02.htm">"What do you want me to do?"</Button> <Button ALIGN=LEFT ICON="Normal" action="bypass -h Quest Q10791_TheManOfMystery 33847-02.htm">"What do you want me to do?"</Button>
</body></html> </body></html>

View File

@@ -1,6 +1,5 @@
<html><body>Tracker Dokara:<br> <html><body>Tracker Dokara:<br>
A cocoon? No!<br> A cocoon? No!<br>Are all these Stakatos being born out of cocoons? Wait, it sounds plausible. This means we need to get rid of more than just the Stakatos!<br>
Are all these Stakatos being born out of cocoons? Wait, it sounds plausible. This means we need to get rid of more than just the Stakatos!<br>
I need your help again, in that case.<br> I need your help again, in that case.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10791_TheManOfMystery 33847-04.htm">"Don't tell me..."</Button> <Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q10791_TheManOfMystery 33847-04.htm">"Don't tell me..."</Button>
</body></html> </body></html>

View File

@@ -1,4 +1,4 @@
<html><body>Tracker Dokara:<br> html><body>Tracker Dokara:<br>
So, this Kain has appeared and helped you again? Pa'agrio always shows the way to outstanding warriors.<br> So, this Kain has appeared and helped you again? Pa'agrio always shows the way to outstanding warriors.<br>
Anyway, we know that those Suspicious Cocoons are the root of our problems, and you've gotten rid of a high number of them, so there's no longer a need to worry. Of course, this Kain fellow helped you, but to me, the outcome is all the same.<br> Anyway, we know that those Suspicious Cocoons are the root of our problems, and you've gotten rid of a high number of them, so there's no longer a need to worry. Of course, this Kain fellow helped you, but to me, the outcome is all the same.<br>
Thank you for your help. Thank you for your help.

View File

@@ -16,8 +16,7 @@
*/ */
package quests.Q10791_TheManOfMystery; package quests.Q10791_TheManOfMystery;
import quests.Q10790_AMercenaryHelper.Q10790_AMercenaryHelper; import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.enums.Race; import com.l2jmobius.gameserver.enums.Race;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -25,57 +24,60 @@ import com.l2jmobius.gameserver.model.base.ClassId;
import com.l2jmobius.gameserver.model.holders.ItemHolder; import com.l2jmobius.gameserver.model.holders.ItemHolder;
import com.l2jmobius.gameserver.model.quest.Quest; import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.quest.State;
import com.l2jmobius.gameserver.network.serverpackets.ExQuestNpcLogList; import com.l2jmobius.gameserver.network.serverpackets.ExQuestNpcLogList;
import com.l2jmobius.gameserver.util.Util;
import quests.Q10790_AMercenaryHelper.Q10790_AMercenaryHelper;
/** /**
* The Man of Mystery (10791) * The Man Of Mystery (10791)
* @author Stayway * @URL https://l2wiki.com/The_Man_of_Mystery
* @author Stayway reworked Gigi
*/ */
public class Q10791_TheManOfMystery extends Quest public class Q10791_TheManOfMystery extends Quest
{ {
// NPC // NPCs
private static final int DOKARA = 33847; private static final int DOKARA = 33847;
private static final int VAN_HALTER = 33993; private static final int KAIN_VAN_HALTER = 33993;
// Monsters // Monster
private static final int SUSPICIOUS_COCOON = 27536; private static final int SUSPICIOUS_COCOON = 27536;
private static final int SUSPICIOUS_COCOON1 = 27537; private static final int SUSPICIOUS_COCOON1 = 27537;
private static final int SUSPICIOUS_COCOON2 = 27538; private static final int SUSPICIOUS_COCOON2 = 27538;
private static final int NEEDLE_STAKATO_CAPTAIN = 27542; private static final int NEEDLE_STAKATO_CAPTAIN = 27542;
private static final int NEEDLE_STAKATO = 27543; private static final int NEEDLE_STAKATO = 27543;
// Item // Items
private static final ItemHolder GUILD_COIN = new ItemHolder(37045, 63); private static final ItemHolder STEEL_DOOR_GUILD = new ItemHolder(37045, 63);
private static final ItemHolder ENCHANT_ARMOR_A = new ItemHolder(26351, 5); private static final ItemHolder EAA = new ItemHolder(730, 2);
// Rewards // Reward
private static final int EXP_REWARD = 16968420; private static final int EXP_REWARD = 16968420;
private static final int SP_REWARD = 4072; private static final int SP_REWARD = 4072;
// Other // Misc
private static final int MIN_LEVEL = 65; private static final int MIN_LEVEL = 65;
private static final int MAX_LEVEL = 70; private static final int MAX_LEVEL = 70;
private static final String KILL_VAR = "KillCount";
public Q10791_TheManOfMystery() public Q10791_TheManOfMystery()
{ {
super(10791, Q10791_TheManOfMystery.class.getSimpleName(), "The Man of Mystery"); super(10791, Q10791_TheManOfMystery.class.getSimpleName(), "The Man Of Mystery");
addStartNpc(DOKARA); addStartNpc(DOKARA);
addTalkId(DOKARA, VAN_HALTER); addTalkId(DOKARA);
addKillId(SUSPICIOUS_COCOON, SUSPICIOUS_COCOON1, SUSPICIOUS_COCOON2, NEEDLE_STAKATO_CAPTAIN, NEEDLE_STAKATO); addKillId(SUSPICIOUS_COCOON, SUSPICIOUS_COCOON1, SUSPICIOUS_COCOON2, NEEDLE_STAKATO_CAPTAIN);
addFirstTalkId(VAN_HALTER); addAttackId(NEEDLE_STAKATO_CAPTAIN);
addCondLevel(MIN_LEVEL, MAX_LEVEL, "no_level.html");
addCondRace(Race.ERTHEIA, "noErtheia.html"); addCondRace(Race.ERTHEIA, "noErtheia.html");
addCondClassId(ClassId.MARAUDER, "no_class.html"); addCondClassId(ClassId.MARAUDER, "no_quest.html");
addCondCompletedQuest(Q10790_AMercenaryHelper.class.getSimpleName(), "no_quest.html"); addCondCompletedQuest(Q10790_AMercenaryHelper.class.getSimpleName(), "restriction.html");
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = event;
final QuestState qs = getQuestState(player, false); final QuestState qs = getQuestState(player, false);
if (qs == null) if (qs == null)
{ {
return null; return getNoQuestMsg(player);
} }
String htmltext = null;
switch (event) switch (event)
{ {
case "33847-02.htm": case "33847-02.htm":
@@ -84,10 +86,11 @@ public class Q10791_TheManOfMystery extends Quest
htmltext = event; htmltext = event;
break; break;
} }
case "33847-04.htm": // start the quest case "33847-04.htm":
{ {
qs.startQuest(); qs.startQuest();
qs.set(Integer.toString(SUSPICIOUS_COCOON), 0); qs.set(Integer.toString(SUSPICIOUS_COCOON), 0);
qs.set(Integer.toString(NEEDLE_STAKATO_CAPTAIN), 0);
htmltext = event; htmltext = event;
break; break;
} }
@@ -95,15 +98,15 @@ public class Q10791_TheManOfMystery extends Quest
{ {
if (qs.isCond(3)) if (qs.isCond(3))
{ {
giveItems(player, GUILD_COIN);
giveItems(player, ENCHANT_ARMOR_A);
addExpAndSp(player, EXP_REWARD, SP_REWARD); addExpAndSp(player, EXP_REWARD, SP_REWARD);
giveItems(player, STEEL_DOOR_GUILD);
giveItems(player, EAA);
qs.exitQuest(false, true); qs.exitQuest(false, true);
htmltext = event; htmltext = event;
}
break; break;
} }
} }
}
return htmltext; return htmltext;
} }
@@ -111,73 +114,56 @@ public class Q10791_TheManOfMystery extends Quest
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
final QuestState qs = getQuestState(player, true); final QuestState qs = getQuestState(player, true);
String htmltext = null; String htmltext = getNoQuestMsg(player);
final int npcId = npc.getId();
switch (qs.getState()) if (qs.isCreated())
{
case State.CREATED:
{
if ((player.getLevel() < MIN_LEVEL) || (player.getLevel() > MAX_LEVEL))
{
htmltext = "no_level.html";
}
else
{ {
htmltext = "33847-01.htm"; htmltext = "33847-01.htm";
} }
break; else if (qs.isStarted())
}
case State.STARTED:
{ {
if (qs.isCond(1)) if ((qs.getCond() > 0) && (qs.getCond() < 3))
{ {
htmltext = "33847-05.html"; htmltext = "33847-05.html";
} }
else if ((qs.isCond(3) && (npcId == DOKARA))) else if (qs.isCond(3))
{ {
htmltext = "33847-06.html"; htmltext = "33847-06.html";
} }
else if ((qs.isCond(3) && (npcId == VAN_HALTER)))
{
htmltext = "33993-02.html";
} }
break; else if (qs.isCompleted())
}
case State.COMPLETED:
{ {
htmltext = getAlreadyCompletedMsg(player); htmltext = getAlreadyCompletedMsg(player);
break;
}
} }
return htmltext; return htmltext;
} }
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon)
{ {
final QuestState qs = getQuestState(player, true); if (npc.isScriptValue(0))
String htmltext = null;
switch (npc.getId())
{ {
case VAN_HALTER: for (int i = 0; i < 5; i++)
{ {
if (qs.isCond(3)) final L2Npc creature = addSpawn(NEEDLE_STAKATO, npc.getX() + getRandom(-20, 20), npc.getY() + getRandom(-20, 20), npc.getZ(), npc.getHeading(), true, 120000, false);
{ addAttackDesire(creature, attacker);
htmltext = "33993-01.html";
} }
break; for (int i1 = 0; i1 < 1; i1++)
{
L2Npc helper = addSpawn(KAIN_VAN_HALTER, npc.getX() + getRandom(-100, 100), npc.getY() + getRandom(-100, 100), npc.getZ(), npc.getHeading(), true, 300000, false);
addAttackDesire(helper, npc);
} }
npc.setScriptValue(1);
} }
return htmltext; return super.onAttack(npc, attacker, damage, isSummon);
} }
@Override @Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon) public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{ {
final QuestState qs = getQuestState(killer, false); final QuestState qs = getRandomPartyMemberState(killer, -1, 3, npc);
if ((qs != null) && (qs.getCond() > 0) && (Util.checkIfInRange(1500, npc, qs.getPlayer(), false)))
if ((qs != null) && qs.isCond(1))
{ {
switch (npc.getId()) switch (npc.getId())
{ {
@@ -186,34 +172,41 @@ public class Q10791_TheManOfMystery extends Quest
case SUSPICIOUS_COCOON2: case SUSPICIOUS_COCOON2:
{ {
int kills = qs.getInt(Integer.toString(SUSPICIOUS_COCOON)); int kills = qs.getInt(Integer.toString(SUSPICIOUS_COCOON));
if (kills < 5)
{
kills++; kills++;
qs.set(Integer.toString(SUSPICIOUS_COCOON), kills); qs.set(Integer.toString(SUSPICIOUS_COCOON), kills);
final ExQuestNpcLogList log = new ExQuestNpcLogList(getId()); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
log.addNpc(SUSPICIOUS_COCOON, kills); }
killer.sendPacket(log);
if (kills >= 5) if (kills >= 5)
{ {
qs.unset(Integer.toString(SUSPICIOUS_COCOON));
final L2Npc mob1 = addSpawn(NEEDLE_STAKATO_CAPTAIN, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), true, 600000, false);
addAttackDesire(mob1, qs.getPlayer());
qs.setCond(2); qs.setCond(2);
addAttackDesire(addSpawn(NEEDLE_STAKATO_CAPTAIN, npc.getLocation()), killer);
addAttackDesire(addSpawn(NEEDLE_STAKATO, npc.getLocation()), killer);
addAttackDesire(addSpawn(NEEDLE_STAKATO, npc.getLocation()), killer);
addAttackDesire(addSpawn(NEEDLE_STAKATO, npc.getLocation()), killer);
addAttackDesire(addSpawn(NEEDLE_STAKATO, npc.getLocation()), killer);
} }
break;
} }
case NEEDLE_STAKATO_CAPTAIN: case NEEDLE_STAKATO_CAPTAIN:
{ {
final int killCount = qs.getInt(KILL_VAR) + 1; int kills = qs.getInt(Integer.toString(NEEDLE_STAKATO_CAPTAIN));
if ((killCount == 1) && (qs.isCond(2))) if ((kills < 1) && (qs.isCond(2)))
{ {
qs.unset(Integer.toString(SUSPICIOUS_COCOON)); kills++;
addSpawn(VAN_HALTER, npc.getX() + 20, npc.getY() + 20, npc.getZ(), npc.getHeading(), false, 80000); qs.set(Integer.toString(NEEDLE_STAKATO_CAPTAIN), kills);
qs.setCond(3); playSound(killer, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
if (qs.getInt(Integer.toString(NEEDLE_STAKATO_CAPTAIN)) >= 1)
{
qs.setCond(3, true);
} }
break; break;
} }
} }
final ExQuestNpcLogList log = new ExQuestNpcLogList(getId());
log.addNpc(SUSPICIOUS_COCOON, qs.getInt(Integer.toString(SUSPICIOUS_COCOON)));
log.addNpc(NEEDLE_STAKATO_CAPTAIN, qs.getInt(Integer.toString(NEEDLE_STAKATO_CAPTAIN)));
qs.getPlayer().sendPacket(log);
} }
return super.onKill(npc, killer, isSummon); return super.onKill(npc, killer, isSummon);
} }

View File

@@ -1,3 +1,3 @@
<html><body>Vorbos:<br> <html><body>Tracker Dokara:<br>
You are not Ertheia, this quest is not for you. You are not Ertheia, this quest is not for you.
</body></html> </body></html>

View File

@@ -1,3 +1,4 @@
<html><body>You don't meet level requirements<br> <html><body>Tracker Dokara:<br>
(Quest available from level 65 to 70) You don't meet level requirements<br>
(Quest available from level 65 - 70)
</body></html> </body></html>

View File

@@ -1,3 +1 @@
<html><body>You don't meet requirements<br> <html><body>You are not Marauder class, this quest is not for you.</body></html>
(This quest is available for Ertheia Marauders who's completed quest A Mercenary helper. )
</body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Research Pio:<br>
(Quest only available to Ertheia characters Lv. 58-61 who have completed the quest "A Mercenary Helper.")
</body></html>