Register for your free account! | Forgot your password?

You last visited: Today at 02:12

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Some Querys

Discussion on [Release] Some Querys within the SRO PServer Guides & Releases forum part of the SRO Private Server category.

Reply
 
Old 08/10/2015, 11:15   #16
 
Mohamed Yakout's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 105
Received Thanks: 16
oke
Mohamed Yakout is offline  
Old 08/10/2015, 11:16   #17
 
elite*gold: 0
Join Date: Jul 2015
Posts: 41
Received Thanks: 7
sry i missed this query xD
i have much more but this one :/
Vision Sro is offline  
Old 08/10/2015, 11:17   #18
 
Mohamed Yakout's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 105
Received Thanks: 16
nvm can i ask for some another querys
Mohamed Yakout is offline  
Old 08/10/2015, 11:17   #19
 
elite*gold: 0
Join Date: Jul 2015
Posts: 41
Received Thanks: 7
ask whatever u want ..
Vision Sro is offline  
Old 08/10/2015, 11:17   #20
 
Mohamed Yakout's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 105
Received Thanks: 16
query to add item to npc
Mohamed Yakout is offline  
Old 08/10/2015, 11:18   #21
 
elite*gold: 0
Join Date: Jul 2015
Posts: 41
Received Thanks: 7
Quote:
Originally Posted by Mohamed Yakout View Post
query to add item to npc
PHP Code:
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 @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_M_CLOTHES_12_FA_A' -- Item CodeName in RefObjCommon
SET 
@Price 5000000 -- 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 
@TAB 'STORE_KT_ARMOR_TAB3' -- 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(IDFROM _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(IDFROM _RefShopTab WHERE CodeName128 = @TAB) < 1)
BEGIN
    
PRINT 'TAB VALUE IS NOT VALID..!'
    
PRINT 'FAILED.'
    
