Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Yes!! u can use the Sql Server 2000

Status
Not open for further replies.
Newbie Spellweaver
Joined
Jan 25, 2005
Messages
24
Reaction score
0
to use the sql server 2000 in the gunz server, opem the Query analizer, select the Guns database, and execulte this query

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spGetCharList]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'-- =============================================
-- Author: Mythical
-- Create date: Dec 25, 2006
-- Description: Merry XMAS!
-- =============================================
CREATE PROCEDURE [dbo].[spGetCharList]
-- Add the parameters for the stored procedure here
@nAID INT
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

-- Insert statements for procedure here
SELECT Level,CharNum,Name
FROM Character
WHERE AID = @nAID
END






'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[Items]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Items](
[CID] [int] NULL,
[ItemID] [int] NULL,
[CIID] [int] IDENTITY(1,1) NOT NULL,
[RentPeriodRemainder] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[Accounts]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Accounts](
[AID] [int] IDENTITY(1,1) NOT NULL,
[UserID] [varchar](50) NOT NULL,
[Password] [varchar](50) NOT NULL,
[UGradeID] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[Character]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Character](
[AID] [int] NULL,
[Name] [varchar](50) NULL,
[CharIndex] [int] NULL,
[Level] [int] NULL,
[Sex] [int] NULL,
[Costume] [int] NULL,
[Face] [int] NULL,
[Hair] [int] NULL,
[ClanName] [varchar](50) NULL,
[XP] [int] NULL,
[BP] [money] NULL,
[head_itemid] [int] NULL,
[chest_itemid] [int] NULL,
[hands_itemid] [int] NULL,
[legs_itemid] [int] NULL,
[feet_itemid] [int] NULL,
[fingerl_itemid] [int] NULL,
[fingerr_itemid] [int] NULL,
[melee_itemid] [int] NULL,
[primary_itemid] [int] NULL,
[secondary_itemid] [int] NULL,
[custom1_itemid] [int] NULL,
[custom2_itemid] [int] NULL,
[CharNum] [int] NULL,
[CID] [int] IDENTITY(1,1) NOT NULL,
[HP] [int] NULL,
[AP] [int] NULL,
[FR] [int] NULL,
[CR] [int] NULL,
[ER] [int] NULL,
[WR] [int] NULL,
[KillCount] [int] NULL,
[DeathCount] [int] NULL,
[PlayTime] [int] NULL,
[CLID] [int] NULL,
[ClanGrade] [int] NULL,
[ClanContPoint] [int] NULL,
[head_slot] [int] NULL,
[chest_slot] [int] NULL,
[hands_slot] [int] NULL,
[legs_slot] [int] NULL,
[feet_slot] [int] NULL,
[fingerl_slot] [int] NULL,
[fingerr_slot] [int] NULL,
[melee_slot] [int] NULL,
[primary_slot] [int] NULL,
[secondary_slot] [int] NULL,
[custom1_slot] [int] NULL,
[custom2_slot] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[Friend]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[Friend](
[CID] [int] NULL,
[FriendCID] [int] NULL,
[Favorite] [int] NULL,
[Name] [varchar](50) NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[ServerStatus]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[ServerStatus](
[ServerID] [int] NULL,
[ServerName] [nvarchar](32) NULL,
[PlayerCount] [int] NULL,
[MaxPlayer] [int] NULL
) ON [PRIMARY]
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spSellBountyItem]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spSellBountyItem]
@nCID INT,
@nItemID INT,
@nCIID INT,
@nPrice INT,
@nCharBP INT
AS
BEGIN
SET NOCOUNT ON;

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

UPDATE Character SET BP = BP + @nPrice
Select 1 Ret
END


'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spSelectCharItem]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spSelectCharItem]
@CID INT
AS
BEGIN
SET NOCOUNT ON;

SELECT RentPeriodRemainder,CIID,ItemID
FROM
Items
WHERE CID = @CID
END



'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spBuyBountyItem]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spBuyBountyItem]
@nCID INT,
@nItemID INT,
@nPrice INT
AS
BEGIN
SET NOCOUNT ON;

