• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[SQL Script] Mothership War on Saturdays and Sundays (Declaration of War)

[emoji848]
Legend
Joined
Dec 3, 2011
Messages
2,232
Reaction score
1,518
A while ago I rewrote the old script posted by PanKJ here to reset the Declaration of War table to my needs (I personally hate doing this via the Admin Tool). So I came up with a script that sets the MS summon times on Saturday for BCU and Sunday for ANI (20:00 Server time). The Attack MS, ofc.

The script should be compatible with all episodes that are EP3+ as the MS system was not reworked ever since. Put it in your SQL Management Studio, press F5, you're done.

Code:
USE atum2_db_1
GO

DROP TABLE dbo.td_DeclarationOfWar
CREATE TABLE dbo.td_DeclarationOfWar (
	Influence				TINYINT,
	MSWarStep				TINYINT,
	NCP						INT,
	MSNum               	INT,
	MSAppearanceMap     	INT,
	MSWarStepStartTime  	datetime,	
	MSWarStepEndTime		datetime,
	MSWarStartTime			datetime,	
	MSWarEndTime			datetime,
	SelectCount				TINYINT,
	GiveUp					BIT,
	MSWarEndState			TINYINT
)
CREATE UNIQUE CLUSTERED INDEX idx_on_DeclarationOfWar ON td_DeclarationOfWar(Influence, MSWarStep)
GO

-- Get 20:00 as start time on the current date
DECLARE @hourStartTime DATETIME = (SELECT DATEADD(hh, 20, DATEADD(dd, DATEDIFF(dd, -2, GETDATE()), 0)))
-- Get next saturday at that time
DECLARE  [USER=2000122825]last[/USER]Saturday DATETIME = (SELECT DATEADD(day, -2 - (DATEPART(dw, @hourStartTime) + @@DATEFIRST - 2) % 7, @hourStartTime))
-- Get next sunday
DECLARE  [USER=2000122825]last[/USER]Sunday DATETIME = (SELECT DATEADD(day, 1,  [USER=2000122825]last[/USER]Saturday))

INSERT INTO dbo.td_DeclarationOfWar (Influence, MSWarStep, NCP, MSNum, MSAppearanceMap, MSWarStepStartTime, MSWarStepEndTime
										, MSWarStartTime, MSWarEndTime, SelectCount, GiveUp, MSWarEndState)
VALUES
	-- BCU
	 (2, 1, 0, 0, 0, DateAdd(day, -5,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, -2,  [USER=2000122825]last[/USER]Saturday),  [USER=2000122825]last[/USER]Saturday, NULL, 3, 0, 0)
	,(2, 2, 0, 0, 0, DateAdd(day, 2,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 5,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 7,  [USER=2000122825]last[/USER]Saturday), NULL, 3, 0, 0)
	,(2, 3, 0, 0, 0, DateAdd(day, 9,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 12,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 14,  [USER=2000122825]last[/USER]Saturday), NULL, 3, 0, 0)
	,(2, 4, 0, 0, 0, DateAdd(day, 16,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 19,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 21,  [USER=2000122825]last[/USER]Saturday), NULL, 3, 0, 0)
	,(2, 5, 0, 0, 0, DateAdd(day, 23,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 26,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 28,  [USER=2000122825]last[/USER]Saturday), NULL, 3, 0, 0)
	,(2, 99, 0, 0, 0, DateAdd(day, 30,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 33,  [USER=2000122825]last[/USER]Saturday), DateAdd(day, 35,  [USER=2000122825]last[/USER]Saturday), NULL, 3, 0, 0)

	-- ANI
	,(4, 1, 0, 0, 0, DateAdd(day, -5,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, -2,  [USER=2000122825]last[/USER]Sunday),  [USER=2000122825]last[/USER]Sunday, NULL, 3, 0, 0)
	,(4, 2, 0, 0, 0, DateAdd(day, 2,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 5,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 7,  [USER=2000122825]last[/USER]Sunday), NULL, 3, 0, 0)
	,(4, 3, 0, 0, 0, DateAdd(day, 9,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 12,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 14,  [USER=2000122825]last[/USER]Sunday), NULL, 3, 0, 0)
	,(4, 4, 0, 0, 0, DateAdd(day, 16,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 19,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 21,  [USER=2000122825]last[/USER]Sunday), NULL, 3, 0, 0)
	,(4, 5, 0, 0, 0, DateAdd(day, 23,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 26,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 28,  [USER=2000122825]last[/USER]Sunday), NULL, 3, 0, 0)
	,(4, 99, 0, 0, 0, DateAdd(day, 30,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 33,  [USER=2000122825]last[/USER]Sunday), DateAdd(day, 35,  [USER=2000122825]last[/USER]Sunday), NULL, 3, 0, 0)
GO

With a bit of SQL knowledge you can easily change the Nations or Times around to fit your needs.

As always, feedback is welcome, but pls no one-liners just saying thanks or smth (there is a like button)
Have fun
 
Last edited: