Noticias:

No tienes permiso para ver los enlaces. Para poder verlos Registrate o Conectate.

Menú Principal

Announce spawn boss

Iniciado por Swarlog, Jul 27, 2025, 12:45 AM

Tema anterior - Siguiente tema

Swarlog

### Eclipse Workspace Patch 1.0
#P L2J_Server_BETA
Index: dist/game/config/L2JMods.properties
===================================================================
--- dist/game/config/L2JMods.properties (revision 6112)
+++ dist/game/config/L2JMods.properties	(working copy)
@@ -68,7 +68,25 @@
 # Default = False
 ChampionEnableInInstances = False
 
+
 # ---------------------------------------------------------------------------
+# Announce boss spawn
+# ---------------------------------------------------------------------------
+
+# Enable/disable announce boss spawn
+# Default = False
+AnnounceBossSpawn = False
+
+# Enable critical announce?
+# True = will be critical announce, False = normal announce
+CriticalAnnounce = False
+
+# Announce message
+# Use %raidboss% for get raidboss name
+AnnounceBossMsg = [Info] Raidboss %raidboss% has been spawned!
+
+
+# ---------------------------------------------------------------------------
 # Wedding System (by evill33t)
 # ---------------------------------------------------------------------------
 # <u><b><font color="red">WARNING: this mod require custom NPC table support turned on !</font></b></u>
Index: java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java
===================================================================
--- java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java	(revision 6112)
+++ java/com/l2jserver/gameserver/instancemanager/RaidBossSpawnManager.java	(working copy)
@@ -32,6 +32,7 @@
 
 import com.l2jserver.Config;
 import com.l2jserver.L2DatabaseFactory;
+import com.l2jserver.gameserver.Announcements;
 import com.l2jserver.gameserver.ThreadPoolManager;
 import com.l2jserver.gameserver.datatables.NpcTable;
 import com.l2jserver.gameserver.datatables.SpawnTable;
@@ -163,6 +164,14 @@
 				
 				_log.info(getClass().getSimpleName() + ": Spawning Raid Boss " + raidboss.getName());
 				
+				if (Config.ANNOUNCE_BOSS_SPAWN)
+				{
+					String msg = "";
+					msg = Config.ANNOUNCE_BOSS_MSG.replaceAll("%raidboss%", raidboss.getName
+					
+					Announcements.getInstance().announceToAll(msg, Config.ANNOUNCE_BOSS_SPAWN_CRIT);
+				}
+				
 				_bosses.put(bossId, raidboss);
 			}
 			
Index: java/com/l2jserver/Config.java
===================================================================
--- java/com/l2jserver/Config.java	(revision 6112)
+++ java/com/l2jserver/Config.java	(working copy)
@@ -683,6 +683,9 @@
 	// --------------------------------------------------
 	// L2JMods Settings
 	// --------------------------------------------------
+	public static boolean ANNOUNCE_BOSS_SPAWN;
+	public static boolean ANNOUNCE_BOSS_SPAWN_CRIT;
+	public static String ANNOUNCE_BOSS_MSG;
 	public static boolean L2JMOD_CHAMPION_ENABLE;
 	public static boolean L2JMOD_CHAMPION_PASSIVE;
 	public static int L2JMOD_CHAMPION_FREQUENCY;
@@ -2425,6 +2428,9 @@
 				_log.log(Level.SEVERE, "Error while loading L2JMod settings!", e);
 			}
 			
+			ANNOUNCE_BOSS_SPAWN = Boolean.parseBoolean(L2JModSettings.getProperty("AnnounceBossSpawn", "false"));
+			ANNOUNCE_BOSS_SPAWN_CRIT = Boolean.parseBoolean(L2JModSettings.getProperty("CriticalAnnounce", "false"));
+			ANNOUNCE_BOSS_MSG = L2JModSettings.getProperty("AnnounceBossMsg", "[Info] Raidboss %raidboss% has been spawned!");
 			L2JMOD_CHAMPION_ENABLE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionEnable", "false"));
 			L2JMOD_CHAMPION_PASSIVE = Boolean.parseBoolean(L2JModSettings.getProperty("ChampionPassive", "false"));
 			L2JMOD_CHAMPION_FREQUENCY = Integer.parseInt(L2JModSettings.getProperty("ChampionFrequency", "0"));