新角色自动送点-奇迹MU数据库触发器语句

新角色统一送自由分配点触发器

CREATE TRIGGER 新角色统一送自由分配点触发器 ON Character
AFTER INSERT
AS
SET NOCOUNT ON
UPDATE Character SET LevelUpPoint=需要送的点数
FROM Inserted
WHERE Character.accountid=inserted.accountid
and Character.name=inserted.name
SET NOCOUNT OFF

新角色以职业送自由分配点触发器

CREATE TRIGGER 新角色以职业送自由分配点触发器 ON Character
AFTER INSERT
AS
SET NOCOUNT ON
UPDATE Character SET LevelUpPoint=法师需要送的点数
FROM Inserted
WHERE Inserted.Class=0 and Character.accountid=inserted.accountid
and Character.name=inserted.name
UPDATE Character SET LevelUpPoint=战士需要送的点数
FROM Inserted
WHERE Inserted.Class=16 and Character.accountid=inserted.accountid
and Character.name=inserted.name
UPDATE Character SET LevelUpPoint=弓箭需要送的点数
FROM Inserted
WHERE Inserted.Class=32 and Character.accountid=inserted.accountid
and Character.name=inserted.name
UPDATE Character SET LevelUpPoint=魔剑需要送的点数
FROM Inserted
WHERE Inserted.Class=48 and Character.accountid=inserted.accountid
and Character.name=inserted.name
UPDATE Character SET LevelUpPoint=圣导需要送的点数
FROM Inserted
WHERE Inserted.Class=64 and Character.accountid=inserted.accountid
and Character.name=inserted.name
UPDATE Character SET LevelUpPoint=召唤需要送的点数
FROM Inserted
WHERE Inserted.Class=80 and Character.accountid=inserted.accountid
and Character.name=inserted.name
SET NOCOUNT OFF 

新圣导角色送统率触发器

CREATE TRIGGER 新圣导角色送统率触发器 ON Character
AFTER INSERT
AS
SET NOCOUNT ON
UPDATE Character SET Leadership=需要送的点数
FROM Inserted
WHERE Character.accountid=inserted.accountid
and Character.name=inserted.name
SET NOCOUNT OFF
0

评论0

没有账号?注册  忘记密码?