Sync with L2jServer HighFive Sep 18th 2015.

This commit is contained in:
MobiusDev
2015-09-19 22:37:08 +00:00
parent 339cab601b
commit a2d764aaf8
134 changed files with 1440 additions and 1014 deletions

View File

@ -18,45 +18,47 @@
*/
package handlers.effecthandlers;
import com.l2jserver.gameserver.ThreadPoolManager;
import java.util.HashMap;
import java.util.Map;
import com.l2jserver.gameserver.model.StatsSet;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Summon;
import com.l2jserver.gameserver.model.conditions.Condition;
import com.l2jserver.gameserver.model.effects.AbstractEffect;
import com.l2jserver.gameserver.model.effects.EffectFlag;
import com.l2jserver.gameserver.model.effects.L2EffectType;
import com.l2jserver.gameserver.model.skills.BuffInfo;
import com.l2jserver.gameserver.model.stats.Stats;
/**
* Servitor Share effect implementation.<br>
* Synchronizing effects on player and servitor if one of them gets removed for some reason the same will happen to another. Partner's effect exit is executed in own thread, since there is no more queue to schedule the effects,<br>
* partner's effect is called while this effect is still exiting issuing an exit call for the effect, causing a stack over flow.
* @author UnAfraid, Zoey76
* Servitor Share effect implementation. Have effect only on servitor's but not on pets Important: Only one effect can be used on char per time.
* @author Zealar
*/
public final class ServitorShare extends AbstractEffect
{
private static final class ScheduledEffectExitTask implements Runnable
{
private final L2Character _effected;
private final int _skillId;
public ScheduledEffectExitTask(L2Character effected, int skillId)
{
_effected = effected;
_skillId = skillId;
}
@Override
public void run()
{
_effected.stopSkillEffects(false, _skillId);
}
}
private final Map<Stats, Double> stats = new HashMap<>(9);
public ServitorShare(Condition attachCond, Condition applyCond, StatsSet set, StatsSet params)
{
super(attachCond, applyCond, set, params);
for (String key : params.getSet().keySet())
{
stats.put(Stats.valueOfXml(key), params.getDouble(key, 1.));
}
}
@Override
public void onStart(BuffInfo info)
{
super.onStart(info);
info.getEffected().getActingPlayer().setServitorShare(stats);
if (info.getEffected().getActingPlayer().getServitors() != null)
{
for (L2Summon summon : info.getEffected().getActingPlayer().getServitors().values())
{
summon.broadcastInfo();
}
}
}
@Override
@ -74,11 +76,13 @@ public final class ServitorShare extends AbstractEffect
@Override
public void onExit(BuffInfo info)
{
final L2Character effected = info.getEffected().isSummon() ? ((L2Summon) info.getEffected()).getOwner() : info.getEffected();
if (effected != null)
info.getEffected().getActingPlayer().setServitorShare(null);
if (info.getEffected().getServitors() != null)
{
ThreadPoolManager.getInstance().scheduleEffect(new ScheduledEffectExitTask(effected, info.getSkill().getId()), 100);
for (L2Summon summon : info.getEffected().getActingPlayer().getServitors().values())
{
summon.broadcastInfo();
}
}
}
}

View File

@ -0,0 +1,4 @@
<html><body>Ancient Stone Tablet:<br>
Upon closer examination, you notice an inscription describing the exploits of the heroes who defeated Daimon the White-Eyed.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00603_DaimonTheWhiteEyedPart1 31548-02.html">Read the inscription</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Ancient Stone Tablet:<br>
Daimon the White-Eyed's most formidable weapon is his magical ability to instantly render his victim totally immobile!<br>
[Illegible text]<br>
As you turn to leave, you hear something fall from the tablet. Upon closer examination, it proves to be a fragment of a mysterious bead.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Ancient Stone Tablet:<br>
You've already read the inscription. Find another tablet.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Ancient Stone Tablet:<br>
Upon closer examination, you notice an inscription describing the exploits of the heroes who defeated Daimon the White-Eyed.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00603_DaimonTheWhiteEyedPart1 31549-02.html">Read the inscription</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Ancient Stone Tablet:<br>
"The knight's necklace shone brightly. His strength had sustained him thus far against the powerful magic of Daimon the White-Eyed, and sensing victory, he slowly raised his head. Suddenly, from behind him came..."<br>
[Illegible text]<br>
As you turn to leave, you hear something fall to the floor... Upon close examination, you see that it is a fragment of a mysterious bead.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Ancient Stone Tablet:<br>
You've already read the inscription. Find another tablet.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Ancient Stone Tablet:<br>
Upon closer examination, you notice an inscription describing the exploits of the heroes who defeated Daimon the White-Eyed.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00603_DaimonTheWhiteEyedPart1 31550-02.html">Read the inscription</Button>
</body></html>

