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

BETA: Quests in Java:

	* Red-Eyed Invaders (39)
	* The Finest Food (623)

Patch by: janiko
Reviewed by: jurchiks, xban1x, Zoey76
parent f2dc3a85
No related branches found
No related tags found
No related merge requests found
Showing
with 486 additions and 3 deletions
<html><body>Guard Babenco:<br> <html><body>Guard Babenco:<br>
Thanks for your help. I'm honored.<br> Thanks for your help. I'm honored.<br>
Report to<font color="LEVEL"> Captain Bathis</font> for your orders. He's at the<font color="LEVEL"> northern entrance of Gludio Castle Town</font>. Report to <font color="LEVEL">Captain Bathis</font> for your orders. He's at the <font color="LEVEL">northern entrance of the Town of Gludio</font>.
</body></html> </body></html>
\ No newline at end of file
<html><body>Guard Babenco:<br>
Report to <font color="LEVEL">Captain Bathis</font> for your orders. He's at the <font color="LEVEL">northern entrance of the Town of Gludio</font>.
</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.Q00039_RedEyedInvaders;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.ItemHolder;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
/**
* Red-eyed Invaders (39)
* @author janiko
*/
public final class Q00039_RedEyedInvaders extends Quest
{
// NPCs
private static final int CAPTAIN_BATHIA = 30332;
private static final int GUARD_BABENCO = 30334;
// Monsters
private static final int MALE_LIZARDMAN = 20919;
private static final int MALE_LIZARDMAN_SCOUT = 20920;
private static final int MALE_LIZARDMAN_GUARD = 20921;
private static final int GIANT_ARANE = 20925;
// Items
private static final ItemHolder LIZ_NECKLACE_A = new ItemHolder(7178, 100);
private static final ItemHolder LIZ_NECKLACE_B = new ItemHolder(7179, 100);
private static final ItemHolder LIZ_PERFUME = new ItemHolder(7180, 30);
private static final ItemHolder LIZ_GEM = new ItemHolder(7181, 30);
// Rewards
private static final ItemHolder GREEN_HIGH_LURE = new ItemHolder(6521, 60);
private static final ItemHolder BABYDUCK_ROD = new ItemHolder(6529, 1);
private static final ItemHolder FISHING_SHOT_NONE = new ItemHolder(6535, 500);
// Misc
private static final int MIN_LVL = 20;
private Q00039_RedEyedInvaders()
{
super(39, Q00039_RedEyedInvaders.class.getSimpleName(), "Red-eyed Invaders");
addStartNpc(GUARD_BABENCO);
addTalkId(GUARD_BABENCO, CAPTAIN_BATHIA);
addKillId(MALE_LIZARDMAN_GUARD, MALE_LIZARDMAN_SCOUT, MALE_LIZARDMAN, GIANT_ARANE);
registerQuestItems(LIZ_NECKLACE_A.getId(), LIZ_NECKLACE_B.getId(), LIZ_PERFUME.getId(), LIZ_GEM.getId());
}
@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 "30334-03.htm":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "30332-02.html":
{
if (qs.isCond(1))
{
qs.setCond(2, true);
htmltext = event;
}
break;
}
case "30332-05.html":
{
if (qs.isCond(3))
{
if (hasAllItems(player, true, LIZ_NECKLACE_A, LIZ_NECKLACE_B))
{
qs.setCond(4, true);
takeAllItems(player, LIZ_NECKLACE_A, LIZ_NECKLACE_B);
htmltext = event;
}
else
{
htmltext = "30332-06.html";
}
}
break;
}
case "30332-09.html":
{
if (qs.isCond(5))
{
if (hasAllItems(player, true, LIZ_PERFUME, LIZ_GEM))
{
rewardItems(player, GREEN_HIGH_LURE);
rewardItems(player, BABYDUCK_ROD);
rewardItems(player, FISHING_SHOT_NONE);
addExpAndSp(player, 62366, 2783);
qs.exitQuest(false, true);
htmltext = event;
}
else
{
htmltext = "30332-10.html";
}
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
final QuestState qs = getQuestState(talker, true);
String htmltext = getNoQuestMsg(talker);
switch (npc.getId())
{
case CAPTAIN_BATHIA:
{
switch (qs.getCond())
{
case 1:
{
htmltext = "30332-01.html";
break;
}
case 2:
{
htmltext = "30332-03.html";
break;
}
case 3:
{
htmltext = "30332-04.html";
break;
}
case 4:
{
htmltext = "30332-07.html";
break;
}
case 5:
{
htmltext = "30332-08.html";
break;
}
}
break;
}
case GUARD_BABENCO:
{
if (qs.isCreated())
{
htmltext = (talker.getLevel() >= MIN_LVL) ? "30334-01.htm" : "30334-02.htm";
}
else if (qs.isStarted() && qs.isCond(1))
{
htmltext = "30334-04.html";
}
else if (qs.isCompleted())
{
htmltext = getAlreadyCompletedMsg(talker);
}
break;
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
switch (npc.getId())
{
case MALE_LIZARDMAN:
{
final QuestState qs = getRandomPartyMemberState(killer, 2, 3, npc);
if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, LIZ_NECKLACE_A.getId(), 1, LIZ_NECKLACE_A.getCount(), 0.5, true))
{
if (hasItem(qs.getPlayer(), LIZ_NECKLACE_B))
{
qs.setCond(3);
}
}
break;
}
case MALE_LIZARDMAN_SCOUT:
{
if (getRandomBoolean())
{
final QuestState qs = getRandomPartyMemberState(killer, 2, 3, npc);
if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, LIZ_NECKLACE_A.getId(), 1, LIZ_NECKLACE_A.getCount(), 0.5, true))
{
if (hasItem(qs.getPlayer(), LIZ_NECKLACE_B))
{
qs.setCond(3);
}
}
}
else
{
final QuestState qs = getRandomPartyMemberState(killer, 4, 3, npc);
if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, LIZ_PERFUME.getId(), 1, LIZ_PERFUME.getCount(), 0.25, true))
{
if (hasItem(qs.getPlayer(), LIZ_GEM))
{
qs.setCond(5);
}
}
}
break;
}
case MALE_LIZARDMAN_GUARD:
{
if (getRandomBoolean())
{
final QuestState qs = getRandomPartyMemberState(killer, 2, 3, npc);
if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, LIZ_NECKLACE_B.getId(), 1, LIZ_NECKLACE_B.getCount(), 0.5, true))
{
if (hasItem(qs.getPlayer(), LIZ_NECKLACE_A))
{
qs.setCond(3);
}
}
}
else
{
final QuestState qs = getRandomPartyMemberState(killer, 4, 3, npc);
if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, LIZ_PERFUME.getId(), 1, LIZ_PERFUME.getCount(), 0.3, true))
{
if (hasItem(qs.getPlayer(), LIZ_GEM))
{
qs.setCond(5);
}
}
}
break;
}
case GIANT_ARANE:
{
final QuestState qs = getRandomPartyMemberState(killer, 4, 3, npc);
if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, LIZ_GEM.getId(), 1, LIZ_GEM.getCount(), 0.3, true))
{
if (hasItem(qs.getPlayer(), LIZ_PERFUME))
{
qs.setCond(5);
}
}
break;
}
}
return super.onKill(npc, killer, isSummon);
}
public static void main(String[] args)
{
new Q00039_RedEyedInvaders();
}
}
\ No newline at end of file
<html><body>Chef Jeremy:<br> <html><body>Chef Jeremy:<br>
Long ago, the most distinguished aristocrats of the empire came here for their excursions. Those bastards! When I refused to be their personal chef, they insulted my food! They have no appreciation for haute cuisine!<br> Long ago, the most distinguished aristocrats of the empire came here for their excursions. Those bastards! When I refused to be their personal chef, they insulted my food! They have no appreciation for haute cuisine!<br>
As hard as they tried, no one could find fault with my food!<br> As hard as they tried, no one could find fault with my food!<br>
Those cretins had the nerve to point out that they weren't served a specialty dish indigenous to this region!<br> Those cretins had the nerve to point out that they weren't served a specialty dish indigenous to this region!<br>
Then and there I resolved to make a dish so indigenous to this region that those barbarians would be silenced once and for all!<br> Then and there I resolved to make a dish so indigenous to this region that those barbarians would be silenced once and for all!<br>
But, as I'm sure you're aware, it takes more than ingredients to make a dish.<br> But, as I'm sure you're aware, it takes more than ingredients to make a dish.<br>
The monsters in this region are too tough, don't you think?<br> The monsters in this region are too tough, don't you think?<br>
Will you help me?<br> Will you help me?<br>
<a action="bypass -h Quest 623_TheFinestFood 31521-03.htm">"I'll help you."</a> <a action="bypass -h Quest Q00623_TheFinestFood 31521-03.htm>">"I'll help you."</a>
</body></html> </body></html>
\ No newline at end of file
<html><body>Chef Jeremy:<br> <html><body>Chef Jeremy:<br>
Wonderful!<br> Wonderful!<br>
I need some<font color="LEVEL"> Leaves of Hot Springs Flava</font>,<font color="LEVEL"> Meat of Hot Springs Buffalo</font> and<font color="LEVEL"> Horn of Hot Springs Antelope</font>. Please bring me one hundred of each.<br> I need some <font color="LEVEL">Leaves of Hot Springs Flava</font>, <font color="LEVEL">Meat of Hot Springs Buffalo</font> and <font color="LEVEL">Horn of Hot Springs Antelope</font>. Please bring me one hundred of each.<br>
I know it's a lot, but what can I say? Do it for the advancement of culinary science!<br> I know it's a lot, but what can I say? Do it for the advancement of culinary science!
</body></html> </body></html>
\ No newline at end of file
<html><body>Chef Jeremy:<br> <html><body>Chef Jeremy:<br>
Excellent! I didn't think you'd survive! Oh, did I say that out loud?<br> Excellent! I didn't think you'd survive! Oh, did I say that out loud?<br>
I meant to say, I'm very happy to see you back so soon! Now, let's have a look at those ingredients.<br> I meant to say, I'm very happy to see you back so soon! Now, let's have a look at those ingredients.<br>
<a action="bypass -h Quest 623_TheFinestFood 31521-07.htm">"Here you go."</a> <a action="bypass -h Quest Q00623_TheFinestFood 31521-06.html">"Here you go."</a>
</body></html> </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.Q00623_TheFinestFood;
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.holders.ItemHolder;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
/**
* The Finest Food (623)
* @author janiko
*/
public final class Q00623_TheFinestFood extends Quest
{
// NPCs
private static final int JEREMY = 31521;
// Monsters
private static final int THERMAL_BUFFALO = 21315;
private static final int THERMAL_FLAVA = 21316;
private static final int THERMAL_ANTELOPE = 21318;
// Items
private static final ItemHolder LEAF_OF_FLAVA = new ItemHolder(7199, 100);
private static final ItemHolder BUFFALO_MEAT = new ItemHolder(7200, 100);
private static final ItemHolder HORN_OF_ANTELOPE = new ItemHolder(7201, 100);
// Rewards
private static final ItemHolder RING_OF_AURAKYRA = new ItemHolder(6849, 1);
private static final ItemHolder SEALED_SANDDRAGONS_EARING = new ItemHolder(6847, 1);
private static final ItemHolder DRAGON_NECKLACE = new ItemHolder(6851, 1);
// Misc
private static final int MIN_LVL = 71;
private static final Map<Integer, ItemHolder> MONSTER_DROPS = new HashMap<>();
static
{
MONSTER_DROPS.put(THERMAL_BUFFALO, BUFFALO_MEAT);
MONSTER_DROPS.put(THERMAL_FLAVA, LEAF_OF_FLAVA);
MONSTER_DROPS.put(THERMAL_ANTELOPE, HORN_OF_ANTELOPE);
}
public Q00623_TheFinestFood()
{
super(623, Q00623_TheFinestFood.class.getSimpleName(), "The Finest Food");
addStartNpc(JEREMY);
addTalkId(JEREMY);
addKillId(THERMAL_BUFFALO, THERMAL_FLAVA, THERMAL_ANTELOPE);
registerQuestItems(LEAF_OF_FLAVA.getId(), BUFFALO_MEAT.getId(), HORN_OF_ANTELOPE.getId());
}
@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 "31521-03.htm":
{
if (qs.isCreated())
{
qs.startQuest();
htmltext = event;
}
break;
}
case "31521-06.html":
{
if (qs.isCond(2))
{
if (hasAllItems(player, true, LEAF_OF_FLAVA, BUFFALO_MEAT, HORN_OF_ANTELOPE))
{
int random = getRandom(1000);
if (random < 120)
{
giveAdena(player, 25000, true);
rewardItems(player, RING_OF_AURAKYRA);
}
else if (random < 240)
{
giveAdena(player, 65000, true);
rewardItems(player, SEALED_SANDDRAGONS_EARING);
}
else if (random < 340)
{
giveAdena(player, 25000, true);
rewardItems(player, DRAGON_NECKLACE);
}
else if (random < 940)
{
giveAdena(player, 73000, true);
addExpAndSp(player, 230000, 18200);
}
qs.exitQuest(false, true);
htmltext = event;
}
else
{
htmltext = "31521-07.html";
}
}
break;
}
}
return htmltext;
}
@Override
public String onTalk(L2Npc npc, L2PcInstance talker)
{
final QuestState qs = getQuestState(talker, true);
String htmltext = getNoQuestMsg(talker);
switch (npc.getId())
{
case JEREMY:
{
if (qs.isCreated())
{
htmltext = (talker.getLevel() >= MIN_LVL) ? "31521-01.htm" : "31521-02.htm";
}
else if (qs.isStarted())
{
switch (qs.getCond())
{
case 1:
{
htmltext = "31521-04.html";
break;
}
case 2:
{
htmltext = "31521-05.html";
break;
}
}
}
else if (qs.isCompleted())
{
htmltext = getAlreadyCompletedMsg(talker);
}
break;
}
}
return htmltext;
}
@Override
public String onKill(L2Npc npc, L2PcInstance killer, boolean isSummon)
{
final QuestState qs = getRandomPartyMemberState(killer, 1, 3, npc);
final ItemHolder holder = MONSTER_DROPS.get(npc.getId());
if ((qs != null) && giveItemRandomly(qs.getPlayer(), npc, holder.getId(), 1, holder.getCount(), 1, true))
{
if (hasAllItems(qs.getPlayer(), true, BUFFALO_MEAT, HORN_OF_ANTELOPE, LEAF_OF_FLAVA))
{
qs.setCond(2);
}
}
return super.onKill(npc, killer, isSummon);
}
public static void main(String[] args)
{
new Q00623_TheFinestFood();
}
}
\ No newline at end of file
UPDATE character_quests SET name='Q00039_RedEyedInvaders' WHERE name='39_RedEyedInvaders';
UPDATE character_quests SET name='Q00623_TheFinestFood' WHERE name='623_TheFinestFood';
\ No newline at end of file
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