17-09-2013, 05:16 AM
|
#1
|
|
• الانـتـسـاب » Sep 2012
|
• رقـم العـضـويـة » 105332
|
• المشـــاركـات » 319
|
• الـدولـة »
|
• الـهـوايـة » Hex,PHP,C#,SQL
|
• اسـم الـسـيـرفـر » No Server
|
• الـجـنـس » Male
|
• نقـاط التقييم » 43
|
|
|
SQL script for EquipmentsToInvenotry to fixed bugg item crash By Yui
Hello Silkroad4arab
Today i will add new way to fixed item crash
example you use item get crash every time when login
this script will help you to solved this problem
all item will back to your Invenotry again
كود PHP:
USE [SRO_VT_SHARD]
GO
/****** Create By Yui SQL *****/
/****** Object: StoredProcedure [dbo].[_emptyEquipmentsToInvenotry] Script Date: 23/09/2012 07:37:38 م ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: Megaman
-- Create date: No specific date
-- Description: Uneqiupment all Weapons, Armors and Accessories from Character
-- =============================================
CREATE PROCEDURE [dbo].[_emptyEquipmentsToInvenotry]
-- Add the parameters for the stored procedure here
@charname16 varchar (16)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Declare @intFlag1 INT -- For Slots
Declare @intFlag2 INT -- For Equipments Slots
Declare @Flag2Permission INT -- Permissions for Equipments slots
Declare @ITEMID INT -- For Gathering ItemID as Temporary
Declare @CharID INT -- For Gathering Character ID
SET @intFlag1 = 13
SET @intFlag2 = 0
SET @Flag2Permission = 0
-- Checking before starting Actions
IF not exists (select CharID from _Char where CharName16 = @charname16)
BEGIN
Return -4 -- The character is not exists
END
SET @CharID = (select CharID from _Char where CharName16 = @charname16)
-- WARNING !! WARNING !! Starting Actions !! WARNING !! WARNING
WHILE (@intFlag1 <=109)
Begin
IF (select i.ItemID from _Inventory i where i.CharID = @CharID and i.Slot = @intFlag1) = 0
BEGIN
SET @Flag2Permission = 1
WHILE (@intFlag2 <= 12) and (@Flag2Permission = 1)
BEGIN
IF (select ItemID from _Inventory where Slot = @intFlag2 and CharID = @CharID) != 0
BEGIN
-- Checking If ITEMID is not Dummy object
IF (select ItemID from _Inventory where Slot = @intFlag2 and CharID = @CharID) = 0
BEGIN
Return -3 -- ITEM is selected wrongly
END
SET @ITEMID = (select ItemID from _Inventory where Slot = @intFlag2 and CharID = @CharID)
UPDATE _Inventory set ItemID = @ITEMID where CharID = @CharID and Slot = @intFlag1
Update _Inventory Set ItemID = 0 where CharID = @CharID and Slot = @intFlag2
END
SET @intFlag2 = @intFlag2 + 1
SET @Flag2Permission = 0
END
END
SET @intFlag1 = @intFlag1 + 1
END
END
GO
كود PHP:
exec dbo._emptyEquipmentsToInvenotry [ Character Name]
i hope this script will help owner of serve's
|
|
|