/****** Object: Stored Procedure dbo.RMS_LEVEL1000MAIL Script Date: 2004-5-13 11:21:09 ******/
CREATE PROCEDURE RMS_LEVEL1000MAIL
@gameid varchar(14),
@time datetime
AS
set nocount on
declare @mailcount int, @InsertMailError int, @InsertTickError int , @level int , @face int,@WindowKind int,@WindowIndex int,@permission int
set @MailCount = 0
set @InsertMailError = 1
set @InsertTickError = 1
begin transaction
select @MailCount = count(*) from tblMail1 where Recipient = @GameID and Time = @Time
while @MailCount > 0
begin
set @MailCount = 0
set @Time = dateadd(second, 1, @Time)
select @MailCount = count(*) from tblMail1 where Recipient = @GameID and Time = @Time
end
insert tblMail1 (Time, Recipient, Sender, ReadOrNot, Title, Line, Content, Item) values(@Time, @GameID, '[永年红月]', 0, '千级奖励', 20, '感谢您对永年红月的支持', '')
select @InsertMailError = @@ERROR
select @Level=lvl from tblGameID1 where @GameID=GameID
begin
begin
select @face=face from tblGameID1 where @GameID=GameID
if @face=0
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 187, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=1
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 188, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=2
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 190, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=3
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 190, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=4
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 192, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=5
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 194, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=6
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 191, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=7
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 190, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=8
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 193, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
end
end
select @InsertTickError = @@ERROR
If @InsertMailError = 0 and @InsertTickError = 0
begin
commit transaction
end
else
begin
rollback transaction
end
GO
-
CREATE PROCEDURE RMS_LEVEL1000MAIL
@gameid varchar(14),
@time datetime
AS
set nocount on
declare @mailcount int, @InsertMailError int, @InsertTickError int , @level int , @face int,@WindowKind int,@WindowIndex int,@permission int
set @MailCount = 0
set @InsertMailError = 1
set @InsertTickError = 1
begin transaction
select @MailCount = count(*) from tblMail1 where Recipient = @GameID and Time = @Time
while @MailCount > 0
begin
set @MailCount = 0
set @Time = dateadd(second, 1, @Time)
select @MailCount = count(*) from tblMail1 where Recipient = @GameID and Time = @Time
end
insert tblMail1 (Time, Recipient, Sender, ReadOrNot, Title, Line, Content, Item) values(@Time, @GameID, '[永年红月]', 0, '千级奖励', 20, '感谢您对永年红月的支持', '')
select @InsertMailError = @@ERROR
select @Level=lvl from tblGameID1 where @GameID=GameID
begin
begin
select @face=face from tblGameID1 where @GameID=GameID
if @face=0
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 187, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=1
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 188, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=2
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 190, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=3
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 190, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=4
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 192, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=5
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 194, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=6
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 191, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=7
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 190, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
if @face=8
insert tblSpecialItem1 (ItemKind, ItemIndex, ItemDurability, Position, Map, X, Y, TileKind, GameID, WindowKind, WindowIndex, MiscTime, AttackGrade, StrengthGrade, SpiritGrade, DexterityGrade, PowerGrade) values (6, 193, 4, 2, 1, 100, 100, 1, @GameID, 100, 0, @Time, 4,10,10,10,35)
end
end
select @InsertTickError = @@ERROR
If @InsertMailError = 0 and @InsertTickError = 0
begin
commit transaction
end
else
begin
rollback transaction
end
GO
-