[Share] Grandboss Status & Respawn time voiced command.

    Share
    avatar
    jmd

    Posts : 12
    Join date : 2013-03-07
    Age : 25
    Location : Greece

    [Share] Grandboss Status & Respawn time voiced command.

    Post  jmd on 2nd July 2017, 11:59

    This patch might look kinda messy but blame it on eclipse's autoformat thing.



    https://gist.github.com/JMD13/38d1eac0635aa504833d4c53b3a5d5cc

    Code:
    Index: java/net/sf/l2j/gameserver/GameServer.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/GameServer.java (revision 589)
    +++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
    @@ -194,6 +194,7 @@
     import net.sf.l2j.gameserver.handler.usercommandhandlers.OlympiadStat;
     import net.sf.l2j.gameserver.handler.usercommandhandlers.PartyInfo;
     import net.sf.l2j.gameserver.handler.usercommandhandlers.Time;
    +import net.sf.l2j.gameserver.handler.voicedcommandhandlers.Epic;
     import net.sf.l2j.gameserver.handler.voicedcommandhandlers.TvTCommand;
     import net.sf.l2j.gameserver.handler.voicedcommandhandlers.VoiceExperience;
     import net.sf.l2j.gameserver.handler.voicedcommandhandlers.stats;
    @@ -241,7 +242,7 @@
     public class GameServer
     {
     private static final Logger _log = Logger.getLogger(GameServer.class.getName());
    -
    +
     private final SelectorThread<L2GameClient> _selectorThread;
     private final DeadLockDetector _deadDetectThread;
     private final ItemTable _itemTable;
    @@ -249,7 +250,7 @@
     private final HennaTable _hennaTable;
     private final IdFactory _idFactory;
     public static GameServer gameServer;
    -
    +
     private final ItemHandler _itemHandler;
     private final SkillHandler _skillHandler;
     private final AdminCommandHandler _adminCommandHandler;
    @@ -262,29 +263,29 @@
     private final AutoSpawnHandler _autoSpawnHandler;
     private final LoginServerThread _loginThread;
     private final HelperBuffTable _helperBuffTable;
    -
    +
     public static Status statusServer;
     @SuppressWarnings("unused")
     private final ThreadPoolManager _threadpools;
    -
    +
     public static final Calendar DateTimeServerStarted = Calendar.getInstance();
    -
    +
     public long getUsedMemoryMB()
     {
     return (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576; // 1024 * 1024 = 1048576
     }
    -
    +
     public SelectorThread<L2GameClient> getSelectorThread()
     {
     return _selectorThread;
     }
    -
    +
     public GameServer() throws Exception
     {
     long serverLoadStart = System.currentTimeMillis();
     gameServer = this;
     _log.finest("used mem:" + getUsedMemoryMB() + "MB");
    -
    +
     if (Config.SERVER_VERSION != null)
     {
     _log.info("L2J Server Version:    " + Config.SERVER_VERSION);
    @@ -299,21 +300,21 @@
     _log.severe("Could not read object IDs from DB. Please Check Your Data.");
     throw new Exception("Could not initialize the ID factory");
     }
    -
    +
     _threadpools = ThreadPoolManager.getInstance();
    -
    +
     new File(Config.DATAPACK_ROOT, "data/clans").mkdirs();
     new File(Config.DATAPACK_ROOT, "data/crests").mkdirs();
    -
    +
     // load script engines
     L2ScriptEngineManager.getInstance();
    -
    +
     // start game time control early
     GameTimeController.getInstance();
    -
    +
     // keep the references of Singletons to prevent garbage collection
     CharNameTable.getInstance();
    -
    +
     _itemTable = ItemTable.getInstance();
     if (!_itemTable.isInitialized())
     {
    @@ -320,92 +321,92 @@
     _log.severe("Could not find the extraced files. Please Check Your Data.");
     throw new Exception("Could not initialize the item table");
     }
    -
    +
     ExtractableItemsData.getInstance();
     SummonItemsData.getInstance();
    -
    +
     TradeController.getInstance();
     L2Multisell.getInstance();
    -
    +
     SkillTable.getInstance();
    -
    +
     // L2EMU_ADD by Rayan. L2J - BigBro
     if (Config.ALLOW_NPC_WALKERS)
     {
     NpcWalkerRoutesTable.getInstance();
     }
    -
    +
     RecipeController.getInstance();
    -
    +
     if (Config.NPC_BUFFER_ENABLED)
     {
     NpcBufferTable.getInstance();
     }
    -
    +
     SkillTreeTable.getInstance();
     ArmorSetsTable.getInstance();
     FishTable.getInstance();
    -
    +
     if (Config.SP_BOOK_NEEDED)
     {
     SkillSpellbookTable.getInstance();
     }
    -
    +
     CharTemplateTable.getInstance();
     NobleSkillTable.getInstance();
    -
    +
     // Call to load caches
     HtmCache.getInstance();
     CrestCache.getInstance();
    -
    +
     // forum has to be loaded before clan data, because of last forum id used should have also memo included
     if (Config.COMMUNITY_TYPE > 0)
     {
     ForumsBBSManager.getInstance().initRoot();
     }
    -
    +
     ClanTable.getInstance();
    -
    +
     GeoData.getInstance();
     if (Config.GEODATA == 2)
     {
     PathFinding.getInstance();
     }
    -
    +
     _npcTable = NpcTable.getInstance();
    -
    +
     if (!_npcTable.isInitialized())
     {
     _log.severe("Could not find the extraced files. Please Check Your Data.");
     throw new Exception("Could not initialize the npc table");
     }
    -
    +
     _hennaTable = HennaTable.getInstance();
    -
    +
     if (!_hennaTable.isInitialized())
     {
     throw new Exception("Could not initialize the Henna Table");
     }
    -
    +
     HennaTreeTable.getInstance();
    -
    +
     if (!_hennaTable.isInitialized())
     {
     throw new Exception("Could not initialize the Henna Tree Table");
     }
    -
    +
     _helperBuffTable = HelperBuffTable.getInstance();
    -
    +
     if (!_helperBuffTable.isInitialized())
     {
     throw new Exception("Could not initialize the Helper Buff Table");
     }
    -
    +
     // Load clan hall data before zone data
     ClanHallManager.getInstance();
     CastleManager.getInstance();
     SiegeManager.getInstance();
    -
    +
     TeleportLocationTable.getInstance();
     LevelUpData.getInstance();
     L2World.getInstance();
    @@ -419,20 +420,20 @@
     Announcements.getInstance();
     MapRegionTable.getInstance();
     EventDroplist.getInstance();
    -
    +
     /** Load Manor data */
     L2Manor.getInstance();
    -
    +
     AuctionManager.getInstance();
    -
    +
     BoatManager.getInstance();
     CastleManorManager.getInstance();
    -
    +
     MercTicketManager.getInstance();
     PartyMatchRoomList.getInstance();
     PetitionManager.getInstance();
     QuestManager.getInstance();
    -
    +
     try
     {
     _log.info("Loading Server Scripts");
    @@ -443,41 +444,41 @@
     {
     _log.severe("Failed loading scripts.cfg, no script is going to be loaded");
     }
    -
    +
     QuestManager.getInstance().report();
    -
    +
     if (Config.SAVE_DROPPED_ITEM)
     {
     ItemsOnGroundManager.getInstance();
     }
    -
    +
     if (Config.AUTODESTROY_ITEM_AFTER > 0)
     {
     ItemsAutoDestroy.getInstance();
     }
    -
    +
     MonsterRace.getInstance();
    -
    +
     _doorTable = DoorTable.getInstance();
     _doorTable.parseData();
     StaticObjects.getInstance();
    -
    +
     _sevenSignsEngine = SevenSigns.getInstance();
     SevenSignsFestival.getInstance();
     _autoSpawnHandler = AutoSpawnHandler.getInstance();
     _autoChatHandler = AutoChatHandler.getInstance();
    -
    +
     // Spawn the Orators/Preachers if in the Seal Validation period.
     _sevenSignsEngine.spawnSevenSignsNPC();
    -
    +
     Olympiad.getInstance();
     Hero.getInstance();
    -
    +
     FaenorScriptEngine.getInstance();
    -
    +
     _log.config("AutoChatHandler: Loaded " + _autoChatHandler.size() + " handlers in total.");
     _log.config("AutoSpawnHandler: Loaded " + _autoSpawnHandler.size() + " handlers in total.");
    -
    +
     _itemHandler = ItemHandler.getInstance();
     _itemHandler.registerItemHandler(new ScrollOfEscape());
     _itemHandler.registerItemHandler(new ScrollOfResurrection());
    @@ -492,7 +493,7 @@
     _itemHandler.registerItemHandler(new PetFood());
     _itemHandler.registerItemHandler(new Potions());
     _itemHandler.registerItemHandler(new Recipes());
    -
    +
     _itemHandler.registerItemHandler(new RollingDice());
     _itemHandler.registerItemHandler(new EnchantScrolls());
     _itemHandler.registerItemHandler(new EnergyStone());
    @@ -504,7 +505,7 @@
     _itemHandler.registerItemHandler(new SevenSignsRecord());
     _itemHandler.registerItemHandler(new CharChangePotions());
     _itemHandler.registerItemHandler(new Firework());
    -
    +
     _itemHandler.registerItemHandler(new Seed());
     _itemHandler.registerItemHandler(new Harvester());
     _itemHandler.registerItemHandler(new MercTicket());
    @@ -513,7 +514,7 @@
     _itemHandler.registerItemHandler(new SummonItems());
     _itemHandler.registerItemHandler(new BeastSpice());
     _log.config("ItemHandler: Loaded " + _itemHandler.size() + " handlers.");
    -
    +
     _skillHandler = SkillHandler.getInstance();
     _skillHandler.registerSkillHandler(new Blow());
     _skillHandler.registerSkillHandler(new Pdam());
    @@ -543,7 +544,7 @@
     _skillHandler.registerSkillHandler(new BeastFeed());
     _skillHandler.registerSkillHandler(new GetPlayer());
     _log.config("SkillHandler: Loaded " + _skillHandler.size() + " handlers.");
    -
    +
     _adminCommandHandler = AdminCommandHandler.getInstance();
     _adminCommandHandler.registerAdminCommandHandler(new AdminAdmin());
     _adminCommandHandler.registerAdminCommandHandler(new AdminInvul());
    @@ -598,10 +599,10 @@
     _adminCommandHandler.registerAdminCommandHandler(new AdminGeodata());
     _adminCommandHandler.registerAdminCommandHandler(new AdminGeoEditor());
     _adminCommandHandler.registerAdminCommandHandler(new AdminManor());
    -
    +
     // _adminCommandHandler.registerAdminCommandHandler(new AdminRadar());
     _log.config("AdminCommandHandler: Loaded " + _adminCommandHandler.size() + " handlers.");
    -
    +
     _userCommandHandler = UserCommandHandler.getInstance();
     _userCommandHandler.registerUserCommandHandler(new ClanPenalty());
     _userCommandHandler.registerUserCommandHandler(new ClanWarsList());
    @@ -610,42 +611,43 @@
     _userCommandHandler.registerUserCommandHandler(new Loc());
     _userCommandHandler.registerUserCommandHandler(new Mount());
     _userCommandHandler.registerUserCommandHandler(new OlympiadStat());
    -
    +
     _userCommandHandler.registerUserCommandHandler(new PartyInfo());
     _userCommandHandler.registerUserCommandHandler(new Time());
     _userCommandHandler.registerUserCommandHandler(new ChannelLeave());
     _userCommandHandler.registerUserCommandHandler(new ChannelDelete());
     _userCommandHandler.registerUserCommandHandler(new ChannelListUpdate());
    -
    +
     _log.config("UserCommandHandler: Loaded " + _userCommandHandler.size() + " handlers.");
    -
    +
     _voicedCommandHandler = VoicedCommandHandler.getInstance();
     _voicedCommandHandler.registerVoicedCommandHandler(new stats());
    -
    + _voicedCommandHandler.registerVoicedCommandHandler(new Epic());
    +
     if (Config.Boost_EXP_COMMAND)
     {
     _voicedCommandHandler.registerVoicedCommandHandler(new VoiceExperience());
     }
    -
    +
     _voicedCommandHandler.registerVoicedCommandHandler(new TvTCommand());
    -
    +
     _log.config("VoicedCommandHandler: Loaded " + _voicedCommandHandler.size() + " handlers.");
    -
    +
     TaskManager.getInstance();
    -
    +
     GmListTable.getInstance();
    -
    +
     // read pet stats from db
     L2PetDataTable.getInstance().loadPetsData();
    -
    +
     if (Config.ACCEPT_GEOEDITOR_CONN)
     {
     GeoEditorListener.getInstance();
     }
    -
    +
     _shutdownHandler = Shutdown.getInstance();
     Runtime.getRuntime().addShutdownHook(_shutdownHandler);
    -
    +
     try
     {
     _doorTable.getDoor(24190001).openMe();
    @@ -658,7 +660,7 @@
     _doorTable.getDoor(23180004).openMe();
     _doorTable.getDoor(23180005).openMe();
     _doorTable.getDoor(23180006).openMe();
    -
    +
     _doorTable.checkAutoOpen();
     }
     catch (NullPointerException e)
    @@ -669,9 +671,9 @@
     e.printStackTrace();
     }
     }
    -
    +
     _log.config("IdFactory: Free ObjectID's remaining: " + IdFactory.getInstance().size());
    -
    +
     // initialize the dynamic extension loader
     try
     {
    @@ -681,22 +683,22 @@
     {
     _log.log(Level.WARNING, "DynamicExtension could not be loaded and initialized", ex);
     }
    -
    +
     if ((Config.OFFLINE_TRADE_ENABLE || Config.OFFLINE_CRAFT_ENABLE) && Config.RESTORE_OFFLINERS)
     {
     OfflineTradersTable.restoreOfflineTraders();
     }
    -
    +
     if (Config.ALLOW_AUTO_REWARDER)
     {
     AutoRewarder.load();
     }
    -
    +
     // Start Event Engine
     EventEngine.load();
    -
    +
     KnownListUpdateTaskManager.getInstance();
    -
    +
     if (Config.DEADLOCK_DETECTOR)
     {
     _deadDetectThread = new DeadLockDetector();
    @@ -707,25 +709,25 @@
     {
     _deadDetectThread = null;
     }
    -
    +
     System.gc();
     // maxMemory is the upper limit the JVM can use, totalMemory the size of the current allocation pool, freeMemory the unused memory in the allocation pool
     long freeMem = ((Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory()) + Runtime.getRuntime().freeMemory()) / 1048576; // 1024 * 1024 = 1048576
     long totalMem = Runtime.getRuntime().maxMemory() / 1048576;
     _log.info("GameServer Started, free memory " + freeMem + " Mb of " + totalMem + " Mb");
    -
    +
     _loginThread = LoginServerThread.getInstance();
     _loginThread.start();
    -
    +
     final SelectorConfig sc = new SelectorConfig();
     sc.MAX_READ_PER_PASS = Config.MMO_MAX_READ_PER_PASS;
     sc.MAX_SEND_PER_PASS = Config.MMO_MAX_SEND_PER_PASS;
     sc.SLEEP_TIME = Config.MMO_SELECTOR_SLEEP_TIME;
     sc.HELPER_BUFFER_COUNT = Config.MMO_HELPER_BUFFER_COUNT;
    -
    +
     final L2GamePacketHandler gph = new L2GamePacketHandler();
     _selectorThread = new SelectorThread<>(sc, gph, gph, gph, new IPv4Filter());
    -
    +
     InetAddress bindAddress = null;
     if (!Config.GAMESERVER_HOSTNAME.equals("*"))
     {
    @@ -738,7 +740,7 @@
     _log.log(Level.SEVERE, "WARNING: The GameServer bind address is invalid, using all avaliable IPs. Reason: " + e1.getMessage(), e1);
     }
     }
    -
    +
     try
     {
     _selectorThread.openServerSocket(bindAddress, Config.PORT_GAME);
    @@ -749,38 +751,38 @@
     System.exit(1);
     }
     _selectorThread.start();
    -
    +
     _log.config("Maximum Number of Connected Players: " + Config.MAXIMUM_ONLINE_USERS);
     _log.log(Level.INFO, getClass().getSimpleName() + ": Server loaded in " + ((System.currentTimeMillis() - serverLoadStart) / 1000) + " seconds.");
    -
    +
     AutoAnnounceTaskManager.getInstance();
     }
    -
    +
     public static void main(String[] args) throws Exception
     {
     Server.SERVER_MODE = Server.MODE_GAMESERVER;
    -
    +
     // Local Constants
     final String LOG_FOLDER = "log"; // Name of folder for log file
     final String LOG_NAME = "./log.cfg"; // Name of log file
    -
    +
     /*** Main ***/
     // Create log folder
     File logFolder = new File(Config.DATAPACK_ROOT, LOG_FOLDER);
     logFolder.mkdir();
    -
    +
     // Create input stream for log file -- or store file data into memory
     try (InputStream is = new FileInputStream(new File(LOG_NAME)))
     {
     LogManager.getLogManager().readConfiguration(is);
     }
    -
    +
     // Initialize config
     Config.load();
    -
    +
     L2DatabaseFactory.getInstance();
     gameServer = new GameServer();
    -
    +
     if (Config.IS_TELNET_ENABLED)
     {
     statusServer = new Status(Server.SERVER_MODE);
    Index: java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Epic.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Epic.java (revision 0)
    +++ java/net/sf/l2j/gameserver/handler/voicedcommandhandlers/Epic.java (revision 0)
    @@ -0,0 +1,105 @@
    +/*
    + * Copyright (C) 2004-2014 L2J DataPack
    + *
    + * This file is part of L2J DataPack.
    + *
    + * L2J DataPack 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.
    + *
    + * L2J DataPack 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 java.util.Date;
    +import java.util.logging.Logger;
    +
    +import net.sf.l2j.gameserver.datatables.NpcTable;
    +import net.sf.l2j.gameserver.handler.IVoicedCommandHandler;
    +import net.sf.l2j.gameserver.instancemanager.GrandBossManager;
    +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
    +import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
    +import net.sf.l2j.gameserver.templates.StatsSet;
    +
    +/**
    + * @author JMD.
    + */
    +
    +public class Epic implements IVoicedCommandHandler
    +{
    + static final Logger _log = Logger.getLogger(Epic.class.getName());
    + private static final String[] VOICED_COMMANDS =
    + {
    + "epic"
    + };
    +
    + @Override
    + public boolean useVoicedCommand(String command, L2PcInstance activeChar, String params)
    + {
    + if (command.startsWith("epic"))
    + {
    + return Status(activeChar);
    + }
    + return false;
    + }
    +
    + public boolean Status(L2PcInstance activeChar)
    + {
    +
    + int[] BOSSES =
    + {
    + 12001,
    + 12052,
    + 12169,
    + 12211,
    + 12372,
    + 12374,
    + 12899,
    +
    + };
    + SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
    + final StringBuilder replyMSG = new StringBuilder("<html><body><center>");
    + replyMSG.append("<font color="LEVEL">* Grand Boss Status & Respawn Time *</font><br>");
    + for (int boss : BOSSES)
    + {
    + String name = NpcTable.getInstance().getTemplate(boss).getName();
    + StatsSet stats = GrandBossManager.getInstance().getStatsSet(boss);
    + if (stats == null)
    + {
    + replyMSG.append("Stats for GrandBoss " + boss + " not found!<br>");
    + continue;
    + }
    +
    + long delay = stats.getLong("respawn_time");
    + long currentTime = System.currentTimeMillis();
    + if (delay <= currentTime)
    + {
    + replyMSG.append("(" + name + ") is <font color="00FF00">Alive</font><br>");
    +
    + }
    + else
    + {
    + replyMSG.append("(" + name + ") is <font color="FF0000">Dead</font> <font color="FF9900">( " + sdf.format(new Date(delay)) + " )</font><br>");
    + }
    + }
    + replyMSG.append("</center></body></html>");
    + final NpcHtmlMessage adminReply = new NpcHtmlMessage(0);
    + adminReply.setHtml(replyMSG.toString());
    + activeChar.sendPacket(adminReply);
    + return true;
    + }
    +
    + @Override
    + public String[] getVoicedCommandList()
    + {
    + return VOICED_COMMANDS;
    + }
    +}
    \ No newline at end of file
    Index: java/net/sf/l2j/gameserver/templates/L2NpcTemplate.java
    ===================================================================
    --- java/net/sf/l2j/gameserver/templates/L2NpcTemplate.java (revision 589)
    +++ java/net/sf/l2j/gameserver/templates/L2NpcTemplate.java (working copy)
    @@ -24,7 +24,6 @@
     
     import javolution.util.FastList;
     import javolution.util.FastMap;
    -
     import net.sf.l2j.gameserver.model.L2DropCategory;
     import net.sf.l2j.gameserver.model.L2DropData;
     import net.sf.l2j.gameserver.model.L2MinionData;
    @@ -38,7 +37,16 @@
      * <BR>
      * <B><U> Data</U> :</B><BR>
      * <BR>
    - * <li>npcId, type, name, sex</li> <li>rewardExp, rewardSp</li> <li>aggroRange, factionId, factionRange</li> <li>rhand, lhand, armor</li> <li>isUndead</li> <li>_drops</li> <li>_minions</li> <li>_teachInfo</li> <li>_skills</li> <li>_questsStart</li><BR>
    + * <li>npcId, type, name, sex</li>
    + * <li>rewardExp, rewardSp</li>
    + * <li>aggroRange, factionId, factionRange</li>
    + * <li>rhand, lhand, armor</li>
    + * <li>isUndead</li>
    + * <li>_drops</li>
    + * <li>_minions</li>
    + * <li>_teachInfo</li>
    + * <li>_skills</li>
    + * <li>_questsStart</li><BR>
      * <BR>
      * @version $Revision: 1.1.2.4 $ $Date: 2005/04/02 15:57:51 $
      */
    @@ -64,15 +72,15 @@
     public final String factionId;
     public final int factionRange;
     public final int absorb_level;
    -        public final short ss;
    -        public final short bss;
    -        public final short ssRate;
    + public final short ss;
    + public final short bss;
    + public final short ssRate;
     
    -        public boolean isQuestMonster = false;
    + public boolean isQuestMonster = false;
     
     public int race;
    -        public final String jClass;
    -        public final String AI;
    + public final String jClass;
    + public final String AI;
     
     /** The table containing all Item that can be dropped by L2NpcInstance using this L2NpcTemplate */
     private FastList<L2DropCategory> _categories = null;
    @@ -100,8 +108,10 @@
     name = set.getString("name");
     serverSideName = set.getBool("serverSideName");
     title = set.getString("title");
    -                if (title.equalsIgnoreCase("Quest Monster"))
    -                    isQuestMonster = true;
    + if (title.equalsIgnoreCase("Quest Monster"))
    + {
    + isQuestMonster = true;
    + }
     serverSideTitle = set.getBool("serverSideTitle");
     sex = set.getString("sex");
     level = set.getByte("level");
    @@ -113,19 +123,23 @@
     armor = set.getInteger("armor");
     
     String f = set.getString("factionId", null);
    -                if (f == null)
    -                    factionId = null;
    -                else
    -                    factionId = f.intern();
    + if (f == null)
    + {
    + factionId = null;
    + }
    + else
    + {
    + factionId = f.intern();
    + }
     
     factionRange = set.getInteger("factionRange");
     absorb_level = set.getInteger("absorb_level", 0);
    -                ss = (short)set.getInteger("ss", 0);
    -                bss  = (short)set.getInteger("bss", 0);
    -                ssRate  = (short)set.getInteger("ssRate", 0);
    + ss = (short) set.getInteger("ss", 0);
    + bss = (short) set.getInteger("bss", 0);
    + ssRate = (short) set.getInteger("ssRate", 0);
     race = 0;
    -                jClass = set.getString("jClass");
    -                AI = set.getString("AI");
    + jClass = set.getString("jClass");
    + AI = set.getString("AI");
     _teachInfo = null;
     }
     
    @@ -170,8 +184,10 @@
     if (!drop.isQuestDrop())
     {
     // if the category doesn't already exist, create it first
    -                        if (_categories == null)
    -                                _categories = new FastList<>();
    + if (_categories == null)
    + {
    + _categories = new FastList<>();
    + }
     
     synchronized (_categories)
     {
    @@ -199,8 +215,10 @@
     
     public void addRaidData(L2MinionData minion)
     {
    -                if (_minions == null)
    -                        _minions = new FastList<>();
    + if (_minions == null)
    + {
    + _minions = new FastList<>();
    + }
     _minions.add(minion);
     }
     
    @@ -207,7 +225,9 @@
     public void addSkill(L2Skill skill)
     {
     if (_skills == null)
    + {
     _skills = new FastMap<>();
    + }
     _skills.put(skill.getId(), skill);
     }
     
    @@ -246,8 +266,10 @@
     */
     public List<L2DropData> getAllDropData()
     {
    -                if (_categories == null)
    -                        return null;
    + if (_categories == null)
    + {
    + return null;
    + }
     
     List<L2DropData> lst = new FastList<>();
     for (L2DropCategory tmp : _categories)
    @@ -263,8 +285,10 @@
     */
     public synchronized void clearAllDropData()
     {
    -                if (_categories == null)
    -                        return;
    + if (_categories == null)
    + {
    + return;
    + }
     
     while (_categories.size() > 0)
     {
    @@ -291,7 +315,9 @@
     public void addQuestEvent(Quest.QuestEventType EventType, Quest q)
     {
     if (questEvents == null)
    + {
     questEvents = new FastMap<>();
    + }
     
     if (questEvents.get(EventType) == null)
     {
    @@ -309,21 +335,25 @@
     // then only register this NPC if not already registered for the specified event.
     // if a quest allows multiple registrations, then register regardless of count
     // In all cases, check if this new registration is replacing an older copy of the SAME quest
    -                        if (!EventType.isMultipleRegistrationAllowed())
    -                        {
    -                                if (_quests[0].getName().equals(q.getName()))
    -                                        _quests[0] = q;
    -                                else
    -                                        _log.warning("Quest event not allowed in multiple quests.  Skipped addition of Event Type ""+EventType+"" for NPC ""+name +"" and quest ""+q.getName()+"".");
    -                        }
    -                        else
    + if (!EventType.isMultipleRegistrationAllowed())
     {
    -                                // be ready to add a new quest to a new copy of the list, with larger size than previously.
    + if (_quests[0].getName().equals(q.getName()))
    + {
    + _quests[0] = q;
    + }
    + else
    + {
    + _log.warning("Quest event not allowed in multiple quests.  Skipped addition of Event Type "" + EventType + "" for NPC "" + name + "" and quest "" + q.getName() + "".");
    + }
    + }
    + else
    + {
    + // be ready to add a new quest to a new copy of the list, with larger size than previously.
     Quest[] tmp = new Quest[len + 1];
    -                                // loop through the existing quests and copy them to the new list.  While doing so, also
    -                                // check if this new quest happens to be just a replacement for a previously loaded quest.
    -                                // If so, just save the updated reference and do NOT use the new list. Else, add the new
    -                                // quest to the end of the new list
    + // loop through the existing quests and copy them to the new list. While doing so, also
    + // check if this new quest happens to be just a replacement for a previously loaded quest.
    + // If so, just save the updated reference and do NOT use the new list. Else, add the new
    + // quest to the end of the new list
     for (int i = 0; i < len; i++)
     {
     if (_quests[i].getName().equals(q.getName()))
    @@ -338,11 +368,19 @@
     }
     }
     }
    +
    + // Custom getting Grand Boss Name for grandboss status voiced command.
    + public String getName()
    + {
    + return name;
    + }
     
     public Quest[] getEventQuests(Quest.QuestEventType EventType)
     {
     if (questEvents == null)
    + {
     return null;
    + }
     
     return questEvents.get(EventType);
     }

    If you done everything right then just type .epic ingame.


    Last edited by jmd on 3rd July 2017, 11:44; edited 1 time in total
    avatar
    Karakan

    Posts : 403
    Join date : 2013-10-04

    Re: [Share] Grandboss Status & Respawn time voiced command.

    Post  Karakan on 2nd July 2017, 12:51

    Nice share! Cool

      Current date/time is 23rd July 2017, 09:35