共享幾個存儲過程!
CREATE procedure .(@strOldUserId varchar(30),@StrNewUserId varchar(30))
AS
DECLARE @strCheckOldUserID varchar(30),@strCheckNewUserID varchar(30)
BEGIN TRAN
SELECT @strCheckOldUserID = Count(strUserId) FROM USERDATA WHERE strUserId = @strOldUserId
IF @strCheckOldUserID = 0
BEGIN
PRINT 'Veritabanında ' + @strOldUserId + ' Adında Karakter Bulunamadı.'
END
ELSE
BEGIN
SELECT @strCheckNewUserID = Count(strUserId) FROM USERDATA WHERE strUserId = @StrNewUserId
IF @strCheckNewUserID = 0
BEGIN
UPDATE ACCOUNT_CHAR set strCharID1 = @StrNewUserId WHERE strCharID1 = @strOldUserId
UPDATE ACCOUNT_CHAR set strCharID2 = @StrNewUserId WHERE strCharID2 = @strOldUserId
UPDATE ACCOUNT_CHAR set strCharID3 = @StrNewUserId WHERE strCharID3 = @strOldUserId
UPDATE USERDATA SET strUserId = @StrNewUserId WHERE strUserId = @strOldUserId
UPDATE KNIGHTS_USER SET strUserId = @StrNewUserId WHERE strUserId = @strOldUserId
UPDATE KNIGHTS SET Chief = @StrNewUserId WHERE Chief = @strOldUserId
UPDATE KNIGHTS SET ViceChief_1 = @StrNewUserId WHERE ViceChief_1 = @strOldUserId
UPDATE KNIGHTS SET ViceChief_2 = @StrNewUserId WHERE ViceChief_2 = @strOldUserId
UPDATE KNIGHTS SET ViceChief_3 = @StrNewUserId WHERE ViceChief_3 = @strOldUserId
UPDATE KING_SYSTEM SET strKingName = @StrNewUserId WHERE strKingName = @strOldUserId
UPDATE KING_ELECTION_LIST SET strName = @StrNewUserId WHERE strName = @strOldUserId
PRINT @strOldUserId + ' Olan Karakter Adı ' + @strNewUserId + ' Olarak Değiştirilmiştir.'
END
ELSE
BEGIN
PRINT @StrNewUserId + ' Karakter Adı Kullanımdadır, Lütfen Başka Bir Karakter Adı Yazınız.'
END
END
COMMIT TRAN
GO --Edited By ganks...
-- KO-CUCE.com için yapılmıştır...
CREATE PROCEDURE .
@account varchar(21)
AS
begin
declare @class smallint
select @class = cast(substring(cast(class as varchar(3)),2,2) as smallint(2)) from userdata where struserid=@account
if @class=1 or @class=5 or @class=6
set @class = 1
if @class=2 or @class=7 or @class=8
set @class = 2
if @class=3 or @class=9 or @class=10
set @class = 3
if @class=4 or @class=11 or @class=12
set @class = 4
update userdata setstritem = (select stritem from baslangic where class=@class) where struserid=@account
end
GO --Electro Shock Private Server Gaming--
--Procedure Create Time 10.05.2008--
--Please Do Not Change Procedures--
--Lütfen Procedure Üstünde Değişiklik Yapmayınız--
CREATE procedure item_encode
@StrUserID varchar(30)
AS
DECLARE
@length int,
@row int,
@i int,
@Num int,
@pos int,
@dur int,
@dur1 int,
@ext int,
@StackSize1 int,
@strName varchar(30),
@strExtName varchar(30),
@CNum varbinary(4),
@cdur varchar(2),
@Source tinyint,
@NEWNum int,
@StackSize int,
@cstack varchar(2),
@InventorySlot int
set @InventorySlot=0
set @i = 14*0
set @length = 401
select @row=count( * ) from userdata where struserid=@StrUserID
if @row>0
begin
Select @Num=Num,
@dur = Durability,
@StackSize1 = stacksize,
@StrUserID = strUserID
From INVENTORY_EDIT
Where strUserID = @StrUserID and InventorySlot=@InventorySlot
Set @CNum = Substring(cast(@Num as varbinary(4)), 4, 1) + Substring(cast(@Num as varbinary(4)), 3, 1) + Substring(cast(@Num as varbinary(4)), 2, 1) + Substring(cast(@Num as varbinary(4)), 1, 1)
Set @Cdur = cast(Substring(cast(@dur as varbinary(2)), 2, 1)+Substring(cast(@dur as varbinary(2)), 1, 1) as varchar(2))
Set @Cstack = cast(Substring(cast(@StackSize1 as varbinary(2)), 2, 1)+Substring(cast(@StackSize1 as varbinary(2)), 1, 1) as varchar(2))
update UserData set strItem = cast(cast(cast(@CNum as varchar(4)) + @Cdur + @Cstack as varchar(8)) as binary(400)) where strUserID = @strUserID
set @i=@i+8
set @InventorySlot=@InventorySlot+1
WHILE @InventorySlot < 50
Begin
Select @Num=Num,
@dur = Durability,
@StackSize1 = stacksize,
@StrUserID = strUserID
From INVENTORY_EDIT
Where strUserID = @StrUserID and InventorySlot=@InventorySlot
Set @CNum = Substring(cast(@Num as varbinary(4)), 4, 1) + Substring(cast(@Num as varbinary(4)), 3, 1) + Substring(cast(@Num as varbinary(4)), 2, 1) + Substring(cast(@Num as varbinary(4)), 1, 1)
Set @Cdur = cast(Substring(cast(@dur as varbinary(2)), 2, 1)+Substring(cast(@dur as varbinary(2)), 1, 1) as varchar(2))
Set @Cstack = cast(Substring(cast(@StackSize1 as varbinary(2)), 2, 1)+Substring(cast(@StackSize1 as varbinary(2)), 1, 1) as varchar(2))
update UserData set strItem = cast( substring(strItem, 1, @i) + cast(cast(@CNum as varchar(4)) + @Cdur + @Cstack as varchar(8)) + substring(strItem, @i+8, 401-@i) as binary(400)) where strUserID = @strUserID
set @i=@i+8
set @InventorySlot=@InventorySlot+1
end
end
GO 第一个是好东西,改名字用的,不知道行不,去测试看看 可以大概解說一下大概功用嘛??? 唉!还是不能在游戏中改中文名。 什么跟什么?
页:
[1]