Mystic tavern employee improvements.

Contributed by gigilo1968.
This commit is contained in:
MobiusDev 2019-03-06 17:00:29 +00:00
parent 11ff29197c
commit 20354f0a99
12 changed files with 1830 additions and 342 deletions

View File

@ -19,11 +19,20 @@ package instances.MysticTavern;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Party; import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.zone.type.L2ScriptZone;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
import instances.MysticTavern.StoryOfFreya.StoryOfFreya; import instances.MysticTavern.StoryOfFreya.StoryOfFreya;
@ -35,34 +44,54 @@ import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub;
* @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI * @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI
* @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4 * @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4
* @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE * @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE
* @author Mobius * @author Mobius, Gigi
*/ */
public class MysticTavern extends AbstractNpcAI public class MysticTavern extends AbstractNpcAI
{ {
// NPC // NPC
private static final int GLOBE = 34200; private static final int GLOBE = 34200;
// Employee
private static final int LOLLIA = 34182;
private static final int HANNA = 34183;
private static final int BRODIEN = 34184;
private static final int LUPIA = 34185;
private static final int MEY = 34186;
// Instances // Instances
// private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_TAUTI = 261;
// private static final int INSTANCE_KELBIM = 262; // private static final int INSTANCE_KELBIM = 262;
private static final int INSTANCE_FREYA = 263; private static final int INSTANCE_FREYA = 263;
// Zones
private static final L2ScriptZone GLOBE_1_ZONE = ZoneManager.getInstance().getZoneById(80019, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_2_ZONE = ZoneManager.getInstance().getZoneById(80020, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_3_ZONE = ZoneManager.getInstance().getZoneById(80021, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_4_ZONE = ZoneManager.getInstance().getZoneById(80022, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_5_ZONE = ZoneManager.getInstance().getZoneById(80023, L2ScriptZone.class);
// Misc // Misc
private static final int MINIMUM_PLAYER_LEVEL = 99; private static final int MINIMUM_PLAYER_LEVEL = 99;
private static final int MINIMUM_PARTY_MEMBERS = 5; private static final int MINIMUM_PARTY_MEMBERS = 5;
private static L2Npc _lollia;
private static L2Npc _hanna;
private static L2Npc _brodien;
private static L2Npc _lupia;
private static L2Npc _mey;
public MysticTavern() public MysticTavern()
{ {
addFirstTalkId(GLOBE); addFirstTalkId(GLOBE);
addSpawnId(LOLLIA, HANNA, BRODIEN, LUPIA, MEY);
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("tellStory"))
{ {
final List<Integer> availableInstances = new ArrayList<>(); final List<Integer> availableInstances = new ArrayList<>();
availableInstances.add(INSTANCE_FREYA); availableInstances.add(INSTANCE_FREYA);
// availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_TAUTI);
// availableInstances.add(INSTANCE_KELBIM); // availableInstances.add(INSTANCE_KELBIM);
switch (event)
{
case "tellStory":
{
if (!player.isGM()) if (!player.isGM())
{ {
final L2Party party = player.getParty(); final L2Party party = player.getParty();
@ -110,7 +139,174 @@ public class MysticTavern extends AbstractNpcAI
{ {
return "34200-not-available.html"; return "34200-not-available.html";
} }
startQuestTimer("npcRoute", 3000, npc, player);
} }
startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test
break;
}
case "npcRoute":
{
if (GLOBE_1_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18133000, true));
_brodien.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50000, -148560, -14152));
_brodien.setHeading(48440);
startQuestTimer("msg_text_brodien_1", 16000, _brodien, null);
startQuestTimer("msg_text_brodien_2", 23000, _brodien, null);
startQuestTimer("msg_text_brodien_3", 31000, _brodien, null);
}
else if (GLOBE_2_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18132000, true));
_lupia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50161, -148356, -14152));
_lupia.setHeading(45808);
startQuestTimer("msg_text_lupia_1", 12000, _lupia, null);
startQuestTimer("msg_text_lupia_2", 19000, _lupia, null);
startQuestTimer("msg_text_lupia_3", 27000, _lupia, null);
}
else if (GLOBE_3_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18131000, true));
_mey.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50092, -148096, -14152));
_mey.setHeading(34669);
startQuestTimer("msg_text_mey_1", 8000, _mey, null);
startQuestTimer("msg_text_mey_2", 15000, _mey, null);
startQuestTimer("msg_text_mey_3", 23000, _mey, null);
}
else if (GLOBE_4_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18135000, true));
_lollia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49480, -148074, -14152));
_lollia.setHeading(13255);
startQuestTimer("msg_text_lollia_1", 10000, _lollia, null);
startQuestTimer("msg_text_lollia_2", 17000, _lollia, null);
startQuestTimer("msg_text_lollia_3", 25000, _lollia, null);
}
else if (GLOBE_5_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18134000, true));
_hanna.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49283, -148179, -14152));
_hanna.setHeading(26747);
startQuestTimer("msg_text_hanna_1", 12000, _hanna, null);
startQuestTimer("msg_text_hanna_2", 19000, _hanna, null);
startQuestTimer("msg_text_hanna_3", 27000, _hanna, null);
}
break;
}
case "msg_text_brodien_1":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.I_HAVE_MANY_STORIES_TO_TELL));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_2":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.PLEASE_SIT_DOWN_SO_THAT_I_CAN_START));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_3":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.WELL_WHOSE_STORY_SHOULD_I_TELL_YOU_TODAY));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18133000, false));
break;
}
case "msg_text_lupia_1":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.HURRY_SIT_DOWN));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_2":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.WHOSE_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_3":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.YOU_HAVE_TO_BE_READY));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18132000, false));
break;
}
case "msg_text_mey_1":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.SHOULD_I_START_LET_S_SEE_IF_WE_RE_READY));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_2":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.I_LL_BE_STARTING_NOW_SO_TAKE_A_SEAT));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_3":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18131000, false));
break;
}
case "msg_text_lollia_1":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.ARE_YOU_READY_TO_HEAR_THE_STORY));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_2":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.I_LL_START_ONCE_EVERYONE_IS_SEATED));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_3":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.HEH_WHAT_SHOULD_I_TALK_ABOUT_NEXT_HMM));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18135000, false));
break;
}
case "msg_text_hanna_1":
{
_hanna.setHeading(26747);
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.WELL_WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_2":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.I_WONDER_WHAT_KIND_OF_STORIES_ARE_POPULAR_WITH_THE_CUSTOMERS));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_3":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.SIT_DOWN_FIRST_I_CAN_T_START_OTHERWISE));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18134000, false));
break;
}
case "return":
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, npc.getSpawn());
npc.setHeading(npc.getSpawn().getHeading());
break;
}
case "enter_instance":
{
// enter randomly // enter randomly
switch (availableInstances.get(getRandom(availableInstances.size()))) switch (availableInstances.get(getRandom(availableInstances.size())))
{ {
@ -130,10 +326,46 @@ public class MysticTavern extends AbstractNpcAI
// break; // break;
// } // }
} }
break;
}
} }
return null; return null;
} }
@Override
public String onSpawn(L2Npc npc)
{
switch (npc.getId())
{
case LOLLIA:
{
_lollia = npc;
break;
}
case HANNA:
{
_hanna = npc;
break;
}
case BRODIEN:
{
_brodien = npc;
break;
}
case LUPIA:
{
_lupia = npc;
break;
}
case MEY:
{
_mey = npc;
break;
}
}
return super.onSpawn(npc);
}
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {

View File

@ -1115,4 +1115,20 @@
<zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100"> <zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100">
<node X="225947" Y="-50420" /> <node X="225947" Y="-50420" />
</zone> </zone>
<!-- Mystic Tavarn Globe Zone -->
<zone name="Mystic_Tavern_Globe1" id="80019" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50055" Y="-148630" />
</zone>
<zone name="Mystic_Tavern_Globe2" id="80020" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50168" Y="-148440" />
</zone>
<zone name="Mystic_Tavern_Globe3" id="80021" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50148" Y="-148055" />
</zone>
<zone name="Mystic_Tavern_Globe4" id="80022" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49495" Y="-148020" />
</zone>
<zone name="Mystic_Tavern_Globe5" id="80023" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49355" Y="-148215" />
</zone>
</list> </list>

View File

@ -19,11 +19,20 @@ package instances.MysticTavern;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Party; import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.zone.type.L2ScriptZone;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
import instances.MysticTavern.StoryOfFreya.StoryOfFreya; import instances.MysticTavern.StoryOfFreya.StoryOfFreya;
@ -35,34 +44,54 @@ import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub;
* @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI * @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI
* @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4 * @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4
* @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE * @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE
* @author Mobius * @author Mobius, Gigi
*/ */
public class MysticTavern extends AbstractNpcAI public class MysticTavern extends AbstractNpcAI
{ {
// NPC // NPC
private static final int GLOBE = 34200; private static final int GLOBE = 34200;
// Employee
private static final int LOLLIA = 34182;
private static final int HANNA = 34183;
private static final int BRODIEN = 34184;
private static final int LUPIA = 34185;
private static final int MEY = 34186;
// Instances // Instances
// private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_TAUTI = 261;
// private static final int INSTANCE_KELBIM = 262; // private static final int INSTANCE_KELBIM = 262;
private static final int INSTANCE_FREYA = 263; private static final int INSTANCE_FREYA = 263;
// Zones
private static final L2ScriptZone GLOBE_1_ZONE = ZoneManager.getInstance().getZoneById(80019, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_2_ZONE = ZoneManager.getInstance().getZoneById(80020, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_3_ZONE = ZoneManager.getInstance().getZoneById(80021, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_4_ZONE = ZoneManager.getInstance().getZoneById(80022, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_5_ZONE = ZoneManager.getInstance().getZoneById(80023, L2ScriptZone.class);
// Misc // Misc
private static final int MINIMUM_PLAYER_LEVEL = 99; private static final int MINIMUM_PLAYER_LEVEL = 99;
private static final int MINIMUM_PARTY_MEMBERS = 5; private static final int MINIMUM_PARTY_MEMBERS = 5;
private static L2Npc _lollia;
private static L2Npc _hanna;
private static L2Npc _brodien;
private static L2Npc _lupia;
private static L2Npc _mey;
public MysticTavern() public MysticTavern()
{ {
addFirstTalkId(GLOBE); addFirstTalkId(GLOBE);
addSpawnId(LOLLIA, HANNA, BRODIEN, LUPIA, MEY);
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("tellStory"))
{ {
final List<Integer> availableInstances = new ArrayList<>(); final List<Integer> availableInstances = new ArrayList<>();
availableInstances.add(INSTANCE_FREYA); availableInstances.add(INSTANCE_FREYA);
// availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_TAUTI);
// availableInstances.add(INSTANCE_KELBIM); // availableInstances.add(INSTANCE_KELBIM);
switch (event)
{
case "tellStory":
{
if (!player.isGM()) if (!player.isGM())
{ {
final L2Party party = player.getParty(); final L2Party party = player.getParty();
@ -110,7 +139,174 @@ public class MysticTavern extends AbstractNpcAI
{ {
return "34200-not-available.html"; return "34200-not-available.html";
} }
startQuestTimer("npcRoute", 3000, npc, player);
} }
startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test
break;
}
case "npcRoute":
{
if (GLOBE_1_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18133000, true));
_brodien.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50000, -148560, -14152));
_brodien.setHeading(48440);
startQuestTimer("msg_text_brodien_1", 16000, _brodien, null);
startQuestTimer("msg_text_brodien_2", 23000, _brodien, null);
startQuestTimer("msg_text_brodien_3", 31000, _brodien, null);
}
else if (GLOBE_2_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18132000, true));
_lupia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50161, -148356, -14152));
_lupia.setHeading(45808);
startQuestTimer("msg_text_lupia_1", 12000, _lupia, null);
startQuestTimer("msg_text_lupia_2", 19000, _lupia, null);
startQuestTimer("msg_text_lupia_3", 27000, _lupia, null);
}
else if (GLOBE_3_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18131000, true));
_mey.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50092, -148096, -14152));
_mey.setHeading(34669);
startQuestTimer("msg_text_mey_1", 8000, _mey, null);
startQuestTimer("msg_text_mey_2", 15000, _mey, null);
startQuestTimer("msg_text_mey_3", 23000, _mey, null);
}
else if (GLOBE_4_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18135000, true));
_lollia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49480, -148074, -14152));
_lollia.setHeading(13255);
startQuestTimer("msg_text_lollia_1", 10000, _lollia, null);
startQuestTimer("msg_text_lollia_2", 17000, _lollia, null);
startQuestTimer("msg_text_lollia_3", 25000, _lollia, null);
}
else if (GLOBE_5_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18134000, true));
_hanna.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49283, -148179, -14152));
_hanna.setHeading(26747);
startQuestTimer("msg_text_hanna_1", 12000, _hanna, null);
startQuestTimer("msg_text_hanna_2", 19000, _hanna, null);
startQuestTimer("msg_text_hanna_3", 27000, _hanna, null);
}
break;
}
case "msg_text_brodien_1":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.I_HAVE_MANY_STORIES_TO_TELL));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_2":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.PLEASE_SIT_DOWN_SO_THAT_I_CAN_START));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_3":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.WELL_WHOSE_STORY_SHOULD_I_TELL_YOU_TODAY));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18133000, false));
break;
}
case "msg_text_lupia_1":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.HURRY_SIT_DOWN));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_2":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.WHOSE_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_3":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.YOU_HAVE_TO_BE_READY));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18132000, false));
break;
}
case "msg_text_mey_1":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.SHOULD_I_START_LET_S_SEE_IF_WE_RE_READY));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_2":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.I_LL_BE_STARTING_NOW_SO_TAKE_A_SEAT));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_3":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18131000, false));
break;
}
case "msg_text_lollia_1":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.ARE_YOU_READY_TO_HEAR_THE_STORY));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_2":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.I_LL_START_ONCE_EVERYONE_IS_SEATED));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_3":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.HEH_WHAT_SHOULD_I_TALK_ABOUT_NEXT_HMM));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18135000, false));
break;
}
case "msg_text_hanna_1":
{
_hanna.setHeading(26747);
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.WELL_WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_2":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.I_WONDER_WHAT_KIND_OF_STORIES_ARE_POPULAR_WITH_THE_CUSTOMERS));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_3":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.SIT_DOWN_FIRST_I_CAN_T_START_OTHERWISE));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18134000, false));
break;
}
case "return":
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, npc.getSpawn());
npc.setHeading(npc.getSpawn().getHeading());
break;
}
case "enter_instance":
{
// enter randomly // enter randomly
switch (availableInstances.get(getRandom(availableInstances.size()))) switch (availableInstances.get(getRandom(availableInstances.size())))
{ {
@ -130,10 +326,46 @@ public class MysticTavern extends AbstractNpcAI
// break; // break;
// } // }
} }
break;
}
} }
return null; return null;
} }
@Override
public String onSpawn(L2Npc npc)
{
switch (npc.getId())
{
case LOLLIA:
{
_lollia = npc;
break;
}
case HANNA:
{
_hanna = npc;
break;
}
case BRODIEN:
{
_brodien = npc;
break;
}
case LUPIA:
{
_lupia = npc;
break;
}
case MEY:
{
_mey = npc;
break;
}
}
return super.onSpawn(npc);
}
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {

View File

@ -1115,4 +1115,20 @@
<zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100"> <zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100">
<node X="225947" Y="-50420" /> <node X="225947" Y="-50420" />
</zone> </zone>
<!-- Mystic Tavarn Globe Zone -->
<zone name="Mystic_Tavern_Globe1" id="80019" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50055" Y="-148630" />
</zone>
<zone name="Mystic_Tavern_Globe2" id="80020" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50168" Y="-148440" />
</zone>
<zone name="Mystic_Tavern_Globe3" id="80021" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50148" Y="-148055" />
</zone>
<zone name="Mystic_Tavern_Globe4" id="80022" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49495" Y="-148020" />
</zone>
<zone name="Mystic_Tavern_Globe5" id="80023" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49355" Y="-148215" />
</zone>
</list> </list>

View File

@ -19,11 +19,20 @@ package instances.MysticTavern;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Party; import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.zone.type.L2ScriptZone;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
import instances.MysticTavern.StoryOfFreya.StoryOfFreya; import instances.MysticTavern.StoryOfFreya.StoryOfFreya;
@ -35,34 +44,54 @@ import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub;
* @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI * @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI
* @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4 * @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4
* @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE * @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE
* @author Mobius * @author Mobius, Gigi
*/ */
public class MysticTavern extends AbstractNpcAI public class MysticTavern extends AbstractNpcAI
{ {
// NPC // NPC
private static final int GLOBE = 34200; private static final int GLOBE = 34200;
// Employee
private static final int LOLLIA = 34182;
private static final int HANNA = 34183;
private static final int BRODIEN = 34184;
private static final int LUPIA = 34185;
private static final int MEY = 34186;
// Instances // Instances
// private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_TAUTI = 261;
// private static final int INSTANCE_KELBIM = 262; // private static final int INSTANCE_KELBIM = 262;
private static final int INSTANCE_FREYA = 263; private static final int INSTANCE_FREYA = 263;
// Zones
private static final L2ScriptZone GLOBE_1_ZONE = ZoneManager.getInstance().getZoneById(80019, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_2_ZONE = ZoneManager.getInstance().getZoneById(80020, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_3_ZONE = ZoneManager.getInstance().getZoneById(80021, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_4_ZONE = ZoneManager.getInstance().getZoneById(80022, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_5_ZONE = ZoneManager.getInstance().getZoneById(80023, L2ScriptZone.class);
// Misc // Misc
private static final int MINIMUM_PLAYER_LEVEL = 99; private static final int MINIMUM_PLAYER_LEVEL = 99;
private static final int MINIMUM_PARTY_MEMBERS = 5; private static final int MINIMUM_PARTY_MEMBERS = 5;
private static L2Npc _lollia;
private static L2Npc _hanna;
private static L2Npc _brodien;
private static L2Npc _lupia;
private static L2Npc _mey;
public MysticTavern() public MysticTavern()
{ {
addFirstTalkId(GLOBE); addFirstTalkId(GLOBE);
addSpawnId(LOLLIA, HANNA, BRODIEN, LUPIA, MEY);
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("tellStory"))
{ {
final List<Integer> availableInstances = new ArrayList<>(); final List<Integer> availableInstances = new ArrayList<>();
availableInstances.add(INSTANCE_FREYA); availableInstances.add(INSTANCE_FREYA);
// availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_TAUTI);
// availableInstances.add(INSTANCE_KELBIM); // availableInstances.add(INSTANCE_KELBIM);
switch (event)
{
case "tellStory":
{
if (!player.isGM()) if (!player.isGM())
{ {
final L2Party party = player.getParty(); final L2Party party = player.getParty();
@ -110,7 +139,174 @@ public class MysticTavern extends AbstractNpcAI
{ {
return "34200-not-available.html"; return "34200-not-available.html";
} }
startQuestTimer("npcRoute", 3000, npc, player);
} }
startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test
break;
}
case "npcRoute":
{
if (GLOBE_1_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18133000, true));
_brodien.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50000, -148560, -14152));
_brodien.setHeading(48440);
startQuestTimer("msg_text_brodien_1", 16000, _brodien, null);
startQuestTimer("msg_text_brodien_2", 23000, _brodien, null);
startQuestTimer("msg_text_brodien_3", 31000, _brodien, null);
}
else if (GLOBE_2_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18132000, true));
_lupia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50161, -148356, -14152));
_lupia.setHeading(45808);
startQuestTimer("msg_text_lupia_1", 12000, _lupia, null);
startQuestTimer("msg_text_lupia_2", 19000, _lupia, null);
startQuestTimer("msg_text_lupia_3", 27000, _lupia, null);
}
else if (GLOBE_3_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18131000, true));
_mey.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50092, -148096, -14152));
_mey.setHeading(34669);
startQuestTimer("msg_text_mey_1", 8000, _mey, null);
startQuestTimer("msg_text_mey_2", 15000, _mey, null);
startQuestTimer("msg_text_mey_3", 23000, _mey, null);
}
else if (GLOBE_4_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18135000, true));
_lollia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49480, -148074, -14152));
_lollia.setHeading(13255);
startQuestTimer("msg_text_lollia_1", 10000, _lollia, null);
startQuestTimer("msg_text_lollia_2", 17000, _lollia, null);
startQuestTimer("msg_text_lollia_3", 25000, _lollia, null);
}
else if (GLOBE_5_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18134000, true));
_hanna.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49283, -148179, -14152));
_hanna.setHeading(26747);
startQuestTimer("msg_text_hanna_1", 12000, _hanna, null);
startQuestTimer("msg_text_hanna_2", 19000, _hanna, null);
startQuestTimer("msg_text_hanna_3", 27000, _hanna, null);
}
break;
}
case "msg_text_brodien_1":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.I_HAVE_MANY_STORIES_TO_TELL));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_2":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.PLEASE_SIT_DOWN_SO_THAT_I_CAN_START));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_3":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.WELL_WHOSE_STORY_SHOULD_I_TELL_YOU_TODAY));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18133000, false));
break;
}
case "msg_text_lupia_1":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.HURRY_SIT_DOWN));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_2":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.WHOSE_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_3":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.YOU_HAVE_TO_BE_READY));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18132000, false));
break;
}
case "msg_text_mey_1":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.SHOULD_I_START_LET_S_SEE_IF_WE_RE_READY));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_2":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.I_LL_BE_STARTING_NOW_SO_TAKE_A_SEAT));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_3":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18131000, false));
break;
}
case "msg_text_lollia_1":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.ARE_YOU_READY_TO_HEAR_THE_STORY));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_2":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.I_LL_START_ONCE_EVERYONE_IS_SEATED));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_3":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.HEH_WHAT_SHOULD_I_TALK_ABOUT_NEXT_HMM));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18135000, false));
break;
}
case "msg_text_hanna_1":
{
_hanna.setHeading(26747);
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.WELL_WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_2":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.I_WONDER_WHAT_KIND_OF_STORIES_ARE_POPULAR_WITH_THE_CUSTOMERS));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_3":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.SIT_DOWN_FIRST_I_CAN_T_START_OTHERWISE));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18134000, false));
break;
}
case "return":
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, npc.getSpawn());
npc.setHeading(npc.getSpawn().getHeading());
break;
}
case "enter_instance":
{
// enter randomly // enter randomly
switch (availableInstances.get(getRandom(availableInstances.size()))) switch (availableInstances.get(getRandom(availableInstances.size())))
{ {
@ -130,10 +326,46 @@ public class MysticTavern extends AbstractNpcAI
// break; // break;
// } // }
} }
break;
}
} }
return null; return null;
} }
@Override
public String onSpawn(L2Npc npc)
{
switch (npc.getId())
{
case LOLLIA:
{
_lollia = npc;
break;
}
case HANNA:
{
_hanna = npc;
break;
}
case BRODIEN:
{
_brodien = npc;
break;
}
case LUPIA:
{
_lupia = npc;
break;
}
case MEY:
{
_mey = npc;
break;
}
}
return super.onSpawn(npc);
}
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {

View File

@ -1115,4 +1115,20 @@
<zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100"> <zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100">
<node X="225947" Y="-50420" /> <node X="225947" Y="-50420" />
</zone> </zone>
<!-- Mystic Tavarn Globe Zone -->
<zone name="Mystic_Tavern_Globe1" id="80019" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50055" Y="-148630" />
</zone>
<zone name="Mystic_Tavern_Globe2" id="80020" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50168" Y="-148440" />
</zone>
<zone name="Mystic_Tavern_Globe3" id="80021" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50148" Y="-148055" />
</zone>
<zone name="Mystic_Tavern_Globe4" id="80022" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49495" Y="-148020" />
</zone>
<zone name="Mystic_Tavern_Globe5" id="80023" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49355" Y="-148215" />
</zone>
</list> </list>

View File

@ -19,11 +19,20 @@ package instances.MysticTavern;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Party; import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.zone.type.L2ScriptZone;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
import instances.MysticTavern.StoryOfFreya.StoryOfFreya; import instances.MysticTavern.StoryOfFreya.StoryOfFreya;
@ -35,34 +44,54 @@ import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub;
* @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI * @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI
* @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4 * @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4
* @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE * @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE
* @author Mobius * @author Mobius, Gigi
*/ */
public class MysticTavern extends AbstractNpcAI public class MysticTavern extends AbstractNpcAI
{ {
// NPC // NPC
private static final int GLOBE = 34200; private static final int GLOBE = 34200;
// Employee
private static final int LOLLIA = 34182;
private static final int HANNA = 34183;
private static final int BRODIEN = 34184;
private static final int LUPIA = 34185;
private static final int MEY = 34186;
// Instances // Instances
// private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_TAUTI = 261;
// private static final int INSTANCE_KELBIM = 262; // private static final int INSTANCE_KELBIM = 262;
private static final int INSTANCE_FREYA = 263; private static final int INSTANCE_FREYA = 263;
// Zones
private static final L2ScriptZone GLOBE_1_ZONE = ZoneManager.getInstance().getZoneById(80019, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_2_ZONE = ZoneManager.getInstance().getZoneById(80020, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_3_ZONE = ZoneManager.getInstance().getZoneById(80021, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_4_ZONE = ZoneManager.getInstance().getZoneById(80022, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_5_ZONE = ZoneManager.getInstance().getZoneById(80023, L2ScriptZone.class);
// Misc // Misc
private static final int MINIMUM_PLAYER_LEVEL = 99; private static final int MINIMUM_PLAYER_LEVEL = 99;
private static final int MINIMUM_PARTY_MEMBERS = 5; private static final int MINIMUM_PARTY_MEMBERS = 5;
private static L2Npc _lollia;
private static L2Npc _hanna;
private static L2Npc _brodien;
private static L2Npc _lupia;
private static L2Npc _mey;
public MysticTavern() public MysticTavern()
{ {
addFirstTalkId(GLOBE); addFirstTalkId(GLOBE);
addSpawnId(LOLLIA, HANNA, BRODIEN, LUPIA, MEY);
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("tellStory"))
{ {
final List<Integer> availableInstances = new ArrayList<>(); final List<Integer> availableInstances = new ArrayList<>();
availableInstances.add(INSTANCE_FREYA); availableInstances.add(INSTANCE_FREYA);
// availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_TAUTI);
// availableInstances.add(INSTANCE_KELBIM); // availableInstances.add(INSTANCE_KELBIM);
switch (event)
{
case "tellStory":
{
if (!player.isGM()) if (!player.isGM())
{ {
final L2Party party = player.getParty(); final L2Party party = player.getParty();
@ -110,7 +139,174 @@ public class MysticTavern extends AbstractNpcAI
{ {
return "34200-not-available.html"; return "34200-not-available.html";
} }
startQuestTimer("npcRoute", 3000, npc, player);
} }
startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test
break;
}
case "npcRoute":
{
if (GLOBE_1_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18133000, true));
_brodien.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50000, -148560, -14152));
_brodien.setHeading(48440);
startQuestTimer("msg_text_brodien_1", 16000, _brodien, null);
startQuestTimer("msg_text_brodien_2", 23000, _brodien, null);
startQuestTimer("msg_text_brodien_3", 31000, _brodien, null);
}
else if (GLOBE_2_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18132000, true));
_lupia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50161, -148356, -14152));
_lupia.setHeading(45808);
startQuestTimer("msg_text_lupia_1", 12000, _lupia, null);
startQuestTimer("msg_text_lupia_2", 19000, _lupia, null);
startQuestTimer("msg_text_lupia_3", 27000, _lupia, null);
}
else if (GLOBE_3_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18131000, true));
_mey.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50092, -148096, -14152));
_mey.setHeading(34669);
startQuestTimer("msg_text_mey_1", 8000, _mey, null);
startQuestTimer("msg_text_mey_2", 15000, _mey, null);
startQuestTimer("msg_text_mey_3", 23000, _mey, null);
}
else if (GLOBE_4_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18135000, true));
_lollia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49480, -148074, -14152));
_lollia.setHeading(13255);
startQuestTimer("msg_text_lollia_1", 10000, _lollia, null);
startQuestTimer("msg_text_lollia_2", 17000, _lollia, null);
startQuestTimer("msg_text_lollia_3", 25000, _lollia, null);
}
else if (GLOBE_5_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18134000, true));
_hanna.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49283, -148179, -14152));
_hanna.setHeading(26747);
startQuestTimer("msg_text_hanna_1", 12000, _hanna, null);
startQuestTimer("msg_text_hanna_2", 19000, _hanna, null);
startQuestTimer("msg_text_hanna_3", 27000, _hanna, null);
}
break;
}
case "msg_text_brodien_1":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.I_HAVE_MANY_STORIES_TO_TELL));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_2":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.PLEASE_SIT_DOWN_SO_THAT_I_CAN_START));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_3":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.WELL_WHOSE_STORY_SHOULD_I_TELL_YOU_TODAY));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18133000, false));
break;
}
case "msg_text_lupia_1":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.HURRY_SIT_DOWN));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_2":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.WHOSE_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_3":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.YOU_HAVE_TO_BE_READY));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18132000, false));
break;
}
case "msg_text_mey_1":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.SHOULD_I_START_LET_S_SEE_IF_WE_RE_READY));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_2":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.I_LL_BE_STARTING_NOW_SO_TAKE_A_SEAT));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_3":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18131000, false));
break;
}
case "msg_text_lollia_1":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.ARE_YOU_READY_TO_HEAR_THE_STORY));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_2":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.I_LL_START_ONCE_EVERYONE_IS_SEATED));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_3":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.HEH_WHAT_SHOULD_I_TALK_ABOUT_NEXT_HMM));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18135000, false));
break;
}
case "msg_text_hanna_1":
{
_hanna.setHeading(26747);
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.WELL_WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_2":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.I_WONDER_WHAT_KIND_OF_STORIES_ARE_POPULAR_WITH_THE_CUSTOMERS));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_3":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.SIT_DOWN_FIRST_I_CAN_T_START_OTHERWISE));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18134000, false));
break;
}
case "return":
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, npc.getSpawn());
npc.setHeading(npc.getSpawn().getHeading());
break;
}
case "enter_instance":
{
// enter randomly // enter randomly
switch (availableInstances.get(getRandom(availableInstances.size()))) switch (availableInstances.get(getRandom(availableInstances.size())))
{ {
@ -130,10 +326,46 @@ public class MysticTavern extends AbstractNpcAI
// break; // break;
// } // }
} }
break;
}
} }
return null; return null;
} }
@Override
public String onSpawn(L2Npc npc)
{
switch (npc.getId())
{
case LOLLIA:
{
_lollia = npc;
break;
}
case HANNA:
{
_hanna = npc;
break;
}
case BRODIEN:
{
_brodien = npc;
break;
}
case LUPIA:
{
_lupia = npc;
break;
}
case MEY:
{
_mey = npc;
break;
}
}
return super.onSpawn(npc);
}
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {

View File

@ -1115,4 +1115,20 @@
<zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100"> <zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100">
<node X="225947" Y="-50420" /> <node X="225947" Y="-50420" />
</zone> </zone>
<!-- Mystic Tavarn Globe Zone -->
<zone name="Mystic_Tavern_Globe1" id="80019" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50055" Y="-148630" />
</zone>
<zone name="Mystic_Tavern_Globe2" id="80020" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50168" Y="-148440" />
</zone>
<zone name="Mystic_Tavern_Globe3" id="80021" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50148" Y="-148055" />
</zone>
<zone name="Mystic_Tavern_Globe4" id="80022" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49495" Y="-148020" />
</zone>
<zone name="Mystic_Tavern_Globe5" id="80023" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49355" Y="-148215" />
</zone>
</list> </list>

View File

@ -19,11 +19,20 @@ package instances.MysticTavern;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Party; import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.zone.type.L2ScriptZone;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
import instances.MysticTavern.StoryOfFreya.StoryOfFreya; import instances.MysticTavern.StoryOfFreya.StoryOfFreya;
@ -35,34 +44,54 @@ import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub;
* @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI * @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI
* @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4 * @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4
* @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE * @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE
* @author Mobius * @author Mobius, Gigi
*/ */
public class MysticTavern extends AbstractNpcAI public class MysticTavern extends AbstractNpcAI
{ {
// NPC // NPC
private static final int GLOBE = 34200; private static final int GLOBE = 34200;
// Employee
private static final int LOLLIA = 34182;
private static final int HANNA = 34183;
private static final int BRODIEN = 34184;
private static final int LUPIA = 34185;
private static final int MEY = 34186;
// Instances // Instances
// private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_TAUTI = 261;
// private static final int INSTANCE_KELBIM = 262; // private static final int INSTANCE_KELBIM = 262;
private static final int INSTANCE_FREYA = 263; private static final int INSTANCE_FREYA = 263;
// Zones
private static final L2ScriptZone GLOBE_1_ZONE = ZoneManager.getInstance().getZoneById(80019, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_2_ZONE = ZoneManager.getInstance().getZoneById(80020, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_3_ZONE = ZoneManager.getInstance().getZoneById(80021, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_4_ZONE = ZoneManager.getInstance().getZoneById(80022, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_5_ZONE = ZoneManager.getInstance().getZoneById(80023, L2ScriptZone.class);
// Misc // Misc
private static final int MINIMUM_PLAYER_LEVEL = 99; private static final int MINIMUM_PLAYER_LEVEL = 99;
private static final int MINIMUM_PARTY_MEMBERS = 5; private static final int MINIMUM_PARTY_MEMBERS = 5;
private static L2Npc _lollia;
private static L2Npc _hanna;
private static L2Npc _brodien;
private static L2Npc _lupia;
private static L2Npc _mey;
public MysticTavern() public MysticTavern()
{ {
addFirstTalkId(GLOBE); addFirstTalkId(GLOBE);
addSpawnId(LOLLIA, HANNA, BRODIEN, LUPIA, MEY);
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("tellStory"))
{ {
final List<Integer> availableInstances = new ArrayList<>(); final List<Integer> availableInstances = new ArrayList<>();
availableInstances.add(INSTANCE_FREYA); availableInstances.add(INSTANCE_FREYA);
// availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_TAUTI);
// availableInstances.add(INSTANCE_KELBIM); // availableInstances.add(INSTANCE_KELBIM);
switch (event)
{
case "tellStory":
{
if (!player.isGM()) if (!player.isGM())
{ {
final L2Party party = player.getParty(); final L2Party party = player.getParty();
@ -110,7 +139,174 @@ public class MysticTavern extends AbstractNpcAI
{ {
return "34200-not-available.html"; return "34200-not-available.html";
} }
startQuestTimer("npcRoute", 3000, npc, player);
} }
startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test
break;
}
case "npcRoute":
{
if (GLOBE_1_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18133000, true));
_brodien.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50000, -148560, -14152));
_brodien.setHeading(48440);
startQuestTimer("msg_text_brodien_1", 16000, _brodien, null);
startQuestTimer("msg_text_brodien_2", 23000, _brodien, null);
startQuestTimer("msg_text_brodien_3", 31000, _brodien, null);
}
else if (GLOBE_2_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18132000, true));
_lupia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50161, -148356, -14152));
_lupia.setHeading(45808);
startQuestTimer("msg_text_lupia_1", 12000, _lupia, null);
startQuestTimer("msg_text_lupia_2", 19000, _lupia, null);
startQuestTimer("msg_text_lupia_3", 27000, _lupia, null);
}
else if (GLOBE_3_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18131000, true));
_mey.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50092, -148096, -14152));
_mey.setHeading(34669);
startQuestTimer("msg_text_mey_1", 8000, _mey, null);
startQuestTimer("msg_text_mey_2", 15000, _mey, null);
startQuestTimer("msg_text_mey_3", 23000, _mey, null);
}
else if (GLOBE_4_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18135000, true));
_lollia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49480, -148074, -14152));
_lollia.setHeading(13255);
startQuestTimer("msg_text_lollia_1", 10000, _lollia, null);
startQuestTimer("msg_text_lollia_2", 17000, _lollia, null);
startQuestTimer("msg_text_lollia_3", 25000, _lollia, null);
}
else if (GLOBE_5_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18134000, true));
_hanna.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49283, -148179, -14152));
_hanna.setHeading(26747);
startQuestTimer("msg_text_hanna_1", 12000, _hanna, null);
startQuestTimer("msg_text_hanna_2", 19000, _hanna, null);
startQuestTimer("msg_text_hanna_3", 27000, _hanna, null);
}
break;
}
case "msg_text_brodien_1":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.I_HAVE_MANY_STORIES_TO_TELL));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_2":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.PLEASE_SIT_DOWN_SO_THAT_I_CAN_START));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_3":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.WELL_WHOSE_STORY_SHOULD_I_TELL_YOU_TODAY));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18133000, false));
break;
}
case "msg_text_lupia_1":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.HURRY_SIT_DOWN));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_2":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.WHOSE_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_3":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.YOU_HAVE_TO_BE_READY));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18132000, false));
break;
}
case "msg_text_mey_1":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.SHOULD_I_START_LET_S_SEE_IF_WE_RE_READY));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_2":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.I_LL_BE_STARTING_NOW_SO_TAKE_A_SEAT));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_3":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18131000, false));
break;
}
case "msg_text_lollia_1":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.ARE_YOU_READY_TO_HEAR_THE_STORY));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_2":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.I_LL_START_ONCE_EVERYONE_IS_SEATED));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_3":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.HEH_WHAT_SHOULD_I_TALK_ABOUT_NEXT_HMM));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18135000, false));
break;
}
case "msg_text_hanna_1":
{
_hanna.setHeading(26747);
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.WELL_WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_2":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.I_WONDER_WHAT_KIND_OF_STORIES_ARE_POPULAR_WITH_THE_CUSTOMERS));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_3":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.SIT_DOWN_FIRST_I_CAN_T_START_OTHERWISE));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18134000, false));
break;
}
case "return":
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, npc.getSpawn());
npc.setHeading(npc.getSpawn().getHeading());
break;
}
case "enter_instance":
{
// enter randomly // enter randomly
switch (availableInstances.get(getRandom(availableInstances.size()))) switch (availableInstances.get(getRandom(availableInstances.size())))
{ {
@ -130,10 +326,46 @@ public class MysticTavern extends AbstractNpcAI
// break; // break;
// } // }
} }
break;
}
} }
return null; return null;
} }
@Override
public String onSpawn(L2Npc npc)
{
switch (npc.getId())
{
case LOLLIA:
{
_lollia = npc;
break;
}
case HANNA:
{
_hanna = npc;
break;
}
case BRODIEN:
{
_brodien = npc;
break;
}
case LUPIA:
{
_lupia = npc;
break;
}
case MEY:
{
_mey = npc;
break;
}
}
return super.onSpawn(npc);
}
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {

View File

@ -1115,4 +1115,20 @@
<zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100"> <zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100">
<node X="225947" Y="-50420" /> <node X="225947" Y="-50420" />
</zone> </zone>
<!-- Mystic Tavarn Globe Zone -->
<zone name="Mystic_Tavern_Globe1" id="80019" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50055" Y="-148630" />
</zone>
<zone name="Mystic_Tavern_Globe2" id="80020" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50168" Y="-148440" />
</zone>
<zone name="Mystic_Tavern_Globe3" id="80021" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50148" Y="-148055" />
</zone>
<zone name="Mystic_Tavern_Globe4" id="80022" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49495" Y="-148020" />
</zone>
<zone name="Mystic_Tavern_Globe5" id="80023" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49355" Y="-148215" />
</zone>
</list> </list>

View File

@ -19,11 +19,20 @@ package instances.MysticTavern;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.l2jmobius.gameserver.ai.CtrlIntention;
import com.l2jmobius.gameserver.enums.ChatType;
import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.instancemanager.InstanceManager;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.L2Party; import com.l2jmobius.gameserver.model.L2Party;
import com.l2jmobius.gameserver.model.Location;
import com.l2jmobius.gameserver.model.actor.L2Npc; import com.l2jmobius.gameserver.model.actor.L2Npc;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.quest.QuestState; import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.zone.type.L2ScriptZone;
import com.l2jmobius.gameserver.network.NpcStringId;
import com.l2jmobius.gameserver.network.serverpackets.NpcSay;
import com.l2jmobius.gameserver.network.serverpackets.OnEventTrigger;
import com.l2jmobius.gameserver.network.serverpackets.PlaySound;
import ai.AbstractNpcAI; import ai.AbstractNpcAI;
import instances.MysticTavern.StoryOfFreya.StoryOfFreya; import instances.MysticTavern.StoryOfFreya.StoryOfFreya;
@ -35,34 +44,54 @@ import quests.Q10297_GrandOpeningComeToOurPub.Q10297_GrandOpeningComeToOurPub;
* @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI * @VIDEO FREYA: https://www.youtube.com/watch?v=-pUB6ghrsLI
* @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4 * @VIDEO TAUTI: https://www.youtube.com/watch?v=_Wz-kxXzJK4
* @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE * @VIDEO KELBIM: https://www.youtube.com/watch?v=wL1D49u6vxE
* @author Mobius * @author Mobius, Gigi
*/ */
public class MysticTavern extends AbstractNpcAI public class MysticTavern extends AbstractNpcAI
{ {
// NPC // NPC
private static final int GLOBE = 34200; private static final int GLOBE = 34200;
// Employee
private static final int LOLLIA = 34182;
private static final int HANNA = 34183;
private static final int BRODIEN = 34184;
private static final int LUPIA = 34185;
private static final int MEY = 34186;
// Instances // Instances
// private static final int INSTANCE_TAUTI = 261; // private static final int INSTANCE_TAUTI = 261;
// private static final int INSTANCE_KELBIM = 262; // private static final int INSTANCE_KELBIM = 262;
private static final int INSTANCE_FREYA = 263; private static final int INSTANCE_FREYA = 263;
// Zones
private static final L2ScriptZone GLOBE_1_ZONE = ZoneManager.getInstance().getZoneById(80019, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_2_ZONE = ZoneManager.getInstance().getZoneById(80020, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_3_ZONE = ZoneManager.getInstance().getZoneById(80021, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_4_ZONE = ZoneManager.getInstance().getZoneById(80022, L2ScriptZone.class);
private static final L2ScriptZone GLOBE_5_ZONE = ZoneManager.getInstance().getZoneById(80023, L2ScriptZone.class);
// Misc // Misc
private static final int MINIMUM_PLAYER_LEVEL = 99; private static final int MINIMUM_PLAYER_LEVEL = 99;
private static final int MINIMUM_PARTY_MEMBERS = 5; private static final int MINIMUM_PARTY_MEMBERS = 5;
private static L2Npc _lollia;
private static L2Npc _hanna;
private static L2Npc _brodien;
private static L2Npc _lupia;
private static L2Npc _mey;
public MysticTavern() public MysticTavern()
{ {
addFirstTalkId(GLOBE); addFirstTalkId(GLOBE);
addSpawnId(LOLLIA, HANNA, BRODIEN, LUPIA, MEY);
} }
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("tellStory"))
{ {
final List<Integer> availableInstances = new ArrayList<>(); final List<Integer> availableInstances = new ArrayList<>();
availableInstances.add(INSTANCE_FREYA); availableInstances.add(INSTANCE_FREYA);
// availableInstances.add(INSTANCE_TAUTI); // availableInstances.add(INSTANCE_TAUTI);
// availableInstances.add(INSTANCE_KELBIM); // availableInstances.add(INSTANCE_KELBIM);
switch (event)
{
case "tellStory":
{
if (!player.isGM()) if (!player.isGM())
{ {
final L2Party party = player.getParty(); final L2Party party = player.getParty();
@ -110,7 +139,174 @@ public class MysticTavern extends AbstractNpcAI
{ {
return "34200-not-available.html"; return "34200-not-available.html";
} }
startQuestTimer("npcRoute", 3000, npc, player);
} }
startQuestTimer("npcRoute", 3000, npc, player); // TODO only for test
break;
}
case "npcRoute":
{
if (GLOBE_1_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18133000, true));
_brodien.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50000, -148560, -14152));
_brodien.setHeading(48440);
startQuestTimer("msg_text_brodien_1", 16000, _brodien, null);
startQuestTimer("msg_text_brodien_2", 23000, _brodien, null);
startQuestTimer("msg_text_brodien_3", 31000, _brodien, null);
}
else if (GLOBE_2_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18132000, true));
_lupia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50161, -148356, -14152));
_lupia.setHeading(45808);
startQuestTimer("msg_text_lupia_1", 12000, _lupia, null);
startQuestTimer("msg_text_lupia_2", 19000, _lupia, null);
startQuestTimer("msg_text_lupia_3", 27000, _lupia, null);
}
else if (GLOBE_3_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18131000, true));
_mey.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-50092, -148096, -14152));
_mey.setHeading(34669);
startQuestTimer("msg_text_mey_1", 8000, _mey, null);
startQuestTimer("msg_text_mey_2", 15000, _mey, null);
startQuestTimer("msg_text_mey_3", 23000, _mey, null);
}
else if (GLOBE_4_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18135000, true));
_lollia.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49480, -148074, -14152));
_lollia.setHeading(13255);
startQuestTimer("msg_text_lollia_1", 10000, _lollia, null);
startQuestTimer("msg_text_lollia_2", 17000, _lollia, null);
startQuestTimer("msg_text_lollia_3", 25000, _lollia, null);
}
else if (GLOBE_5_ZONE.isInsideZone(npc))
{
npc.broadcastPacket(new OnEventTrigger(18134000, true));
_hanna.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, new Location(-49283, -148179, -14152));
_hanna.setHeading(26747);
startQuestTimer("msg_text_hanna_1", 12000, _hanna, null);
startQuestTimer("msg_text_hanna_2", 19000, _hanna, null);
startQuestTimer("msg_text_hanna_3", 27000, _hanna, null);
}
break;
}
case "msg_text_brodien_1":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.I_HAVE_MANY_STORIES_TO_TELL));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_2":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.PLEASE_SIT_DOWN_SO_THAT_I_CAN_START));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_brodien_3":
{
_brodien.broadcastPacket(new NpcSay(_brodien.getObjectId(), ChatType.NPC_GENERAL, _brodien.getId(), NpcStringId.WELL_WHOSE_STORY_SHOULD_I_TELL_YOU_TODAY));
GLOBE_1_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.brodien_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18133000, false));
break;
}
case "msg_text_lupia_1":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.HURRY_SIT_DOWN));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_2":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.WHOSE_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lupia_3":
{
_lupia.broadcastPacket(new NpcSay(_lupia.getObjectId(), ChatType.NPC_GENERAL, _lupia.getId(), NpcStringId.YOU_HAVE_TO_BE_READY));
GLOBE_2_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.rupia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18132000, false));
break;
}
case "msg_text_mey_1":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.SHOULD_I_START_LET_S_SEE_IF_WE_RE_READY));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_2":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.I_LL_BE_STARTING_NOW_SO_TAKE_A_SEAT));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_mey_3":
{
_mey.broadcastPacket(new NpcSay(_mey.getObjectId(), ChatType.NPC_GENERAL, _mey.getId(), NpcStringId.WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_3_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.mae_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18131000, false));
break;
}
case "msg_text_lollia_1":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.ARE_YOU_READY_TO_HEAR_THE_STORY));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_2":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.I_LL_START_ONCE_EVERYONE_IS_SEATED));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_lollia_3":
{
_lollia.broadcastPacket(new NpcSay(_lollia.getObjectId(), ChatType.NPC_GENERAL, _lollia.getId(), NpcStringId.HEH_WHAT_SHOULD_I_TALK_ABOUT_NEXT_HMM));
GLOBE_4_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.lollia_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18135000, false));
break;
}
case "msg_text_hanna_1":
{
_hanna.setHeading(26747);
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.WELL_WHICH_STORY_DO_YOU_WANT_TO_HEAR));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_1", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_2":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.I_WONDER_WHAT_KIND_OF_STORIES_ARE_POPULAR_WITH_THE_CUSTOMERS));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_2", 0, 0, 0, 0, 0));
break;
}
case "msg_text_hanna_3":
{
_hanna.broadcastPacket(new NpcSay(_hanna.getObjectId(), ChatType.NPC_GENERAL, _hanna.getId(), NpcStringId.SIT_DOWN_FIRST_I_CAN_T_START_OTHERWISE));
GLOBE_5_ZONE.broadcastPacket(new PlaySound(3, "Npcdialog1.hanna_inzone_3", 0, 0, 0, 0, 0));
startQuestTimer("enter_instance", 3000, npc, player);
startQuestTimer("return", 6000, npc, null);
npc.broadcastPacket(new OnEventTrigger(18134000, false));
break;
}
case "return":
{
npc.getAI().setIntention(CtrlIntention.AI_INTENTION_MOVE_TO, npc.getSpawn());
npc.setHeading(npc.getSpawn().getHeading());
break;
}
case "enter_instance":
{
// enter randomly // enter randomly
switch (availableInstances.get(getRandom(availableInstances.size()))) switch (availableInstances.get(getRandom(availableInstances.size())))
{ {
@ -130,10 +326,46 @@ public class MysticTavern extends AbstractNpcAI
// break; // break;
// } // }
} }
break;
}
} }
return null; return null;
} }
@Override
public String onSpawn(L2Npc npc)
{
switch (npc.getId())
{
case LOLLIA:
{
_lollia = npc;
break;
}
case HANNA:
{
_hanna = npc;
break;
}
case BRODIEN:
{
_brodien = npc;
break;
}
case LUPIA:
{
_lupia = npc;
break;
}
case MEY:
{
_mey = npc;
break;
}
}
return super.onSpawn(npc);
}
@Override @Override
public String onFirstTalk(L2Npc npc, L2PcInstance player) public String onFirstTalk(L2Npc npc, L2PcInstance player)
{ {

View File

@ -1115,4 +1115,20 @@
<zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100"> <zone name="Mystic_Tavern_Freya_Zone6" id="80018" type="ScriptZone" shape="Cylinder" minZ="-2650" maxZ="-2500" rad="1100">
<node X="225947" Y="-50420" /> <node X="225947" Y="-50420" />
</zone> </zone>
<!-- Mystic Tavarn Globe Zone -->
<zone name="Mystic_Tavern_Globe1" id="80019" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50055" Y="-148630" />
</zone>
<zone name="Mystic_Tavern_Globe2" id="80020" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50168" Y="-148440" />
</zone>
<zone name="Mystic_Tavern_Globe3" id="80021" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-50148" Y="-148055" />
</zone>
<zone name="Mystic_Tavern_Globe4" id="80022" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49495" Y="-148020" />
</zone>
<zone name="Mystic_Tavern_Globe5" id="80023" type="ScriptZone" shape="Cylinder" minZ="-14250" maxZ="-14100" rad="110">
<node X="-49355" Y="-148215" />
</zone>
</list> </list>