[Guide] Locking your DL creation and remove DL chars from DB

View previous topic View next topic Go down

[Guide] Locking your DL creation and remove DL chars from DB

Post by  on Sun Dec 23, 2007 1:11 pm

o lock Darklord creation in your server do this:


Quote:

CREATE TRIGGER [prevent_DL] ON [dbo].[Character]
FOR INSERT
AS
--declarations of variables
DECLARE @Acc varchar(10), @Max INT, @Min INT
SET @Min = 250 --replace this with your desired minimun level

--cursor with the inserted records (can be many)
DECLARE LISTA CURSOR LOCAL FOR
SELECT AccountID FROM INSERTED
WHERE (Class=64)
OPEN LISTA
FETCH NEXT FROM LISTA INTO @Acc
WHILE @@FETCH_STATUS = 0
BEGIN
--here we get the max level reached for every character on the same account
SET @Max = (SELECT MAX(cLevel) FROM [Character] WHERE (AccountID=@Acc))
IF (@Max < @Min) --if his max level is less than our minimun requiered: KILL!!!!
BEGIN
ROLLBACK TRANSACTION
END
FETCH NEXT FROM LISTA INTO @Acc
END
--gracefully ending the procedure
CLOSE LISTA
DEALLOCATE LISTA


To do:
Open SQL Query Analyzer, login as usual and select MuOnline Database.
Copy the code {above** and paste it on the query window and execute it
(push the play button)
and it should add the script in your MuOnline Database. Save and close the file.

To clear your Database with Darklord characters without deleting accounts and keeping stats do this:
Open SQL Query Analyzer, login as usual and select MuOnline Database. On the query window copy paste this code:


Quote:

update character
set class = ('16')
where clevel < 250 and class = '64'


where
clevel is the level required to create Darklord. After pasting the code
click the play button and see if there are no errors. If all is well
then all the darklord characters on your db are transformed to dark
knights!

Good Luck! ciao!


Favourite Game : MuOnline
Registration date : 1969-12-31

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum