FlyingPuts
Kayıtlı Üye
- Katılım
- 12 Ocak 2013
- Mesajlar
- 442
KODLARI Q.A YAPISTIRIN
Update_siege
UPDATE_SIEGE_CHALLENGER
[/HIDE]
UPDATE_SIEGE_CHALLENGER2
UPDATE_SIEGE_DECIDE_CHALLENGER
Knights_Siege_Warfare
Update_knights_war
[/hide]
Update_siege
View hidden content is available for registered users!
UPDATE_SIEGE_CHALLENGER
Kod:
CREATE PROCEDURE UPDATE_SIEGE_CHALLENGER
@sCastleIndex smallint,
@strChallengerList char(50)
AS
UPDATE KNIGHTS_SIEGE_WARFARE SET strChallengeList = @strChallengerList
WHERE sCastleIndex = @sCastleIndex
GO
UPDATE_SIEGE_CHALLENGER2
View hidden content is available for registered users!
UPDATE_SIEGE_DECIDE_CHALLENGER
View hidden content is available for registered users!
Knights_Siege_Warfare
Kod:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[KNIGHTS_SIEGE_WARFARE]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[KNIGHTS_SIEGE_WARFARE]
GO
CREATE TABLE [dbo].[KNIGHTS_SIEGE_WARFARE] (
[sCastleIndex] [smallint] NOT NULL ,
[sMasterKnights] [smallint] NOT NULL ,
[bySiegeType] [tinyint] NOT NULL ,
[byWarDay] [tinyint] NOT NULL ,
[byWarTime] [tinyint] NOT NULL ,
[byWarMinute] [tinyint] NOT NULL ,
[sChallengeList_1] [smallint] NOT NULL ,
[sChallengeList_2] [smallint] NOT NULL ,
[sChallengeList_3] [smallint] NOT NULL ,
[sChallengeList_4] [smallint] NOT NULL ,
[sChallengeList_5] [smallint] NOT NULL ,
[sChallengeList_6] [smallint] NOT NULL ,
[sChallengeList_7] [smallint] NOT NULL ,
[sChallengeList_8] [smallint] NOT NULL ,
[sChallengeList_9] [smallint] NOT NULL ,
[sChallengeList_10] [smallint] NOT NULL ,
[byWarRequestDay] [tinyint] NOT NULL ,
[byWarRequestTime] [tinyint] NOT NULL ,
[byWarRequestMinute] [tinyint] NOT NULL ,
[byGuerrillaWarDay] [tinyint] NOT NULL ,
[byGuerrillaWarTime] [tinyint] NOT NULL ,
[byGuerrillaWarMinute] [tinyint] NOT NULL ,
[strChallengeList] [char] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[sMoradonTariff] [smallint] NOT NULL ,
[sDellosTariff] [smallint] NOT NULL ,
[nDungeonCharge] [int] NOT NULL ,
[nMoradonTax] [int] NOT NULL ,
[nDellosTax] [int] NOT NULL ,
[sRequestList_1] [smallint] NOT NULL ,
[sRequestList_2] [smallint] NOT NULL ,
[sRequestList_3] [smallint] NOT NULL ,
[sRequestList_4] [smallint] NOT NULL ,
[sRequestList_5] [smallint] NOT NULL ,
[sRequestList_6] [smallint] NOT NULL ,
[sRequestList_7] [smallint] NOT NULL ,
[sRequestList_8] [smallint] NOT NULL ,
[sRequestList_9] [smallint] NOT NULL ,
[sRequestList_10] [smallint] NOT NULL
) ON [PRIMARY]
GO
Kod:
INSERT INTO [knights_siege_warfare] VALUES ('1','15003','5','3','5','54','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','NULL','20','20','0','0','0','0','0','0','0','0','0','0','0','0','0');
Update_knights_war
Kod:
ALTER PROCEDURE [dbo].[UPDATE_KNIGHTS_WAR]
@byType tinyint,
@shWhite smallint,
@shBlue smallint
AS
/*CPU*/
DECLARE @strWhiteName char(21)
DECLARE @strBlueName char(21)
SET @strWhiteName = NULL
SET @strBlueName = NULL
IF @byType = 1
BEGIN
SELECT @strWhiteName = IDName FROM KNIGHTS WHERE IDNum = @shWhite
SELECT @strBlueName = IDName FROM KNIGHTS WHERE IDNum = @shBlue
UPDATE KNIGHTS SET nWarEnemyID = @shBlue, strEnemyName = @strBlueName WHERE IDNum = @shWhite
UPDATE KNIGHTS SET nWarEnemyID = @shWhite, strEnemyName = @strWhiteName WHERE IDNum = @shBlue
END
ELSE IF @byType = 2
BEGIN
UPDATE KNIGHTS SET byOldWarResult = 2, nLose = nLose+1, nWarEnemyID = 0 WHERE IDNum = @shWhite -- lose team
UPDATE KNIGHTS SET byOldWarResult = 1, nVictory = nVictory+1, nWarEnemyID = 0 WHERE IDNum = @shBlue -- victory team
END
[/hide]