الموقع العربي الاول للعبة Silkroad Online

الموقع العربي الاول للعبة Silkroad Online (https://silkroad4arab.com/vb/index.php)
-   قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة (https://silkroad4arab.com/vb/forumdisplay.php?f=226)
-   -   ITEMS IN NPC (https://silkroad4arab.com/vb/showthread.php?t=620054)

ahmedjemy 15-10-2017 06:47 PM

ITEMS IN NPC
 
ازاي اغير ال weapons - accessory - set اللي في ال Npc اللي هي النورمال العادية اللي من
degree 1 لحد degree 9 بدل ما تكون عادية اخليها SUN و ازاي اعملها FullBlue .
شكرا

Neoon 15-10-2017 06:56 PM

رد: ITEMS IN NPC
 

ahmedjemy 15-10-2017 11:23 PM

رد: ITEMS IN NPC
 
تمام دا ازاي اعمل ال PLUS و STAT و Full blue
انا لو عايز اشيل النورمال items اللي في ال npc دا و احط بدالها sun ازاي؟

ahmedjemy 15-10-2017 11:26 PM

رد: ITEMS IN NPC
 
و ياريت كويري اقدر اعرف بيه رقم السطر بتاع الايتم في ال _RefScrapOfPackageItem

Neoon 15-10-2017 11:30 PM

رد: ITEMS IN NPC
 
كود PHP:

Media.pk2\server_dep\silkroad\textdata\refpackagei tem.txt Media.pk2\server_dep\silkroad\textdata\refpricepol icyofitem.txt Media.pk2\server_dep\silkroad\textdata\refscrapofp ackageitem.txt Media.pk2\server_dep\silkroad\textdata\refshopgood s.txt 


1. Go to ur SQL --> SRO_VT_SHARD (or how u call it) --> refpackageitem
And In Media --> server_dep\silkroad\textdata\refpackageitem.txt

First in the database for generating ID after in media.pk2
Code:
كود PHP:

1 15 1864 PACKAGE_ITEM_PRE_MALL_AVATAR_M_SAYTAN_DRESS 0 EXPAND_TERM_ALL SN_ITEM_PRE_MALL_AVATAR_M_SAYTAN_DRESS SN_ITEM_PRE_MALL_AVATAR_M_SAYTAN_DRESS_TT_DESC 

item\Avatar\mall_avatar_m_saytan_dress.ddj -1 XXX -1 xxx -1 xxx -1 xxx 1=on 0=off Id automatically generated Item code 1=item mall new items 0=normal Icon name in Media.pk2\Icon64\item\avatar\

2. SRO_VT_SHARD\refpricepolicyofitem and Media.pk2\server_dep\silkroad\textdata\refpricepol icyofitem.txt

Code:
كود PHP:

>>>>>>>>>>>>for silk item:<<<<<<<<<<<<<< 1 15 PACKAGE_ITEM_MALL_AVATAR_M_SAYTAN_DRESS 2 0 300 -1 xxx -1 xxx -1 xxx -1 xxx 1 15 PACKAGE_ITEM_MALL_AVATAR_M_SAYTAN_DRESS 4 0 0 -1 xxx -1 xxx -1 xxx -1 xxx 1 15 PACKAGE_ITEM_MALL_AVATAR_M_SAYTAN_DRESS 16 0 0 -1 xxx -1 xxx -1 xxx -1 xxx 1=on 0=off Item code price >>>>>>>>>>>>For gold item:<<<<<<<<<<<<<< 1 15 PACKAGE_ITEM_EU_W_HEAVY_11_SA_SET_B 1 0 3413000 -1 xxx -1 xxx -1 xxx -1 xxx 1=on 0=off Item code price
3
-SRO_VT_SHARD\refscrapofpackageitem and Media.pk2\server_dep\silkroad\textdata\refscrapofp ackageitem.txt 

First in the database for generating ID after in media.pk2

Code:
كود PHP:

1 15 PACKAGE_ITEM_PRE_MALL_AVATAR_M_SAYTAN_DRESS ITEM_PRE_MALL_AVATAR_M_SAYTAN_DRESS 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 xxx -1 xxx -1 xxx -1 xxx 1864 1=on 0=off Item code Id automatically generated
4
-SRO_VT_SHARD\refshopgoods and Media.pk2\server_dep\silkroad\textdata\refshopgood s.txt 

Code:
كود PHP:

1 15 MALL_AVATAR_DRESS PACKAGE_ITEM_PRE_MALL_AVATAR_M_SAYTAN_DRESS 66 -1 xxx -1 xxx -1 xxx -1 xxx 1=on 0=off Shop+Table ID Item code Slot(starts at 0)for example Item mall with only Shaytan avatar dress : 1 15 MALL_AVATAR_DRESS PACKAGE_ITEM_PRE_MALL_AVATAR_M_SAYTAN_DRESS 0 -1 xxx -1 xxx -1 xxx -1 xxx 1 15 MALL_AVATAR_DRESS PACKAGE_ITEM_PRE_MALL_AVATAR_W_SAYTAN_DRESS 1 -1 xxx -1 xxx -1 xxx -1 xxx 



واخيراً إعمل Import



Query Add item to npc after edit
كود PHP:

/****query add item npc edited by mohamed hasan***/ 
USE SRO_VT_SHARD 
GO 
DECLARE @ID int 
DECLARE @INDEX int 
DECLARE @CodeName varchar(128) 
DECLARE @
PackageName varchar(128) 
DECLARE @
DescSTRID varchar(128) 
DECLARE @
File varchar(128) 
DECLARE @
Price int 
DECLARE @SilkPrice int 
DECLARE @Gcoin int 
DECLARE @Scoin int 
DECLARE @Icoin int 
DECLARE @Ccoin int 
DECLARE @Acoin int 
DECLARE @Optlvl int 
DECLARE @Slot tinyint 
DECLARE @TAB varchar(128) 
DECLARE @
Data int 
DECLARE @SkipScrapOfPackageItem int = 0 
DECLARE @SkipPackageItem int = 0 
DECLARE @SkipPricePolicyOfItem int = 0 
--- Set Variables 
SET 
@CodeName = 'ITEM_CH_NECKLACE_11_A_RARE' -- Item CodeName in RefObjCommon 
SET 
@Price = 1 -- Set 0 if you don't want to set Gold Price 
SET @SilkPrice = 0 -- Set 0 if you don'
t want to set Silk Price 
SET 
@Gcoin = 0 -- Set 0 if you don't want to set Gold Coin Price 
SET @Scoin = 0 -- Set 0 if you don'
t want to set Silver Coin Price  
SET 
@Icoin = 0 -- set 0 if you don't want to set Iron Coin Price 
SET @Ccoin = 0 -- set 0 if you don'
t want to set Copper Coin Price 
SET 
@Acoin = 0 -- set 0 if you don't want to set Arena Coin Price 
SET @Optlvl = 5 -- Item Plus in npc Set 0 if you don'
t want plus for any item 
SET 
@TAB = 'STORE_CH_NOVA_SET_SELLER_TAB7' -- Tab name in NPC, For _RefShopGoods 
SET 
@PackageName = 'PACKAGE_'+@CodeName -- Do not edit if you don't know what are you doing. 
--- you don'
t need to touch here... 
IF (@
CodeName = '') 
BEGIN 
    
PRINT 'You have to edit CodeName..!' 
    
PRINT 'FAILED.' 
    
RETURN 
END 
IF ((SELECT COUNT(ID) FROM _RefObjCommon WHERE CodeName128 = @CodeName) < 1) 
BEGIN 
    
PRINT 'There is no item with this CodeName..!' 
    
PRINT 'FAILED.' 
    
RETURN 
END 
IF (@Price < 0) 
BEGIN 
    
PRINT 'Price is not VALID..!' 
    
PRINT 'FAILED.' 
    
RETURN 
END 
IF (@SilkPrice < 0) 
BEGIN 
    
PRINT 'Silk Price is not VALID..!' 
    
PRINT 'FAILED.' 
    
RETURN 
END 
IF ((SELECT COUNT(ID) FROM _RefShopTab WHERE CodeName128 = @TAB) < 1) 
BEGIN 
    
PRINT 'TAB VALUE IS NOT VALID..!' 
    
PRINT 'FAILED.' 
    
RETURN 
END 
IF ((SELECT COUNT (RefPackageItemCodeName) FROM _RefShopGoods WHERE RefPackageItemCodeName = @PackageName AND RefTabCodeName = @TAB) > 0) 
BEGIN 
    
PRINT 'There is already same item in same tab..!' 
    
PRINT 'FAILED.' 
    
RETURN 
END 
IF ((SELECT COUNT (RefPackageItemCodeName) FROM _RefScrapOfPackageItem WHERE RefPackageItemCodeName = @PackageName) > 0) 
BEGIN 
    
PRINT 'There is already an entry for this item, skipping @_RefScrapOfPackageItem table..!' 
    
SET @SkipScrapOfPackageItem = 1 
END 
IF ((SELECT COUNT (CodeName128) FROM _RefPackageItem WHERE CodeName128 = @PackageName) > 0) 
BEGIN 
    
PRINT 'There is already an entry for this item, skipping @_RefPackageItem table..!' 
    
SET @SkipPackageItem = 1 
END 
IF ((SELECT COUNT (PaymentDevice) FROM _RefPricePolicyOfItem WHERE RefPackageItemCodeName = @PackageName AND PaymentDevice = '1') > 0) 
BEGIN 
    
PRINT 'There is already an entry for this item with same PaymentDevice, skipping @_RefPricePolicyOfItem table..! (Gold)' 
    
SET @SkipPricePolicyOfItem = 1 
END 
IF ((SELECT COUNT (PaymentDevice) FROM _RefPricePolicyOfItem WHERE RefPackageItemCodeName = @PackageName AND PaymentDevice = '2') > 0) 
BEGIN 
    
PRINT 'There is already an entry for this item with same PaymentDevice, skipping @_RefPricePolicyOfItem table..! (Silk)' 
    
IF (@SkipPricePolicyOfItem = 1) 
    
BEGIN 
        SET 
@SkipPricePolicyOfItem = 3 
    END 
    
ELSE 
    
BEGIN 
        SET 
@SkipPricePolicyOfItem = 2 
    END 
END 
IF (@SilkPrice = 0) AND (@Price = 0) 
BEGIN 
    
PRINT 'You need to set a price, at least one !' 
    
PRINT 'FAILED.' 
    
RETURN 
END 
SELECT TOP 1 
@ID = ID FROM _RefPackageItem ORDER BY ID DESC 
SET 
@ID = @ID + 1 
SELECT TOP 1 
@INDEX = [Index] FROM _RefScrapOfPackageItem ORDER BY [Index] DESC 
SET 
@INDEX = @INDEX + 1 
SELECT TOP 1 
@Slot = SlotIndex FROM _RefShopGoods WHERE RefTabCodeName = @TAB ORDER BY SlotIndex DESC 
IF (@Slot = 0) 
BEGIN 
    SET 
@Slot = @Slot + 1 
END 
ELSE IF (@Slot > 0) 
BEGIN 
    SET 
@Slot = @Slot + 1 
END 
ELSE 
BEGIN 
    SET 
@Slot = 0 
END 
SET 
@DescSTRID = 'SN_' + @CodeName + '_TT_DESC' 
SELECT @File = AssocFileIcon128 FROM _RefObjCommon WHERE CodeName128 = @CodeName 
IF (@CodeName LIKE '%RING%' OR @CodeName LIKE '%NECKLACE%' OR @CodeName LIKE '%ARCHEMY%') 
BEGIN 
    SET 
@Data = 1 
END 
ELSE 
BEGIN 
    SELECT 
@Data = Dur_U FROM _RefObjItem WHERE ID = (SELECT Link FROM _RefObjCommon WHERE CodeName128 = @CodeName) 
END 
BEGIN TRANSACTION 
IF (@SkipPackageItem = 0) 
BEGIN 
    
--SET IDENTITY_INSERT _RefPackageItem ON 
    INSERT _RefPackageItem 
([Service], Country, ID, CodeName128, SaleTag, ExpandTerm, NameStrID, DescStrID, AssocFileIcon, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES (1, 15, @ID, @PackageName, 0, 'EXPAND_TERM_ALL', 'SN_'+@CodeName, @DescSTRID, @File, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx') 
        IF (@@
ERROR <> 0)   
        
BEGIN 
            
PRINT 'AN ERROR HAPPENED WHILE ADDING TO _RefPackageItem, Rolling back...' 
            
ROLLBACK TRANSACTION 
            
RETURN 
        
END 
    
PRINT 'Added to _RefPackageItem !' 
    
--SET IDENTITY_INSERT _RefPackageItem OFF 
END 
IF (@SkipScrapOfPackageItem = 0) 
BEGIN 
    INSERT _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, [Index]) VALUES (1, 15, @PackageName, @CodeName, @Optlvl, 0, @Data, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx', @INDEX) 
        IF (@@
ERROR <> 0)   
        
BEGIN 
            
PRINT 'AN ERROR HAPPENED WHILE ADDING TO _RefScrapOfPackageItem, Rolling back...' 
            
ROLLBACK TRANSACTION 
            
RETURN 
        
END 
    
PRINT 'Added to _RefScrapOfPackageItem !' 
END 
/**Gold Price***/ 
IF (@SkipPricePolicyOfItem = 2 OR @SkipPricePolicyOfItem = 0 AND @Price > 0) 
BEGIN 
    INSERT _RefPricePolicyOfItem 
(Service, Country, RefPackageItemCodeName, PaymentDevice, PreviousCost, Cost, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES (1, 15, @PackageName, 1, 0, @Price, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx') 
        IF (@@
ERROR <> 0)   
        
BEGIN 
            
PRINT 'AN ERROR HAPPENED WHILE ADDING TO _RefPricePolicyOfItem, Rolling back...' 
            
ROLLBACK TRANSACTION 
            
RETURN 
        
END 
    
PRINT 'Added to _RefPricePolicyOfItem, PaymentDevice = 1 (Gold)' 
END 
/*** Silk Price **/ 
IF (@SkipPricePolicyOfItem = 1 OR @SkipPricePolicyOfItem = 0 AND @SilkPrice > 0) 
BEGIN 
    INSERT _RefPricePolicyOfItem 
(Service, Country, RefPackageItemCodeName, PaymentDevice, PreviousCost, Cost, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES (1, 15, @PackageName, 2, 0, @SilkPrice, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx') 
        IF (@@
ERROR <> 0)   
        
BEGIN 
            
PRINT 'AN ERROR HAPPENED WHILE ADDING TO _RefPricePolicyOfItem, Rolling back...' 
            
ROLLBACK TRANSACTION 
            
RETURN 
        
END 
    
PRINT 'Added to _RefPricePolicyOfItem, PaymentDevice = 2 (Silk)' 
END 
ELSE 
BEGIN 
    
PRINT 'There is already silk / gold price, skipping _RefPricePolicyOfItem table...' 
END 
/*****Gold Coin***/ 
IF (@SkipPricePolicyOfItem = 1 OR @SkipPricePolicyOfItem = 0 AND @Gcoin > 0) 
BEGIN 
    INSERT _RefPricePolicyOfItem 
(Service, Country, RefPackageItemCodeName, PaymentDevice, PreviousCost, Cost, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES (1, 15, @PackageName, 512, 0, @Gcoin, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx') 
        IF (@@
ERROR <> 0)   
        
BEGIN 
            
PRINT 'AN ERROR HAPPENED WHILE ADDING TO _RefPricePolicyOfItem, Rolling back...' 
            
ROLLBACK TRANSACTION 
            
RETURN 
        
END 
    
PRINT 'Added to _RefPricePolicyOfItem, PaymentDevice = 512 (Gold Coin)' 
END 
ELSE 
BEGIN 
    
PRINT 'There is already silk / gold price, skipping _RefPricePolicyOfItem table...' 
END 
/***Silver Coin***/ 
IF (@SkipPricePolicyOfItem = 1 OR @SkipPricePolicyOfItem = 0 AND @Scoin > 0) 
BEGIN 
    INSERT _RefPricePolicyOfItem 
(Service, Country, RefPackageItemCodeName, PaymentDevice, PreviousCost, Cost, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES (1, 15, @PackageName, 256, 0, @Scoin, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx') 
        IF (@@
ERROR <> 0)   
        
BEGIN 
            
PRINT 'AN ERROR HAPPENED WHILE ADDING TO _RefPricePolicyOfItem, Rolling back...' 
            
ROLLBACK TRANSACTION 
            
RETURN 
        
END 
    
PRINT 'Added to _RefPricePolicyOfItem, PaymentDevice = 256 (Silver Coin)' 
END 
ELSE 
BEGIN 
    
PRINT 'There is already silk / gold price, skipping _RefPricePolicyOfItem table...' 
END 
/****Iron Coin****/ 
IF (@SkipPricePolicyOfItem = 1 OR @SkipPricePolicyOfItem = 0 AND @Icoin > 0) 
BEGIN 
    INSERT _RefPricePolicyOfItem 
(Service, Country, RefPackageItemCodeName, PaymentDevice, PreviousCost, Cost, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES (1, 15, @PackageName, 128, 0, @Icoin, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx') 
        IF (@@
ERROR <> 0)   
        
BEGIN 
            
PRINT 'AN ERROR HAPPENED WHILE ADDING TO _RefPricePolicyOfItem, Rolling back...' 
            
ROLLBACK TRANSACTION 
            
RETURN 
        
END 
    
PRINT 'Added to _RefPricePolicyOfItem, PaymentDevice = 128 (Iron Coin)' 
END 
ELSE 
BEGIN 
    
PRINT 'There is already silk / gold price, skipping _RefPricePolicyOfItem table...' 
END 
/****Copper Coin**/ 
IF (@SkipPricePolicyOfItem = 1 OR @SkipPricePolicyOfItem = 0 AND @Ccoin > 0) 
BEGIN 
    INSERT _RefPricePolicyOfItem 
(Service, Country, RefPackageItemCodeName, PaymentDevice, PreviousCost, Cost, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES (1, 15, @PackageName, 64, 0, @Ccoin, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx') 
        IF (@@
ERROR <> 0)   
        
BEGIN 
            
PRINT 'AN ERROR HAPPENED WHILE ADDING TO _RefPricePolicyOfItem, Rolling back...' 
            
ROLLBACK TRANSACTION 
            
RETURN 
        
END 
    
PRINT 'Added to _RefPricePolicyOfItem, PaymentDevice = 64 (Copper Coin)' 
END 
ELSE 
BEGIN 
    
PRINT 'There is already silk / gold price, skipping _RefPricePolicyOfItem table...' 
END 
/****Arena Coin***/ 
IF (@SkipPricePolicyOfItem = 1 OR @SkipPricePolicyOfItem = 0 AND @Acoin > 0) 
BEGIN 
    INSERT _RefPricePolicyOfItem 
(Service, Country, RefPackageItemCodeName, PaymentDevice, PreviousCost, Cost, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES (1, 15, @PackageName, 1024, 0, @Acoin, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx') 
        IF (@@
ERROR <> 0)   
        
BEGIN 
            
PRINT 'AN ERROR HAPPENED WHILE ADDING TO _RefPricePolicyOfItem, Rolling back...' 
            
ROLLBACK TRANSACTION 
            
RETURN 
        
END 
    
PRINT 'Added to _RefPricePolicyOfItem, PaymentDevice = 1024 (Arena Coin)' 
END 
ELSE 
BEGIN 
    
PRINT 'There is already silk / gold price, skipping _RefPricePolicyOfItem table...' 
END 
/************** End Prices ***************/ 
INSERT _RefShopGoods (Service, Country, RefTabCodeName, RefPackageItemCodeName, SlotIndex, Param1, Param1_Desc128, Param2, Param2_Desc128, Param3, Param3_Desc128, Param4, Param4_Desc128) VALUES (1, 15, @TAB, @PackageName, @Slot, -1, 'xxx', -1, 'xxx', -1, 'xxx', -1, 'xxx') 
    IF (@@
ERROR <> 0)   
    
BEGIN 
        
PRINT 'An error happened while adding to _RefShopGoods table' 
        
PRINT 'FAILED.' 
        
ROLLBACK TRANSACTION 
        
RETURN 
    
END 
    
PRINT 'Added to _RefShopGoods, DONE!' 
COMMIT TRANSACTION 


ahmedjemy 15-10-2017 11:38 PM

رد: ITEMS IN NPC
 
طيب انت شايف انه اسهل بالنسبة ليا يعني اعمل كده و افضل اعمل الايتم 8 و 100% و FB هيبقي اسهل
ولا اعمل NPC جديد و اضيف فيه الايتم SUN اسهل؟

Scrox 16-10-2017 10:08 PM

رد: ITEMS IN NPC
 
انت اعمل NPC جديدة و ضايف sun احسن من دى كلوا

Neoon 16-10-2017 11:51 PM

رد: ITEMS IN NPC
 
الي انت شايفو اسهل بالنسبالك اعملو

Spicoo 17-10-2017 01:08 AM

رد: ITEMS IN NPC
 
استخدم Vsro Npc Program لو عاوز تشيل ال item normal وتنزل بدالو sun

افندينا ™Hamboka™ 31-10-2017 02:21 AM

رد: ITEMS IN NPC
 
##


الساعة الآن 12:24 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions, Inc.