--清空新人装备栏
CREATE TRIGGER [清空新人装备栏] ON [dbo].[Character]
after Insert
as
Update [Character] set [Character].Inventory=0 From Inserted
Where [Character].accountid=inserted.accountid
and [Character].name=inserted.name
--新角色送点触发器
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=圣导送的点数,Leadership=统率的点数
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 [Leadership] ON [dbo].[Character]
after Insert
as
Update [Character] set [Character].Leadership=9999
From Inserted
Where Inserted.Class=64 and [Character].accountid=inserted.accountid
and [Character].name=inserted.name
CREATE TRIGGER 新人送点 ON Character
AFTER INSERT
AS
SET NOCOUNT ON
UPDATE Character SET Character.LevelUpPoint=300
FROM Inserted
WHERE Character.name=Inserted.name
SET NOCOUNT OFF
CREATE TRIGGER [新角色送钱到身上] ON Character
AFTER INSERT
AS
SET NOCOUNT ON
UPDATE Character SET Money=新人送的钱数
FROM Inserted
WHERE Character.accountid=inserted.accountid
and Character.name=inserted.name
SET NOCOUNT OFF
新帐号送钱到仓库
CREATE TRIGGER 新帐号送钱到仓库 ON warehouse
AFTER INSERT
AS
SET NOCOUNT ON
UPDATE warehouse SET Money=仓库送的钱数
FROM Inserted
WHERE warehouse.accountid=inserted.accountid
SET NOCOUNT OFF
CREATE TRIGGER [大师满级满点] ON [dbo].[T_MasterLevelSystem]
FOR INSERT, UPDATE, DELETE
AS
update [T_MasterLevelSystem]
set [T_MasterLevelSystem].MASTER_LEVEL = 250
WHERE MASTER_LEVEL = 0 and ML_POINT = 0
update [T_MasterLevelSystem]
SET [T_MasterLevelSystem].ML_POINT = 250
WHERE MASTER_LEVEL = 250 and ML_POINT = 0
update [T_MasterLevelSystem]
SET [T_MasterLevelSystem].ML_EXP = 0
WHERE MASTER_LEVEL = 250 and ML_POINT = 250