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!

Easiest Way to Limit Guild Member and Disable Guild Union (T-SQL) (vSRO 1.188)

Experienced Elementalist
Joined
Aug 22, 2013
Messages
208
Reaction score
125
Hey :)

well this is old stuff but i recently made it for my server so i'll share. This prolly useless to you but you may use it if you like. By the way, I use original SP from vSRO 1.188, just added few codes in them.

Comes the boring part: (My changes are in red)

Limit Guild Member
Code:
USE [SRO_VT_SHARD]
GO
/****** Object:  StoredProcedure [dbo].[_Guild_AddMember]    Script Date: 06/10/2015 11:58:39 ******/
/*
 * Modified [_Guild_AddMember] StoredProcedure
 * Witchy Moo
 */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[_Guild_AddMember]
    [USER=237450]GuiL[/USER]dID    INT,
    @MemberID    INT,
    @MemberClass    TINYINT,
    @Permission    INT
AS
IF (NOT EXISTS (SELECT ID FROM [_Guild] WITH (NOLOCK) WHERE ID = [USER=237450]GuiL[/USER]dID))
BEGIN
    RETURN -1000
END
[COLOR=#ff0000]/* Guild Limit: Start */
DECLARE @MemberLimit TINYINT
SET @MemberLimit = 32 -- limit here
IF ((SELECT COUNT(CharID) FROM [_GuildMember] WHERE GuildID = [USER=237450]GuiL[/USER]dID) >= @MemberLimit)
BEGIN
    RETURN 0
END
/* Guild Limit: End */
[/COLOR]BEGIN TRANSACTION
    DECLARE @rvalue INT
    DECLARE [USER=1333469111]join[/USER]Date SMALLDATETIME
    SET [USER=1333469111]join[/USER]Date = GETDATE()
    EXEC @rvalue = [_Guild_FnAddMember] [USER=237450]GuiL[/USER]dID, @MemberID, @MemberClass, [USER=1333469111]join[/USER]Date, @Permission
    IF (@@ERROR <> 0 OR @rvalue <= 0)
    BEGIN
        ROLLBACK TRANSACTION
        RETURN @rvalue
    END
COMMIT TRANSACTION
RETURN 1
Disable Union (No fake guild whatsoever inside union list, it's simply disable the feature)
Code:
USE [SRO_VT_SHARD]
GO
/****** Object:  StoredProcedure [dbo].[_AllianceCreate]    Script Date: 06/10/2015 12:09:27 ******/
/*
 * Modified [_AllianceCreate] StoredProcedure
 * Witchy Moo
 */
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[_AllianceCreate]
    [USER=2000152611]creatorg[/USER]uildID        INT,
    @FirstAllyGuildID    INT
AS
SET XACT_ABORT ON
[COLOR=#ff0000]RETURN 0    -- Disable Union, comment this one if you want to re-enable Union[/COLOR]
BEGIN TRANSACTION
    DECLARE [USER=797847]Alli[/USER]anceID INT
    SET [USER=797847]Alli[/USER]anceID = 0
    INSERT INTO [_AlliedClans] VALUES [USER=2000152611]creatorg[/USER]uildID,@FirstAllyGuildID,0,0,0,0,0,0,GETDATE(),0,0)
    IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
    BEGIN
        ROLLBACK TRANSACTION
        RETURN -1
    END
    SET [USER=797847]Alli[/USER]anceID = @@IDENTITY
    IF  [USER=797847]Alli[/USER]anceID = 0)
    BEGIN
        ROLLBACK TRANSACTION
        RETURN -2
    END
    UPDATE [_Guild] SET Alliance = [USER=797847]Alli[/USER]anceID WHERE ID IN  [USER=2000152611]creatorg[/USER]uildID, @FirstAllyGuildID)
    IF (@@ERROR <> 0 OR @@ROWCOUNT <> 2)
    BEGIN
        ROLLBACK TRANSACTION
        RETURN -3
    END
COMMIT TRANSACTION
RETURN [USER=797847]Alli[/USER]anceID
 
Newbie Spellweaver
Joined
Jul 9, 2012
Messages
16
Reaction score
0
i Got That Query Already Work On My DB I Wanna Return Back Guild Union Work !
How i Can Made !
 
Experienced Elementalist
Joined
Aug 22, 2013
Messages
208
Reaction score
125
i might. and u don't have to use it if you don't need it.
 
Back
Top