Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java b/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
- index e682cc6..ab68e75 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/GameServer.java
- @@ -56,6 +56,7 @@
- import net.sf.l2j.gameserver.data.xml.FishData;
- import net.sf.l2j.gameserver.data.xml.HennaData;
- import net.sf.l2j.gameserver.data.xml.HerbDropData;
- +import net.sf.l2j.gameserver.data.xml.IconData;
- import net.sf.l2j.gameserver.data.xml.InstantTeleportData;
- import net.sf.l2j.gameserver.data.xml.ItemData;
- import net.sf.l2j.gameserver.data.xml.MapRegionData;
- @@ -273,6 +274,9 @@
- LOGGER.info("Loaded {} target handlers.", TargetHandler.getInstance().size());
- LOGGER.info("Loaded {} user command handlers.", UserCommandHandler.getInstance().size());
- + StringUtil.printSection("IconData");
- + IconData.getInstance();
- +
- StringUtil.printSection("System");
- Runtime.getRuntime().addShutdownHook(Shutdown.getInstance());
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/data/manager/GrandBossManager.java b/aCis_gameserver/java/net/sf/l2j/gameserver/data/manager/GrandBossManager.java
- index 8055a66..6d9fc97 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/data/manager/GrandBossManager.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/data/manager/GrandBossManager.java
- @@ -27,6 +27,7 @@
- private final Map<Integer, GrandBoss> _bosses = new HashMap<>();
- private final Map<Integer, StatSet> _sets = new HashMap<>();
- private final Map<Integer, Integer> _bossStatus = new HashMap<>();
- + private final Map<Integer, Long> _trigger = new HashMap<>();
- protected GrandBossManager()
- {
- @@ -98,6 +99,22 @@
- return _bosses.get(bossId);
- }
- + public long getBossTrigger(int bossId)
- + {
- + if (_trigger.containsKey(bossId))
- + return _trigger.get(bossId);
- + return -1;
- + }
- +
- + /**
- + * @param bossId : Set the Grandboss ID
- + * @param time : Insert a value time of triggering.
- + */
- + public void setBossTrigger(int bossId, long time)
- + {
- + _trigger.put(bossId, time);
- + }
- +
- public StatSet getStatSet(int bossId)
- {
- return _sets.get(bossId);
- @@ -201,6 +218,7 @@
- _bosses.clear();
- _sets.clear();
- _bossStatus.clear();
- + _trigger.clear();
- }
- public static GrandBossManager getInstance()
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/data/manager/RaidBossManager.java b/aCis_gameserver/java/net/sf/l2j/gameserver/data/manager/RaidBossManager.java
- index 421a8bf..3ca176c 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/data/manager/RaidBossManager.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/data/manager/RaidBossManager.java
- @@ -32,6 +32,7 @@
- private static final String SAVE_RAIDBOSS = "UPDATE raidboss_spawnlist SET currentHP = ?, currentMP = ? WHERE boss_id = ?";
- protected final Map<Integer, BossSpawn> _spawns = new HashMap<>();
- + public final static Map<Integer, Long> _rTime = new HashMap<>();
- public RaidBossManager()
- {
- @@ -79,6 +80,28 @@
- }
- /**
- + * @param id : Insert BossId to get infos about respawnTime.
- + * @return returns -1 if BossID and/or respawnTime isn't mapping.
- + */
- + public long getRespawntime(int id)
- + {
- + if (_rTime.containsKey(id))
- + return _rTime.get(id);
- +
- + return -1;
- + }
- +
- + /**
- + * @param id : Set the ID of Boss.
- + * @param time : Insert a value of long time.
- + * @return If success inserting, the value of time inserts to map.
- + */
- + public long setTime(int id, long time)
- + {
- + return _rTime.put(id, time);
- + }
- +
- + /**
- * @return a {@link Collection} holding all existing {@link BossSpawn}s.
- */
- public Collection<BossSpawn> getBossSpawns()
- @@ -159,6 +182,7 @@
- bs.setCurrentHp(currentHP);
- bs.setCurrentMp(currentMP);
- bs.setRespawnTime(0);
- + _rTime.put(id, 0L);
- // Time passed by, or we force the database save ; save data on database.
- if (time > respawnTime || forceSave)
- @@ -192,6 +216,7 @@
- bs.setCurrentHp(0);
- bs.setCurrentMp(0);
- bs.setRespawnTime(respawnTime);
- + _rTime.put(id, respawnTime);
- }
- // Add the BossSpawn.
- @@ -214,6 +239,9 @@
- if (bs == null)
- return;
- + if (_rTime.containsKey(id))
- + _rTime.remove(id);
- +
- // Make actions related to despawn.
- bs.onDespawn();
- @@ -260,6 +288,7 @@
- // Delete spawns entries.
- _spawns.clear();
- + _rTime.clear();
- }
- public static RaidBossManager getInstance()
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/IconData.java b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/IconData.java
- new file mode 100644
- index 0000000..f709bd8
- --- /dev/null
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/data/xml/IconData.java
- @@ -0,0 +1,68 @@
- +package net.sf.l2j.gameserver.data.xml;
- +
- +import java.nio.file.Path;
- +import java.util.HashMap;
- +import java.util.Map;
- +
- +import net.sf.l2j.commons.data.xml.IXmlReader;
- +
- +import org.w3c.dom.Document;
- +
- +/**
- + * @author BaggosPC
- + *
- + */
- +public class IconData implements IXmlReader
- +{
- + public static final Map<Integer, String> _iconItem = new HashMap<>();
- +
- + protected IconData()
- + {
- + load();
- + }
- +
- + @Override
- + public void load()
- + {
- + parseFile("./data/xml/iconItems.xml");
- + LOGGER.info("Loaded {} Icons on items.", _iconItem.size());
- + }
- +
- + @Override
- + public void parseDocument(Document doc, Path path)
- + {
- + try
- + {
- + forEach(doc, "list", listNode -> forEach(listNode, "icon", iconNode ->
- + {
- + var set = parseAttributes(iconNode);
- + _iconItem.put(set.getInteger("ItemID"), set.getString("Icon"));
- + }));
- + }
- + catch (Exception e)
- + {
- + LOGGER.info("Error while loading. Make sure your iconItems.xml its correct. The error may be after the "+ _iconItem.size() + " loaded icon(s).");
- + }
- + }
- +
- + public void reload()
- + {
- + _iconItem.clear();
- + load();
- + }
- +
- + public static String getIcon(int id)
- + {
- + return _iconItem.get(id);
- + }
- +
- + public static IconData getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final IconData INSTANCE = new IconData();
- + }
- +}
- \ No newline at end of file
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/spawn/BossSpawn.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/spawn/BossSpawn.java
- index f30299a..712e6fd 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/spawn/BossSpawn.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/spawn/BossSpawn.java
- @@ -10,6 +10,7 @@
- import net.sf.l2j.commons.pool.ThreadPool;
- import net.sf.l2j.commons.random.Rnd;
- +import net.sf.l2j.gameserver.data.manager.RaidBossManager;
- import net.sf.l2j.gameserver.enums.BossStatus;
- import net.sf.l2j.gameserver.model.actor.Npc;
- @@ -32,6 +33,7 @@
- private double _currentMp;
- private long _respawnTime;
- + private long _bossTime;
- @Override
- public String toString()
- @@ -49,6 +51,16 @@
- _spawn = spawn;
- }
- + public long getBossTime()
- + {
- + return _bossTime;
- + }
- +
- + public void setBossTime(long bossTime)
- + {
- + _bossTime = bossTime;
- + }
- +
- public BossStatus getStatus()
- {
- return _status;
- @@ -136,6 +148,7 @@
- _currentHp = 0;
- _currentMp = 0;
- _respawnTime = respawnTime;
- + _bossTime = RaidBossManager.getInstance().setTime(_spawn.getNpcId(), respawnTime);
- // Cancel task, if running.
- cancelTask();
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/BossZone.java b/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/BossZone.java
- index 5e5b7c0..dd6808b 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/BossZone.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/model/zone/type/BossZone.java
- @@ -86,7 +86,7 @@
- player.setInsideZone(ZoneId.NO_SUMMON_FRIEND, true);
- // Skip other checks for GM or if no invade time is set.
- - if (player.isGM() || _invadeTime == 0)
- + if (player.isGM() || _invadeTime == 0 || player.isInObserverMode())
- return;
- // Get player object id.
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- index d8adb02..deec387 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/network/clientpackets/RequestBypassToServer.java
- @@ -20,6 +20,7 @@
- import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- import net.sf.l2j.gameserver.scripting.QuestState;
- +import net.sf.l2j.gameserver.scripting.script.feature.RaidbossInfo;
- public final class RequestBypassToServer extends L2GameClientPacket
- {
- @@ -98,6 +99,16 @@
- html.disableValidation();
- player.sendPacket(html);
- }
- + else if (_command.startsWith("droplist"))
- + {
- + StringTokenizer st = new StringTokenizer(_command, " ");
- + st.nextToken();
- +
- + int npcId = Integer.parseInt(st.nextToken());
- + int page = st.hasMoreTokens() ? Integer.parseInt(st.nextToken()) : 1;
- +
- + RaidbossInfo.sendDropInfos(player, npcId, page);
- + }
- else if (_command.startsWith("npc_"))
- {
- if (!player.validateBypass(_command))
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Antharas.java b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Antharas.java
- index ad33fc8..2d0a6e8 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Antharas.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Antharas.java
- @@ -12,6 +12,7 @@
- import net.sf.l2j.gameserver.data.manager.GrandBossManager;
- import net.sf.l2j.gameserver.data.manager.ZoneManager;
- import net.sf.l2j.gameserver.enums.ScriptEventType;
- +import net.sf.l2j.gameserver.model.World;
- import net.sf.l2j.gameserver.model.actor.Creature;
- import net.sf.l2j.gameserver.model.actor.Npc;
- import net.sf.l2j.gameserver.model.actor.Playable;
- @@ -143,6 +144,9 @@
- // Drop tasks.
- dropTimers(npc);
- + // Stop triggering map
- + GrandBossManager.getInstance().setBossTrigger(ANTHARAS, 0L);
- +
- // Delete current instance of Antharas.
- npc.deleteMe();
- return null;
- @@ -171,6 +175,9 @@
- // stores current time for inactivity task.
- _timeTracker = System.currentTimeMillis();
- + // Stop triggering map
- + GrandBossManager.getInstance().setBossTrigger(ANTHARAS, 0L);
- + World.announceToOnlinePlayers("Grand Monster Antharas is engaged in battle!", true);
- GrandBossManager.getInstance().setBossStatus(ANTHARAS, FIGHTING);
- npc.setInvul(false);
- npc.forceRunStance();
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Baium.java b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Baium.java
- index 0654270..bc54511 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Baium.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Baium.java
- @@ -14,6 +14,7 @@
- import net.sf.l2j.gameserver.data.manager.ZoneManager;
- import net.sf.l2j.gameserver.enums.ScriptEventType;
- import net.sf.l2j.gameserver.geoengine.GeoEngine;
- +import net.sf.l2j.gameserver.model.World;
- import net.sf.l2j.gameserver.model.actor.Attackable;
- import net.sf.l2j.gameserver.model.actor.Creature;
- import net.sf.l2j.gameserver.model.actor.Npc;
- @@ -112,6 +113,7 @@
- _minions.add(angel);
- }
- + World.announceToOnlinePlayers("Grand Monster Baium is awake and fighting.", true);
- startQuestTimerAtFixedRate("baium_despawn", baium, null, 60000);
- startQuestTimerAtFixedRate("skill_range", baium, null, 2000);
- startQuestTimerAtFixedRate("angels_aggro_reconsider", null, null, 5000);
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Valakas.java b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Valakas.java
- index 03cd98e..7d65abe 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Valakas.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/ai/boss/Valakas.java
- @@ -8,6 +8,7 @@
- import net.sf.l2j.gameserver.data.manager.GrandBossManager;
- import net.sf.l2j.gameserver.data.manager.ZoneManager;
- import net.sf.l2j.gameserver.enums.ScriptEventType;
- +import net.sf.l2j.gameserver.model.World;
- import net.sf.l2j.gameserver.model.actor.Creature;
- import net.sf.l2j.gameserver.model.actor.Npc;
- import net.sf.l2j.gameserver.model.actor.Playable;
- @@ -173,6 +174,9 @@
- cancelQuestTimers("regen_task", npc);
- cancelQuestTimers("skill_task", npc);
- + // Stop triggering map
- + GrandBossManager.getInstance().setBossTrigger(VALAKAS, 0L);
- +
- // Delete current instance of Valakas.
- npc.deleteMe();
- @@ -222,9 +226,12 @@
- VALAKAS_LAIR.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, -10, 3400, 4000, 10, -15, 1, 0));
- else if (name.equalsIgnoreCase("spawn_10"))
- {
- + // Stop triggering map
- + GrandBossManager.getInstance().setBossTrigger(VALAKAS, 0L);
- +
- GrandBossManager.getInstance().setBossStatus(VALAKAS, FIGHTING);
- npc.setInvul(false);
- -
- + World.announceToOnlinePlayers("Grand Monster Valakas is engaged in battle!", true);
- startQuestTimerAtFixedRate("regen_task", npc, null, 60000);
- startQuestTimerAtFixedRate("skill_task", npc, null, 2000);
- }
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/GrandbossInfo.java b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/GrandbossInfo.java
- new file mode 100644
- index 0000000..63ee4aa
- --- /dev/null
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/GrandbossInfo.java
- @@ -0,0 +1,195 @@
- +package net.sf.l2j.gameserver.scripting.script.feature;
- +
- +import java.text.SimpleDateFormat;
- +import java.util.StringTokenizer;
- +
- +import net.sf.l2j.commons.lang.StringUtil;
- +import net.sf.l2j.commons.logging.CLogger;
- +
- +import net.sf.l2j.gameserver.data.manager.GrandBossManager;
- +import net.sf.l2j.gameserver.data.xml.NpcData;
- +import net.sf.l2j.gameserver.model.actor.Npc;
- +import net.sf.l2j.gameserver.model.actor.Player;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +import net.sf.l2j.gameserver.scripting.Quest;
- +
- +/**
- + * @author BaggosPC
- + *
- + */
- +public class GrandbossInfo extends Quest
- +{
- + protected static final CLogger LOGGER = new CLogger(GrandbossInfo.class.getName());
- +
- + private static final int[] NPCs =
- + {
- + 31729,
- + 31730,
- + 31731,
- + 31732,
- + 31733,
- + 31734,
- + 31735,
- + 31736,
- + 31737,
- + 31738,
- + 31775,
- + 31776,
- + 31777,
- + 31778,
- + 31779,
- + 31780,
- + 31781,
- + 31782,
- + 31783,
- + 31784,
- + 31785,
- + 31786,
- + 31787,
- + 31788,
- + 31789,
- + 31790,
- + 31791,
- + 31792,
- + 31793,
- + 31794,
- + 31795,
- + 31796,
- + 31797,
- + 31798,
- + 31799,
- + 31800,
- + 31801,
- + 31802,
- + 31803,
- + 31804,
- + 31805,
- + 31806,
- + 31807,
- + 31808,
- + 31809,
- + 31810,
- + 31811,
- + 31812,
- + 31813,
- + 31814,
- + 31815,
- + 31816,
- + 31817,
- + 31818,
- + 31819,
- + 31820,
- + 31821,
- + 31822,
- + 31823,
- + 31824,
- + 31825,
- + 31826,
- + 31827,
- + 31828,
- + 31829,
- + 31830,
- + 31831,
- + 31832,
- + 31833,
- + 31834,
- + 31835,
- + 31836,
- + 31837,
- + 31838,
- + 31839,
- + 31840,
- + 31841,
- + };
- +
- + public GrandbossInfo()
- + {
- + super(-1, "feature");
- +
- + addTalkId(NPCs);
- + }
- +
- + @Override
- + public String onAdvEvent(String event, Npc npc, Player cha)
- + {
- + // Location of Grandboss to Observe the battle.
- + if (event.equalsIgnoreCase("antharas"))
- + cha.enterObserverMode(178040, 115048, -7704);
- + else if (event.equalsIgnoreCase("valakas"))
- + cha.enterObserverMode(212808, -114152, -1632);
- +
- + if (!StringUtil.isDigit(event))
- + return event;
- +
- + var filename = "data/html/script/feature/GrandbossInfo/" + npc.getNpcId() + ".htm";
- + var grandId = Integer.parseInt(event);
- + var BossStatus = GrandBossManager.getInstance().getBossStatus(grandId);
- + var npcData = NpcData.getInstance().getTemplate(grandId);
- + var trigger = GrandBossManager.getInstance().getBossTrigger(grandId);
- +
- + switch (BossStatus)
- + {
- + case 0:
- + var str = new StringTokenizer(event, " ");
- + str.nextToken();
- + var page = str.hasMoreTokens() ? Integer.parseInt(str.nextToken()) : 1;
- +
- + RaidbossInfo.sendDropInfos(cha, grandId, page);
- + }
- + switch (npcData.getNpcId())
- + {
- + case 29006:
- + case 29014:
- + case 29001:
- + case 29022: // Case of Queen/Core/Orfen/Zaken
- + if (BossStatus == 1)
- + sendHTM(cha, npc, grandId);
- + break;
- + case 29020: // Case of Baium
- + if (BossStatus == 2)
- + sendHTM(cha, npc, grandId);
- + break;
- + case 29019:
- + case 29028: // Case of Antharas/Valakas
- + var htm = new NpcHtmlMessage(0);
- + switch (BossStatus)
- + {
- + case 1:
- + filename = "data/html/script/feature/GrandbossInfo/trigger.htm";
- + htm.setFile(filename);
- + htm.replace("%trigger%", "<font color=\"FF9900\">" + new SimpleDateFormat("HH:mm").format(trigger) + ".</font>");
- + cha.sendPacket(htm);
- + break;
- + case 2:
- + filename = "data/html/script/feature/GrandbossInfo/watch.htm";
- + htm.setFile(filename);
- + cha.sendPacket(htm);
- + break;
- + case 3:
- + sendHTM(cha, npc, grandId);
- + break;
- + }
- + break;
- + }
- + return null;
- + }
- +
- + private static void sendHTM(Player cha, Npc npc, int id)
- + {
- + var npcData = NpcData.getInstance().getTemplate(id);
- + var info = GrandBossManager.getInstance().getStatSet(id);
- + var temp = info.getLong("respawn_time");
- + var htm = new NpcHtmlMessage(0);
- +
- + htm.setFile("data/html/script/feature/GrandbossInfo/dead.htm");
- + htm.replace("%name%", npcData.getName());
- + htm.replace("%refresh%", "<font color=\"FF9900\">" + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(temp) + ".</font>");
- + cha.sendPacket(htm);
- + }
- +
- + @Override
- + public String onTalk(Npc npc, Player player)
- + {
- + return "info.htm";
- + }
- +}
- \ No newline at end of file
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/RaidbossInfo.java b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/RaidbossInfo.java
- index d960e08..b562fdf 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/RaidbossInfo.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/feature/RaidbossInfo.java
- @@ -1,15 +1,27 @@
- package net.sf.l2j.gameserver.scripting.script.feature;
- +import java.text.DecimalFormat;
- +import java.text.SimpleDateFormat;
- import java.util.HashMap;
- +import java.util.List;
- import java.util.Map;
- +import java.util.StringTokenizer;
- import net.sf.l2j.commons.lang.StringUtil;
- +import net.sf.l2j.commons.math.MathUtil;
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.data.manager.RaidBossManager;
- import net.sf.l2j.gameserver.data.sql.SpawnTable;
- +import net.sf.l2j.gameserver.data.xml.IconData;
- +import net.sf.l2j.gameserver.data.xml.ItemData;
- +import net.sf.l2j.gameserver.data.xml.NpcData;
- import net.sf.l2j.gameserver.model.actor.Npc;
- import net.sf.l2j.gameserver.model.actor.Player;
- +import net.sf.l2j.gameserver.model.item.DropData;
- import net.sf.l2j.gameserver.model.location.Location;
- import net.sf.l2j.gameserver.model.spawn.Spawn;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- import net.sf.l2j.gameserver.scripting.Quest;
- public class RaidbossInfo extends Quest
- @@ -119,13 +131,113 @@
- if (!StringUtil.isDigit(event))
- return event;
- - final Location loc = RADARS.get(Integer.parseInt(event));
- - if (loc != null)
- - player.getRadarList().addMarker(loc);
- + var rbid = Integer.parseInt(event);
- + var filename = "data/html/script/feature/RaidbossInfo/" + npc.getNpcId() + ".htm";
- + var npcData = NpcData.getInstance().getTemplate(rbid);
- + var boss = RaidBossManager.getInstance().getBossSpawn(rbid);
- + var time = RaidBossManager.getInstance().getRespawntime(rbid);
- + var htm = new NpcHtmlMessage(0);
- + // filename = ((boss.getStatus() == BossStatus.ALIVE) ? "data/html/scripts/custom/RaidbossInfo/alive.htm" : "data/html/scripts/custom/RaidbossInfo/dead.htm");
- + switch (boss.getStatus())
- + {
- + case ALIVE:
- + var loc = RADARS.get(Integer.parseInt(event));
- + if (loc != null)
- + player.getRadarList().addMarker(loc);
- +
- +
- + var str = new StringTokenizer(event, " ");
- + str.nextToken();
- + var page = str.hasMoreTokens() ? Integer.parseInt(str.nextToken()) : 1;
- +
- + sendDropInfos(player, rbid, page);
- + break;
- + case DEAD:
- + filename = "data/html/script/feature/RaidbossInfo/dead.htm";
- + htm.setFile(filename);
- + htm.replace("%name%", npcData.getName());
- + htm.replace("%refresh%", "<font color=\"FF9900\">" + new SimpleDateFormat("dd-MM-yyyy HH:mm").format(time) + ".</font>");
- + player.sendPacket(htm);
- + break;
- + }
- return null;
- }
- + public static void sendDropInfos(Player player, int npcId, int page)
- + {
- + var npcData = NpcData.getInstance().getTemplate(npcId);
- + List<DropData> list = npcData.getAllDropData();
- + var PAGE_LIMIT = 7;
- +
- + if (list.isEmpty())
- + {
- + player.sendMessage("Boss " + npcData.getName() + " has no drop.");
- + return;
- + }
- +
- + var max = MathUtil.countPagesNumber(list.size(), PAGE_LIMIT);
- + if (page > max)
- + page = max;
- +
- + list = list.subList((page - 1) * PAGE_LIMIT, Math.min(page * PAGE_LIMIT, list.size()));
- +
- + var sb = new StringBuilder(2000);
- + StringUtil.append(sb, "<html><title>Boss ", npcData.getName(), "</title><body><center><font color=\"LEVEL\">Boss Monster ", npcData.getName(), " is alive!</font></center><br>");
- +
- + var row = 0;
- + for (DropData drop : list)
- + {
- + sb.append(((row % 2) == 0 ? "<table width=\"280\" bgcolor=\"000000\"><tr>" : "<table width=\"280\"><tr>"));
- +
- + var chance = Math.min(100, (((drop.getItemId() == 57) ? drop.getChance() * Config.RATE_DROP_ADENA : drop.getChance() * Config.RATE_DROP_ITEMS_BY_RAID) / 10000));
- + var item = ItemData.getInstance().getTemplate(drop.getItemId());
- +
- + String format;
- + if (chance <= 0.001 || chance <= 0.01)
- + {
- + var df = new DecimalFormat(chance <= 0.001 ? "#.####" : "#.###");
- + format = df.format(chance);
- + }
- + else
- + {
- + var df = new DecimalFormat("##.##");
- + format = df.format(chance);
- + }
- +
- + String name = item.getName();
- + if (name.length() >= 45)
- + name = name.substring(0, 42) + "...";
- +
- + StringUtil.append(sb, "<td width=44 height=41 align=center><table bgcolor=" + ("3BB9FF") + " cellpadding=6 cellspacing=\"-5\"><tr><td><button width=32 height=32 back=" + IconData.getIcon(drop.getItemId()) + " fore=" + IconData.getIcon(drop.getItemId()) + "></td></tr></table></td>");
- + StringUtil.append(sb, "<td width=246 height=34>", name, "<br1><font color=B09878>", "Drop", ": ", format, "% Min: ", drop.getMinDrop(), " Max: ", drop.getMaxDrop(), "</font></td>");
- +
- + sb.append("</tr></table><img src=\"L2UI.SquareGray\" width=277 height=1>");
- + row++;
- + }
- +
- + // Build page footer.
- + sb.append("<br><img src=\"L2UI.SquareGray\" width=277 height=1><table width=\"100%\" bgcolor=000000><tr>");
- +
- + if (page > 1)
- + StringUtil.append(sb, "<td align=left width=70><a action=\"bypass droplist ", npcId, " ", page - 1, "\">Previous</a></td>");
- + else
- + StringUtil.append(sb, "<td align=left width=70>Previous</td>");
- +
- + StringUtil.append(sb, "<td align=center width=100>Page ", page, "</td>");
- +
- + if (page < max)
- + StringUtil.append(sb, "<td align=right width=70><a action=\"bypass droplist ", npcId, " ", page + 1, "\">Next</a></td>");
- + else
- + StringUtil.append(sb, "<td align=right width=70>Next</td>");
- +
- + sb.append("</tr></table><img src=\"L2UI.SquareGray\" width=277 height=1>");
- + sb.append("</body></html>");
- + var html = new NpcHtmlMessage(0);
- + html.setHtml(sb.toString());
- + player.sendPacket(html);
- + }
- +
- @Override
- public String onTalk(Npc npc, Player player)
- {
- diff --git a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/teleport/GrandBossTeleporter.java b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/teleport/GrandBossTeleporter.java
- index cee8e32..60f7da2 100644
- --- a/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/teleport/GrandBossTeleporter.java
- +++ b/aCis_gameserver/java/net/sf/l2j/gameserver/scripting/script/teleport/GrandBossTeleporter.java
- @@ -161,6 +161,10 @@
- if (status == Antharas.DORMANT)
- {
- + var trigger = Config.WAIT_TIME_ANTHARAS;
- + var Time = System.currentTimeMillis() + (trigger);
- +
- + GrandBossManager.getInstance().setBossTrigger(Antharas.ANTHARAS, Time);
- GrandBossManager.getInstance().setBossStatus(Antharas.ANTHARAS, Antharas.WAITING);
- ScriptData.getInstance().getQuest("Antharas").startQuestTimer("beginning", null, null, Config.WAIT_TIME_ANTHARAS);
- }
- @@ -191,6 +195,10 @@
- if (status == Valakas.DORMANT)
- {
- + var trigger = Config.WAIT_TIME_ANTHARAS;
- + var Time = System.currentTimeMillis() + (trigger);
- +
- + GrandBossManager.getInstance().setBossTrigger(Valakas.VALAKAS, Time);
- GrandBossManager.getInstance().setBossStatus(Valakas.VALAKAS, Valakas.WAITING);
- ScriptData.getInstance().getQuest("Valakas").startQuestTimer("beginning", null, null, Config.WAIT_TIME_VALAKAS);
- }
- diff --git a/aCis_datapack/data/html/adventurer_guildsman/31805.htm b/aCis_datapack/data/html/adventurer_guildsman/31805.htm
- index b3f851f..d997037 100644
- --- a/aCis_datapack/data/html/adventurer_guildsman/31805.htm
- +++ b/aCis_datapack/data/html/adventurer_guildsman/31805.htm
- @@ -1,8 +1,11 @@
- -<html><body>Adventure Guildsman:<br>
- +<html>
- +<title>Adventure Guildsman</title>
- +<body>Adventure Guildsman:<br>
- The world is a dark and scary place, my friend! If everyone would only follow the teachings of Eve and Einhasad, this chaos would finally end!<br>
- What's needed is brave warrior like you stand up for the down-trodden, to restore peace and justice to the world! are you up to the task?<br>
- <a action="bypass -h npc_%objectId%_questlist">Quest Information</a><br>
- -<a action="bypass -h npc_%objectId%_Quest RaidbossInfo">Raid Monster Information</a><br>
- +<a action="bypass -h npc_%objectId%_Quest RaidbossInfo">Boss Monster Information</a><br>
- +<a action="bypass -h npc_%objectId%_Quest GrandbossInfo">Grand Monster Information</a><br>
- <a action="bypass -h npc_%objectId%_Chat 1">Use Life Crystals</a><br>
- <a action="bypass -h npc_%objectId%_Quest">Quest</a>
- </body></html>
- diff --git a/aCis_datapack/data/html/script/feature/GrandbossInfo/dead.htm b/aCis_datapack/data/html/script/feature/GrandbossInfo/dead.htm
- new file mode 100644
- index 0000000..66306e2
- --- /dev/null
- +++ b/aCis_datapack/data/html/script/feature/GrandbossInfo/dead.htm
- @@ -0,0 +1,6 @@
- +<html>
- +<title>Boss Manager</title>
- +<body>
- +Hello Traveler,<br>
- +Raidboss %name% is dead! Next respawn at: %refresh%<br>
- +</body></html>
- \ No newline at end of file
- diff --git a/aCis_datapack/data/html/script/feature/GrandbossInfo/info.htm b/aCis_datapack/data/html/script/feature/GrandbossInfo/info.htm
- new file mode 100644
- index 0000000..2837e67
- --- /dev/null
- +++ b/aCis_datapack/data/html/script/feature/GrandbossInfo/info.htm
- @@ -0,0 +1,12 @@
- +<html>
- +<title>Boss Manager</title>
- +<body>Grandbosses Information:<br>
- +<a action="bypass -h Quest GrandbossInfo 29001">Queent Ant (lv40)</a><br>
- +<a action="bypass -h Quest GrandbossInfo 29006">Core (lv50)</a><br>
- +<a action="bypass -h Quest GrandbossInfo 29014">Orfen (lv50)</a><br>
- +<a action="bypass -h Quest GrandbossInfo 29022">Zaken (lv60)</a><br>
- +<a action="bypass -h Quest GrandbossInfo 29020">Baium (lv78)</a><br>
- +<a action="bypass -h Quest GrandbossInfo 29019">Antharas (lv79)</a><br>
- +<a action="bypass -h Quest GrandbossInfo 29047">Scarlet van Halisha (lv80)</a><br>
- +<a action="bypass -h Quest GrandbossInfo 29028">Valakas (lv85)</a><br>
- +</body></html>
- diff --git a/aCis_datapack/data/html/script/feature/GrandbossInfo/trigger.htm b/aCis_datapack/data/html/script/feature/GrandbossInfo/trigger.htm
- new file mode 100644
- index 0000000..5fdcb84
- --- /dev/null
- +++ b/aCis_datapack/data/html/script/feature/GrandbossInfo/trigger.htm
- @@ -0,0 +1,8 @@
- +<html>
- +<title>Boss Manager</title>
- +<body>
- +Hello Traveler, you came at the right time!<br>
- +Someone has entered, Grandboss its about to spawn soon!<br>
- +Entry closes at %trigger%
- +<br>When the battle begin, you will be able to watch the players killing the Grandboss.
- +</body></html>
- \ No newline at end of file
- diff --git a/aCis_datapack/data/html/script/feature/GrandbossInfo/watch.htm b/aCis_datapack/data/html/script/feature/GrandbossInfo/watch.htm
- new file mode 100644
- index 0000000..71c0af2
- --- /dev/null
- +++ b/aCis_datapack/data/html/script/feature/GrandbossInfo/watch.htm
- @@ -0,0 +1,7 @@
- +<html>
- +<title>Boss Manager</title>
- +<body>
- +Hello Traveler,<br>
- +The Grandboss is engaged in battle! You can now watch other players killing it.<br>
- +<a action="bypass -h Quest GrandbossInfo antharas">Watch the battle.</a><br>
- +</body></html>
- \ No newline at end of file
- diff --git a/aCis_datapack/data/html/script/feature/RaidbossInfo/dead.htm b/aCis_datapack/data/html/script/feature/RaidbossInfo/dead.htm
- new file mode 100644
- index 0000000..66306e2
- --- /dev/null
- +++ b/aCis_datapack/data/html/script/feature/RaidbossInfo/dead.htm
- @@ -0,0 +1,6 @@
- +<html>
- +<title>Boss Manager</title>
- +<body>
- +Hello Traveler,<br>
- +Raidboss %name% is dead! Next respawn at: %refresh%<br>
- +</body></html>
- \ No newline at end of file
- diff --git a/aCis_datapack/data/html/script/feature/RaidbossInfo/info.htm b/aCis_datapack/data/html/script/feature/RaidbossInfo/info.htm
- index d923869..f785131 100644
- --- a/aCis_datapack/data/html/script/feature/RaidbossInfo/info.htm
- +++ b/aCis_datapack/data/html/script/feature/RaidbossInfo/info.htm
- @@ -1,9 +1,11 @@
- -<html><body>Raid Monster Information:<br>
- +<html>
- +<title>Boss Manager</title>
- +<body>Raid Monster Information:<br>
- <a action="bypass -h Quest RaidbossInfo level20.htm">Level 20 Raid Monsters</a><br>
- <a action="bypass -h Quest RaidbossInfo level30.htm">Level 30 Raid Monsters</a><br>
- <a action="bypass -h Quest RaidbossInfo level40.htm">Level 40 Raid Monsters</a><br>
- <a action="bypass -h Quest RaidbossInfo level50.htm">Level 50 Raid Monsters</a><br>
- <a action="bypass -h Quest RaidbossInfo level60.htm">Level 60 Raid Monsters</a><br>
- <a action="bypass -h Quest RaidbossInfo level70.htm">Level 70 Raid Monsters</a><br>
- -<a action="bypass -h Quest RaidbossInfo level80.htm">Level 80 Raid Monsters</a>
- +<a action="bypass -h Quest RaidbossInfo level80.htm">Level 80 Raid Monsters</a><br>
- </body></html>
- \ No newline at end of file
- diff --git a/aCis_datapack/data/xml/scripts.xml b/aCis_datapack/data/xml/scripts.xml
- index 3e38b21..a24ef1a 100644
- --- a/aCis_datapack/data/xml/scripts.xml
- +++ b/aCis_datapack/data/xml/scripts.xml
- @@ -402,6 +402,7 @@
- <script path="script.feature.Clan"/>
- <script path="script.feature.EchoCrystal"/>
- <script path="script.feature.FirstClassChange"/>
- + <script path="script.feature.GrandbossInfo"/>
- <script path="script.feature.HeroCirclet"/>
- <script path="script.feature.HeroWeapon"/>
- <script path="script.feature.KetraOrcSupport"/>
Add Comment
Please, Sign In to add comment