CREATE TRIGGER [dbo].[Auto_RB_CHCLASS] ON [dbo].[ChaInfo]
after update
as
BEGIN
Update [ChaInfo] set [ChaInfo].ChaReborn = 1,[ChaInfo].ChaTribe = 1
from Inserted
Where Inserted.ChaTribe = 0
Update [ChaInfo] set [ChaInfo].ChaLevel=1, -- Level that you get after reborn
[ChaInfo].ChaReborn=[ChaInfo].ChaReborn + 1, -- Reborn counter
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = 300*[ChaInfo].ChaReborn, -- how many stat points you get per reborn
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Spirit you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaIntel = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 50000000 -- Optional : Reborn cost 50m
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 51 -- Max Reborn number
and [ChaInfo].ChaTribe = 1
and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
and [ChaInfo].ChaMoney >= 50000000 -- Optional : Require 50m gold for reborn
and [ChaInfo].ChaOnline=0
Update [ChaInfo] set [ChaInfo].ChaLevel=1,
[ChaInfo].ChaTribe = 2,
[ChaInfo].ChaClass = 16,
[ChaInfo].ChaReborn=1, -- will go back to 1 reborn after Change to MixClass
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = 5000, -- stat points you get when you change into mix class
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Spirit you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaIntel = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 1000000000 -- Optional : Chang MixClass cost 1b
From inserted
Where Inserted.ChaLevel = 300 -- Level to Change into MixClass
and [ChaInfo].ChaClass = 1
and [ChaInfo].ChaReborn = 51 -- Required RB to Change MixClass
and [ChaInfo].ChaMoney >= 1000000000 -- Optional : Require 1b gold for Change MixClass
and [ChaInfo].ChaName = inserted.ChaName
and [ChaInfo].ChaNum = inserted.ChaNum
Update [ChaInfo] set [ChaInfo].ChaLevel=1,
[ChaInfo].ChaTribe = 2,
[ChaInfo].ChaClass = 16,
[ChaInfo].ChaReborn=1, -- will go back to 1 reborn after Change to MixClass
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = 5000, -- stat points you get when you change into mix class
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Spirit you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaIntel = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 1000000000 -- Optional : Chang MixClass cost 1b
From inserted
Where Inserted.ChaLevel = 300 -- Level to Change into MixClass
and [ChaInfo].ChaClass = 2
and [ChaInfo].ChaReborn = 51 -- Required RB to Change MixClass
and [ChaInfo].ChaMoney >= 1000000000 -- Optional : Require 1b gold for Change MixClass
and [ChaInfo].ChaName = inserted.ChaName
and [ChaInfo].ChaNum = inserted.ChaNum
Update [ChaInfo] set [ChaInfo].ChaLevel=1,
[ChaInfo].ChaTribe = 2,
[ChaInfo].ChaClass = 32,
[ChaInfo].ChaReborn=1, -- will go back to 1 reborn after Change to MixClass
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = 5000, -- stat points you get when you change into mix class
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Spirit you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaIntel = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 1000000000 -- Optional : Chang MixClass cost 1b
From inserted
Where Inserted.ChaLevel = 300 -- Level to Change into MixClass
and [ChaInfo].ChaClass = 4
and [ChaInfo].ChaReborn = 51 -- Required RB to Change MixClass
and [ChaInfo].ChaMoney >= 1000000000 -- Optional : Require 1b gold for Change MixClass
and [ChaInfo].ChaName = inserted.ChaName
and [ChaInfo].ChaNum = inserted.ChaNum
Update [ChaInfo] set [ChaInfo].ChaLevel=1,
[ChaInfo].ChaTribe = 2,
[ChaInfo].ChaClass = 32,
[ChaInfo].ChaReborn=1, -- will go back to 1 reborn after Change to MixClass
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = 5000, -- stat points you get when you change into mix class
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Spirit you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaIntel = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 1000000000 -- Optional : Chang MixClass cost 1b
From inserted
Where Inserted.ChaLevel = 300 -- Level to Change into MixClass
and [ChaInfo].ChaClass = 8
and [ChaInfo].ChaReborn = 51 -- Required RB to Change MixClass
and [ChaInfo].ChaMoney >= 1000000000 -- Optional : Require 1b gold for Change MixClass
and [ChaInfo].ChaName = inserted.ChaName
and [ChaInfo].ChaNum = inserted.ChaNum
Update [ChaInfo] set [ChaInfo].ChaLevel=1, -- Level that you get after reborn
[ChaInfo].ChaReborn=[ChaInfo].ChaReborn + 1, -- Reborn counter
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = 400*[ChaInfo].ChaReborn+5000, -- how many stat points you get per reborn (+5000 is reward stat you get from Change Mixclass)
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Spirit you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaIntel = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 100000000 -- Optional : Reborn cost 100m
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 61 -- Max Reborn number
and [ChaInfo].ChaTribe = 2
and [ChaInfo].ChaClass = 16
and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
and [ChaInfo].ChaMoney >= 100000000 -- Optional : Require 100m gold for reborn
and [ChaInfo].ChaOnline=0
Update [ChaInfo] set [ChaInfo].ChaLevel=1, -- Level that you get after reborn
[ChaInfo].ChaReborn=[ChaInfo].ChaReborn + 1, -- Reborn counter
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = 400*[ChaInfo].ChaReborn+5000, -- how many stat points you get per reborn (+5000 is reward stat you get from Change Mixclass)
[ChaInfo].ChaPower = 0, -- Set the number of Pow you added to 0
[ChaInfo].ChaStrong = 0, -- Set the number of Vit you added to 0
[ChaInfo].ChaStrength = 0, -- Set the number of Stm you added to 0
[ChaInfo].ChaSpirit = 0, -- Set the number of Spirit you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaIntel = 0, -- Set the number of Int you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 100000000 -- Optional : Reborn cost 100m
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 61 -- Max Reborn number
and [ChaInfo].ChaTribe = 2
and [ChaInfo].ChaClass = 32
and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
and [ChaInfo].ChaMoney >= 100000000 -- Optional : Require 100m gold for reborn
and [ChaInfo].ChaOnline=0
End