Lailly AI improvements.

Contributed by gigilo1968.
This commit is contained in:
MobiusDevelopment
2019-03-30 16:29:29 +00:00
parent 0b03da19bb
commit cca8612de5
24 changed files with 434 additions and 176 deletions

View File

@@ -1,5 +1,5 @@
<html><body>Madame Lailly:<br>
Hmm? You weren't listening to a story? Or have you listened to all of them?<br>
I understand that you want to listen to more great stories, but patience is a virtue!<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Lailly 34181.html">Back</Button>
</body></html>

View File

@@ -2,6 +2,6 @@
Welcome. Thank you for coming all the way here.<br>
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?<br>
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">"Okay."</button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lailly okay">"Okay."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -14,11 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ai.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();

View File

@@ -1,5 +1,5 @@
<html><body>Madame Lailly:<br>
Hmm? You weren't listening to a story? Or have you listened to all of them?<br>
I understand that you want to listen to more great stories, but patience is a virtue!<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Lailly 34181.html">Back</Button>
</body></html>

View File

@@ -2,6 +2,6 @@
Welcome. Thank you for coming all the way here.<br>
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?<br>
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">"Okay."</button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lailly okay">"Okay."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -14,11 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ai.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();

View File

@@ -1,5 +1,5 @@
<html><body>Madame Lailly:<br>
Hmm? You weren't listening to a story? Or have you listened to all of them?<br>
I understand that you want to listen to more great stories, but patience is a virtue!<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Lailly 34181.html">Back</Button>
</body></html>

View File

@@ -2,6 +2,6 @@
Welcome. Thank you for coming all the way here.<br>
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?<br>
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">"Okay."</button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lailly okay">"Okay."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -14,11 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ai.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();

View File

@@ -1,5 +1,5 @@
<html><body>Madame Lailly:<br>
Hmm? You weren't listening to a story? Or have you listened to all of them?<br>
I understand that you want to listen to more great stories, but patience is a virtue!<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Lailly 34181.html">Back</Button>
</body></html>

View File

@@ -2,6 +2,6 @@
Welcome. Thank you for coming all the way here.<br>
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?<br>
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">"Okay."</button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lailly okay">"Okay."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -14,11 +14,13 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ai.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();

View File

@@ -1,5 +0,0 @@
<html><body>Madame Lailly:<br>
Hmm? You weren't listening to a story? Or have you listened to all of them?<br>
I understand that you want to listen to more great stories, but patience is a virtue!<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Madame Lailly:<br>
Welcome. Thank you for coming all the way here.<br>
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?<br>
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">"Okay."</button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}

View File

@@ -0,0 +1,5 @@
<html><body>Madame Lailly:<br>
Hmm? You weren't listening to a story? Or have you listened to all of them?<br>
I understand that you want to listen to more great stories, but patience is a virtue!<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Lailly 34181.html">Back</Button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Madame Lailly:<br>
Welcome. Thank you for coming all the way here.<br>
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?<br>
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lailly okay">"Okay."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}

View File

@@ -1,5 +0,0 @@
<html><body>Madame Lailly:<br>
Hmm? You weren't listening to a story? Or have you listened to all of them?<br>
I understand that you want to listen to more great stories, but patience is a virtue!<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h npc_%objectId%_Chat 0">Back</Button>
</body></html>

View File

@@ -1,7 +0,0 @@
<html><body>Madame Lailly:<br>
Welcome. Thank you for coming all the way here.<br>
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?<br>
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">"Okay."</button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}

View File

@@ -0,0 +1,5 @@
<html><body>Madame Lailly:<br>
Hmm? You weren't listening to a story? Or have you listened to all of them?<br>
I understand that you want to listen to more great stories, but patience is a virtue!<br>
<Button ALIGN=LEFT ICON="RETURN" action="bypass -h Quest Lailly 34181.html">Back</Button>
</body></html>

View File

@@ -0,0 +1,7 @@
<html><body>Madame Lailly:<br>
Welcome. Thank you for coming all the way here.<br>
I'm Lailly, and my husband is the owner of this tavern. You met Settlen, right?<br>
His health had been deteriorating, but I think he's been getting better since we settled down here. Please come by often!<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Lailly okay">"Okay."</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}