Knight Online Usko&Pvp&Koxp Her Konuda Paylaşım

Forumumuza HoşgeLDiNiz[StorMyDayS]
Sitemize Lütfen Üye Olunuz...[StorMyDayS]
Katkı Sağlayınız...[StorMyDayS]
İyi Vakitler...[StorMyDayS]
Knight Online Usko&Pvp&Koxp Her Konuda Paylaşım

Usko&Pvp&Koxp ve 1299 İle İlgili Herşey


    Clan Irk Değişimi Bütün Userleri İle 1299 Kodu

    Paylaş
    avatar
    StorMyDayS
    Administrator
    Administrator

    Mesaj Sayısı : 155
    İtibar : 1003
    Kayıt tarihi : 20/03/10
    Yaş : 27

    default Clan Irk Değişimi Bütün Userleri İle 1299 Kodu

    Mesaj tarafından StorMyDayS Bir C.tesi Haz. 25, 2011 11:45 pm

    ine Güzel ve Yararlı Bir Sistemimi Sizlere Sunuyorum

    CLAN IRK TRANSFERİ
    Özellikler:
    -Clandaki oyuncular ile birlikte Clan karşı ırka geçer
    -Clandaki oyuncuların yan karakterleri de karşı ırka geçer
    -Clandaki bir oyuncu Online ise StorMyDayS'in Sistemi olan ve neredeyse tüm
    Database'lerde bulunan ACCOUNT NATION TRANSFER sistemine devredilir, Oyuncu ilk relog da işlem tamamlanır. Yani Server açıkken ya da oyuncu online iken dahi Clan Transferini yapabilirsiniz.
    -Yeni Eklenen: Clan Lideri veya liderin yan karakterleri online ise transfer islemi yapilmaz.
    -Clan IDNum degisimi eklendi. Bir arkadasin uyarisi uzerine guncelleme yaptim.
    Karus Idnum 1-5000, Human IDNum 15000-20000 arasi Update olacaktir. 24.03.2011

    KULLANIM:
    Kod:

    EXEC CLAN_NATION_TRANSFER 'CLAN_İSMİ'

    PROSEDÜR

    Random Sayi Uretmek icin Gerekli Tablo.
    Bu tabloyu ekleyin ve silmeyin.
    Kod:

    USE [kn_online]
    GO
    /****** Object: Table [dbo].[CLANREF] Script Date: 03/25/2011 02:00:59 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[CLANREF](
    [GNum] [int] NULL
    ) ON [PRIMARY]
    GO

    DECLARE @sayac Int = 0
    WHILE 1=1
    BEGIN
    Set @sayac = @sayac + 1
    If @sayac > 20000 BREAK
    Insert Into CLANREF Values(@sayac)
    End

    Yukardaki kod SQL 2000 de hata verirse, bu dosyayı indirip içindeki kodu QA da uygulayın.
    [Linkleri görebilmek için üye olun veya giriş yapın.]

    Prosedurumuz

    Kod:

    USE [kn_online]
    GO
    /****** Object: StoredProcedure [dbo].[CLAN_NATION_TRANSFER] Script Date: 03/24/2011 23:42:47 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO

    CREATE PROCEDURE [dbo].[CLAN_NATION_TRANSFER]
    @ClanName varchar(21)
    AS
    /*
    Yapan : AKI
    16.02.2011
    Update:24.03.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 = 13
    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 = 13
    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 = 13
    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

    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

    DECLARE @NewCAH smallint,@NewCAK smallint
    SET @NewCAK = (SELECT TOP 1 GNum FROM CLANREF WHERE(GNum Between 15001 AND 20000) AND GNum Not In (SELECT IDNum FROM KNIGHTS) ORDER BY NewID())
    SET @NewCAH = (SELECT TOP 1 GNum FROM CLANREF WHERE(GNum Between 1 AND 5000) AND GNum Not In (SELECT IDNum FROM KNIGHTS) ORDER BY NewID())
    IF @ClanNation =1
    BEGIN
    UPDATE USERDATA SET Knights=@NewCAK WHERE Knights=@ClanNum
    UPDATE KNIGHTS_RATING SET shIndex=@NewCAK WHERE shIndex=@ClanNum
    UPDATE KNIGHTS_USER SET sIDNum=@NewCAK WHERE sIDNum=@ClanNum
    UPDATE KING_ELECTION_LIST SET nKnights=@NewCAK WHERE nKnights=@ClanNum
    UPDATE KNIGHTS_SIEGE_WARFARE SET sMasterKnights=@NewCAK WHERE sMasterKnights=@ClanNum
    UPDATE KNIGHTS SET Nation=@NewNation, IDNum=@NewCAK WHERE IDNum=@ClanNum
    END

    IF @ClanNation =2
    BEGIN
    UPDATE USERDATA SET Knights=@NewCAH WHERE Knights=@ClanNum
    UPDATE KNIGHTS_RATING SET shIndex=@NewCAH WHERE shIndex=@ClanNum
    UPDATE KNIGHTS_USER SET sIDNum=@NewCAH WHERE sIDNum=@ClanNum
    UPDATE KING_ELECTION_LIST SET nKnights=@NewCAH WHERE nKnights=@ClanNum
    UPDATE KNIGHTS_SIEGE_WARFARE SET sMasterKnights=@NewCAH WHERE sMasterKnights=@ClanNum
    UPDATE KNIGHTS SET Nation=@NewNation, IDNum=@NewCAH WHERE IDNum=@ClanNum
    END

    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



    _________________
    İstekleriniz İçin Bana Özel Mesaj Atın ... ( Özel Mesaj Atabilmek İçin Forumda En Az 5 Mesaj Atmış Olmanız Gerekiyor ) Bize Destek Olmak İçin Bu Link'e Bir Kere Tıklamanız Yeterlidir ... DESTEK İçin BU YAZIYA TIKLA

      Forum Saati Paz Eyl. 24, 2017 3:51 pm