Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- Index: java/net/sf/l2j/gameserver/instancemanager/GrandBossManager.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/instancemanager/GrandBossManager.java (revision 4)
- +++ java/net/sf/l2j/gameserver/instancemanager/GrandBossManager.java (working copy)
- @@ -9,12 +9,10 @@
- import java.util.logging.Level;
- import java.util.logging.Logger;
- +import net.sf.l2j.Config;
- import net.sf.l2j.L2DatabaseFactory;
- import net.sf.l2j.gameserver.data.NpcTable;
- import net.sf.l2j.gameserver.model.actor.instance.GrandBoss;
- import net.sf.l2j.gameserver.templates.StatsSet;
- +import net.sf.l2j.gameserver.util.Broadcast;
- /**
- * This class handles the status of all Grand Bosses, and manages L2BossZone zones.
- @@ -82,38 +80,6 @@
- _bossStatus.put(bossId, status);
- _log.info("GrandBossManager: Updated " + NpcTable.getInstance().getTemplate(bossId).getName() + " (id: " + bossId + ") status to " + status);
- updateDb(bossId, true);
- + if (Config.GRAND_BOSS_ANNOUNCE)
- + {
- + switch (bossId)
- + {
- + case 29001:
- + case 29006:
- + case 29014:
- + if (status == 0)
- + Broadcast.announceToOnlinePlayers("Grandboss " + NpcTable.getInstance().getTemplate(bossId).getName() + " is spawned in the world!", true);
- + else if (status == 1)
- + Broadcast.announceToOnlinePlayers("Grandboss " + NpcTable.getInstance().getTemplate(bossId).getName() + " has been killed. Type .epic for details!", true);
- + break;
- + case 29020:
- + if (status == 0)
- + Broadcast.announceToOnlinePlayers("Grandboss " + NpcTable.getInstance().getTemplate(bossId).getName() + " is spawned in the world!", true);
- + else if (status == 1)
- + Broadcast.announceToOnlinePlayers("Grandboss " + NpcTable.getInstance().getTemplate(bossId).getName() + " is awake and fighting.", true);
- + else if (status == 2)
- + Broadcast.announceToOnlinePlayers("Grandboss " + NpcTable.getInstance().getTemplate(bossId).getName() + " has been killed. Type .epic for details!", true);
- + break;
- + case 29028:
- + case 29019:
- + case 29047:
- + if (status == 0)
- + Broadcast.announceToOnlinePlayers("Grandboss " + NpcTable.getInstance().getTemplate(bossId).getName() + " is spawned in the world!", true);
- + if (status == 2)
- + Broadcast.announceToOnlinePlayers("Grandboss " + NpcTable.getInstance().getTemplate(bossId).getName() + " is engaged in battle!", true);
- + else if (status == 3)
- + Broadcast.announceToOnlinePlayers("Grandboss " + NpcTable.getInstance().getTemplate(bossId).getName() + " has been killed. Type .epic for details!", true);
- + break;
- + }
- + }
- }
- /**
- Index: config/npcs.properties
- ===================================================================
- --- config/npcs.properties (revision 4)
- +++ config/npcs.properties (working copy)
- @@ -245,6 +245,16 @@
- # Random interval. Value is hour.
- ZakenRandomSpawn = 20
- +# Announce Grandboss status.
- +# Ex: If status for Antharas/Valakas/Frintezza change to 2 player get announce:
- +# Grandbossname is engaged in battle.
- +# If status changed to 3: Grandbossname has been killed. Type .epic for details!
- +# For Baium if status change to 1 - Baium is awake and fighting.
- +# All Grandboses respawned - Grandbossname is spawned in the world!
- +AnnounceGrandBossStatus = True
- +# Enlabe .epic command
- +EpicInfoCmd = True
- +
- #=============================================================
- # IA
- #=============================================================
- Index: java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (revision 4)
- +++ java/net/sf/l2j/gameserver/handler/VoicedCommandHandler.java (working copy)
- @@ -20,6 +20,7 @@
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.AioMenu;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.BankingCommand;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.EventJoin;
- +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.GrandBossInfo;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.GrandBossStatus;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Menu;
- import net.sf.l2j.gameserver.handler.voicedcommandhandlers.OfflineShop;
- @@ -52,6 +53,7 @@
- registerHandler(new Repair());
- registerHandler(new AioMenu());
- registerHandler(new OfflineShop());
- + registerHandler(new GrandBossInfo());
- }
- public void registerHandler(IVoicedCommandHandler handler)
- Index: java/net/sf/l2j/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 4)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -665,6 +665,9 @@
- public static int SPAWN_INTERVAL_ZAKEN;
- public static int RANDOM_SPAWN_TIME_ZAKEN;
- + public static boolean GRANDBOSSES_ANNOUNCE;
- + public static boolean INFO_EPIC;
- +
- /** AI */
- public static boolean GUARD_ATTACK_AGGRO_MOB;
- public static int MAX_DRIFT_RANGE;
- @@ -1988,6 +2011,9 @@
- SPAWN_INTERVAL_ZAKEN = npcs.getProperty("ZakenSpawnInterval", 60);
- RANDOM_SPAWN_TIME_ZAKEN = npcs.getProperty("ZakenRandomSpawn", 20);
- + GRAND_BOSS_ANNOUNCE = npcs.getProperty("AnnounceGrandBossStatus", true);
- + INFO_EPIC = npcs.getProperty("EpicInfoCmd", true);
- +
- GUARD_ATTACK_AGGRO_MOB = npcs.getProperty("GuardAttackAggroMob", false);
- MAX_DRIFT_RANGE = npcs.getProperty("MaxDriftRange", 300);
- MIN_NPC_ANIMATION = npcs.getProperty("MinNPCAnimation", 20);
- Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/GrandBossInfo.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/GrandBossInfo.java (nonexistent)
- +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/GrandBossInfo.java (working copy)
- @@ -0,0 +1,168 @@
- +/*
- + * 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 net.sf.l2j.gameserver.handler.voicedcommandhandlers;
- +
- +import java.text.SimpleDateFormat;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.data.NpcTable;
- +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
- +import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
- +import net.sf.l2j.gameserver.instancemanager.RaidBossSpawnManager;
- +import net.sf.l2j.gameserver.model.actor.instance.Player;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +import net.sf.l2j.gameserver.templates.StatsSet;
- +
- +/**
- + * @author Baggos
- + */
- +public class GrandBossInfo implements IVoicedCommandHandler
- +{
- +
- + private static final String[] _voicedCommands =
- + {
- + "epic"
- + };
- +
- + private static final int[] raidbosses = new int[]
- + {
- + 29022 // Zaken
- + };
- +
- + private static final int[] GRAND = new int[]
- + {
- + 29001, // Queen Ant
- + 29006, // Core
- + 29014 // Orfen
- + };
- +
- + private static final int[] GRAND2 = new int[]
- + {
- + 29019, // Antharas
- + 29028, // Valakas
- + 29047 // Halisha
- + };
- +
- + private static final int BAIUM = 29020;
- +
- + @Override
- + public boolean useVoicedCommand(String command, Player activeChar, String params)
- + {
- + if (command.equals("epic") && Config.EPIC_INFO)
- + {
- + final StringBuilder sb = new StringBuilder();
- + NpcHtmlMessage html = new NpcHtmlMessage(0);
- + for (int raidboss : raidbosses)
- + {
- + String name = NpcTable.getInstance().getTemplate(raidboss).getName();
- + long delay = RaidBossSpawnManager.getInstance().getRespawntime(raidboss);
- + sb.append("<html><head><title>Epic Boss Manager</title></head><body>");
- + sb.append("<center>");
- + sb.append("<img src=\"L2UI.SquareGray\" width=300 height=1><br>");
- +
- + if (delay <= System.currentTimeMillis())
- + {
- + sb.append("" + name + ": <font color=\"4d94ff\">Is Alive!</font><br1>");
- + }
- + else
- + {
- + sb.append("" + name + ": <br1>");
- + sb.append(" <font color=\"FFFFFF\">" + " " + "Respawn at:</font>" + "" + "<font color=\"FF9900\"> " + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(delay) + "</font><br>");
- + }
- + }
- +
- + // Case of Queen/Core/Orfen
- + for (int grandboss : GRAND)
- + {
- + StatsSet info = GrandBossManager.getInstance().getStatsSet(grandboss);
- + long temp = info.getLong("respawn_time");
- + String Grand = NpcTable.getInstance().getTemplate(grandboss).getName();
- +
- + sb.append("<center>");
- + sb.append("<img src=\"L2UI.SquareGray\" width=300 height=1><br>");
- + if (temp <= System.currentTimeMillis())
- + {
- + sb.append("" + Grand + ": <font color=\"4d94ff\">Is Alive!</font><br1>");
- + }
- + else
- + {
- + sb.append("" + Grand + ": <br1>");
- + sb.append(" <font color=\"FFFFFF\">" + " " + "Respawn at:</font>" + "" + "<font color=\"FF9900\"> " + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(temp) + "</font><br>");
- + }
- + }
- +
- + // Case of Baium
- + StatsSet infobaium = GrandBossManager.getInstance().getStatsSet(BAIUM);
- + long tempbaium = infobaium.getLong("respawn_time");
- + String Baium = NpcTable.getInstance().getTemplate(BAIUM).getName();
- + int BaiumStatus = GrandBossManager.getInstance().getBossStatus(BAIUM);
- +
- + sb.append("<center>");
- + sb.append("<img src=\"L2UI.SquareGray\" width=300 height=1><br>");
- + if (tempbaium <= System.currentTimeMillis() && BaiumStatus == 0)
- + {
- + sb.append("" + Baium + ": <font color=\"ff4d4d\">Is Asleep!</font><br1>");
- + }
- + else if (BaiumStatus == 1)
- + {
- + sb.append("" + Baium + ": <font color=\"ff4d4d\">Is Awake and fighting. Entry is locked.</font><br1>");
- + }
- + else
- + {
- + sb.append("" + Baium + ": <br1>");
- + sb.append(" <font color=\"FFFFFF\">" + " " + "Respawn at:</font>" + "" + "<font color=\"FF9900\"> " + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(tempbaium) + "</font><br>");
- + }
- +
- + // Case of Antharas/Valakas/Halisha
- + for (int grandboss : GRAND2)
- + {
- + StatsSet infogrand = GrandBossManager.getInstance().getStatsSet(grandboss);
- + long tempgrand = infogrand.getLong("respawn_time");
- + String Grand = NpcTable.getInstance().getTemplate(grandboss).getName();
- + int BossStatus = GrandBossManager.getInstance().getBossStatus(grandboss);
- +
- + sb.append("<center>");
- + sb.append("<img src=\"L2UI.SquareGray\" width=300 height=1><br>");
- + if (tempgrand <= System.currentTimeMillis() && BossStatus == 0)
- + {
- + sb.append("" + Grand + ": <font color=\"4d94ff\">Is spawned. Entry is unlocked.</font><br1>");
- + }
- + else if (BossStatus == 1)
- + {
- + sb.append("" + Grand + ": <font color=\"ff4d4d\">Someone has entered. Hurry!</font><br1>");
- + }
- + else if (BossStatus == 2)
- + {
- + sb.append("" + Grand + ": <font color=\"ff4d4d\">Is engaged in battle. Entry is locked.</font><br1>");
- + }
- + else
- + {
- + sb.append("" + Grand + ": <br1>");
- + sb.append(" <font color=\"FFFFFF\">" + " " + "Respawn at:</font>" + "" + "<font color=\"FF9900\"> " + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(tempgrand) + "</font><br>");
- + }
- + }
- + html.setHtml(sb.toString());
- + html.replace("%bosslist%", sb.toString());
- + activeChar.sendPacket(html);
- + }
- + return true;
- + }
- +
- + @Override
- + public String[] getVoicedCommandList()
- + {
- + return _voicedCommands;
- + }
- +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement