ViewInventory[Karakterin Inventorysindeki İtemleri Görün]

    Flexy
    Flexy


    Favori Oyun Favori Oyun : WolfTeam
    Nick Nick : Ko-PVP
    Karakter Karakter : Asas
    Irk Irk : El Morad
    Cinsiyet Cinsiyet : Erkek
    Mesaj Sayısı Mesaj Sayısı : 73
    Rep Puanı Rep Puanı : 1
    Kayıt tarihi Kayıt tarihi : 26/12/09
    Lakap Lakap : Asker

    ViewInventory[Karakterin Inventorysindeki İtemleri Görün] Empty ViewInventory[Karakterin Inventorysindeki İtemleri Görün]

    Mesaj tarafından Flexy Salı Ocak 12, 2010 9:57 am

    İnventorysindeki İtemleri Görmek İçin Yazdığım Prosedürümü Paylaşıyorum [Resimleri görebilmek için üye olun veya giriş yapın.]
    Prosedürün Amacı : İstediğimiz Karakterin İnventorysinde ki İtemleri Görmek [Resimleri görebilmek için üye olun veya giriş yapın.]

    Kod:
    --ISєx4FunI
    CREATE PROCEDURE [ViewInventory]
    @StrUserID varchar(30)
    AS
    DECLARE @row int, @i int, @dwid int, @pos int, @type varbinary(4), @ext int, @StackSize int,  @strName varchar(30), @strExtName varchar(30)

    select @row = count(*) from InventoryView where strUserID = @StrUserId

    if @row > 0
    begin
        ROLLBACK TRAN
        select @StrUserID, 0, 0x0000, 0, 'In Use', 'Please refresh'
        RETURN
    end

    set @i = 1
    WHILE @i < 401
    Begin
       
        Select @dwid=cast(cast(substring(cast(substring(strItem, @i,4) as varbinary(4)), 4, 1)+substring(cast(substring(strItem, @i,4) as varbinary(4)), 3, 1)+substring(cast(substring(strItem, @i,4) as varbinary(4)), 2, 1)+substring(cast(substring(strItem, @i,4) as varbinary(4)), 1, 1) as varbinary(4)) as int(4)),
        @type = cast( substring(strItem, @i+4, 2) as varbinary(2)),
        @StackSize = cast(cast(cast( substring(strItem, @i+7, 1) as varbinary(1))+cast(substring(strItem, @i+6, 1) as varbinary(1)) as varbinary(2)) as smallint)
        From UserData
        Where strUserID = @StrUserID

        set @strName = ''   

        select @ext = byExtIndex, @strName = szName from item_basic where dwid = cast(substring(cast(@dwid as varchar(9)), 1, 6)+'000' as int(4))

        set @strExtName = 'No Item'
       
        If @ext = 0
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext0 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 1
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext1 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 2
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext2 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 3
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext3 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 4
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext4 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 5
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext5 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 6
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext6 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 7
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext7 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 8
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext8 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 9
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext9 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 10
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext10 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 11
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext11 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 12
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext12 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 13
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext13 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 14
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext14 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 15
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext15 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 16
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext16 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 17
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext17 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 18
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext18 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 19
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext19 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 20
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext20 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 21
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext21 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))
        If @ext = 22
            select @strExtName = 'Non upgradeable'
        If @ext = 23
            select @strExtName = replace(szHeader , '  ', ' ') + '+' + cast(dwId % 10 as char(2))  from itemext23 where dwid = cast(substring(cast(@dwid as varchar(9)), 7, 9) as int(4))

        insert into InventoryView values (@StrUserId, @dwid, @type, @StackSize, @strName, @strExtName)
        set @i = @i + 8
    End

    select * from InventoryView
    delete from InventoryView where strUserID = @StrUserId
    GO

    Kullanımı :

    Kod:
    exec ViewInventory 'karakter adı'

      Forum Saati Cuma Nis. 19, 2024 11:44 am