View File

@ -0,0 +1,6 @@
<html><body>Mysterious Ancient Tablet:<br>
"Based on previous adventurers' experience, a fragment certainly exists that may be useful when confronting Daimon the White-Eyed. But even so, Daimon is...<br>
In that case, you may gather your strength and launch a focused attack, but that does not seem to be optimal. It is vital that his three henchmen be..."<br>
The rest of the tablet is too damaged to read.<br>
As you turn around, you suddenly hear the sound of something falling from the tablet. It's a mysterious bead fragment...
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Ancient Stone Tablet:<br>
You've already read the inscription. Find another tablet.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Ancient Stone Tablet:<br>
Upon closer examination, you notice an inscription describing the exploits of the heroes who defeated Daimon the White-Eyed.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00603_DaimonTheWhiteEyedPart1 31551-02.html">Read the inscription</Button>
</body></html>

View File

@ -0,0 +1,8 @@
<html><body>Ancient Stone Tablet:<br>
"Yeah, those three henchmen pose a problem...", said the warrior with the spear.<br>
The mage replied, "I agree. Especially the one that keeps restoring Daimon! I'll deal with that rascal myself!"<br>
The Dwarf girl softly said,<br>
"Someone's going to have to deal with Daimon. Who can do that? None of us are any match for his powers, even if we use the bead of summoning perfectly!"<br>
[Illegible text]<br>
As you turn to leave, you hear something fall from the tablet. Upon close examination, you find that it's a fragment of a mysterious bead.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Ancient Stone Tablet:<br>
You've already read the inscription. Find another tablet.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Ancient Stone Tablet:<br>
Upon closer examination, you notice an inscription describing the exploits of the heroes who defeated Daimon the White-Eyed.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00603_DaimonTheWhiteEyedPart1 31552-02.html">Read the inscription</Button>
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Ancient Stone Tablet:<br>
The text describes the decisive battles against Daimon the White-Eyed.<br>
Past heroes used the bead of summoning to call out Daimon before he and his minions were ready.<br>
<br>
Now it all makes sense! You know how to defeat Daimon!<br>
As you stand thinking before the tablet, something falls to the ground.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Ancient Stone Tablet:<br>
You've already read the inscription. Now that you've learned how to defeat Daimon the White-Eyed, go back to Eye of Argos.
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Eye of Argos:<br>
Welcome, traveler!<br>
My eyes see justice, courage and wisdom within you!<br>
Our meeting is not mere coincidence, my brave young warrior!<br>
A trial awaits you. Will you accept the challenge?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00603_DaimonTheWhiteEyedPart1 31683-03.htm">"I accept the challenge!"</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Eye of Argos:<br>
I'm waiting for an adventurer with adequate skills and courage.<br>
(This quest may only be undertaken by characters of level 73 or above.)
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Eye of Argos:<br>
Do you know about Daimon the White-Eyed? When Einhasad ripped Argos apart and scattered the pieces throughout the land, I became the bright side of Argos and Daimon became the dark side.<br>
Daimon has been expanding his powerbase, spreading his evil influence even further. He dreams of expanding his reach globally, but each time, his efforts have been thwarted by heroes like you!<br>
Now, his force is spreading and his henchmen are wandering about in this land. Will you take up the fight against this demonic scourge?<br>
First, you must study the methods that past heroes used to stop him.<br>
You'll find stone tablets describing their accomplishments in several parts of this region. Read them and report back to me what you learn.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Eye of Argos:<br>
Have you read all the inscriptions on the tablets? Daimon clouds my memory so that I can't remember the things about him. Thus, the only ways to defeat him are recorded on the tablets. They are left here and there throughout this area.<br>
But, Daimon's forces must have been destroying them. You don't have much time, my hero!
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Eye of Argos:<br>
Oh, you came back!<br>
Did you find out how the heroes of the past defeated Daimon the White-Eyed?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00603_DaimonTheWhiteEyedPart1 31683-06.html">"Yes, I did."</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Eye of Argos:<br>
The bead of summoning? Ah, yes, I haven't forgotten about that one yet! Good job, my hero!<br>
Now, you must make a bead of summoning! It has the power to summon him from the darkness. You must obtain 200 thoughts of darkness from valley Bandersnatch slaves, Buffalo Slaves and Grendel Slaves and bring them to me.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Eye of Argos:<br>
Where are the thoughts of darkness to make the bead to defeat Daimon of White Eye?
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Eye of Argos:<br>
Have you collected all the thoughts of darkness you need?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00603_DaimonTheWhiteEyedPart1 31683-10.html">"Here are the thoughts of darkness I've collected."</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Eye of Argos:<br>
I can feel his power growing every day!<br>
Have you collected enough thoughts of darkness to stop him?<br>
Could it be that he will prevail?
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Eye of Argos:<br>
You've created the vessel that will contain the power to draw him out.<br>
I shall put the voice to call him out in this thought of darkness. You, my hero, will you give me some time alone? I'll be ready shortly after. Come back to me then..<br>
I hope we're not too late!
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Eye of Argos:<br>
Where are the eyes of darkness you've collected?
</body></html>

