CashShop Plus -- Fully working 90% + 10%(Your hands-on)
CashShop+
Click here to download
***FEATURES***
Better security compare to old chumpy.cashShop(with respect)
Can sell goods for account (like premium services)
Prototype Interface of offical Cabal+ cashshop.
PrototypeJS integration (Scriptaculous)
Switchable currency (cash/tpoint)
Search function implemented
2 Tabs switchable category
For the Leechers
As the title say's you need to hands-on in order to work 100% not just copy/paste.
The part of this release which I didn't include is the
buying query.
but I can give you pointers for that so you will know where to start.
http://i43.tinypic.com/2hrfrdl.jpg
CashAccountPlus
Code:
USE [CabalCash]
GO
/****** Object: Table [dbo].[CashAccountPlus] Script Date: 11/12/2013 21:42:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[CashAccountPlus](
[ID] [varchar](50) NOT NULL,
[UserNum] [int] NOT NULL,
[Cash] [int] NOT NULL,
[CashBonus] [int] NOT NULL,
[CashTotal] AS ([Cash]+[CashBonus]),
[UpdateDateTime] [datetime] NOT NULL,
CONSTRAINT [PK_CashAccont+] PRIMARY KEY CLUSTERED
(
[UserNum] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[CashAccountPlus] ADD CONSTRAINT [DF_CashAccountPlus_Cash] DEFAULT ((0)) FOR [Cash]
GO
ALTER TABLE [dbo].[CashAccountPlus] ADD CONSTRAINT [DF_CashAccountPlus_CashBonus] DEFAULT ((0)) FOR [CashBonus]
GO
ALTER TABLE [dbo].[CashAccountPlus] ADD CONSTRAINT [DF_CashAccountPlus_UpdateDateTime] DEFAULT (getdate()) FOR [UpdateDateTime]
GO
ShopItems Table
Code:
USE [CabalCash]
GO
/****** Object: Table [dbo].[ShopItems] Script Date: 11/12/2013 21:25:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ShopItems](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](200) NOT NULL,
[Description] [varchar](500) NOT NULL,
[ItemIdx] [int] NOT NULL,
[DurationIdx] [int] NOT NULL,
[ItemOpt] [int] NOT NULL,
[Image] [varchar](50) NOT NULL,
[Price] [int] NOT NULL,
[Category] [int] NOT NULL,
[Stock] [int] NOT NULL,--this is the Available column
[Rank] [int] NOT NULL, --used for Best selling items
[Count] [int] NOT NULL, --count of goods
[Shop] [int] NOT NULL, --1=cash, 2=tpoint
CONSTRAINT [PK_ShopItems] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo].[ShopItems] ADD CONSTRAINT [DF_ShopItems_Rank] DEFAULT ((0)) FOR [Rank]
GO
ALTER TABLE [dbo].[ShopItems] ADD CONSTRAINT [DF_ShopItems_Count] DEFAULT ((1)) FOR [Count]
GO
ALTER TABLE [dbo].[ShopItems] ADD CONSTRAINT [DF_ShopItems_Shop] DEFAULT ((1)) FOR [Shop]
GO
This is same as GetBankAlz
Code:
USE [CabalCash]
GO
/****** Object: StoredProcedure [dbo].[up_Plus_GetCash] Script Date: 11/12/2013 21:34:57 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[up_Plus_GetCash](@ID varchar(20), @UserNum int ) AS
BEGIN
if (NOT EXISTS(SELECT UserNum FROM CashAccountPlus WHERE UserNum = @UserNum))
BEGIN
INSERT CashAccountPlus(ID, UserNum, Cash, CashBonus, UpdateDateTime)
VALUES ( @ID, @UserNum, 0, 0, GETDATE() )
END
SELECT UserNum, Cash
FROM CashAccountPlus
WHERE UserNum = @UserNum
END
The buying StoredProcedure
Code:
USE [CabalCash]
GO
/****** Object: StoredProcedure [dbo].[up_Plus_BuyItem] Script Date: 11/12/2013 21:32:37 ******/
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[up_Plus_BuyItem](
@UserNum int,
@ServerIdx int,
@ItemIdx int,
@ItemOpt int,
@ItemDur int,
@ItemCount int
)AS
BEGIN
SET NOCOUNT ON
DECLARE @Price INT, @Num INT, @CashPre INT,@PREMDUR DATETIME, @Type INT
IF (NOT EXISTS(SELECT * FROM ShopItems WHERE ItemIdx = @ItemIdx))
BEGIN
SELECT 'Item Not Found'
RETURN
END
IF (@ItemDur=1) BEGIN SET @PREMDUR=DATEADD(HOUR, 1, GETDATE()) END ELSE
IF (@ItemDur=2) BEGIN SET @PREMDUR=DATEADD(HOUR, 2, GETDATE()) END ELSE
IF (@ItemDur=3) BEGIN SET @PREMDUR=DATEADD(HOUR, 3, GETDATE()) END ELSE
IF (@ItemDur=4) BEGIN SET @PREMDUR=DATEADD(HOUR, 4, GETDATE()) END ELSE
IF (@ItemDur=5) BEGIN SET @PREMDUR=DATEADD(HOUR, 5, GETDATE()) END ELSE
IF (@ItemDur=6) BEGIN SET @PREMDUR=DATEADD(HOUR, 6, GETDATE()) END ELSE
IF (@ItemDur=7) BEGIN SET @PREMDUR=DATEADD(HOUR, 10, GETDATE()) END ELSE
IF (@ItemDur=8) BEGIN SET @PREMDUR=DATEADD(HOUR, 12, GETDATE()) END ELSE
IF (@ItemDur=9) BEGIN SET @PREMDUR=DATEADD(DAY, 1, GETDATE()) END ELSE
IF (@ItemDur=10) BEGIN SET @PREMDUR=DATEADD(DAY, 3, GETDATE()) END ELSE
IF (@ItemDur=11) BEGIN SET @PREMDUR=DATEADD(DAY, 5, GETDATE()) END ELSE
IF (@ItemDur=12) BEGIN SET @PREMDUR=DATEADD(DAY, 7, GETDATE()) END ELSE
IF (@ItemDur=13) BEGIN SET @PREMDUR=DATEADD(DAY, 10, GETDATE()) END ELSE
IF (@ItemDur=14) BEGIN SET @PREMDUR=DATEADD(DAY, 14, GETDATE()) END ELSE
IF (@ItemDur=15) BEGIN SET @PREMDUR=DATEADD(DAY, 15, GETDATE()) END ELSE
IF (@ItemDur=16) BEGIN SET @PREMDUR=DATEADD(DAY, 20, GETDATE()) END ELSE
IF (@ItemDur=17) BEGIN SET @PREMDUR=DATEADD(DAY, 30, GETDATE()) END ELSE
IF (@ItemDur=18) BEGIN SET @PREMDUR=DATEADD(DAY, 45, GETDATE()) END ELSE
IF (@ItemDur=19) BEGIN SET @PREMDUR=DATEADD(DAY, 60, GETDATE()) END ELSE
IF (@ItemDur=20) BEGIN SET @PREMDUR=DATEADD(DAY, 90, GETDATE()) END ELSE
IF (@ItemDur=21) BEGIN SET @PREMDUR=DATEADD(DAY, 100, GETDATE()) END ELSE
IF (@ItemDur=22) BEGIN SET @PREMDUR=DATEADD(DAY, 120, GETDATE()) END ELSE
IF (@ItemDur=23) BEGIN SET @PREMDUR=DATEADD(DAY, 180, GETDATE()) END ELSE
IF (@ItemDur=24) BEGIN SET @PREMDUR=DATEADD(DAY, 270, GETDATE()) END ELSE
IF (@ItemDur=25) BEGIN SET @PREMDUR=DATEADD(DAY, 367, GETDATE()) END ELSE
IF (@ItemDur=26) BEGIN SET @PREMDUR=DATEADD(MINUTE, 3, GETDATE()) END ELSE
IF (@ItemDur>=27) BEGIN SET @PREMDUR=DATEADD(YEAR, 99, GETDATE()) END
SELECT @Type = Category FROM ShopItems WHERE ItemIdx=@ItemIdx
SELECT @Price = @ItemCount*Price FROM ShopItems WHERE ItemIdx=@ItemIdx
SELECT @CashPre=Cash FROM CashAccountPlus WHERE UserNum=@UserNum
IF @CashPre<@Price
BEGIN
RETURN -1
END
BEGIN TRAN
SET @Num = 1
WHILE @Num<=@ItemCount
BEGIN
IF(@Type>=2) --To Character
BEGIN
INSERT INTO MyCashItem (UserNum,TranNo,ServerIdx,ItemKindIdx,ItemOpt,DurationIdx)
VALUES (@UserNum,0,@ServerIdx,@ItemIdx,@ItemOpt,@ItemDur)
IF(@@RowCount < 1)
BEGIN
ROLLBACK TRAN
RETURN -2
END
END
IF(@Type=1) --Premium for Account
BEGIN
IF (NOT EXISTS(SELECT * FROM Account.dbo.cabal_charge_auth WHERE UserNum = @UserNum))
BEGIN
INSERT INTO Account.dbo.cabal_charge_auth(UserNum,[Type],[ExpireDate],PayMinutes,ServiceKind)
VALUES (@UserNum,0,@PREMDUR,0,@ItemIdx)
IF(@@RowCount < 1)
BEGIN
ROLLBACK TRAN
RETURN -2
END
END
ELSE IF (EXISTS(SELECT * FROM Account.dbo.cabal_charge_auth WHERE UserNum = @UserNum))
BEGIN
UPDATE Account.dbo.cabal_charge_auth SET [ExpireDate]=@PREMDUR, ServiceKind=@ItemIdx WHERE UserNum=@UserNum
IF(@@RowCount < 1)
BEGIN
ROLLBACK TRAN
RETURN -3
END
END
END
SET @Num=@Num+1
END
UPDATE ShopItems SET Stock=Stock-@ItemCount, [Rank]=[Rank]+1 where ItemIdx=@ItemIdx
IF(@@RowCount < 1)
BEGIN
ROLLBACK TRAN
RETURN -4
END
UPDATE CashAccountPlus SET Cash=Cash-@Price, UpdateDateTime = GETDATE() WHERE UserNum = @UserNum
IF(@@RowCount < 1)
BEGIN
ROLLBACK TRAN
RETURN -5
END
INSERT INTO CashLog(Usernum,LogType,CashPre,CashBonusPre,CashAfter,CashBonusAfter,ChangeCash,ChangeCashBonus,ItemCD,TranNo)
VALUES (@UserNum,2,@CashPre,0,@CashPre-@Price,0,0-@Price,0,@ItemIdx,CAST(GETDATE() AS INT)+@Price)
IF(@@RowCount < 1)
BEGIN
ROLLBACK TRAN
RETURN -6
END
COMMIT TRAN
END
GOODLUCK TO YOU!!!
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
More sleeker design + for you, so whats all about the buying query you didnt released? ;D
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
The people should do something.. Not just live with others good's..
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
Quote:
Originally Posted by
blade99
whats all about the buying query you didnt released? ;D
yep because if its included then the result is copy/paste..
You need to code it on your own if you call your self a developer then you can do it without a palm on your forehead. :D
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
such a nice work it worked for me :)
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
too bad for me because i am in experience..
but thanks for the great release..
got to bookmark this page, hoping to learn how to make this work :):
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
i love the style and it looks refreshing in your eyes but! i need some help! i have used fresh DB's.
//GetBankAlz
http://img34.imageshack.us/img34/2346/67vy.png
Uploaded with ImageShack.us
//ShopItems Table
http://img690.imageshack.us/img690/2834/4v9n.png
Uploaded with ImageShack.us
//StoredProcedure
http://img23.imageshack.us/img23/4198/lkl8.png
Uploaded with ImageShack.us
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
Quote:
Originally Posted by
4pLay
i love the style and it looks refreshing in your eyes but! i need some help! i have used fresh DB's.
don't just copy/paste/run the queries, examine it first before applying. :D
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
Quote:
Originally Posted by
oOSpikeOo
well i think cabal game shop doesnt support plugins (im not sure)
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
@PX2000, you know why i like you release? Its not the shop itself, cuz for me its useless, its about that in your release its not just copy/paste. Now you putted the others members to work on it, studying it to get it working. Good job.
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
HINT: ALTER means you already have it on your database.
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
upload your cabalcash.bak plix .px2000
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
@Sidzinho, try make it workin yourself, dont except to be copy/paste.
Re: CashShop Plus -- Fully working 90% + 10%(Your hands-on)
Quote:
Originally Posted by
Sidzinho
upload your cabalcash.bak plix .px2000
Like the comfortably and ready-made
XD