[PAYLAŞIM] Clan Irk Transferi

    Paylaş
    avatar
    hako90
    Profesyonel Üye

    Profesyonel Üye


    Mesaj Sayısı : 396
    Kayıt tarihi : 10/12/09
    Forum Başarısı : 8553
    Rep Puanı : 2
    Cinsiyeti : Doğum tarihi : 29/12/93
    Yaş : 24
    Hangi Şehir : Ankara
    Hangi Ülke : Türkiye
    Lakap : Yoktur

    icon12 [PAYLAŞIM] Clan Irk Transferi

    Mesaj tarafından hako90 Bir C.tesi Şub. 13, 2010 1:26 am

    tek bir kodla karus clanı üyeleriyle birlikte human , human clanıda üyeleriyle birlikte karus yapabilirsiniz. Üstelik o clandaki kişinin yan charı varsa ırk transferine o da dahil olur.

    öncelikle aşağıdaki procedure'leri query anlyzerda çalıştırıp kaydediyoruz databaseye.

    CREATE PROCEDURE [clan_human] @IDName char(21) AS
    --
    webmsn
    declare @IDNo smallint,@irk tinyint,@c1 char(21),@acc char(21),@acc1 char(21),@acc3 char(21
    )
    select @IDNo = IDNum from Knights where IDName = @
    IDName
    select
    @irk = Nation From Knights where IDNUM = @
    IDNo
    select
    @c1 = strUserId from userdata where Knights = @
    IDNo
    select
    @acc = strAccountID from account_char where strCharID1 = @
    c1
    select
    @acc1 = strAccountID from account_char where strCharID2 = @
    c1
    select
    @acc3 = strAccountID from account_char where strCharID3 = @
    c1


    declare @k1 char(21),@k2 char(21),@k3 char(21
    )
    select @k1 = strCharID1 from account_char where strAccountID = @
    acc
    select
    @k2 = strCharID2 from account_char where strAccountID = @
    acc1
    select
    @k3 = strCharID3 from account_char where strAccountID = @
    acc3



    if @irk =
    2
    begin
    print
    'Zaten clan human'
    end
    if @irk =
    1
    begin
    update account_char set bNation
    ='2' where strAccountID = @
    acc
    update account_char set bNation
    ='2' where strAccountID = @
    acc1
    update account_char set bNation
    ='2' where strAccountID = @
    acc3
    update Knights set Nation
    ='2' where IDNum = @IDNo and Nation =
    1
    update userdata set Nation
    ='2',Zone='21' where Knights = @IDNo and Nation =
    1


    --
    warriorsa
    update userdata set Race
    ='11',Class='201' where Knights = @IDNo and Class=
    101
    update userdata set Race
    ='12',Class='205' where Knights = @IDNo and Class=
    105
    update userdata set Race
    ='12',Class='206' where Knights = @IDNo and Class=
    106

    update userdata set Race
    ='11',Class='201' where strUserId = @k1 and Class=
    101
    update userdata set Race
    ='12',Class='205' where strUserId = @k1 and Class=
    105
    update userdata set Race
    ='12',Class='206' where strUserId = @k1 and Class=
    106

    update userdata set Race
    ='11',Class='201' where strUserId = @k2 and Class=
    101
    update userdata set Race
    ='12',Class='205' where strUserId = @k2 and Class=
    105
    update userdata set Race
    ='12',Class='206' where strUserId = @k2 and Class=
    106

    update userdata set Race
    ='11',Class='201' where strUserId = @k3 and Class=
    101
    update userdata set Race
    ='12',Class='205' where strUserId = @k3 and Class=
    105
    update userdata set Race
    ='12',Class='206' where strUserId = @k3 and Class=
    106

    --
    roguesa
    update userdata set Race
    ='12',Class='202' where Knights = @IDNo and Class=
    102
    update userdata set Race
    ='12',Class='207' where Knights = @IDNo and Class=
    107
    update userdata set Race
    ='12',Class='208' where Knights = @IDNo and Class=
    108

    update userdata set Race
    ='12',Class='202' where strUserId = @k1 and Class=
    102
    update userdata set Race
    ='12',Class='207' where strUserId = @k1 and Class=
    107
    update userdata set Race
    ='12',Class='208' where strUserId = @k1 and Class=
    108

    update userdata set Race
    ='12',Class='202' where strUserId = @k2 and Class=
    102
    update userdata set Race
    ='12',Class='207' where strUserId = @k2 and Class=
    107
    update userdata set Race
    ='12',Class='208' where strUserId = @k2 and Class=
    108

    update userdata set Race
    ='12',Class='202' where strUserId = @k3 and Class=
    102
    update userdata set Race
    ='12',Class='207' where strUserId = @k3 and Class=
    107
    update userdata set Race
    ='12',Class='208' where strUserId = @k3 and Class=
    108

    --
    magese
    update userdata set Race
    ='12',Class='203' where Knights = @IDNo and Class=
    103
    update userdata set Race
    ='13',Class='209' where Knights = @IDNo and Class=
    109
    update userdata set Race
    ='13',Class='210' where Knights = @IDNo and Class=
    110

    update userdata set Race
    ='12',Class='203' where strUserId = @k1 and Class=
    103
    update userdata set Race
    ='13',Class='209' where strUserId = @k1 and Class=
    109
    update userdata set Race
    ='13',Class='210' where strUserId = @k1 and Class=
    110

    update userdata set Race
    ='12',Class='203' where strUserId = @k2 and Class=
    103
    update userdata set Race
    ='13',Class='209' where strUserId = @k2 and Class=
    109
    update userdata set Race
    ='13',Class='210' where strUserId = @k2 and Class=
    110

    update userdata set Race
    ='12',Class='203' where strUserId = @k3 and Class=
    103
    update userdata set Race
    ='13',Class='209' where strUserId = @k3 and Class=
    109
    update userdata set Race
    ='13',Class='210' where strUserId = @k3 and Class=
    110


    --
    priestse
    update userdata set Race
    ='13',Class='204' where Knights = @IDNo and Class=
    104
    update userdata set Race
    ='13',Class='211' where Knights = @IDNo and Class=
    111
    update userdata set Race
    ='13',Class='212' where Knights = @IDNo and Class=
    112

    update userdata set Race
    ='13',Class='204' where strUserId = @k1 and Class=
    104
    update userdata set Race
    ='13',Class='211' where strUserId = @k1 and Class=
    111
    update userdata set Race
    ='13',Class='212' where strUserId = @k1 and Class=
    112

    update userdata set Race
    ='13',Class='204' where strUserId = @k2 and Class=
    104
    update userdata set Race
    ='13',Class='211' where strUserId = @k2 and Class=
    111
    update userdata set Race
    ='13',Class='212' where strUserId = @k2 and Class=
    112

    update userdata set Race
    ='13',Class='204' where strUserId = @k3 and Class=
    104
    update userdata set Race
    ='13',Class='211' where strUserId = @k3 and Class=
    111
    update userdata set Race
    ='13',Class='212' where strUserId = @k3 and Class=
    112

    end
    GO




    CREATE PROCEDURE [clan_karus] @IDName char(21) AS
    --
    webmsn
    declare @IDNo smallint,@irk tinyint,@c1 char(21),@acc char(21),@acc1 char(21),@acc3 char(21)
    select @IDNo = IDNum from Knights where IDName = @IDName
    select
    @irk = Nation From Knights where IDNUM = @IDNo
    select
    @c1 = strUserId from userdata where Knights = @IDNo
    select
    @acc = strAccountID from account_char where strCharID1 = @c1
    select
    @acc1 = strAccountID from account_char where strCharID2 = @c1
    select
    @acc3 = strAccountID from account_char where strCharID3 = @c1


    declare @k1 char(21),@k2 char(21),@k3 char(21)
    select @k1 = strCharID1 from account_char where strAccountID = @acc
    select
    @k2 = strCharID2 from account_char where strAccountID = @acc1
    select
    @k3 = strCharID3 from account_char where strAccountID = @acc3



    if @irk = 1
    begin
    print 'Zaten clan karus'
    end
    if @irk = 2
    begin
    update account_char set bNation
    ='1' where strAccountID = @acc
    update account_char set bNation
    ='1' where strAccountID = @acc1
    update account_char set bNation
    ='1' where strAccountID = @acc3
    update Knights set Nation
    ='1' where IDNum = @IDNo and Nation = 2
    update userdata set Nation
    ='1',Zone='21' where Knights = @IDNo and Nation = 2


    -- warriorsa
    update userdata set Race
    ='1',Class='101' where Knights = @IDNo and Class= 201
    update userdata set Race
    ='1',Class='105' where Knights = @IDNo and Class= 205
    update userdata set Race
    ='1',Class='106' where Knights = @IDNo and Class= 206

    update userdata set Race
    ='1',Class='101' where strUserId = @k1 and Class= 201
    update userdata set Race
    ='1',Class='105' where strUserId = @k1 and Class= 205
    update userdata set Race
    ='1',Class='106' where strUserId = @k1 and Class= 206

    update userdata set Race
    ='1',Class='101' where strUserId = @k2 and Class= 201
    update userdata set Race
    ='1',Class='105' where strUserId = @k2 and Class= 205
    update userdata set Race
    ='1',Class='106' where strUserId = @k2 and Class= 206

    update userdata set Race
    ='1',Class='101' where strUserId = @k3 and Class= 201
    update userdata set Race
    ='1',Class='105' where strUserId = @k3 and Class= 205
    update userdata set Race
    ='1',Class='106' where strUserId = @k3 and Class= 206

    -- roguesa
    update userdata set Race
    ='2',Class='102' where Knights = @IDNo and Class= 202
    update userdata set Race
    ='2',Class='107' where Knights = @IDNo and Class= 207
    update userdata set Race
    ='2',Class='108' where Knights = @IDNo and Class= 208

    update userdata set Race
    ='2',Class='102' where strUserId = @k1 and Class= 202
    update userdata set Race
    ='2',Class='107' where strUserId = @k1 and Class= 207
    update userdata set Race
    ='2',Class='108' where strUserId = @k1 and Class= 208

    update userdata set Race
    ='2',Class='102' where strUserId = @k2 and Class= 202
    update userdata set Race
    ='2',Class='107' where strUserId = @k2 and Class= 207
    update userdata set Race
    ='2',Class='108' where strUserId = @k2 and Class= 208

    update userdata set Race
    ='2',Class='102' where strUserId = @k3 and Class= 202
    update userdata set Race
    ='2',Class='107' where strUserId = @k3 and Class= 207
    update userdata set Race
    ='2',Class='108' where strUserId = @k3 and Class= 208

    -- magese
    update userdata set Race
    ='3',Class='103' where Knights = @IDNo and Class= 203
    update userdata set Race
    ='3',Class='109' where Knights = @IDNo and Class= 209
    update userdata set Race
    ='3',Class='110' where Knights = @IDNo and Class= 210

    update userdata set Race
    ='3',Class='103' where strUserId = @k1 and Class= 203
    update userdata set Race
    ='3',Class='109' where strUserId = @k1 and Class= 209
    update userdata set Race
    ='3',Class='110' where strUserId = @k1 and Class= 210

    update userdata set Race
    ='3',Class='103' where strUserId = @k2 and Class= 203
    update userdata set Race
    ='3',Class='109' where strUserId = @k2 and Class= 209
    update userdata set Race
    ='3',Class='110' where strUserId = @k2 and Class= 210

    update userdata set Race
    ='12',Class='103' where strUserId = @k3 and Class= 203
    update userdata set Race
    ='13',Class='109' where strUserId = @k3 and Class= 209
    update userdata set Race
    ='13',Class='110' where strUserId = @k3 and Class= 210


    -- priestse
    update userdata set Race
    ='4',Class='104' where Knights = @IDNo and Class= 204
    update userdata set Race
    ='4',Class='111' where Knights = @IDNo and Class= 211
    update userdata set Race
    ='4',Class='112' where Knights = @IDNo and Class= 212

    update userdata set Race
    ='4',Class='104' where strUserId = @k1 and Class= 204
    update userdata set Race
    ='4',Class='111' where strUserId = @k1 and Class= 211
    update userdata set Race
    ='4',Class='112' where strUserId = @k1 and Class= 212

    update userdata set Race
    ='4',Class='104' where strUserId = @k2 and Class= 204
    update userdata set Race
    ='4',Class='111' where strUserId = @k2 and Class= 211
    update userdata set Race
    ='4',Class='112' where strUserId = @k2 and Class= 212

    update userdata set Race
    ='4',Class='104' where strUserId = @k3 and Class= 204
    update userdata set Race
    ='4',Class='111' where strUserId = @k3 and Class= 211
    update userdata set Race
    ='4',Class='112' where strUserId = @k3 and Class= 212

    end
    GO


    bu kodları kaydettikten sonra çalışma şeklini göstereyim.

    --> karus bi clanı human yapmak için
    exec clan_human 'ClanAdı'


    --> human bi clanı karus yapmak için
    exec clan_karus 'ClanAdı'


      Forum Saati Perş. Ara. 13, 2018 10:02 pm