国王选举中加入贡献限制
/****** Object:Stored Procedure dbo.KING_ELECTION_PROC Script Date: 6/6/2006 6:03:33 PM ******/CREATE PROCEDURE .
@strAccountID char(21), -- Voted man's account
@strCharID char(21), -- Nick's vote
@byNation tinyint,
@strCandidacyID char(21), -- Nick chosen people
@nRet smallint OUTPUT
AS
DECLARE @nRow smallint
SELECT @nRow = Count(strAccountID) FROM KING_BALLOT_BOX WHEREstrAccountID = @strAccountID
IF @nRow > 0 -- Vote for one person
BEGIN
SET @nRet = -3
RETURN
END
DECLARE @Loyalty int
SELECT @Loyalty = Loyalty FROM USERDATA WHERE strUserID = @strCharID
IF @Loyalty < 1000
BEGIN
SET @nRet = -3
RETURN
END
INSERT INTO KING_BALLOT_BOX (strAccountID, strCharID, byNation, strCandidacyID )
VALUES ( @strAccountID, @strCharID, @byNation, @strCandidacyID )
UPDATE KING_ELECTION_LIST SET nMoney = nMoney + 1
WHEREbyType = 4 and strName = @strCandidacyID
SET @nRet =1
RETURN
GO
1# ctgwglzc
哪里控制贡献多少 挨~版本那里还没搞好,国王系统,暂时用不着,先收住先 收藏了!! 谢谢分享
页:
[1]