الموضوع: start itmes
عرض مشاركة واحدة
قديم 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'116, @codename)  
  return -
1  
 end  
 
if (not exists (select from _char with (nolockwhere charname16 = @charname))  
 
begin  
  raiserror
('not existing character: %s'116, @charname)  
  return -
2  
 end  
 select 
@charid charid, @inv_capacity InventorySize from _char with (nolockwhere charname16 = @charname  
 
if (not exists (select from _inventory with (nolockwhere charid = @charid and slot >= 13 and slot < @inV_capacity and itemid 0))  
 
begin  
  raiserror
('Inventory Full: %s'116, @charname)  
  return -
3  -- inventory full  
 end  
 
declare @empty_slot int  
 select top 1 
@empty_slot slot from _inventory with (nolockwhere 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 or @ref_item_id is null)  
 
begin  
  raiserror
('@RefItemID == NULL: %s'116, @charname)  
  return -
4  
 end  
 
if (@link_to_item or @link_to_item is null)  
 
begin  
  raiserror
('RefItem Link == NULL: %s'116, @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 
 set 
@IS_PET 
 
if (@tid1 <> 3)  
 
begin  
  raiserror
('not item: %s, %s'116, @charname, @codename)   
  return -
6  -- آ؟أ€أ€×¾أ†أ€أŒأ…أ›أ€أŒ ¾أ†´أڈ¾أں?  
 
end  
 
if (@tid1 and @tid2 1)  
  
set @IS_EQUIP 1
else if (@tid1 and @tid2 and @tid3 and (@tid4 or @tid4 ) )
 
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 output6, @charid, @empty_slot, @ref_item_id, @opt_level0, @data
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
end  
 
else  
 
begin  
    
if( @IS_PET )
          
set @data 0
    
else
    
begin
          
declare @max_count int  
          select 
@max_count MaxStack from _RefObjItem where ID = @link_to_item  
    
          
if (@data <= or @data > @max_count)  
          
begin
            set 
@data = @max_count  
          end
    end
    
    
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    --        
»أ³أپآ،°³أ†أ* (أƒأ–¼±أˆ£)
    --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
      
exec _STRG_ADD_EXPENDABLE @item_id output, @dummy_serial_number output6, @charid, @empty_slot, @ref_item_id, @data
      
    
--@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    --@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
 
end  

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