Junior Spellweaver
- Joined
- Oct 12, 2008
- Messages
- 130
- Reaction score
- 10
i've keep this script for long time and i use this in my previous server so i share it that someone talk me to share it .
How To Use :
Just Go To "RanGame1 > Tables > dbo.ChaInfo > Trigger > Right Click The Trigger > New Trigger" Then Paste and Execute it...
Credit To : Sir Smarkies for Reborn Script(I know his is no longer here.)
And To Sir PrinceOfPersia for amend script..
Tools : Windows Calculator just kidding..
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[Auto_Reborn] ON [dbo].[ChaInfo]
after update
as
BEGIN
Update [ChaInfo] set [ChaInfo].ChaLevel=1,
[ChaInfo].ChaReborn=[ChaInfo].ChaReborn + 1,
[ChaInfo].ChaMoney = [ChaInfo].ChaMoney - 15000000,
[ChaInfo].ChaStRemain = (1*[ChaInfo].ChaReborn)
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 350 -- Max Reborn number
and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
and [ChaInfo].ChaMoney >= 15000000
DECLARE @MaxPowStats bigint, @MaxIntStats bigint,
@MaxDexStats bigint, @MaxVitStats bigint, @MaxStmStats bigint,
@StatPenalty bigint
SET @MaxPowStats = 30000
SET @MaxDexStats = 30000
SET @MaxIntStats = 30000
SET @MaxVitStats = 30000
SET @MaxStmStats = 30000
SET @StatPenalty = 7500
UPDATE [rangame1].[dbo].[ChaInfo]
SET
[ChaInfo].ChaStRemain = [ChaInfo].ChaStRemain +
(CASE WHEN inserted.[ChaPower] > @MaxPowStats THEN ( CASE WHEN @StatPenalty = 0 THEN (inserted.[ChaPower] - @MaxPowStats) ELSE 0 END) ELSE 0 END) +
(CASE WHEN inserted.ChaDex > @MaxDexStats THEN ( CASE WHEN @StatPenalty = 0 THEN (inserted.ChaDex - @MaxDexStats) ELSE 0 END) ELSE 0 END) +
(CASE WHEN inserted.ChaStrong > @MaxVitStats THEN ( CASE WHEN @StatPenalty = 0 THEN (inserted.ChaStrong - @MaxVitStats) ELSE 0 END) ELSE 0 END) +
(CASE WHEN inserted.ChaStrength > @MaxStmStats THEN ( CASE WHEN @StatPenalty = 0 THEN (inserted.ChaStrength - @MaxStmStats) ELSE 0 END) ELSE 0 END) +
(CASE WHEN inserted.ChaSpirit > @MaxIntStats THEN ( CASE WHEN @StatPenalty = 0 THEN (inserted.ChaSpirit - @MaxIntStats) ELSE 0 END) ELSE 0 END)
,[ChaInfo].ChaPower = CASE WHEN inserted.[ChaPower] > @MaxPowStats THEN (CASE WHEN @StatPenalty = 0 THEN @MaxPowStats ELSE (@MaxPowStats - @StatPenalty) END) ELSE inserted.[ChaPower] END
,[ChaInfo].ChaDex = CASE WHEN inserted.ChaDex > @MaxDexStats THEN (CASE WHEN @StatPenalty = 0 THEN @MaxDexStats ELSE (@MaxDexStats - @StatPenalty) END) ELSE inserted.ChaDex END
,[ChaInfo].ChaStrong = CASE WHEN inserted.ChaStrong > @MaxVitStats THEN (CASE WHEN @StatPenalty = 0 THEN @MaxVitStats ELSE (@MaxVitStats - @StatPenalty) END) ELSE inserted.ChaStrong END
,[ChaInfo].ChaStrength = CASE WHEN inserted.ChaStrength > @MaxStmStats THEN (CASE WHEN @StatPenalty = 0 THEN @MaxStmStats ELSE (@MaxStmStats - @StatPenalty) END) ELSE inserted.ChaStrength END
,[ChaInfo].ChaSpirit = CASE WHEN inserted.ChaSpirit > @MaxIntStats THEN (CASE WHEN @StatPenalty = 0 THEN @MaxIntStats ELSE (@MaxIntStats - @StatPenalty) END) ELSE inserted.ChaSpirit END
FROM inserted
WHERE inserted.[ChaName] = [ChaInfo].[ChaName]
and [ChaInfo].[ChaSpecial] = 0
End
How To Use :
Just Go To "RanGame1 > Tables > dbo.ChaInfo > Trigger > Right Click The Trigger > New Trigger" Then Paste and Execute it...
About The Reborn Script :
Level 300 Required To Reborn
15000000 Required Gold To Reborn
Max Reborn Is 350
About The Amend Stat Script :
Max Stats For Pow, Dex, Int, Vit, Stm : 30000
Stat Penalty is 7500
The Purpose of "Stat Penalty" when your put stats over your maxstats will be decreased by your Stats penalty ...
Note : You Can Change The Values By Your Own
Credit To : Sir Smarkies for Reborn Script(I know his is no longer here.)
And To Sir PrinceOfPersia for amend script..
Tools : Windows Calculator just kidding..
Last edited: