NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

USE [SRO_VT_SHARD]
GO
/****** Object: StoredProcedure [dbo].[_UPDATE_COST] Script Date: 8.11.2021 02:43:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- vsrodestek.com

ALTER PROCEDURE [dbo].[_UPDATE_COST]
@Operation tinyint,
@CharID int,
@PaymentDevice int,
@PackageItemCodeName varchar(129),
@RemainGold bigint,
@OwnSilkToPay int,
@GiftSilkToPay int,
@OffsetOptionalPoint int,
@MileageToPay int
AS

SET NOCOUNT ON

declare @PaymentDeviceTemp int
declare @RemainOwnSilk int
declare @RemainGiftSilk int
declare @RemainMileage int
declare @Result int

set @RemainOwnSilk = 0
set @RemainGiftSilk = 0
set @RemainMileage = 0

IF (@RemainGold < 0 or @MileageToPay < 0 or @OwnSilkToPay < 0 or @GiftSilkToPay < 0 or @OffsetOptionalPoint < 0)
BEGIN
RETURN -2001
END

DECLARE @PC_ID INT
set @PC_ID = @CharID

if (@Operation = 19)
begin
-- COS ¿ë ¹°Ç°À» ±¸ÀÔÇѰŴϱñ... ij¸¯ ã¾Æ¼ µ· »©Áà¾ßÁö...
SELECT @PC_ID = OwnerCharID FROM _CharCOS WHERE ID = @PC_ID
IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
BEGIN
RETURN -2002
END
end


if ((@PaymentDevice & (2 | 4 | 16 )) > 0)
begin

declare @JID int
select top 1 @JID = UserJID from _User
where CharID = @PC_ID
IF (@@ROWCOUNT = 0 OR @@ERROR <> 0)
BEGIN
RETURN -2006
END

DECLARE @PackageItemID int
select @PackageItemID = ID from dbo._RefPackageItem where codename128 = @PackageItemCodeName

DECLARE @rvalue int

EXEC @rvalue = SRO_VT_ACCOUNT.DBO._ConsumeSilkByGameServer @JID, @OwnSilkToPay OUTPUT, @GiftSilkToPay OUTPUT, @MileageToPay output, 0, @CharID, @PackageItemID , 0

IF (@rvalue < 0 OR @@ERROR <> 0)
BEGIN
RETURN -2012
END

insert into _ResultOfPackageItemToMappingWithServerSide
values (@Operation, @CharID, 255, @OwnSilkToPay, 2, 0, 1, 0)

if (@@ERROR <> 0 or @@ROWCOUNT = 0)
begin
return -2007
end

insert into _ResultOfPackageItemToMappingWithServerSide
values (@Operation, @CharID, 254,@GiftSilkToPay, 4, 0, 1, 0)

if (@@ERROR <> 0 or @@ROWCOUNT = 0)
begin
return -2007
end

insert into _ResultOfPackageItemToMappingWithServerSide
values (@Operation, @CharID, 253,@MileageToPay, 16, 0, 1, 0)


----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------

if (@@ERROR <> 0 or @@ROWCOUNT = 0)
begin
return -2007
end
end

-- gold
if ((@PaymentDevice & 1) > 0)
begin
UPDATE _Char SET RemainGold = @RemainGold WHERE CharID = @PC_ID
IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
BEGIN
RETURN -2003
END
end

-- guildpoint
if ((@PaymentDevice & 8) > 0)
BEGIN
-- ±æµå¸¦ ¾Ë¾Æ¿Í¶ó.
declare @GuildID int
select @GuildID = GuildID from _GuildMember
where CharID = @PC_ID

IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
BEGIN
RETURN -2004
END

-- ±æµå Æ÷ÀÎÆ® ±î¶ó.
update _Guild set GatheredSP = GatheredSP - @OffsetOptionalPoint
where GatheredSP >= @OffsetOptionalPoint and ID = @GuildID

IF (@@ERROR <> 0 OR @@ROWCOUNT = 0)
BEGIN

RETURN -2005
END

insert into _ResultOfPackageItemToMappingWithServerSide
values (@Operation, @CharID, 252, @OffsetOptionalPoint, 8, 0, 1, 0)


----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------

if (@@ERROR <> 0 or @@ROWCOUNT = 0)
begin
return -2007
end
end

-- honorpoint
else if ((@PaymentDevice & 32) > 0)
begin
-- honorpoint ±î¶ó.
update _TrainingCampMember set HonorPoint = HonorPoint - @OffsetOptionalPoint
where HonorPoint >= @OffsetOptionalPoint and CharID = @PC_ID

if (@@ERROR <> 0 or @@ROWCOUNT = 0)
begin
return -2006
end

insert into _ResultOfPackageItemToMappingWithServerSide
values (@Operation, @CharID, 252, @OffsetOptionalPoint, 32, 0, 1, 0)


----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------

if (@@ERROR <> 0 or @@ROWCOUNT = 0)
begin
return -2007
end
end

SET NOCOUNT OFF


return 1

     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.