تسجيل الدخول دائمآ
ط·آ§ط¸â€‍ط·آ¥ط·آ¹ط¸â€‍ط·آ§ط¸â€ ط·آ§ط·ع¾

الـجـروب الـخـاص بـالـمـنـتـدي Silkroad4arab Facebook | Official Group 



قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة [ قسم خاص لأسئلة واستفسارات عمل السيرفرات الخاصة ] [ يرجى الالتزام بقوانين قسم الأسئلة والاستفسارات ]

 
 
أدوات الموضوع انواع عرض الموضوع
قديم 07-11-2018, 02:33 PM   #13

stafherp
عضو مميز



الصورة الرمزية stafherp


• الانـتـسـاب » Oct 2012
• رقـم العـضـويـة » 106331
• المشـــاركـات » 957
• الـدولـة » GIZZA
• الـهـوايـة » Babel.SRO only
• اسـم الـسـيـرفـر » Lepus
• الـجـنـس » Male
• نقـاط التقييم » 13
stafherp صـاعـد

stafherp غير متواجد حالياً



افتراضي رد: start itmes



كود PHP:
USE [SRO_VT_SHARD]
GO
/****** Object:  StoredProcedure [dbo].[_ADD_ITEM_EXTERN]    Script Date: 11/7/2018 1:26:27 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO







ALTER       procedure 
[dbo].[_ADD_ITEM_EXTERN]  
@
charname  varchar(64),  
@
codename  varchar(128),  
@
data   int,  
@
opt_level  int  
as  
 declare @
charid int  
 
declare @ref_item_id int  
 
declare @link_to_item int  
 
declare @inv_capacity int

 set 
@inv_capacity = 45

 
if (not exists (select * from _RefObjCommon where Codename128 = @codename))  
 
begin  
  raiserror
('unknown item: %s', 1, 16, @codename)  
  return -
1  
 end  
 
if (not exists (select * from _char with (nolock) where charname16 = @charname))  
 
begin  
  raiserror
('not existing character: %s', 1, 16, @charname)  
  return -
2  
 end  
 select 
@charid = charid, @inv_capacity = InventorySize from _char with (nolock) where charname16 = @charname  
 
if (not exists (select * from _inventory with (nolock) where charid = @charid and slot >= 13 and slot < @inV_capacity and itemid = 0))  
 
begin  
  raiserror
('Inventory Full: %s', 1, 16, @charname)  
  return -
3  -- inventory full  
 end  
 
declare @empty_slot int  
 select top 1 
@empty_slot = slot from _inventory with (nolock) where charid = @charid and slot >= 13 and slot < @inV_capacity and itemid = 0 order by slot  
 set 
@ref_item_id = 0  
 set 
@link_to_item = 0  
 select 
@ref_item_id = id, @link_to_item = link from _RefObjCommon where codename128 = @codename  
 
if (@ref_item_id = 0 or @ref_item_id is null)  
 
begin  
  raiserror
('@RefItemID == NULL: %s', 1, 16, @charname)  
  return -
4  
 end  
 
if (@link_to_item = 0 or @link_to_item is null)  
 
begin  
  raiserror
('RefItem Link == NULL: %s', 1, 16, @charname)  
  return -
5  
 end  
 
declare @tid1 int  
 
declare @tid2 int  
 
declare @tid3 int
 
declare @tid4 int
 select 
@tid1 = TypeID1, @tid2 = TypeID2, @tid3 = TypeID3, @tid4 = TypeID4 from _RefObjCommon where ID = @ref_item_id  
 
declare @IS_EQUIP int
 
declare @IS_PET int
 set 
@IS_EQUIP = 0 
 set 
@IS_PET = 0 
 
if (@tid1 <> 3)  
 
begin  
  raiserror
('not item: %s, %s', 1, 16, @charname, @codename)   
  return -
6  -- آ؟أ€أ€×! ¾أ†أ€أŒأ…أ›أ€أŒ ¾أ†´أڈ¾أں?  
 
end  
 
if (@tid1 = 3 and @tid2 = 1)  
  
set @IS_EQUIP = 1
else if (@tid1 = 3 and @tid2 = 2 and @tid3 = 1 and (@tid4 = 1 or @tid4 = 2 ) )
 
set @IS_PET = 1
 
declare @item_id bigint  
 set 
@item_id = 0  
   
 
declare @dummy_serial_number bigint  
 set 
@dummy_serial_number = 0  
 
if (@IS_EQUIP = 1)  
 
begin  
  
declare @dur int  
  select 
@dur = Dur_L from _RefObjItem where ID = @link_to_item  
  set 
@data = @dur  
  
if (@opt_level < 12)  
   
set @opt_level = 12  
  
else if (@opt_level > 12)  
   
set @opt_level = 12  
    
  
declare @remain_gold bigint  
  select 
@remain_gold = remaingold from _char where charid = @charid  
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--        
»أ³أپآ،°³أ†أ* (أƒأ–¼±أˆ£)
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  
exec _STRG_ADD_EQUIP_NORMAL @item_id output, @dummy_serial_number output, 6, @charid, @empty_slot, @ref_item_id, @opt_level, 0, @data
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
end  
 
else  
 
begin  
    
if( @IS_PET = 1 )
          
set @data = 0
    
else
    
begin
          
declare @max_count int  
          select 
@max_count = MaxStack from _RefObjItem where ID = @link_to_item  
    
          
if (@data <= 0 or @data > @max_count)  
          
begin
            set 
@data = @max_count  
          end
    end
    
    
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    --        
»أ³أپآ،°³أ†أ* (أƒأ–¼±أˆ£)
    --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
      
exec _STRG_ADD_EXPENDABLE @item_id output, @dummy_serial_number output, 6, @charid, @empty_slot, @ref_item_id, @data
      
    
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
end  

 
if (@item_id > 0)  
  return 
1  
 
else  
 
begin  
  raiserror
('failed for unknown reason: %s, %s', 1, 16, @charname, @codename)   
  return -
7  
 end 
+12




 


يتصفح الموضوع حالياً : 1 (0 عضو و 1 زائر)
 

ضوابط المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع

المواضيع المتشابهه
الموضوع كاتب الموضوع المنتدى الردود آخر مشاركة
How TO add Itmes in Itme mall ;( mohamed6663 قسم الاسئلة و الاستفسارات لعمل السيرفرات الخاصة 0 08-08-2012 05:00 AM


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