From cca8612de5a07f698f811a15a994fff594dd509d Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sat, 30 Mar 2019 16:29:29 +0000 Subject: [PATCH] Lailly AI improvements. Contributed by gigilo1968. --- .../GainakUnderground/Lailly/34181-1.html} | 2 +- .../areas/GainakUnderground/Lailly/34181.html | 2 +- .../GainakUnderground/Lailly}/Lailly.java | 53 ++++++++- .../GainakUnderground/Lailly/34181-1.html | 2 +- .../areas/GainakUnderground/Lailly/34181.html | 2 +- .../GainakUnderground/Lailly}/Lailly.java | 53 ++++++++- .../GainakUnderground/Lailly/34181-1.html | 2 +- .../areas/GainakUnderground/Lailly/34181.html | 2 +- .../GainakUnderground/Lailly}/Lailly.java | 53 ++++++++- .../GainakUnderground/Lailly/34181-1.html | 2 +- .../GainakUnderground/Lailly/34181.html} | 2 +- .../{ => Lailly}/Lailly.java | 53 ++++++++- .../dist/game/data/html/default/34181-1.htm | 5 - .../dist/game/data/html/default/34181.htm | 7 -- .../ai/areas/GainakUnderground/Lailly.java | 62 ----------- .../GainakUnderground/Lailly/34181-1.html | 5 + .../areas/GainakUnderground/Lailly/34181.html | 7 ++ .../GainakUnderground/Lailly/Lailly.java | 105 ++++++++++++++++++ .../dist/game/data/html/default/34181-1.htm | 5 - .../dist/game/data/html/default/34181.htm | 7 -- .../ai/areas/GainakUnderground/Lailly.java | 62 ----------- .../GainakUnderground/Lailly/34181-1.html | 5 + .../areas/GainakUnderground/Lailly/34181.html | 7 ++ .../GainakUnderground/Lailly/Lailly.java | 105 ++++++++++++++++++ 24 files changed, 434 insertions(+), 176 deletions(-) rename L2J_Mobius_2.5_Underground/dist/game/data/{html/default/34181-1.htm => scripts/ai/areas/GainakUnderground/Lailly/34181-1.html} (69%) rename L2J_Mobius_4.0_GrandCrusade/dist/game/data/html/default/34181.htm => L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html (80%) rename {L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground => L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly}/Lailly.java (50%) rename L2J_Mobius_4.0_GrandCrusade/dist/game/data/html/default/34181-1.htm => L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html (69%) rename L2J_Mobius_2.5_Underground/dist/game/data/html/default/34181.htm => L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html (80%) rename {L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground => L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly}/Lailly.java (50%) rename L2J_Mobius_5.0_Salvation/dist/game/data/html/default/34181-1.htm => L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html (69%) rename L2J_Mobius_3.0_Helios/dist/game/data/html/default/34181.htm => L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html (80%) rename {L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground => L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly}/Lailly.java (50%) rename L2J_Mobius_3.0_Helios/dist/game/data/html/default/34181-1.htm => L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html (69%) rename L2J_Mobius_5.0_Salvation/dist/game/data/{html/default/34181.htm => scripts/ai/areas/GainakUnderground/Lailly/34181.html} (80%) rename L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/{ => Lailly}/Lailly.java (50%) delete mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/html/default/34181-1.htm delete mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/html/default/34181.htm delete mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html create mode 100644 L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java delete mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/html/default/34181-1.htm delete mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/html/default/34181.htm delete mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html create mode 100644 L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/34181-1.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html similarity index 69% rename from L2J_Mobius_2.5_Underground/dist/game/data/html/default/34181-1.htm rename to L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html index 4623a9c3b2..9e37587271 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/34181-1.htm +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html @@ -1,5 +1,5 @@ Madame Lailly:
Hmm? You weren't listening to a story? Or have you listened to all of them?
I understand that you want to listen to more great stories, but patience is a virtue!
- + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/html/default/34181.htm b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html similarity index 80% rename from L2J_Mobius_4.0_GrandCrusade/dist/game/data/html/default/34181.htm rename to L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html index 6a8f4be806..fd07c0d1c6 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/html/default/34181.htm +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html @@ -2,6 +2,6 @@ Welcome. Thank you for coming all the way here.
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!
- + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java similarity index 50% rename from L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java rename to L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java index e9c3bd21fa..c7416f041e 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java +++ b/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java @@ -14,11 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package ai.areas.GainakUnderground; +package ai.areas.GainakUnderground.Lailly; import com.l2jmobius.gameserver.enums.ChatType; +import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.model.actor.Npc; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.instancezone.Instance; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.serverpackets.NpcSay; @@ -32,29 +34,70 @@ public final class Lailly extends AbstractNpcAI { // NPCs private static final int LAILLY = 34181; + // Instances + private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_KELBIM = 262; + private static final int INSTANCE_FREYA = 263; private Lailly() { addSpawnId(LAILLY); + addFirstTalkId(LAILLY); } @Override public String onAdvEvent(String event, Npc npc, PlayerInstance player) { - if (event.equals("SPAM_TEXT") && (npc != null)) + String htmltext = null; + switch (event) { - npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + case "34181.html": + { + htmltext = event; + break; + } + case "spam_text": + { + npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + break; + } + case "okay": + { + final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false); + if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis())) + { + switch (instance.getTemplateId()) + { + case INSTANCE_TAUTI: + case INSTANCE_KELBIM: + case INSTANCE_FREYA: + { + player.teleToLocation(instance.getEnterLocation(), instance); + break; + } + } + break; + } + htmltext = "34181-1.html"; + break; + } } - return super.onAdvEvent(event, npc, player); + return htmltext; } @Override public String onSpawn(Npc npc) { - startQuestTimer("SPAM_TEXT", 180000, npc, null, true); + startQuestTimer("spam_text", 180000, npc, null, true); return super.onSpawn(npc); } + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "34181.html"; + } + public static void main(String[] args) { new Lailly(); diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/html/default/34181-1.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html similarity index 69% rename from L2J_Mobius_4.0_GrandCrusade/dist/game/data/html/default/34181-1.htm rename to L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html index 4623a9c3b2..9e37587271 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/html/default/34181-1.htm +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html @@ -1,5 +1,5 @@ Madame Lailly:
Hmm? You weren't listening to a story? Or have you listened to all of them?
I understand that you want to listen to more great stories, but patience is a virtue!
- + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/34181.htm b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html similarity index 80% rename from L2J_Mobius_2.5_Underground/dist/game/data/html/default/34181.htm rename to L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html index 6a8f4be806..fd07c0d1c6 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/html/default/34181.htm +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html @@ -2,6 +2,6 @@ Welcome. Thank you for coming all the way here.
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!
- + \ No newline at end of file diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java similarity index 50% rename from L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java rename to L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java index e9c3bd21fa..c7416f041e 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java +++ b/L2J_Mobius_3.0_Helios/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java @@ -14,11 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package ai.areas.GainakUnderground; +package ai.areas.GainakUnderground.Lailly; import com.l2jmobius.gameserver.enums.ChatType; +import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.model.actor.Npc; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.instancezone.Instance; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.serverpackets.NpcSay; @@ -32,29 +34,70 @@ public final class Lailly extends AbstractNpcAI { // NPCs private static final int LAILLY = 34181; + // Instances + private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_KELBIM = 262; + private static final int INSTANCE_FREYA = 263; private Lailly() { addSpawnId(LAILLY); + addFirstTalkId(LAILLY); } @Override public String onAdvEvent(String event, Npc npc, PlayerInstance player) { - if (event.equals("SPAM_TEXT") && (npc != null)) + String htmltext = null; + switch (event) { - npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + case "34181.html": + { + htmltext = event; + break; + } + case "spam_text": + { + npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + break; + } + case "okay": + { + final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false); + if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis())) + { + switch (instance.getTemplateId()) + { + case INSTANCE_TAUTI: + case INSTANCE_KELBIM: + case INSTANCE_FREYA: + { + player.teleToLocation(instance.getEnterLocation(), instance); + break; + } + } + break; + } + htmltext = "34181-1.html"; + break; + } } - return super.onAdvEvent(event, npc, player); + return htmltext; } @Override public String onSpawn(Npc npc) { - startQuestTimer("SPAM_TEXT", 180000, npc, null, true); + startQuestTimer("spam_text", 180000, npc, null, true); return super.onSpawn(npc); } + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "34181.html"; + } + public static void main(String[] args) { new Lailly(); diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/html/default/34181-1.htm b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html similarity index 69% rename from L2J_Mobius_5.0_Salvation/dist/game/data/html/default/34181-1.htm rename to L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html index 4623a9c3b2..9e37587271 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/html/default/34181-1.htm +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html @@ -1,5 +1,5 @@ Madame Lailly:
Hmm? You weren't listening to a story? Or have you listened to all of them?
I understand that you want to listen to more great stories, but patience is a virtue!
- + \ No newline at end of file diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/34181.htm b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html similarity index 80% rename from L2J_Mobius_3.0_Helios/dist/game/data/html/default/34181.htm rename to L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html index 6a8f4be806..fd07c0d1c6 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/34181.htm +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html @@ -2,6 +2,6 @@ Welcome. Thank you for coming all the way here.
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!
- + \ No newline at end of file diff --git a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java similarity index 50% rename from L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java rename to L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java index e9c3bd21fa..c7416f041e 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java @@ -14,11 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package ai.areas.GainakUnderground; +package ai.areas.GainakUnderground.Lailly; import com.l2jmobius.gameserver.enums.ChatType; +import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.model.actor.Npc; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.instancezone.Instance; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.serverpackets.NpcSay; @@ -32,29 +34,70 @@ public final class Lailly extends AbstractNpcAI { // NPCs private static final int LAILLY = 34181; + // Instances + private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_KELBIM = 262; + private static final int INSTANCE_FREYA = 263; private Lailly() { addSpawnId(LAILLY); + addFirstTalkId(LAILLY); } @Override public String onAdvEvent(String event, Npc npc, PlayerInstance player) { - if (event.equals("SPAM_TEXT") && (npc != null)) + String htmltext = null; + switch (event) { - npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + case "34181.html": + { + htmltext = event; + break; + } + case "spam_text": + { + npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + break; + } + case "okay": + { + final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false); + if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis())) + { + switch (instance.getTemplateId()) + { + case INSTANCE_TAUTI: + case INSTANCE_KELBIM: + case INSTANCE_FREYA: + { + player.teleToLocation(instance.getEnterLocation(), instance); + break; + } + } + break; + } + htmltext = "34181-1.html"; + break; + } } - return super.onAdvEvent(event, npc, player); + return htmltext; } @Override public String onSpawn(Npc npc) { - startQuestTimer("SPAM_TEXT", 180000, npc, null, true); + startQuestTimer("spam_text", 180000, npc, null, true); return super.onSpawn(npc); } + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "34181.html"; + } + public static void main(String[] args) { new Lailly(); diff --git a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/34181-1.htm b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html similarity index 69% rename from L2J_Mobius_3.0_Helios/dist/game/data/html/default/34181-1.htm rename to L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html index 4623a9c3b2..9e37587271 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/data/html/default/34181-1.htm +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html @@ -1,5 +1,5 @@ Madame Lailly:
Hmm? You weren't listening to a story? Or have you listened to all of them?
I understand that you want to listen to more great stories, but patience is a virtue!
- + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/html/default/34181.htm b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html similarity index 80% rename from L2J_Mobius_5.0_Salvation/dist/game/data/html/default/34181.htm rename to L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html index 6a8f4be806..fd07c0d1c6 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/html/default/34181.htm +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html @@ -2,6 +2,6 @@ Welcome. Thank you for coming all the way here.
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!
- + \ No newline at end of file diff --git a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java similarity index 50% rename from L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java rename to L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java index e9c3bd21fa..c7416f041e 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java +++ b/L2J_Mobius_5.0_Salvation/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java @@ -14,11 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -package ai.areas.GainakUnderground; +package ai.areas.GainakUnderground.Lailly; import com.l2jmobius.gameserver.enums.ChatType; +import com.l2jmobius.gameserver.instancemanager.InstanceManager; import com.l2jmobius.gameserver.model.actor.Npc; import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.instancezone.Instance; import com.l2jmobius.gameserver.network.NpcStringId; import com.l2jmobius.gameserver.network.serverpackets.NpcSay; @@ -32,29 +34,70 @@ public final class Lailly extends AbstractNpcAI { // NPCs private static final int LAILLY = 34181; + // Instances + private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_KELBIM = 262; + private static final int INSTANCE_FREYA = 263; private Lailly() { addSpawnId(LAILLY); + addFirstTalkId(LAILLY); } @Override public String onAdvEvent(String event, Npc npc, PlayerInstance player) { - if (event.equals("SPAM_TEXT") && (npc != null)) + String htmltext = null; + switch (event) { - npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + case "34181.html": + { + htmltext = event; + break; + } + case "spam_text": + { + npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + break; + } + case "okay": + { + final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false); + if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis())) + { + switch (instance.getTemplateId()) + { + case INSTANCE_TAUTI: + case INSTANCE_KELBIM: + case INSTANCE_FREYA: + { + player.teleToLocation(instance.getEnterLocation(), instance); + break; + } + } + break; + } + htmltext = "34181-1.html"; + break; + } } - return super.onAdvEvent(event, npc, player); + return htmltext; } @Override public String onSpawn(Npc npc) { - startQuestTimer("SPAM_TEXT", 180000, npc, null, true); + startQuestTimer("spam_text", 180000, npc, null, true); return super.onSpawn(npc); } + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "34181.html"; + } + public static void main(String[] args) { new Lailly(); diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/html/default/34181-1.htm b/L2J_Mobius_5.5_EtinasFate/dist/game/data/html/default/34181-1.htm deleted file mode 100644 index 4623a9c3b2..0000000000 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/html/default/34181-1.htm +++ /dev/null @@ -1,5 +0,0 @@ -Madame Lailly:
-Hmm? You weren't listening to a story? Or have you listened to all of them?
-I understand that you want to listen to more great stories, but patience is a virtue!
- - \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/html/default/34181.htm b/L2J_Mobius_5.5_EtinasFate/dist/game/data/html/default/34181.htm deleted file mode 100644 index 6a8f4be806..0000000000 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/html/default/34181.htm +++ /dev/null @@ -1,7 +0,0 @@ -Madame Lailly:
-Welcome. Thank you for coming all the way here.
-I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?
-His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!
- - - \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java deleted file mode 100644 index e9c3bd21fa..0000000000 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package ai.areas.GainakUnderground; - -import com.l2jmobius.gameserver.enums.ChatType; -import com.l2jmobius.gameserver.model.actor.Npc; -import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; -import com.l2jmobius.gameserver.network.NpcStringId; -import com.l2jmobius.gameserver.network.serverpackets.NpcSay; - -import ai.AbstractNpcAI; - -/** - * Lailly AI. - * @author Stayway - */ -public final class Lailly extends AbstractNpcAI -{ - // NPCs - private static final int LAILLY = 34181; - - private Lailly() - { - addSpawnId(LAILLY); - } - - @Override - public String onAdvEvent(String event, Npc npc, PlayerInstance player) - { - if (event.equals("SPAM_TEXT") && (npc != null)) - { - npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); - } - return super.onAdvEvent(event, npc, player); - } - - @Override - public String onSpawn(Npc npc) - { - startQuestTimer("SPAM_TEXT", 180000, npc, null, true); - return super.onSpawn(npc); - } - - public static void main(String[] args) - { - new Lailly(); - } -} \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html new file mode 100644 index 0000000000..9e37587271 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html @@ -0,0 +1,5 @@ +Madame Lailly:
+Hmm? You weren't listening to a story? Or have you listened to all of them?
+I understand that you want to listen to more great stories, but patience is a virtue!
+ + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html new file mode 100644 index 0000000000..fd07c0d1c6 --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html @@ -0,0 +1,7 @@ +Madame Lailly:
+Welcome. Thank you for coming all the way here.
+I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?
+His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!
+ + + \ No newline at end of file diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java new file mode 100644 index 0000000000..c7416f041e --- /dev/null +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java @@ -0,0 +1,105 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package ai.areas.GainakUnderground.Lailly; + +import com.l2jmobius.gameserver.enums.ChatType; +import com.l2jmobius.gameserver.instancemanager.InstanceManager; +import com.l2jmobius.gameserver.model.actor.Npc; +import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.instancezone.Instance; +import com.l2jmobius.gameserver.network.NpcStringId; +import com.l2jmobius.gameserver.network.serverpackets.NpcSay; + +import ai.AbstractNpcAI; + +/** + * Lailly AI. + * @author Stayway + */ +public final class Lailly extends AbstractNpcAI +{ + // NPCs + private static final int LAILLY = 34181; + // Instances + private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_KELBIM = 262; + private static final int INSTANCE_FREYA = 263; + + private Lailly() + { + addSpawnId(LAILLY); + addFirstTalkId(LAILLY); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + switch (event) + { + case "34181.html": + { + htmltext = event; + break; + } + case "spam_text": + { + npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + break; + } + case "okay": + { + final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false); + if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis())) + { + switch (instance.getTemplateId()) + { + case INSTANCE_TAUTI: + case INSTANCE_KELBIM: + case INSTANCE_FREYA: + { + player.teleToLocation(instance.getEnterLocation(), instance); + break; + } + } + break; + } + htmltext = "34181-1.html"; + break; + } + } + return htmltext; + } + + @Override + public String onSpawn(Npc npc) + { + startQuestTimer("spam_text", 180000, npc, null, true); + return super.onSpawn(npc); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "34181.html"; + } + + public static void main(String[] args) + { + new Lailly(); + } +} \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/html/default/34181-1.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/html/default/34181-1.htm deleted file mode 100644 index 4623a9c3b2..0000000000 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/html/default/34181-1.htm +++ /dev/null @@ -1,5 +0,0 @@ -Madame Lailly:
-Hmm? You weren't listening to a story? Or have you listened to all of them?
-I understand that you want to listen to more great stories, but patience is a virtue!
- - \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/html/default/34181.htm b/L2J_Mobius_6.0_Fafurion/dist/game/data/html/default/34181.htm deleted file mode 100644 index 6a8f4be806..0000000000 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/html/default/34181.htm +++ /dev/null @@ -1,7 +0,0 @@ -Madame Lailly:
-Welcome. Thank you for coming all the way here.
-I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?
-His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!
- - - \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java deleted file mode 100644 index e9c3bd21fa..0000000000 --- a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the L2J Mobius project. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -package ai.areas.GainakUnderground; - -import com.l2jmobius.gameserver.enums.ChatType; -import com.l2jmobius.gameserver.model.actor.Npc; -import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; -import com.l2jmobius.gameserver.network.NpcStringId; -import com.l2jmobius.gameserver.network.serverpackets.NpcSay; - -import ai.AbstractNpcAI; - -/** - * Lailly AI. - * @author Stayway - */ -public final class Lailly extends AbstractNpcAI -{ - // NPCs - private static final int LAILLY = 34181; - - private Lailly() - { - addSpawnId(LAILLY); - } - - @Override - public String onAdvEvent(String event, Npc npc, PlayerInstance player) - { - if (event.equals("SPAM_TEXT") && (npc != null)) - { - npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); - } - return super.onAdvEvent(event, npc, player); - } - - @Override - public String onSpawn(Npc npc) - { - startQuestTimer("SPAM_TEXT", 180000, npc, null, true); - return super.onSpawn(npc); - } - - public static void main(String[] args) - { - new Lailly(); - } -} \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html new file mode 100644 index 0000000000..9e37587271 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181-1.html @@ -0,0 +1,5 @@ +Madame Lailly:
+Hmm? You weren't listening to a story? Or have you listened to all of them?
+I understand that you want to listen to more great stories, but patience is a virtue!
+ + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html new file mode 100644 index 0000000000..fd07c0d1c6 --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/34181.html @@ -0,0 +1,7 @@ +Madame Lailly:
+Welcome. Thank you for coming all the way here.
+I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?
+His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!
+ + + \ No newline at end of file diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java new file mode 100644 index 0000000000..c7416f041e --- /dev/null +++ b/L2J_Mobius_6.0_Fafurion/dist/game/data/scripts/ai/areas/GainakUnderground/Lailly/Lailly.java @@ -0,0 +1,105 @@ +/* + * This file is part of the L2J Mobius project. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package ai.areas.GainakUnderground.Lailly; + +import com.l2jmobius.gameserver.enums.ChatType; +import com.l2jmobius.gameserver.instancemanager.InstanceManager; +import com.l2jmobius.gameserver.model.actor.Npc; +import com.l2jmobius.gameserver.model.actor.instance.PlayerInstance; +import com.l2jmobius.gameserver.model.instancezone.Instance; +import com.l2jmobius.gameserver.network.NpcStringId; +import com.l2jmobius.gameserver.network.serverpackets.NpcSay; + +import ai.AbstractNpcAI; + +/** + * Lailly AI. + * @author Stayway + */ +public final class Lailly extends AbstractNpcAI +{ + // NPCs + private static final int LAILLY = 34181; + // Instances + private static final int INSTANCE_TAUTI = 261; + private static final int INSTANCE_KELBIM = 262; + private static final int INSTANCE_FREYA = 263; + + private Lailly() + { + addSpawnId(LAILLY); + addFirstTalkId(LAILLY); + } + + @Override + public String onAdvEvent(String event, Npc npc, PlayerInstance player) + { + String htmltext = null; + switch (event) + { + case "34181.html": + { + htmltext = event; + break; + } + case "spam_text": + { + npc.broadcastPacket(new NpcSay(npc.getObjectId(), ChatType.NPC_GENERAL, npc.getId(), NpcStringId.READY_TO_LISTEN_TO_A_STORY_COME_NOW)); + break; + } + case "okay": + { + final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false); + if ((instance != null) && (instance.getEndTime() > System.currentTimeMillis())) + { + switch (instance.getTemplateId()) + { + case INSTANCE_TAUTI: + case INSTANCE_KELBIM: + case INSTANCE_FREYA: + { + player.teleToLocation(instance.getEnterLocation(), instance); + break; + } + } + break; + } + htmltext = "34181-1.html"; + break; + } + } + return htmltext; + } + + @Override + public String onSpawn(Npc npc) + { + startQuestTimer("spam_text", 180000, npc, null, true); + return super.onSpawn(npc); + } + + @Override + public String onFirstTalk(Npc npc, PlayerInstance player) + { + return "34181.html"; + } + + public static void main(String[] args) + { + new Lailly(); + } +} \ No newline at end of file