|
You last visited: Today at 13:47
Advertisement
[NEW] Skill reset scrolls (Working 100%)
Discussion on [NEW] Skill reset scrolls (Working 100%) within the SRO PServer Guides & Releases forum part of the SRO Private Server category.
01/23/2019, 19:23
|
#1
|
elite*gold: 0
Join Date: May 2018
Posts: 84
Received Thanks: 44
|
[NEW] Skill reset scrolls (Working 100%)
Greetings @everyone,
@  this is what you requested.
I created this query to reset the skills and the masteries, it will return all of the skill points that the character used
There are a lot of topics about this scroll but it doesn't return the real skill point that been used, but this does!
Here are the qurey:
Code:
DECLARE @TSP INT
DECLARE @TMSP INT
SET @TSP = (SELECT SUM(A.ReqLearn_SP) FROM _RefSkill A, _CharSkill B WHERE A.GroupID = (SELECT GroupID FROM _RefSkill WHERE ID = B.SkillID) AND A.Basic_Level <= (SELECT Basic_Level FROM _RefSkill WHERE ID = B.SkillID) AND B.CharID = @CharID)
SET @TMSP = (SELECT SUM(A.Exp_M) FROM _RefLevel A, _CharSkillMastery B WHERE A.Lvl <= B.Level - 1 AND B.CharID = @CharID)
UPDATE _Char SET RemainSkillPoint = RemainSkillPoint + @TSP + @TMSP
UPDATE _CharSkillMastery SET Level = 0 WHERE CharID = @CharID
DELETE _CharSkill WHERE SkillID NOT IN (1, 70, 40, 2, 8421, 9354, 9355, 11162, 9944, 8419, 8420, 11526, 10625) AND CharID = @CharID
EDITED:
Due to @  you can replace the last line with:
Code:
DELETE FROM _CharSkill WHERE SkillID NOT IN (SELECT SkillID FROM _RefCharDefault_Skill) AND CharID = @CharID
NOTE: Please dude don't ask me "Where is the _RefObjCommon & _RefObjItem lines?" or "Where/How should I use this?"
If you want to ask those questions then <Answer yourself>
Have A Nice Life!
|
|
|
01/23/2019, 20:04
|
#2
|
elite*gold: 100
Join Date: Sep 2017
Posts: 1,108
Received Thanks: 903
|
You can replace:
Code:
DELETE _CharSkill WHERE SkillID NOT IN (1, 70, 40, 2, 8421, 9354, 9355, 11162, 9944, 8419, 8420, 11526, 10625) AND CharID = @CharID
With:
Code:
DELETE skill FROM _CharSkill skill WHERE skill.SkillID NOT IN (SELECT defs.SkillID FROM _RefCharDefault_Skill defs) AND skill.CharID = @CharID
Good job though, it's nice to see that there's still people who can write a clean code other than known ones.
|
|
|
01/23/2019, 20:32
|
#3
|
elite*gold: 70
Join Date: Apr 2017
Posts: 1,023
Received Thanks: 504
|
nice work mate
|
|
|
01/23/2019, 20:49
|
#4
|
elite*gold: 0
Join Date: May 2018
Posts: 84
Received Thanks: 44
|
Quote:
Originally Posted by #HB
You can replace:
Code:
DELETE _CharSkill WHERE SkillID NOT IN (1, 70, 40, 2, 8421, 9354, 9355, 11162, 9944, 8419, 8420, 11526, 10625) AND CharID = @CharID
With:
Code:
DELETE skill FROM _CharSkill skill WHERE skill.SkillID NOT IN (SELECT defs.SkillID FROM _RefCharDefault_Skill defs) AND skill.CharID = @CharID
Good job though, it's nice to see that there's still people who can write a clean code other than known ones.
|
Yeah!, but i think this line is shorter:
Code:
DELETE FROM _CharSkill WHERE SkillID NOT IN (SELECT SkillID FROM _RefCharDefault_Skill) AND CharID = @CharID
Thanks dude.
Quote:
Originally Posted by Zoro.Sro
nice work mate
|
Any Time!
|
|
|
01/23/2019, 23:22
|
#5
|
elite*gold: 0
Join Date: Aug 2010
Posts: 689
Received Thanks: 375
|
Quote:
Originally Posted by Klito*
Yeah!, but i think this line is shorter:
Code:
DELETE FROM _CharSkill WHERE SkillID NOT IN (SELECT SkillID FROM _RefCharDefault_Skill) AND CharID = @CharID
Thanks dude.
Any Time!
|
need fb scroll 16/17/18/19 dg item Weapon/Shield/Armor/Ring set please ? % 100 fb +15 scroll
|
|
|
01/24/2019, 00:35
|
#6
|
elite*gold: 0
Join Date: May 2017
Posts: 1,081
Received Thanks: 224
|
good work
|
|
|
01/24/2019, 01:52
|
#7
|
elite*gold: 355
Join Date: Mar 2009
Posts: 264
Received Thanks: 52
|
Quote:
Originally Posted by Klito*
Greetings @everyone,
@  this is what you requested.
I created this query to reset the skills and the masteries, it will return all of the skill points that the character used
There are a lot of topics about this scroll but it doesn't return the real skill point that been used, but this does!
Here are the qurey:
Code:
DECLARE @TSP INT
DECLARE @TMSP INT
SET @TSP = (SELECT SUM(A.ReqLearn_SP) FROM _RefSkill A, _CharSkill B WHERE A.GroupID = (SELECT GroupID FROM _RefSkill WHERE ID = B.SkillID) AND A.Basic_Level <= (SELECT Basic_Level FROM _RefSkill WHERE ID = B.SkillID) AND B.CharID = @CharID)
SET @TMSP = (SELECT SUM(A.Exp_M) FROM _RefLevel A, _CharSkillMastery B WHERE A.Lvl <= B.Level - 1 AND B.CharID = @CharID)
UPDATE _Char SET RemainSkillPoint = RemainSkillPoint + @TSP + @TMSP
UPDATE _CharSkillMastery SET Level = 0 WHERE CharID = @CharID
DELETE _CharSkill WHERE SkillID NOT IN (1, 70, 40, 2, 8421, 9354, 9355, 11162, 9944, 8419, 8420, 11526, 10625) AND CharID = @CharID
EDITED:
Due to @  you can replace the last line with:
Code:
DELETE FROM _CharSkill WHERE SkillID NOT IN (SELECT SkillID FROM _RefCharDefault_Skill) AND CharID = @CharID
NOTE: Please dude don't ask me "Where is the _RefObjCommon & _RefObjItem lines?" or "Where/How should I use this?"
If you want to ask those questions then <Answer yourself>
Have A Nice Life!
|
wasn't my request i can do it
|
|
|
01/24/2019, 02:34
|
#8
|
elite*gold: 82
Join Date: Mar 2010
Posts: 451
Received Thanks: 417
|
GOOD JOB
|
|
|
01/24/2019, 02:49
|
#9
|
elite*gold: 0
Join Date: Feb 2017
Posts: 8
Received Thanks: 1
|
Thnaks alot dude
|
|
|
01/24/2019, 19:21
|
#10
|
elite*gold: 0
Join Date: May 2018
Posts: 84
Received Thanks: 44
|
Quote:
Originally Posted by Dev.L0RdReVaN
wasn't my request i can do it
|
Really!, So why you didn't?
Because it doesn't work in your server, That's a good question (WoW)
You asked me to do it for you but you are like a baby who doesn't want people to look at him and say: "He calls himself a developer and can't write this simple query", Oh dude baby will still a baby!
Code:
Thanks guys for supporting me!
|
|
|
10/18/2019, 21:17
|
#11
|
elite*gold: 1476
Join Date: Nov 2017
Posts: 102
Received Thanks: 104
|
Quote:
Originally Posted by #HB
You can replace:
Code:
DELETE _CharSkill WHERE SkillID NOT IN (1, 70, 40, 2, 8421, 9354, 9355, 11162, 9944, 8419, 8420, 11526, 10625) AND CharID = @CharID
With:
Code:
DELETE skill FROM _CharSkill skill WHERE skill.SkillID NOT IN (SELECT defs.SkillID FROM _RefCharDefault_Skill defs) AND skill.CharID = @CharID
Good job though, it's nice to see that there's still people who can write a clean code other than known ones.
|
Actually if he already picked that info, it's more efficient to do it with a list and save that query each time since these values are usually static. You better notice the important matters, and there are important matters. I don't know how you guys can thank him for such a disaster query.
It's 100% working, in deed, but he forgot to mention that it's 100% working for everyone.
The query takes the data from a specific char but all the players enjoy the SP lol.
Quote:
Originally Posted by Klito*
Code:
UPDATE _Char SET RemainSkillPoint = RemainSkillPoint + @TSP + @TMSP
Have A Nice Life!
|
But yeah..
Quote:
Originally Posted by #HB
Good job though, it's nice to see that there's still people who can write a clean code other than known ones.
|
Delete this misleading thread or edit the query.
Code:
UPDATE _Char SET RemainSkillPoint = RemainSkillPoint + @TSP + @TMSP WHERE CharID = @CharID
Have A Nice Life!
|
|
|
10/19/2019, 01:47
|
#12
|
elite*gold: 1014
Join Date: Apr 2015
Posts: 1,028
Received Thanks: 1,243
|
is that a show for your skills guys ?
|
|
|
10/19/2019, 16:02
|
#13
|
elite*gold: 6
Join Date: Nov 2013
Posts: 279
Received Thanks: 223
|
good job
|
|
|
10/20/2019, 22:09
|
#14
|
elite*gold: 0
Join Date: Oct 2019
Posts: 19
Received Thanks: 0
|
Gonna try out this.
|
|
|
10/26/2019, 09:19
|
#15
|
elite*gold: 36
Join Date: Aug 2017
Posts: 142
Received Thanks: 61
|
When your _Charskill table reaches the big data situation, these code is going to ****** up.
|
|
|
All times are GMT +1. The time now is 13:49.
|
|