|
You last visited: Today at 02:33
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.
07/31/2014, 15:57
|
#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
Code:
USE [PS_GameLog]
GO
/****** Object: StoredProcedure [dbo].[usp_Insert_Action_Log_E] Script Date: 2014-07-31 14:18:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** Object: Stored Procedure dbo.usp_Insert_Action_Log_E ******/
ALTER Proc [dbo].[usp_Insert_Action_Log_E]
@UserID varchar(18),
@UserUID int,
@CharID int,
@CharName varchar(50),
@CharLevel tinyint,
@CharExp int,
@MapID smallint,
@PosX real,
@PosY real,
@PosZ real,
@ActionTimeZ varchar(50),
@ActionType tinyint,
@Value1 bigint = null,
@Value2 int = null,
@Value3 int = null,
@Value4 bigint = null,
@Value5 int = null,
@Value6 int = null,
@Value7 int = null,
@Value8 int = null,
@Value9 int = null,
@Value10 int = null,
@Text1 varchar(100) = '',
@Text2 varchar(100) = '',
@Text3 varchar(100) = '',
@Text4 varchar(100) = '',
@Sql nvarchar(4000) = '',
@yyyy varchar(4) = '',
@mm varchar(2) = '',
@dd varchar(2) = '',
@Bucket smallint = -1,
@Craftname Varchar(20) = ''
AS
DECLARE @ActionTime as datetime
DECLARE @Enchant varchar(2)
DECLARE @NewCraftname varchar(20)
SELECT @ActionTime = CONVERT(datetime, @ActionTimeZ, 120)
SET @yyyy = datepart(yyyy, @ActionTime)
SET @mm = datepart(mm, @ActionTime)
SET @dd = datepart(dd, @ActionTime)
IF(LEN(@mm) = 1)
BEGIN
SET @mm = '0' + @mm
END
IF(LEN(@dd) = 1)
BEGIN
SET @dd = '0' + @dd
END
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
SET @Sql = N'
INSERT INTO PS_GameLog.dbo.ActionLog
(UserID, UserUID, CharID, CharName, CharLevel, CharExp, MapID, PosX, PosY, PosZ, ActionTime, ActionType, Craftname,
Value1, Value2, Value3, Value4, Value5, Value6, Value7, Value8, Value9, Value10, Text1, Text2, Text3, Text4)
VALUES(@UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType, @Craftname,
@Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4, @Craftname)'
EXEC sp_executesql @Sql,
N'@UserID varchar(18), @UserUID int, @CharID int, @CharName varchar(50), @Craftname Varchar(20),
@CharLevel tinyint, @CharExp int, @MapID smallint, @PosX real, @PosY real, @PosZ real, @ActionTime datetime, @ActionType tinyint, @Craftname Varchar(20,
@Value1 bigint, @Value2 int, @Value3 int, @Value4 bigint, @Value5 int, @Value6 int, @Value7 int, @Value8 int,
@Value9 int, @Value10 int, @Text1 varchar(100), @Text2 varchar(100), @Text3 varchar(100), @Text4 varchar(100)',
@UserID, @UserUID, @CharID, @CharName, @CharLevel, @CharExp, @MapID, @PosX, @PosY, @PosZ, @ActionTime, @ActionType, @Craftname,
@Value1, @Value2, @Value3, @Value4, @Value5, @Value6, @Value7, @Value8, @Value9, @Value10, @Text1, @Text2, @Text3, @Text4
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
|
|
|
07/31/2014, 16:48
|
#2
|
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.
|
|
|
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
|
|
|
07/31/2014, 18:49
|
#4
|
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
|
|
|
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
|
|
|
08/01/2014, 09:00
|
#6
|
elite*gold: 1
Join Date: Dec 2010
Posts: 33,275
Received Thanks: 5,709
|
Shaiya -> Shaiya PServer Development
#moved
|
|
|
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?
|
|
|
08/01/2014, 15:07
|
#8
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,451
|
Quote:
Originally Posted by szymo228
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
|
|
|
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].
|
|
|
08/02/2014, 00:22
|
#10
|
elite*gold: 10
Join Date: Jan 2012
Posts: 1,698
Received Thanks: 5,451
|
Quote:
Originally Posted by szymo228
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
|
|
|
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
|
|
|
01/13/2015, 12:57
|
#12
|
elite*gold: 260
Join Date: Sep 2011
Posts: 487
Received Thanks: 359
|
Quote:
Originally Posted by astross
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:
|
|
|
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.
|
|