[help] how to set revive 10gc for pre , and 25gc for normal

Results 1 to 3 of 3
  1. #1
    Newbie JRjz IMba is offline
    MemberRank
    Sep 2014 Join Date
    4Posts

    [help] how to set revive 10gc for pre , and 25gc for normal

    [help] how to set revive 10gc for pre , and 25gc for normal

    help me pls

    Code:
    -- ----------------------------
    -- Procedure structure for [WZ_CharRevive]
    -- ----------------------------
    
    
    ALTER PROCEDURE [dbo].[WZ_CharRevive]
    	@in_CustomerID int,
    	@in_CharID int,
    	@in_Health int
    AS
    BEGIN
    	SET NOCOUNT ON;
    	
    	--------------------------------------------------------------------
    	-- validate CharID/CustomerID pair
    	--------------------------------------------------------------------
    	declare  @CustomerID int = 0
    	select  @CustomerID=CustomerID from UsersChars where CharID=@in_CharID
    	if(@@ROWCOUNT = 0 or  @CustomerID <> @in_CustomerID) begin
    		select 6 as ResultCode, 'bad charid' as ResultMsg
    		return
    	end
    	
    	--------------------------------------------------------------------
    	-- get developer flag
    	--------------------------------------------------------------------
    	declare @IsDeveloper int = 0
    	select @IsDeveloper=IsDeveloper from UsersData where CustomerID=@in_CustomerID
    
    
    	--------------------------------------------------------------------
    	-- note that revive timer is 1hrs, change in WZ_GetAccountInfo1 as well
    	--------------------------------------------------------------------
    	declare  @sectorevive int
    	declare  @alive int = 0
    
    
    
    
    	--------------------------------------------------------------------
    	--- Check for Premium Account
    	--- If Premium then SecToRevive is 15 mins.
    	--- If Normal then SecToRevive is 30 mins.
    	--------------------------------------------------------------------
    	DECLARE  @iSPRemium int = 0
    	SELECT  @iSPRemium=isPremium FROM UsersData WHERE CustomerID=@in_CustomerID
    
    
    	IF   @iSPRemium = 1) BEGIN
    		SELECT 
    		  @sectorevive=DATEDIFF (second, GETUTCDATE (), DATEADD (second, 960, DeathUtcTime)),
    		  @alive=Alive
    		FROM UsersChars WHERE CharID=@in_CharID
    	END
    	ELSE
    	BEGIN
    		SELECT 
    		  @sectorevive=DATEDIFF (second, GETUTCDATE (), DATEADD (second, 1820, DeathUtcTime)),
    		  @alive=Alive
    		FROM UsersChars WHERE CharID=@in_CharID
    	END
    
    
    	--------------------------------------------------------------------
    	-- prevent fast teleporting if we're not dead
    	--------------------------------------------------------------------
    	IF  @alive <> 0) BEGIN
    		select 6 as ResultCode, 'character is not dead' as ResultMsg
    		RETURN
    	END
    	
    	-- do not allow early revive, give 2min grace
    	--if  @sectorevive > 120 and @IsDeveloper = 0) begin
    	--	select 6 as ResultCode, 'too early' as ResultMsg
    	--	return
    	--end
    	
    	--------------------------------------------------------------------
    	-- Revive Char Early
    	--------------------------------------------------------------------
    	IF  @sectorevive > 20) BEGIN
    	
    		-- Check RevivePoint
    		DECLARE  @RevivePoint int = 0
    		SELECT  @RevivePoint=Point FROM Application_Revive WHERE CustomerID = @in_CustomerID
    		
    		
    		if  @RevivePoint > 0
    		begin
    			-- Use RevivePoint
    			UPDATE Application_Revive SET Point=Point-1 WHERE CustomerID = @in_CustomerID
    		end
    		
    		-- Normal GC
    		else
    		begin
    			-- get points for that customer
    			declare  @GamePoints int
    			declare  @RevivePrice int
    			set  @RevivePrice = 25
    			SELECT  @GamePoints=GamePoints FROM UsersData WHERE CustomerID=@in_CustomerID
    			if (@@RowCount = 0) begin
    				select 6 as ResultCode, 'no CustomerID' as ResultMsg
    				return
    			end
    			
    			-- check if enough money
    			if  @GamePoints <  @RevivePrice) begin
    				select 6 as ResultCode, 'Not Enough GC' as ResultMsg
    				return
    			end
    			
    			-- perform actual transaction
    			set  @GamePoints =  @GamePoints  @RevivePrice;
    			UPDATE UsersData SET GamePoints  @GamePoints where CustomerID=@in_CustomerID
    			
    			-- update transaction detail
          declare @bl float = 0
          SELECT @bl=GamePoints FROM UsersData WHERE CustomerID=@in_CustomerID
    			INSERT INTO FinancialTransactions
    			VALUES (@in_CustomerID, 'EarlyRevive', 2002, GETDATE(), 
    					25, '1', 'APPROVED', 0,@bl)
    		end
    	END
    	
    	--------------------------------------------------------------------
    	-- revive
    	--------------------------------------------------------------------
    	update UsersChars set
    		Alive=2,
    		Health=@in_Health, -- AomBESkillSystem : Health value from api.
    		Food=0,
    		Water=0,
    		Toxic=0,
    		GameFlags=1,
    		legfall=0,
    		bleeding=0
    	where CharID=@in_CharID
    
    
    	select 0 as ResultCode
    END
    Last edited by GigaToni; 18-10-14 at 11:02 PM. Reason: Next time use code tags!


  2. #2
    Yuri-BR#1559 Yuri-BR is offline
    DeveloperRank
    Apr 2013 Join Date
    ☣️❤️Location
    1,039Posts

    Re: [help] how to set revive 10gc for pre , and 25gc for normal

    try set it to normal player :)

    Code:
    if(@accountType = 2) begin -- Normal
        set  @RevivePrice = 25
    end
    - - - Updated - - -

    perhaps will also need to set in the source

  3. #3
    Newbie takaida is offline
    MemberRank
    Jun 2006 Join Date
    17Posts

    Re: [help] how to set revive 10gc for pre , and 25gc for normal

    Quote Originally Posted by Yuri-BR View Post
    try set it to normal player :)

    Code:
    if(@accountType = 2) begin -- Normal
        set    @RevivePrice = 25
    end
    - - - Updated - - -

    perhaps will also need to set in the source
    Help me !!

    for Premium ??

    Code:
    -- ----------------------------
    -- Procedure structure for [WZ_CharRevive]
    -- ----------------------------
    
    ALTER PROCEDURE [dbo].[WZ_CharRevive]
    	@in_CustomerID int,
    	@in_CharID int,
    	@in_Health int
    AS
    BEGIN
    	SET NOCOUNT ON;
    	
    	--------------------------------------------------------------------
    	-- validate CharID/CustomerID pair
    	--------------------------------------------------------------------
    	declare  @CustomerID int = 0
    	select  @CustomerID=CustomerID from UsersChars where CharID=@in_CharID
    	if(@@ROWCOUNT = 0 or  @CustomerID <> @in_CustomerID) begin
    		select 6 as ResultCode, 'bad charid' as ResultMsg
    		return
    	end
    	
    	--------------------------------------------------------------------
    	-- get developer flag
    	--------------------------------------------------------------------
    	declare @IsDeveloper int = 0
    	select @IsDeveloper=IsDeveloper from UsersData where CustomerID=@in_CustomerID
    
    	--------------------------------------------------------------------
    	-- note that revive timer is 1hrs, change in WZ_GetAccountInfo1 as well
    	--------------------------------------------------------------------
    	declare  @sectorevive int
    	declare  @alive int = 0
    
    
    	--------------------------------------------------------------------
    	--- Check for Premium Account
    	--- If Premium then SecToRevive is 15 mins.
    	--- If Normal then SecToRevive is 30 mins.
    	--------------------------------------------------------------------
    	DECLARE  @iSPRemium int = 0
    	SELECT  @iSPRemium=isPremium FROM UsersData WHERE CustomerID=@in_CustomerID
    
    	IF   @iSPRemium = 1) BEGIN
    		SELECT 
    		  @sectorevive=DATEDIFF (second, GETUTCDATE (), DATEADD (second, 320, DeathUtcTime)),
    		  @alive=Alive
    		FROM UsersChars WHERE CharID=@in_CharID
    	END
    	ELSE
    	BEGIN
    		SELECT 
    		  @sectorevive=DATEDIFF (second, GETUTCDATE (), DATEADD (second, 920, DeathUtcTime)),
    		  @alive=Alive
    		FROM UsersChars WHERE CharID=@in_CharID
    	END
    
    	--------------------------------------------------------------------
    	-- prevent fast teleporting if we're not dead
    	--------------------------------------------------------------------
    	IF  @alive <> 0) BEGIN
    		select 6 as ResultCode, 'character is not dead' as ResultMsg
    		RETURN
    	END
    	
    	-- do not allow early revive, give 2min grace
    	--if  @sectorevive > 120 and @IsDeveloper = 0) begin
    	--	select 6 as ResultCode, 'too early' as ResultMsg
    	--	return
    	--end
    	
    	--------------------------------------------------------------------
    	-- Revive Char Early
    	--------------------------------------------------------------------
    	IF  @sectorevive > 20) BEGIN
    	
    		-- Check RevivePoint
    		DECLARE  @RevivePoint int = 0
    		SELECT  @RevivePoint=Point FROM Application_Revive WHERE CustomerID = @in_CustomerID
    		
    		
    		if  @RevivePoint > 0
    		begin
    			-- Use RevivePoint
    			UPDATE Application_Revive SET Point=Point-1 WHERE CustomerID = @in_CustomerID
    		end
    	
    		-- Normal GC
    		else
    		begin
    			-- get points for that customer
    			declare  @GamePoints int
    			declare  @RevivePrice int
    			set  @RevivePrice = 25
    			SELECT  @GamePoints=GamePoints FROM UsersData WHERE CustomerID=@in_CustomerID
    			if (@@RowCount = 0) begin
    				select 6 as ResultCode, 'no CustomerID' as ResultMsg
    				return
    			end
    			
    			-- check if enough money
    			if  @GamePoints <  @RevivePrice) begin
    				select 6 as ResultCode, 'Not Enough GC' as ResultMsg
    				return
    			end
    			
    			-- perform actual transaction
    			set  @GamePoints =  @GamePoints  @RevivePrice;
    			UPDATE UsersData SET GamePoints  @GamePoints where CustomerID=@in_CustomerID
    			
    			-- update transaction detail
          declare @bl float = 0
          SELECT @bl=GamePoints FROM UsersData WHERE CustomerID=@in_CustomerID
    			INSERT INTO FinancialTransactions
    			VALUES (@in_CustomerID, 'EarlyRevive', 2002, GETDATE(), 
    					25, '1', 'APPROVED', 0,@bl)
    		end
    	END
    	
    	--------------------------------------------------------------------
    	-- revive
    	--------------------------------------------------------------------
    	update UsersChars set
    		Alive=2,
    		Health=@in_Health, -- AomBESkillSystem : Health value from api.
    		Food=0,
    		Water=0,
    		Toxic=0,
    		GameFlags=1,
    		legfall=0,
    		bleeding=0
    	where CharID=@in_CharID
    
    	select 0 as ResultCode
    END
    ---------------- for me No !! Premium Account
    Last edited by GigaToni; 18-10-14 at 11:01 PM.



Advertisement