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

Results 1 to 7 of 7
  1. #1
    Don't touch my Nutella! Witchy Moo is offline
    MemberRank
    Aug 2013 Join Date
    SingaporeLocation
    208Posts

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

    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]
        @GuiLdID    INT,
        @MemberID    INT,
        @MemberClass    TINYINT,
        @Permission    INT
    AS
    IF (NOT EXISTS (SELECT ID FROM [_Guild] WITH (NOLOCK) WHERE ID = @GuiLdID))
    BEGIN
        RETURN -1000
    END
    /* Guild Limit: Start */
    DECLARE @MemberLimit TINYINT
    SET @MemberLimit = 32 -- limit here
    IF ((SELECT COUNT(CharID) FROM [_GuildMember] WHERE GuildID = @GuiLdID) >= @MemberLimit)
    BEGIN
        RETURN 0
    END
    /* Guild Limit: End */
    BEGIN TRANSACTION
        DECLARE @rvalue INT
        DECLARE @joinDate SMALLDATETIME
        SET @joinDate = GETDATE()
        EXEC @rvalue = [_Guild_FnAddMember] @GuiLdID, @MemberID, @MemberClass, @joinDate, @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]
        @creatorguildID        INT,
        @FirstAllyGuildID    INT
    AS
    SET XACT_ABORT ON
    RETURN 0    -- Disable Union, comment this one if you want to re-enable Union
    BEGIN TRANSACTION
        DECLARE @AllianceID INT
        SET @AllianceID = 0
        INSERT INTO [_AlliedClans] VALUES @creatorguildID,@FirstAllyGuildID,0,0,0,0,0,0,GETDATE(),0,0)
        IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
        BEGIN
            ROLLBACK TRANSACTION
            RETURN -1
        END
        SET @AllianceID = @@IDENTITY
        IF  @AllianceID = 0)
        BEGIN
            ROLLBACK TRANSACTION
            RETURN -2
        END
        UPDATE [_Guild] SET Alliance = @AllianceID WHERE ID IN  @creatorguildID, @FirstAllyGuildID)
        IF (@@ERROR <> 0 OR @@ROWCOUNT <> 2)
        BEGIN
            ROLLBACK TRANSACTION
            RETURN -3
        END
    COMMIT TRANSACTION
    RETURN @AllianceID


  2. #2
    Apprentice hossamxt is offline
    MemberRank
    Jul 2012 Join Date
    16Posts

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

    i Got That Query Already Work On My DB I Wanna Return Back Guild Union Work !
    How i Can Made !

  3. #3
    No avatar RenePunik is offline
    MemberRank
    Feb 2013 Join Date
    1,430Posts

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

    Quote Originally Posted by hossamxt View Post
    i Got That Query Already Work On My DB I Wanna Return Back Guild Union Work !
    How i Can Made !
    From database backups.

  4. #4
    Don't touch my Nutella! Witchy Moo is offline
    MemberRank
    Aug 2013 Join Date
    SingaporeLocation
    208Posts

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

    Quote Originally Posted by hossamxt View Post
    i Got That Query Already Work On My DB I Wanna Return Back Guild Union Work !
    How i Can Made !
    Like i mentioned, my changes are in red. so, remove the red part

  5. #5
    No avatar RenePunik is offline
    MemberRank
    Feb 2013 Join Date
    1,430Posts

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

    I really appreciate your work, but who want to disable guilds or even unions?

  6. #6
    Don't touch my Nutella! Witchy Moo is offline
    MemberRank
    Aug 2013 Join Date
    SingaporeLocation
    208Posts

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

    i might. and u don't have to use it if you don't need it.

  7. #7
    Proficient Member tschulian is offline
    MemberRank
    Jul 2012 Join Date
    ErlangenLocation
    151Posts

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

    @Witchy Moo Rene wanna be a pro with his pro english tho ... *__* If he dont needs it, no one needs it.

    #request to close because RenePunik does not need this.

    lol.



Advertisement