[If anyone needs it].. Add Avatar to Item Mall Query etc.

Results 1 to 16 of 16
  1. #1
    #Yummi.sql Caipi is offline
    MemberRank
    Sep 2011 Join Date
    GermanyLocation
    403Posts

    information [If anyone needs it].. Add Avatar to Item Mall Query etc.

    In case someone needs to add various Avatar pieces to the Item Mall the following query will mostly do the work for you..

    Already tried it out and it worked truly properly
    Should actually work as well for other items to the Item Mall.


    Basically it'll add everything to the tables what you'd have to add manually - furthermore it'll throw everything you need to add to the .txt files @ the pk2 at the Message Box below out.
    (Server restart is naturally required if you're adding em while the server is online).

    To make sure that everything is typed in correctly it checks at first if the Codename exists in your _RefObjCommon table + if you didn't misspell the destination Tab (For now only the Hat, Dress and Attachment Tab is allowed.

    If you want to add more add the ones to the..
    PHP Code:
    IF (@WhichTAB 'MALL_AVATAR_ATTACH' OR @WhichTAB 'MALL_AVATAR_DRESS' OR @WhichTAB 'MALL_AVATAR_HAT'
    ..line.


    PHP Code:
    USE SRO_VT_SHARD /* ITEMS TO MALL FOR SILK by Caipi */
    Declare @CodeName varchar (74)
    Declare @
    yourPrice int
    Declare @WhichTAB varchar(74)



    SET @CodeName 'ITEM_MALL_AVATAR_M_DRAGONDRESS'            /* The Spawncode of the item you want to add */
    SET @yourPrice 130                                        /* Silkprice */
    SET @WhichTAB 'MALL_AVATAR_DRESS'                            /* To which Tab of the Item Mall do you want to add the Item*/


    Declare @Data varchar(15SET @Data '0'                    /*Leave '0' as long as you're adding Avatars - otherwise Quantity of Item*/
    IF exists(SELECT CodeName128 FROM _RefObjCommon WHERE CodeName128 = @CodeName)
    BEGIN
    /*Only Avatar Tabs possible at the moment*/IF (@WhichTAB 'MALL_AVATAR_ATTACH' OR @WhichTAB 'MALL_AVATAR_DRESS' OR @WhichTAB 'MALL_AVATAR_HAT'/*To make sure that the Tab is correct (in order to missspellings)*/
    BEGIN

    /* Codename instead of the ID */ 
    Declare @ItemID int SET @ItemID = (SELECT ID FROM _RefObjCommon WHERE CodeName128 = @CodeName)

    /* Which Itemdata.txt is affected in the Media.pk2*/
    Declare @newItemID varchar(5)
    IF (@
    ItemID 5000SET @newItemID 5000
    else if (@ItemID 10000SET @newItemID 10000
    else if (@ItemID 15000SET @newItemID 15000
    else if (@ItemID 20000SET @newItemID 20000
    else if (@ItemID 25000SET @newItemID 25000
    else if (@ItemID 30000SET @newItemID 30000
    else if (@ItemID 35000SET @newItemID 35000
    else if (@ItemID 40000SET @newItemID 40000
    else SET @newItemID 45000
    print ''
    print @CodeName ' from Media\server_dep\silkroad\textdata\itemdata_'+@newItemID+'.txt'
    print ''
    /*END which Itemdata.txt*/

    /* for _RefPackageItem */
    IF EXISTS (SELECT CodeName128 FROM _RefPackageItem WHERE CodeName128 'Package_'+@CodeName)
        
    BEGIN
            
    Declare @SN1 varchar(74SET @SN1 = (SELECT NameStrID FROM _RefPackageItem WHERE CodeName128 'PACKAGE_'+@CodeName)
            Declare @
    DESC1 varchar(74SET @Desc1 = (SELECT DescStrID FROM _RefPackageItem WHERE CodeName128 'PACKAGE_'+@CodeName)
            Declare @
    DDJ1 varchar(74SET @DDJ1 = (SELECT AssocFileIcon FROM _RefPackageItem WHERE CodeName128 'PACKAGE_'+@CodeName)
            Declare @
    TOPID1 varchar (10SET @TOPID1 = (SELECT ID FROM _RefPackageItem WHERE CodeName128 'PACKAGE_'+@CodeName)
                print 
    '##Check the following lines @ refpackageitem.txt!'
                
    print '1    15    '+@TOPID1+'    PACKAGE_'+@CodeName+'    0    EXPAND_TERM_ALL    '+@SN1+'    '+@DESC1+'    '+@DDJ1+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
                
    print ''
        
    END
            
    ELSE BEGIN
                
    Declare @SN varchar(74SET @SN = (SELECT NameStrID128 FROM _RefObjCommon WHERE ID = @ItemID)
                Declare @
    DESC varchar(74SET @Desc = (SELECT DescStrID128 FROM _RefObjCommon WHERE ID = @ItemID)
                Declare @
    DDJ varchar(74SET @DDJ = (SELECT AssocFileIcon128 FROM _RefObjCommon WHERE ID = @ItemID)
                    
    INSERT INTO _RefPackageItem (Service,Country,CodeName128,SaleTag,ExpandTerm,NameStrID,DescStrID,AssocFileIcon,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128
                    
    VALUES (1,15,'PACKAGE_'+@CodeName,0,'EXPAND_TERM_ALL',@SN,@Desc,@DDJ,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
                Declare @
    TOPID varchar (10SET @TOPID = (SELECT MAX(IDFROM _RefPackageItem)
                    print 
    ''
                    
    print 'Add the following line @ refpackageitem.txt'
                    
    print '1    15    '+@TOPID+'    PACKAGE_'+@CodeName+'    0    EXPAND_TERM_ALL    '+@SN+'    '+@DESC+'    '+@DDJ+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
                    
    print ''
            
    END

    /* for _RefPricePolicyOfItem */
    IF EXISTS (SELECT RefPackageItemCodeName FROM _RefPricePolicyOfItem WHERE RefPackageItemCodeName 'Package_'+@CodeName)
        
    BEGIN
            
    print '##Check the following lines @ RefPricePolicyOfItem.txt!'
            
    Declare @NEWPRICE1 varchar(15SET @NEWPRICE1 = (SELECT Cost FROM _RefPricePolicyOfItem WHERE RefPackageItemCodeName 'Package_'+@CodeName AND PaymentDevice 2)
                print 
    '1    15    PACKAGE_'+@CodeName+'    2    0    '+@NEWPRICE1+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
                
    print '1    15    PACKAGE_'+@CodeName+'    4    0    0    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
                
    print '1    15    PACKAGE_'+@CodeName+'    16    0    0    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
                
    print ''
        
    END
            
    ELSE BEGIN
                INSERT INTO _RefPricePolicyOfItem 
    (Service,Country,RefPackageItemCodeName,PaymentDevice,PreviousCost,Cost,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
                
    VALUES (1,15,'PACKAGE_'+@CodeName,2,0,@yourPrice,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
                
    INSERT INTO _RefPricePolicyOfItem (Service,Country,RefPackageItemCodeName,PaymentDevice,PreviousCost,Cost,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
                
    VALUES (1,15,'PACKAGE_'+@CodeName,4,0,0,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
                
    INSERT INTO _RefPricePolicyOfItem (Service,Country,RefPackageItemCodeName,PaymentDevice,PreviousCost,Cost,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
                
    VALUES (1,15,'PACKAGE_'+@CodeName,16,0,0,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
            Declare @
    NEWPRICE varchar(15SET @NEWPRICE = @yourPrice
                
    print ''
                
    print 'Add the following lines @ refpricepolicyofitem.txt'
                
    print '1    15    PACKAGE_'+@CodeName+'    2    0    '+@NEWPRICE+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
                
    print '1    15    PACKAGE_'+@CodeName+'    4    0    0    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
                
    print '1    15    PACKAGE_'+@CodeName+'    16    0    0    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
                
    print ''
            
    END

    /* for _RefShopGoods */
    IF EXISTS (SELECT RefPackageItemCodeName FROM _RefShopGoods WHERE RefPackageItemCodeName 'Package_'+@CodeName AND RefTabCodeName = @WhichTAB)
        
    BEGIN
            
    print '##Check the following lines @ RefShopGoods.txt!'
            
    Declare @WhichTAB1 varchar(74SET @WhichTAB1 = (SELECT RefTabCodeName FROM _RefShopGoods WHERE RefPackageItemCodeName 'PACKAGE_'+@CodeName)
            Declare @
    newSLOTINDEX1 varchar(15SET @newSLOTINDEX1 = (SELECT SlotIndex FROM _RefShopGoods WHERE RefPackageItemCodeName 'PACKAGE_'+@CodeName AND RefTabCodeName = @WhichTAB1)
            print 
    '1    15    '+@WhichTAB1+'    '+'PACKAGE_'+@CodeName+'    '+@newSLOTINDEX1+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
            
    print ''
        
    END
            
    ELSE BEGIN
                
    Declare @newSLOTINDEX varchar(15SET @newSLOTINDEX = (SELECT MAX(SlotIndexFROM _RefShopGoods WHERE RefTabCodeName = @WhichTAB)+1
                INSERT INTO _RefShopGoods 
    (Service,Country,RefTabCodeName,RefPackageItemCodeName,SlotIndex,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
                
    VALUES (1,15,@WhichTAB,'PACKAGE_'+@CodeName,@newSLOTINDEX,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
                print 
    ''
                
    print 'Add the following line @ refshopgoods.txt'
                
    print '1    15    '+@WhichTAB+'    '+'PACKAGE_'+@CodeName+'    '+@newSLOTINDEX+'    -1    xxx    -1    xxx    -1    xxx    -1    xxx'
                
    print ''
            
    END

    /* for _RefScrapOfPackageItem */
    IF EXISTS (SELECT RefPackageItemCodeName FROM _RefScrapOfPackageItem WHERE RefPackageItemCodeName 'Package_'+@CodeName AND RefItemCodeName = @CodeName)
        
    BEGIN
            
    print '##Check the following lines @ RefScrapOfPackageItem.txt!'
            
    Declare @ScrapIndex1 varchar(15)
            
    SET @ScrapIndex1 = (SELECT [IndexFROM _RefScrapOfPackageItem WHERE RefItemCodeName = @CodeName)
            Declare @
    Data1 varchar(15SET @Data1 = (SELECT Data FROM _RefScrapOfPackageItem WHERE RefItemCodeName = @CodeName)
            print 
    '1    15    '+'PACKAGE_'+@CodeName+'    '+@CodeName+'    0    0    '+@Data1+'    0    0    0    0    0    0    0    0    0    0    0    0    0    -1    xxx    -1    xxx    -1    xxx    -1    xxx    '+@ScrapIndex1    
            
    print ''
        
    END
            
    ELSE BEGIN
                INSERT INTO _RefScrapOfPackageItem 
    (Service,Country,RefPackageItemCodeName,RefItemCodeName,OptLevel,Variance,Data,MagParamNum,MagParam1,MagParam2,MagParam3,MagParam4,MagParam5,MagParam6,MagParam7,MagParam8,MagParam9,MagParam10,MagParam11,MagParam12,Param1,Param1_Desc128,Param2,Param2_Desc128,Param3,Param3_Desc128,Param4,Param4_Desc128)
                
    VALUES (1,15,'PACKAGE_'+@CodeName,@CodeName,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
                Declare @
    ScrapIndex varchar(15)
                
    SET @ScrapIndex = (SELECT [IndexFROM _RefScrapOfPackageItem WHERE RefItemCodeName = @CodeName)
                    print 
    ''
                    
    print 'Add the following line @ refscrapofpackageitem.txt'
                    
    print '1    15    '+'PACKAGE_'+@CodeName+'    '+@CodeName+'    0    0    '+@Data+'    0    0    0    0    0    0    0    0    0    0    0    0    0    -1    xxx    -1    xxx    -1    xxx    -1    xxx    '+@ScrapIndex
                    
    print ''
            
    END
        
    print ''
        
    print ''
        
    print 'Done!'
    END
    ELSE BEGIN
    print 'The @WhichTAB value is incorrect!'
    END
    END
    else begin 
    print '@CodeName value does not exist.'
    end 

    In order to keep the right spaces between each words I attached the .txt file as well, and I recommend you to use only the query from the textfile.
    -> Only Copy Pasta from the Message Box to the .txt files @ the Media.


    Workes properly and spares you some time.
    Attached Files Attached Files


  2. #2
    (*..:: RaGeZONER ::..*) 3d2000 is offline
    MemberRank
    Nov 2011 Join Date
    462Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    As always :DD Awesome <3

  3. #3
    #Yummi.sql Caipi is offline
    MemberRank
    Sep 2011 Join Date
    GermanyLocation
    403Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    I bet you didn't even try it out! ;x

  4. #4
    Infraction Banned mage300 is offline
    MemberRank
    Aug 2011 Join Date
    134Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    amazing

  5. #5
    __F0X__ arabianfox is offline
    MemberRank
    Nov 2011 Join Date
    292Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    great work as always,thank you.

    you should release a new post with title "the ultimate queries package for Vsro files" includes all your good working queries. >> just idea

    thank you again

  6. #6
    (*..:: RaGeZONER ::..*) 3d2000 is offline
    MemberRank
    Nov 2011 Join Date
    462Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    Quote Originally Posted by Caipi View Post
    I bet you didn't even try it out! ;x
    i told you before i trust you :PP

    the Idea i love who share their Thoughts . their Ideas . their Work . and their Effort to make A GOOD sharing community

    that why i said ,, Awesome ,, i mean for shearing the IDEA .. not sharing the Code :)
    Last edited by 3d2000; 23-01-12 at 07:21 PM.

  7. #7
    Proficient Member Dragonzee is offline
    MemberRank
    Oct 2011 Join Date
    Bashtil, Al JizLocation
    161Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    thanks for share

    Like + Rep +1

  8. #8
    Member HardStylax is offline
    MemberRank
    Oct 2011 Join Date
    88Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    Thanks, I will try it out later ;)

  9. #9
    #Yummi.sql Caipi is offline
    MemberRank
    Sep 2011 Join Date
    GermanyLocation
    403Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    That query is actually very simple - it's like an essay with all the necessary information within.. ^^

  10. #10
    Apprentice RealityT90 is offline
    MemberRank
    Jan 2012 Join Date
    11Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    @Caipi I can truely approve that you saved me some important time, you got my Like

  11. #11
    Member kellogz is offline
    MemberRank
    Aug 2011 Join Date
    71Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    Gonna test it soon :P

  12. #12
    #Yummi.sql Caipi is offline
    MemberRank
    Sep 2011 Join Date
    GermanyLocation
    403Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    Quote Originally Posted by RealityT90 View Post
    @Caipi I can truely approve that you saved me some important time, you got my Like
    Well I lately had to add all avatars to the item mall on another server as well and I was sooo lucky that I bothered before to write that lil query ;D

  13. #13
    Apprentice Devilsro is offline
    MemberRank
    Dec 2011 Join Date
    23Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    how to add it in media?

  14. #14
    Account Upgraded | Title Enabled! lucastx is offline
    MemberRank
    Sep 2008 Join Date
    BrasilLocation
    240Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    Wow a lot thanks.
    Can you make one for pet too?

  15. #15
    Laravel Core Programmer Jangan is offline
    DeveloperRank
    Jul 2007 Join Date
    Dubai, UAELocation
    2,113Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    PLIS, i am nyd free awatar add serwer!

    lol nice work caipi, you and your crazy queries... becoming a fan of yours.

  16. #16
    #Yummi.sql Caipi is offline
    MemberRank
    Sep 2011 Join Date
    GermanyLocation
    403Posts

    Re: [If anyone needs it].. Add Avatar to Item Mall Query etc.

    Quote Originally Posted by Devilsro View Post
    how to add it in media?
    As I said the lines which you need to add to your textfiles will be shown in the message window below (@mssql)


    Quote Originally Posted by lucastx View Post
    Wow a lot thanks.
    Can you make one for pet too?
    Shud be basically the same you only need to change the necessary item code and @WhichTAB
    + change the following line as it's stated..
    PHP Code:
    /*Only Avatar Tabs possible at the moment*/IF exists(SELECT CodeName128 FROM _RefShopTab WHERE CodeName128 = @WhichTAB AND CodeName128 like '%MALL_%'/*To make sure that the Tab is correct (in order to missspellings)*/ 
    The Data value is also on "0", I assume CashItem has to be "1" on _RefObjCommon.
    Shud work for every item mall item actually :)

    Quote Originally Posted by Jangan View Post
    PLIS, i am nyd free awatar add serwer!

    lol nice work caipi, you and your crazy queries... becoming a fan of yours.
    Queries are more reliable than human hands and if a query successfully did it's job it'll do it the same way again, w/o any misspellings.
    + more faster, I dislike doing everything by hand ;D Furthermore there won't be a tiny value which causes immediate shutdowns or crashes ingame for which you'd need another half an hour to fix it.

    + I enjoy writing those lil essays, especially if they work ^^



Advertisement