SRO Item mall sql proc

03/31/2012 00:54 ThElitEyeS#1
Code:
USE [YourDB]
GO


/****** Coded By ThElitEyeS ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROC [dbo].[purchase]
@char varchar(50),
@code varchar(129),
@price int,
@amount int,
@plus int
AS
IF ((SELECT TOP 1 silk_own FROM SRO_VT_ACCOUNT.DBO.SK_Silk WHERE JID = (SELECT JID FROM SRO_VT_ACCOUNT.DBO.TB_User WHERE StrUserID = @char)) >= @price)
BEGIN
    DECLARE @empty int
    SELECT top 1 @empty = Slot FROM SRO_VT_SHARD.DBO._Inventory WHERE CharID = (SELECT CharID FROM SRO_VT_SHARD.DBO._Char WHERE CharName16 = @char) AND Slot >= 13 AND ItemID = 0 order by slot
    IF (@empty >= (SELECT InventorySize FROM SRO_VT_SHARD.DBO._Char WHERE CharName16 = @char))
    BEGIN
        SELECT 'Inventory is full.' AS INFO
    END
    ELSE
    BEGIN
        SELECT 'Item was placed on the selected Character.' AS INFO;
        DECLARE @itemid int
        DECLARE @serial varchar(129)
        DECLARE @newid bigint
        SELECT @itemid = ID FROM SRO_VT_SHARD.DBO._RefObjCommon WHERE CodeName128 = @code
        SELECT @serial = LatestItemSerial FROM SRO_VT_SHARD.DBO._LatestItemSerial
        SELECT @newid = ID64 FROM SRO_VT_SHARD.DBO._Items WHERE Serial64 = @serial
        INSERT INTO SRO_VT_SHARD.DBO._Items (RefItemID, OptLevel, Data, MagParamNum, Serial64) VALUES (@itemid, @plus, @amount, 0, @serial)
        INSERT INTO SRO_VT_SHARD.DBO._ItemPool (ItemID, InUse) VALUES (@newid, 1)
        UPDATE SRO_VT_SHARD.DBO._Inventory SET ItemID = @newid WHERE Slot = @empty AND  CharID = (SELECT CharID FROM SRO_VT_SHARD.DBO._Char WHERE CharName16 = @char)
        UPDATE SRO_VT_ACCOUNT.DBO.SK_Silk SET silk_own = silk_own - @price WHERE JID = (SELECT JID FROM SRO_VT_ACCOUNT.DBO.TB_User WHERE StrUserID = @char)
        INSERT INTO mall_log(character, code, price, amount, plus, date) VALUES (@char, @code, @price, @amount, @plus, GETDATE())
    END
END
ELSE
BEGIN
    SELECT 'Not enough silks' AS INFO
END
GO
Logs table



Code:
USE [YourDB]
GO
SET ANSI_NULLS ON
GO


SET QUOTED_IDENTIFIER ON
GO


SET ANSI_PADDING ON
GO


CREATE TABLE [dbo].[mall_log](
[id] [int] IDENTITY(1,1) NOT NULL,
[character] [varchar](50) NULL,
[code`] [varchar](129) NULL,
    [price] [int] NULL,
    [amount] [int] NULL,
    [plus] [int] NULL,
    [date] [datetime] NULL
) ON [PRIMARY]


GO


SET ANSI_PADDING OFF
GO
remove the ` from [code`]
03/31/2012 00:57 ThElitEyeS#2
hater :)

useless boy you was crying to me how to make item mall.
03/31/2012 00:57 LastThief*#3
Why should I hate on you ? Seriously.


People nowadays can't accept criticism !

I cried on you ? hahaha made my day.

You forgot when you was begging me to stop crashing your sql server and deleting your database ?

but well you're kid and you don't know what is criticism.
03/31/2012 00:58 PortalDark#4
Quote:
Originally Posted by LastThief* View Post
Why should I hate on you ? Seriously.


People nowadays can't accept criticism !
thats true(about criticism, not the idea in fact)
even if it is criticism, you two, try not making fuzz of it
but i have to say any share/help is appreciated
03/31/2012 01:00 ThElitEyeS#5
Quote:
Originally Posted by LastThief* View Post
Why should I hate on you ? Seriously.


People nowadays can't accept criticism !

I cried on you ? hahaha made my day.

You forgot when you was begging me to stop crashing your sql server and deleting your database ?
no i don't i remember when cherno was crashing it :facepalm:
KIDS

begging -> in your dreams
03/31/2012 01:07 PortalDark#6
guys, seriously, I told you not to make fuzz of it, at least not here
get a room somewhere and settle things there
03/31/2012 01:08 FoxRayz#7
Quote:
Originally Posted by LastThief* View Post
Why should I hate on you ? Seriously.


People nowadays can't accept criticism !

I cried on you ? hahaha made my day.

You forgot when you was begging me to stop crashing your sql server and deleting your database ?

but well you're kid and you don't know what is criticism.
Quote:
Originally Posted by PortalDark View Post
thats true(about criticism, not the idea in fact)
even if it is criticism, you two, try not making fuzz of it
but i have to say any share/help is appreciated
Criticism should be constructive and not based on personal disputes.


Ont: Some people here may find it useful so thanks :)
03/31/2012 01:09 PortalDark#8
Quote:
Originally Posted by FoxRayz View Post
Criticism should be constructive and not based on personal disputes.


Ont: Some people here may find it useful so thanks :)
i said, i like the idea of criticism, not the way he did
03/31/2012 01:10 LastThief*#9
Quote:
Originally Posted by FoxRayz View Post
Criticism should be constructive and not based on personal disputes.


Ont: Some people here may find it useful so thanks :)
It's not based on personal disputes infact it's just the truth that it's totally useless.
03/31/2012 01:12 FoxRayz#10
Quote:
Originally Posted by LastThief* View Post
It's not based on personal disputes infact it's just the truth that it's totally useless.
Still if this release wasnt from TheEliteEyes you wouldn't even bother to write in the topic. Maybe it's useless for you because you're already into php. But still there's some people that might need it.
03/31/2012 01:13 ThElitEyeS#11
Quote:
Originally Posted by FoxRayz View Post
Still if this release wasnt from TheEliteEyes you wouldn't even bother to write in the topic. Maybe it's useless for you because you're already into php. But still there's some people that might need it.
you can call it from php too.
he just crying cuz he couldn't make it.
03/31/2012 01:19 ✗EpicSoul✗#12
elite you cant say shit bro. u came into our Skype convo crying for help.
@topic why didnt you just send it to the kid that "cryed" at you.
03/31/2012 01:23 PortalDark#13
ok, seems that this will lead to a flamewar
anyone that keeps at it, will get reported
please guys, this is a SHARE, just say thank you and leave without being rude
03/31/2012 01:25 Keyeight#14
guys stop this stupid Ware and grow up if you dont like it someone else would like it bro
@topic

thx bro i find it useful for me
03/31/2012 01:26 PortalDark#15
Quote:
Originally Posted by ThElitEyeS View Post
1. i never cried for help.
2. you was doing this in team viewer.
3. you wasn't know how to fix the problem so stfu.
4. you and your friend was trolling me so both of you blocked and deleted .
tell me if you want to know any thing else
why you keep spamming and flaming
#reported