Skip to content
Snippets Groups Projects
Commit 65e2b34f authored by malyelfik's avatar malyelfik
Browse files

BETA: Improved quest '''Resurrection of an Old Manager'''

Suggested by: !UnAfraid
parent 4ed8c1d6
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,6 @@ handlers/MasterHandler.java ...@@ -11,7 +11,6 @@ handlers/MasterHandler.java
# AI Section # AI Section
# Npc # Npc
ai/npc/SuspiciousStones.java
ai/npc/NpcBuffers/BirthdayCake.java ai/npc/NpcBuffers/BirthdayCake.java
ai/npc/NpcBuffers/CabaleBuffer.java ai/npc/NpcBuffers/CabaleBuffer.java
ai/npc/NpcBuffers/Totems.java ai/npc/NpcBuffers/Totems.java
......
/*
* 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;
import quests.Q00114_ResurrectionOfAnOldManager.Q00114_ResurrectionOfAnOldManager;
import com.l2jserver.gameserver.datatables.SpawnTable;
import com.l2jserver.gameserver.model.L2Spawn;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
/**
* Suspicious-Looking Pile of Stones AI
* @author malyelfik
*/
public class SuspiciousStones extends AbstractNpcAI
{
private static final int npcId = 32046;
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equalsIgnoreCase("check"))
{
for (L2PcInstance pl : npc.getKnownList().getKnownPlayers().values())
{
if (pl != null)
{
final QuestState st = pl.getQuestState(Q00114_ResurrectionOfAnOldManager.class.getSimpleName());
if ((st != null) && st.isCond(17))
{
st.takeItems(8090, 1);
st.giveItems(8091, 1);
st.setCond(18, true);
pl.sendPacket(new ExShowScreenMessage(NpcStringId.THE_RADIO_SIGNAL_DETECTOR_IS_RESPONDING_A_SUSPICIOUS_PILE_OF_STONES_CATCHES_YOUR_EYE, 2, 4500));
}
}
}
}
return event;
}
public SuspiciousStones(String name, String descr)
{
super(name, descr);
L2Npc npc = null;
for (L2Spawn spawn : SpawnTable.getInstance().getSpawnTable())
{
if ((spawn != null) && (spawn.getNpcid() == npcId))
{
npc = spawn.getLastSpawn();
}
}
if (npc != null)
{
startQuestTimer("check", 1000, npc, null, true);
}
else
{
_log.warning("SuspiciousStones: Can't find npc!");
}
}
public static void main(String[] args)
{
new SuspiciousStones(SuspiciousStones.class.getSimpleName(), "ai/npc");
}
}
\ No newline at end of file
...@@ -18,13 +18,16 @@ import quests.Q00121_PavelTheGiant.Q00121_PavelTheGiant; ...@@ -18,13 +18,16 @@ import quests.Q00121_PavelTheGiant.Q00121_PavelTheGiant;
import com.l2jserver.gameserver.ai.CtrlIntention; import com.l2jserver.gameserver.ai.CtrlIntention;
import com.l2jserver.gameserver.model.actor.L2Attackable; import com.l2jserver.gameserver.model.actor.L2Attackable;
import com.l2jserver.gameserver.model.actor.L2Character;
import com.l2jserver.gameserver.model.actor.L2Npc; import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest; import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState; import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State; import com.l2jserver.gameserver.model.quest.State;
import com.l2jserver.gameserver.model.zone.L2ZoneType;
import com.l2jserver.gameserver.network.NpcStringId; import com.l2jserver.gameserver.network.NpcStringId;
import com.l2jserver.gameserver.network.clientpackets.Say2; import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.ExShowScreenMessage;
import com.l2jserver.gameserver.network.serverpackets.NpcSay; import com.l2jserver.gameserver.network.serverpackets.NpcSay;
/** /**
...@@ -52,6 +55,9 @@ public class Q00114_ResurrectionOfAnOldManager extends Quest ...@@ -52,6 +55,9 @@ public class Q00114_ResurrectionOfAnOldManager extends Quest
// Monster // Monster
private static final int GUARDIAN = 27318; private static final int GUARDIAN = 27318;
// Zones
private static final int[] ZONES = {200032, 200033, 200034};
private static L2Attackable golem = null; private static L2Attackable golem = null;
@Override @Override
...@@ -562,12 +568,31 @@ public class Q00114_ResurrectionOfAnOldManager extends Quest ...@@ -562,12 +568,31 @@ public class Q00114_ResurrectionOfAnOldManager extends Quest
return super.onKill(npc, player, isPet); return super.onKill(npc, player, isPet);
} }
// TODO: Custom until onNpcSee support is done
@Override
public String onEnterZone(L2Character character, L2ZoneType zone)
{
if (character.isPlayer())
{
final QuestState st = ((L2PcInstance) character).getQuestState(getName());
if ((st != null) && st.isCond(17))
{
st.takeItems(DETCTOR, 1);
st.giveItems(DETCTOR2, 1);
st.setCond(18, true);
character.sendPacket(new ExShowScreenMessage(NpcStringId.THE_RADIO_SIGNAL_DETECTOR_IS_RESPONDING_A_SUSPICIOUS_PILE_OF_STONES_CATCHES_YOUR_EYE, 2, 4500));
}
}
return super.onEnterZone(character, zone);
}
public Q00114_ResurrectionOfAnOldManager(int questId, String name, String descr) public Q00114_ResurrectionOfAnOldManager(int questId, String name, String descr)
{ {
super(questId, name, descr); super(questId, name, descr);
addStartNpc(YUMI); addStartNpc(YUMI);
addTalkId(YUMI, WENDY, BOX, STONES, NEWYEAR); addTalkId(YUMI, WENDY, BOX, STONES, NEWYEAR);
addKillId(GUARDIAN); addKillId(GUARDIAN);
addEnterZoneId(ZONES);
registerQuestItems(STARSTONE, STARSTONE2, DETCTOR, DETCTOR2, LETTER); registerQuestItems(STARSTONE, STARSTONE2, DETCTOR, DETCTOR2, LETTER);
} }
......
...@@ -234,4 +234,21 @@ ...@@ -234,4 +234,21 @@
<node X="-49004" Y="242907" /> <node X="-49004" Y="242907" />
<node X="-47530" Y="244402" /> <node X="-47530" Y="244402" />
</zone> </zone>
<!-- Custom zones for quest 114 -->
<zone name="archaic_laboratory_gate1" id="200032" type="ScriptZone" shape="Cuboid" minZ="-3300" maxZ="-3400">
<node X="89953" Y="-106250" />
<node X="90242" Y="-106143" />
</zone>
<zone name="archaic_laboratory_gate2" id="200033" type="ScriptZone" shape="NPoly" minZ="-3300" maxZ="-3400">
<node X="91491" Y="-108277" />
<node X="91409" Y="-108192" />
<node X="91623" Y="-107981" />
<node X="91703" Y="-108064" />
</zone>
<zone name="archaic_laboratory_gate3" id="200034" type="ScriptZone" shape="NPoly" minZ="-3300" maxZ="-3400">
<node X="88468" Y="-108063" />
<node X="88549" Y="-107983" />
<node X="88759" Y="-108195" />
<node X="88677" Y="-108275" />
</zone>
</list> </list>
\ 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