UPDATE Character SET BP = BP-@nPrice
INSERT INTO Items
VALUES(@nCID,@nItemID,NULL)
SELECT 0 OrderCIID

END





'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spGetLoginInfo]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spGetLoginInfo]
@szAccountName varchar(50)
AS
BEGIN
SET NOCOUNT ON;

SELECT AID, Password
FROM Accounts
WHERE UserID = @szAccountName
END



'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spGetAccountInfo]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spGetAccountInfo]
@nAID INT
AS
BEGIN
SET NOCOUNT ON;

SELECT AID,UGradeID,UserID
FROM Accounts
WHERE AID = @nAID
END




'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spUpdateCharInfoData]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spUpdateCharInfoData]
@nAddedXP INT,
@nAddedBP INT,
@nAddedKillCount INT,
@nAddedDeathCount INT,
@nCID INT
AS
UPDATE Character
SET XP = XP+@nAddedXP,
BP = BP+@nAddedBP,
KillCount = KillCount+@nAddedKillCount,
DeathCount = DeathCount+@nAddedDeathCount
WHERE CID = @nCID'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spUpdateEquipItem]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spUpdateEquipItem]
@nCID INT,
@parts INT,
@nCIID INT,
@nItemID INT
AS
BEGIN
SET NOCOUNT ON;

IF @parts = 0
UPDATE Character
SET head_itemid = @nItemID,
head_slot = @nCIID
WHERE CID = @nCID

IF @parts = 1
UPDATE Character
SET chest_itemid = @nItemID,
chest_slot = @nCIID
WHERE CID = @nCID

IF @parts = 2
UPDATE Character
SET hands_itemid = @nItemID,
hands_slot = @nCIID
WHERE CID = @nCID

IF @parts = 3
UPDATE Character
SET legs_itemid = @nItemID,
legs_slot = @nCIID
WHERE CID = @nCID

IF @parts = 4
UPDATE Character
SET feet_itemid = @nItemID,
feet_slot = @nCIID
WHERE CID = @nCID

IF @parts = 5
UPDATE Character
SET fingerl_itemid = @nItemID,
fingerl_slot = @nCIID
WHERE CID = @nCID

IF @parts = 6
UPDATE Character
SET fingerr_itemid = @nItemID,
fingerr_slot = @nCIID
WHERE CID = @nCID

IF @parts = 7
UPDATE Character
SET melee_itemid = @nItemID,
melee_slot = @nCIID
WHERE CID = @nCID

IF @parts = 8
UPDATE Character
SET primary_itemid = @nItemID,
primary_slot = @nCIID
WHERE CID = @nCID

IF @parts = 9
UPDATE Character
SET secondary_itemid = @nItemID,
secondary_slot = @nCIID
WHERE CID = @nCID

IF @parts = 10
UPDATE Character
SET custom1_itemid = @nItemID,
custom1_slot = @nCIID
WHERE CID = @nCID

IF @parts = 11
UPDATE Character
SET custom2_itemid = @nItemID,
custom2_slot = @nCIID
WHERE CID = @nCID

Select 1 Ret
END




'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spInsertChar]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spInsertChar]
@nAID INT,
@nCharIndex INT,
@szName nvarchar(32),
@nSex INT,
@nHair INT,
@nFace INT,
@nCostume INT
AS
BEGIN
SET NOCOUNT ON;

DECLARE @cnt INT
SELECT @cnt=COUNT(*)
FROM Character
WHERE AID = @nAID

DECLARE @cid INT
SELECT @cid=COUNT(*)
FROM Character

