Game


You are not connected. Please login or register

Fix Strengthen item

Go down  Message [Page 1 of 1]

1Fix Strengthen item Empty Fix Strengthen item Fri Feb 07, 2014 6:26 pm

Fenix

Fenix
Game Master
Game Master
edit database
use 2 query



Code:
USE [db_tank]
GO

/****** Object:  StoredProcedure [dbo].[SP_Users_Items_Update]    Script Date: 12/19/2012 12:45:00 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SP_Users_Items_Update]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[SP_Users_Items_Update]
GO

USE [db_tank]
GO

/****** Object:  StoredProcedure [dbo].[SP_Users_Items_Update]    Script Date: 12/19/2012 12:45:00 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO




-- =============================================
-- Author:      <Ken>
-- ALTER  date: <2009-10-22>
-- Description:   <用户信息:更新人物物品信息>
-- =============================================
CREATE  PROCEDURE [dbo].[SP_Users_Items_Update] 
  @ItemID int,
 @UserID int,
 @TemplateID int,
 @Place int,
 @Count int,
 @IsJudge bit,
 @Color nvarchar(100),
 @IsExist bit,
 @StrengthenLevel int,
 @AttackCompose int,
 @DefendCompose int,
 @LuckCompose int,
 @AgilityCompose int,
 @IsBinds bit,
 @BeginDate DateTime,
 @ValidDate int,
 @BagType int,
 @Skin nvarchar(50),
 @IsUsed bit,
 @RemoveDate datetime,
 @RemoveType int,
 @Hole1 int,
 @Hole2 int,
 @Hole3 int,
 @Hole4 int,
 @Hole5 int,
 @Hole6 int,
 @StrengthenTimes int,
 @Hole5Level int,
 @Hole5Exp int,
 @Hole6Level int,
 @Hole6Exp int,
 @IsGold bit,
 @StrengthenExp int
 AS   
  begin
   /*if @Place>-1
   begin
      update Sys_Users_Goods set Place=-2 where UserID=@UserID and BagType=@BagType and Place=@Place and IsExist=1
   end*/

    UPDATE Sys_Users_Goods Set UserID=@UserID,BagType=@BagType, TemplateID=@TemplateID, Place=@Place, Count=@Count, IsJudge=@IsJudge, Color=@Color, IsExist=@IsExist, StrengthenLevel=@StrengthenLevel, AttackCompose=@AttackCompose, DefendCompose=@DefendCompose, LuckCompose=@LuckCompose, AgilityCompose=@AgilityCompose, IsBinds=@IsBinds, BeginDate=@BeginDate, ValidDate=@ValidDate,Skin=@Skin,IsUsed=@IsUsed,RemoveDate=@RemoveDate,RemoveType=@RemoveType,Hole1=@Hole1,Hole2=@Hole2,Hole3=@Hole3,Hole4=@Hole4,Hole5=@Hole5,Hole6=@Hole6,StrengthenTimes=@StrengthenTimes,Hole5Level=@Hole5Level,Hole5Exp=@Hole5Exp,Hole6Level=@Hole6Level,Hole6Exp=@Hole6Exp,IsGold=@IsGold,strengthenexp=@StrengthenExp WHERE ItemID =@ItemID


  end

GO






Code:
USE [db_tank]
GO

/****** Object:  StoredProcedure [dbo].[SP_Users_Items_Add]    Script Date: 12/19/2012 12:44:49 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SP_Users_Items_Add]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[SP_Users_Items_Add]
GO

USE [db_tank]
GO

/****** Object:  StoredProcedure [dbo].[SP_Users_Items_Add]    Script Date: 12/19/2012 12:44:49 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO




-- =============================================
-- Author:      <Ken>
-- ALTER  date: <2009-10-22>
-- Description:   <用户信息:用户新增一个物品>
-- =============================================
CREATE  PROCEDURE [dbo].[SP_Users_Items_Add] 
  @ItemID int output,
 @UserID int,
 @TemplateID int,
 @Place int,
 @Count int,
 @IsJudge bit,
 @Color nvarchar(100),
 @IsExist bit,
 @StrengthenLevel int,
 @AttackCompose int,
 @DefendCompose int,
 @LuckCompose int,
 @AgilityCompose int,
 @IsBinds bit,
 @BeginDate DateTime,
 @ValidDate int,
 @BagType int,
 @Skin nvarchar(50),
 @IsUsed bit,
 @RemoveType int,
 @Hole1 int,
 @Hole2 int,
 @Hole3 int,
 @Hole4 int,
 @Hole5 int,
 @Hole6 int,
 @StrengthenTimes int,
 @Hole5Level int,
 @Hole5Exp int,
 @Hole6Level int,
 @Hole6Exp int,
 @IsGold bit,
 @strengthenexp int
AS 
declare  @temp int
select @temp = count(*) from Sys_Users_Goods where ItemID=@ItemID
if @temp=0
 begin
   /*if @Place>-1
   begin
      update Sys_Users_Goods set Place=-2 where UserID=@UserID and BagType=@BagType and Place=@Place and IsExist=1
   end*/

    INSERT INTO Sys_Users_Goods( UserID, BagType,TemplateID, Place, Count, IsJudge, Color, IsExist, StrengthenLevel, AttackCompose, DefendCompose, LuckCompose, AgilityCompose, IsBinds, BeginDate, ValidDate,Skin,IsUsed,RemoveType,Hole1,Hole2,Hole3,Hole4,Hole5,Hole6,StrengthenTimes,Hole5Level,Hole5Exp,Hole6Level,Hole6Exp,IsGold,strengthenexp)
    VALUES( @UserID, @BagType,@TemplateID, @Place, @Count, @IsJudge, @Color, @IsExist, @StrengthenLevel, @AttackCompose, @DefendCompose, @LuckCompose, @AgilityCompose, @IsBinds, @BeginDate, @ValidDate,@Skin,@IsUsed,@RemoveType,@Hole1,@Hole2,@Hole3,@Hole4,@Hole5,@Hole6,@StrengthenTimes, @Hole5Level, @Hole5Exp, @Hole6Level, @Hole6Exp, @IsGold,@strengthenexp)
    select @@identity as 'identity'
    set @ItemID=@@identity   
 end

GO




sorry my English is bad







download here (update19/12/2012)




Thank Trminhpc

http://www.devgame.ga

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum