Register for your free account! | Forgot your password?

You last visited: Today at 02:33

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[HELP]GM Enchant +1 max 18

Discussion on [HELP]GM Enchant +1 max 18 within the Shaiya PServer Development forum part of the Shaiya Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
[HELP]GM Enchant +1 max 18

Hey
I try wirte script in usp_Insert_Action_Log_E
To get enchant +1 when sell GME in NPC
But is not work-Work only with full CraftName Like this



usp_Insert_Action_Log_E

Works only with
Code:
IF (@ActionType = 114 and @Value2 = 100206)
Begin
Update PS_GameData.dbo.CharItems SET Craftname = 51515151515151515170
WHERE CharID = @CharID and Bag = 1 and Slot = 0
END
I try
Code:
IF (@ActionType = 114 and @Value2 = 100208)
Begin
Update PS_GameData.dbo.CharItems SET Craftname = Craftname + @Enchant * 01 
WHERE CharID = @CharID and Bag = 1 and Slot = 0
END
And
Code:
IF (@ActionType = 114 and @Value2 = 100209)
Begin
Update PS_GameData.dbo.CharItems SET Craftname = Craftname + 01 
WHERE CharID = @CharID and Bag = 1 and Slot = 0
END
But i get nothing
QQers19 is offline  
Old 07/31/2014, 16:48   #2
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,451
The Craftname column is a varchar(20), or at least should be.
What you're doing there is adding 2 more digits, which depending on the Craftname data type is either returning an error or simply not showing up in game.

Here's what you should be doing:
Code:
UPDATE PS_GameData.dbo.CharItems
SET Craftname = SUBSTRING(Craftname, 1, 18) + '00'
WHERE CharID = @CharID AND Bag = @Bag AND Slot = @Slot
I won't comment this, it should be simple enough for you to understand.
nubness is offline  
Thanks
3 Users
Old 07/31/2014, 17:38   #3
 
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
nubness your script work, but giving specific enchant for example [0] up to [18] And when i use have atack ench in helmet
I guess is not possible get ench for weap an armor + 04-05 and 65-66
QQers19 is offline  
Old 07/31/2014, 18:49   #4
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,451
If you want to increase the enchant level, there's more ways of doing that.

The easiest to understand is by getting the current enchant level, change it and put it back in the Craftname, as follows:

Code:
DECLARE @Enchant TINYINT = (SELECT CAST(SUBSTRING(Craftname, 19, 2) AS TINYINT) FROM CharItems WHERE CharID = @CharID AND Bag = @Bag AND Slot = @Slot)

SET @Enchant += 5 -- this will increase the enchant by 5

DECLARE @EnchantString CHAR(2) = @Enchant

IF LEN(@EnchantString) = 1
	SET @EnchantString= '0' + @EnchantString

UPDATE CharItems
SET Craftname = SUBSTRING(Craftname, 1, 18) + @EnchantString
WHERE CharID = @CharID AND Bag = @Bag AND Slot = @Slot
nubness is offline  
Thanks
2 Users
Old 07/31/2014, 20:17   #5
 
elite*gold: 0
Join Date: Oct 2012
Posts: 89
Received Thanks: 4
Thanks nubness That's what I meant
QQers19 is offline  
Old 08/01/2014, 09:00   #6




 
Autrux's Avatar
 
elite*gold: 1
Join Date: Dec 2010
Posts: 33,275
Received Thanks: 5,709
Arrow Shaiya -> Shaiya PServer Development

#moved
Autrux is offline  
Old 08/01/2014, 14:59   #7
 
elite*gold: 0
Join Date: Feb 2012
Posts: 19
Received Thanks: 2
nubness, your script work, but how to restrain max enchant to for example [15] max?
szymo228 is offline  
Old 08/01/2014, 15:07   #8
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,451
Quote:
Originally Posted by szymo228 View Post
nubness, your script work, but how to restrain max enchant to for example [15] max?
Code:
DECLARE @Enchant TINYINT = (SELECT CAST(SUBSTRING(Craftname, 19, 2) AS TINYINT) FROM CharItems WHERE CharID = @CharID AND Bag = @Bag AND Slot = @Slot)

SET @Enchant += 5 -- this will increase the enchant by 5

IF @Enchant > 15
	SET @Enchant = 15

DECLARE @EnchantString CHAR(2) = @Enchant