INSERT INTO Character
VALUES(@nAID,@szName,@cnt,50,@nSex,@nCostume,@nFace,@nHair,NULL,0,100000,0,0,0,0,0,0,0,0,0,0,0,0,@cnt,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
END








'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spGetAccountCharInfo]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spGetAccountCharInfo]
@nAID INT,
@nCharIndex INT
AS
BEGIN
SET NOCOUNT ON;

SELECT custom2_itemid, custom1_itemid, secondary_itemid, primary_itemid, melee_itemid, fingerr_itemid, fingerl_itemid, feet_itemid, legs_itemid, hands_itemid, chest_itemid, head_itemid, BP, XP, Face, Hair, Sex, Level, CharNum, ClanName, Name
FROM Character
WHERE AID = @nAID AND CharIndex = @nCharIndex
END





'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spDeleteChar]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spDeleteChar]
@nAID INT,
@nCharIndex INT,
@szCharName nvarchar(32)
AS
BEGIN
SET NOCOUNT ON;

DECLARE @Ret INT
SELECT @Ret =
COUNT(*)
FROM Character
WHERE Name = @szCharName AND CharIndex = @nCharIndex AND AID = @nAID

IF @Ret != 0
DELETE
FROM Character
WHERE Name = @szCharName AND CharIndex = @nCharIndex AND AID = @nAID

SELECT @Ret Ret

END



'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spGetCharInfoByCharNum]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spGetCharInfoByCharNum]
@nAID INT,
@nCharIndex INT
AS
BEGIN
SET NOCOUNT ON;

SELECT custom2_slot,custom1_slot,secondary_slot,primary_slot,melee_slot,fingerl_slot,fingerr_slot,feet_slot,legs_slot,hands_slot,chest_slot,head_slot,ClanContPoint,ClanGrade,ClanName,CLID,PlayTime,DeathCount,KillCount,CharNum,WR,ER,CR,FR,AP,HP,BP,XP,Face,Hair,Sex,Level,Name,CID
FROM Character
WHERE AID = @nAID AND CharIndex = @nCharIndex
END


'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spUpdateCharLevel]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spUpdateCharLevel]
@nLevel INT,
@nCID INT
AS
BEGIN
SET NOCOUNT ON;

UPDATE Character
SET Level = @nLevel
WHERE CID = @nCID
END

'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spUpdateCharBP]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spUpdateCharBP]
@nBP INT,
@nCID INT
AS
BEGIN
SET NOCOUNT ON;

UPDATE Character
SET BP = @nBP
WHERE CID = @nCID
END

'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spUpdateCharPlayTime]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spUpdateCharPlayTime]
@nPlayTime INT,
@nCID INT
AS
UPDATE Character
SET PlayTime = @nPlayTime
WHERE CID = @nCID'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spGetFriendList]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spGetFriendList]
@nCID INT
AS
SELECT Name,Favorite,FriendCID
FROM Friend
WHERE CID = @nCID

'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spAddFriend]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spAddFriend]
@nCID INT,
@nFriendCID INT,
@nFavorite INT
AS
DECLARE @Ret INT
SELECT @Ret = COUNT(*)
FROM Friend
WHERE CID = @nCID AND FriendCID = @nFriendCID

IF @Ret = 0
INSERT INTO Friend
VALUES(@nCID,@nFriendCID,@nFavorite,NULL)

SELECT @Ret Ret
'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spRemoveFriend]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spRemoveFriend]
@nCID INT,
@nFriendCID INT
AS
DELETE
FROM Friend
WHERE CID = @nCID AND FriendCID = @nFriendCID'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[spUpdateServerStatus]') AND type in (N'P', N'PC'))
BEGIN
EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[spUpdateServerStatus]
@ServerID INT,
@nPlayerCount INT
AS
UPDATE dbo.ServerStatus
SET PlayerCount = @nPlayerCount
WHERE ServerID = @ServerID
'
END
 
Custom Title Activated
Loyal Member
Joined
Nov 5, 2006
Messages
1,358
Reaction score
15
maybe you should release a .sql file...

anyways nice release
 

mts

Experienced Elementalist
Joined
Dec 31, 2006
Messages
298
Reaction score
3
nice job.. you are so crazy
 
Junior Spellweaver
Joined
Dec 23, 2006
Messages
145
Reaction score
0
Am I the only one who uses sql server 2000 since zyz released the db? lol.
 
Status
Not open for further replies.
Back
Top