Merged with released L2J-Unity files.

This commit is contained in:
mobiusdev
2016-06-12 01:34:09 +00:00
parent e003e87887
commit 635557f5da
18352 changed files with 3245113 additions and 2892959 deletions

View File

@@ -1,5 +1,5 @@
<html><body>Officer Klemis:<br>
...Hmm... This is a problem...<br>
According to our scouts, there has been a surge in violent behavior amongst the beast clans of the Seed. While we're here trying to save our men, we can't ignore this and wait for it go get worse.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-04.html">"Anyway I can help?"</Button>
<html><body>Officer Klemis:<br>
...Hmm... This is a problem...<br>
According to our scouts, there has been a surge in violent behavior amongst the beast clans of the Seed. While we're here trying to save our men, we can't ignore this and wait for it to get worse.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-04.html">"Anyway I can help?"</Button>
</body></html>

View File

@@ -1,5 +1,5 @@
<html><body>Officer Klemis:<br>
You've earned your rest today, soldier!<br>
The monsters won't be coming back after the lashing you gave them. I hope you come back at some point, our work here isn't done yet.<br>
(This quest can be completed once a day and resets at 6:30 am.)
<html><body>Officer Klemis:<br>
You've earned your rest today, soldier!<br>
The monsters won't be coming back after the lashing you gave them. I hope you come back at some point, our work here isn't done yet.<br>
(This quest can be completed once a day and resets at 6:30 am.)
</body></html>

View File

@@ -1,4 +1,4 @@
<html><body>Officer Klemis:<br>
Hmm... you look a little soft to be here. I wouldn't send someone into the Seed if I knew for sure I'd have to bury them later.<br>
(Only characters level 84 and above who have completed To The Seed of Annihilation can take this quest.)
<html><body>Officer Klemis:<br>
Hmm... you look a little soft to be here. I wouldn't send someone into the Seed if I knew for sure I'd have to bury them later.<br>
(Only characters level 85 and above who have completed To The Seed of Annihilation can take this quest.)
</body></html>

View File

@@ -1,5 +1,5 @@
<html><body>Officer Klemis:<br>
Ah, are you serious?! Well thank the gods, I could make use of a seasoned veteran like you.<br>
The mission is quite simple: Kill the monsters that inhabit the <font color="LEVEL">Seed of Annihilation</font>. But be warned, while the terms of the mission are simple, actually completing it will not be.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-05.htm">"Like I said, I want to help."</Button>
<html><body>Officer Klemis:<br>
Ah, are you serious?! Well thank the gods, I could make use of a seasoned veteran like you.<br>
The mission is quite simple: Kill the monsters that inhabit the <font color="LEVEL">Seed of Annihilation</font>. But be warned, while the terms of the mission are simple, actually completing it will not be.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-05.htm">"I'll be happy to help."</Button>
</body></html>

View File

@@ -1,6 +1,6 @@
<html><body>Officer Klemis:<br>
Alright. The Seed of Annihilation is comprised of three regions, each region with its own environment and set of properties. The monsters in each of these regions have evolved to fit those surroundings, so we've given each clan a name to distinguish them - the <font color="LEVEL">Bistakon, Reptilikon, and Cokrakon</font>.<br>
The mission is to wipe them out one region at a time.<br>
So, you scared, or you ready to make terrifying beasts bleed?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-06.htm">"Kill 'em all and let the gods sort 'em out, that's what I say."</Button>
<html><body>Officer Klemis:<br>
Alright. The Seed of Annihilation is comprised of three regions, each region with its own environment and set of properties. The monsters in each of these regions have evolved to fit those surroundings, so we've given each clan a name to distinguish them - the <font color="LEVEL">Bistakon, Reptilikon, and Kokracon</font>.<br>
The mission is to wipe them out one region at a time.<br>
So, you scared, or you ready to make terrifying beasts bleed?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-06.htm">"You can count on me."</Button>
</body></html>

View File

@@ -1,7 +1,7 @@
<html><body>Officer Klemis:<br>
Alright, soldier! That's what I wanted to hear.<br>
So, which region will you cleanse first?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-07.html">Bistakon Region</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-08.html">Reptilikon Region</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-09.html">Cokrakon Region</Button>
<html><body>Officer Klemis:<br>
Alright, soldier! That's what I wanted to hear.<br>
So, which region will you cleanse first?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-07.html">Bistacon area</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-08.html">Reptilikon area</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-09.html">Cokrakon area</Button>
</body></html>