RETURN
END
IF ((SELECT COUNT (RefPackageItemCodeNameFROM _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 (RefPackageItemCodeNameFROM _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 (CodeName128FROM _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 (PaymentDeviceFROM _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 (PaymentDeviceFROM _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 = [IndexFROM _RefScrapOfPackageItem ORDER BY [IndexDESC
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], CountryIDCodeName128SaleTagExpandTermNameStrIDDescStrIDAssocFileIconParam1Param1_Desc128Param2Param2_Desc128Param3Param3_Desc128Param4Param4_Desc128VALUES (115, @ID, @PackageName0'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 
(ServiceCountryRefPackageItemCodeNameRefItemCodeNameOptLevelVarianceDataMagParamNumMagParam1MagParam2MagParam3MagParam4MagParam5MagParam6MagParam7MagParam8MagParam9MagParam10MagParam11MagParam12Param1Param1_Desc128Param2Param2_Desc128Param3Param3_Desc128Param4Param4_Desc128, [Index]) VALUES (115, @PackageName, @CodeName00, @Data0000000000000, -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
IF (@SkipPricePolicyOfItem OR @SkipPricePolicyOfItem AND @Price 0)
BEGIN
    INSERT _RefPricePolicyOfItem 
(ServiceCountryRefPackageItemCodeNamePaymentDevicePreviousCostCostParam1Param1_Desc128Param2Param2_Desc128Param3Param3_Desc128Param4Param4_Desc128VALUES (115, @PackageName10, @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
IF (@SkipPricePolicyOfItem OR @SkipPricePolicyOfItem AND @SilkPrice 0)
BEGIN
    INSERT _RefPricePolicyOfItem 
(ServiceCountryRefPackageItemCodeNamePaymentDevicePreviousCostCostParam1Param1_Desc128Param2Param2_Desc128Param3Param3_Desc128Param4Param4_Desc128VALUES (115, @PackageName20, @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
INSERT _RefShopGoods 
(ServiceCountryRefTabCodeNameRefPackageItemCodeNameSlotIndexParam1Param1_Desc128Param2Param2_Desc128Param3Param3_Desc128Param4Param4_Desc128VALUES (115, @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 
Vision Sro is offline  
Old 08/10/2015, 11:18   #22
 
Mohamed Yakout's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 105
Received Thanks: 16
how does it work xD sry am begineer
Mohamed Yakout is offline  
Old 08/10/2015, 11:20   #23
 
elite*gold: 0
Join Date: Jul 2015
Posts: 41
Received Thanks: 7
its simple
SET @CodeName = 'here your item code that u want to add to npc' -- Item CodeName in RefObjCommon
SET @Price =this is gold price if u wanna arena coin price or anything else so leave it 0 -- Set 0 if you don't want to set GOLD PRICE
SET @SilkPrice = here u write silk price if u want -- Set 0 if you don't want to set Silk Price
Vision Sro is offline  
Old 08/10/2015, 11:20   #24
 
Mohamed Yakout's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 105
Received Thanks: 16
and how can i change TAB ?
Mohamed Yakout is offline  
Old 08/10/2015, 11:21   #25
 
elite*gold: 0
Join Date: Jul 2015
Posts: 41
Received Thanks: 7
write which tab u want in there
SET @TAB = 'STORE_KT_ARMOR_TAB3' -- Tab name in NPC, For _RefShopGoods
TAB1 or 2 or 3 or 4 .. which u want
Vision Sro is offline  
Old 08/10/2015, 11:21   #26
 
Mohamed Yakout's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 105
Received Thanks: 16
ok can i have another querys xD ?
sry if i being annoying
Mohamed Yakout is offline  
Old 08/10/2015, 11:22   #27
 
elite*gold: 0
Join Date: Jul 2015
Posts: 41
Received Thanks: 7
nah its okay .. tell me which query u want
Vision Sro is offline  
Old 08/10/2015, 11:22   #28
 
Mohamed Yakout's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 105
Received Thanks: 16
query to remove item from monster
Mohamed Yakout is offline  
Old 08/10/2015, 11:23   #29
 
elite*gold: 0
Join Date: Jul 2015
Posts: 41
Received Thanks: 7
Use [SRO_VT_SHARD]
Delete From dbo._RefMonster_AssignedItemDrop Where RefItemID = 'Item ID' and RefMonsterID = 'Mob ID';
write item id and mob id then press execute .. item will be removed from monster
Vision Sro is offline  
Old 08/10/2015, 11:23   #30
 
Mohamed Yakout's Avatar
 
elite*gold: 0
Join Date: Dec 2014
Posts: 105
Received Thanks: 16
query to plvl char
Mohamed Yakout is offline  
Reply


Similar Threads Similar Threads
[Release] Tools and Querys
05/20/2015 - SRO PServer Guides & Releases - 2 Replies
Tools and query's 1 pack 2 pack All cleaned thanks will be enough
[Release] Admin-Quest - Ingame MySQL Querys
03/01/2015 - Metin2 PServer Guides & Strategies - 9 Replies
Simpel aber nützlich, eine kleine Quest zum ausführen von SQL-Querys direkt aus dem Client. Wofür nützlich? Ach, ich weiss selber nicht. Vielleicht wenn man keine Lust hat Navicat zu öffnen oder what ever. Nehmt die Quest und macht was damit :awesome: Wie immer bin ich an Verbesserungsvorschlägen am Code interessiert :) Special Thanks: luki4fun - für die Denkstütze mit der Schleife .Xilent - für die Hilfe beim Fehler suchen
[Release] 2 mobs packed + querys
04/02/2013 - Metin2 PServer Guides & Strategies - 15 Replies
Hi Elitepvpers. EVERYTHING IS MOVED TO MY OWN WEBSITE! I wont answer anyone on elitepvpers anymore. I'm tired of all my stuff gets shut down. (closed) so I decided. to move everything I have in here, to my own website. International Metin2 Forum.
[Release]Dark-Fusion2 Alle Querys
08/21/2012 - Metin2 PServer Guides & Strategies - 18 Replies
Naice
[Release] 2011er Querys Reittiere
10/14/2011 - Metin2 PServer Guides & Strategies - 17 Replies
Hey Com, Vorwort : Ich habe in der SuFu gesucht und habe keinen Thread darüber gefunden. So ich Release mal die Querys für die 2011er Datenbank von den 4 Reittieren. Da viele die nicht haben werde ich sie hier publizieren. Wie gesagt es ist nichts besonderes und kann jeder selbst machen (Aber nur wer's weiß wie das geht ;)) Querys



All times are GMT +2. The time now is 02:12.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.