|
• الانـتـسـاب » Mar 2008
|
• رقـم العـضـويـة » 15312
|
• المشـــاركـات » 409
|
• الـدولـة » مصر
|
• الـهـوايـة » handst sot/silkroad
|
• اسـم الـسـيـرفـر » Taurus
|
• الـجـنـس » Male
|
• نقـاط التقييم » 10
|
|
|
رد: مطلوب Procedures
اقتباس:
المشاركة الأصلية كتبت بواسطة DarkTeam
عفوا ,,, لايمكنك مشاهده الروابط لانك غير مسجل لدينا [ للتسجيل اضغط هنا ]
اهو
كود PHP:
Use [SRO_VT_SHARDLOG] --# write database name [Whatever] *Written database name must be exists.
Go
Create Table [dbo].[iLegend_Tool] -- common table
([ID][Int] NOT NULL Primary Key Identity ,
[Service][Int] NOT NULL ,
[Type][Varchar](50) NOT NULL ,
[Target][Varchar](60) ,
[Message][Varchar](Max) ,
[RefMobID][Varchar](10) ,
[RefItemID][Varchar](10) ,
[Amount][Varchar](4) ,
[OptLvl][Varchar](3) ,
[RegionID][Varchar](50) ,
[PosX][Varchar](50) ,
[PosY][Varchar](50) ,
[PosZ][Varchar](50) ,
[WorldID][Varchar](50) ,
[CapeColor][Varchar](10) ,
[StallTitle][Varchar](100) ,
[StallGreating][Varchar](100) ,
[StallSlot][Varchar](1) ,
[InvSlot][Varchar](3) ,
[ItemCount][Varchar](10) ,
[ItemPrice][Varchar](20) ,
[Date][Varchar](100) NOT NULL);
Go
Create Table [dbo].[_IncomingGlobalChat] -- global log table
([ID][Int] NOT NULL Primary Key Identity ,
[CharName][Varchar](60) NOT NULL ,
[GlobalChat][Varchar](Max) NOT NULL ,
[Date][Varchar](100) NOT NULL);
Go
Create Table [dbo].[_IncomingPrivateChat] -- private chat log table
([ID][Int] NOT NULL Primary Key Identity ,
[CharName][Varchar](60) NOT NULL ,
[Chat][Varchar](Max) NOT NULL ,
[Date][Varchar](100) NOT NULL);
Go
Create Table [dbo].[_UniquesLog]
([ID][Int] NOT NULL Primary Key Identity , -- unique log table
[Type][Int] NOT NULL ,
[CodeName128][Varchar](128) NOT NULL ,
[Killer][Varchar](60) ,
[Date][Varchar](100) NOT NULL);
Go
Create table [dbo].[StallItemBuyers]
([ID][Int] NOT NULL Primary Key Identity , -- stall buyers table
[BuyerName][Varchar](50) NOT NULL ,
[StallSlot][INT] NOT NULL ,
[Date][Varchar](100) NOT NULL)
Go
Create table [dbo].[ExecQuery]
([ID][Int] NOT NULL Primary Key Identity , -- execute queries table
[Day][Varchar](50) NOT NULL ,
[Time][Varchar](50) NOT NULL ,
[DatabaseIndex][INT] NOT NULL ,
[Query][Varchar](8000) NOT NULL)
Go
SET ANSI_NULLS ON
Go
SET QUOTED_IDENTIFIER ON
Go
Create Procedure [dbo].[_Tool_Use] -- tool use procedure
@Service [Varchar](1),
@Type [Varchar](50),
@Target [Varchar](60), -- Allow Null
@Message [Varchar](max), -- Allow Null
@RefMobID [Varchar](10), -- Allow Null
@RefItemID [Varchar](10), -- Allow Null
@Amount [Varchar](4), -- Allow Null
@OptLvl [Varchar](3), -- Allow Null
@RegionID [Varchar](50), -- Allow Null
@PosX [Varchar](50), -- Allow Null
@PosY [Varchar](50), -- Allow Null
@PosZ [Varchar](50), -- Allow Null
@WorldID [Varchar](50), -- Allow Null
@CapeColor [Varchar](50), -- Allow Null
@StallTitle [Varchar](100), -- Allow Null
@StallGreating [Varchar](100), -- Allow Null
@StallSlot [Varchar](1), -- Allow Null
@InvSlot [Varchar](3), -- Allow Null
@ItemCount [Varchar](10), -- Allow Null
@ItemPrice [Varchar](20) -- Allow Null
As
--------------------------------------------------------------------------------
/* @Type */ /* Required Values For Insert */
-- Notice (Service,Type,Message,Date)
-- Global (Service,Type,Message,Date)
-- Public (Service,Type,Message,Date)
-- Private (Service,Type,Target,Message,Date)
-- Message (Service,Type,Target,Message,Date)
-- Movetouser (Service,Type,Target,Date)
-- Recalluser (Service,Type,Target,Date)
-- Recallguild (Service,Type,Target,Date)
-- Totown (Service,Type,Target,Date)
-- Disconnect (Service,Type,Target,Date)
-- Warp (Service,Type,RegionID,PosX,PosY,PosZ,WorldID,Date)
-- Loadmonster (Service,Type,RefMobID,Amount,Date)
-- Makeitem (Service,Type,RefItemID,Amount,OptLvl,Date)
-- Invincible (Service,Type,Date)
-- Invisible (Service,Type,Date)
-- Gotown (Service,Type,Date)
-- GMskill (Service,Type,Date)
-- PvpCape (Service,Type,CapeColor,Date)
-- CreateStall (Service,Type,StallTitle,StallGreating,Date)
-- AddStallItem (Service,Type,StallSlot,InvSlot,ItemCount,ItemPrice,Date)
-- OpenStall (Service,Type,Date)
-- CloseStall (Service,Type,Date)
--------------------------------------------------------------------------------
Insert Into [dbo].[iLegend_Tool]
(Service,Type,Target,Message,RefMobID,RefItemID,Amount,OptLvl,RegionID,PosX,PosY,PosZ,WorldID,CapeColor,StallTitle,StallGreating,StallSlot,InvSlot,ItemCount,ItemPrice,Date)
Values
(@Service,@Type,@Target,@Message,@RefMobID,@RefItemID,@Amount,@OptLvl,@RegionID,@PosX,@PosY,@PosZ,@WorldID,@CapeColor,@StallTitle,@StallGreating,@StallSlot,@InvSlot,@ItemCount,@ItemPrice,GETDATE())
Go
Create Procedure [dbo].[_Add_IncomingChat] -- save incoming chat procedure
@Type [Varchar](60) ,
@CharName [Varchar](60) ,
@Message [Varchar](Max)
As
--------------------------------------------------------------------------------------------------------------------------
-- @Type = 1 means private chat
-- @Type = 2 means global chat
IF @Type = 1
Begin
Insert Into [dbo].[_IncomingPrivateChat] (CharName,Chat,Date) Values (@CharName,@Message,GETDATE())
End
IF @Type = 2
Begin
Insert Into [dbo].[_IncomingGlobalChat] (CharName,GlobalChat,Date) Values (@CharName,@Message,GETDATE())
End
Go
Create Procedure [dbo].[_Add_UniqueLog] -- save unique log procedure
@Type [Varchar](1) ,
@RefMonsterID [Int] ,
@Killer [Varchar](60)
As
Declare @CodeName Varchar(128) = (Select CodeName128 From [SRO_VT_SHARD].[dbo].[_RefObjCommon] Where ID = @RefMonsterID)
--------------------------------------------------------------------------------------------------------------------------
-- @Type = 1 means Spawned
-- @Type = 2 means Killed
Insert Into [dbo].[_UniquesLog] (Type,CodeName128,Killer,Date) Values (@Type,@CodeName,@Killer,GETDATE())
GO
Create Procedure [dbo].[_ExecuteAfterTime]
@CoolTime Varchar(10) , -- For example '00:00:05' (for execute query after 5 seconds from time now)
@Query Varchar(Max)
As
--------------------------------------------------------------------------------------------------------------------------
Declare @Time Time(0) , @ID Varchar(20)
Set @Time = Getdate() + @CoolTime
Set @ID = (Select Max(ID) From [dbo].[ExecQuery])
IF @ID Is Null Set @ID = 1 ELSE Set @ID = @ID + 1
Set @Query = @Query + ' Delete From [dbo].[ExecQuery] Where ID = ' + @ID
Set Identity_Insert [dbo].[ExecQuery] ON
Insert into ExecQuery (ID,Day,Time,DatabaseIndex,Query) Values (@ID,'Always',@Time,1,@Query)
Set Identity_Insert [dbo].[ExecQuery] OFF
|
ده مش كامل راجع قبل مترد علي الموضوع و تقول يغلق
|