Hello, i am skold Co-foundeur and Dev 4story-RA
I have debug Tsavepet :
ALTER PROCEDURE [dbo].[TSavePet]
@dwCharID INT,
@wpetID SMALLINT,
@szName VARCHAR(50),
@timeUse SMALLDATETIME
AS
DECLARE @dwUserID INT
select @dwUserId = dwUserID from tchartable where dwCharID = @dwCharID
BEGIN TRAN TSavePet
IF not EXISTS(SELECT @dwUserID FROM TpetTABLE WHERE dwuserID = @dwuserID AND wpetID = @wpetID)
begin
INSERT INTO TpetTABLE(dwuserID, wpetID, szName, timeuse)
VALUES(@dwuserID, @wpetID, @szName, @timeUse)
END
ELSE
IF EXISTS(SELECT @dwUserID FROM TpetTABLE WHERE dwuserID = @dwuserID AND wpetID = 3)
BEGIN
UPDATE TpetTABLE SET
szName = @szName, timeuse = @timeUse
WHERE dwuserID = @dwuserID AND wpetID = @wpetID
END
COMMIT TRAN TSavePet
And if you i have this to create a mount at the creation of character but the name of pet change at every creation of character to the acount :
DECLARE @szMountName VARCHAR(50)
SET @szMountName = 'Amis de ' + @szNAME
SET @szMountName = REPLACE(@szMountName, 's''s', 's''')
IF not EXISTS(SELECT @dwUserID FROM TpetTABLE WHERE dwuserID = @dwuserID AND wpetID = 3)
begin
INSERT INTO TpetTABLE(dwuserID, wpetID, szName, timeuse)
VALUES(@dwuserID, 3, @szName, 0)
END
ELSE
IF EXISTS(SELECT @dwUserID FROM TpetTABLE WHERE dwuserID = @dwuserID AND wpetID = 3)
BEGIN
UPDATE TpetTABLE
SET szName = @szName, timeuse = 0
WHERE dwuserID = @dwuserID AND wpetID = 3
END
Good bye ;-)
I have debug Tsavepet :
ALTER PROCEDURE [dbo].[TSavePet]
@dwCharID INT,
@wpetID SMALLINT,
@szName VARCHAR(50),
@timeUse SMALLDATETIME
AS
DECLARE @dwUserID INT
select @dwUserId = dwUserID from tchartable where dwCharID = @dwCharID
BEGIN TRAN TSavePet
IF not EXISTS(SELECT @dwUserID FROM TpetTABLE WHERE dwuserID = @dwuserID AND wpetID = @wpetID)
begin
INSERT INTO TpetTABLE(dwuserID, wpetID, szName, timeuse)
VALUES(@dwuserID, @wpetID, @szName, @timeUse)
END
ELSE
IF EXISTS(SELECT @dwUserID FROM TpetTABLE WHERE dwuserID = @dwuserID AND wpetID = 3)
BEGIN
UPDATE TpetTABLE SET
szName = @szName, timeuse = @timeUse
WHERE dwuserID = @dwuserID AND wpetID = @wpetID
END
COMMIT TRAN TSavePet
And if you i have this to create a mount at the creation of character but the name of pet change at every creation of character to the acount :
DECLARE @szMountName VARCHAR(50)
SET @szMountName = 'Amis de ' + @szNAME
SET @szMountName = REPLACE(@szMountName, 's''s', 's''')
IF not EXISTS(SELECT @dwUserID FROM TpetTABLE WHERE dwuserID = @dwuserID AND wpetID = 3)
begin
INSERT INTO TpetTABLE(dwuserID, wpetID, szName, timeuse)
VALUES(@dwuserID, 3, @szName, 0)
END
ELSE
IF EXISTS(SELECT @dwUserID FROM TpetTABLE WHERE dwuserID = @dwuserID AND wpetID = 3)
BEGIN
UPDATE TpetTABLE
SET szName = @szName, timeuse = 0
WHERE dwuserID = @dwuserID AND wpetID = 3
END
Good bye ;-)