Beleth wormhole improvements.

This commit is contained in:
MobiusDev
2016-12-31 16:03:18 +00:00
parent 167ff41c14
commit b259d33ed4
3 changed files with 45 additions and 46 deletions

View File

@@ -1,3 +1,3 @@
<html><body>Wormhole:<br><!-- TODO: Find retail html --> <html><body>Wormhole:<br>
It seems like Beleth is occupied at the moment. Beleth is already engaged in combat with others.
</body></html> </body></html>

View File

@@ -0,0 +1,3 @@
<html><body>Wormhole:<br>
Beleth is not here.
</body></html>

View File

@@ -51,15 +51,16 @@ public final class Wormhole extends AbstractNpcAI
@Override @Override
public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
{ {
String htmltext = null; if (event.equals("teleport"))
switch (event)
{ {
case "teleport": final int status = GrandBossManager.getInstance().getBossStatus(BELETH);
if (status == 1)
{ {
if (GrandBossManager.getInstance().getBossStatus(BELETH) > 0) return "33901-4.html";
}
if (status == 2)
{ {
htmltext = "33901-4.html"; return "33901-5.html";
break;
} }
if (!player.isInParty()) if (!player.isInParty())
@@ -68,7 +69,7 @@ public final class Wormhole extends AbstractNpcAI
packet.setHtml(getHtm(player.getHtmlPrefix(), "33901-2.html")); packet.setHtml(getHtm(player.getHtmlPrefix(), "33901-2.html"));
packet.replace("%min%", Integer.toString(Config.BELETH_MIN_PLAYERS)); packet.replace("%min%", Integer.toString(Config.BELETH_MIN_PLAYERS));
player.sendPacket(packet); player.sendPacket(packet);
break; return null;
} }
final L2Party party = player.getParty(); final L2Party party = player.getParty();
@@ -77,9 +78,7 @@ public final class Wormhole extends AbstractNpcAI
final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player); final boolean isPartyLeader = (isInCC) ? party.getCommandChannel().isLeader(player) : party.isLeader(player);
if (!isPartyLeader) if (!isPartyLeader)
{ {
htmltext = "33901-3.html"; return "33901-3.html";
break;
} }
else if ((members.size() < Config.BELETH_MIN_PLAYERS) || (members.size() > Config.BELETH_MAX_PLAYERS)) else if ((members.size() < Config.BELETH_MIN_PLAYERS) || (members.size() > Config.BELETH_MAX_PLAYERS))
{ {
@@ -87,7 +86,6 @@ public final class Wormhole extends AbstractNpcAI
packet.setHtml(getHtm(player.getHtmlPrefix(), "33901-2.html")); packet.setHtml(getHtm(player.getHtmlPrefix(), "33901-2.html"));
packet.replace("%min%", Integer.toString(Config.BELETH_MIN_PLAYERS)); packet.replace("%min%", Integer.toString(Config.BELETH_MIN_PLAYERS));
player.sendPacket(packet); player.sendPacket(packet);
break;
} }
else else
{ {
@@ -99,10 +97,8 @@ public final class Wormhole extends AbstractNpcAI
} }
} }
} }
break;
} }
} return null;
return htmltext;
} }
@Override @Override