View File

@ -0,0 +1,219 @@
/*
* Copyright (C) 2004-2015 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.Q00603_DaimonTheWhiteEyedPart1;
import java.util.HashMap;
import java.util.Map;
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;
import com.l2jserver.gameserver.model.quest.State;
/**
* Daimon the White-Eyed - Part 1 (603)
* @author Pandragon
*/
public final class Q00603_DaimonTheWhiteEyedPart1 extends Quest
{
// NPC
private static final int EYE_OF_ARGOS = 31683;
private static final int TABLET_1 = 31548;
private static final int TABLET_2 = 31549;
private static final int TABLET_3 = 31550;
private static final int TABLET_4 = 31551;
private static final int TABLET_5 = 31552;
// Items
private static final int SPIRIT_OF_DARKNESS = 7190;
private static final int BROKEN_CRYSTAL = 7191;
// Monsters
private final Map<Integer, Double> MONSTER_CHANCES = new HashMap<>();
{
MONSTER_CHANCES.put(21297, 0.5); // Canyon Bandersnatch Slave
MONSTER_CHANCES.put(21299, 0.519); // Buffalo Slave
MONSTER_CHANCES.put(21304, 0.673); // Grendel Slave
}
// Reward
private static final int UNFINISHED_CRYSTAL = 7192;
// Misc
private static final int MIN_LVL = 73;
public Q00603_DaimonTheWhiteEyedPart1()
{
super(603, Q00603_DaimonTheWhiteEyedPart1.class.getSimpleName(), "Daimon the White-Eyed - Part 1");
addStartNpc(EYE_OF_ARGOS);
addTalkId(EYE_OF_ARGOS, TABLET_1, TABLET_2, TABLET_3, TABLET_4, TABLET_5);
addKillId(MONSTER_CHANCES.keySet());
registerQuestItems(SPIRIT_OF_DARKNESS, BROKEN_CRYSTAL);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, false);
String htmltext = null;
if (qs == null)
{
return htmltext;
}
switch (event)
{
case "31683-03.htm":
{
if (qs.isCreated())
{
qs.set("tablet_" + TABLET_1, 0);
qs.set("tablet_" + TABLET_2, 0);
qs.set("tablet_" + TABLET_3, 0);
qs.set("tablet_" + TABLET_4, 0);
qs.set("tablet_" + TABLET_5, 0);
qs.startQuest();
htmltext = event;
}
break;
}
case "31548-02.html":
case "31549-02.html":
case "31550-02.html":
case "31551-02.html":
case "31552-02.html":
{
if (qs.getCond() < 6)
{
giveItems(player, BROKEN_CRYSTAL, 1);
qs.set("TABLET_" + npc.getId(), 1);
qs.setCond(qs.getCond() + 1, true);
htmltext = event;
}
break;
}
case "31683-06.html":
{
if (qs.isCond(6) && (getQuestItemsCount(player, BROKEN_CRYSTAL) >= 5))
{
takeItems(player, BROKEN_CRYSTAL, -1);
qs.setCond(7, true);
htmltext = event;
}
break;
}
case "31683-10.html":
{
if (qs.isCond(8))
{
if (getQuestItemsCount(player, SPIRIT_OF_DARKNESS) >= 200)
{
takeItems(player, SPIRIT_OF_DARKNESS, -1);
giveItems(player, UNFINISHED_CRYSTAL, 1);
qs.exitQuest(true, true);
htmltext = event;
}
else
{
htmltext = "31683-11.html";
}
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
final QuestState qs = getQuestState(talker, true);
String htmltext = getNoQuestMsg(talker);
switch (qs.getState())
{
case State.CREATED:
{
if (npc.getId() == EYE_OF_ARGOS)
{
htmltext = ((talker.getLevel() < MIN_LVL) ? "31683-02.html" : "31683-01.htm");
}
break;
}
case State.STARTED:
{
if (npc.getId() == EYE_OF_ARGOS)
{
switch (qs.getCond())
{
case 1:
case 2:
case 3:
case 4:
case 5:
{
htmltext = "31683-04.html";
break;
}
case 6:
{
htmltext = "31683-05.html";
break;
}
case 7:
{
htmltext = "31683-07.html";
break;
}
case 8:
{
htmltext = "31683-08.html";
break;
}
}
}
else if (qs.getInt("TABLET_" + npc.getId()) == 0)
{
htmltext = npc.getId() + "-01.html";
}
else
{
htmltext = npc.getId() + "-03.html";
}
break;
}
case State.COMPLETED:
{
htmltext = getAlreadyCompletedMsg(talker);
break;
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, 7, 3, npc);
if (qs != null)
{
if (giveItemRandomly(qs.getPlayer(), npc, SPIRIT_OF_DARKNESS, 1, 200, MONSTER_CHANCES.get(npc.getId()), true))
{
qs.setCond(8, true);
}
}
return super.onKill(npc, killer, isSummon);
}
}

View File

@ -0,0 +1,4 @@
<html><body>Altar of Daimon the White-Eyed:<br>
A sinister energy encircles the altar.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00604_DaimonTheWhiteEyedPart2 31541-02.html">Place the Bead of Summoning on the altar.</Button>
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Altar of Daimon the White-Eyed:<br>
Evil forces are gathering... Oh, the horror!
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Altar of Daimon the White-Eyed:<br>
Daimon the White-Eyed has already been summoned!
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Altar of Daimon the White-Eyed:<br>
A summoning orb is needed.
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Altar of Daimon the White-Eyed:<br>
Daimon's moans can be faintly heard...
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Eye of Argos:<br>
Have you been neglecting your training? I'm reluctant to assign this critical mission to you!<br>
(This quest may only be undertaken by characters of level 73 or above.)
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Eye of Argos:<br>
Where have you done with the Unfinished Bead of Summoning that I gave you?
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Eye of Argos:<br>
The bead containing my voice is now completed.<br>
Are you ready to confront Daimon the White-Eyed, dear warrior? Will you risk your life for the cause?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00604_DaimonTheWhiteEyedPart2 31683-04.htm">"I'm ready."</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Eye of Argos:<br>
Go to the stronghold of Daimon the White-Eyed, find the altar used to make sacrifices and place the summoning orb upon it.<br>
One more thing!<br>
Occasionally, Daimon hides the altar. If this happens, wait until the altar reappears before taking action. Apply all your courage and faith to destroying Daimon!
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Eye of Argos:<br>
Place the summoning orb onto the altar in the stronghold of Daimon the White-Eyed.<br>
Daimon will be drawn out by its power. Destroy him and return to me.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Eye of Argos:<br>
Dear soldier, I felt a weakening in his force around here! Did you kill Daimon the White-Eyed?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00604_DaimonTheWhiteEyedPart2 31683-07.html">"I killed the beast."</Button>
</body></html>

View File

@ -0,0 +1,5 @@
<html><body>Eye of Argos:<br>
You've vanquished the dreaded Daimon, but he's not gone forever.<br>
Someday, he shall rise and threaten the peace of the world again.<br>
I pray when he does that we have many heroes like you.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Eye of Argos:<br>
Where is the proof that you killed Daimon?<br>
Do you think I'll fall for your lie? You, fake heroes!
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Eye of Argos:<br>
Does Daimon the White-Eyed live?<br>
I understand your hesitance, but by overcoming your fear, the path to true heroism will open up to you!
</body></html>

View File

@ -0,0 +1,274 @@
/*
* Copyright (C) 2004-2015 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.Q00604_DaimonTheWhiteEyedPart2;
import com.l2jserver.gameserver.datatables.SpawnTable;
import com.l2jserver.gameserver.enums.ChatType;
import com.l2jserver.gameserver.enums.QuestSound;
import com.l2jserver.gameserver.model.Location;
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;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.serverpackets.NpcSay;
import com.l2jserver.gameserver.util.Util;
/**
* Daimon the White-Eyed - Part 2 (604)
* @author Adry_85
*/
public final class Q00604_DaimonTheWhiteEyedPart2 extends Quest
{
// NPCs
private static final int DAIMONS_ALTAR = 31541;
private static final int EYE_OF_ARGOS = 31683;
// Raid Boss
private static final int DAIMON_THE_WHITE_EYED = 25290;
// Items
private static final int UNFINISHED_SUMMON_CRYSTAL = 7192;
private static final int SUMMON_CRYSTAL = 7193;
private static final int ESSENCE_OF_DAIMON = 7194;
// Misc
private static final int MIN_LEVEL = 73;
// Location
private static final Location DAIMON_THE_WHITE_EYED_LOC = new Location(186320, -43904, -3175);
// Rewards
private static final int DYE_I2M2_C = 4595; // Greater Dye of INT <Int+2 Men-2>
private static final int DYE_I2W2_C = 4596; // Greater Dye of INT <Int+2 Wit-2>
private static final int DYE_M2I2_C = 4597; // Greater Dye of MEN <Men+2 Int-2>
private static final int DYE_M2W2_C = 4598; // Greater Dye of MEN <Men+2 Wit-2>
private static final int DYE_W2I2_C = 4599; // Greater Dye of WIT <Wit+2 Int-2>
private static final int DYE_W2M2_C = 4600; // Greater Dye of WIT <Wit+2 Men-2>
public Q00604_DaimonTheWhiteEyedPart2()
{
super(604, Q00604_DaimonTheWhiteEyedPart2.class.getSimpleName(), "Daimon the White-Eyed - Part 2");
addStartNpc(EYE_OF_ARGOS);
addTalkId(EYE_OF_ARGOS, DAIMONS_ALTAR);
addSpawnId(DAIMON_THE_WHITE_EYED);
addKillId(DAIMON_THE_WHITE_EYED);
registerQuestItems(SUMMON_CRYSTAL, ESSENCE_OF_DAIMON);
}
@Override
public void actionForEachPlayer(L2PcInstance player, L2Npc npc, boolean isSummon)
{
final QuestState qs = getQuestState(player, false);
if ((qs != null) && (qs.getMemoState() >= 11) && (qs.getMemoState() <= 21))
{
if (Util.checkIfInRange(1500, npc, player, false))
{
if (hasQuestItems(player, ESSENCE_OF_DAIMON))
{
qs.setCond(3, true);
qs.setMemoState(22);
}
giveItems(player, ESSENCE_OF_DAIMON, 1);
qs.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if ("DESPAWN".equals(event))
{
if (isDaimonSpawned())
{
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getTemplate().getDisplayId(), NpcStringId.CAN_LIGHT_EXIST_WITHOUT_DARKNESS));
npc.deleteMe();
}
return super.onAdvEvent(event, npc, player);
}
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return null;
}
String htmltext = null;
switch (event)
{
case "31683-04.htm":
{
takeItems(player, UNFINISHED_SUMMON_CRYSTAL, 1);
qs.startQuest();
qs.setMemoState(11);
giveItems(player, SUMMON_CRYSTAL, 1);
htmltext = event;
break;
}
case "31683-07.html":
{
if (hasQuestItems(player, ESSENCE_OF_DAIMON))
{
final int reward;
final int random = getRandom(1000);
takeItems(player, ESSENCE_OF_DAIMON, 1);
if (random < 167)
{
reward = DYE_I2M2_C;
}
else if (random < 334)
{
reward = DYE_I2W2_C;
}
else if (random < 501)
{
reward = DYE_M2I2_C;
}
else if (random < 668)
{
reward = DYE_M2W2_C;
}
else if (random < 835)
{
reward = DYE_W2I2_C;
}
else
{
reward = DYE_W2M2_C;
}
rewardItems(player, reward, 5);
qs.exitQuest(true, true);
htmltext = event;
}
else
{
htmltext = "31683-08.html";
}
break;
}
case "31541-02.html":
{
if (hasQuestItems(player, SUMMON_CRYSTAL))
{
if (!isDaimonSpawned())
{
takeItems(player, SUMMON_CRYSTAL, 1);
htmltext = event;
addSpawn(DAIMON_THE_WHITE_EYED, DAIMON_THE_WHITE_EYED_LOC);
npc.deleteMe();
qs.setMemoState(21);
qs.setCond(2, true);
}
else
{
htmltext = "31541-03.html";
}
}
else
{
htmltext = "31541-04.html";
}
break;
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
executeForEachPlayer(killer, npc, isSummon, true, false);
return super.onKill(npc, killer, isSummon);
}
@Override
public String onSpawn(L2Npc npc)
{
startQuestTimer("DESPAWN", 1200000, npc, null);
npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getTemplate().getDisplayId(), NpcStringId.WHO_IS_CALLING_ME));
return super.onSpawn(npc);
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
final QuestState qs = getQuestState(player, true);
String htmltext = getNoQuestMsg(player);
if (qs.isCreated())
{
if (player.getLevel() < MIN_LEVEL)
{
htmltext = "31683-01.htm";
}
else if (!hasQuestItems(player, UNFINISHED_SUMMON_CRYSTAL))
{
htmltext = "31683-02.htm";
}
else
{
htmltext = "31683-03.htm";
}
}
else if (qs.isStarted())
{
if (npc.getId() == EYE_OF_ARGOS)
{
if (qs.isMemoState(11))
{
htmltext = "31683-05.html";
}
else if (qs.getMemoState() >= 22)
{
htmltext = (hasQuestItems(player, ESSENCE_OF_DAIMON)) ? "31683-06.html" : "31683-09.html";
}
}
else
{
if (qs.isMemoState(11))
{
if (hasQuestItems(player, SUMMON_CRYSTAL))
{
htmltext = "31541-01.html";
}
}
else if (qs.isMemoState(21))
{
if (!isDaimonSpawned())
{
addSpawn(DAIMON_THE_WHITE_EYED, DAIMON_THE_WHITE_EYED_LOC);
npc.deleteMe();
htmltext = "31541-02.html";
}
else
{
htmltext = "31541-03.html";
}
}
else if (qs.getMemoState() >= 22)
{
htmltext = "31541-05.html";
}
}
}
return htmltext;
}
private static boolean isDaimonSpawned()
{
return SpawnTable.getInstance().findAny(DAIMON_THE_WHITE_EYED) != null;
}
}

View File

@ -133,6 +133,8 @@ import quests.Q00511_AwlUnderFoot.Q00511_AwlUnderFoot;
import quests.Q00551_OlympiadStarter.Q00551_OlympiadStarter;
import quests.Q00552_OlympiadVeteran.Q00552_OlympiadVeteran;
import quests.Q00553_OlympiadUndefeated.Q00553_OlympiadUndefeated;
import quests.Q00603_DaimonTheWhiteEyedPart1.Q00603_DaimonTheWhiteEyedPart1;
import quests.Q00604_DaimonTheWhiteEyedPart2.Q00604_DaimonTheWhiteEyedPart2;
import quests.Q00617_GatherTheFlames.Q00617_GatherTheFlames;
import quests.Q00618_IntoTheFlame.Q00618_IntoTheFlame;
import quests.Q00621_EggDelivery.Q00621_EggDelivery;
@ -364,6 +366,8 @@ public class QuestMasterHandler
Q00551_OlympiadStarter.class,
Q00552_OlympiadVeteran.class,
Q00553_OlympiadUndefeated.class,
Q00603_DaimonTheWhiteEyedPart1.class,
Q00604_DaimonTheWhiteEyedPart2.class,
Q00617_GatherTheFlames.class,
Q00618_IntoTheFlame.class,
Q00621_EggDelivery.class,