ctgwglzc
发表于 2012-5-29 20:24:48
1、建立 NEW_CHAR_ITEM存储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 BIRTH_ITEM where class=@class) where struserid=@account
end
GO
ctgwglzc
发表于 2012-5-29 20:25:33
2、导入数据表
点击进入下载-BIRTH_ITEM.7z
3、CREATE_NEW_CHAR存储中IF @@ERROR <> 0
BEGIN
ROLLBACK TRAN
SET @nRet =4
RETURN
END上一行,加入 exec NEW_CHAR_ITEM @CharID
雪皓松松
发表于 2012-5-29 22:24:39
{:1_209:}CT放出来了,楼主你就把这EVT分享了吧.好吗。
feifeixia
发表于 2012-5-29 22:37:38
这个 真的号复杂。。
duepbbmal336
发表于 2012-5-30 19:31:41
本帖最后由 duepbbmal336 于 2012-5-30 19:58 编辑
雪皓松松 发表于 2012-5-29 22:24 static/image/common/back.gif
CT放出来了,楼主你就把这EVT分享了吧.好吗。
CREATE PROCEDURE CREATE_NEW_CHAR
@nRet smallint OUTPUT,
@AccountID char(21),
@index tinyint,
@CharID char(21),
@Race tinyint,
@Class smallint,
@Hair tinyint,
@Face tinyint,
@Str tinyint,
@Sta tinyint,
@Dex tinyint,
@Intel tinyint,
@Cha tinyint
AS
DECLARE @Row tinyint, @Nation tinyint, @Zone tinyint, @PosX int, @PosZ int
SET @Row = 0 SET @Nation = 0SET @Zone = 0SET @PosX = 0 SET @PosZ = 0
SELECT @Nation = bNation, @Row = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
IF @Row >= 1 SET @nRet =1
IF @Nation = 1 AND @Race > 10 SET @nRet = 2
ELSE IF @Nation = 2 AND @Race < 10 SET @nRet = 2
ELSE IF @Nation <>1 AND @Nation <> 2 SET @nRet = 2
IF @nRet > 0
RETURN
SELECT @Row = COUNT(*) FROM USERDATA WHERE strUserId = @CharID
IF @Row > 0
BEGIN
SET @nRet =1
RETURN
END
--SET @Zone = @Nation
SET @Zone=21
SELECT @PosX = InitX, @PosZ = InitZFROM ZONE_INFO WHERE ZoneNo = @Zone
BEGIN TRAN
IF @index = 0
UPDATE ACCOUNT_CHAR SET strCharID1 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
ELSE
BEGIN
ROLLBACK TRAN
SET @nRet=4
RETURN
END
--IF @index = 1
--UPDATE ACCOUNT_CHAR SET strCharID2 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
--ELSE IF @index = 2
--UPDATE ACCOUNT_CHAR SET strCharID3 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
--ELSE IF @index = 3
--UPDATE ACCOUNT_CHAR SET strCharID4 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
--ELSE IF @index = 4
--UPDATE ACCOUNT_CHAR SET strCharID5 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
INSERT INTO USERDATA (strUserId, Nation, Race, Class, HairColor, Face, Strong, Sta, Dex, Intel, Cha, Zone, PX, PZ )
VALUES (@CharID, @Nation, @Race, @Class, @Hair, @Face, @Str, @Sta, @Dex, @Intel, @Cha, @Zone, @PosX, @PosZ)
IF @@ERROR <> 0
BEGIN
ROLLBACK TRAN
SET @nRet =4
RETURN
END
exec NEW_CHAR_ITEM @CharID
COMMIT TRAN
SET @nRet =0
GO
按这样也没有出生装备无语了啊
jianweis
发表于 2012-5-30 20:36:46
回复一下
music852
发表于 2012-6-20 04:13:41
非常感謝一個爆炸
JYMETIN
发表于 2012-6-24 21:49:35
看看?
evaydd
发表于 2012-7-30 18:56:34
好东西,收下了!!!
Rayman
发表于 2012-8-4 15:14:29
本帖最后由 Rayman 于 2012-8-4 15:16 编辑
看过此贴,有感,是而发一段好多人都想要的存储。
CREATE PROCEDURE CREATE_NEW_CHAR
@nRet smallint OUTPUT,
@AccountID char(21),
@index tinyint,
@CharID char(21),
@Race tinyint,
@Class smallint,
@Hair tinyint,
@Face tinyint,
@Str tinyint,
@Sta tinyint,
@Dex tinyint,
@Intel tinyint,
@Cha tinyint
AS
DECLARE @Row tinyint, @Nation tinyint, @Zone tinyint, @PosX int, @PosZ int
SET @Row = 0 SET @Nation = 0SET @Zone = 0SET @PosX = 0 SET @PosZ = 0
SELECT @Nation = bNation, @Row = bCharNum FROM ACCOUNT_CHAR WHERE strAccountID = @AccountID
--只准建三个人
IF @Row >=3 SET @nRet =1
IF @Nation = 1 AND @Race > 10 SET @nRet = 2
ELSE IF @Nation = 2 AND @Race < 10 SET @nRet = 2
ELSE IF @Nation <>1 AND @Nation <> 2 SET @nRet = 2
IF @nRet > 0
RETURN
SELECT @Row = COUNT(*) FROM USERDATA WHERE strUserId = @CharID
IF @Row > 0
BEGIN
SET @nRet =3
RETURN
END
--SET @Zone = @Nation
SET @Zone=21
SELECT @PosX = InitX, @PosZ = InitZFROM ZONE_INFO WHERE ZoneNo = @Zone
BEGIN TRAN
IF @index = 0--中间的
UPDATE ACCOUNT_CHAR SET strCharID1 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
ELSE IF @index = 1--左边的
UPDATE ACCOUNT_CHAR SET strCharID2 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
ELSE IF @index = 2 --右边的
UPDATE ACCOUNT_CHAR SET strCharID3 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
--ELSE IF @index = 3 --sohu未开放的
-- UPDATE ACCOUNT_CHAR SET strCharID4 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
--ELSE IF @index = 4 --sohu未开放的
--UPDATE ACCOUNT_CHAR SET strCharID5 = @CharID, bCharNum = bCharNum + 1 WHERE strAccountID = @AccountID
--如果是中间的,则给80级,否则给1级
IF @index=0
INSERT INTO USERDATA (strUserId,strAccountID, Nation, Race, Class, HairColor, Face, Strong, Sta, Dex, Intel, Cha, Zone, PX, PZ ,loyalty,exp,level,gold,points,strsKill)VALUES(@CharID,@AccountID, @Nation, @Race, @Class, @Hair, @Face, @Str, @Sta, @Dex, @Intel, @Cha, @Zone, @PosX, @PosZ,100,1000000000,80,500000,277,0x8E000000000000000000)
ELSE
INSERT INTO USERDATA (strUserId,strAccountID, Nation, Race, Class, HairColor, Face, Strong, Sta, Dex, Intel, Cha, Zone, PX, PZ ,loyalty,exp,gold)VALUES(@CharID,@AccountID, @Nation, @Race, @Class, @Hair, @Face, @Str, @Sta, @Dex, @Intel, @Cha, @Zone, @PosX, @PosZ,100,1000000000,500000)
------------------------------------------------------------------------------------------------------------------------------------------
--开始发放新手装备
IF @index=0 --如果是80级的号,给80的装备,否则让其自己打
BEGIN
DECLARE @strItem char(400)
IF @Class=101 or @Class=201 or @Class=106 or @Class=206
BEGIN
select @strItem=strItem from userdata where struserid='warrior'
update userdata set strItem=@strItem where struserid=@CharID
END
IF @Class=102 or @Class=202 or @Class=108 or @Class=208
BEGIN
select @strItem=strItem from userdata where struserid='roger'
update userdata set strItem=@strItem where struserid=@CharID
END
IF @Class=103 or @Class=203 or @Class=110 or @Class=210
BEGIN
select @strItem=strItem from userdata where struserid='mace'
update userdata set strItem=@strItem where struserid=@CharID
END
IF @Class=104 or @Class=204 or @Class=112 or @Class=212
BEGIN
select @strItem=strItem from userdata where struserid='premist'
update userdata set strItem=@strItem where struserid=@CharID
END
END
------------------------------------------------------------------------------------------------------------------------------------------
IF @@ERROR <> 0
BEGIN
ROLLBACK TRAN
SET @nRet =4
RETURN
END
COMMIT TRAN
SET @nRet =0
GO
存储说明:
这个存储是允许建三个人物,中间的为80级(技能和能力点给到位了),两边的就默认1级,上线后复制初始人物装备。装备来源为四个初始号,分别是warriror,roger,mace,premist。
此存储比CT发的要精简,无需再新建一个存储为实现所需功能。操作也灵活,只需更改四个初始号上的装备即可。
后记:
其实懂存储的人一看就知道是小儿科了,只有想不到,没有做不到,深入技术才是根本,怎么抄都没用的。网上下的再好的端也是个废品,因为好的东西是高手不断完善来才得来的,真正好的东西,很难在网上下载的到。也由此B4一下那些成天害人的垃圾,比如以前的什么招牌、788等。我想说的是:有本事的人一般不会倒处招摇。