PKC死亡不化特石头存储代码
红月技术吧
全部回复
仅看楼主
level 7
gggyniiw 楼主
CREATE PROCEDURE RMS_DECREASESPECIALITEMDURABILITY
@ItemKind int,
@ItemIndex int,
@ItemDurability int,
@ItemAttackGrade int,
@ItemStrengthGrade int,
@ItemSpiritGrade int,
@ItemDexterityGrade int,
@ItemPowerGrade int,
@Position int,
@GameID varchar(14),
@WindowKind int,
@WindowIndex int
AS
set nocount on
declare @DecreaseDurability int
declare @iMapID int
select @iMapID=Map From tblGameID1 Where GameID=@GameID
if (@iMapID=35 OR @iMapID=69 OR @iMapID=70) return
set @DecreaseDurability = 0
begin transaction
if @ItemDurability >= 4
begin
if (datepart(ms, getdate()) / 10) < 50
begin
set @DecreaseDurability = 1
end
end
else
begin
if @ItemDurability = 3
begin
if (datepart(ms, getdate()) / 10) < 40
begin
set @DecreaseDurability = 1
end
end
else
begin
if @ItemDurability = 2
begin
if (datepart(ms, getdate()) / 10) < 30
begin
set @DecreaseDurability = 1
end
end
else
begin
if @ItemDurability = 1
begin
if (datepart(ms, getdate()) / 10) < 20
begin
set @DecreaseDurability = 1
end
end
else
begin
if @ItemDurability = 0
begin
if (datepart(ms, getdate()) / 10) < 10
begin
set @DecreaseDurability = 1
end
end
else
begin
if (datepart(ms, getdate()) / 10) < 50
begin
delete tblSpecialItem1 where ID in (select top 1 ID from tblSpecialItem1 where ItemKind = @ItemKind and ItemIndex = @ItemIndex and ItemDurability = @ItemDurability and AttackGrade = @ItemAttackGrade and StrengthGrade = @ItemStrengthGrade and SpiritGrade = @ItemSpiritGrade and DexterityGrade = @ItemDexterityGrade and PowerGrade = @ItemPowerGrade and Position = @Position and GameID = @GameID and WindowKind = @WindowKind and WindowIndex = @WindowIndex)
-- if @@ROWCOUNT > 0
-- begin
insert tblSpecialItemLog1 (LogKind, ItemKind, ItemIndex, ItemDurability, Position, GameID, WindowKind, WindowIndex, LogItemCount,AttackGrade,StrengthGrade,SpiritGrade,DexterityGrade,PowerGrade) values (103, @ItemKind, @ItemIndex, @ItemDurability, @Position, @GameID, @WindowKind, @WindowIndex, @@ROWCOUNT,@ItemAttackGrade,@ItemStrengthGrade,@ItemSpiritGrade,@ItemDexterityGrade,@ItemPowerGrade)
-- end
end
end
end
end
end
end
if @DecreaseDurability = 1
begin
update tblSpecialItem1 set ItemDurability = ItemDurability - 1 where ID in (select top 1 ID from tblSpecialItem1 where ItemKind = @ItemKind and ItemIndex = @ItemIndex and ItemDurability = @ItemDurability and AttackGrade = @ItemAttackGrade and StrengthGrade = @ItemStrengthGrade and SpiritGrade = @ItemSpiritGrade and DexterityGrade = @ItemDexterityGrade and PowerGrade = @ItemPowerGrade and Position = @Position and GameID = @GameID and WindowKind = @WindowKind and WindowIndex = @WindowIndex)
end
commit transaction
GO
- 本文出自红月吧 - 中国最大的红月技术网,原文地址:http://rm.redmoon8.com/forum.php?mod=viewthread&tid=55
2014年07月31日 08点07分 1
1