奇迹MU,等级达到150级后自动转职触发器

奇迹MU,等级达到150级后自动转职触发器,非创立角色就直接转职
这样的好处是免除做转职任务,又防止了转生后,1级就可以穿转职后的职业装备

CREATE TRIGGER [自动转职] ON [dbo].[Character]
AFTER UPDATE
AS
BEGIN
    SET NOCOUNT ON;
    UPDATE C
    SET C.Class = 1
    FROM [dbo].[Character] AS C
    INNER JOIN Inserted AS I ON C.accountid = I.accountid AND C.name = I.name
    WHERE I.Class = 0 AND I.clevel >= 150;
    UPDATE C
    SET C.Class = 17
    FROM [dbo].[Character] AS C
    INNER JOIN Inserted AS I ON C.accountid = I.accountid AND C.name = I.name
    WHERE I.Class = 16 AND I.clevel >= 150;
    UPDATE C
    SET C.Class = 33
    FROM [dbo].[Character] AS C
    INNER JOIN Inserted AS I ON C.accountid = I.accountid AND C.name = I.name
    WHERE I.Class = 32 AND I.clevel >= 150;

    SET NOCOUNT OFF;
END;

相关文章

发表新评论