View File

@@ -1,5 +1,5 @@
<html><body>Officer Klemis:<br>
Ah, the Bistakons... well, I know a little something about them. Here's a short brief.<br>
The monsters of the Bistakon clans look like mammals, but don't be fooled. Their claws and teeth are unnaturally sharp and strong, and they aren't shy about using them. Also, they travel in packs, so unless you like being outnumbered, you should recruit a few friends to help.<br>
If you can kill <font color="LEVEL">15</font> each of the <font color="LEVEL">Bgurent, Brakian, Groikan, and Treykan</font> variants, that should be enough to clear the region for a while. And with that, good luck.
<html><body>Officer Klemis:<br>
Ah, the Bistakons... well, I know a little something about them. Here's a short brief.<br>
The monsters of the Bistakon clans look like mammals, but don't be fooled. Their claws and teeth are unnaturally sharp and strong, and they aren't shy about using them. Also, they travel in packs, so unless you like being outnumbered, you should recruit a few friends to help.<br>
If you can kill <font color="LEVEL">15</font> each of the <font color="LEVEL">Bgurent, Brakian, Groikan, and Treykan</font> variants, that should be enough to clear the region for a while. And with that, good luck.
</body></html>

View File

@@ -1,6 +1,6 @@
<html><body>Officer Klemis:<br>
Ah, the Reptilikons. I'll brief you on them.<br>
The monsters of the Reptilikon region are basically enormous reptilian beasts. They are just as vicious as the other beast clans, and tend to be poisonous to boot. Trust me on this - don't go alone. That said I hope it goes well.<br>
If you can kill <font color="LEVEL">20</font> each of the <font color="LEVEL">Turtlelian, Krajian, and Tardyon</font> variants, we can declare that region safe a while.<br>
Good hunting!
<html><body>Officer Klemis:<br>
Ah, the Reptilikons. I'll brief you on them.<br>
The monsters of the Reptilikon region are basically enormous reptilian beasts. They are just as vicious as the other beast clans, and tend to be poisonous to boot. Trust me on this - don't go alone. That said I hope it goes well.<br>
If you can kill <font color="LEVEL">20</font> each of the <font color="LEVEL">Turtlelian, Krajian, and Tardyon</font> variants, we can declare that region safe a while. <br1>
Good hunting!
</body></html>

View File

@@ -1,5 +1,5 @@
<html><body>Officer Klemis:<br>
Ah, the Cokrakon region. Alright, I'll give you a short brief of what we know about it.<br>
The Cokrakon clans resemble birds, but believe me, they aren't hunting worms. These monsters can emit sound shockwaves that can shatter your bones, paralyze all your nerves and muscle tissue, and leave you basically unable to move quickly. If Kookaburras give you nightmares, these things will leave you unable to ever sleep again. Do yourself a favor, when you go on the hunt, bring others with you.<br>
If you can kill <font color="LEVEL">20</font> each of the <font color="LEVEL">Kanibi, Kiriona, and Kaiona</font> variants, the region will be clear. You should get started, I wish you well.
<html><body>Officer Klemis:<br>
Ah, the Cokrakon region. Alright, I'll give you a short brief of what we know about it.<br>
The Cokrakon clans resemble birds, but believe me, they aren't hunting worms. These monsters can emit sound shockwaves that can shatter your bones, paralyze all your nerves and muscle tissue, and leave you basically unable to move quickly. If Kookaburras give you nightmares, these things will leave you unable to ever sleep again. Do yourself a favor, when you go on the hunt, bring others with you.<br>
If you can kill <font color="LEVEL">20</font> each of the <font color="LEVEL">Kanibi, Kiriona, and Kaiona</font> variants, the region will be clear. You should get started, I wish you well.
</body></html>

View File

@@ -1,7 +1,7 @@
<html><body>Officer Klemis:<br>
Tired of lazy afternoons, long naps, and good meals, eh? Haha, well thanks for volunteering.<br>
I'll let you decide what region of the Seed you want to cleanse. There are three to choose from:<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-07.html">Bistakon Region</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-08.html">Reptilikon Region</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-09.html">Cokrakon Region</Button>
<html><body>Officer Klemis:<br>
Tired of lazy afternoons, long naps, and good meals, eh? Haha, well thanks for volunteering.<br>
I'll let you decide what region of the Seed you want to cleanse. There are three to choose from:<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-07.html">Bistakon Region</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-08.html">Reptilikon Region</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Q00453_NotStrongEnoughAlone 32734-09.html">Cokrakon Region</Button>
</body></html>

View File

@@ -1,4 +1,4 @@
<html><body>Officer Klemis:<br>
The monsters of the Bistakon clans look like mammals, but don't be fooled. Their claws and teeth are unnaturally sharp and strong, and they aren't shy about using them. Also, they travel in packs, so unless you like being outnumbered, you should recruit a few friends to help.<br>
If you can kill <font color="LEVEL">15</font> each of the <font color="LEVEL">Bgurent, Brakian, Groikan, and Treykan</font> variants, that should be enough to clear the region for a while. And with that, good luck.
<html><body>Officer Klemis:<br>
The monsters of the Bistakon clans look like mammals, but don't be fooled. Their claws and teeth are unnaturally sharp and strong, and they aren't shy about using them. Also, they travel in packs, so unless you like being outnumbered, you should recruit a few friends to help.<br>
If you can kill <font color="LEVEL">15</font> each of the <font color="LEVEL">Bgurent, Brakian, Groikan, and Treykan</font> variants, that should be enough to clear the region for a while. And with that, good luck.
</body></html>

View File

@@ -1,4 +1,4 @@
<html><body>Officer Klemis:<br>
The monsters of the Reptilikon region are basically enormous reptilian beasts. They are just as vicious as the other beast clans, and tend to be poisonous to boot. Trust me on this - don't go alone. That said I hope it goes well.<br>
If you can kill <font color="LEVEL">20</font> each of the <font color="LEVEL">Turtlelian, Krajian, and Tardyon</font> variants, we can declare that region safe a while.
<html><body>Officer Klemis:<br>
The monsters of the Reptilikon region are basically enormous reptilian beasts. They are just as vicious as the other beast clans, and tend to be poisonous to boot. Trust me on this - don't go alone. That said I hope it goes well.<br>
If you can kill <font color="LEVEL">20</font> each of the <font color="LEVEL">Turtlelian, Krajian, and Tardyon</font> variants, we can declare that region safe a while.
</body></html>

View File

@@ -1,4 +1,4 @@
<html><body>Officer Klemis:<br>
The Cokrakon clans resemble birds, but believe me, they aren't hunting worms. These monsters can emit sound shockwaves that can shatter your bones, paralyze all your nerves and muscle tissue, and leave you basically unable to move quickly. If Kookaburras give you nightmares, these things will leave you unable to ever sleep again. Do yourself a favor, when you go on the hunt, bring others with you.<br>
If you can kill <font color="LEVEL">20</font> each of the <font color="LEVEL">Kanibi, Kiriona, and Kaiona</font> variants, the region will be clear. You should get started. I wish you well.
<html><body>Officer Klemis:<br>
The Cokrakon clans resemble birds, but believe me, they aren't hunting worms. These monsters can emit sound shockwaves that can shatter your bones, paralyze all your nerves and muscle tissue, and leave you basically unable to move quickly. If Kookaburras give you nightmares, these things will leave you unable to ever sleep again. Do yourself a favor, when you go on the hunt, bring others with you.<br>
If you can kill <font color="LEVEL">20</font> each of the <font color="LEVEL">Kanibi, Kiriona, and Kaiona</font> variants, the region will be clear. You should get started. I wish you well.
</body></html>

View File

@@ -1,3 +1,3 @@
<html><body>Officer Klemis:<br>
Good job soldier! Another day earning that pay. Thanks for your help, couldn't have done it without you. Here take this. Take it, you've earned it. And if you're ever here again, I could always use your help.
<html><body>Officer Klemis:<br>
Good job soldier! Another day earning that pay. Thanks for your help, couldn't have done it without you. Here take this. Take it, you've earned it. And if you're ever here again, I could always use your help.
</body></html>

View File

@@ -1,358 +1,418 @@
/*
* 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.Q00453_NotStrongEnoughAlone;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.enums.QuestType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
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.serverpackets.ExQuestNpcLogList;
import com.l2jmobius.gameserver.util.Util;
import quests.Q10282_ToTheSeedOfAnnihilation.Q10282_ToTheSeedOfAnnihilation;
/**
* Not Strong Enough Alone (453)
* @author malyelfik
*/
public class Q00453_NotStrongEnoughAlone extends Quest
{
// NPC
private static final int KLEMIS = 32734;
private static final int[] MONSTER1 =
{
22746,
22747,
22748,
22749,
22750,
22751,
22752,
22753
};
private static final int[] MONSTER2 =
{
22754,
22755,
22756,
22757,
22758,
22759
};
private static final int[] MONSTER3 =
{
22760,
22761,
22762,
22763,
22764,
22765
};
// Reward
private static final int[][] REWARD =
{
{
15815,
15816,
15817,
15818,
15819,
15820,
15821,
15822,
15823,
15824,
15825
},
{
15634,
15635,
15636,
15637,
15638,
15639,
15640,
15641,
15642,
15643,
15644
}
};
public Q00453_NotStrongEnoughAlone()
{
super(453, Q00453_NotStrongEnoughAlone.class.getSimpleName(), "Not Strong Enought Alone");
addStartNpc(KLEMIS);
addTalkId(KLEMIS);
addKillId(MONSTER1);
addKillId(MONSTER2);
addKillId(MONSTER3);
}
private void increaseKill(L2PcInstance player, L2Npc npc)
{
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return;
}
int npcId = npc.getId();
if (Util.checkIfInRange(1500, npc, player, false))
{
final ExQuestNpcLogList log = new ExQuestNpcLogList(getId());
if (Util.contains(MONSTER1, npcId) && qs.isCond(2))
{
if (npcId == MONSTER1[4])
{
npcId = MONSTER1[0];
}
else if (npcId == MONSTER1[5])
{
npcId = MONSTER1[1];
}
else if (npcId == MONSTER1[6])
{
npcId = MONSTER1[2];
}
else if (npcId == MONSTER1[7])
{
npcId = MONSTER1[3];
}
final int i = qs.getInt(String.valueOf(npcId));
if (i < 15)
{
qs.set(Integer.toString(npcId), Integer.toString(i + 1));
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
checkProgress(qs, 15, MONSTER1[0], MONSTER1[1], MONSTER1[2], MONSTER1[3]);
log.addNpc(MONSTER1[0], qs.getInt(String.valueOf(MONSTER1[0])));
log.addNpc(MONSTER1[1], qs.getInt(String.valueOf(MONSTER1[1])));
log.addNpc(MONSTER1[2], qs.getInt(String.valueOf(MONSTER1[2])));
log.addNpc(MONSTER1[3], qs.getInt(String.valueOf(MONSTER1[3])));
}
else if (Util.contains(MONSTER2, npcId) && qs.isCond(3))
{
if (npcId == MONSTER2[3])
{
npcId = MONSTER2[0];
}
else if (npcId == MONSTER2[4])
{
npcId = MONSTER2[1];
}
else if (npcId == MONSTER2[5])
{
npcId = MONSTER2[2];
}
final int i = qs.getInt(String.valueOf(npcId));
if (i < 20)
{
qs.set(Integer.toString(npcId), Integer.toString(i + 1));
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
checkProgress(qs, 20, MONSTER2[0], MONSTER2[1], MONSTER2[2]);
log.addNpc(MONSTER2[0], qs.getInt(String.valueOf(MONSTER2[0])));
log.addNpc(MONSTER2[1], qs.getInt(String.valueOf(MONSTER2[1])));
log.addNpc(MONSTER2[2], qs.getInt(String.valueOf(MONSTER2[2])));
}
else if (Util.contains(MONSTER3, npcId) && qs.isCond(4))
{
if (npcId == MONSTER3[3])
{
npcId = MONSTER3[0];
}
else if (npcId == MONSTER3[4])
{
npcId = MONSTER3[1];
}
else if (npcId == MONSTER3[5])
{
npcId = MONSTER3[2];
}
final int i = qs.getInt(String.valueOf(npcId));
if (i < 20)
{
qs.set(Integer.toString(npcId), Integer.toString(i + 1));
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
checkProgress(qs, 20, MONSTER3[0], MONSTER3[1], MONSTER3[2]);
log.addNpc(MONSTER3[0], qs.getInt(String.valueOf(MONSTER3[0])));
log.addNpc(MONSTER3[1], qs.getInt(String.valueOf(MONSTER3[1])));
log.addNpc(MONSTER3[2], qs.getInt(String.valueOf(MONSTER3[2])));
}
player.sendPacket(log);
}
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final String htmltext = event;
final QuestState qs = getQuestState(player, false);
if (qs == null)
{
return htmltext;
}
if (event.equalsIgnoreCase("32734-06.htm"))
{
qs.startQuest();
}
else if (event.equalsIgnoreCase("32734-07.html"))
{
qs.setCond(2, true);
}
else if (event.equalsIgnoreCase("32734-08.html"))
{
qs.setCond(3, true);
}
else if (event.equalsIgnoreCase("32734-09.html"))
{
qs.setCond(4, true);
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
if (player.getParty() != null)
{
for (L2PcInstance member : player.getParty().getMembers())
{
increaseKill(member, npc);
}
}
else
{
increaseKill(player, npc);
}
return null;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player)
{
String htmltext = getNoQuestMsg(player);
final QuestState qs = getQuestState(player, true);
final QuestState prev = player.getQuestState(Q10282_ToTheSeedOfAnnihilation.class.getSimpleName());
if (qs == null)
{
return htmltext;
}
switch (qs.getState())
{
case State.CREATED:
{
if ((player.getLevel() >= 84) && (prev != null) && prev.isCompleted())
{
htmltext = "32734-01.htm";
}
else
{
htmltext = "32734-03.html";
}
break;
}
case State.STARTED:
{
switch (qs.getCond())
{
case 1:
{
htmltext = "32734-10.html";
break;
}
case 2:
{
htmltext = "32734-11.html";
break;
}
case 3:
{
htmltext = "32734-12.html";
break;
}
case 4:
{
htmltext = "32734-13.html";
break;
}
case 5:
{
giveItems(player, REWARD[getRandom(REWARD.length)][getRandom(REWARD[0].length)], 1);
qs.exitQuest(QuestType.DAILY, true);
htmltext = "32734-14.html";
break;
}
}
break;
}
case State.COMPLETED:
{
if (!qs.isNowAvailable())
{
htmltext = "32734-02.htm";
}
else
{
qs.setState(State.CREATED);
if ((player.getLevel() >= 84) && (prev != null) && (prev.getState() == State.COMPLETED))
{
htmltext = "32734-01.htm";
}
else
{
htmltext = "32734-03.html";
}
}
break;
}
}
return htmltext;
}
private static void checkProgress(QuestState qs, int count, int... mobs)
{
for (int mob : mobs)
{
if (qs.getInt(String.valueOf(mob)) < count)
{
return;
}
}
qs.setCond(5, true);
}
}
/*
* 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.Q00453_NotStrongEnoughAlone;
import java.util.HashSet;
import java.util.Set;
import com.l2jmobius.commons.util.CommonUtil;
import com.l2jmobius.gameserver.enums.QuestSound;
import com.l2jmobius.gameserver.enums.QuestType;
import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
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.util.Util;
import quests.Q10282_ToTheSeedOfAnnihilation.Q10282_ToTheSeedOfAnnihilation;
/**
* Not Strong Enough Alone (453)
* @author malyelfik
*/
public final class Q00453_NotStrongEnoughAlone extends Quest
{
// NPCs
private static final int KLEMIS = 32734;
private static final int[] MONSTER1 =
{
22746, // Bgurent
22747, // Brakian
22748, // Groikan
22749, // Treykan
22750, // Elite Bgurent
22751, // Elite Brakian
22752, // Elite Groikan
22753, // Elite Treykan
};
private static final int[] MONSTER2 =
{
22754, // Turtlelian
22755, // Krajian
22756, // Tardyon
22757, // Elite Turtlelian
22758, // Elite Krajian
22759, // Elite Tardyon
};
private static final int[] MONSTER3 =
{
22760, // Kanibi
22761, // Kiriona
22762, // Kaiona
22763, // Elite Kanibi
22764, // Elite Kiriona
22765, // Elite Kaiona
};
// Misc
private static final int MIN_LV = 85;
public Q00453_NotStrongEnoughAlone()
{
super(453);
addStartNpc(KLEMIS);
addTalkId(KLEMIS);
addKillId(MONSTER1);
addKillId(MONSTER2);
addKillId(MONSTER3);
addCondCompletedQuest(Q10282_ToTheSeedOfAnnihilation.class.getSimpleName(), "32734-03.html");
addCondMinLevel(MIN_LV, "32734-03.html");
}
private void increaseKill(L2PcInstance player, L2Npc npc)
{
final QuestState st = getQuestState(player, false);
if (st == null)
{
return;
}
int npcId = npc.getId();
if (Util.checkIfInRange(1500, npc, player, false))
{
if (CommonUtil.contains(MONSTER1, npcId) && st.isCond(2))
{
if (npcId == MONSTER1[4])
{
npcId = MONSTER1[0];
}
else if (npcId == MONSTER1[5])
{
npcId = MONSTER1[1];
}
else if (npcId == MONSTER1[6])
{
npcId = MONSTER1[2];
}
else if (npcId == MONSTER1[7])
{
npcId = MONSTER1[3];
}
final int currValue = st.getInt("count_" + npcId);
if (currValue < 15)
{
st.set("count_" + npcId, currValue + 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
checkProgress(st, 15, MONSTER1[0], MONSTER1[1], MONSTER1[2], MONSTER1[3]);
}
else if (CommonUtil.contains(MONSTER2, npcId) && st.isCond(3))
{
if (npcId == MONSTER2[3])
{
npcId = MONSTER2[0];
}
else if (npcId == MONSTER2[4])
{
npcId = MONSTER2[1];
}
else if (npcId == MONSTER2[5])
{
npcId = MONSTER2[2];
}
final int currValue = st.getInt("count_" + npcId);
if (currValue < 20)
{
st.set("count_" + npcId, currValue + 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
checkProgress(st, 20, MONSTER2[0], MONSTER2[1], MONSTER2[2]);
}
else if (CommonUtil.contains(MONSTER3, npcId) && st.isCond(4))
{
if (npcId == MONSTER3[3])
{
npcId = MONSTER3[0];
}
else if (npcId == MONSTER3[4])
{
npcId = MONSTER3[1];
}
else if (npcId == MONSTER3[5])
{
npcId = MONSTER3[2];
}
final int currValue = st.getInt("count_" + npcId);
if (currValue < 20)
{
st.set("count_" + npcId, currValue + 1);
playSound(player, QuestSound.ITEMSOUND_QUEST_ITEMGET);
}
checkProgress(st, 20, MONSTER3[0], MONSTER3[1], MONSTER3[2]);
}
}
sendNpcLogList(player);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
final String htmltext = event;
final QuestState st = getQuestState(player, false);
if (st == null)
{
return null;
}
switch (event)
{
case "32734-06.htm":
{
st.startQuest();
break;
}
case "32734-07.html":
{
st.setCond(2, true);
break;
}
case "32734-08.html":
{
st.setCond(3, true);
break;
}
case "32734-09.html":
{
st.setCond(4, true);
break;
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isSummon)
{
if (player.getParty() != null)
{
for (L2PcInstance member : player.getParty().getMembers())
{
increaseKill(member, npc);
}
}
else
{
increaseKill(player, npc);
}
return null;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance player, boolean isSimulated)
{
String htmltext = getNoQuestMsg(player);
final QuestState st = getQuestState(player, true);
switch (st.getState())
{
case State.CREATED:
{
htmltext = "32734-01.htm";
break;
}
case State.STARTED:
{
switch (st.getCond())
{
case 1:
{
htmltext = "32734-10.html";
break;
}
case 2:
{
htmltext = "32734-11.html";
break;
}
case 3:
{
htmltext = "32734-12.html";
break;
}
case 4:
{
htmltext = "32734-13.html";
break;
}
case 5:
{
if (!isSimulated)
{
final int random = getRandom(1000);
if (random < 34)
{
giveItems(player, 34861, 1); // Ingredient and Hardener Pouch (R-grade)
}
else if (random < 52)
{
giveItems(player, 34861, 2); // Ingredient and Hardener Pouch (R-grade)
}
else if (random < 64)
{
giveItems(player, 34861, 3); // Ingredient and Hardener Pouch (R-grade)
}
else if (random < 73)
{
giveItems(player, 34861, 4); // Ingredient and Hardener Pouch (R-grade)
}
else if (random < 77)
{
giveItems(player, 17526, 1); // Scroll: Enchant Weapon (R-grade)
}
else if (random < 124)
{
giveItems(player, 17527, 1); // Scroll: Enchant Armor (R-grade)
}
else if (random < 153)
{
giveItems(player, 9552, 1); // Fire Crystal
}
else if (random < 182)
{
giveItems(player, 9553, 1); // Water Crystal
}
else if (random < 211)
{
giveItems(player, 9554, 1); // Earth Crystal
}
else if (random < 240)
{
giveItems(player, 9555, 1); // Wind Crystal
}
else if (random < 269)
{
giveItems(player, 9556, 1); // Dark Crystal
}
else if (random < 298)
{
giveItems(player, 9557, 1); // Holy Crystal
}
else if (random < 415)
{
giveItems(player, 9546, 1); // Fire Stone
}
else if (random < 532)
{
giveItems(player, 9547, 1); // Water Stone
}
else if (random < 649)
{
giveItems(player, 9548, 1); // Earth Stone
}
else if (random < 766)
{
giveItems(player, 9549, 1); // Wind Stone
}
else if (random < 883)
{
giveItems(player, 9550, 1); // Dark Stone
}
else if (random < 1000)
{
giveItems(player, 9551, 1); // Holy Stone
}
st.exitQuest(QuestType.DAILY, true);
}
htmltext = "32734-14.html";
break;
}
}
break;
}
case State.COMPLETED:
{
if (st.isNowAvailable())
{
st.setState(State.CREATED);
htmltext = "32734-01.htm";
}
else
{
htmltext = "32734-02.htm";
}
break;
}
}
return htmltext;
}
private static void checkProgress(QuestState st, int count, int... mobs)
{
for (int mob : mobs)
{
if (st.getInt("count_" + mob) < count)
{
return;
}
}
st.setCond(5, true);
}
@Override
public Set<NpcLogListHolder> getNpcLogList(L2PcInstance activeChar)
{
final QuestState qs = getQuestState(activeChar, false);
final Set<NpcLogListHolder> npcLogList = new HashSet<>(3);
if (qs != null)
{
switch (qs.getCond())
{
case 2:
{
npcLogList.add(new NpcLogListHolder(MONSTER1[0], false, qs.getInt("count_" + MONSTER1[0])));
npcLogList.add(new NpcLogListHolder(MONSTER1[1], false, qs.getInt("count_" + MONSTER1[1])));
npcLogList.add(new NpcLogListHolder(MONSTER1[2], false, qs.getInt("count_" + MONSTER1[2])));
npcLogList.add(new NpcLogListHolder(MONSTER1[3], false, qs.getInt("count_" + MONSTER1[3])));
break;
}
case 3:
{
npcLogList.add(new NpcLogListHolder(MONSTER2[0], false, qs.getInt("count_" + MONSTER2[0])));
npcLogList.add(new NpcLogListHolder(MONSTER2[1], false, qs.getInt("count_" + MONSTER2[1])));
npcLogList.add(new NpcLogListHolder(MONSTER2[2], false, qs.getInt("count_" + MONSTER2[2])));
break;
}
case 4:
{
npcLogList.add(new NpcLogListHolder(MONSTER3[0], false, qs.getInt("count_" + MONSTER3[0])));
npcLogList.add(new NpcLogListHolder(MONSTER3[1], false, qs.getInt("count_" + MONSTER3[1])));
npcLogList.add(new NpcLogListHolder(MONSTER3[2], false, qs.getInt("count_" + MONSTER3[2])));
break;
}
}
return npcLogList;
}
return super.getNpcLogList(activeChar);
}
}