Addition of missing Leona AI.

Contributed by Liamxroy.
This commit is contained in:
MobiusDevelopment 2020-12-13 22:56:30 +00:00
parent 3e33a6fbce
commit 8e605c716e
8 changed files with 157 additions and 0 deletions

View File

@ -0,0 +1,4 @@
<html><body>Blackbird Clan Lord Leona Blackbird:<br>
On the Etis van Etina there is an attack!<br>
At this time it's impossible to enter the temple.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Blackbird Clan Lord Leona Blackbird:<br>
Etis van Etina? You're too late, friend.<br>
A group of warriors drove him off not long ago.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Blackbird Clan Lord Leona Blackbird:<br>
You are overcome by a voice, a voice so powerful you are helpless as it speaks:<br>
(The players who belong to an association can only enter through the Association Leader.)
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Blackbird Clan Lord Leona Blackbird:<br>
(A command channel needs at least minimum: <font color="LEVEL">%min%</font> and maximum: <font color="LEVEL">%max%</font> members to challenge Etis van Etina.)
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Blackbird Clan Lord Leona Blackbird:<br>
(A command channel members level must be minimum: <font color="LEVEL">%minLevel% Lvl</font> or higher to challenge Etis van Etina.)
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Blackbird Clan Lord Leona Blackbird:<br>
(You can't go on Etina's Instance solo right now.)
</body></html>

View File

@ -0,0 +1,7 @@
<html><body>Blackbird Clan Lord Leona Blackbird:<br>
Thank you. Without your help, we couldn't have won easily.<br>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest Leona teleport"><font color="LEVEL">"I want to go to Etis Van Etina."</font></Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h npc_%objectId%_Chat 6"><font color="LEVEL">"I want to go to Etis Van Etina."(Solo)</font></Button>
<Button ALIGN=LEFT ICON="TELEPORT" action="bypass -h Quest Leona tp_inner"><font color="LEVEL">"I want to go inside Atelia Refinery."</font></Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -0,0 +1,129 @@
/*
* 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.AteliaRefinery.Leona;
import java.util.List;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.Location;
import org.l2jmobius.gameserver.model.Party;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import ai.AbstractNpcAI;
/**
* @author Liamxroy
*/
public class Leona extends AbstractNpcAI
{
// NPCs
private static final int LEONA = 34504;
private static final int ETINA_RAID = 29318;
// Location
private static final Location ENTER_LOC = new Location(-245778, 181088, 2860);
private static final Location REFINERY = new Location(-59328, 52624, -8608);
public Leona()
{
addFirstTalkId(LEONA);
addTalkId(LEONA);
}
@Override
public String onAdvEvent(String event, Npc npc, PlayerInstance player)
{
if (event.equals("teleport"))
{
final int status = GrandBossManager.getInstance().getBossStatus(ETINA_RAID);
if (player.isGM())
{
player.teleToLocation(ENTER_LOC, true);
GrandBossManager.getInstance().setBossStatus(ETINA_RAID, 1);
}
else
{
if (status == 1)
{
return "34504-1.html";
}
if (status == 2)
{
return "34504-2.html";
}
if (!player.isInParty())
{
return "34504-3.html";
}
final Party party = player.getParty();
final boolean isInCC = party.isInCommandChannel();
final List<PlayerInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
if (!isPartyLeader)
{
return "34504-3.html";
}
if ((members.size() < Config.ETINA_MIN_PLAYERS) || (members.size() > Config.ETINA_MAX_PLAYERS))
{
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
packet.setHtml(getHtm(player, "34504-4.html"));
packet.replace("%min%", Integer.toString(Config.ETINA_MIN_PLAYERS));
packet.replace("%max%", Integer.toString(Config.ETINA_MAX_PLAYERS));
player.sendPacket(packet);
return null;
}
for (PlayerInstance member : members)
{
if (member.getLevel() < Config.ETINA_MIN_PLAYER_LEVEL)
{
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
packet.setHtml(getHtm(player, "34504-5.html"));
packet.replace("%minlvl%", Integer.toString(Config.ETINA_MIN_PLAYER_LEVEL));
player.sendPacket(packet);
return null;
}
}
for (PlayerInstance member : members)
{
if (member.isInsideRadius3D(npc, Config.ALT_PARTY_RANGE))
{
member.teleToLocation(ENTER_LOC, false);
GrandBossManager.getInstance().setBossStatus(ETINA_RAID, 1);
}
}
}
}
else if (event.equals("tp_inner"))
{
player.teleToLocation(REFINERY, true);
}
return super.onAdvEvent(event, npc, player);
}
@Override
public String onFirstTalk(Npc npc, PlayerInstance player)
{
return "34504.html";
}
public static void main(String[] args)
{
new Leona();
}
}