友情提示:奇迹私服无保障,喜爱奇迹请支持官方奇迹MU!

游戏资料库

你当前的位置:奇迹私发网 > 技术资料 > 内容

技术资料

修改战盟人数限制的存储过程


CREATE PROCEDURE    WZ_CS_ReqRegAttackGuild
    @iMapSvrGroup        SMALLINT,    -- 甘辑滚 弊缝
    @szGuildName        VARCHAR(8)    -- 傍己殿废阑 茄 辨靛捞抚
As
Begin
    BEGIN TRANSACTION
   
    SET NOCOUNT ON
    DECLARE    @iMaxRegGuildCount    INT                    -- 傍己俊 弥措 殿废且 荐 乐绰 辨靛 荐
    DECLARE    @iCurRegGuildCount    INT                    -- 泅犁 傍己俊 殿废茄 辨靛 荐
    SET         @iMaxRegGuildCount    = 100
    SELECT @iCurRegGuildCount = COUNT(*) FROM MuCastle_REG_SIEGE  WITH (READUNCOMMITTED)  WHERE MAP_SVR_GROUP = @iMapSvrGroup
    IF (@iCurRegGuildCount >= @iMaxRegGuildCount)
    BEGIN
            SELECT 6 As QueryResult                    -- 殿废茄 辨靛啊 捞固 N俺甫 逞菌澜
    END
    ELSE
    BEGIN
        IF EXISTS ( SELECT MAP_SVR_GROUP FROM MuCastle_REG_SIEGE  WITH (READUNCOMMITTED)
                    WHERE MAP_SVR_GROUP = @iMapSvrGroup and REG_SIEGE_GUILD = @szGuildName)
        BEGIN
            SELECT 2 As QueryResult                    -- 捞固 殿废登绢 乐澜
        END
        ELSE
        BEGIN
            DECLARE @szOwnGuildName        VARCHAR(8)
            SELECT @szOwnGuildName = OWNER_GUILD FROM MuCastle_DATA WHERE MAP_SVR_GROUP = @iMapSvrGroup
   
            -- 趣矫 荐己螟 辨靛啊 酒囱瘤 痢八
            IF (@szOwnGuildName = @szGuildName)
            BEGIN
                SELECT 3 As QueryResult                -- 荐己螟 辨靛烙
            END
            ELSE
            BEGIN
                IF NOT EXISTS ( SELECT G_Name FROM Guild  WITH (READUNCOMMITTED) WHERE G_Name = @szGuildName)
                BEGIN
                    SELECT 4 As QueryResult            -- 辨靛沥焊啊 粮犁窍瘤 臼澜
                END
                ELSE
                BEGIN
                    DECLARE @szGuildMaster            VARCHAR(10)
                    DECLARE @iGuildMasterLevel            INT
                    DECLARE @iGuildMemberCount            INT
                   
                    SELECT @szGuildMaster = G_Master FROM Guild WHERE G_Name = @szGuildName
                    SELECT @iGuildMasterLevel = cLevel FROM Character WHERE Name = @szGuildMaster
                    SELECT @iGuildMemberCount = COUNT(*) FROM GuildMember WHERE G_Name = @szGuildName
                   
                    IF (@iGuildMasterLevel < 200)  ----这里修改盟主的要求等级(默认就是要200或以上才能)
                    BEGIN
                        SELECT 5 As QueryResult        -- 辨靛付胶磐狼 饭骇捞 撤澜
                    END
                    ELSE
                    BEGIN
                        IF (@iGuildMemberCount < 0)  -----这里修改战盟人数限制,修改为0,一个人就能申请了
                        BEGIN
                            SELECT 8 As QueryResult    -- 辨靛盔 荐啊 何练
                        END
                        ELSE
                        BEGIN
                            DECLARE @iMAX_SEQNUM    INT    -- 泅犁 弥措 殿废锅龋
                            DECLARE @iNXT_SEQNUM    INT    -- 促澜 殿废锅龋
                            SELECT @iMAX_SEQNUM = MAX(SEQ_NUM) FROM MuCastle_REG_SIEGE  WITH (READUNCOMMITTED)  WHERE MAP_SVR_GROUP = @iMapSvrGroup
                           
                            IF (@iMAX_SEQNUM IS NULL)
                                SET @iNXT_SEQNUM    = 1
                            ELSE
                                SET @iNXT_SEQNUM    = @iMAX_SEQNUM + 1
                            INSERT INTO MuCastle_REG_SIEGE
                            VALUES (@iMapSvrGroup, @szGuildName, 0, 0, @iNXT_SEQNUM)
                   
                            SELECT 1 As QueryResult    -- 殿废 己傍
                        END
                    END
                END
            END
        END
    END
   
    IF(@@Error <> 0 )
        ROLLBACK TRANSACTION
    ELSE   
        COMMIT TRANSACTION
    SET NOCOUNT OFF   
End
GO

本文标签:

如需转载,请注明本文链接:http://www.598mu.com/jishu/201304033780.html



上一篇:修改个性套装属性设置 [经典原创]

下一篇:要塞套装掉率