Moved announcements to SQL.

This commit is contained in:
MobiusDevelopment
2021-04-24 12:49:26 +00:00
parent 0b60bf915e
commit e43087f9cd
82 changed files with 2014 additions and 1928 deletions

View File

@@ -0,0 +1,14 @@
CREATE TABLE IF NOT EXISTS `announcements` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` int(11) NOT NULL,
`initial` bigint(20) NOT NULL DEFAULT 0,
`delay` bigint(20) NOT NULL DEFAULT 0,
`repeat` int(11) NOT NULL DEFAULT 0,
`author` text NOT NULL,
`content` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO announcements (`type`, `author`, `content`) VALUES
(0, 'L2jMobius', 'Thanks for using L2jMobius!'),
(0, 'L2jMobius', 'http://www.l2jmobius.org');

View File

@@ -1,9 +0,0 @@
-- --------------------------------------
-- Table structure for auto_announcements
-- --------------------------------------
CREATE TABLE IF NOT EXISTS `auto_announcements` (
`id` int(11) NOT NULL auto_increment,
`announcement` varchar(255) NOT NULL,
`delay` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

View File

@@ -1,2 +0,0 @@
Thanks for using L2jMobius!
http://www.l2jmobius.org

View File

@@ -7,12 +7,9 @@
<center>Write the message of the announcement.</center>
<center><multiedit var="new_announcement" width=240 height=30></center><br>
<center><table><tr>
<td><button value="Add" action="bypass -h admin_add_announcement $new_announcement" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"></td>
<td><button value="Announce" action="bypass -h admin_announce_menu $new_announcement" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"></td>
<td><button value="Reload" action="bypass -h admin_announce_announcements" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"></td>
</tr>
<tr>
<td align="center"><button value="Auto Ann." action="bypass -h admin_autoannounce $menu_command" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"></td>
<td><button value="Auto" action="bypass -h admin_autoannounce $menu_command" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"></td>
<td><button value="Add" action="bypass -h admin_add_announcement $new_announcement" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"></td>
</tr>
</table></center>
%announces%

View File

@@ -0,0 +1,19 @@
<html><body>
<table width=260><tr>
<td width=40><button value="Main" action="bypass -h admin_admin" width=40 height=15 back="sek.cbui94" fore="sek.cbui92"></td>
<td width=180><center>Auto Announcements Menu</center></td>
<td width=40><button value="Back" action="bypass -h admin_admin" width=40 height=15 back="sek.cbui94" fore="sek.cbui92"></td></tr>
</table><br><br>
<center>Write the message of the announcement.</center>
<center><multiedit var="new_announcement" width=240 height=30><br><br>
Delay (in seconds) <edit var="delay" width=70><br>
Minimum time is 30 seconds.<br1>
<br><br>
<table><tr>
<td><button value="Auto" action="bypass -h admin_autoannounce $menu_command" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"></td>
<td><button value="Announce" action="bypass -h admin_announce_menu $new_announcement" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"></td>
<td><button value="Add" action="bypass -h admin_add_autoannouncement $delay $new_announcement" width=75 height=21 back="L2UI_ch3.Btn1_normalOn" fore="L2UI_ch3.Btn1_normal"></td>
</tr>
</table></center>
%announces%
</body></html>

View File

@@ -29,8 +29,8 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.Announcements;
import org.l2jmobius.gameserver.data.SkillTable;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
import org.l2jmobius.gameserver.geoengine.GeoEngine;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.Effect;
@@ -130,7 +130,7 @@ public class Baium extends Quest
addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss Baium Stone spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss Baium Stone spawned in world.");
}
GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP);
}
@@ -146,7 +146,7 @@ public class Baium extends Quest
final GrandBossInstance baium = (GrandBossInstance) addSpawn(LIVE_BAIUM, loc_x, loc_y, loc_z, heading, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + baium.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + baium.getName() + " spawned in world.");
}
GrandBossManager.getInstance().addBoss(baium);
ThreadPool.schedule(() ->
@@ -170,7 +170,7 @@ public class Baium extends Quest
addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss Baium Stone spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss Baium Stone spawned in world.");
}
}
}
@@ -184,7 +184,7 @@ public class Baium extends Quest
addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss Baium Stone spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss Baium Stone spawned in world.");
}
}
else if (event.equals("skill_range") && (npc != null))

View File

@@ -25,7 +25,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.Announcements;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
import org.l2jmobius.gameserver.enums.ChatType;
import org.l2jmobius.gameserver.instancemanager.GlobalVariablesManager;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
@@ -118,7 +118,7 @@ public class Core extends Quest
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + core.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + core.getName() + " spawned in world.");
}
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
spawnBoss(core);
@@ -133,7 +133,7 @@ public class Core extends Quest
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + core.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + core.getName() + " spawned in world.");
}
spawnBoss(core);
}
@@ -169,7 +169,7 @@ public class Core extends Quest
final GrandBossInstance core = (GrandBossInstance) addSpawn(CORE, 17726, 108915, -6480, 0, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + core.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + core.getName() + " spawned in world.");
}
GrandBossManager.getInstance().setBossStatus(CORE, ALIVE);
spawnBoss(core);

View File

@@ -20,8 +20,8 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.Announcements;
import org.l2jmobius.gameserver.data.SkillTable;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.instance.GrandBossInstance;
@@ -76,7 +76,7 @@ public class Orfen extends Quest
_orfen = (GrandBossInstance) addSpawn(ORFEN, 55024, 17368, -5412, 0, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
}
GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
GrandBossManager.getInstance().addBoss(_orfen);
@@ -97,7 +97,7 @@ public class Orfen extends Quest
_orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
}
GrandBossManager.getInstance().addBoss(_orfen);
_orfen.setCurrentHpMp(hp, mp);
@@ -112,7 +112,7 @@ public class Orfen extends Quest
_orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
}
GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
GrandBossManager.getInstance().addBoss(_orfen);
@@ -137,7 +137,7 @@ public class Orfen extends Quest
_orfen = (GrandBossInstance) addSpawn(ORFEN, loc_x, loc_y, loc_z, heading, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + _orfen.getName() + " spawned in world.");
}
GrandBossManager.getInstance().setBossStatus(ORFEN, LIVE);
GrandBossManager.getInstance().addBoss(_orfen);

View File

@@ -23,8 +23,8 @@ import org.l2jmobius.Config;
import org.l2jmobius.commons.util.Chronos;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.ai.CtrlIntention;
import org.l2jmobius.gameserver.data.Announcements;
import org.l2jmobius.gameserver.data.SkillTable;
import org.l2jmobius.gameserver.data.sql.AnnouncementsTable;
import org.l2jmobius.gameserver.instancemanager.GrandBossManager;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.actor.Attackable;
@@ -109,7 +109,7 @@ public class QueenAnt extends Quest
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
}
GrandBossManager.getInstance().setBossStatus(QUEEN, LIVE);
GrandBossManager.getInstance().addBoss(queen);
@@ -127,7 +127,7 @@ public class QueenAnt extends Quest
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
}
GrandBossManager.getInstance().addBoss(queen);
queen.setCurrentHpMp(hp, mp);
@@ -139,7 +139,7 @@ public class QueenAnt extends Quest
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
}
GrandBossManager.getInstance().setBossStatus(QUEEN, LIVE);
GrandBossManager.getInstance().addBoss(queen);
@@ -175,7 +175,7 @@ public class QueenAnt extends Quest
final GrandBossInstance queen = (GrandBossInstance) addSpawn(QUEEN, -21610, 181594, -5734, 0, false, 0);
if (Config.ANNOUNCE_TO_ALL_SPAWN_RB)
{
Announcements.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
AnnouncementsTable.getInstance().announceToAll("Raid boss " + queen.getName() + " spawned in world.");
}
GrandBossManager.getInstance().setBossStatus(QUEEN, LIVE);
GrandBossManager.getInstance().addBoss(queen);