[Euphoria Dev Team Release] Starter Skills

08/01/2013 14:21 Philipp_#1
Hello everybody,

this release was created due to me being lazy during other development. I was testing something about skills on my local server and I had to upgrade the skills from 1 up to 9 each time. After some time I thought about avoiding this by adding some lines to the famous usp_Create_Char_R procedure. This release is only important for servers that have the instant leveling feature, and most of all, free or extremely easy servers.
Let's say you create a character whose starting level is 60, you login and want to start playing. Opening the skills window and upgrading each skill to its max with the hundreds of available skillpoints gets annoying. What I am releasing will automatically unlock each skills max skill level.
Here it is:
Code:
SELECT SkillID,MAX(SkillLevel) AS SkillLevel,MAX(Country) AS Country,MAX(Grow) AS Grow,MAX(Attackfighter) AS Attackfighter,MAX(Defensefighter) AS Defensefighter,MAX(Patrolrogue) AS Patrolrogue,MAX(Shootrogue) AS Shootrogue,MAX(Attackmage) AS Attackmage,MAX(Defensemage) AS Defensemage INTO #Skills
FROM PS_GameDefs.dbo.Skills
WHERE ReqLevel <= @Level AND 
	SkillLevel < 100 AND 
	TypeShow > 0 AND 
	(((@Job != 0 OR (Attackfighter = 1)) AND ((@Family != 0 OR (Country IN (6,2,0))) AND (@Family != 3 OR (Country IN (6,5,3)))))
		AND ((@Job != 1 OR (Defensefighter = 1)) AND ((@Family != 0 OR (Country IN (6,2,0))) AND (@Family != 3 OR (Country IN (6,5,3)))))
		AND ((@Job != 2 OR (Patrolrogue = 1)) AND ((@Family != 1 OR (Country IN (6,2,1))) AND (@Family != 2 OR (Country IN (6,5,4)))))
		AND ((@Job != 3 OR (Shootrogue = 1)) AND ((@Family != 1 OR (Country IN (6,2,1))) AND (@Family != 3 OR (Country IN (6,5,3)))))
		AND ((@Job != 4 OR (Attackmage = 1)) AND ((@Family != 1 OR (Country IN (6,2,1))) AND (@Family != 2 OR (Country IN (6,5,4)))))
		AND ((@Job != 5 OR (Defensemage = 1)) AND ((@Family != 0 OR (Country IN (6,2,0))) AND (@Family != 2 OR (Country IN (6,5,4))))))
GROUP BY SkillID

DECLARE @Count INT = (SELECT COUNT(SkillLevel) FROM #Skills)

WHILE @Count > 0
BEGIN
	INSERT INTO CharSkills
	SELECT TOP (1) @CharID,SkillID,SkillLevel,@Count,0,GETDATE(),0
	FROM #Skills

	DELETE TOP (1) FROM #Skills

	SET @Count -= 1
END

DROP TABLE #Skills
Simply add it right after the following line, which can be found at the very end of your proc
Code:
SET @CharID = IDENT_CURRENT('Chars')
Enjoy!

08/01/2013 20:58 [Dev]Matheus#2
I could not make this script work happens the following error:

Code:
Msg 102, Level 15, State 1, Procedure usp_Create_Char_R, Line 117
Incorrect syntax near '('.
Msg 137, Level 15, State 2, Procedure usp_Create_Char_R, Line 119
Must declare the scalar variable "@Count".
Msg 137, Level 15, State 2, Procedure usp_Create_Char_R, Line 122
Must declare the scalar variable "@Count".
Msg 102, Level 15, State 1, Procedure usp_Create_Char_R, Line 127
Incorrect syntax near '-'.
If you can help me and solve this error please.:handsdown:
08/01/2013 21:48 Philipp_#3
Hello [Dev]Matheus,
this function was written and tested by using SQL Server 2012. I believed todays developers left use the latest software or at least SQL Server 2008. Inline variable assignment, as well as compound operators (Add EQUALS, Minus EQUALS etc.) are available in SQL Server 2008 and upper versions only. Both features are used by me.
For those who are using SQL Server 2005, here is the same code as in the 1st post, just without the features mentioned above.
Code:
SELECT SkillID,MAX(SkillLevel) AS SkillLevel,MAX(Country) AS Country,MAX(Grow) AS Grow,MAX(Attackfighter) AS Attackfighter,MAX(Defensefighter) AS Defensefighter,MAX(Patrolrogue) AS Patrolrogue,MAX(Shootrogue) AS Shootrogue,MAX(Attackmage) AS Attackmage,MAX(Defensemage) AS Defensemage INTO #Skills
FROM PS_GameDefs.dbo.Skills
WHERE ReqLevel <= @Level AND 
	SkillLevel < 100 AND 
	TypeShow > 0 AND 
	(((@Job != 0 OR (Attackfighter = 1)) AND ((@Family != 0 OR (Country IN (6,2,0))) AND (@Family != 3 OR (Country IN (6,5,3)))))
		AND ((@Job != 1 OR (Defensefighter = 1)) AND ((@Family != 0 OR (Country IN (6,2,0))) AND (@Family != 3 OR (Country IN (6,5,3)))))
		AND ((@Job != 2 OR (Patrolrogue = 1)) AND ((@Family != 1 OR (Country IN (6,2,1))) AND (@Family != 2 OR (Country IN (6,5,4)))))
		AND ((@Job != 3 OR (Shootrogue = 1)) AND ((@Family != 1 OR (Country IN (6,2,1))) AND (@Family != 3 OR (Country IN (6,5,3)))))
		AND ((@Job != 4 OR (Attackmage = 1)) AND ((@Family != 1 OR (Country IN (6,2,1))) AND (@Family != 2 OR (Country IN (6,5,4)))))
		AND ((@Job != 5 OR (Defensemage = 1)) AND ((@Family != 0 OR (Country IN (6,2,0))) AND (@Family != 2 OR (Country IN (6,5,4))))))
GROUP BY SkillID

DECLARE @Count INT 
SET @Count = (SELECT COUNT(SkillLevel) FROM #Skills)

WHILE @Count > 0
BEGIN
	INSERT INTO CharSkills
	SELECT TOP (1) @CharID,SkillID,SkillLevel,@Count,0,GETDATE(),0
	FROM #Skills

	DELETE TOP (1) FROM #Skills

	SET @Count = @Count - 1
END

DROP TABLE #Skills
P.S. I advise everyone who is using SQL Server 2005 to upgrade it.
08/02/2013 05:32 [Admin]ßІί†ž#4
Again, great release Philly !
02/01/2014 18:26 elfamosoo#5
Why do i get this error ?
Msg 137, Level 15, State 2, Line 3
Must declare the scalar variable "@Level".
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near '@Job'.
Msg 137, Level 15, State 2, Line 20
Must declare the scalar variable "@CharID".
02/01/2014 20:43 nubness#6
Quote:
Originally Posted by N4TSU View Post
It's like 4-5 months ago, I don't think it'll work..
This makes no sense, why wouldn't it work ?

The problem with his error is that he's most likely using SQL Server 2005, and should upgrade to 2008 R2 or higher.
02/01/2014 21:08 Stureplan#7
I'm sorry, I don't know much about SQL etc..

btw.. #Added to Index
02/02/2014 16:25 elfamosoo#8
Quote:
Originally Posted by nubness View Post
This makes no sense, why wouldn't it work ?

The problem with his error is that he's most likely using SQL Server 2005, and should upgrade to 2008 R2 or higher.
I'm using Sql server 2012 i tried both scripts and got the same error
02/02/2014 20:06 Philipp_#9
Quote:
Originally Posted by elfamosoo View Post
Why do i get this error ?
Msg 137, Level 15, State 2, Line 3
Must declare the scalar variable "@Level".
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near '@Job'.
Msg 137, Level 15, State 2, Line 20
Must declare the scalar variable "@CharID".
Because you didn't read my explanation, you just copied my query in a new window.

Quote:
Originally Posted by N4TSU View Post
I'm sorry, I don't know much about SQL etc..
Stop commenting then.
11/20/2018 08:00 [GameAdvisor]Finn#10
hi i use this method and all skill is working.. but buffs is not working.. thanks
11/20/2018 10:10 Fordmondeo20#11
with buffs do you probably mean res rune, pid and so on?
01/13/2019 20:46 [GameAdvisor]Finn#12
[Only registered and activated users can see links. Click Here To Register...]
this what i mean
Buffs Description change to "???"
and when i use said wrong target
01/13/2019 22:22 SnickQ#13
Quote:
Originally Posted by [GameAdvisor]Finn View Post
[Only registered and activated users can see links. Click Here To Register...]
this what i mean
Buffs Description change to "???"
and when i use said wrong target
Im not sure but probably the problem is in skill lvl
01/21/2020 04:34 aeros031#14
Hello, please can you help me ... I am using SQL Server 2008 R2 but the script runs smoothly but when I create a character the Skills are not activated.