|
改进了的生化培养存储过程
- CREATE PROCEDURE RMS_DOITEMGROWTH
- @GameID varchar(14),
- @WindowKind int,
- @WindowIndex int,
- @ItemKind int,
- @ItemIndex int,
- @AttackGrade int,
- @StrengthGrade int,
- @SpiritGrade int,
- @DexterityGrade int,
- @PowerGrade int,
- @NextItemKind int,
- @NextItemIndex int,
- @NextAttackGrade int,
- @NextStrengthGrade int,
- @NextSpiritGrade int,
- @NextDexterityGrade int,
- @NextPowerGrade int
- AS
- set nocount on
- begin transaction
- DECLARE @NextLevel real
- DECLARE @ItemID int
- SET @ItemID= 0
- SET @NextLevel= @NextAttackGrade+@NextStrengthGrade+@NextSpiritGrade+@NextDexterityGrade+@NextPowerGrade
-
- SELECT TOP 1 @ItemID=ID FROM tblSpecialItem1 WHERE GameID=@GameID AND WindowKind=@WindowKind AND WindowIndex=@WindowIndex AND
- ItemKind=@ItemKind AND ItemIndex=@ItemIndex AND AttackGrade=@AttackGrade AND StrengthGrade=@StrengthGrade AND SpiritGrade=@SpiritGrade AND DexterityGrade=@DexterityGrade AND PowerGrade=@PowerGrade AND Position=1
- IF @ItemID > 0
- BEGIN
- IF (@NextLevel/20=Round(@NextLevel/20,0,1)) AND (@NextAttackGrade<4)
- BEGIN
- UPDATE tblSpecialItem1 SET ItemKind=@NextItemKind,ItemIndex=@NextItemIndex+20,AttackGrade=@AttackGrade+1 WHERE ID=@ItemID
- END
- ELSE
- BEGIN
- UPDATE tblSpecialItem1 SET ItemKind=@NextItemKind,ItemIndex=@NextItemIndex,AttackGrade=@NextAttackGrade,StrengthGrade=@NextStrengthGrade,SpiritGrade=@NextSpiritGrade,DexterityGrade=@NextDexterityGrade,PowerGrade=@NextPowerGrade WHERE ID=@ItemID
- END
- END
- commit transaction
- GO
复制代码
为了替换现有存储过程,请按照以下步骤操作: - 登录到企业管理器。
- 在REDMOON数据库中找到"存储过程"目录(注意不是"表"的目录)。
- 定位到存储过程RMS_DOITEMGROWTH。
- 右键点击并选择“属性”。
- 将存储过程的内容替换为新的代码。具体步骤是复制楼主提供的新存储过程代码,替换原有内容。
关于升级机制的调整: 在存储过程中,有一部分代码如下: - BEGIN
- IF (@NextLevel/20=Round(@NextLevel/20,0,1)) AND (@NextAttackGrade<4)
复制代码里的20是说升到20次一定改。改成10就是每10次一定改,至于改成1我就没试了,我改成10在我自己的单机上就升了N多生化才一身P的
|
|