IF LEN(@EnchantString) = 1
	SET @EnchantString= '0' + @EnchantString

UPDATE CharItems
SET Craftname = SUBSTRING(Craftname, 1, 18) + @EnchantString
WHERE CharID = @CharID AND Bag = @Bag AND Slot = @Slot
nubness is offline  
Thanks
2 Users
Old 08/02/2014, 00:10   #9
 
elite*gold: 0
Join Date: Feb 2012
Posts: 19
Received Thanks: 2
I need that enchant only for armors
When i change it for
IF @Enchant > 65
SET @Enchant = 65

its still working on wep and giving [20].
szymo228 is offline  
Old 08/02/2014, 00:22   #10
 
nubness's Avatar
 
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,451
Quote:
Originally Posted by szymo228 View Post
I need that enchant only for armors
When i change it for
IF @Enchant > 65
SET @Enchant = 65

its still working on wep and giving [20].
This is really simple to adjust, you should put more effort into it.

Code:
DECLARE @Enchant TINYINT = (SELECT CAST(SUBSTRING(Craftname, 19, 2) AS TINYINT) FROM CharItems WHERE CharID = @CharID AND Bag = @Bag AND Slot = @Slot)

SET @Enchant += 5 -- this will increase the enchant by 5

IF @Enchant > 65 
	SET @Enchant = 65
ELSE IF @Enchant > 15 AND @Enchant < 50
	SET @Enchant = 15

DECLARE @EnchantString CHAR(2) = @Enchant

IF LEN(@EnchantString) = 1
	SET @EnchantString= '0' + @EnchantString

UPDATE CharItems
SET Craftname = SUBSTRING(Craftname, 1, 18) + @EnchantString
WHERE CharID = @CharID AND Bag = @Bag AND Slot = @Slot
nubness is offline  
Thanks
5 Users
Old 01/13/2015, 07:43   #11
 
elite*gold: 0
Join Date: Jul 2012
Posts: 36
Received Thanks: 7
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '('.
Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@CharID".
Msg 137, Level 15, State 2, Line 5
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 1, Line 6
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 2, Line 7
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 1, Line 8
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 2, Line 10
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 2, Line 12
Must declare the scalar variable "@EnchantString".
Msg 137, Level 15, State 2, Line 13
Must declare the scalar variable "@EnchantString".
Msg 137, Level 15, State 2, Line 16
Must declare the scalar variable "@EnchantString".




Have error
astross is offline  
Old 01/13/2015, 12:57   #12
 
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
Quote:
Originally Posted by astross View Post
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '('.
Msg 137, Level 15, State 2, Line 1
Must declare the scalar variable "@CharID".
Msg 137, Level 15, State 2, Line 5
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 1, Line 6
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 2, Line 7
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 1, Line 8
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 2, Line 10
Must declare the scalar variable "@Enchant".
Msg 137, Level 15, State 2, Line 12
Must declare the scalar variable "@EnchantString".
Msg 137, Level 15, State 2, Line 13
Must declare the scalar variable "@EnchantString".
Msg 137, Level 15, State 2, Line 16
Must declare the scalar variable "@EnchantString".




Have error
Next time read topic more carefully
Quote:
in usp_Insert_Action_Log_E
That is better solution:
SnickQ is offline  
Reply


Similar Threads Similar Threads
Enchant+9
07/16/2012 - General Gaming Discussion - 4 Replies
Hi is there any one enchanting my headgear +9 water !? i pay him ap if any one know how say me and we speak about price...
100% Enchant
02/17/2010 - Mabinogi - 77 Replies
Sorry I'm not very good at understanding/creating the kinds of programs and applications found on this forum so this might be a very silly question. Since there's a fastcook thing that makes only perfect playing successes (with playing instrument) I'm wondering if it's possible to make any enchant success only a great success. Thank you for any responses.
enchant?
02/19/2009 - Lineage 2 - 3 Replies
Hey! Im need hack for enchant. Im play L2 Interlude in server L2Mega. plz help me! Or any hack work this server
Sicher enchant/// Perfckt enchant
03/17/2007 - Lineage 2 - 6 Replies
kann mir einer einen richtig guten enchant trick sagen/// Everybody knows a very good enchnat trick? *edit* for c5? Germanl2



All times are GMT +2. The time now is 02:33.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.