[Tut-Release]How to Fix MPOG Item Shop

Junior Spellweaver
Joined
Apr 12, 2009
Messages
126
Reaction score
5
Not Hard to Fix and i dont know if it works 100% but the basic works






REALLY IMPORTANT!!!!:
to work you need to change in zitem IsCashItem="false" to IsCashItem="true"








First:
Execute this Fix For Central Bank:
PHP:
CREATE TABLE [dbo].[AccountItems](
	[AID] [int] NULL,
	[ItemID] [int] NULL,
	[AIID] [int] IDENTITY(1,1) NOT NULL,
	[RentPeriodRemainder] [int] NULL
) ON [PRIMARY]

PHP:
CREATE PROCEDURE [dbo].[spBringAccountItem]
	-- Add the parameters for the stored procedure here
	@nAID INT,
	@nCID INT,
	@nAIID INT
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	DECLARE @nItemID INT
	SELECT @nItemID=ItemID
	FROM AccountItems
	WHERE AID = @nAID AND AIID = @nAIID

	DELETE FROM AccountItems
	WHERE AID = @nAID AND AIID = @nAIID AND ItemID = @nItemID

	INSERT INTO Items VALUES (@nCID, @nItemID, NULL)
SELECT 0 As OrderCIID, @nItemID As ItemID

END
PHP:
CREATE PROCEDURE [dbo].[spBringBackAccountItem]
	-- Add the parameters for the stored procedure here
	@nAID INT,
	@nCID INT,
	@nCIID INT
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	DECLARE @nItemID INT
	SELECT @nItemID=ItemID
	FROM Items
	WHERE CID = @nCID AND CIID = @nCIID

	DELETE FROM Items
	WHERE CID = @nCID AND CIID = @nCIID AND ItemID = @nItemID

	INSERT INTO AccountItems VALUES (@nAID, @nItemID, NULL)

END
PHP:
CREATE PROCEDURE [dbo].[spSelectAccountItem]
	-- Add the parameters for the stored procedure here
	@AID INT
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	SELECT RentPeriodRemainder,AIID,ItemID
	FROM
	AccountItems
	WHERE AID = @AID
END

After That Fix Tables And Scripts :
diosz said:
good
Here are the files to the shop working properly = P

Just go to your database "GunzDB" -> tables -> Right click on "CasShop" Design and then choose edit in my image .....
Pauliinho - [Tut-Release]How to Fix MPOG Item Shop - RaGEZONE Forums

Pauliinho - [Tut-Release]How to Fix MPOG Item Shop - RaGEZONE Forums


do not edit the latest image bn let the "MaxWeight" sorry jiji

Okz

then replaced my files for your own and now works

go to the Web as admin and go to "Add Item to Shop" and add the weapon = P

Remember to do back up a file and the DB

Files = http://forum.ragezone.com/attachment.php?attachmentid=65960&d=1233191164

The last part =)

Open dbo.AccountItem table And Right Click > Design :

Pauliinho - [Tut-Release]How to Fix MPOG Item Shop - RaGEZONE Forums


Now Try To Add, Buy , Use the Items . It Works *-*
i dont remenber if i forgot something :D

Credits: Me,Vicio,Diosz,Wesman2232
 
Last edited:
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
 
O_o who uses mpog?.. Those who have anti sql injection then i feel good for, those who dont, sorry but meh u gonna get haxed some time >.>
 
o Fixed SQL Injection :D Remade some parts of MPOG, and i dont use it.


@Wes - Micro

i fixed mine doing this and works(add,buy,use)
 
Still not work lol !
The item's I put it to the storage , It work fine but I can't see the item's in the central bank !
Well , When i relog it back to my Inventory !
I think your forget some part :D
 
Back