Gameserver/After Npc Edit

Results 1 to 10 of 10
  1. #1
    Newbie LegendM is offline
    MemberRank
    Sep 2011 Join Date
    22Posts

    Gameserver/After Npc Edit

    Hi guys I have problem with gameserver.I edit all thing in database and client side but when I try open gameserver this error happen and gameserver close


  2. #2
    Newbie siksika is offline
    MemberRank
    Jan 2012 Join Date
    15Posts

    Re: Gameserver/After Npc Edit

    check _refscrapofpackage table the data column its probably set to 0 but u need to change it to match the dura
    or use this code which is caipi code but i added 2 lines to get the dura automatically

    PHP Code:
    USE SRO_VT_SHARD /* ITEMS TO NPC FOR GOLD by Caipi */
    Declare @ItemID int
    Declare @yourPrice int
    Declare @WhichTAB varchar(74)



    SET @ItemID 2                           /* The Item ID of the Item you want to add to the NPC*/ --## <--
    SET @yourPrice 5000                        /* The price per Unit */ --## <--
    SET @WhichTAB 'STORE_CH_POTION_TAB1'        /* To which Tab at which NPC you want to add the Item*/



    /* Codename instead of the ID */ 
    Declare @CodeName varchar (74SET @CodeName = (SELECT CodeName128 FROM _RefObjCommon WHERE ID = @ItemID)
    Declare @
    Link int SET @Link = (SELECT Link FROM _RefObjCommon WHERE ID = @ItemID)
    Declare @
    Data int SET @Data = (SELECT Dur_L FROM _RefObjItem WHERE ID = @Link)

    /* Which Itemdata.txt is affected in the Media.pk2*/
    Declare @newItemID varchar(5)
    Declare @
    lastPrice varchar(25SET @lastPrice = (SELECT Price FROM _RefObjCommon WHERE ID = @ItemID)
    Declare @
    yourPriceCHAR varchar(25SET @yourPriceCHAR = @yourPrice
    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 'Change the current Price of '+@lastPrice+' to '+@yourPriceCHAR+' at the itemdata_'+@newItemID+'. (For the visual Price ingame)'
    /*END which Itemdata.txr*/

    /*for _RefObjCommon Price*/
    UPDATE _RefObjCommon SET Price = @yourPrice WHERE ID = @ItemID

    /* for _RefPackageItem */
    IF EXISTS (SELECT CodeName128 FROM _RefPackageItem WHERE CodeName128 'Package_'+@CodeName)
        
    BEGIN
            
    print 'Already added @ RefPackageItem/.txt!'
        
    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 AND PaymentDevice AND Cost = @yourPrice)
        
    BEGIN
            
    print 'Already added @ RefPricePolicyOfItem/.txt!'
        
    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,1,0,@yourPrice,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
    Declare @
    NEWPRICE varchar(15SET @NEWPRICE = @yourPrice
    print ''
    print 'Add the following line @ refpricepolicyofitem.txt'
    print '1    15    PACKAGE_'+@CodeName+'    1    0    '+@NEWPRICE+'    -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 'Already added @ RefShopGoods/.txt!'
        
    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 'Already added @ RefScrapOfPackageItem/.txt!'
        
    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,@Data,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 MAX([Index]) FROM _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!' 

  3. #3
    Newbie LegendM is offline
    MemberRank
    Sep 2011 Join Date
    22Posts

    Re: Gameserver/After Npc Edit

    Quote Originally Posted by siksika View Post
    check _refscrapofpackage table the data column its probably set to 0 but u need to change it to match the dura
    or use this code which is caipi code but i added 2 lines to get the dura automatically

    PHP Code:
    USE SRO_VT_SHARD /* ITEMS TO NPC FOR GOLD by Caipi */
    Declare @ItemID int
    Declare @yourPrice int
    Declare @WhichTAB varchar(74)



    SET @ItemID 2                           /* The Item ID of the Item you want to add to the NPC*/ --## <--
    SET @yourPrice 5000                        /* The price per Unit */ --## <--
    SET @WhichTAB 'STORE_CH_POTION_TAB1'        /* To which Tab at which NPC you want to add the Item*/



    /* Codename instead of the ID */ 
    Declare @CodeName varchar (74SET @CodeName = (SELECT CodeName128 FROM _RefObjCommon WHERE ID = @ItemID)
    Declare @
    Link int SET @Link = (SELECT Link FROM _RefObjCommon WHERE ID = @ItemID)
    Declare @
    Data int SET @Data = (SELECT Dur_L FROM _RefObjItem WHERE ID = @Link)

    /* Which Itemdata.txt is affected in the Media.pk2*/
    Declare @newItemID varchar(5)
    Declare @
    lastPrice varchar(25SET @lastPrice = (SELECT Price FROM _RefObjCommon WHERE ID = @ItemID)
    Declare @
    yourPriceCHAR varchar(25SET @yourPriceCHAR = @yourPrice
    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 'Change the current Price of '+@lastPrice+' to '+@yourPriceCHAR+' at the itemdata_'+@newItemID+'. (For the visual Price ingame)'
    /*END which Itemdata.txr*/

    /*for _RefObjCommon Price*/
    UPDATE _RefObjCommon SET Price = @yourPrice WHERE ID = @ItemID

    /* for _RefPackageItem */
    IF EXISTS (SELECT CodeName128 FROM _RefPackageItem WHERE CodeName128 'Package_'+@CodeName)
        
    BEGIN
            
    print 'Already added @ RefPackageItem/.txt!'
        
    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 AND PaymentDevice AND Cost = @yourPrice)
        
    BEGIN
            
    print 'Already added @ RefPricePolicyOfItem/.txt!'
        
    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,1,0,@yourPrice,-1,'xxx',-1,'xxx',-1,'xxx',-1,'xxx')
    Declare @
    NEWPRICE varchar(15SET @NEWPRICE = @yourPrice
    print ''
    print 'Add the following line @ refpricepolicyofitem.txt'
    print '1    15    PACKAGE_'+@CodeName+'    1    0    '+@NEWPRICE+'    -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 'Already added @ RefShopGoods/.txt!'
        
    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 'Already added @ RefScrapOfPackageItem/.txt!'
        
    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,@Data,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 MAX([Index]) FROM _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!' 
    Same nothing changed

  4. #4
    Member siyoteam is offline
    MemberRank
    Oct 2011 Join Date
    93Posts

    Re: Gameserver/After Npc Edit

    Quote Originally Posted by LegendM View Post
    Hi guys I have problem with gameserver.I edit all thing in database and client side but when I try open gameserver this error happen and gameserver close
    double name in _RefObjCommon

  5. #5
    Newbie LegendM is offline
    MemberRank
    Sep 2011 Join Date
    22Posts

    Re: Gameserver/After Npc Edit

    Quote Originally Posted by siyoteam View Post
    double name in _RefObjCommon
    I do not understand.

  6. #6
    Newbie siksika is offline
    MemberRank
    Jan 2012 Join Date
    15Posts

    Re: Gameserver/After Npc Edit

    u need to delete all the old lines that u added be4 usin the new query

  7. #7
    Newbie LegendM is offline
    MemberRank
    Sep 2011 Join Date
    22Posts

    Re: Gameserver/After Npc Edit

    Quote Originally Posted by siksika View Post
    u need to delete all the old lines that u added be4 usin the new query
    So I must do
    1.Using this query to clean database
    2.Add items

    Right?

  8. #8
    Newbie siksika is offline
    MemberRank
    Jan 2012 Join Date
    15Posts

    Re: Gameserver/After Npc Edit

    this query doesnt clean database it just adds items to npc u need to delete lines that u add manualy

  9. #9
    Newbie LegendM is offline
    MemberRank
    Sep 2011 Join Date
    22Posts

    Re: Gameserver/After Npc Edit

    Quote Originally Posted by siksika View Post
    this query doesnt clean database it just adds items to npc u need to delete lines that u add manualy
    (0 row(s) affected)
    Msg 515, Level 16, State 2, Line 49
    Cannot insert the value NULL into column 'CodeName128', table 'SRO_VT_SHARD_INIT.dbo._RefPackageItem'; column does not allow nulls. INSERT fails.
    The statement has been terminated.

    Add the following line @ refpackageitem.txt


    Msg 515, Level 16, State 2, Line 64
    Cannot insert the value NULL into column 'RefPackageItemCodeName', table 'SRO_VT_SHARD_INIT.dbo._RefPricePolicyOfItem'; column does not allow nulls. INSERT fails.
    The statement has been terminated.

    Add the following line @ refpricepolicyofitem.txt


    Msg 515, Level 16, State 2, Line 80
    Cannot insert the value NULL into column 'RefPackageItemCodeName', table 'SRO_VT_SHARD_INIT.dbo._RefShopGoods'; column does not allow nulls. INSERT fails.
    The statement has been terminated.

    Add the following line @ refshopgoods.txt


    Msg 515, Level 16, State 2, Line 94
    Cannot insert the value NULL into column 'RefPackageItemCodeName', table 'SRO_VT_SHARD_INIT.dbo._RefScrapOfPackageItem'; column does not allow nulls. INSERT fails.
    The statement has been terminated.

    Add the following line @ refscrapofpackageitem.txt
    Msg 245, Level 16, State 1, Line 100
    Conversion failed when converting the varchar value ' 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 xxx -1 xxx -1 xxx -1 xxx ' to data type int.


    Any idea?

  10. #10
    Newbie siksika is offline
    MemberRank
    Jan 2012 Join Date
    15Posts

    Re: Gameserver/After Npc Edit

    change first line use SRO_VT_SHARD to SRO_VT_SHARD_INIT if u already did then i have no idea =] sry =]



Advertisement