1299 Sorunsuz Clan ırk değişimi

Konu

#1
Paylaşım ismi: 1299 Sorunsuz Clan ırk değişimi
Paylaşım sürümü: 1299
Paylaşım sahibi: Şafak
Paylaşım açıklaması: Serverınızda eşitliği sağlamak için ya da farklı sebeplerden dolayı bir clanın ırkını değiştirebilirsiniz. Clanda bulunan tüm oyuncuları editör aracılığı ile tek tek geçirmektense aşağıdaki prosedürü uygulayarak tek seferde oyuncular online dahi olsa işlemi tamamlayabilirsiniz. Daha sonra paylaşacağım 1299 komut dosyasında online oyuncuları tek tek dc edip oyunca tekrar girmelerini sağlayabilirsiniz. Relog yapan oyuncular tekrar oyuna girdiğinde clanları değişmiş olacaktır.

İlk olarak aşağıdaki kodları SQL Query'e girerek F5 yapın.

PROSEDÜR:
Kod:
USE [Kn_online]
GO
/****** Object: StoredProcedure [dbo].[CLAN_NATION_TRANSFER] Script Date: 02/17/2011 09:12:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[CLAN_NATION_TRANSFER]
@ClanName char(21)
AS
/*
Yapan : AKI
16.02.2011
*/
DECLARE @bNation tinyint, @NewNation tinyint,@ClanNation tinyint,@ClanNum smallint

Select @ClanNum=IdNum, @ClanNation=Nation from KNIGHTS where IDName =@ClanName

DECLARE @ClanUser Char(21)
DECLARE @Class tinyint
DECLARE @Race tinyint

DECLARE CLAN CURSOR FOR
SELECT strUserID,Class,Race FROM USERDATA WHERE Knights = @ClanNum

OPEN CLAN

FETCH NEXT FROM CLAN INTO @ClanUser,@Class,@Race
WHILE @@FETCH_STATUS =0
BEGIN

DECLARE @AccountId char(21)
SELECT @AccountId=strAccountID from ACCOUNT_CHAR WHERE strCharID1=@ClanUser or strCharID2=@ClanUser or strCharID3=@ClanUser
SELECT @bNation = bNation FROM ACCOUNT_CHAR WHERE strAccountID = @AccountId

IF @bNation = 1
SET @NewNation = 2
ELSE
SET @NewNation = 1
SET @ClanUser = NULL
SET @Race = 0
SET @Class = 0

SELECT @ClanUser = strCharID1 FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID AND strCharID1 IS NOT NULL
IF @ClanUser IS NOT NULL
BEGIN
SELECT @Race = Race,@Class = Class FROM USERDATA WHERE strUserId = @ClanUser
IF @Race = 1
SET @Race = 12
ELSE IF @Race = 2
SET @Race = 12
ELSE IF @Race = 3
SET @Race = 12
ELSE IF @Race = 4
SET @Race = 13
ELSE IF @Race = 11
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 201
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 205
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 206
SET @Race = 1
ELSE IF @Race = 13 AND @Class = 201
SET @Race = 1
ELSE IF @Race = 13 AND @Class = 205
SET @Race = 1
ELSE IF @Race = 13 AND @Class = 206
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 202
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 207
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 208
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 202
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 207
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 208
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 203
SET @Race = 3
ELSE IF @Race = 12 AND @Class = 209
SET @Race = 3
ELSE IF @Race = 12 AND @Class = 210
SET @Race = 3
ELSE IF @Race = 13 AND @Class = 203
SET @Race = 3
ELSE IF @Race = 13 AND @Class = 209
SET @Race = 3
ELSE IF @Race = 13 AND @Class = 210
SET @Race = 3
ELSE IF @Race = 12 AND @Class = 204
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 211
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 212
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 204
SET @Race = 4
ELSE IF @Race = 13 AND @Class = 211
SET @Race = 4
ELSE IF @Race = 13 AND @Class = 212
SET @Race = 4

IF @NewNation = 1
SET @Class = @Class - 100
ELSE
SET @Class = @Class + 100

UPDATE USERDATA SET Nation = @NewNation,Race = @Race,Class = @Class, Rank = 0, Title = 0 FROM USERDATA WHERE strUserId = @ClanUser
END
SET @ClanUser = NULL
SET @Race = 0
SET @Class = 0

SELECT @ClanUser = strCharID2 FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID AND strCharID2 IS NOT NULL

IF @ClanUser IS NOT NULL
BEGIN
SELECT @Race = Race,@Class = Class FROM USERDATA WHERE strUserId = @ClanUser

