Skip to content
Snippets Groups Projects
Commit 2eb9a576 authored by malyelfik's avatar malyelfik
Browse files

BETA: Improved quest '''Control Device of the Giants (307) '''

 * Now Hekaton respawn isn't stored only for players who killed him
parent bc6c4904
No related branches found
No related tags found
No related merge requests found
Showing
with 81 additions and 122 deletions
<html><body>Dwarf Explorer Droph:<br> <html><body>Dwarf Explorer Droph:<br>
There is a Raid Monster named <font color="LEVEL">Hekaton Prime</font> in the deep substratum of this Giants' Cave. In fact, it is the central core that controls this area!<br> There is a Raid Monster named <font color="LEVEL">Hekaton Prime</font> in the deep substratum of this Giants' Cave. In fact, it is the central core that controls this area!<br>
If we can expel it, our exploration will be much easier. Doing so is beyond my power, though.<br>Perhaps you have some equally powerful friends who would be willing to help you do it? I'll happily pay you for your work!<br> If we can expel it, our exploration will be much easier. Doing so is beyond my power, though.<br>Perhaps you have some equally powerful friends who would be willing to help you do it? I'll happily pay you for your work!<br>
<a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-04.htm">Accept.</a></body></html> <a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-04.html">Accept.</a></body></html>
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
Good decision! I'll fill you in on the information then, aye?<br> Good decision! I'll fill you in on the information then, aye?<br>
This Hekaton Prime does not show itself often: it's a controling unit that prefers to work at the back, see? He has three monsters... that's <font color="LEVEL">Gorgos, the Last Titan Utenes, and Giant Marpanak</font>, and each guard Hekaton Prime's cave.<br> This Hekaton Prime does not show itself often: it's a controling unit that prefers to work at the back, see? He has three monsters... that's <font color="LEVEL">Gorgos, the Last Titan Utenes, and Giant Marpanak</font>, and each guard Hekaton Prime's cave.<br>
To capture Hekaton Prime, you need to take care of the three monsters first. Capture these monsters and collect the <font color="LEVEL">Cave Exploration Text</font>1 to 3. I'll then translate them and summon Hekaton Prime for you.<br> To capture Hekaton Prime, you need to take care of the three monsters first. Capture these monsters and collect the <font color="LEVEL">Cave Exploration Text</font>1 to 3. I'll then translate them and summon Hekaton Prime for you.<br>
<a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05.htm">"Tell me the about the monsters I need to capture."</a><br> <a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05.html">"Tell me the about the monsters I need to capture."</a><br>
<a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-06.htm">"I'll get started now."</a> <a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-06.html">"I'll get started now."</a>
</body></html> </body></html>
\ No newline at end of file
<html><body>Dwarf Adventurer Droph:<br> <html><body>Dwarf Adventurer Droph:<br>
They are the right-hand creatures of Hekaton Prime: Gorgos, the Last Titan Utenes, and the Giant Marpanak. If you want to know where they are, I'd be more than willing to help. Which would you like to face first?<br> They are the right-hand creatures of Hekaton Prime: Gorgos, the Last Titan Utenes, and the Giant Marpanak. If you want to know where they are, I'd be more than willing to help. Which would you like to face first?<br>
<a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05a.htm">"Where's the Gorgos?"</a><br> <a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05a.html">"Where's the Gorgos?"</a><br>
<a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05b.htm">"I want Utenes."</a><br> <a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05b.html">"I want Utenes."</a><br>
<a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05c.htm">"Where's the Giant Marpanak?"</a> <a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05c.html">"Where's the Giant Marpanak?"</a>
</body></html> </body></html>
\ No newline at end of file
<html><body>Dwarf Explorer Droph:<br> <html><body>Dwarf Explorer Droph:<br>
You must defeat Gorgolos, last Giant ???? and Giant ????? before facing Hekaton Prime. If you want to know where they are, I am more than willing to tell you. Which one are you interested in?<br> You must defeat Gorgolos, last Giant ???? and Giant ????? before facing Hekaton Prime. If you want to know where they are, I am more than willing to tell you. Which one are you interested in?<br>
<a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05a.htm">Gorgolos</a><br> <a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05a.html">Gorgolos</a><br>
<a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05b.htm">Last Giant ????</a><br> <a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05b.html">Last Giant ????</a><br>
<a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05c.htm">Giant ?????</a> <a action="bypass -h Quest Q00307_ControlDeviceOfTheGiants 32711-05c.html">Giant ?????</a>
</body></html> </body></html>
\ No newline at end of file
...@@ -29,91 +29,79 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest ...@@ -29,91 +29,79 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
{ {
// NPC // NPC
private final static int DROPH = 32711; private final static int DROPH = 32711;
// RB // RB
private final static int GORGOLOS = 25681; private final static int GORGOLOS = 25681;
private final static int LAST_TITAN_UTENUS = 25684; private final static int LAST_TITAN_UTENUS = 25684;
private final static int GIANT_MARPANAK = 25680; private final static int GIANT_MARPANAK = 25680;
private final static int HEKATON_PRIME = 25687; private final static int HEKATON_PRIME = 25687;
// Items // Items
private final static int SUPPORT_ITEMS = 14850; private final static int SUPPORT_ITEMS = 14850;
private final static int CET_1_SHEET = 14851; private final static int CET_1_SHEET = 14851;
private final static int CET_2_SHEET = 14852; private final static int CET_2_SHEET = 14852;
private final static int CET_3_SHEET = 14853; private final static int CET_3_SHEET = 14853;
private final static int respawnDelay = 3600000; // 1 hour // Misc
private final static int RESPAWN_DELAY = 3600000; // 1 hour
private static L2Npc hekaton;
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
QuestState st = player.getQuestState(getName()); final QuestState st = player.getQuestState(getName());
String htmltext = event;
if (st == null) if (st == null)
{ {
return null; return null;
} }
if (event.equalsIgnoreCase("32711-04.htm")) String htmltext = event;
switch (event)
{ {
if (st.getPlayer().getLevel() >= 79) case "32711-04.html":
{ if (player.getLevel() >= 79)
st.setState(State.STARTED);
st.set("cond", "1");
st.playSound("ItemSound.quest_accept");
if (!st.hasQuestItems(CET_1_SHEET) || !st.hasQuestItems(CET_2_SHEET) || !st.hasQuestItems(CET_3_SHEET))
{ {
htmltext = "32711-04.htm"; st.startQuest();
htmltext = (hasQuestItems(player, CET_1_SHEET, CET_2_SHEET, CET_3_SHEET)) ? "32711-04a.html" : "32711-04.html";
} }
else if (st.hasQuestItems(CET_1_SHEET) && st.hasQuestItems(CET_2_SHEET) && st.hasQuestItems(CET_3_SHEET)) break;
case "32711-05a.html":
player.sendPacket(new RadarControl(0, 2, 186214, 61591, -4152));
break;
case "32711-05b.html":
player.sendPacket(new RadarControl(0, 2, 187554, 60800, -4984));
break;
case "32711-05c.html":
player.sendPacket(new RadarControl(0, 2, 193432, 53922, -4368));
break;
case "spawn":
if (!hasQuestItems(player, CET_1_SHEET, CET_2_SHEET, CET_3_SHEET))
{ {
htmltext = "32711-04a.htm"; return getNoQuestMsg(player);
} }
} else if ((hekaton != null) && !hekaton.isDead())
}
else if (event.equalsIgnoreCase("32711-05a.htm"))
{
player.sendPacket(new RadarControl(0, 2, 186214, 61591, -4152));
}
else if (event.equalsIgnoreCase("32711-05b.htm"))
{
player.sendPacket(new RadarControl(0, 2, 187554, 60800, -4984));
}
else if (event.equalsIgnoreCase("32711-05c.htm"))
{
player.sendPacket(new RadarControl(0, 2, 193432, 53922, -4368));
}
// Hekaton Prime spawn
else if (event.equalsIgnoreCase("spawn"))
{
String test = st.getGlobalQuestVar("Hekaton respawn");
if (test.isEmpty())
{
st.takeItems(CET_1_SHEET, 1);
st.takeItems(CET_2_SHEET, 1);
st.takeItems(CET_3_SHEET, 1);
addSpawn(HEKATON_PRIME, 191887, 56405, -7626, 1000, false, 0);
st.set("spawned", "1");
htmltext = "32711-09.htm";
}
else
{
long remain = Long.parseLong(test) - System.currentTimeMillis();
if (remain > 0)
{ {
htmltext = "32711-09a.htm"; return "32711-09.html";
} }
else String respawn = loadGlobalQuestVar("Respawn");
long remain = (!respawn.isEmpty()) ? Long.parseLong(respawn) - System.currentTimeMillis() : 0;
if (remain > 0)
{ {
st.takeItems(CET_1_SHEET, 1); return "32711-09a.html";
st.takeItems(CET_2_SHEET, 1);
st.takeItems(CET_3_SHEET, 1);
addSpawn(HEKATON_PRIME, 192062, 57357, -7650, 1000, false, 0);
st.set("spawned", "1");
htmltext = "32711-09.htm";
} }
} st.takeItems(CET_1_SHEET, 1);
st.takeItems(CET_2_SHEET, 1);
st.takeItems(CET_3_SHEET, 1);
hekaton = addSpawn(HEKATON_PRIME, 191777, 56197, -7624, 0, false, 0);
htmltext = "32711-09.html";
break;
case "32711-03.htm":
case "32711-05.html":
case "32711-06.html":
break;
default:
htmltext = null;
break;
} }
return htmltext; return htmltext;
} }
...@@ -122,7 +110,7 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest ...@@ -122,7 +110,7 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
public String onTalk(L2Npc npc, L2PcInstance player) public String onTalk(L2Npc npc, L2PcInstance player)
{ {
String htmltext = getNoQuestMsg(player); String htmltext = getNoQuestMsg(player);
QuestState st = player.getQuestState(getName()); final QuestState st = player.getQuestState(getName());
if (st == null) if (st == null)
{ {
return htmltext; return htmltext;
...@@ -132,39 +120,24 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest ...@@ -132,39 +120,24 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
{ {
case State.CREATED: case State.CREATED:
{ {
if (player.getLevel() >= 79) htmltext = (player.getLevel() >= 79) ? "32711-01.htm" : "32711-02.htm";
{
htmltext = "32711-01.htm";
}
else
{
htmltext = "32711-02.htm";
}
break; break;
} }
case State.STARTED: case State.STARTED:
{ {
if (st.getInt("spawned") == 1) if ((hekaton != null) && !hekaton.isDead())
{ {
htmltext = "32711-09.htm"; htmltext = "32711-09.html";
} }
else if (st.getInt("cond") == 1) else if (st.isCond(1))
{ {
if (!st.hasQuestItems(CET_1_SHEET) || !st.hasQuestItems(CET_2_SHEET) || !st.hasQuestItems(CET_3_SHEET)) htmltext = (!hasQuestItems(player, CET_1_SHEET, CET_2_SHEET, CET_3_SHEET)) ? "32711-07.html" : "32711-08.html";
{
htmltext = "32711-07.htm";
}
else
{
htmltext = "32711-08.htm";
}
} }
else if (st.getInt("cond") == 2) else if (st.isCond(2))
{ {
st.giveItems(SUPPORT_ITEMS, 1); st.giveItems(SUPPORT_ITEMS, 1);
st.playSound("ItemSound.quest_finish"); st.exitQuest(true, true);
st.exitQuest(true); htmltext = "32711-10.html";
htmltext = "32711-10.htm";
} }
break; break;
} }
...@@ -175,10 +148,10 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest ...@@ -175,10 +148,10 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
@Override @Override
public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) public String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
{ {
L2PcInstance partyMember = getRandomPartyMember(player, "1"); final L2PcInstance partyMember = getRandomPartyMember(player, "1");
if (partyMember == null) if (partyMember == null)
{ {
return null; return super.onKill(npc, player, isPet);
} }
final QuestState st = partyMember.getQuestState(getName()); final QuestState st = partyMember.getQuestState(getName());
...@@ -187,67 +160,52 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest ...@@ -187,67 +160,52 @@ public class Q00307_ControlDeviceOfTheGiants extends Quest
case GORGOLOS: case GORGOLOS:
{ {
st.giveItems(CET_1_SHEET, 1); st.giveItems(CET_1_SHEET, 1);
st.playSound("ItemSound.quest_itemget"); st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
break; break;
} }
case LAST_TITAN_UTENUS: case LAST_TITAN_UTENUS:
{ {
st.giveItems(CET_2_SHEET, 1); st.giveItems(CET_2_SHEET, 1);
st.playSound("ItemSound.quest_itemget"); st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
break; break;
} }
case GIANT_MARPANAK: case GIANT_MARPANAK:
{ {
st.giveItems(CET_3_SHEET, 1); st.giveItems(CET_3_SHEET, 1);
st.playSound("ItemSound.quest_itemget"); st.playSound(QuestSound.ITEMSOUND_QUEST_ITEMGET);
break; break;
} }
case HEKATON_PRIME: case HEKATON_PRIME:
{ {
if (player.getParty() != null) if (player.isInParty())
{ {
for (L2PcInstance party : player.getParty().getMembers()) for (L2PcInstance pl : player.getParty().getMembers())
{ {
rewardPlayer(party); final QuestState qs = pl.getQuestState(getName());
if ((qs != null) && qs.isCond(1))
{
qs.setCond(2, true);
}
} }
} saveGlobalQuestVar("Respawn", Long.toString(System.currentTimeMillis() + RESPAWN_DELAY));
else
{
rewardPlayer(player);
} }
break; break;
} }
} }
return null; return super.onKill(npc, player, isPet);
}
private void rewardPlayer(L2PcInstance player)
{
QuestState st = player.getQuestState(getName());
if ((st != null) && (st.getInt("spawned") == 1))
{
st.playSound("ItemSound.quest_middle");
st.unset("spawned");
st.set("cond", "2");
st.saveGlobalQuestVar("Hekaton respawn", Long.toString(System.currentTimeMillis() + respawnDelay));
}
} }
public Q00307_ControlDeviceOfTheGiants(int id, String name, String descr) public Q00307_ControlDeviceOfTheGiants(int id, String name, String descr)
{ {
super(id, name, descr); super(id, name, descr);
addStartNpc(DROPH); addStartNpc(DROPH);
addTalkId(DROPH); addTalkId(DROPH);
addKillId(GORGOLOS); addKillId(GORGOLOS, LAST_TITAN_UTENUS, GIANT_MARPANAK, HEKATON_PRIME);
addKillId(LAST_TITAN_UTENUS);
addKillId(GIANT_MARPANAK);
addKillId(HEKATON_PRIME);
} }
public static void main(String[] args) public static void main(String[] args)
{ {
new Q00307_ControlDeviceOfTheGiants(307, Q00307_ControlDeviceOfTheGiants.class.getSimpleName(), "Control Device Of The Giants"); new Q00307_ControlDeviceOfTheGiants(307, Q00307_ControlDeviceOfTheGiants.class.getSimpleName(), "Control Device of the Giants");
} }
} }
\ No newline at end of file
DELETE FROM character_quest_global_data WHERE var = "Hekaton respawn";
\ 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