Silkroad Guildleri 5 Lvlden Başlatma Kodu

silkroad_admin

Administrator
Yönetici
Silkroad Guildleri 5 Lvlden Başlatma Kodu Sizlerle.

USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_Guild_Create] Script Date: 08/16/2012 23:40:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

--
ALTER PROCEDURE [dbo].[_Guild_Create]
@GuildName varchar(64),
@CreaterID int
as
if (exists (select id from _Guild where Name = @GuildName))
begin
return -1000
end
if (exists (select CharID from _GuildMember where CharID = @CreaterID))
begin
return -1001
end
begin transaction

declare @GuildID int
declare @FoundationDate smalldatetime

set @FoundationDate = GetDate()
insert _Guild(Name, Lvl, GatheredSP, FoundationDate,Alliance,Booty) values(@GuildName, 5, 123456, @FoundationDate,0,0)
set @GuildID = @@identity

if (@@error <> 0 or @@rowcount = 0 or @GuildID = 0)
begin
rollback transaction
return -5
end


--길드장은 퍼미션이 0xffffffff !!
declare @rvalue int
exec @rvalue = _Guild_FnAddMember @GuildID, @CreaterID, 0, @FoundationDate,0xffffffff
if (@@error <> 0 or @rvalue <= 0)
begin
rollback transaction
return @rvalue
end

-- 길드 창고를 생성하자
exec @rvalue = _Guild_CreateChest_NoTX @GuildID
if (@@error <> 0 or @rvalue <= 0)
begin
rollback transaction
return @rvalue
end


commit transaction
return @GuildID
 
Üst