Disable Dark Lord on 99b and Other Versions

Results 1 to 2 of 2
  1. #1
    Member Imma is offline
    MemberRank
    Sep 2008 Join Date
    LondonLocation
    66Posts

    wink Disable Dark Lord on 99b and Other Versions

    Full credits go to: anhnga
    (script is not by me, I just found it hidden on the forum)

    Open your Enterprise Manager, select the MuOnline database, at the top of your screen go to Tools -> SQL Query Analyzer and copy and paste the following:

    USE MuOnline
    IF EXISTS (SELECT Name FROM sysobjects
    WHERE name = 'DarkLordPreserve' AND type = 'TR')
    DROP TRIGGER DarkLordPreserve
    GO

    CREATE TRIGGER DarkLordPreserve ON Character INSTEAD OF INSERT
    AS
    BEGIN
    DECLARE
    @CharnameExist varchar(10),
    @MaxCharLevel smallint,
    @InsAccountID varchar(10),
    @InsName nvarchar(50),
    @InscLevel smallint,
    @InsLevelUpPoint int,
    @InsClass tinyint,
    @InsExperience int,
    @InsStrength smallint,
    @InsDexterity smallint,
    @InsVitality smallint,
    @InsEnergy smallint,
    @InsMoney int,
    @InsLife real,
    @InsMaxLife real,
    @InsMana real,
    @InsMaxMana real,
    @InsMapNumber smallint,
    @InsMapPosX smallint,
    @InsMapPosY smallint,
    @InsMapDir tinyint,
    @InsMDate smalldatetime,
    @InsLDate smalldatetime,
    @InsDbVersion tinyint

    SELECT
    @InsAccountID = AccountID,
    @InsName = Name,
    @InscLevel = cLevel,
    @InsLevelUpPoint = LevelUpPoint,
    @InsClass = Class,
    @InsExperience = Experience,
    @InsStrength = Strength,
    @InsDexterity = Dexterity,
    @InsVitality = Vitality,
    @InsEnergy = Energy,
    @InsMoney = Money,
    @InsLife = Life,
    @InsMaxLife = MaxLife,
    @InsMana = Mana,
    @InsMaxMana = MaxMana,
    @InsMapNumber = MapNumber,
    @InsMapPosX = MapPosX,
    @InsMapPosY = MapPosY,
    @InsMapDir = MapDir,
    @InsMDate = MDate,
    @InsLDate = LDate,
    @InsDbVersion = DbVersion
    FROM inserted


    -- Find Max Level
    SELECT @MaxCharLevel = MAX(cLevel) FROM Character WHERE (AccountId = @InsAccountID)

    -- Get one Random Character Name from DB
    SELECT TOP 1 @CharnameExist = Name FROM Character

    -- Put DarkLord Class Number Here
    IF (@InsClass = 64)
    BEGIN
    -- Put desired minimum level of character that has to exist here
    IF (@MaxCharLevel < 300)
    BEGIN
    SET @InsName = @CharnameExist
    END
    IF (@MaxCharLevel IS NULL)
    BEGIN
    SET @InsName = @CharnameExist
    END
    END

    -- Insert the Query
    INSERT INTO Character
    (
    AccountID, Name, cLevel, LevelUpPoint, Class, Experience, Strength, Dexterity, Vitality, Energy,
    Money, Life, MaxLife, Mana, MaxMana, MapNumber, MapPosX, MapPosY, MapDir, MDate,LDate,DbVersion
    )
    VALUES
    (
    @InsAccountID, @InsName, @InscLevel, @InsLevelUpPoint, @InsClass, @InsExperience,
    @InsStrength, @InsDexterity, @InsVitality, @InsEnergy, @InsMoney, @InsLife, @InsMaxLife,
    @InsMana, @InsMaxMana, @InsMapNumber, @InsMapPosX, @InsMapPosY, @InsMapDir, @InsMDate, @InsLDate, @InsDbVersion
    )
    END
    This script works well for those who don't have the WZ_CreateCharacter stored procedure (like me!)

    300 - change this to the minimum level you want players to have before they can create a DL.

    Thanks to anhnga for this awesome script!
    Last edited by Imma; 21-01-10 at 08:16 PM.


  2. #2
    Enthusiast speakeris is offline
    MemberRank
    Oct 2009 Join Date
    45Posts

    Re: Disable Dark Lord on 99b and Other Versions

    10/10 But i dont heve 99b :D



Advertisement