Daichir Teleporter AI.

This commit is contained in:
MobiusDev 2017-09-16 22:31:58 +00:00
parent 668dac5f40
commit ee3228b22a
36 changed files with 564 additions and 27 deletions

View File

@ -146,6 +146,25 @@ LilithMinPlayerLvl = 85
# Maximum players Level for enter to Lilith. Retail: 89
LilithMaxPlayerLvl = 89
# ---------------------------------------------------------------------------
# Trasken
# ---------------------------------------------------------------------------
# Interval time of Trasken. Value is hour. Range 1-480. Retail: 264
IntervalOfTraskenSpawn = 264
# Random interval. Range 1-192. Retail: 72
RandomOfTraskenSpawn = 72
# Minimal count of players for enter to Trasken. Retail: 49
TraskenMinPlayers = 49
# Maximum count of players for enter to Trasken. Retail: 112
TraskenMaxPlayers = 112
# Minimum players Level for enter to Trasken. Retail: 99
TraskenMinPlayerLvl = 85
# ---------------------------------------------------------------------------
# Lindvior
# ---------------------------------------------------------------------------

View File

@ -0,0 +1,4 @@
<html><body>Teleport Device:<br>
Are you sure you want to leave the cave?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Trasken exitZone">Yes, teleport me out.</Button>
</body></html>

View File

@ -1,4 +1,4 @@
<html><body>Teleport Device:<br>
This is a teleport device made to move to the ground.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Trasken exitZone">Go up to the town.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">Go up to the town.</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Head Priest of the Earth Daichir:<br>
There is an active siege at the Earth Wyrn Cave!<br>
At this time it's impossible to enter.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Head Priest of the Earth Daichir:<br>
Trasken? 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>Head Priest of the Earth Daichir:<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>Head Priest of the Earth Daichir:<br>
(A command channel needs at least minimum: <font color="LEVEL">%min%</font> and maximum: <font color="LEVEL">%max%</font> members to challenge Trasken.)
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Head Priest of the Earth Daichir:<br>
(A command channel members level must be minimum: <font color="LEVEL">%minlvl% Lvl</font> or higher to challenge Trasken.)
</body></html>

View File

@ -3,6 +3,6 @@
Although we are unfortunate to be suffering, do not pity yourself. All is meant. All will be remedied.<br>
The Goddess of the Earth is always beside you. We must repay her for the kindness she allows us.<br>
If you want the blessing of goddess to be always with you, remember my words! <font color="LEVEL">"Karna Maphra!"</font><br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Trasken enterZone">"What of Trasken?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Daichir enterZone">"What of Trasken?"</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -0,0 +1,128 @@
/*
* 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.bosses.Trasken.Daichir;
import java.util.List;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
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.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import ai.AbstractNpcAI;
/**
* Daichir Teleporter AI
* @author Mobius
*/
public class Daichir extends AbstractNpcAI
{
// NPCs
private static final int DAICHIR = 30537;
private static final int TRASKEN = 29197;
// Locations
private static final Location ENTER_LOCATION = new Location(75445, -182112, -9880);
// Status
private static final int FIGHTING = 1;
private static final int DEAD = 3;
public Daichir()
{
addFirstTalkId(DAICHIR);
addTalkId(DAICHIR);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("enterZone"))
{
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (player.isGM())
{
player.teleToLocation(ENTER_LOCATION, true);
GrandBossManager.getInstance().setBossStatus(TRASKEN, FIGHTING);
}
else
{
if (status == FIGHTING)
{
return "33881-1.html";
}
if (status == DEAD)
{
return "33881-2.html";
}
if (!player.isInParty())
{
return "33881-3.html";
}
final L2Party party = player.getParty();
final boolean isInCC = party.isInCommandChannel();
final List<L2PcInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
if (!isPartyLeader)
{
return "33881-3.html";
}
if ((members.size() < Config.TRASKEN_MIN_PLAYERS) || (members.size() > Config.TRASKEN_MAX_PLAYERS))
{
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
packet.setHtml(getHtm(player.getHtmlPrefix(), "33881-4.html"));
packet.replace("%min%", Integer.toString(Config.TRASKEN_MIN_PLAYERS));
packet.replace("%max%", Integer.toString(Config.TRASKEN_MAX_PLAYERS));
player.sendPacket(packet);
return null;
}
for (L2PcInstance member : members)
{
if (member.getLevel() < Config.TRASKEN_MIN_PLAYER_LVL)
{
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
packet.setHtml(getHtm(player.getHtmlPrefix(), "33881-5.html"));
packet.replace("%minlvl%", Integer.toString(Config.TRASKEN_MIN_PLAYER_LVL));
player.sendPacket(packet);
return null;
}
}
for (L2PcInstance member : members)
{
if (member.isInsideRadius(npc, 1500, true, false))
{
member.teleToLocation(ENTER_LOCATION, true);
GrandBossManager.getInstance().setBossStatus(TRASKEN, FIGHTING);
}
}
}
}
return null;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return npc.getId() + ".html";
}
public static void main(String[] args)
{
new Daichir();
}
}

View File

@ -70,6 +70,7 @@ public class Trasken extends AbstractNpcAI
private static final int DIGISTIVE = 29206;
private static final int TRADJAN = 19160;
private static final int HEART_ERTHWYRM = 19081;
private static final int TELEPORT_ORB = 33513;
// Zone
private static final int ZONE_ID = 12108;
private static final int ZONE_ID_HEART = 12109;
@ -81,7 +82,6 @@ public class Trasken extends AbstractNpcAI
22120846
};
private static final int DOOR = 22120001;
private static final Location ENTER_LOCATION = new Location(75445, -182112, -9880);
private static final Location EXIT_LOCATION = new Location(87679, -141982, -1341);
static final Location CENTER_LOCATION = new Location(81208, -182095, -9895);
static final Location HEART_LOCATION = new Location(81208, -182095, -9895);
@ -579,14 +579,12 @@ public class Trasken extends AbstractNpcAI
{
switch (event)
{
case "enterZone":
{
player.teleToLocation(ENTER_LOCATION);
break;
}
case "exitZone":
{
player.teleToLocation(EXIT_LOCATION);
if (npc.getId() == TELEPORT_ORB)
{
player.teleToLocation(EXIT_LOCATION);
}
break;
}
case "finish":

View File

@ -902,6 +902,13 @@ public final class Config
public static int KELBIM_SPAWN_INTERVAL;
public static int KELBIM_SPAWN_RANDOM;
// Trasken
public static int TRASKEN_SPAWN_INTERVAL;
public static int TRASKEN_SPAWN_RANDOM;
public static int TRASKEN_MIN_PLAYERS;
public static int TRASKEN_MAX_PLAYERS;
public static int TRASKEN_MIN_PLAYER_LVL;
// Lindvior
public static int LINDVIOR_SPAWN_INTERVAL;
public static int LINDVIOR_SPAWN_RANDOM;
@ -2249,6 +2256,11 @@ public final class Config
LILITH_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfLilithSpawn", 148);
LILITH_MIN_PLAYER_LVL = GrandBossSettings.getInt("LilithMinPlayerLvl", 85);
LILITH_MAX_PLAYER_LVL = GrandBossSettings.getInt("LilithMaxPlayerLvl", 89);
TRASKEN_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfTraskenSpawn", 264);
TRASKEN_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfTraskenSpawn", 72);
TRASKEN_MIN_PLAYERS = GrandBossSettings.getInt("TraskenMinPlayers", 49);
TRASKEN_MAX_PLAYERS = GrandBossSettings.getInt("TraskenMaxPlayers", 112);
TRASKEN_MIN_PLAYER_LVL = GrandBossSettings.getInt("TraskenMinPlayerLvl", 85);
LINDVIOR_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfLindviorSpawn", 264);
LINDVIOR_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfLindviorSpawn", 72);
LINDVIOR_MIN_PLAYERS = GrandBossSettings.getInt("LindviorMinPlayers", 49);

View File

@ -146,6 +146,25 @@ LilithMinPlayerLvl = 85
# Maximum players Level for enter to Lilith. Retail: 89
LilithMaxPlayerLvl = 89
# ---------------------------------------------------------------------------
# Trasken
# ---------------------------------------------------------------------------
# Interval time of Trasken. Value is hour. Range 1-480. Retail: 264
IntervalOfTraskenSpawn = 264
# Random interval. Range 1-192. Retail: 72
RandomOfTraskenSpawn = 72
# Minimal count of players for enter to Trasken. Retail: 49
TraskenMinPlayers = 49
# Maximum count of players for enter to Trasken. Retail: 112
TraskenMaxPlayers = 112
# Minimum players Level for enter to Trasken. Retail: 99
TraskenMinPlayerLvl = 85
# ---------------------------------------------------------------------------
# Lindvior
# ---------------------------------------------------------------------------

View File

@ -0,0 +1,4 @@
<html><body>Teleport Device:<br>
Are you sure you want to leave the cave?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Trasken exitZone">Yes, teleport me out.</Button>
</body></html>

View File

@ -1,4 +1,4 @@
<html><body>Teleport Device:<br>
This is a teleport device made to move to the ground.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Trasken exitZone">Go up to the town.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">Go up to the town.</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Head Priest of the Earth Daichir:<br>
There is an active siege at the Earth Wyrn Cave!<br>
At this time it's impossible to enter.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Head Priest of the Earth Daichir:<br>
Trasken? 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>Head Priest of the Earth Daichir:<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>Head Priest of the Earth Daichir:<br>
(A command channel needs at least minimum: <font color="LEVEL">%min%</font> and maximum: <font color="LEVEL">%max%</font> members to challenge Trasken.)
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Head Priest of the Earth Daichir:<br>
(A command channel members level must be minimum: <font color="LEVEL">%minlvl% Lvl</font> or higher to challenge Trasken.)
</body></html>

View File

@ -3,6 +3,6 @@
Although we are unfortunate to be suffering, do not pity yourself. All is meant. All will be remedied.<br>
The Goddess of the Earth is always beside you. We must repay her for the kindness she allows us.<br>
If you want the blessing of goddess to be always with you, remember my words! <font color="LEVEL">"Karna Maphra!"</font><br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Trasken enterZone">"What of Trasken?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Daichir enterZone">"What of Trasken?"</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -0,0 +1,128 @@
/*
* 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.bosses.Trasken.Daichir;
import java.util.List;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
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.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import ai.AbstractNpcAI;
/**
* Daichir Teleporter AI
* @author Mobius
*/
public class Daichir extends AbstractNpcAI
{
// NPCs
private static final int DAICHIR = 30537;
private static final int TRASKEN = 29197;
// Locations
private static final Location ENTER_LOCATION = new Location(75445, -182112, -9880);
// Status
private static final int FIGHTING = 1;
private static final int DEAD = 3;
public Daichir()
{
addFirstTalkId(DAICHIR);
addTalkId(DAICHIR);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("enterZone"))
{
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (player.isGM())
{
player.teleToLocation(ENTER_LOCATION, true);
GrandBossManager.getInstance().setBossStatus(TRASKEN, FIGHTING);
}
else
{
if (status == FIGHTING)
{
return "33881-1.html";
}
if (status == DEAD)
{
return "33881-2.html";
}
if (!player.isInParty())
{
return "33881-3.html";
}
final L2Party party = player.getParty();
final boolean isInCC = party.isInCommandChannel();
final List<L2PcInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
if (!isPartyLeader)
{
return "33881-3.html";
}
if ((members.size() < Config.TRASKEN_MIN_PLAYERS) || (members.size() > Config.TRASKEN_MAX_PLAYERS))
{
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
packet.setHtml(getHtm(player.getHtmlPrefix(), "33881-4.html"));
packet.replace("%min%", Integer.toString(Config.TRASKEN_MIN_PLAYERS));
packet.replace("%max%", Integer.toString(Config.TRASKEN_MAX_PLAYERS));
player.sendPacket(packet);
return null;
}
for (L2PcInstance member : members)
{
if (member.getLevel() < Config.TRASKEN_MIN_PLAYER_LVL)
{
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
packet.setHtml(getHtm(player.getHtmlPrefix(), "33881-5.html"));
packet.replace("%minlvl%", Integer.toString(Config.TRASKEN_MIN_PLAYER_LVL));
player.sendPacket(packet);
return null;
}
}
for (L2PcInstance member : members)
{
if (member.isInsideRadius(npc, 1500, true, false))
{
member.teleToLocation(ENTER_LOCATION, true);
GrandBossManager.getInstance().setBossStatus(TRASKEN, FIGHTING);
}
}
}
}
return null;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return npc.getId() + ".html";
}
public static void main(String[] args)
{
new Daichir();
}
}

View File

@ -70,6 +70,7 @@ public class Trasken extends AbstractNpcAI
private static final int DIGISTIVE = 29206;
private static final int TRADJAN = 19160;
private static final int HEART_ERTHWYRM = 19081;
private static final int TELEPORT_ORB = 33513;
// Zone
private static final int ZONE_ID = 12108;
private static final int ZONE_ID_HEART = 12109;
@ -81,7 +82,6 @@ public class Trasken extends AbstractNpcAI
22120846
};
private static final int DOOR = 22120001;
private static final Location ENTER_LOCATION = new Location(75445, -182112, -9880);
private static final Location EXIT_LOCATION = new Location(87679, -141982, -1341);
static final Location CENTER_LOCATION = new Location(81208, -182095, -9895);
static final Location HEART_LOCATION = new Location(81208, -182095, -9895);
@ -579,14 +579,12 @@ public class Trasken extends AbstractNpcAI
{
switch (event)
{
case "enterZone":
{
player.teleToLocation(ENTER_LOCATION);
break;
}
case "exitZone":
{
player.teleToLocation(EXIT_LOCATION);
if (npc.getId() == TELEPORT_ORB)
{
player.teleToLocation(EXIT_LOCATION);
}
break;
}
case "finish":

View File

@ -904,6 +904,13 @@ public final class Config
public static int KELBIM_SPAWN_INTERVAL;
public static int KELBIM_SPAWN_RANDOM;
// Trasken
public static int TRASKEN_SPAWN_INTERVAL;
public static int TRASKEN_SPAWN_RANDOM;
public static int TRASKEN_MIN_PLAYERS;
public static int TRASKEN_MAX_PLAYERS;
public static int TRASKEN_MIN_PLAYER_LVL;
// Lindvior
public static int LINDVIOR_SPAWN_INTERVAL;
public static int LINDVIOR_SPAWN_RANDOM;
@ -2253,6 +2260,11 @@ public final class Config
LILITH_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfLilithSpawn", 148);
LILITH_MIN_PLAYER_LVL = GrandBossSettings.getInt("LilithMinPlayerLvl", 85);
LILITH_MAX_PLAYER_LVL = GrandBossSettings.getInt("LilithMaxPlayerLvl", 89);
TRASKEN_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfTraskenSpawn", 264);
TRASKEN_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfTraskenSpawn", 72);
TRASKEN_MIN_PLAYERS = GrandBossSettings.getInt("TraskenMinPlayers", 49);
TRASKEN_MAX_PLAYERS = GrandBossSettings.getInt("TraskenMaxPlayers", 112);
TRASKEN_MIN_PLAYER_LVL = GrandBossSettings.getInt("TraskenMinPlayerLvl", 85);
LINDVIOR_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfLindviorSpawn", 264);
LINDVIOR_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfLindviorSpawn", 72);
LINDVIOR_MIN_PLAYERS = GrandBossSettings.getInt("LindviorMinPlayers", 49);

View File

@ -146,6 +146,25 @@ LilithMinPlayerLvl = 85
# Maximum players Level for enter to Lilith. Retail: 89
LilithMaxPlayerLvl = 89
# ---------------------------------------------------------------------------
# Trasken
# ---------------------------------------------------------------------------
# Interval time of Trasken. Value is hour. Range 1-480. Retail: 264
IntervalOfTraskenSpawn = 264
# Random interval. Range 1-192. Retail: 72
RandomOfTraskenSpawn = 72
# Minimal count of players for enter to Trasken. Retail: 49
TraskenMinPlayers = 49
# Maximum count of players for enter to Trasken. Retail: 112
TraskenMaxPlayers = 112
# Minimum players Level for enter to Trasken. Retail: 99
TraskenMinPlayerLvl = 85
# ---------------------------------------------------------------------------
# Lindvior
# ---------------------------------------------------------------------------

View File

@ -0,0 +1,4 @@
<html><body>Teleport Device:<br>
Are you sure you want to leave the cave?<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Trasken exitZone">Yes, teleport me out.</Button>
</body></html>

View File

@ -1,4 +1,4 @@
<html><body>Teleport Device:<br>
This is a teleport device made to move to the ground.<br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Trasken exitZone">Go up to the town.</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h npc_%objectId%_Chat 1">Go up to the town.</Button>
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Head Priest of the Earth Daichir:<br>
There is an active siege at the Earth Wyrn Cave!<br>
At this time it's impossible to enter.
</body></html>

View File

@ -0,0 +1,4 @@
<html><body>Head Priest of the Earth Daichir:<br>
Trasken? 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>Head Priest of the Earth Daichir:<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>Head Priest of the Earth Daichir:<br>
(A command channel needs at least minimum: <font color="LEVEL">%min%</font> and maximum: <font color="LEVEL">%max%</font> members to challenge Trasken.)
</body></html>

View File

@ -0,0 +1,3 @@
<html><body>Head Priest of the Earth Daichir:<br>
(A command channel members level must be minimum: <font color="LEVEL">%minlvl% Lvl</font> or higher to challenge Trasken.)
</body></html>

View File

@ -3,6 +3,6 @@
Although we are unfortunate to be suffering, do not pity yourself. All is meant. All will be remedied.<br>
The Goddess of the Earth is always beside you. We must repay her for the kindness she allows us.<br>
If you want the blessing of goddess to be always with you, remember my words! <font color="LEVEL">"Karna Maphra!"</font><br>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Trasken enterZone">"What of Trasken?"</Button>
<Button ALIGN=LEFT ICON="NORMAL" action="bypass -h Quest Daichir enterZone">"What of Trasken?"</Button>
<Button ALIGN=LEFT ICON="QUEST" action="bypass -h npc_%objectId%_Quest">Quest</Button>
</body></html>

View File

@ -0,0 +1,128 @@
/*
* 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.bosses.Trasken.Daichir;
import java.util.List;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
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.instance.L2PcInstance;
import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
import ai.AbstractNpcAI;
/**
* Daichir Teleporter AI
* @author Mobius
*/
public class Daichir extends AbstractNpcAI
{
// NPCs
private static final int DAICHIR = 30537;
private static final int TRASKEN = 29197;
// Locations
private static final Location ENTER_LOCATION = new Location(75445, -182112, -9880);
// Status
private static final int FIGHTING = 1;
private static final int DEAD = 3;
public Daichir()
{
addFirstTalkId(DAICHIR);
addTalkId(DAICHIR);
}
@Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{
if (event.equals("enterZone"))
{
final int status = GrandBossManager.getInstance().getBossStatus(TRASKEN);
if (player.isGM())
{
player.teleToLocation(ENTER_LOCATION, true);
GrandBossManager.getInstance().setBossStatus(TRASKEN, FIGHTING);
}
else
{
if (status == FIGHTING)
{
return "33881-1.html";
}
if (status == DEAD)
{
return "33881-2.html";
}
if (!player.isInParty())
{
return "33881-3.html";
}
final L2Party party = player.getParty();
final boolean isInCC = party.isInCommandChannel();
final List<L2PcInstance> members = (isInCC) ? party.getCommandChannel().getMembers() : party.getMembers();
final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
if (!isPartyLeader)
{
return "33881-3.html";
}
if ((members.size() < Config.TRASKEN_MIN_PLAYERS) || (members.size() > Config.TRASKEN_MAX_PLAYERS))
{
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
packet.setHtml(getHtm(player.getHtmlPrefix(), "33881-4.html"));
packet.replace("%min%", Integer.toString(Config.TRASKEN_MIN_PLAYERS));
packet.replace("%max%", Integer.toString(Config.TRASKEN_MAX_PLAYERS));
player.sendPacket(packet);
return null;
}
for (L2PcInstance member : members)
{
if (member.getLevel() < Config.TRASKEN_MIN_PLAYER_LVL)
{
final NpcHtmlMessage packet = new NpcHtmlMessage(npc.getObjectId());
packet.setHtml(getHtm(player.getHtmlPrefix(), "33881-5.html"));
packet.replace("%minlvl%", Integer.toString(Config.TRASKEN_MIN_PLAYER_LVL));
player.sendPacket(packet);
return null;
}
}
for (L2PcInstance member : members)
{
if (member.isInsideRadius(npc, 1500, true, false))
{
member.teleToLocation(ENTER_LOCATION, true);
GrandBossManager.getInstance().setBossStatus(TRASKEN, FIGHTING);
}
}
}
}
return null;
}
@Override
public String onFirstTalk(L2Npc npc, L2PcInstance player)
{
return npc.getId() + ".html";
}
public static void main(String[] args)
{
new Daichir();
}
}

View File

@ -70,6 +70,7 @@ public class Trasken extends AbstractNpcAI
private static final int DIGISTIVE = 29206;
private static final int TRADJAN = 19160;
private static final int HEART_ERTHWYRM = 19081;
private static final int TELEPORT_ORB = 33513;
// Zone
private static final int ZONE_ID = 12108;
private static final int ZONE_ID_HEART = 12109;
@ -81,7 +82,6 @@ public class Trasken extends AbstractNpcAI
22120846
};
private static final int DOOR = 22120001;
private static final Location ENTER_LOCATION = new Location(75445, -182112, -9880);
private static final Location EXIT_LOCATION = new Location(87679, -141982, -1341);
static final Location CENTER_LOCATION = new Location(81208, -182095, -9895);
static final Location HEART_LOCATION = new Location(81208, -182095, -9895);
@ -579,14 +579,12 @@ public class Trasken extends AbstractNpcAI
{
switch (event)
{
case "enterZone":
{
player.teleToLocation(ENTER_LOCATION);
break;
}
case "exitZone":
{
player.teleToLocation(EXIT_LOCATION);
if (npc.getId() == TELEPORT_ORB)
{
player.teleToLocation(EXIT_LOCATION);
}
break;
}
case "finish":

View File

@ -904,6 +904,13 @@ public final class Config
public static int KELBIM_SPAWN_INTERVAL;
public static int KELBIM_SPAWN_RANDOM;
// Trasken
public static int TRASKEN_SPAWN_INTERVAL;
public static int TRASKEN_SPAWN_RANDOM;
public static int TRASKEN_MIN_PLAYERS;
public static int TRASKEN_MAX_PLAYERS;
public static int TRASKEN_MIN_PLAYER_LVL;
// Lindvior
public static int LINDVIOR_SPAWN_INTERVAL;
public static int LINDVIOR_SPAWN_RANDOM;
@ -2253,6 +2260,11 @@ public final class Config
LILITH_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfLilithSpawn", 148);
LILITH_MIN_PLAYER_LVL = GrandBossSettings.getInt("LilithMinPlayerLvl", 85);
LILITH_MAX_PLAYER_LVL = GrandBossSettings.getInt("LilithMaxPlayerLvl", 89);
TRASKEN_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfTraskenSpawn", 264);
TRASKEN_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfTraskenSpawn", 72);
TRASKEN_MIN_PLAYERS = GrandBossSettings.getInt("TraskenMinPlayers", 49);
TRASKEN_MAX_PLAYERS = GrandBossSettings.getInt("TraskenMaxPlayers", 112);
TRASKEN_MIN_PLAYER_LVL = GrandBossSettings.getInt("TraskenMinPlayerLvl", 85);
LINDVIOR_SPAWN_INTERVAL = GrandBossSettings.getInt("IntervalOfLindviorSpawn", 264);
LINDVIOR_SPAWN_RANDOM = GrandBossSettings.getInt("RandomOfLindviorSpawn", 72);
LINDVIOR_MIN_PLAYERS = GrandBossSettings.getInt("LindviorMinPlayers", 49);