[Release] Clan Procs

Junior Spellweaver
Joined
Nov 23, 2004
Messages
125
Reaction score
2
This is my own code, created from scratch. I take no responsibility for the use of my code. Expect Clan War procs when me and LGKiez get bored of them xD Kidding lol where working out bugs with point system atm.

Clan Table:

Code:
USE [GunzDB]
GO
/****** Object:  Table [dbo].[Clan]    Script Date: 01/28/2007 10:28:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Clan](
	[CLID] [int] NOT NULL,
	[Level] [int] NULL,
	[Name] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[ClanMaster] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[EmblemURL] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
	[TotalPoint] [int] NULL,
	[Point] [int] NULL,
	[Wins] [int] NULL,
	[Losses] [int] NULL,
	[MemberCount] [int] NULL,
	[Ranking] [int] NULL,
	[EmblemCheckSum] [varchar](20) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING OFF

spGetCharClan:

Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[spGetCharClan]
	@nCID varchar(50) 
AS
BEGIN
	SET NOCOUNT ON;

	SELECT ClanName
	FROM Character
	WHERE CID = @nCID
END

spRemoveClanMember:

Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Mackintosh> www.jointherev.org
-- Create date: <January 12, 2007>
-- Description:	This procedure will enable Clan Masters
-- to remove current clan members.
-- =============================================
CREATE PROCEDURE [dbo].[spRemoveClanMember]
	
	@CLID INT,
	@CID INT
AS
BEGIN

	UPDATE Character
	SET ClanGrade = 0, ClanName = NULL, CLID = 0
	WHERE CID = @CID

	SELECT @CLID Ret

END

spRemoveClanMemberFromCharName:

Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Mackintosh> www.jointherev.org
-- Create date: <January 12, 2007>
-- Description:	This procedure will enable Clan Masters
-- to remove current clan members.
-- =============================================
CREATE PROCEDURE [dbo].[spRemoveClanMemberFromCharName]
	
	@CLID INT,
	@CID INT,
	@UserID VARCHAR(20)
AS
BEGIN

	

	UPDATE Character
	SET ClanGrade = 0, ClanName = NULL, CLID = 0
	WHERE Name = @UserID

	SELECT @CLID Ret

END

spUpdateClanGrade:

Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		<Mackintosh> www.jointherev.org
-- Create date: <January 12, 2007>
-- Description:	Updates users status in the clan
-- ie. Leader
-- =============================================
CREATE PROCEDURE [dbo].[spUpdateClanGrade]
	
	@CLID INT,
	@CID INT,
	@Grade INT
AS
BEGIN

	UPDATE Character
	SET ClanGrade = @Grade
	WHERE CID = @CID

END

spAddClanMember:

Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[spAddClanMember] 
	@CLID int,
	@CID int,
	@unknown varchar(20)
AS
BEGIN
	SET NOCOUNT ON;

	DECLARE @clanName VARCHAR(20)

	SELECT @clanName = Name FROM Clan
	WHERE CLID = @CLID
	
	UPDATE Character
	SET ClanName = @clanName
	WHERE CID = @CID

	UPDATE Character
	SET CLID = @CLID
	WHERE CID = @CID

	SELECT @CLID Ret
	
END

spCreateClan:

Code:
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[spCreateClan] 
	@ClanName varchar(50),
	@Master int,
	@Founder1 int,
	@Founder2 int,
	@Founder3 int,
	@Founder4 int
AS
BEGIN
	SET NOCOUNT ON;

	DECLARE @clid INT
	SELECT @clid=(COUNT(*)+1)
	FROM Clan
	
	-- Add Clan master and founders
	UPDATE Character
	SET ClanName = @ClanName,
		CLID = @clid,
		ClanGrade = 1
	WHERE CID = @Master

	UPDATE Character
	SET ClanName = @ClanName,
		CLID = @clid
	WHERE CID = @Founder1

	UPDATE Character
	SET ClanName = @ClanName,
		CLID = @clid
	WHERE CID = @Founder2

	UPDATE Character
	SET ClanName = @ClanName,
		CLID = @clid
	WHERE CID = @Founder3

	UPDATE Character
	SET ClanName = @ClanName,
		CLID = @clid
	WHERE CID = @Founder4
	
	INSERT INTO Clan ([CLID],[Name])
	VALUES (@clid, @ClanName)
	
SELECT @clid Ret, @clid NewCLID
END
 
Last edited:
Junior Spellweaver
Joined
Nov 23, 2004
Messages
125
Reaction score
2
Opps hit refresh guys I accidently included one of the original Procs xD and forgot to add spCreateClan -_-
 
Last edited:
ThuGie.NL - Webmaster
Joined
Apr 16, 2006
Messages
607
Reaction score
55
Uhm it can use some tweaking..
And souldnt
CREATE PROCEDURE [dbo].[spGetCharClan]
@nCID varchar(50)
AS
@nCID be a integer ?
since its a id and a id = integer
CID = Character ID after all..


and uhm..
You are working on the db with lgkeiz ?
And clan name = max 16
at least thats the max the server handles..
and the emblem checksum = integer
and for the emblem url max 256 chars but i guess max is the same..
For the original ClanMaster name that you have its
szMasterName
so for table = MasterName
MemberCount = nTotalMemberCount
table = TotalMemberCount

meh just in case you wanna use original naming.
 
Last edited:
Junior Spellweaver
Joined
Nov 23, 2004
Messages
125
Reaction score
2
Nah i don't want to use original naming this has nothing to do with GunZ DB im not trying to copy anything @_@ lol

and no where not working a db together, we don't share poop with eachother >.< Just stuck at the same place. Im sure alot of people have clan/clanwar already finished, it only took me like 10 minutes to make these just havent found the time to get working 100%
 
Last edited:
ThuGie.NL - Webmaster
Joined
Apr 16, 2006
Messages
607
Reaction score
55
As far as i know LGkeiz only needs to get the scoring to work,
But not sure though havent really had time to work on anything atm..

And thanks for clearing that up.
But you might wanna limit the clanname to 16 though ;),
And place nCID as int.
 
Experienced Elementalist
Joined
Oct 1, 2006
Messages
287
Reaction score
0
for me all works thx men I test it and work!!
 
Last edited:
Joined
Jul 20, 2005
Messages
621
Reaction score
11
MackInTosh - [Release] Clan Procs - RaGEZONE Forums


work?
 

mts

Experienced Elementalist
Joined
Dec 31, 2006
Messages
298
Reaction score
3
Finnaly Its Out!


edit:
darkxl learn english

4 ppl to create
 

mts

Experienced Elementalist
Joined
Dec 31, 2006
Messages
298
Reaction score
3
mack.. how many time to release clan wars procs? (scores) my players are getting crazy!
 
Experienced Elementalist
Joined
Apr 3, 2004
Messages
240
Reaction score
19
Thanks for sharing MackInTosh :)
Been trying to create them myself for a few weeks without success, testing those out, good work! :)
 
Master Summoner
Joined
Jan 1, 2007
Messages
509
Reaction score
2
.... bryan stfu if u dont know whats going on...

on the screenshot it said: 4 people to create, but he was alone with maybe 1 other person. and he said it wont work

so mts told him to learn english and read what it said.

dont try to be smart next time
 
Back
Top