
Originally Posted by
bhoszmuco14
this is my triggers
USE [RanGame1]
GO
/****** Object: Trigger [dbo].[Auto_Reborn] Script Date: 12/14/2012 16:31:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[Auto_Reborn] ON [dbo].[ChaInfo]
after update
as
BEGIN
Update [ChaInfo] set [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].ChaStartMap=22, -- asdasdsad
[ChaInfo].ChaStartGate=0, -- sdkjbskljb
[ChaInfo].ChaSavePosX=0.847706, -- X coordinates
[ChaInfo].ChaSavePosY=0.299, -- Y coordinates
[ChaInfo].ChaSaveMap=22, -- dffdfgd
[ChaInfo].ChaSavePosZ=0.345514, -- dfggdfg
[ChaInfo].ChaReturnMap=22, -- dfgdgd
[ChaInfo].ChaReturnPosX=0.847706, -- fdgdfg
[ChaInfo].ChaReturnPosY=0.299, -- fdgdfg
[ChaInfo].ChaReturnPosZ=0.345514, -- fdgdfg
[ChaInfo].ChaStRemain = (500*[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 Int you added to 0
[ChaInfo].ChaDex = 0, -- Set the number of Dex you added to 0
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 10000000, -- Optional : Reborn cost 5m
[ChaInfo].ChaSkillSlot = NULL -- Optional : Delete shortcut list of skills
From Inserted
Where Inserted.ChaLevel >= 250 -- Level to reborn
and [ChaInfo].ChaReborn < 150 -- Max Reborn number
and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
and [ChaInfo].ChaBright >= 0 -- Optional : Require 0 or more attr for reborn
and [ChaInfo].ChaMoney >= 10000000 -- Optional : Require 10m gold for reborn
End