What is this?
1. What is AccountItems and why is it needed?
Vico's Central Bank fix? Show me a link, probably old as hell xD
EDIT : As I thought, the thread was back in 2007. You can't trust anything old to work :P
Here's my scripts since they look like they have way more information than these ones.
sp.BringAccountItem :
Code:
USE [GunzDB]
GO
/****** Object: StoredProcedure [dbo].[spBringAccountItem] Script Date: 05/13/2009 22:19:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- 창고 아이템 내 캐릭터로 가져오기 ----------
CREATE PROC [dbo].[spBringAccountItem]
@AID int,
@CID int,
@AIID int
AS
SET NoCount On
DECLARE @ItemID int
DECLARE @CAID int
DECLARE @OrderCIID int
DECLARE @RentDate DATETIME
DECLARE @RentHourPeriod SMALLINT
DECLARE @Cnt SMALLINT
SELECT @ItemID=ItemID, @RentDate=RentDate, @RentHourPeriod=RentHourPeriod, @Cnt=Cnt
FROM AccountItem WHERE AIID = @AIID
SELECT @CAID = AID FROM Character WHERE CID=@CID
IF @ItemID IS NOT NULL AND @CAID = @AID
BEGIN
BEGIN TRAN ----------------
DELETE FROM AccountItem WHERE AIID = @AIID
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN
END
INSERT INTO CharacterItem (CID, ItemID, RegDate, RentDate, RentHourPeriod, Cnt)
VALUES (@CID, @ItemID, GETDATE(), @RentDate, @RentHourPeriod, @Cnt)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN
END
SET @OrderCIID = @@IDENTITY
INSERT INTO BringAccountItemLog (ItemID, AID, CID, Date)
VALUES (@ItemID, @AID, @CID, GETDATE())
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN
END
COMMIT TRAN ---------------
SELECT @OrderCIID AS ORDERCIID, @ItemID AS ItemID, (@RentHourPeriod*60) - (DateDiff(n, @RentDate, GETDATE())) AS RentPeriodRemainder
END
sp.BringBackAccountItem :
Code:
USE [GunzDB]
GO
/****** Object: StoredProcedure [dbo].[spBringBackAccountItem] Script Date: 05/13/2009 22:19:36 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- 내 캐릭터 캐쉬아이템을 창고에 넣기 ---------
CREATE PROC [dbo].[spBringBackAccountItem]
@AID int,
@CID int,
@CIID int
AS
SET NOCOUNT ON
DECLARE @ItemID int
DECLARE @RentDate DATETIME
DECLARE @RentHourPeriod SMALLINT
DECLARE @Cnt SMALLINT
DECLARE @HeadCIID int
DECLARE @ChestCIID int
DECLARE @HandsCIID int
DECLARE @LegsCIID int
DECLARE @FeetCIID int
DECLARE @FingerLCIID int
DECLARE @FingerRCIID int
DECLARE @MeleeCIID int
DECLARE @PrimaryCIID int
DECLARE @SecondaryCIID int
DECLARE @Custom1CIID int
DECLARE @Custom2CIID int
SELECT
@HeadCIID=head_slot, @ChestCIID=chest_slot, @HandsCIID=hands_slot,
@LegsCIID=legs_slot, @FeetCIID=feet_slot, @FingerLCIID=fingerl_slot, @FingerRCIID=fingerr_slot,
@MeleeCIID=melee_slot, @PrimaryCIID=primary_slot, @SecondaryCIID=secondary_slot,
@Custom1CIID=custom1_slot, @Custom2CIID=custom2_slot
FROM Character(nolock) WHERE cid=@CID AND aid=@AID
SELECT @ItemID=ItemID, @RentDate=RentDate, @RentHourPeriod=RentHourPeriod, @Cnt=Cnt
FROM CharacterItem WHERE CIID=@CIID AND CID=@CID
IF ((@ItemID IS NOT NULL) AND (@ItemID >= 400000) AND
(@HeadCIID IS NULL OR @HeadCIID != @CIID) AND
(@ChestCIID IS NULL OR @ChestCIID != @CIID) AND
(@HandsCIID IS NULL OR @HandsCIID != @CIID) AND
(@LegsCIID IS NULL OR @LegsCIID != @CIID) AND
(@FeetCIID IS NULL OR @FeetCIID != @CIID) AND
(@FingerLCIID IS NULL OR @FingerLCIID != @CIID) AND
(@FingerRCIID IS NULL OR @FingerRCIID != @CIID) AND
(@MeleeCIID IS NULL OR @MeleeCIID != @CIID) AND
(@PrimaryCIID IS NULL OR @PrimaryCIID != @CIID) AND
(@SecondaryCIID IS NULL OR @SecondaryCIID != @CIID) AND
(@Custom1CIID IS NULL OR @Custom1CIID != @CIID) AND
(@Custom2CIID IS NULL OR @Custom2CIID != @CIID))
BEGIN
BEGIN TRAN -------------
UPDATE CharacterItem SET CID=NULL WHERE CIID=@CIID AND CID=@CID
IF 0 = @@ROWCOUNT BEGIN
ROLLBACK TRAN
RETURN
END
INSERT INTO AccountItem (AID, ItemID, RentDate, RentHourPeriod, Cnt)
VALUES (@AID, @ItemID, @RentDate, @RentHourPeriod, @Cnt)
IF 0 <> @@ERROR BEGIN
ROLLBACK TRAN
RETURN
END
COMMIT TRAN -----------
END
sp.SelectAccountItem :
Code:
USE [GunzDB]
GO
/****** Object: StoredProcedure [dbo].[spSelectAccountItem] Script Date: 05/13/2009 22:17:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/* 중앙은행 아이템 보기 */
CREATE PROC [dbo].[spSelectAccountItem]
@AID int
AS
SET NOCOUNT ON
DECLARE @NowTime DATETIME
SELECT @NowTime = GETDATE()
SELECT AIID, ItemID, (RentHourPeriod*60) - (DateDiff(n, RentDate, @NowTime)) AS RentPeriodRemainder
FROM AccountItem(NOLOCK)
WHERE AID=@AID ORDER BY AIID