IF @Race = 1
SET @Race = 12
ELSE IF @Race = 2
SET @Race = 12
ELSE IF @Race = 3
SET @Race = 12
ELSE IF @Race = 4
SET @Race = 13
ELSE IF @Race = 11
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 201
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 205
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 206
SET @Race = 1
ELSE IF @Race = 13 AND @Class = 201
SET @Race = 1
ELSE IF @Race = 13 AND @Class = 205
SET @Race = 1
ELSE IF @Race = 13 AND @Class = 206
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 202
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 207
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 208
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 202
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 207
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 208
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 203
SET @Race = 3
ELSE IF @Race = 12 AND @Class = 209
SET @Race = 3
ELSE IF @Race = 12 AND @Class = 210
SET @Race = 3
ELSE IF @Race = 13 AND @Class = 203
SET @Race = 3
ELSE IF @Race = 13 AND @Class = 209
SET @Race = 3
ELSE IF @Race = 13 AND @Class = 210
SET @Race = 3
ELSE IF @Race = 12 AND @Class = 204
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 211
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 212
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 204
SET @Race = 4
ELSE IF @Race = 13 AND @Class = 211
SET @Race = 4
ELSE IF @Race = 13 AND @Class = 212
SET @Race = 4

IF @NewNation = 1
SET @Class = @Class - 100
ELSE
SET @Class = @Class + 100

UPDATE USERDATA SET Nation = @NewNation,Race = @Race,Class = @Class, Rank = 0, Title = 0 FROM USERDATA WHERE strUserId = @ClanUser

END

SET @ClanUser = NULL
SET @Race = 0
SET @Class = 0

SELECT @ClanUser = strCharID3 FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID AND strCharID3 IS NOT NULL

IF @ClanUser IS NOT NULL
BEGIN
SELECT @Race = Race,@Class = Class FROM USERDATA WHERE strUserId = @ClanUser

IF @Race = 1
SET @Race = 12
ELSE IF @Race = 2
SET @Race = 12
ELSE IF @Race = 3
SET @Race = 12
ELSE IF @Race = 4
SET @Race = 13
ELSE IF @Race = 11
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 201
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 205
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 206
SET @Race = 1
ELSE IF @Race = 13 AND @Class = 201
SET @Race = 1
ELSE IF @Race = 13 AND @Class = 205
SET @Race = 1
ELSE IF @Race = 13 AND @Class = 206
SET @Race = 1
ELSE IF @Race = 12 AND @Class = 202
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 207
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 208
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 202
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 207
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 208
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 203
SET @Race = 3
ELSE IF @Race = 12 AND @Class = 209
SET @Race = 3
ELSE IF @Race = 12 AND @Class = 210
SET @Race = 3
ELSE IF @Race = 13 AND @Class = 203
SET @Race = 3
ELSE IF @Race = 13 AND @Class = 209
SET @Race = 3
ELSE IF @Race = 13 AND @Class = 210
SET @Race = 3
ELSE IF @Race = 12 AND @Class = 204
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 211
SET @Race = 2
ELSE IF @Race = 12 AND @Class = 212
SET @Race = 2
ELSE IF @Race = 13 AND @Class = 204
SET @Race = 4
ELSE IF @Race = 13 AND @Class = 211
SET @Race = 4
ELSE IF @Race = 13 AND @Class = 212
SET @Race = 4

IF @NewNation = 1
SET @Class = @Class - 100
ELSE
SET @Class = @Class + 100

UPDATE USERDATA SET Nation = @NewNation,Race = @Race,Class = @Class, Rank = 0, Title = 0 FROM USERDATA WHERE strUserId = @ClanUser
END
UPDATE ACCOUNT_CHAR SET bNation = @NewNation WHERE strAccountID = @AccountID
UPDATE KNIGHTS set Nation=@NewNation WHERE IDNum=@ClanNum

DECLARE @OnUser tinyint
SELECT @OnUser = Count(*) FROM CURRENTUSER WHERE strAccountID = @AccountID
IF @OnUser <> 0
BEGIN
INSERT INTO ACCOUNT_NATION_TRANSFERS_QUEUE (AccountID,Process,Description,UpdatedTime) VALUES (@AccountID,0,'Henüz İşlem Yapılmadı.',GETDATE())
END

FETCH NEXT FROM CLAN INTO @ClanUser,@Class,@Race
END
CLOSE CLAN
DEALLOCATE CLAN

IF @NewNation = 1
BEGIN
PRINT '# ' + @ClanName + ' Clani Human IRK''ından Karus IRK''ına Transfer Edildi.'
END
ELSE
BEGIN
PRINT '# ' + @ClanName + ' Clani Karus IRK''ından Human IRK''ına Transfer Edildi.'
END

Prosedürü oluşturduktan sonra aşağıdaki kodu kullanarak Clan ırkını değiştirebilirsiniz.
Aşağıdaki kodları SQL Query girerek F5 yapın.
KULLANIM:
Kod:
EXEC CLAN_NATION_TRANSFER 'CLAN_İSMİ'
Cevapla
#2
Teşekkürler
|.gg/ambar discordunda takılıyorum| 網 ALFACREW36 卍 |
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Benzer Konular

Task
Kayıt Ol
Discord Adresimize Katılın