-
Enthusiast
[Guide]How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
I am aware that guides already got posted but none was really complete like no one ever said how to limit reborns or how to make you get more stat points each time you reborn
so here it goes :
Open your SQL manager and go to RanGame1 > Tables > ChaInfo
Rightclick dbo.ChaInfo and click Design Table
Go to the bottom of the list that appears
there at the Column name put "ChaReborn"
datatype : Smallint
allow "NULL"
when you're done save the edits and open the tree of dbo.ChaInfo and find "Trigger"
Rightclick Trigger and click "New Trigger"
and put this in :
CREATE TRIGGER [dbo].[Auto_Reborn] ON [dbo].[ChaInfo]
after update
as
BEGIN
Update [ChaInfo] set [ChaInfo].ChaReborn = 0,[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 = (100*[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 - 2000000, -- Optional : Reborn cost 2m
[ChaInfo].ChaSkillPoint = (10*[ChaInfo].ChaReborn), -- Set the Skillpoints per reborn
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 10 -- 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 >= 2000000 -- Optional : Require 2m gold for reborn
End
How to make double reborn :
Change the first script a bit (at the lvs)
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 = (100*[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 - 2000000, -- Optional : Reborn cost 2m
[ChaInfo].ChaSkillPoint = (10*[ChaInfo].ChaReborn), -- Set the Skillpoints per reborn
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel >= 290 -- Level to 1x reborn
and [ChaInfo].ChaLevel < 295 -- Limitation of 1x Reborn
and [ChaInfo].ChaReborn < 10 -- 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 >= 2000000 -- Optional : Require 2m gold for reborn
and then add below this :
Update [ChaInfo] set [ChaInfo].ChaLevel=1, -- Level that you get after reborn
[ChaInfo].ChaReborn=[ChaInfo].ChaReborn + 2, -- Reborn counter -- NO need to change anything beside of THIS you get automatically more stat points if you put the reborn counter +2
[ChaInfo].ChaExp=0, -- Set Exp back to 0
[ChaInfo].ChaStRemain = (100*[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 - 4000000, -- Optional : Reborn cost 4m
[ChaInfo].ChaSkillPoint = (10*[ChaInfo].ChaReborn), -- Set the Skillpoints per reborn
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel >= 296 -- Level to 2x reborn
and [ChaInfo].ChaReborn < 10 -- 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 >= 4000000 -- Optional : Require 4m gold for double reborn
after that press the Red "!" to perform the compiling of the Trigger, and you're done!
To Reborn : Change Map / Relog
Note : To delete any of the changes when reborn like Skills delete, just delete that line and don't forget that ONLY the last thing to happen got NO comma at the end, any line needs a comma beside the last otherwise it won't work
You can use any value of your char to get changed or as requirement for reborn
even require to be in a certain Map with
[ChaInfo].ChaSaveMap
or even to have a certain guild nick (like nick : REBORN) to make ppl reborn at will and not by mistake
[ChaInfo].ChaGuName = 'REBORN'
To clear the guild nick after reborn add this line : [ChaInfo].ChaGuName = ' ' -- careful its 2 ' not 1 "
and don't forget the comma if its not the last thing to change
Note : If you need REBORN then Reborn will NOT work, its case sensitive and don't forget the '
Important : Don't try around too much with this code on an open server, if you change things wrong it could end up in making EVERY char of your server reborn each second without having to satisfy and requirement, please back up your server files first or make it on a separate server to avoid hard damage while trying to modify this code
Example for fatal mistake :
Update [ChaInfo] set [ChaInfo].ChaLevel=1
Update [ChaInfo] set [ChaInfo].ChaReborn=[ChaInfo].ChaReborn + 1, -- Reborn counter
Update [ChaInfo] set [ChaInfo].ChaStRemain = (100*[ChaInfo].ChaReborn)
Update [ChaInfo] set [ChaInfo].ChaMoney = [ChaInfo].ChaMoney -2000000
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaMoney > 2000000
THIS would make EVERY char in your server reborn for free every time they relog or move to other map!!!
Yea for FREE no -2m because the condition of lv 300 and 2m gold is ONLY for the last Update command, means you would have made this skirpt :
Change map or relog = Reborn
and
If Lv 300 and money 2m then Money -2m
DO NOT USE THIS
Edit : Edited it now I'm using a variable that is 0 when you make your char and stays 0 all the way, its not used by the game so I use it to make ChaReborn get 0 instead of NULL
but if anyone knows how to check if a variable is NULL tell me and I'll add it instead, cos if I make
Where Inserted.ChaReborn = NULL
it won't do anything, it will just cause your char to rollback any time instead of reborn X.x
Last edited by Tammy; 15-08-07 at 01:41 PM.
-
-
Account Upgraded | Title Enabled!
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
nice guide.. clear and clean
but got errors executing this trigger
(problem solved)
Last edited by heavenzel; 15-08-07 at 02:07 PM.
Reason: problem solved
-
Enthusiast
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
I know what was your problem I didn't test all myself sorry
[ChaInfo].ChaSkill = NULL
and not = 0
otherwise it won't work
same for ChaSkillslot and quest
copy again the new version of my skript sorry again
and don't forget to put the variable ChaReborn correctly :
Go to the bottom of the list that appears
there at the Column name put "ChaReborn"
datatype : Smallint
allow "NULL"
if you don't allow null it causes an error later on...
-
Valued Member
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
Nice Guide...2 thumbs up :zoo_taz::starwars:
-
Valued Member
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
nice job tammy. its clear & simple unlike others. ok man ill try this. congrats man. keep in touch.
-
Valued Member
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
...bump...nice guide Tammy...i heard you created a new server? coz you we're kicked out from RanEvo...
-
Enthusiast
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
That Server isn't open for public
but yes true. I used a lot of knowlegde to release it. Worked a whole month to make the new skills items and stuff and now I help people here with random problems, if you want to know more about SQL, or any ran file editors, just ask o.o
-
Valued Member
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
...can i be one of the testers/players in your server then?... :) if it's fine with you...anyways, about stats...can i add stats more than 10k and not have my character rolling back?... what should i edit?...and how?
-
Enthusiast
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
Rollback only comes up if your HP exceeds 32767.5 if you have 32767 hp its fine if you got 32768 hp you will rollback
To add stats how? By GMcharEdit? Or Reborn?
By Reborn :
Replace this line :
[ChaInfo].ChaStRemain = (100*[ChaInfo].ChaReborn), -- how many stat points you get per reborn
with this :
[ChaInfo].ChaStRemain = 10000
With GMCharEditor :
How to use it :
Open SQL Manager go to RanUser database and go Server Group, open it and fill in :
SGNum : 1
SGName : the way you want call your server
OdbcName : RanGame1
OdbcUserID : the user ID you used (Default : sa)
OdbcPassword : the password you used (Default : 1234)
OdbcLogName : RanLog
OdbcLogUserID : the user ID you used (Default : sa)
OdbcLogPassword : the password you used (Default : 1234)
After that go to ServerInfo and fill it in like this :
SGNum : 1
SvrNum : 1
SvrType : 4
Then Run GMCharEdit and fill the fields
First field : RanUser
Second field : The Username you typed at SQL manager
Third field : The Password you typed at SQL manager
Fourth field : The Password you typed at SQL manager
then click ok, chose your server from the list and it will open the GM char editor
How to edit chars
In the Search Bar give the name of the char you wish to edit then double click his name on the founds list, and you will find an easy to use window with lots of info about your char that you can change, like Statpoints or Pow or Dex and so on
Enjoy ^^
-
Apprentice
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
this trigger first in DB---> (Update Character Level,Skill and Stat Points
Dex,Pow,Int,Vit,Stm and Money)
then i put reborn trigger .. this the best part ....when create new char u loss all item
what happen ..?
can combine reborn and update char :)
-
Enthusiast
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
The problem is that the SQL refuses to change anything on the database having 2 triggers its like he doesn't know what to do so to avoid damage doesn't do anything at all
Solution : Fusion both Trigger into 1
add this into your first trigger
at the bottom
before "END"
Update [ChaInfo] set [ChaInfo].ChaReborn = 0,[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 = (100*[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 - 2000000, -- Optional : Reborn cost 2m
[ChaInfo].ChaSkillPoint = (10*[ChaInfo].ChaReborn), -- Set the Skillpoints per reborn
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 10 -- 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 >= 2000000 -- Optional : Require 2m gold for reborn
then it should work
I guess you mean this trigger :
like I said just add before the "END" like this :
CREATE TRIGGER [dbo].[NewChar_Level] ON [dbo].[ChaInfo]
after update
as
BEGIN
Update [ChaInfo] set [ChaInfo].ChaLevel=100
From Inserted
Where Inserted.ChaLevel = 1 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Update [ChaInfo] set [ChaInfo].ChaSkillPoint=1500
From Inserted
Where Inserted.ChaSkillPoint = 0 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Update [ChaInfo] set [ChaInfo].ChaStRemain=1500
From Inserted
Where Inserted.ChaStRemain = 3 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Update [ChaInfo] set [ChaInfo].ChaMoney=1000000
From Inserted
Where Inserted.ChaMoney = 0 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Update [ChaInfo] set [ChaInfo].ChaPower=100
From Inserted
Where Inserted.ChaPower = 0 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Update [ChaInfo] set [ChaInfo].ChaStrong=100
From Inserted
Where Inserted.ChaStrong = 0 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Update [ChaInfo] set [ChaInfo].ChaStrength=100
From Inserted
Where Inserted.ChaStrength = 0 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Update [ChaInfo] set [ChaInfo].ChaSpirit=100
From Inserted
Where Inserted.ChaSpirit = 0 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Update [ChaInfo] set [ChaInfo].ChaDex=100
From Inserted
Where Inserted.ChaDex = 0 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
Update [ChaInfo] set [ChaInfo].ChaIntel=100
From Inserted
Where Inserted.ChaIntel = 0 and [ChaInfo].ChaName=inserted.ChaName
and [ChaInfo].UserNum =inserted.UserNum
-- HERE
Update [ChaInfo] set [ChaInfo].ChaReborn = 0,[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 = (100*[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 - 2000000, -- Optional : Reborn cost 2m
[ChaInfo].ChaSkillPoint = (10*[ChaInfo].ChaReborn), -- Set the Skillpoints per reborn
[ChaInfo].ChaSkills = NULL, -- Optional : Forget all skills after reborn
[ChaInfo].ChaSkillSlot = NULL, -- Optional : Delete shortcut list of skills
[ChaInfo].ChaQuest = NULL -- Optional : Delete quest list (need restart all quests) after reborn
From Inserted
Where Inserted.ChaLevel = 300 -- Level to reborn
and [ChaInfo].ChaReborn < 10 -- 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 >= 2000000 -- Optional : Require 2m gold for reborn
END
-
Proficient Member
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
now I know why the problem occurs when have two triggers. I hope I dont mess up with palyers db if I do this. Maybe I need to do it on my development server. Thanks tammy
-
Account Upgraded | Title Enabled!
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
hehehe.. another problem occur.. all client cant connect to game...
when i look up field and agent server, i saw native client error.. when i deleted your trigeer, all errors back to normal... y?
-
Enthusiast
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)
Strange O.o
what did you use as trigger
maybe you edit sth wrong
post it here please
to me it still works to connect
-
Apprentice
Re: Guide : How to make AutoReborn Scripts for SQL 2005 (Complete and simple)